1

Here is a dialog, how to change this color (unchecked)?

screenshot

I try to set style but not work:

 <style name="ThemeMyAppDialogAlertDay"  
   parent="ThemeOverlay.MaterialComponents.MaterialAlertDialog">
    <item name="colorPrimary">@color/color_secondary</item>
    <item name="colorPrimaryVariant">@color/color_primary_variant</item>
    <item name="colorOnPrimary">@color/color_secondary</item>
    <item name="colorSecondary">@color/color_secondary</item>
    <item name="colorAccent">@color/color_error</item>
</style>
hata
  • 10,652
  • 6
  • 37
  • 62

2 Answers2

0

Try this , It should help

<style name="materialDiaog" parent="MaterialAlertDialog.MaterialComponents">
    <item name="buttonTint">@color/colorPrimary</item>
    <item name="colorPrimary">@color/color_secondary</item>
    <item name="colorPrimaryVariant">@color/color_primary_variant</item>
    <item name="colorOnPrimary">@color/color_secondary</item>
    <item name="colorSecondary">@color/color_secondary</item>
    <item name="colorAccent">@color/color_error</item>


</style>
<style name="AppTheme" parent="{set your parent theme here}">
    <item name="materialAlertDialogTheme">@style/materialDiaog</item>
</style>
ebs237
  • 184
  • 2
  • 11
0

You can use:

 <style name="ThemeMyAppDialogAlertDay"  
   parent="ThemeOverlay.MaterialComponents.MaterialAlertDialog">
     <item name="colorSecondary">@color/selected</item> <!-- selected -->
     <item name="colorControlNormal">@color/unselected</item> <!-- unselected -->
 </style> 

enter image description here

Gabriele Mariotti
  • 250,295
  • 77
  • 670
  • 690