Android appcompat-v7:21.0.0 change material checkbox colors

I had a similar problem with unchecked CheckBoxes and RadioButtons.
I found the solution, when I figured out that controls takes their “Off” color from

<item name="android:textColorSecondary">@color/secondary_text</item>


EDIT:

Specifying, if your app’s or activity’s theme inherite one of L’s AppCompat (Dark/Light/Light.DarkActionBar), you can set:

<style name="SampleTheme" parent="Theme.AppCompat">
    <item name="colorAccent">@color/green</item>
    <item name="android:textColorSecondary">@color/red</item>
</style>

And that’s result:

enter image description here

Notice: When you get different effect you probably use “wrong” theme – make sure you set it correctly.

Leave a Comment