Skip to content

Commit

Permalink
Improve alert dialog style
Browse files Browse the repository at this point in the history
  • Loading branch information
MorenoTropical committed Jun 5, 2024
1 parent f2cca93 commit 4ee26a9
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
10 changes: 10 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,16 @@
<item name="checkboxStyle">@style/AlertDialogCheckBox.Style</item>
</style>

<style name="ThemeOverlay.AnkiDroid.AlertDialog" parent="ThemeOverlay.Material3.MaterialAlertDialog">
<item name="dialogCornerRadius">@dimen/m3_alert_dialog_corner_size</item>
<item name="materialAlertDialogBodyTextStyle">@style/AnkiDroid.AlertDialog.Body.Text</item>
</style>

<style name="AnkiDroid.AlertDialog.Body.Text" parent="MaterialAlertDialog.Material3.Body.Text">
<!-- The default style uses onSurfaceVariant, which isn't defined yet -->
<item name="android:textColor">?android:attr/textColor</item>
</style>

<style name="CustomButtonBarButtonStyle" parent="Widget.AppCompat.Button.ButtonBar.AlertDialog">
<item name="android:textColor">?attr/progressDialogButtonTextColor</item>
</style>
Expand Down
4 changes: 0 additions & 4 deletions AnkiDroid/src/main/res/values/theme_black.xml
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,6 @@
<!-- ProgressDialog-->
<item name="dialogBackground">@color/theme_black_primary_light</item>
<item name="progressDialogButtonTextColor">@color/material_light_blue_400</item>

<!-- AlertDialogTheme-->
<item name="alertDialogTheme">@style/AlertDialogStyle</item>

</style>

<style name="SnackbarTextStyleBlack" parent="@style/Widget.MaterialComponents.Snackbar.TextView">
Expand Down
4 changes: 1 addition & 3 deletions AnkiDroid/src/main/res/values/theme_dark.xml
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,6 @@
<item name="navDrawerImage">@drawable/nav_drawer_logo_dark_theme</item>
<!-- Dialog styles -->
<item name="android:listPreferredItemHeight">56dip</item>
<item name="dialogCornerRadius">@dimen/dialog_corner_radius</item>
<item name="android:dialogCornerRadius" tools:targetApi="p">@dimen/dialog_corner_radius</item>
<item name="textAllCaps">false</item>
<!--Custom Tabs colors-->
<item name="customTabNavBarColor">@color/material_grey_800</item>
Expand Down Expand Up @@ -147,7 +145,7 @@
<item name="checkMediaListForeground">@color/white</item>

<!-- AlertDialogTheme-->
<item name="alertDialogTheme">@style/AlertDialogStyle</item>
<item name="alertDialogTheme">@style/ThemeOverlay.AnkiDroid.AlertDialog</item>
<item name="tabStyle">@style/Widget.MaterialComponents.TabLayout</item>
</style>

Expand Down
3 changes: 1 addition & 2 deletions AnkiDroid/src/main/res/values/theme_light.xml
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,6 @@
<item name="navDrawerImage">@drawable/nav_drawer_logo</item>
<!-- Dialog styles -->
<item name="android:listPreferredItemHeight">56dip</item>
<item name="dialogCornerRadius">@dimen/dialog_corner_radius</item>
<item name="android:dialogCornerRadius" tools:targetApi="p">@dimen/dialog_corner_radius</item>
<item name="textAllCaps">false</item>
<!--Custom Tabs colors-->
<item name="customTabNavBarColor">@color/material_light_blue_500</item>
Expand Down Expand Up @@ -129,6 +127,7 @@
<item name="switchPreferenceCompatStyle">@style/Preference.SwitchPreferenceCompat.Material3</item>
<item name="sliderStyle">@style/SliderStyle</item>
<item name="preferenceTheme">@style/PreferenceThemeOverlay.AnkiDroid</item>
<item name="alertDialogTheme">@style/ThemeOverlay.AnkiDroid.AlertDialog</item>

<!-- ProgressDialog-->
<item name="dialogBackground">@color/white</item>
Expand Down

0 comments on commit 4ee26a9

Please sign in to comment.