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

Commit 1e2a4efd authored by burakov's avatar burakov
Browse files

[Dual Shade] Match surface and scrim colors with the SurfaceEffects spec

Fix: 404732145
Fix: 404484235
Test: Existing unit tests still pass.
Test: Manually by opening and closing the notifications shade and quick
 settings shade and observing that the colors look as intended, in both
 light and dark mode, with notifications blur on and off.
Flag: com.android.systemui.scene_container
Change-Id: I55854205743dfde2ea95d345d89d9812b85064aa
parent 084ae854
Loading
Loading
Loading
Loading
+9 −9
Original line number Diff line number Diff line
@@ -37,7 +37,6 @@ import androidx.compose.foundation.layout.systemBarsIgnoringVisibility
import androidx.compose.foundation.layout.waterfall
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.overscroll
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.windowsizeclass.WindowWidthSizeClass
import androidx.compose.runtime.Composable
import androidx.compose.runtime.ReadOnlyComposable
@@ -46,6 +45,7 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.LocalLayoutDirection
import androidx.compose.ui.platform.LocalResources
import androidx.compose.ui.res.dimensionResource
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
@@ -57,6 +57,8 @@ import com.android.mechanics.behavior.VerticalExpandContainerSpec
import com.android.mechanics.behavior.verticalExpandContainerBackground
import com.android.systemui.Flags
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.composable.OverlayShade.rememberShadeExpansionMotion

/** Renders a lightweight shade UI container, as an overlay. */
@@ -190,17 +192,15 @@ object OverlayShade {
    }

    object Colors {
        val ScrimBackground = Color(0f, 0f, 0f, alpha = 0.3f)
        val ScrimBackground: Color
            @Composable
            @ReadOnlyComposable
            get() = Color(LocalResources.current.notificationScrim(Flags.notificationShadeBlur()))

        val PanelBackground: Color
            @Composable
            @ReadOnlyComposable
            get() {
                return if (Flags.notificationShadeBlur()) {
                    MaterialTheme.colorScheme.primaryContainer.copy(alpha = 0.4f)
                } else {
                    MaterialTheme.colorScheme.surfaceContainer
                }
            }
            get() = Color(LocalResources.current.shadePanel(Flags.notificationShadeBlur()))
    }

    object Dimensions {