How to change EditText bubble color (under cursor) in android?

Hiren Patel picture Hiren Patel · Feb 11, 2016 · Viewed 8.7k times · Source

How to change the color of EditText bubble in android, I could do change the cursor drawable but I want change color of Bubble, please share idea on it.

Reference screenshot:

enter image description here

Any help would be appreciated.

Answer

saulmm picture saulmm · Feb 11, 2016

You can change all your EditText bubbles and bar colors setting the accent color in your AppTheme.

<style name="AppTheme" parent="Base.Theme.AppCompat.Light">
    <item name="colorPrimary">@color/indigo</item>
    <item name="colorAccent">@color/pink</item>
</style>

Or you could just change one single EditText with the android:theme attribute of your component.

<style name="MyEditText" parent="Theme.AppCompat.Light">  
   <item name="colorControlNormal">@color/indigo</item>
   <item name="colorControlActivated">@color/pink</item>
</style>  

<EditText  
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:hint="Hint text"
    android:theme="@style/MyEditText"
    />