4

i know this question was already answered but i can't find a solution that work.

on android > lolipop (21) is their any way to change the color of my text selection handles (without uploading new png image)?

i define this style

<?xml version="1.0" encoding="utf-8"?>
<resources>

  <style name="AppEditTextStyle" parent="@android:style/Widget.Material.Light.EditText">
    <item name="android:background">@null</item>    
    <item name="android:textCursorDrawable">@null</item> 
    <item name="android:drawableTint">#00ffffff</item>           
  </style>

  <style name="AppTheme" parent="@android:style/Theme.Material.Light.NoActionBar"> 
    <item name="android:editTextStyle">@style/AppEditTextStyle</item>
  </style>

</resources>

but it's not work, i receive : Error: No resource found that matches the given name: attr 'android:drawableTint'.

but in the doc (https://developer.android.com/reference/android/widget/TextView.html#attr_android:drawableTint) it is clearly specified that android:drawableTint exist :( so i don't understand why i miss ?

zeus
  • 12,173
  • 9
  • 63
  • 184
  • Loki this might help you. http://stackoverflow.com/questions/29795197/how-to-change-color-of-edittext-handlers – W4R10CK Sep 18 '16 at 12:29
  • thanks W4R10CK but no :( i don't want to do @drawable/text_select_handle_middle because i know that on android > 21 their is a way to change the color wihtout uploading new drawables. i don't understand for now why #00ffffff return an error :( – zeus Sep 18 '16 at 12:47
  • Possible duplicate of [How to change color of EditText handles?](https://stackoverflow.com/questions/29795197/how-to-change-color-of-edittext-handles) – Vadim Kotov Mar 13 '19 at 15:55

1 Answers1

2

In android lolipop and later the handles color is the accent color.

I suggest to read this:

Selection - Patterns - Material design guidelines

Here is the styles line:

<item name="colorAccent">@color/colorAccent</item>

And set selection color like this:

android:textColorHighlight="@color/colorAccent"
Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Bruno Ferreira
  • 1,561
  • 1
  • 10
  • 17