Wherever your carret on a name that you want to change is
if you call for autocomplete (ctrl + space)
you will get a new full name instead of the only the part after carret(which is needed in this example)
The only possible way to choose another name in a clean way is to place carret at the end of the previous name
but when you want to change a name from the middle of the previous name
you have no choice other than accept the suggested name
and then delete the residue text from the previous name
Comparing previous text with new selected text from autocomplete suggestion box is implemented on many code editors. Is there any specific reason that Android Studio team decided to not to implement this feature? or may be this feature exist but is turned off by default for some reason and if this is the case how could we turn it on?
Just use TAB instead of ENTER to autocomplete changing the old value. It also works for methods.
Related
I am testing my app with TalkBack and have noticed that at some points in the app for e.g. if I click a dropdown spinner, and select an item, it will call out the item's name (which is expected), but right after that it will call out the app's name as well.
I know this is coming from the android:label for the application in the Manifest, and I have tried removing it, and setting it null; but in that case it just reads out 'Untitled'. I am sure it is coming from there because when I change the label to another string it starts saying that.
Not sure, how to fix this and have not found any solid solutions for this online. Any help would be appreciated!
Say I type the following field
field = "I am field";
In Eclipse as soon as I place the mouse on field it shows me a list of options from which I can select create local variable field.
In Android Studio, the lightbulb is a headache for me. Sometimes it appears quickly, sometimes it takes forever to appear.
Is there a way to force it to appear?
Are you talking about using Alt + Enter?
This link might help:
https://www.jetbrains.com/idea/help/keyboard-shortcuts-you-cannot-miss.html
Pressing Alt + Enter results in the drop-down menu with correction options in this case:
In the Android studio Settings/Keymap "shortcut Ctrl+Alt+S"
search for usage of "Alt + Ent" as below image if its not assigned for any action plz go for No. 2
Android studio shortcuts
In the Android studio Settings/Editor/Intentions.
Check whatever you want to show Intention in are checked or not as below photo
Intention
Double check no.1 is working fine and you found usage of "Alt + Ent" shortcut
[You can find the solution on official Jet brains website]
Intellij IDEA keyboard shortcuts
Intention actions
Try putting the cursor right next to the last letter of the class/method you want to edit, in other hand what worked for me in Android Studio is to use the bar on the right side, 'Outline' and from there get to the part you want to edit and use the tools from Outline or by right clicking on the method that appears in the tree drop down.
Is there any shortcut for editing properties of a widget in Android Layout editor in ADT?
I need to change gravity of TextView lots of times, but every time I have to use mouse...
You could do a search and replace on a particular string in the layout.
Highlight only the TextViews you want the search to happen in
Search > Search
Enter the string to be replaced and press the "Replace" button or "Replace
All" button.
If you post the exact xml listing of your layout, I can be more exact in which string needs to be replaced. If that solution doesn't work for your particular case, to save some time, I suppose you might also be able to create a particular custom Eclipse template for your TextView.
A third option would be to use inheritance and create a customTextView with the gravity already set a certain way.
And a fourth option still would be to set the properties of your TextViews programmatically after the fact using both XML and Java (instead of only using XML).
I hate when I try to open the declaration of a layout and Eclipse redirects me to the R file, which is the same as nothing. Is there a keyboard shortcut for it to take me to the layout file. I know if you click on it with CTRL it gives you this option on a pop-up, but I hate using the mouse. I can't find this on the keybinding section. There's just plain "open declaration" which I have already changed because it was a horrible F3 by default, but this usually takes you to the R file
Well there is a mouse shortcut - Just hold down CTRL and hover over the id you want to see. You'll get two options, one for R.java and other to open the declaration. Choose the second one
EDIT:
Sorry, completely missed the part where you dont like the mouse use. Well I dont think there is any other way, and I see a bug/feature request here https://code.google.com/p/android/issues/detail?id=53536 reported specifically asking for this, so I wouldnt think another way exists other than either using the mouse or using the keyboard to highlight the particular item of interest and using Ctrl+Shift+R to get the menu and pressing Enter but like you mention this wouldnt work for something like R.id.foo . Wish someone from Google/Eclipse could comment on the bug/feature request.
If you CTRL + Shift + r : you can open any resource.
Using this with any text selected will pre-populate the open resource dialog with the text you selected. After that you should be able to find the file you want very quickly and double click it to open (or use down arrow and enter for openting without using a mouse).
Hope this helps.
I have a range say,1-100 and i want the user to select a value from this range.Ofcourse showing this with a spinner will be awful.I want to use the functionality of date widget,where we can pick a date by pressing a +/- sign,the longer the press ,higher the iteration speed.
I found numberpicker.java that has the code the date widget uses to get this functionality, but do i have to paste that entire code to achieve this functionality!
Here is a tutorial on how to pull out NumberPicker; I've followed it myself: http://www.quietlycoding.com/?p=5
I found numberpicker.java that has the
code the date widget uses to get this
functionality, but do i have to paste
that entire code to achieve this
functionality!
Unfortunately, yes, plus perhaps some resources as well (I have not looked at that code recently). I am not aware of anyone who has pulled that out to make a reusable component, and it is not a widget in the SDK.
Sorry!