Revert "Revert "Update dialog background color for dark theme""
This reverts commit 77259dc9bbe7d61c66a674ed0ac77fcc69a55cb0.
Previously, using a general attribute to change the background color
for alert dialog. It will also impact on the background of other
components. To fix it, we used another attribute to change the dialog
background.
Bug: 132753127
Bug: 132623454
Bug: 129993336
Test: visual
Change-Id: I09091ee8fb45238d0ea94760f2fca5c206299a57
diff --git a/res/values-night/colors.xml b/res/values-night/colors.xml
index 4041d0d..f761217 100644
--- a/res/values-night/colors.xml
+++ b/res/values-night/colors.xml
@@ -22,6 +22,8 @@
<color name="homepage_card_dismissal_background">@*android:color/material_grey_900</color>
<color name="contextual_card_background">@*android:color/material_grey_900</color>
<color name="search_bar_background">@*android:color/material_grey_800</color>
+ <!-- Dialog background color -->
+ <color name="dialog_background">@*android:color/material_grey_800</color>
<color name="notification_importance_selection_bg">@*android:color/material_grey_800</color>
<color name="notification_importance_button_selected">#AECBFA</color> <!-- material blue 200 -->
<color name="notification_importance_button_unselected">#5F6368</color>
diff --git a/res/values-night/themes.xml b/res/values-night/themes.xml
index 2227b88..f47513e 100644
--- a/res/values-night/themes.xml
+++ b/res/values-night/themes.xml
@@ -33,6 +33,7 @@
<style name="Theme.AlertDialog.Base" parent="@style/Theme.AppCompat.DayNight.Dialog.Alert">
<item name="colorAccent">@*android:color/accent_device_default_dark</item>
+ <item name="android:colorBackground">@color/dialog_background</item>
</style>
</resources>
diff --git a/res/values/colors.xml b/res/values/colors.xml
index e1c9228..4a4c896 100644
--- a/res/values/colors.xml
+++ b/res/values/colors.xml
@@ -144,4 +144,7 @@
<!-- Search bar background color -->
<color name="search_bar_background">@android:color/white</color>
+ <!-- Dialog background color -->
+ <color name="dialog_background">@*android:color/background_device_default_light</color>
+
</resources>
\ No newline at end of file
diff --git a/res/values/themes.xml b/res/values/themes.xml
index d9d1e74..8316971 100644
--- a/res/values/themes.xml
+++ b/res/values/themes.xml
@@ -121,6 +121,7 @@
<style name="Theme.AlertDialog.Base" parent="@style/Theme.AppCompat.DayNight.Dialog.Alert">
<item name="colorAccent">@*android:color/accent_device_default_light</item>
+ <item name="android:colorBackground">@color/dialog_background</item>
</style>
<style name="Theme.AlertDialog" parent="Theme.AlertDialog.Base">
diff --git a/src/com/android/settings/accessibility/HearingAidDialogFragment.java b/src/com/android/settings/accessibility/HearingAidDialogFragment.java
index aa80564..67b9d39 100644
--- a/src/com/android/settings/accessibility/HearingAidDialogFragment.java
+++ b/src/com/android/settings/accessibility/HearingAidDialogFragment.java
@@ -16,12 +16,13 @@
package com.android.settings.accessibility;
-import android.app.AlertDialog;
import android.app.Dialog;
import android.app.settings.SettingsEnums;
import android.content.DialogInterface;
import android.os.Bundle;
+import androidx.appcompat.app.AlertDialog;
+
import com.android.settings.R;
import com.android.settings.bluetooth.BluetoothPairingDetail;
import com.android.settings.core.SubSettingLauncher;