Skip to content

Commit

Permalink
Replace outdated preference dialogs with M3 dialogs
Browse files Browse the repository at this point in the history
  • Loading branch information
cyb3rko committed Dec 6, 2022
1 parent 5860114 commit d016f88
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
24 changes: 24 additions & 0 deletions app/src/main/res/drawable/dialog_bg_monet.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list
xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape>
<solid android:color="?attr/colorSurface" />
<corners
android:bottomLeftRadius="28dp"
android:bottomRightRadius="28dp"
android:topLeftRadius="28dp"
android:topRightRadius="28dp" />
</shape>
</item>
<item>
<shape>
<solid android:color="@color/m3_popupmenu_overlay_color" />
<corners
android:bottomLeftRadius="28dp"
android:bottomRightRadius="28dp"
android:topLeftRadius="28dp"
android:topRightRadius="28dp" />
</shape>
</item>
</layer-list>
7 changes: 7 additions & 0 deletions app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
<item name="cardColor">@color/cardColor</item>

<item name="switchPreferenceCompatStyle">@style/Preference.SwitchPreferenceCompat</item>
<item name="materialAlertDialogTheme">@style/Dialog.Preferences</item>
<item name="alertDialogTheme">@style/Dialog.Preferences</item>
</style>

<style name="Button.AppIntro" parent="Widget.Material3.Button">
Expand All @@ -60,4 +62,9 @@
<item name="widgetLayout">@layout/preference_switch</item>
</style>

<style name="Dialog.Preferences" parent="ThemeOverlay.Material3.MaterialAlertDialog">
<item name="dialogCornerRadius">28dp</item>
<item name="android:background">@drawable/dialog_bg_monet</item>
</style>

</resources>

0 comments on commit d016f88

Please sign in to comment.