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

Commit eaaa1f1d authored by burakov's avatar burakov
Browse files

[Dual Shade] Replace the scrim background color to match the spec.

The concept of "notifications scrim" no longer exists in Dual Shade;
instead, we used the color spec for "scrim behind shadePanel" as defined
in the UX spec (#404040 with alpha of 40%).

Fix: 414579329
Test: Manually by opening the shade on both dark and light theme and
 observing that the scrim color behind the shade is correct.
Flag: com.android.systemui.scene_container
Change-Id: Iad367d3d4313836bf2f09704bcec1b3769bd8094
parent d0c3ed74
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -47,8 +47,8 @@ import com.android.compose.windowsizeclass.LocalWindowSizeClass
import com.android.mechanics.behavior.VerticalExpandContainerSpec
import com.android.mechanics.behavior.verticalExpandContainerBackground
import com.android.systemui.res.R
import com.android.systemui.shade.ui.ShadeColors.notificationScrim
import com.android.systemui.shade.ui.ShadeColors.shadePanel
import com.android.systemui.shade.ui.ShadeColors.shadePanelScrimBehind
import com.android.systemui.shade.ui.composable.OverlayShade.rememberShadeExpansionMotion

/** Renders a lightweight shade UI container, as an overlay. */
@@ -170,7 +170,7 @@ object OverlayShade {
        val ScrimBackground: Color
            @Composable
            @ReadOnlyComposable
            get() = Color(notificationScrim(LocalContext.current, /* blurSupported= */ true))
            get() = Color(shadePanelScrimBehind(LocalContext.current))

        @Composable
        @ReadOnlyComposable
+14 −11
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ import com.android.systemui.res.R
object ShadeColors {
    /**
     * Calculate notification shade panel color.
     *
     * @param context Context to resolve colors.
     * @param blurSupported Whether blur is enabled (can be off due to battery saver)
     * @param withScrim Whether to composite a scrim when blur is enabled (used by legacy shade).
@@ -34,11 +35,11 @@ object ShadeColors {
            if (withScrim) {
                ColorUtils.compositeColors(
                    shadePanelStandard(context),
                    shadePanelScrimBehind(context))
                    shadePanelScrimBehind(context),
                )
            } else {
                shadePanelStandard(context)
            }

        } else {
            shadePanelFallback(context)
        }
@@ -54,18 +55,20 @@ object ShadeColors {
    }

    @JvmStatic
    private fun shadePanelStandard(context: Context): Int {
        val layerAbove = context.resources.getColor(
            com.android.internal.R.color.shade_panel_fg, context.theme)
        val layerBelow = context.resources.getColor(
            com.android.internal.R.color.shade_panel_bg, context.theme)
        return ColorUtils.compositeColors(layerAbove, layerBelow)
    fun shadePanelScrimBehind(context: Context): Int {
        return context.resources.getColor(
            com.android.internal.R.color.shade_panel_scrim,
            context.theme,
        )
    }

    @JvmStatic
    private fun shadePanelScrimBehind(context: Context): Int {
        return context.resources.getColor(
            com.android.internal.R.color.shade_panel_scrim, context.theme)
    private fun shadePanelStandard(context: Context): Int {
        val layerAbove =
            context.resources.getColor(com.android.internal.R.color.shade_panel_fg, context.theme)
        val layerBelow =
            context.resources.getColor(com.android.internal.R.color.shade_panel_bg, context.theme)
        return ColorUtils.compositeColors(layerAbove, layerBelow)
    }

    @JvmStatic