Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/stefan-niedermann/nextcloud-notes.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Niedermann <info@niedermann.it>2022-11-12 09:31:30 +0300
committerStefan Niedermann <info@niedermann.it>2022-11-12 11:02:24 +0300
commit311ad084c9207eba0e1d41508b0a8f13fe5bb98f (patch)
tree48c7f5a8f5bf0478ed5dcc060bfeefcafb710f17
parent0d3e32a2f73702f796590973bb6d45749f4e3f01 (diff)
Material 3: Workaround for preferences dialogs
Signed-off-by: Stefan Niedermann <info@niedermann.it>
-rw-r--r--app/src/main/res/values/styles.xml10
1 files changed, 10 insertions, 0 deletions
diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml
index b280b7f9..885c5986 100644
--- a/app/src/main/res/values/styles.xml
+++ b/app/src/main/res/values/styles.xml
@@ -15,6 +15,10 @@
<item name="windowActionModeOverlay">true</item>
<item name="android:actionModeBackground">?attr/colorPrimary</item>
+ <!-- Workaround: Preferences Dialogs are using AlertDialogs instead of MaterialAlertDialogs. -->
+ <!-- https://stackoverflow.com/questions/70650073/adjust-androidx-preference-dialogs-to-follow-material-you -->
+ <item name="alertDialogTheme">@style/PreferencesAlertDialogTheme</item>
+
<item name="materialAlertDialogTheme">@style/MaterialAlertDialogTheme</item>
<item name="actionModeStyle">@style/actionModeStyle</item>
@@ -47,6 +51,12 @@
<item name="buttonBarNeutralButtonStyle">@style/buttonStyle</item>
</style>
+ <style name="PreferencesAlertDialogTheme" parent="MaterialAlertDialogTheme">
+ <!-- https://m3.material.io/components/dialogs/specs#6771d107-624e-47cc-b6d8-2b7b620ba2f1 -->
+ <item name="dialogCornerRadius">28dp</item>
+ <item name="android:background">?attr/colorSurface</item>
+ </style>
+
<style name="buttonStyle" parent="Widget.Material3.Button.TextButton.Dialog">
<item name="android:textColor">?attr/colorAccent</item>
</style>