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

Commit 887c4377 authored by Fabian Kozynski's avatar Fabian Kozynski Committed by Android (Google) Code Review
Browse files

Merge "Fix colors for power menu dialog" into main

parents d5aca836 0b031d59
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -62,6 +62,9 @@
    <!-- The color of the text in the Global Actions menu -->
    <!-- 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_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 -->
    <!-- Floating overlay actions -->
    <color name="overlay_background_protection_start">#80000000</color> <!-- 50% black -->
    <color name="overlay_background_protection_start">#80000000</color> <!-- 50% black -->


+2 −0
Original line number Original line Diff line number Diff line
@@ -52,7 +52,9 @@
    <color name="global_actions_lite_button_background_focused">#808080</color>
    <color name="global_actions_lite_button_background_focused">#808080</color>
    <color name="global_actions_lite_text">#F0F0F0</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">#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">@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>
    <color name="global_actions_shutdown_ui_text">@color/control_primary_text</color>


+27 −5
Original line number Original line 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.ActivityStarter;
import com.android.systemui.plugins.GlobalActions.GlobalActionsManager;
import com.android.systemui.plugins.GlobalActions.GlobalActionsManager;
import com.android.systemui.plugins.GlobalActionsPanelPlugin;
import com.android.systemui.plugins.GlobalActionsPanelPlugin;
import com.android.systemui.qs.flags.QsInCompose;
import com.android.systemui.scrim.ScrimDrawable;
import com.android.systemui.scrim.ScrimDrawable;
import com.android.systemui.settings.UserTracker;
import com.android.systemui.settings.UserTracker;
import com.android.systemui.shade.ShadeController;
import com.android.systemui.shade.ShadeController;
@@ -1008,17 +1009,21 @@ public class GlobalActionsDialogLite implements DialogInterface.OnDismissListene


    protected int getEmergencyTextColor(Context context) {
    protected int getEmergencyTextColor(Context context) {
        return context.getResources().getColor(
        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) {
    protected int getEmergencyIconColor(Context context) {
        return context.getResources().getColor(
        return context.getResources().getColor(QsInCompose.isEnabled()
                com.android.systemui.res.R.color.global_actions_lite_emergency_icon);
                ? 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) {
    protected int getEmergencyBackgroundColor(Context context) {
        return context.getResources().getColor(
        return context.getResources().getColor(QsInCompose.isEnabled()
                com.android.systemui.res.R.color.global_actions_lite_emergency_background);
                ?
                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 {
    private class EmergencyAffordanceAction extends EmergencyAction {
@@ -1987,6 +1992,17 @@ public class GlobalActionsDialogLite implements DialogInterface.OnDismissListene
                messageView.setText(mMessageResId);
                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;
            return v;
        }
        }


@@ -2682,6 +2698,12 @@ public class GlobalActionsDialogLite implements DialogInterface.OnDismissListene
                mBackgroundDrawable = new ScrimDrawable();
                mBackgroundDrawable = new ScrimDrawable();
                mScrimAlpha = 1.0f;
                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
            // If user entered from the lock screen and smart lock was enabled, disable it
            int user = mSelectedUserInteractor.getSelectedUserId();
            int user = mSelectedUserInteractor.getSelectedUserId();