I am only getting autocomplete in my xml layout when i type "android:" I want to get it whenever I press cmd+space. I am using a mac
Go to
Eclipse -> Preferences -> XML -> XML Files - > Editor -> Content Assist
and tick all proposals checkboxes to allow this.
EDIT : Also tick Automatically make suggestions and Insert single proposals automatically checkboxes.
Open Preferences and in the search type XML, you would find on the left pane a XML hierarchy and under editor you will have content assist. Just tick all the boxes there are in this page and you are good to go!
Window--->Preferences----->General------->Keys, find Content Assist and set attribute Binding as cmd + space, and attribute When as Editing in Structured Text Editors, if it still not work, right click on your xml file, choose open with, try to use Android Menu Editor. Good luck.
I found the solution:
I needed to unselect in my mac SystemPref --> keyboard-->shortcuts there was a command "select the previous input source"
All You want is code promption whatever you enter.
Eclipse -> Preferences -> XML -> XML Files - > Editor -> Content Assist
Then input "prompt when these characters are inserted" with
#+<=:abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
Related
I'm trying to translate a strings.xml file on Android Studio but it seems like the Translations Editor is not enabled (it does not appear as an option when I right click on the strings.xml file). I've tried deleting and installing back Android Studio but it's still the same; any ideas on how to solve?
Thank you in advance!
this is the "no enabled action found message I get
you have to open the string.xml file, then you will see the open editor option on the upper right side
Reopen the Android Studio IDE, it'll solve the problem. Also it will update the strings and refresh the layout of any layout xml.
Translations Editor shows up when you right-click on string resource files whose names end with strings.xml. On others it does not. The same goes for editor option that is supposed to show up in upper right side when string resource file is opened.
So, filenames like strings.xml, preferences_strings.xml, etc. are fine, while strings_intro.xml, etc. are not.
In case you don't have any string resource files named in that way, you can create an empty one named strings.xml and use it to open Translations Editor.
Or, you can open the it in the following way:
Open any xml layout file
Switch to 'Design' view in upper right corner
Design toolbar will look something like the following:
Click on the localizations option (globe icon)
At the bottom of the drop-down menu you will see 'Edit Translations...' option
Click on it - and there you are!
I cannot figure out how to search for text inside an individual XML file from Eclipse. Basically if I am editing one of my xml layout files, and I hit CTL + H -> file search -> Selected resources radio button checked, I always get '0 results in empty scope' as my results. Google hasn`t given me any help on this.
My workaround is to choose 'Workspace' instead of 'Selected resources' and then navigate to the file I want in my search results which is time-consuming. Why doesn't eclipse recognize my current XML file as a selected resource like it does with java files? Has anyone else had this issue? I`m using Eclipse ADT 23.0.2.129578
Go to the Source tab of the layout file editor, then use Ctrl+F to open the Find/Replace dialog. You can also use Ctrl+K to traverse through matches of the last search, even when the Find/Replace dialog is closed.
You can use Ctrl + Shift + R for searching the XML file quickly in eclipse.
I have this strange line wrap on Android Studio and I want to disable because it freaks me out...
It's also available under the context menu
In Android Studio 0.4.0 following should help:
Configure > Settings > Editor > Uncheck 'Use soft wraps in editor'
On Mac (Android Studio 3.0):
Preferences -> Editor -> General -> Uncheck 'Use soft wraps in editor'
I wanted to entirely disable wrapping and I found a workaround.
It doesn't seem to work for specific file extensions (Groovy, HTML, Java, etc.) but does with the general value. I set it with a significantly great number and am having no more wrapping.
I think they should give a master option for it!
In Android Studio 2.3.3+, to disable line wrapping, you need to go to:
Preferences
Code Styles
[Select a Language, e.g. Java]
Set "wrap on typing" to NO.
If you're wondering how to do this for Flutter/Dart, here's how:
File -> Settings -> Code Style -> Dart
Change the Line length field to something bigger than the default (I'm using 300)
This should work for any programming language.
In Android Studio 1.0.2, there is no menu named Configure. Settings is now under File menu. Everything are as accepted answer.
Right click near the line numbers for the soft wrap option to pop up.
In Android Studio 3.5.3 you can set the soft wrap to line up with the orginal lines indent AND set an additional indent spaces. Makes it easier for me to read
Settings --> Editor --> General
I found helpful that in the current version (Android Studio 3.2) you can set the soft wrap indicators to show only in the current line in adition to using soft wraps in editor.
Check the Show soft wrap indicators for current line only in:
Editor -> General -> Soft Wraps
There is also the auto-line breaking issue, where AS will automatically add hard line returns in long lines. I found the setting for this in Preferences > Editor > Code Style > Hard wrap at [X] and []wrap on typing.
Android Studio 4.1.3:
Preferences > Code Style > uncheck wrap on typing
While editing an XML layout file, I would like Eclipse to display content proposals.
E.g. when I type in "marg" and press Cmd+Space, it should offer me a dropdown list of
layout_marginLeft, layout_marginRight etc.
How can I set this keybinding?
(On Mac it is by default Ctrl+Space, but I want it to be Cmd+Space)
Command+Space usually brings up Spotlight. You'll have to turn this off first.
Go to System Preferences / Spotlight.
Disable or remap Command+Space.
Then in Eclipse:
Go to Eclipse / Preferences.
Select General / Keys.
Select Content Assist in the list.
Delete the ^Space in the binding textbox.
Type in Command+Space.
If you go to
Eclipse > Preferences > Keys
find the option 'Content Assist' and changing the binding to cmd + space.
I am seeing a strange problem with my Eclipse IDE for Android development.
Autocompletion does not work when I hit Ctrl + Space in the main.xml file for my layouts. In the bottom left, I get a message saying for example "LinearLayout not found".
I also have the correct namespace specified in my file.
It does work though for other xml files, such as my strings.xml which I find strange.
This is an annoyance as I'd like to easily see all the options available for a View or Layout.
Anyone got any ideas on how to resolve this?
Check that the file is being opened in the Android XML Layout editor (not just the "plain" XML editor). Right-click the file, choose Open With, and select Android Layout Editor.
It seems like an eclipse XML editor issue.
If you declare the xmlns in other than "xmlns:android" you loose the autocompletion.
for example if you say:
xmlns:android="http://schemas.android.com/apk/res/android"
android:.... //AUTOCOMPLETES
if you say
xmlns:android1="http://schemas.android.com/apk/res/android"
android1:... //DOES NOT AUTOCOMPLETE
Open eclipse and go to the following:
Window > preferences > XML > editor > content assist > advanced
Select all checkboxes and click ok. After that, restart eclipse.
Try this as suggested powder366
Or you can set the default editor in Eclipse Preferences, used Android Common XML Editor. You find it in Eclipse Preferences, General, Editors, File Associations. Click on .xml, choose "Add" "Android Common XML Editor". Select it and press the Default button.
OPEN YOUR FILE WITH GENERIC TEXT EDITOR
Right-click on XML File, select Open with GENERIC TEXT EDITOR
Check that the file is being opened in the Generic text editor.If not then, Right-click the file, choose Open With, and select Generic text Editor.