How can I change the color of a selected text in the Android Studio Editor?
I want to change only the color highlight of the selected line(s) in Android Studio and not the overall background.
How can I do that?
Go to Preferences -> Editor -> Colors and Fonts -> General, then change the "Selection Background" setting. See below:
Make sure you apply your changes; then you should see them reflected both in the preferences window and in your live code:
For Android Studio Version 3.2
This is the same answer as the earlier accepted answer, but updated because of recent changes to Android Studio (ok, Android is a moving target, but here's the latest as of November 2018).
Preferences -> Editor -> Color Scheme -> General -> Editor -> Selection Background
Then click on the hexadecimal block to the right of "Background" to pull up a color chooser.
My Android Studio is showing me annoying green lines in XML files. How can I remove it? Thanks.
The green lines show areas interpreted by IDE as different language injection.
In those areas you end up with different code completion rules etc.
So assuming you used the language injections by mistake, clicking the lightbulb and choosing "Un-inject Language/Reference" removes those areas.
It's quicker than going through the settings and prevents any inconsistent highlighting and code completion when editing the file later.
Ok, I've found how to disable it.
Preferences -> Editor -> Color & Fonts -> Injected language fragment (uncheck background).
I'm following a few tutorials in order to change my Logcat colors in Android Studio 0.6.1 without success.
To set it up I go to:
File -> Settings -> Editor -> Colours and Fonts -> Android Logcat
Once on Android Logcat, the foreground, background, etc. check boxes are all disabled.
Does anyone have an idea why?
Thanks in advance.
You cannot change the default so first you need to creat your own configuration by clicking on "save as" button.
After doing so there is a check-box below the all available color options, Entitled "Inherit Attributes From Console", Untick that checkbox will enable all color options for you.
To change the Logcat colors you can go to goto File > Settings or press Ctrl+Alt+S.
You can see this similar UI assuming you are using Darcula Theme
Note you need to unchecked Use inherited attributes in-order to modify the color.
Basically, how can I hide these icons that appear automatically when I get the ID of a drawable in Java code? Or at least limit their number to 1 instead of 5?
I've looked everywhere in the settings and can't seem to find anything. And they are pretty annoying, as they take away quite a bit of coding space.
You can disable the icons by going to preferences -> Editor -> Appearance. There you will find a checkbox saying Show icons preview in gutter for small icons. (Java)
You can also disable css color previews there if you want. For the change to take effect I had to restart Android Studio.
Go to preferences -> Editor-> Appearance. Uncheck the box that says
"Show CSS color preview icon in gutter"
Is there any way to make the editor text larger in Android Studio?
I go to Settings>Editor>Colors&Fonts>Font where I find "Size:12". However, I'm unable to change the value for the size.
They didn't make this very obvious, did they?
All you have to do is click the "Save As" button to create a new profile. You can't change the font because you can't overwrite the default profiles.
If creating a custom setting doesn't help:
Click on File > Settings > Editor and check the field:
Change font-size with CTRL + Mouse Wheel.
Worked for me.
Extending the answer above, for Windows:
1. Go to File > Settings ...
2. Modify the settings shown below
If you are using Android Studio (version 0.5.2) then this applies:
Click on [File][Settings], and under the "IDE Settings" area (left side Pane), choose "Appearance".
On the right side (the 'Appearance Settings') check the CheckBox called "Override default fonts by (not recommended)" and then the "Size" choice will un-grey and you can choose a new size using either the PullDown or by typing a number. Double check that the number is reasonable (not too large).
Click [Apply] to see the result of your choice and ensure that it is readable before choosing [OK] and dismissing the Settings Panel.
Cautions: Since Android Studio is still in Beta (a new Program) choosing too small or too large a Font, or choosing one that the Editor does not agree with, may make Text either unreadable or worse (cause a crash).
This is likely why the Setting says "not recommended". You do not want to have to edit the Program's settings with a Hex Editor if you make a mess by setting the Fonts to 144 Points instead of just 14 -- the Menu line would be huge.
A small increase in the Font size should be OK but be careful not to make Text so large that it can not fit in the area that was reserved for it (not just in the Editor but also the "Main Menu" and the "Info Bar" (at the bottom).
Note: The 'Edit Window' Text is smaller than all the other Text by one size but all Text is controlled by the one Setting. Making the 'Edit Window' Text too big is very likely to cause problems elsewhere since all the other Text is larger than what is shown in the 'Edit Window'.
Keymap
There is nothing wrong with the other answers but this one shows how to map the font sizing to a keyboard shortcut. One can then use Cmd/= and Cmd/- (or Ctrl/=, Ctrl-) to manage the font sizing. You can choose any key combination you like but note the conflicts message that appears when you select a keyboard shortcut (just to be sure that it makes sense in your use-case).
Go to Preferences (Settings in Windows) Menu and select the Keymap section title on the left. On the right sections' search box, type in font. You will find several entries including Increase Font Size and Decrease Font Size. You can double click each of these to add a keyboard shortcut.
For mine, I chose Cmd/= and Cmd/- as my shortcuts respectively. You will be prompted with an option to Leave or Remove conflicts. In my case, I chose to leave the conflicts in place as they are never likely to be loaded at the same time.
Double-click to add keymap
Enter key combination and note any conflicts
Choose how to handle conflicts
NB: If you choose Leave, conflicts remain ~ but may not matter if they
are not loaded at the same time. If you choose Remove then the original
keyboard shortcuts are removed (use with care).
Nota Bene
Another useful keymap on font sizing is Reset Font Size, which puts things back to the default setting. This option shows up when you search the Keymap in preferences for font. In my case, I chose Cmd/Shift/0 so that I would avoid the commonly used Cmd\0 shortcut that opens the Messages window.
Reset Font Size
Valid as of Android Studio 1.5.1
FYI
A different method to change the font sizes is to open the Actions
menu and search for font. When found then double click on the
increase/decrease font size choices. On the Mac, I access actions
menu using the Cmd/Shift/A shortcut or under Help menu, choose
Find Actions.
A nice feature is:
File -> Settings -> Editor -> General
On top there is a section "Mouse"
You can click on the "Change font size (ZOOM) with CTRL+Mouse wheel"
So you can change the size on demand.
In MacBook Android Studio ->
Select Preferences... ->
Click on Save As.. ->Give any name -> OK -> then select Scheme -> and you given name every option Editable
Go to Settings > Editor, expand the Editor tree, go to Color & Fonts expand that tree and find Font, at the top select the theme you want to change fonts for and then change the font under Editor Font
It seems they have fixed it now. I'm using Android Studio 3.0, and I'm able to modify default scheme.
Just open Settings > Editor > Colors&Fonts > Font, enter the desired font size in field "Size" and click "Apply" button, that's it.
Goto Files | Settings | Appearance & Behavior --> appearance --> scroll down mouse you will find presentation mode change the font size .
I have the issue but it was due to changed font family. I had to specify Font size for specific Font Family I was currently using. Got to Settings > Font > Click Current Editor font...
It will open Color Scheme > Color Scheme Font. Specify Font size here