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

Commit 0b031d59 authored by Fabián Kozynski's avatar Fabián Kozynski
Browse files

Fix colors for power menu dialog

Test: manual, light and dark theme
Flag: com.android.systemui.qs_ui_refactor_compose_fragment
Fixes: 385201494
Change-Id: I3bd588c4df156864be533f8e18b54bd5c5711f28
parent caf93858
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -62,6 +62,9 @@
    <!-- The color of the text in the Global Actions menu -->
    <color name="global_actions_alert_text">@color/GM2_red_300</color>

    <color name="global_actions_lite_emergency_background_new_color">#F55E57</color>
    <color name="global_actions_lite_emergency_icon_new_color">#3A0907</color>

    <!-- Floating overlay actions -->
    <color name="overlay_background_protection_start">#80000000</color> <!-- 50% black -->

+2 −0
Original line number Diff line number Diff line
@@ -52,7 +52,9 @@
    <color name="global_actions_lite_button_background_focused">#808080</color>
    <color name="global_actions_lite_text">#F0F0F0</color>
    <color name="global_actions_lite_emergency_background">#F85D4D</color>
    <color name="global_actions_lite_emergency_background_new_color">#D8372D</color>
    <color name="global_actions_lite_emergency_icon">@color/GM2_grey_900</color>
    <color name="global_actions_lite_emergency_icon_new_color">#FFFFFF</color>

    <color name="global_actions_shutdown_ui_text">@color/control_primary_text</color>

+27 −5
Original line number Diff line number Diff line
@@ -129,6 +129,7 @@ import com.android.systemui.globalactions.domain.interactor.GlobalActionsInterac
import com.android.systemui.plugins.ActivityStarter;
import com.android.systemui.plugins.GlobalActions.GlobalActionsManager;
import com.android.systemui.plugins.GlobalActionsPanelPlugin;
import com.android.systemui.qs.flags.QsInCompose;
import com.android.systemui.scrim.ScrimDrawable;
import com.android.systemui.settings.UserTracker;
import com.android.systemui.shade.ShadeController;
@@ -1008,17 +1009,21 @@ public class GlobalActionsDialogLite implements DialogInterface.OnDismissListene

    protected int getEmergencyTextColor(Context context) {
        return context.getResources().getColor(
                com.android.systemui.res.R.color.global_actions_lite_text);
                QsInCompose.isEnabled() ? R.color.materialColorOnSurface
                        : com.android.systemui.res.R.color.global_actions_lite_text);
    }

    protected int getEmergencyIconColor(Context context) {
        return context.getResources().getColor(
                com.android.systemui.res.R.color.global_actions_lite_emergency_icon);
        return context.getResources().getColor(QsInCompose.isEnabled()
                ? com.android.systemui.res.R.color.global_actions_lite_emergency_icon_new_color
                : com.android.systemui.res.R.color.global_actions_lite_emergency_icon);
    }

    protected int getEmergencyBackgroundColor(Context context) {
        return context.getResources().getColor(
                com.android.systemui.res.R.color.global_actions_lite_emergency_background);
        return context.getResources().getColor(QsInCompose.isEnabled()
                ?
                com.android.systemui.res.R.color.global_actions_lite_emergency_background_new_color
                : com.android.systemui.res.R.color.global_actions_lite_emergency_background);
    }

    private class EmergencyAffordanceAction extends EmergencyAction {
@@ -1987,6 +1992,17 @@ public class GlobalActionsDialogLite implements DialogInterface.OnDismissListene
                messageView.setText(mMessageResId);
            }

            if (QsInCompose.isEnabled()) {
                int textAndIconColor = context.getColor(R.color.materialColorOnSurface);
                messageView.setTextColor(textAndIconColor);
                mIconView.setBackgroundTintList(
                        ColorStateList.valueOf(
                                context.getColor(R.color.materialColorSurfaceContainerHighest)
                        )
                );
                mIconView.setImageTintList(ColorStateList.valueOf(textAndIconColor));
            }

            return v;
        }

@@ -2682,6 +2698,12 @@ public class GlobalActionsDialogLite implements DialogInterface.OnDismissListene
                mBackgroundDrawable = new ScrimDrawable();
                mScrimAlpha = 1.0f;
            }
            if (QsInCompose.isEnabled()) {
                View v = findViewById(R.id.list);
                v.setBackgroundTintList(ColorStateList.valueOf(
                        getContext().getColor(R.color.materialColorSurfaceContainerLow)
                ));
            }

            // If user entered from the lock screen and smart lock was enabled, disable it
            int user = mSelectedUserInteractor.getSelectedUserId();