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

Commit 1112aa91 authored by Danny Lin's avatar Danny Lin Committed by Nishith Khanna
Browse files

SystemUI: Follow light/dark theme in power menu

Now that we've modified the power menu to refresh on UI mode changes,
make it follow the system light/dark theme for better integration in
light mode.

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
Signed-off-by: default avataralthafvly <althafvly@gmail.com>
parent 5091630c
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -55,6 +55,11 @@
    <!-- The color of the text in the Global Actions menu -->
    <color name="global_actions_text">@color/GM2_grey_200</color>

    <!-- Colors for Power Menu Lite -->
    <color name="global_actions_lite_background">@*android:color/primary_device_default_dark</color>
    <color name="global_actions_lite_button_background">@*android:color/surface_dark</color>
    <color name="global_actions_lite_text">@*android:color/foreground_device_default_dark</color>

    <!-- The color of the text in the Global Actions menu -->
    <color name="global_actions_alert_text">@color/GM2_red_300</color>

+3 −3
Original line number Diff line number Diff line
@@ -39,10 +39,10 @@
    <color name="global_actions_grid_background">#F1F3F4</color>

    <!-- Colors for Power Menu Lite -->
    <color name="global_actions_lite_background">#191C18</color>
    <color name="global_actions_lite_button_background">#303030</color>
    <color name="global_actions_lite_background">@*android:color/primary_device_default_light</color>
    <color name="global_actions_lite_button_background">@*android:color/surface_light</color>
    <color name="global_actions_lite_button_background_focused">#666666</color>
    <color name="global_actions_lite_text">#F0F0F0</color>
    <color name="global_actions_lite_text">@*android:color/foreground_device_default_light</color>
    <color name="global_actions_lite_emergency_background">#F85D4D</color>
    <color name="global_actions_lite_emergency_icon">@color/GM2_grey_900</color>

+9 −0
Original line number Diff line number Diff line
@@ -846,6 +846,15 @@ public class GlobalActionsDialogLite implements DialogInterface.OnDismissListene
                user.id) != 0;
    }

    @Override
    public void onUiModeChanged() {
        // Colors may change, depending on UI mode
        mContext.getTheme().applyStyle(mContext.getThemeResId(), true);
        if (mDialog != null && mDialog.isShowing()) {
            mDialog.refreshDialog();
        }
    }

    @Override
    public void onConfigChanged(Configuration newConfig) {
        if (mDialog != null && mDialog.isShowing()