Loading packages/SystemUI/compose/features/src/com/android/systemui/common/ui/compose/windowinsets/ScreenDecorProvider.kt +6 −1 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import androidx.compose.runtime.Composable import androidx.compose.runtime.CompositionLocalProvider import androidx.compose.runtime.ProvidableCompositionLocal import androidx.compose.runtime.State import androidx.compose.runtime.derivedStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.staticCompositionLocalOf import androidx.compose.ui.platform.LocalContext Loading Loading @@ -52,7 +53,11 @@ fun ScreenDecorProvider(windowInsets: () -> WindowInsets?, content: @Composable val screenCornerRadiusPx = remember(context.display.uniqueId) { ScreenDecorationsUtils.getWindowCornerRadius(context) } val screenCornerRadiusDp = with(LocalDensity.current) { screenCornerRadiusPx.toDp() } val cutout = remember(windowInsets, context) { { windowInsets().toCutout(context) } } val cutout = remember(windowInsets, context) { val cutoutState = derivedStateOf { windowInsets().toCutout(context) } ({ cutoutState.value }) } CompositionLocalProvider( LocalScreenCornerRadius provides screenCornerRadiusDp, Loading packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/element/StatusBarElement.kt +6 −3 Original line number Diff line number Diff line Loading @@ -66,8 +66,7 @@ constructor( @Composable fun StatusBar(modifier: Modifier = Modifier) { val context = LocalContext.current val viewDisplayCutout = LocalDisplayCutout.current().viewDisplayCutoutKeyguardStatusBarView val displayCutout = LocalDisplayCutout.current @SuppressLint("InflateParams") val view = Loading Loading @@ -114,7 +113,11 @@ constructor( }, modifier = modifier.fillMaxWidth().height { Utils.getStatusBarHeaderHeightKeyguard(context) }, update = { viewController.setDisplayCutout(viewDisplayCutout) }, update = { viewController.setDisplayCutout( displayCutout().viewDisplayCutoutKeyguardStatusBarView ) }, ) } Loading packages/SystemUI/compose/features/src/com/android/systemui/shade/ui/composable/ShadeHeader.kt +2 −1 Original line number Diff line number Diff line Loading @@ -598,7 +598,7 @@ private fun BatteryIconLegacy( val inverseColor = Utils.getColorAttrDefaultColor(themedContext, android.R.attr.textColorPrimaryInverse) val cutoutLocation = LocalDisplayCutout.current().location val cutout = LocalDisplayCutout.current AndroidView( factory = { context -> Loading @@ -618,6 +618,7 @@ private fun BatteryIconLegacy( batteryIcon }, update = { batteryIcon -> val cutoutLocation = cutout().location batteryIcon.setPercentShowMode( if (useExpandedFormat || cutoutLocation != CutoutLocation.CENTER) { BatteryMeterView.MODE_ESTIMATE Loading packages/SystemUI/compose/features/src/com/android/systemui/shade/ui/composable/ShadeScene.kt +3 −2 Original line number Diff line number Diff line Loading @@ -250,7 +250,7 @@ private fun ContentScope.SingleShade( shadeSession: SaveableSession, usingCollapsedLandscapeMedia: Boolean, ) { val cutoutLocation = LocalDisplayCutout.current().location val cutout = LocalDisplayCutout.current val cutoutInsets = WindowInsets.Companion.displayCutout // TODO(b/428779792): update color to match BC25 spec val shadePanelColor = Color.Gray.copy(alpha = 0.32f) Loading Loading @@ -287,7 +287,8 @@ private fun ContentScope.SingleShade( val shadeHorizontalPadding = dimensionResource(id = R.dimen.notification_panel_margin_horizontal) val shadeMeasurePolicy = remember(mediaInRow) { remember(mediaInRow, cutout, cutoutInsets) { val cutoutLocation = cutout().location SingleShadeMeasurePolicy( isMediaInRow = mediaInRow, mediaOffset = { mediaOffset.roundToPx() }, Loading Loading
packages/SystemUI/compose/features/src/com/android/systemui/common/ui/compose/windowinsets/ScreenDecorProvider.kt +6 −1 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import androidx.compose.runtime.Composable import androidx.compose.runtime.CompositionLocalProvider import androidx.compose.runtime.ProvidableCompositionLocal import androidx.compose.runtime.State import androidx.compose.runtime.derivedStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.staticCompositionLocalOf import androidx.compose.ui.platform.LocalContext Loading Loading @@ -52,7 +53,11 @@ fun ScreenDecorProvider(windowInsets: () -> WindowInsets?, content: @Composable val screenCornerRadiusPx = remember(context.display.uniqueId) { ScreenDecorationsUtils.getWindowCornerRadius(context) } val screenCornerRadiusDp = with(LocalDensity.current) { screenCornerRadiusPx.toDp() } val cutout = remember(windowInsets, context) { { windowInsets().toCutout(context) } } val cutout = remember(windowInsets, context) { val cutoutState = derivedStateOf { windowInsets().toCutout(context) } ({ cutoutState.value }) } CompositionLocalProvider( LocalScreenCornerRadius provides screenCornerRadiusDp, Loading
packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/element/StatusBarElement.kt +6 −3 Original line number Diff line number Diff line Loading @@ -66,8 +66,7 @@ constructor( @Composable fun StatusBar(modifier: Modifier = Modifier) { val context = LocalContext.current val viewDisplayCutout = LocalDisplayCutout.current().viewDisplayCutoutKeyguardStatusBarView val displayCutout = LocalDisplayCutout.current @SuppressLint("InflateParams") val view = Loading Loading @@ -114,7 +113,11 @@ constructor( }, modifier = modifier.fillMaxWidth().height { Utils.getStatusBarHeaderHeightKeyguard(context) }, update = { viewController.setDisplayCutout(viewDisplayCutout) }, update = { viewController.setDisplayCutout( displayCutout().viewDisplayCutoutKeyguardStatusBarView ) }, ) } Loading
packages/SystemUI/compose/features/src/com/android/systemui/shade/ui/composable/ShadeHeader.kt +2 −1 Original line number Diff line number Diff line Loading @@ -598,7 +598,7 @@ private fun BatteryIconLegacy( val inverseColor = Utils.getColorAttrDefaultColor(themedContext, android.R.attr.textColorPrimaryInverse) val cutoutLocation = LocalDisplayCutout.current().location val cutout = LocalDisplayCutout.current AndroidView( factory = { context -> Loading @@ -618,6 +618,7 @@ private fun BatteryIconLegacy( batteryIcon }, update = { batteryIcon -> val cutoutLocation = cutout().location batteryIcon.setPercentShowMode( if (useExpandedFormat || cutoutLocation != CutoutLocation.CENTER) { BatteryMeterView.MODE_ESTIMATE Loading
packages/SystemUI/compose/features/src/com/android/systemui/shade/ui/composable/ShadeScene.kt +3 −2 Original line number Diff line number Diff line Loading @@ -250,7 +250,7 @@ private fun ContentScope.SingleShade( shadeSession: SaveableSession, usingCollapsedLandscapeMedia: Boolean, ) { val cutoutLocation = LocalDisplayCutout.current().location val cutout = LocalDisplayCutout.current val cutoutInsets = WindowInsets.Companion.displayCutout // TODO(b/428779792): update color to match BC25 spec val shadePanelColor = Color.Gray.copy(alpha = 0.32f) Loading Loading @@ -287,7 +287,8 @@ private fun ContentScope.SingleShade( val shadeHorizontalPadding = dimensionResource(id = R.dimen.notification_panel_margin_horizontal) val shadeMeasurePolicy = remember(mediaInRow) { remember(mediaInRow, cutout, cutoutInsets) { val cutoutLocation = cutout().location SingleShadeMeasurePolicy( isMediaInRow = mediaInRow, mediaOffset = { mediaOffset.roundToPx() }, Loading