How to change the color of focused EditText when using "android: Theme.Holo.Light"?

I use "android: Theme.Holo.Light" in my application, it gives the default blue color. I want to have an EditText when focused, as shown below.

enter image description here

By default, this happens when applying the holo.light theme . enter image description here

+6
source share
2 answers

You can use the Holo Color generator for custom colors.

http://android-holo-colors.com/

You do not need to download all controls. Only the ones you want.

+12
source

Help you:

You will need to create/modify your own NinePatch image to replace it by default, and use it as the background of your EditText . If you look in your SDK folder , under your platform, res/drawable , you should find a NinePatch image for the EditText focus state. If that’s all you want to change, you can simply paste it into Photoshop or any other image editing software and change the orange color to your chosen color. Then save this in the drawable folder .

For instance:

edittext_modified_states.xml

 <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android" > <item android:state_pressed="true" android:drawable="@android:drawable/edittext_pressed" /> <!-- pressed --> <item android:state_focused="true" android:drawable="@drawable/edittext_focused_blue" /> <!-- focused --> <item android:drawable="@android:drawable/edittext_normal" /> <!-- default --> </selector> 
+7
source

Source: https://habr.com/ru/post/949542/


All Articles