Skip to content

Commit

Permalink
Material Alert Dialog Styling
Browse files Browse the repository at this point in the history
  • Loading branch information
neeldoshii committed Jun 4, 2024
1 parent 660ee79 commit a1d06b0
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions AnkiDroid/src/main/res/values/attrs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -176,4 +176,5 @@
<attr name="checkMediaListForeground" format="color" />

<attr name="progressDialogButtonTextColor" format="color"/>
<attr name="materialAlertDialogPrimaryColor" format="color"/>
</resources>
4 changes: 4 additions & 0 deletions AnkiDroid/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,10 @@
<item name="checkboxStyle">@style/AlertDialogCheckBox.Style</item>
</style>

<style name="ThemeOverlay.App.MaterialAlertDialog" parent="ThemeOverlay.Material3.MaterialAlertDialog">
<item name="colorPrimary">?attr/materialAlertDialogPrimaryColor</item>
</style>

<style name="CustomButtonBarButtonStyle" parent="Widget.AppCompat.Button.ButtonBar.AlertDialog">
<item name="android:textColor">?attr/progressDialogButtonTextColor</item>
</style>
Expand Down
3 changes: 3 additions & 0 deletions AnkiDroid/src/main/res/values/theme_black.xml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@
<!-- AlertDialogTheme-->
<item name="alertDialogTheme">@style/AlertDialogStyle</item>

<!-- MaterialAlertDialog-->
<item name="materialAlertDialogPrimaryColor">@color/theme_black_primary_dark</item>

</style>

<style name="SnackbarTextStyleBlack" parent="@style/Widget.MaterialComponents.Snackbar.TextView">
Expand Down
3 changes: 3 additions & 0 deletions AnkiDroid/src/main/res/values/theme_dark.xml
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,9 @@
<!-- AlertDialogTheme-->
<item name="alertDialogTheme">@style/AlertDialogStyle</item>
<item name="tabStyle">@style/Widget.MaterialComponents.TabLayout</item>

<!--MaterialAlertDialogTheme-->
<item name="materialAlertDialogPrimaryColor">@color/theme_dark_primary</item>
</style>

<style name="Theme_Dark" parent="Base.Theme.Dark"/>
Expand Down
3 changes: 3 additions & 0 deletions AnkiDroid/src/main/res/values/theme_light.xml
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@
<item name="checkMediaListForeground">@color/material_grey_700</item>
<item name="progressDialogButtonTextColor">@color/material_light_blue_500</item>
<item name="tabStyle">@style/Widget.MaterialComponents.TabLayout</item>

<!-- Material Alert Dialog-->
<item name="materialAlertDialogPrimaryColor">@color/material_light_blue_500</item>
</style>

<style name="Theme_Light" parent="Base.Theme.Light"/>
Expand Down
2 changes: 2 additions & 0 deletions AnkiDroid/src/main/res/values/theme_plain.xml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@
<item name="dialogBackground">@color/white</item>
<item name="progressDialogButtonTextColor">@color/theme_plain_primary</item>

<!-- MaterialAlertDialog-->
<item name="materialAlertDialogPrimaryColor">@color/theme_plain_primary</item>
</style>

<style name="Theme_Light.Plain" parent="Base.Theme.Light.Plain"/>
Expand Down

0 comments on commit a1d06b0

Please sign in to comment.