From 6f78e3c16b5a18a80fb216bff5a1e1d14fe4ffa4 Mon Sep 17 00:00:00 2001 From: Fabian Kozynski Date: Wed, 20 Oct 2021 12:32:06 -0400 Subject: [PATCH] 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 --- core/res/res/layout/alert_dialog.xml | 6 +++--- packages/SystemUI/res/values/styles.xml | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/core/res/res/layout/alert_dialog.xml b/core/res/res/layout/alert_dialog.xml index 59e56af01b8d1..6869c5fb7935f 100644 --- a/core/res/res/layout/alert_dialog.xml +++ b/core/res/res/layout/alert_dialog.xml @@ -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" />