How to change accent color in Android Material alerts?

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 (for example, the status bar or action mode), but all the controls (check boxes, radio, and buttons) in the alerts still have a turquoise color by default. Is there any way to color them?

ps I do not use the appcompat library, so for this question you should pretend that I do not support anything below Lollipop.

+5
source share
1 answer

I assume that "alert" means a Dialog . They are controlled by another topic:

 <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> 
+5
source

Source: https://habr.com/ru/post/1206908/


All Articles