Flutter smart-code generation shortcut in android studio - android-studio

when I select a widget say a Text widget in android studio, I hit on alt and enter to generate a code. For example, you can wrap a widget inside a column with this combination but in my case, this combination suggests me things like : generate getter and setter or toString() method which definitely come from java. Now you might say, you have to change your key binding then but that is the problem, on keyboard shortcuts section, I see only one section where I can assign a combination. But then this happens where I only get code suggestions for java. How could I possibly change that?

Alright, so I found the solution, when you check the keyboard shortcuts, you gotta find show context actions and assign a key binding to it, then it is fixed.

Related

Make Android Studio autopop up not change constrast

In Android Studio, pressing the up an down arrows will change the contrast of the autopopup bar.
Before
After
This also occurs in the default themes. Is there anyway to make the contrast start in the after position, even without pressing any arrows?
The popup is dimmed to indicate that there is no default selection for completion. It depends on context and in some cases the first entry will be selected automatically, while in the other cases you need to select the completion varian with the arrow keys first.
To get the pre-selection work automatically in IntelliJ IDEA and Android Studio enable the Insert selected suggestion by pressing space, dot, or other context-dependent keys option:
In some other cases it may be also necessary to add
-Dide.completion.lookup.element.preselect.depends.on.context=false
in Help | Edit Custom VM Options and restart the IDE.
Related issue: https://youtrack.jetbrains.com/issue/IDEA-193090.

Is there a way to enable interactive search in properties window?

I just started to use Android Studio and wondering if there is a way to search interactively in property window.
I mean like Xcode does. (It's not a properties, though.)
Is there a plugin or configuration for the function like this?
Android Studio actually has a search tool for properties similar to the one in Xcode. But it's implemented in a very unusual and un-intuitive way. Which makes it hard to find.
In Android Studio version 1.5.1, you have to click either on the 'Properties' header or any property-name below the header, and then you need to start typing the property you want, even though there is no text-box or any other indication that your typing will produce any effect.
When you do this, then a text-box appears with the characters you've typed in. And Android Studio highlights all the properties that contain your character sequence. You can then look only at the highlighted properties to find the one you want.
There is no filter like in Xcode, but if you start typing property name the selection will jump to the first match and the rest of the matches will be highlighted.

Android studio breadcrumb method signature

I am looking for Breadcrumb functionality like Eclipse in Android Studio.
In Eclipse Breadcrumb shows "method signature" when pointer(cursor) come inside whereas in Android Studio Breadcrumb is good for nothing.
Please find attached for better insight.
The accepted answer is not correct.
The feature is still here in 2018.
It's under View -> Active Editor -> Show Breadcrums.
The breadcrums are situated south of the current editing window, not north as in Eclipse.
You can enable it via View -> Navigation Bar and check it.
But it will show breadcrumb/navigation upto class only and not upto the method signature.
As suggessted by AVEbrahimi also, ctrl+F12 will show method signature.
Seems this feature gone away.
You should use:
Ctrl+F12 OR CMD+F12
Here are two ways to see the method signature through a tool tip that hovers next to the method you have selected or put the caret on.
Press ctrl + P with the method selected.
or
Go to View > Show Parameter Info with the method selected.
I found the above solution on the second link I looked at after this one. The link was for a different IDE but the hotkey works in Android Studio.
Show Parameter Info
Also, you can go to Settings > Editor
Under "Other" check "Show quick doc on mouse move". This will show a popup tool tip with information about the method including parameter info.
Found that here:
View method information in Android Studio
Pressing Alt+Q displays the name of the current context, which is actually the method name (Context Info) quickly and easily.

Android Studio/Intellij Idea: "Table of Contents" for a class

I have been messing around with Android Studio and so far I like most of what I have seen. One thing that has been annoying me though is this lack of "Table of Contents" for a class. I apologize for not knowing exactly what to call it. But what I am referring to is the dropdown menu in eclipse that lists all the methods, interfaces, classes and so on that are in that class file. This then allows you to jump to that position. This view is when you are in "Package Explorer" and click the arrow to the left of the class. This is one thing that makes me really miss eclipse. I know that you can easily search with Ctrl+F inside a document but I often forget the method names. I tried looking through here but to no avail. Just wondering if anyone knows some way to handle this.
IDEA has a tab called "Structure", which shows all the methods, fields, etc. of the currently-open class.
I've just got a Tip of the Day popup in Android Studio helping with exactly this problem.
You can quickly navigate in the currently edited file with
Ctrl/⌘+F12 (Navigate | File Structure).
It shows the list of members of the current class. Select an element you want to navigate to and press the Enter key or the F4 key. To easily locate an item in the
list, just start typing its name.
Also, as danny117 points out, you can use Alt/⌘+7 to show / hide the same content in a side panel view (shown above in Chris Jester-Young's answer).
View > Tool Windows > Structure
In addition to what Chris Jester-Young said, it's worth pointing out how to see the methods and properties of a class pointed by the cursor.
a) Type Ctrl + H in the class pointed by cursor.
b) In the class name, in the hierarchy window, double-click the class name. The system, upon confirmation, will decompile and open the class code.
c) Alt + 7 (Windows) or Command + 7 (MAC) to display the structure window.
d) One can now visualize properties, methods, derived classes, derived interfaces, and even include inherited items. All related to the class under the caret.
I'm currently using Beta 0.8.9 of the Android Studio and what you need to do is click on the settings icon in the Android Project View. If you select 'Show Members' then the Classes become expandable and you can navigate around the class using the project view.

Visual Studio hot key - switch Find context/location

Is there a hot key to toggle the search context/location in the "Find"/"Find in Files" commands (Ctr+F and Shift+Ctrl+F respectively )? I'm talking about the drop down that asks where to search for example Current Project, Current Document, Entire Solution etc.
"Find" is probably my most used feature since working with markup and CSS very often I can't just F12 to a selector definition or Shift+F12 to Find Usages, a regular text search is really the only option and I want to make this as efficient as possible.
Yes, I can tab to it but this takes 6-tabs and if I do it fast, often get the count wrong and prematurely execute bad searches; so it's not cutting it.
If there isn't a hotkey how can I set one? Ctrl + F3 would work well since F3 is "Find Next"
Thanks
I'm not sure if there is a command in Visual Studio that does what you are looking for.
If there is one, you can set the shortcut key in the Tools\Options menu (Environment\Keyboard).
In the screenshot, I'm searching for all the VS command that contain "find". Perhaps one of these is what you need.
Then move to the Press shortcut keys textbox and choose your desired key binding.

Resources