You will have many problems with the compatibility library with both checkboxes and radio buttons.
1) They come only in black for any Android 4.x devices. They work on Android 5.x and 2.x (don't ask me why this works on 2.x, they have no idea).
2) They don’t have a disabled state (it doesn’t matter if all of your checkboxes are turned on, otherwise you may surprise very badly).
Note that the default background for the dark theme is gray, not black, so if you keep it ok by default.
To solve this problem, I created a white and disabled version of the following drawings, all added to my main project, but not in the compatibility project (for the obvious purpose of maintenance):
abc_btn_check_to_on_mtrl_000 abc_btn_check_to_on_mtrl_015 abc_btn_radio_to_on_mtrl_000 abc_btn_radio_to_on_mtrl_015
Then are created accessible for managing all states (to override the initial state):
For example, a dark theme will use this:
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_enabled="false" android:state_checked="true" android:drawable="@drawable/abc_btn_check_to_on_mtrl_015_disabled" /> <item android:state_enabled="true" android:state_checked="true" android:drawable="@drawable/abc_btn_check_to_on_mtrl_015" /> <item android:state_enabled="true" android:drawable="@drawable/abc_btn_check_to_on_mtrl_000" /> <item android:drawable="@drawable/abc_btn_check_to_on_mtrl_000_disabled" /> </selector>
The light theme will use this (user can switch the theme in my application):
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_enabled="false" android:state_checked="true" android:drawable="@drawable/abc_btn_check_to_on_mtrl_015_disabled" /> <item android:state_enabled="true" android:state_checked="true" android:drawable="@drawable/abc_btn_check_to_on_mtrl_015_light" /> <item android:state_enabled="true" android:drawable="@drawable/abc_btn_check_to_on_mtrl_000_light" /> <item android:drawable="@drawable/abc_btn_check_to_on_mtrl_000_disabled" /> </selector>
Then all I had to do was redefine the default compatibility theme (both activity and dialogue, for dark / dark themes), adding something like this:
<item name="android:listChoiceIndicatorSingle">@drawable/abc_btn_radio_material</item> <item name="android:listChoiceIndicatorMultiple">@drawable/abc_btn_check_material</item>
And this is for light topics:
<item name="android:listChoiceIndicatorSingle">@drawable/abc_btn_radio_material_light</item> <item name="android:listChoiceIndicatorMultiple">@drawable/abc_btn_check_material_light</item>
Now I have full functional flags and radio on all versions of Android! IMO in the compatible library was not tested at all for a dark theme, only a white theme was used. A disconnected state will probably never be used by dev of the compat lib.