I have the following theme declaration in my values-v21 folder:
<style name="BaseTheme" parent="android:Theme.Material.Light.DarkActionBar">
<item name="android:colorPrimary">@color/brand_primary</item>
<item name="android:colorPrimaryDark">@color/status_bar_bg</item>
<item name="android:colorAccent">#FF00FF</item>
<item name="android:colorControlHighlight">#0000FF</item>
</style>
These colors apply to everything as expected (e.g. status bar or action mode) but all the controls (check boxes, radios, and buttons) in alerts still have the default turquoise color. Is there a way to colorize them too?
p.s. I'm not using the appcompat library, for the purpose of this question you should pretend I don't support anything below Lollipop.
Android system accent colors can be changed by going to Settings > Wallpaper & style > Basic colors and picking your favorite color. You can also go to Wallpaper colors to let Android pick the colors based on your wallpaper.
Go to Settings->System->Developer options–>Scroll down to accent colors. Now, choose the accent color that you want to enable and you are done.
Accent Color refers to a color used to emphasize key parts of the UI, such as the active tab, focused input texts, checked boxes, etc. The Material Theme plugin enables this feature in the IDE and gives the ability to customize it to your heart's content.
I assume by "alert" you mean a Dialog
. These are controlled by a different theme reference:
<style name="AppTheme" parent="android:Theme.Material.Light.DarkActionBar">
<item name="android:alertDialogTheme">@style/BaseDialogTheme</item>
</style>
<style name="BaseDialogTheme" parent="android:Theme.Material.Dialog.Alert">
<item name="android:colorPrimary">...</item>
</style>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With