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

Commit 3ae16b27 authored by Danny Burakov's avatar Danny Burakov Committed by Android (Google) Code Review
Browse files

Merge "[Dual Shade] Replace the scrim background color to match the spec." into main

parents e34116fa eaaa1f1d
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