42 lines
1.6 KiB
Diff
42 lines
1.6 KiB
Diff
From 894572f399ce6132eae919fa2106e8554648c79c Mon Sep 17 00:00:00 2001
|
|
From: Danny Lin <danny@kdrag0n.dev>
|
|
Date: Tue, 8 Mar 2022 20:37:33 -0800
|
|
Subject: [PATCH 13/22] SystemUI: Always refresh power menu on UI mode change
|
|
|
|
This is necessary for reliably theming the global actions dialog with
|
|
dynamic colors and adapting it to light/dark themes.
|
|
|
|
Demo screenshots (with color overlays applied):
|
|
https://twitter.com/kdrag0n/status/1445960685427433473
|
|
|
|
[kdrag0n: ported to 12L]
|
|
|
|
Change-Id: If58fb4079a4cd11414ff928fad3576beecb14ff5
|
|
---
|
|
.../systemui/globalactions/GlobalActionsDialogLite.java | 9 +++++++++
|
|
1 file changed, 9 insertions(+)
|
|
|
|
diff --git a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialogLite.java b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialogLite.java
|
|
index bddf5756f925..0ed1042f21e2 100644
|
|
--- a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialogLite.java
|
|
+++ b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialogLite.java
|
|
@@ -787,6 +787,15 @@ public class GlobalActionsDialogLite implements DialogInterface.OnDismissListene
|
|
&& (currentUser == null || currentUser.isPrimary());
|
|
}
|
|
|
|
+ @Override
|
|
+ public void onUiModeChanged() {
|
|
+ // Colors may change, depending on UI mode
|
|
+ mContext.getTheme().applyStyle(mContext.getThemeResId(), true);
|
|
+ if (mDialog != null) {
|
|
+ mDialog.refreshDialog();
|
|
+ }
|
|
+ }
|
|
+
|
|
@Override
|
|
public void onConfigChanged(Configuration newConfig) {
|
|
if (mDialog != null && mDialog.isShowing()
|
|
--
|
|
2.25.1
|
|
|