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

github.com/stefan-niedermann/nextcloud-deck.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Niedermann <info@niedermann.it>2022-11-11 17:44:46 +0300
committerStefan Niedermann <info@niedermann.it>2022-11-11 17:44:46 +0300
commit7e2f09b32602686c35c235b07919b2af439535cd (patch)
tree42f57a913398ec9f4f7e0ced3fb472c9f7e15c59
parent72f559c4924000c39938a3bac36e2663977b80b6 (diff)
#1376 Fix wrong border radius and background color of preference dialogs
Signed-off-by: Stefan Niedermann <info@niedermann.it>
-rw-r--r--app/src/main/res/values/styles.xml15
1 files changed, 12 insertions, 3 deletions
diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml
index eef927ae7..e29bb0793 100644
--- a/app/src/main/res/values/styles.xml
+++ b/app/src/main/res/values/styles.xml
@@ -13,7 +13,10 @@
<item name="android:textColorLink">?android:colorAccent</item>
<item name="android:textColorHighlight">@color/defaultTextHighlightBackground</item>
- <item name="alertDialogTheme">@style/MaterialAlertDialogTheme</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="bottomSheetDialogTheme">@style/AppBottomSheetDialogTheme</item>
@@ -26,12 +29,20 @@
<item name="textAppearanceHeadlineLarge">@style/textAppearanceHeadlineLarge</item>
</style>
+ <style name="AppTheme" parent="BaseTheme" />
+
<style name="MaterialAlertDialogTheme" parent="ThemeOverlay.Material3.MaterialAlertDialog">
<item name="buttonBarPositiveButtonStyle">@style/buttonStyle</item>
<item name="buttonBarNegativeButtonStyle">@style/buttonStyle</item>
<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>
@@ -86,8 +97,6 @@
<item name="android:textSize">36sp</item>
</style>
- <style name="AppTheme" parent="BaseTheme" />
-
<style name="SplashTheme" parent="Theme.SplashScreen">
<item name="windowSplashScreenBackground">@color/defaultBrand</item>
<item name="windowSplashScreenAnimatedIcon">@drawable/ic_launcher_foreground</item>