Switch between link and string value representation in xml editor

when working in Android Studio in xml values โ€‹โ€‹and referring to @Strings/xy , for example, I saw in the video that in fact you can display the actual values โ€‹โ€‹directly in the same editor window. It was basically a transition between @String/xy and "XYContent", but with an existing link.

I do not refer to "ctrl + click", which opens (in my case) strings.xml in a new tab.

Any idea? Could not find a link to this in the help file.

+6
source share
2 answers

Click and return the cursor to the link to the resource of the line and press Ctrl + "-" (minus / hyphen) and you will see a preview.

This basically collapses everything for the code, and collapsed links to string resources show the values โ€‹โ€‹as a preview. You can also minimize all actions from the menu if you prefer a mouse more than a keyboard. Right-Click -> Folding > Collapse

To go back, press Ctrl + "+" while the cursor is still on the same link.

+10
source

You can go to Preferences => Appearance & Behavior => Editor => General => Code Folding and enable Android String References to always see the value of the string resource in the java file.

0
source

All Articles