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

Commit 14cea5b8 authored by Justin Weir's avatar Justin Weir Committed by Android (Google) Code Review
Browse files

Merge "Add overridable background color for the shade" into main

parents 9f2f3960 0c97306b
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -29,6 +29,9 @@
    <color name="status_bar_icons_hover_color_light">#38FFFFFF</color> <!-- 22% white -->
    <color name="status_bar_icons_hover_color_dark">#38000000</color> <!-- 22% black -->

    <!-- The dark background color behind the shade -->
    <color name="shade_scrim_background_dark">@*android:color/black</color>

    <!-- The color of the background in the separated list of the Global Actions menu -->
    <color name="global_actions_separated_background">#F5F5F5</color>

+29 −27
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import android.graphics.Color;
import android.os.Trace;

import com.android.systemui.dock.DockManager;
import com.android.systemui.res.R;
import com.android.systemui.scrim.ScrimView;
import com.android.systemui.statusbar.notification.stack.StackStateAnimator;

@@ -39,8 +40,8 @@ public enum ScrimState {
    OFF {
        @Override
        public void prepare(ScrimState previousState) {
            mFrontTint = Color.BLACK;
            mBehindTint = Color.BLACK;
            mFrontTint = mBackgroundColor;
            mBehindTint = mBackgroundColor;

            mFrontAlpha = 1f;
            mBehindAlpha = 1f;
@@ -74,15 +75,15 @@ public enum ScrimState {
            } else {
                mAnimationDuration = ScrimController.ANIMATION_DURATION;
            }
            mFrontTint = Color.BLACK;
            mBehindTint = Color.BLACK;
            mNotifTint = mClipQsScrim ? Color.BLACK : Color.TRANSPARENT;
            mFrontTint = mBackgroundColor;
            mBehindTint = mBackgroundColor;
            mNotifTint = mClipQsScrim ? mBackgroundColor : Color.TRANSPARENT;

            mFrontAlpha = 0;
            mBehindAlpha = mClipQsScrim ? 1 : mScrimBehindAlphaKeyguard;
            mNotifAlpha = mClipQsScrim ? mScrimBehindAlphaKeyguard : 0;
            if (mClipQsScrim) {
                updateScrimColor(mScrimBehind, 1f /* alpha */, Color.BLACK);
                updateScrimColor(mScrimBehind, 1f /* alpha */, mBackgroundColor);
            }
        }
    },
@@ -93,10 +94,10 @@ public enum ScrimState {
            // notif scrim alpha values are determined by ScrimController#applyState
            // based on the shade expansion

            mFrontTint = Color.BLACK;
            mFrontTint = mBackgroundColor;
            mFrontAlpha = .66f;

            mBehindTint = Color.BLACK;
            mBehindTint = mBackgroundColor;
            mBehindAlpha = 1f;
        }
    },
@@ -110,7 +111,7 @@ public enum ScrimState {
            mBehindTint = previousState.mBehindTint;
            mBehindAlpha = previousState.mBehindAlpha;

            mFrontTint = Color.BLACK;
            mFrontTint = mBackgroundColor;
            mFrontAlpha = .66f;
        }
    },
