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

Commit 6f78e3c1 authored by Fabian Kozynski's avatar Fabian Kozynski
Browse files

Make AlertDialog use specific styles per button

As the buttons in an alert dialog are identified with Positive,
Negative, Neutral, use the corresponding style attributes. That way,
they can be styled independently.

Style them independently in SystemUI. This allows for AlertDialog or
SystemUIDialog created with the right theme to be able to use the
default buttons with correct styling.

Test: manual (AddUserDialog)
Bug: 203666386
Change-Id: I4f292193bff5dec90f8dc229a9824d22075d5241
parent 104ef43d
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -124,21 +124,21 @@
                android:layout_width="0dip"
                android:layout_gravity="start"
                android:layout_weight="1"
                style="?android:attr/buttonBarButtonStyle"
                style="?android:attr/buttonBarPositiveButtonStyle"
                android:maxLines="2"
                android:layout_height="wrap_content" />
            <Button android:id="@+id/button3"
                android:layout_width="0dip"
                android:layout_gravity="center_horizontal"
                android:layout_weight="1"
                style="?android:attr/buttonBarButtonStyle"
                style="?android:attr/buttonBarNeutralButtonStyle"
                android:maxLines="2"
                android:layout_height="wrap_content" />
            <Button android:id="@+id/button2"
                android:layout_width="0dip"
                android:layout_gravity="end"
                android:layout_weight="1"
                style="?android:attr/buttonBarButtonStyle"
                style="?android:attr/buttonBarNegativeButtonStyle"
                android:maxLines="2"
                android:layout_height="wrap_content" />
            <LinearLayout android:id="@+id/rightSpacer"
+3 −0
Original line number Diff line number Diff line
@@ -419,6 +419,9 @@

    <style name="Theme.SystemUI.Dialog" parent="@android:style/Theme.DeviceDefault.Light.Dialog">
        <item name="android:buttonCornerRadius">28dp</item>
        <item name="android:buttonBarPositiveButtonStyle">@style/Widget.QSDialog.Button</item>
        <item name="android:buttonBarNegativeButtonStyle">@style/Widget.QSDialog.Button.BorderButton</item>
        <item name="android:buttonBarNeutralButtonStyle">@style/Widget.QSDialog.Button.BorderButton</item>
    </style>

    <style name="Theme.SystemUI.Dialog.Alert" parent="@*android:style/Theme.DeviceDefault.Light.Dialog.Alert" />