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
  • 11,633
  • 6
  • 46
  • 69

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>
The Codepreneur
  • 236
  • 3
  • 12
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
  • 320,139
  • 94
  • 887
  • 841