@@ -122,7 +123,7 @@ public enum ScrimState {
        @Override
        public void prepare(ScrimState previousState) {
            mBehindAlpha = mClipQsScrim ? 1 : mDefaultScrimAlpha;
            mBehindTint = mClipQsScrim ? Color.BLACK : mSurfaceColor;
            mBehindTint = mClipQsScrim ? mBackgroundColor : mSurfaceColor;
            mNotifAlpha = mClipQsScrim ? mDefaultScrimAlpha : 0;
            mNotifTint = Color.TRANSPARENT;
            mFrontAlpha = 0f;
@@ -154,10 +155,10 @@ public enum ScrimState {
            mBehindAlpha = mClipQsScrim ? 1 : mDefaultScrimAlpha;
            mNotifAlpha = 1f;
            mFrontAlpha = 0f;
            mBehindTint = mClipQsScrim ? Color.TRANSPARENT : Color.BLACK;
            mBehindTint = mClipQsScrim ? Color.TRANSPARENT : mBackgroundColor;

            if (mClipQsScrim) {
                updateScrimColor(mScrimBehind, 1f /* alpha */, Color.BLACK);
                updateScrimColor(mScrimBehind, 1f /* alpha */, mBackgroundColor);
            }
        }
    },
@@ -184,11 +185,11 @@ public enum ScrimState {
            final boolean isDocked = mDockManager.isDocked();
            mBlankScreen = mDisplayRequiresBlanking;

            mFrontTint = Color.BLACK;
            mFrontTint = mBackgroundColor;
            mFrontAlpha = (alwaysOnEnabled || isDocked || quickPickupEnabled)
                    ? mAodFrontScrimAlpha : 1f;

            mBehindTint = Color.BLACK;
            mBehindTint = mBackgroundColor;
            mBehindAlpha = ScrimController.TRANSPARENT;

            mAnimationDuration = ScrimController.ANIMATION_DURATION_LONG;
@@ -222,8 +223,8 @@ public enum ScrimState {
        @Override
        public void prepare(ScrimState previousState) {
            mFrontAlpha = mAodFrontScrimAlpha;
            mBehindTint = Color.BLACK;
            mFrontTint = Color.BLACK;
            mBehindTint = mBackgroundColor;
            mFrontTint = mBackgroundColor;
            mBlankScreen = mDisplayRequiresBlanking;
            mAnimationDuration = mWakeLockScreenSensorActive
                    ? ScrimController.ANIMATION_DURATION_LONG : ScrimController.ANIMATION_DURATION;
@@ -245,7 +246,6 @@ public enum ScrimState {
            mBehindAlpha = mClipQsScrim ? 1 : 0;
            mNotifAlpha = 0;
            mFrontAlpha = 0;

            mAnimationDuration = mKeyguardFadingAway
                    ? mKeyguardFadingAwayDuration
                    : CentralSurfaces.FADE_KEYGUARD_DURATION;
@@ -259,22 +259,22 @@ public enum ScrimState {
                    && !fromAod;

            mFrontTint = Color.TRANSPARENT;
            mBehindTint = Color.BLACK;
            mBehindTint = mBackgroundColor;
            mBlankScreen = false;

            if (mDisplayRequiresBlanking && previousState == ScrimState.AOD) {
                // Set all scrims black, before they fade transparent.
                updateScrimColor(mScrimInFront, 1f /* alpha */, Color.BLACK /* tint */);
                updateScrimColor(mScrimBehind, 1f /* alpha */, Color.BLACK /* tint */);
                updateScrimColor(mScrimInFront, 1f /* alpha */, mBackgroundColor /* tint */);
                updateScrimColor(mScrimBehind, 1f /* alpha */, mBackgroundColor /* tint */);

                // Scrims should still be black at the end of the transition.
                mFrontTint = Color.BLACK;
                mBehindTint = Color.BLACK;
                mFrontTint = mBackgroundColor;
                mBehindTint = mBackgroundColor;
                mBlankScreen = true;
            }

            if (mClipQsScrim) {
                updateScrimColor(mScrimBehind, 1f /* alpha */, Color.BLACK);
                updateScrimColor(mScrimBehind, 1f /* alpha */, mBackgroundColor);
            }
        }
    },
@@ -283,8 +283,8 @@ public enum ScrimState {
        @Override
        public void prepare(ScrimState previousState) {
            mFrontTint = Color.TRANSPARENT;
            mBehindTint = Color.BLACK;
            mNotifTint = mClipQsScrim ? Color.BLACK : Color.TRANSPARENT;
            mBehindTint = mBackgroundColor;
            mNotifTint = mClipQsScrim ? mBackgroundColor : Color.TRANSPARENT;

            mFrontAlpha = 0;
            mBehindAlpha = mClipQsScrim ? 1 : 0;
@@ -293,7 +293,7 @@ public enum ScrimState {
            mBlankScreen = false;

            if (mClipQsScrim) {
                updateScrimColor(mScrimBehind, 1f /* alpha */, Color.BLACK);
                updateScrimColor(mScrimBehind, 1f /* alpha */, mBackgroundColor);
            }
        }
    };
@@ -327,9 +327,11 @@ public enum ScrimState {
    boolean mKeyguardFadingAway;
    long mKeyguardFadingAwayDuration;
    boolean mClipQsScrim;
    int mBackgroundColor;

    public void init(ScrimView scrimInFront, ScrimView scrimBehind, DozeParameters dozeParameters,
            DockManager dockManager) {
        mBackgroundColor = scrimBehind.getContext().getColor(R.color.shade_scrim_background_dark);
        mScrimInFront = scrimInFront;
        mScrimBehind = scrimBehind;