Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 311ad084 authored by Stefan Niedermann's avatar Stefan Niedermann
Browse files

Material 3: Workaround for preferences dialogs

parent 0d3e32a2
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -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>