Loading packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/blueprint/DefaultBlueprint.kt +13 −30 Original line number Diff line number Diff line Loading @@ -21,7 +21,6 @@ import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.fillMaxHeight import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue Loading Loading @@ -70,10 +69,7 @@ constructor( override val id: String = "default" @Composable override fun SceneScope.Content( viewModel: LockscreenContentViewModel, modifier: Modifier, ) { override fun SceneScope.Content(viewModel: LockscreenContentViewModel, modifier: Modifier) { val isUdfpsVisible = viewModel.isUdfpsVisible val isShadeLayoutWide by viewModel.isShadeLayoutWide.collectAsStateWithLifecycle() val unfoldTranslations by viewModel.unfoldTranslations.collectAsStateWithLifecycle() Loading @@ -85,22 +81,18 @@ constructor( with(notificationSection) { HeadsUpNotifications() } } LockscreenLongPress( viewModel = viewModel.touchHandling, modifier = modifier, ) { onSettingsMenuPlaced -> LockscreenLongPress(viewModel = viewModel.touchHandling, modifier = modifier) { onSettingsMenuPlaced -> Layout( content = { // Constrained to above the lock icon. Column( modifier = Modifier.fillMaxSize(), ) { Column(modifier = Modifier.fillMaxSize()) { with(statusBarSection) { StatusBar( modifier = Modifier.fillMaxWidth() .padding( horizontal = { unfoldTranslations.start.roundToInt() }, horizontal = { unfoldTranslations.start.roundToInt() } ) ) } Loading @@ -109,13 +101,14 @@ constructor( with(topAreaSection) { DefaultClockLayout( smartSpacePaddingTop = viewModel::getSmartSpacePaddingTop, isShadeLayoutWide = isShadeLayoutWide, modifier = Modifier.thenIf(isShadeLayoutWide) { Modifier.fillMaxWidth(0.5f) } .graphicsLayer { translationX = unfoldTranslations.start } }, ) } if (isShadeLayoutWide && !isBypassEnabled) { Loading @@ -127,7 +120,7 @@ constructor( modifier = Modifier.fillMaxWidth(0.5f) .fillMaxHeight() .align(alignment = Alignment.TopEnd) .align(alignment = Alignment.TopEnd), ) } } Loading @@ -142,7 +135,7 @@ constructor( AodNotificationIcons( modifier = Modifier.align(alignment = Alignment.TopStart) .padding(start = aodIconPadding), .padding(start = aodIconPadding) ) Notifications( areNotificationsVisible = areNotificationsVisible, Loading @@ -152,7 +145,7 @@ constructor( } } else { AodNotificationIcons( modifier = Modifier.padding(start = aodIconPadding), modifier = Modifier.padding(start = aodIconPadding) ) } } Loading Loading @@ -205,11 +198,7 @@ constructor( val endShortcutMeasurable = measurables[4] val settingsMenuMeasurable = measurables[5] val noMinConstraints = constraints.copy( minWidth = 0, minHeight = 0, ) val noMinConstraints = constraints.copy(minWidth = 0, minHeight = 0) val lockIconPlaceable = lockIconMeasurable.measure(noMinConstraints) val lockIconBounds = IntRect( Loading @@ -235,14 +224,8 @@ constructor( val settingsMenuPlaceable = settingsMenuMeasurable.measure(noMinConstraints) layout(constraints.maxWidth, constraints.maxHeight) { aboveLockIconPlaceable.place( x = 0, y = 0, ) lockIconPlaceable.place( x = lockIconBounds.left, y = lockIconBounds.top, ) aboveLockIconPlaceable.place(x = 0, y = 0) lockIconPlaceable.place(x = lockIconBounds.left, y = lockIconBounds.top) belowLockIconPlaceable.place( x = 0, y = constraints.maxHeight - belowLockIconPlaceable.height, Loading packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/section/MediaCarouselSection.kt +15 −3 Original line number Diff line number Diff line Loading @@ -17,9 +17,11 @@ package com.android.systemui.keyguard.ui.composable.section import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue import androidx.compose.ui.Modifier import androidx.compose.ui.res.dimensionResource import androidx.lifecycle.compose.collectAsStateWithLifecycle import com.android.compose.animation.scene.SceneScope import com.android.systemui.keyguard.ui.viewmodel.KeyguardMediaViewModel Loading @@ -27,6 +29,7 @@ import com.android.systemui.media.controls.ui.composable.MediaCarousel import com.android.systemui.media.controls.ui.controller.MediaCarouselController import com.android.systemui.media.controls.ui.view.MediaHost import com.android.systemui.media.dagger.MediaModule import com.android.systemui.res.R import javax.inject.Inject import javax.inject.Named Loading @@ -39,13 +42,22 @@ constructor( ) { @Composable fun SceneScope.KeyguardMediaCarousel() { fun SceneScope.KeyguardMediaCarousel( isShadeLayoutWide: Boolean, modifier: Modifier = Modifier, ) { val isMediaVisible by keyguardMediaViewModel.isMediaVisible.collectAsStateWithLifecycle() val horizontalPadding = if (isShadeLayoutWide) { dimensionResource(id = R.dimen.notification_side_paddings) } else { dimensionResource(id = R.dimen.notification_side_paddings) + dimensionResource(id = R.dimen.notification_panel_margin_horizontal) } MediaCarousel( isVisible = isMediaVisible, mediaHost = mediaHost, modifier = Modifier.fillMaxWidth(), modifier = modifier.fillMaxWidth().padding(horizontal = horizontalPadding), carouselController = mediaCarouselController, ) } Loading packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/section/TopAreaSection.kt +2 −1 Original line number Diff line number Diff line Loading @@ -63,6 +63,7 @@ constructor( @Composable fun SceneScope.DefaultClockLayout( smartSpacePaddingTop: (Resources) -> Int, isShadeLayoutWide: Boolean, modifier: Modifier = Modifier, ) { val currentClockLayout by clockViewModel.currentClockLayout.collectAsStateWithLifecycle() Loading Loading @@ -128,7 +129,7 @@ constructor( ) } } with(mediaCarouselSection) { KeyguardMediaCarousel() } with(mediaCarouselSection) { KeyguardMediaCarousel(isShadeLayoutWide) } } } Loading packages/SystemUI/compose/features/src/com/android/systemui/qs/ui/composable/QuickSettings.kt +2 −2 Original line number Diff line number Diff line Loading @@ -79,8 +79,8 @@ object QuickSettings { val MediaLandscapeTopOffset = ValueKey("MediaLandscapeTopOffset") object MediaOffset { // Brightness + padding val InQS = 92.dp // Brightness val InQS = 60.dp val Default = 0.dp @Composable Loading packages/SystemUI/compose/features/src/com/android/systemui/qs/ui/composable/QuickSettingsScene.kt +6 −1 Original line number Diff line number Diff line Loading @@ -74,6 +74,7 @@ import com.android.compose.animation.scene.UserActionResult import com.android.compose.animation.scene.animateSceneDpAsState import com.android.compose.animation.scene.animateSceneFloatAsState import com.android.compose.animation.scene.content.state.TransitionState import com.android.compose.modifiers.padding import com.android.compose.modifiers.thenIf import com.android.compose.windowsizeclass.LocalWindowSizeClass import com.android.systemui.battery.BatteryMeterViewController Loading Loading @@ -379,7 +380,11 @@ private fun SceneScope.QuickSettingsScene( mediaHost = mediaHost, modifier = Modifier.fillMaxWidth() .layoutId(QSMediaMeasurePolicy.LayoutId.Media), .layoutId(QSMediaMeasurePolicy.LayoutId.Media) .padding( horizontal = dimensionResource(id = R.dimen.qs_horizontal_margin) ), carouselController = mediaCarouselController, ) } Loading Loading
packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/blueprint/DefaultBlueprint.kt +13 −30 Original line number Diff line number Diff line Loading @@ -21,7 +21,6 @@ import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.fillMaxHeight import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue Loading Loading @@ -70,10 +69,7 @@ constructor( override val id: String = "default" @Composable override fun SceneScope.Content( viewModel: LockscreenContentViewModel, modifier: Modifier, ) { override fun SceneScope.Content(viewModel: LockscreenContentViewModel, modifier: Modifier) { val isUdfpsVisible = viewModel.isUdfpsVisible val isShadeLayoutWide by viewModel.isShadeLayoutWide.collectAsStateWithLifecycle() val unfoldTranslations by viewModel.unfoldTranslations.collectAsStateWithLifecycle() Loading @@ -85,22 +81,18 @@ constructor( with(notificationSection) { HeadsUpNotifications() } } LockscreenLongPress( viewModel = viewModel.touchHandling, modifier = modifier, ) { onSettingsMenuPlaced -> LockscreenLongPress(viewModel = viewModel.touchHandling, modifier = modifier) { onSettingsMenuPlaced -> Layout( content = { // Constrained to above the lock icon. Column( modifier = Modifier.fillMaxSize(), ) { Column(modifier = Modifier.fillMaxSize()) { with(statusBarSection) { StatusBar( modifier = Modifier.fillMaxWidth() .padding( horizontal = { unfoldTranslations.start.roundToInt() }, horizontal = { unfoldTranslations.start.roundToInt() } ) ) } Loading @@ -109,13 +101,14 @@ constructor( with(topAreaSection) { DefaultClockLayout( smartSpacePaddingTop = viewModel::getSmartSpacePaddingTop, isShadeLayoutWide = isShadeLayoutWide, modifier = Modifier.thenIf(isShadeLayoutWide) { Modifier.fillMaxWidth(0.5f) } .graphicsLayer { translationX = unfoldTranslations.start } }, ) } if (isShadeLayoutWide && !isBypassEnabled) { Loading @@ -127,7 +120,7 @@ constructor( modifier = Modifier.fillMaxWidth(0.5f) .fillMaxHeight() .align(alignment = Alignment.TopEnd) .align(alignment = Alignment.TopEnd), ) } } Loading @@ -142,7 +135,7 @@ constructor( AodNotificationIcons( modifier = Modifier.align(alignment = Alignment.TopStart) .padding(start = aodIconPadding), .padding(start = aodIconPadding) ) Notifications( areNotificationsVisible = areNotificationsVisible, Loading @@ -152,7 +145,7 @@ constructor( } } else { AodNotificationIcons( modifier = Modifier.padding(start = aodIconPadding), modifier = Modifier.padding(start = aodIconPadding) ) } } Loading Loading @@ -205,11 +198,7 @@ constructor( val endShortcutMeasurable = measurables[4] val settingsMenuMeasurable = measurables[5] val noMinConstraints = constraints.copy( minWidth = 0, minHeight = 0, ) val noMinConstraints = constraints.copy(minWidth = 0, minHeight = 0) val lockIconPlaceable = lockIconMeasurable.measure(noMinConstraints) val lockIconBounds = IntRect( Loading @@ -235,14 +224,8 @@ constructor( val settingsMenuPlaceable = settingsMenuMeasurable.measure(noMinConstraints) layout(constraints.maxWidth, constraints.maxHeight) { aboveLockIconPlaceable.place( x = 0, y = 0, ) lockIconPlaceable.place( x = lockIconBounds.left, y = lockIconBounds.top, ) aboveLockIconPlaceable.place(x = 0, y = 0) lockIconPlaceable.place(x = lockIconBounds.left, y = lockIconBounds.top) belowLockIconPlaceable.place( x = 0, y = constraints.maxHeight - belowLockIconPlaceable.height, Loading
packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/section/MediaCarouselSection.kt +15 −3 Original line number Diff line number Diff line Loading @@ -17,9 +17,11 @@ package com.android.systemui.keyguard.ui.composable.section import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue import androidx.compose.ui.Modifier import androidx.compose.ui.res.dimensionResource import androidx.lifecycle.compose.collectAsStateWithLifecycle import com.android.compose.animation.scene.SceneScope import com.android.systemui.keyguard.ui.viewmodel.KeyguardMediaViewModel Loading @@ -27,6 +29,7 @@ import com.android.systemui.media.controls.ui.composable.MediaCarousel import com.android.systemui.media.controls.ui.controller.MediaCarouselController import com.android.systemui.media.controls.ui.view.MediaHost import com.android.systemui.media.dagger.MediaModule import com.android.systemui.res.R import javax.inject.Inject import javax.inject.Named Loading @@ -39,13 +42,22 @@ constructor( ) { @Composable fun SceneScope.KeyguardMediaCarousel() { fun SceneScope.KeyguardMediaCarousel( isShadeLayoutWide: Boolean, modifier: Modifier = Modifier, ) { val isMediaVisible by keyguardMediaViewModel.isMediaVisible.collectAsStateWithLifecycle() val horizontalPadding = if (isShadeLayoutWide) { dimensionResource(id = R.dimen.notification_side_paddings) } else { dimensionResource(id = R.dimen.notification_side_paddings) + dimensionResource(id = R.dimen.notification_panel_margin_horizontal) } MediaCarousel( isVisible = isMediaVisible, mediaHost = mediaHost, modifier = Modifier.fillMaxWidth(), modifier = modifier.fillMaxWidth().padding(horizontal = horizontalPadding), carouselController = mediaCarouselController, ) } Loading
packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/section/TopAreaSection.kt +2 −1 Original line number Diff line number Diff line Loading @@ -63,6 +63,7 @@ constructor( @Composable fun SceneScope.DefaultClockLayout( smartSpacePaddingTop: (Resources) -> Int, isShadeLayoutWide: Boolean, modifier: Modifier = Modifier, ) { val currentClockLayout by clockViewModel.currentClockLayout.collectAsStateWithLifecycle() Loading Loading @@ -128,7 +129,7 @@ constructor( ) } } with(mediaCarouselSection) { KeyguardMediaCarousel() } with(mediaCarouselSection) { KeyguardMediaCarousel(isShadeLayoutWide) } } } Loading
packages/SystemUI/compose/features/src/com/android/systemui/qs/ui/composable/QuickSettings.kt +2 −2 Original line number Diff line number Diff line Loading @@ -79,8 +79,8 @@ object QuickSettings { val MediaLandscapeTopOffset = ValueKey("MediaLandscapeTopOffset") object MediaOffset { // Brightness + padding val InQS = 92.dp // Brightness val InQS = 60.dp val Default = 0.dp @Composable Loading
packages/SystemUI/compose/features/src/com/android/systemui/qs/ui/composable/QuickSettingsScene.kt +6 −1 Original line number Diff line number Diff line Loading @@ -74,6 +74,7 @@ import com.android.compose.animation.scene.UserActionResult import com.android.compose.animation.scene.animateSceneDpAsState import com.android.compose.animation.scene.animateSceneFloatAsState import com.android.compose.animation.scene.content.state.TransitionState import com.android.compose.modifiers.padding import com.android.compose.modifiers.thenIf import com.android.compose.windowsizeclass.LocalWindowSizeClass import com.android.systemui.battery.BatteryMeterViewController Loading Loading @@ -379,7 +380,11 @@ private fun SceneScope.QuickSettingsScene( mediaHost = mediaHost, modifier = Modifier.fillMaxWidth() .layoutId(QSMediaMeasurePolicy.LayoutId.Media), .layoutId(QSMediaMeasurePolicy.LayoutId.Media) .padding( horizontal = dimensionResource(id = R.dimen.qs_horizontal_margin) ), carouselController = mediaCarouselController, ) } Loading