I'm running Android Studio on Mac OS X and I'm not able to see the hard-coded strings values in the editor as well as I cannot see drawables preview. Anyway, I can see colour preview in the xml file. Is there any option that I need to turn on?
I know that this may be due to a bug, but they've strongly publicized this feature so IMHO it works!
The option "Android String References" must be checked under Settings > Editor > Code Folding, but it is checked by default. For me, it doesn't seem to do the string preview automatically. I have to right click anywhere in some code like getString(R.string.mystring)
then go to Folding > Collapse. Or, you can just hit Ctrl + '-' to collapse it as well. This might be the intended behavior or a bug. It seems like they implied it was automatic in the keynote speech, but maybe it's not.
As far as the drawables preview goes, I think it only works for drawables with only one resource instance. So if you have an icon.png in more than one drawable folder (eg. drawable-mdpi and drawable-hdpi), then you won't get the preview. At least, that's how it worked for me. I only saw the preview when I tried it with an icon that was in just one drawable folder.
Press Ctrl+Period (or ⌘+Period on Mac OS X) when your cursor is on getString
or the preview word, then the string is switched.
Now you should use keyboard shortcut Command + '-' or Command + '.' in android studio to show strings preview.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With