Skip to content

Commit

Permalink
SystemUI: Always refresh power menu on UI mode change
Browse files Browse the repository at this point in the history
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
  • Loading branch information
kdrag0n committed Jun 7, 2022
1 parent 8f76458 commit f135aa5
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -715,6 +715,15 @@ boolean shouldDisplayBugReport(UserInfo currentUser) {
&& (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()
Expand Down

0 comments on commit f135aa5

Please sign in to comment.