Loading packages/SystemUI/compose/features/src/com/android/systemui/notifications/ui/composable/Notifications.kt +13 −21 Original line number Diff line number Diff line Loading @@ -50,7 +50,6 @@ import androidx.compose.foundation.layout.windowInsetsBottomHeight import androidx.compose.foundation.overscroll import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.foundation.verticalScroll import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable import androidx.compose.runtime.DisposableEffect import androidx.compose.runtime.LaunchedEffect Loading @@ -64,9 +63,7 @@ import androidx.compose.runtime.setValue import androidx.compose.runtime.snapshotFlow import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.draw.drawBehind import androidx.compose.ui.geometry.Rect import androidx.compose.ui.graphics.BlendMode import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.graphicsLayer import androidx.compose.ui.input.nestedscroll.NestedScrollConnection Loading Loading @@ -314,7 +311,8 @@ fun ContentScope.NotificationScrollingStack( val density = LocalDensity.current val screenCornerRadius = LocalScreenCornerRadius.current val scrimCornerRadius = dimensionResource(R.dimen.notification_scrim_corner_radius) val scrimBackgroundColor = MaterialTheme.colorScheme.surface // TODO(b/428779792): update color to match BC25 spec val surfaceEffect0Color = Color.Gray.copy(alpha = 0.5f) val scrollState = shadeSession.rememberSaveableSession(saver = ScrollState.Saver, key = "ScrollState") { ScrollState(initial = 0) Loading Loading @@ -609,27 +607,21 @@ fun ContentScope.NotificationScrollingStack( Modifier.clickable(onClick = { onEmptySpaceClick?.invoke() }) } ) { // Creates a cutout in the background scrim in the shape of the notifications scrim. // Only visible when notif scrim alpha < 1, during shade expansion. if (shouldPunchHoleBehindScrim) { Spacer( modifier = Modifier.fillMaxSize().drawBehind { drawRect(Color.Black, blendMode = BlendMode.DstOut) } ) } Box( modifier = Modifier.graphicsLayer { alpha = if (shouldPunchHoleBehindScrim) { (expansionFraction / EXPANSION_FOR_MAX_SCRIM_ALPHA).coerceAtMost(1f) } else 1f } .thenIf(shouldShowScrim) { Modifier.background(scrimBackgroundColor) } .thenIf(shouldFillMaxSize) { Modifier.fillMaxSize() } .thenIf(supportNestedScrolling) { Modifier.padding(bottom = minScrimTop) } .thenIf(shouldShowScrim) { Modifier.background(surfaceEffect0Color) } .thenIf(shouldFillMaxSize) { Modifier.fillMaxSize() } .thenIf(supportNestedScrolling) { Modifier.padding(bottom = minScrimTop) } .debugBackground(viewModel, DEBUG_BOX_COLOR) ) { Column( Loading packages/SystemUI/compose/features/src/com/android/systemui/scene/ui/composable/transitions/ToShadeTransition.kt +3 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import com.android.systemui.media.controls.ui.composable.MediaCarousel import com.android.systemui.notifications.ui.composable.Notifications import com.android.systemui.qs.ui.composable.QuickSettings import com.android.systemui.scene.shared.model.Scenes import com.android.systemui.shade.ui.composable.Shade import com.android.systemui.shade.ui.composable.ShadeHeader import kotlin.time.Duration.Companion.milliseconds Loading @@ -42,6 +43,8 @@ fun TransitionBuilder.toShadeTransition(durationScale: Double = 1.0) { fade(QuickSettings.Elements.FooterActions) } fade(Shade.Elements.BackgroundScrim) val qsTranslation = -ShadeHeader.Dimensions.CollapsedHeightForTransitions * 0.66f translate(QuickSettings.Elements.QuickQuickSettings, y = qsTranslation) translate(MediaCarousel.Elements.Content, y = qsTranslation) Loading packages/SystemUI/compose/features/src/com/android/systemui/shade/ui/composable/ShadeScene.kt +5 −10 Original line number Diff line number Diff line Loading @@ -49,7 +49,7 @@ import androidx.compose.runtime.remember import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.CompositingStrategy import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.graphicsLayer import androidx.compose.ui.layout.Layout import androidx.compose.ui.layout.layoutId Loading Loading @@ -252,6 +252,8 @@ private fun ContentScope.SingleShade( ) { val cutoutLocation = LocalDisplayCutout.current().location val cutoutInsets = WindowInsets.Companion.displayCutout // TODO(b/428779792): update color to match BC25 spec val shadePanelColor = Color.Gray.copy(alpha = 0.32f) mediaHost.expansion = if (usingCollapsedLandscapeMedia && isLandscape()) COLLAPSED else EXPANDED var maxNotifScrimTop by remember { mutableIntStateOf(0) } Loading Loading @@ -303,19 +305,12 @@ private fun ContentScope.SingleShade( ) } Box( modifier = modifier.thenIf(shouldPunchHoleBehindScrim) { // Render the scene to an offscreen buffer so that BlendMode.DstOut only clears this // scene (and not the one under it) during a scene transition. Modifier.graphicsLayer(compositingStrategy = CompositingStrategy.Offscreen) } ) { Box() { Box( modifier = Modifier.fillMaxSize() .element(Shade.Elements.BackgroundScrim) .background(colorResource(R.color.shade_scrim_background_dark)) .background(shadePanelColor) ) Layout( modifier = Loading Loading
packages/SystemUI/compose/features/src/com/android/systemui/notifications/ui/composable/Notifications.kt +13 −21 Original line number Diff line number Diff line Loading @@ -50,7 +50,6 @@ import androidx.compose.foundation.layout.windowInsetsBottomHeight import androidx.compose.foundation.overscroll import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.foundation.verticalScroll import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable import androidx.compose.runtime.DisposableEffect import androidx.compose.runtime.LaunchedEffect Loading @@ -64,9 +63,7 @@ import androidx.compose.runtime.setValue import androidx.compose.runtime.snapshotFlow import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.draw.drawBehind import androidx.compose.ui.geometry.Rect import androidx.compose.ui.graphics.BlendMode import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.graphicsLayer import androidx.compose.ui.input.nestedscroll.NestedScrollConnection Loading Loading @@ -314,7 +311,8 @@ fun ContentScope.NotificationScrollingStack( val density = LocalDensity.current val screenCornerRadius = LocalScreenCornerRadius.current val scrimCornerRadius = dimensionResource(R.dimen.notification_scrim_corner_radius) val scrimBackgroundColor = MaterialTheme.colorScheme.surface // TODO(b/428779792): update color to match BC25 spec val surfaceEffect0Color = Color.Gray.copy(alpha = 0.5f) val scrollState = shadeSession.rememberSaveableSession(saver = ScrollState.Saver, key = "ScrollState") { ScrollState(initial = 0) Loading Loading @@ -609,27 +607,21 @@ fun ContentScope.NotificationScrollingStack( Modifier.clickable(onClick = { onEmptySpaceClick?.invoke() }) } ) { // Creates a cutout in the background scrim in the shape of the notifications scrim. // Only visible when notif scrim alpha < 1, during shade expansion. if (shouldPunchHoleBehindScrim) { Spacer( modifier = Modifier.fillMaxSize().drawBehind { drawRect(Color.Black, blendMode = BlendMode.DstOut) } ) } Box( modifier = Modifier.graphicsLayer { alpha = if (shouldPunchHoleBehindScrim) { (expansionFraction / EXPANSION_FOR_MAX_SCRIM_ALPHA).coerceAtMost(1f) } else 1f } .thenIf(shouldShowScrim) { Modifier.background(scrimBackgroundColor) } .thenIf(shouldFillMaxSize) { Modifier.fillMaxSize() } .thenIf(supportNestedScrolling) { Modifier.padding(bottom = minScrimTop) } .thenIf(shouldShowScrim) { Modifier.background(surfaceEffect0Color) } .thenIf(shouldFillMaxSize) { Modifier.fillMaxSize() } .thenIf(supportNestedScrolling) { Modifier.padding(bottom = minScrimTop) } .debugBackground(viewModel, DEBUG_BOX_COLOR) ) { Column( Loading
packages/SystemUI/compose/features/src/com/android/systemui/scene/ui/composable/transitions/ToShadeTransition.kt +3 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import com.android.systemui.media.controls.ui.composable.MediaCarousel import com.android.systemui.notifications.ui.composable.Notifications import com.android.systemui.qs.ui.composable.QuickSettings import com.android.systemui.scene.shared.model.Scenes import com.android.systemui.shade.ui.composable.Shade import com.android.systemui.shade.ui.composable.ShadeHeader import kotlin.time.Duration.Companion.milliseconds Loading @@ -42,6 +43,8 @@ fun TransitionBuilder.toShadeTransition(durationScale: Double = 1.0) { fade(QuickSettings.Elements.FooterActions) } fade(Shade.Elements.BackgroundScrim) val qsTranslation = -ShadeHeader.Dimensions.CollapsedHeightForTransitions * 0.66f translate(QuickSettings.Elements.QuickQuickSettings, y = qsTranslation) translate(MediaCarousel.Elements.Content, y = qsTranslation) Loading
packages/SystemUI/compose/features/src/com/android/systemui/shade/ui/composable/ShadeScene.kt +5 −10 Original line number Diff line number Diff line Loading @@ -49,7 +49,7 @@ import androidx.compose.runtime.remember import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.CompositingStrategy import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.graphicsLayer import androidx.compose.ui.layout.Layout import androidx.compose.ui.layout.layoutId Loading Loading @@ -252,6 +252,8 @@ private fun ContentScope.SingleShade( ) { val cutoutLocation = LocalDisplayCutout.current().location val cutoutInsets = WindowInsets.Companion.displayCutout // TODO(b/428779792): update color to match BC25 spec val shadePanelColor = Color.Gray.copy(alpha = 0.32f) mediaHost.expansion = if (usingCollapsedLandscapeMedia && isLandscape()) COLLAPSED else EXPANDED var maxNotifScrimTop by remember { mutableIntStateOf(0) } Loading Loading @@ -303,19 +305,12 @@ private fun ContentScope.SingleShade( ) } Box( modifier = modifier.thenIf(shouldPunchHoleBehindScrim) { // Render the scene to an offscreen buffer so that BlendMode.DstOut only clears this // scene (and not the one under it) during a scene transition. Modifier.graphicsLayer(compositingStrategy = CompositingStrategy.Offscreen) } ) { Box() { Box( modifier = Modifier.fillMaxSize() .element(Shade.Elements.BackgroundScrim) .background(colorResource(R.color.shade_scrim_background_dark)) .background(shadePanelColor) ) Layout( modifier = Loading