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

Commit 6894708c authored by Rahul Banerjee's avatar Rahul Banerjee
Browse files

Update Shade Blur Scrim colors to match spec

Bug: 370555223
Flag: com.android.systemui.notification_shade_blur
Test: Manual (pull shade down and check transparency)
Change-Id: Iab47e36c43fd2e7c1f5c3ac87e9cb9cfe2f81b4e
parent 0ebfa996
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -108,6 +108,9 @@

    <color name="people_tile_background">@color/material_dynamic_secondary20</color>

    <!-- Dark Theme colors for notification shade/scrim -->
    <color name="shade_panel">@android:color/system_accent1_900</color>

    <!-- Keyboard shortcut helper dialog -->
    <color name="ksh_key_item_color">@*android:color/system_on_surface_variant_dark</color>
</resources>
+3 −0
Original line number Diff line number Diff line
@@ -31,6 +31,9 @@
    <!-- The dark background color behind the shade -->
    <color name="shade_scrim_background_dark">@androidprv:color/system_under_surface_light</color>

    <!-- Colors for notification shade/scrim -->
    <color name="shade_panel">@android:color/system_accent1_800</color>

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

+3 −2
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@

package com.android.systemui.scrim;

import static com.android.systemui.Flags.notificationShadeBlur;

import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ValueAnimator;
@@ -214,8 +216,7 @@ public class ScrimDrawable extends Drawable {
    public void draw(@NonNull Canvas canvas) {
        mPaint.setColor(mMainColor);
        mPaint.setAlpha(mAlpha);
        if (WindowBlurFlag.isEnabled()) {
            // TODO(b/370555223): Match the alpha to the visual spec when it is finalized.
        if (notificationShadeBlur() || WindowBlurFlag.isEnabled()) {
            // TODO (b/381263600), wire this at ScrimController, move it to PrimaryBouncerTransition
            mPaint.setAlpha((int) (0.5f * mAlpha));
        }
+8 −4
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@

package com.android.systemui.scrim;

import static com.android.systemui.Flags.notificationShadeBlur;

import static java.lang.Float.isNaN;

import android.annotation.NonNull;
@@ -39,13 +41,12 @@ import androidx.core.graphics.ColorUtils;
import com.android.internal.annotations.GuardedBy;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.colorextraction.ColorExtractor;
import com.android.systemui.res.R;
import com.android.systemui.shade.TouchLogger;
import com.android.systemui.util.LargeScreenUtils;

import java.util.concurrent.Executor;

import static com.android.systemui.Flags.notificationShadeBlur;

/**
 * A view which can draw a scrim.  This view maybe be used in multiple windows running on different
 * threads, but is controlled by {@link com.android.systemui.statusbar.phone.ScrimController} so we
@@ -253,8 +254,11 @@ public class ScrimView extends View {
                mainTinted = ColorUtils.blendARGB(mColors.getMainColor(), mTintColor, tintAmount);
            }
            if (notificationShadeBlur()) {
                // TODO(b/370555223): Fix color and transparency to match visual spec exactly
                mainTinted = ColorUtils.blendARGB(mColors.getMainColor(), Color.GRAY, 0.5f);
                int layerAbove = ColorUtils.setAlphaComponent(
                        getResources().getColor(R.color.shade_panel, null),
                        (int) (0.4f * 255));
                int layerBelow = ColorUtils.setAlphaComponent(Color.WHITE, (int) (0.1f * 255));
                mainTinted = ColorUtils.compositeColors(layerAbove, layerBelow);
            }
            drawable.setColor(mainTinted, animated);
        } else {