Loading packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/blueprint/DefaultBlueprint.kt +24 −3 Original line number Diff line number Diff line Loading @@ -93,6 +93,7 @@ constructor( SmallClock( burnInParams = burnIn.parameters, onTopChanged = burnIn.onSmallClockTopChanged, onBottomChanged = { bottom -> viewModel.setSmallClockBottom(bottom) }, ) } }, Loading @@ -107,13 +108,21 @@ constructor( SmartSpace( burnInParams = burnIn.parameters, onTopChanged = burnIn.onSmartspaceTopChanged, onBottomChanged = { bottom -> viewModel.setSmartspaceCardBottom(bottom) }, smartSpacePaddingTop = { 0 }, ) } }, media = { with(mediaCarouselElement) { KeyguardMediaCarousel(isShadeLayoutWide = viewModel.isShadeLayoutWide) KeyguardMediaCarousel( isShadeLayoutWide = viewModel.isShadeLayoutWide, onBottomChanged = { bottom -> viewModel.setMediaPlayerBottom(bottom = bottom) }, ) } }, notifications = { Loading @@ -126,7 +135,13 @@ constructor( }, lockIcon = { with(lockElement) { LockIcon() } }, startShortcut = { with(shortcutElement) { Shortcut(isStart = true, applyPadding = false) } with(shortcutElement) { Shortcut( isStart = true, applyPadding = false, onTopChanged = { top -> viewModel.setShortcutTop(top) }, ) } }, ambientIndication = { if (ambientIndicationElementOptional.isPresent) { Loading @@ -141,7 +156,13 @@ constructor( } }, endShortcut = { with(shortcutElement) { Shortcut(isStart = false, applyPadding = false) } with(shortcutElement) { Shortcut( isStart = false, applyPadding = false, onTopChanged = { top -> viewModel.setShortcutTop(top) }, ) } }, settingsMenu = { with(settingsMenuElement) { SettingsMenu(onPlaced = onSettingsMenuPlaced) } Loading packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/element/MediaCarouselElement.kt +11 −1 Original line number Diff line number Diff line Loading @@ -20,6 +20,8 @@ import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.layout.boundsInWindow import androidx.compose.ui.layout.onGloballyPositioned import androidx.compose.ui.res.dimensionResource import com.android.compose.animation.scene.ContentScope import com.android.systemui.media.controls.ui.composable.MediaCarousel Loading @@ -41,6 +43,7 @@ constructor( fun ContentScope.KeyguardMediaCarousel( isShadeLayoutWide: Boolean, modifier: Modifier = Modifier, onBottomChanged: ((Float) -> Unit)? = null, ) { val horizontalPadding = if (isShadeLayoutWide) { Loading @@ -52,8 +55,15 @@ constructor( MediaCarousel( isVisible = true, mediaHost = mediaHost, modifier = modifier.fillMaxWidth().padding(horizontal = horizontalPadding), modifier = modifier .fillMaxWidth() .padding(horizontal = horizontalPadding) .onGloballyPositioned { coordinates -> onBottomChanged?.invoke(coordinates.boundsInWindow().bottom) }, carouselController = mediaCarouselController, onReleaseCallback = { onBottomChanged?.invoke(0f) }, ) } } packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/element/ShortcutElement.kt +11 −5 Original line number Diff line number Diff line Loading @@ -24,6 +24,8 @@ import androidx.compose.foundation.layout.size import androidx.compose.runtime.Composable import androidx.compose.runtime.mutableStateOf import androidx.compose.ui.Modifier import androidx.compose.ui.layout.boundsInWindow import androidx.compose.ui.layout.onGloballyPositioned import androidx.compose.ui.res.dimensionResource import androidx.compose.ui.unit.DpSize import androidx.compose.ui.viewinterop.AndroidView Loading Loading @@ -58,6 +60,7 @@ constructor( fun ContentScope.Shortcut( isStart: Boolean, applyPadding: Boolean, onTopChanged: ((Float) -> Unit)? = null, modifier: Modifier = Modifier, ) { Element( Loading @@ -71,10 +74,13 @@ constructor( indicationController = indicationController, binder = keyguardQuickAffordanceViewBinder, modifier = if (applyPadding) { (if (applyPadding) { Modifier.shortcutPadding() } else { Modifier }) .onGloballyPositioned { coordinates -> onTopChanged?.invoke(coordinates.boundsInWindow().top) }, ) } Loading packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/element/SmallClockElement.kt +8 −2 Original line number Diff line number Diff line Loading @@ -21,6 +21,8 @@ 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.layout.boundsInWindow import androidx.compose.ui.layout.onGloballyPositioned import androidx.compose.ui.res.dimensionResource import androidx.lifecycle.compose.collectAsStateWithLifecycle import com.android.compose.animation.scene.ContentScope Loading @@ -44,9 +46,10 @@ constructor( @Composable fun ContentScope.SmallClock( modifier: Modifier = Modifier, burnInParams: BurnInParameters, onTopChanged: (top: Float?) -> Unit, modifier: Modifier = Modifier, onBottomChanged: ((Float) -> Unit)? = null, ) { val currentClock by viewModel.currentClock.collectAsStateWithLifecycle() val smallTopMargin by Loading @@ -66,7 +69,10 @@ constructor( .padding(top = { smallTopMargin }) .onTopPlacementChanged(onTopChanged) .burnInAware(viewModel = aodBurnInViewModel, params = burnInParams) .element(smallClockElementKey), .element(smallClockElementKey) .onGloballyPositioned { coordinates -> onBottomChanged?.invoke(coordinates.boundsInWindow().bottom) }, ) } } packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/element/SmartSpaceElement.kt +6 −0 Original line number Diff line number Diff line Loading @@ -30,6 +30,8 @@ import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.layout.boundsInWindow import androidx.compose.ui.layout.onGloballyPositioned import androidx.compose.ui.platform.LocalResources import androidx.compose.ui.res.dimensionResource import androidx.compose.ui.unit.dp Loading Loading @@ -60,6 +62,7 @@ constructor( fun ContentScope.SmartSpace( burnInParams: BurnInParameters, onTopChanged: (top: Float?) -> Unit, onBottomChanged: ((Float) -> Unit)?, smartSpacePaddingTop: (Resources) -> Int, modifier: Modifier = Modifier, ) { Loading Loading @@ -120,6 +123,9 @@ constructor( Modifier.fillMaxWidth() .padding(start = paddingCardHorizontal, end = paddingCardHorizontal) .burnInAware(viewModel = aodBurnInViewModel, params = burnInParams) .onGloballyPositioned { coordinates -> onBottomChanged?.invoke(coordinates.boundsInWindow().bottom) } ) } } Loading Loading
packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/blueprint/DefaultBlueprint.kt +24 −3 Original line number Diff line number Diff line Loading @@ -93,6 +93,7 @@ constructor( SmallClock( burnInParams = burnIn.parameters, onTopChanged = burnIn.onSmallClockTopChanged, onBottomChanged = { bottom -> viewModel.setSmallClockBottom(bottom) }, ) } }, Loading @@ -107,13 +108,21 @@ constructor( SmartSpace( burnInParams = burnIn.parameters, onTopChanged = burnIn.onSmartspaceTopChanged, onBottomChanged = { bottom -> viewModel.setSmartspaceCardBottom(bottom) }, smartSpacePaddingTop = { 0 }, ) } }, media = { with(mediaCarouselElement) { KeyguardMediaCarousel(isShadeLayoutWide = viewModel.isShadeLayoutWide) KeyguardMediaCarousel( isShadeLayoutWide = viewModel.isShadeLayoutWide, onBottomChanged = { bottom -> viewModel.setMediaPlayerBottom(bottom = bottom) }, ) } }, notifications = { Loading @@ -126,7 +135,13 @@ constructor( }, lockIcon = { with(lockElement) { LockIcon() } }, startShortcut = { with(shortcutElement) { Shortcut(isStart = true, applyPadding = false) } with(shortcutElement) { Shortcut( isStart = true, applyPadding = false, onTopChanged = { top -> viewModel.setShortcutTop(top) }, ) } }, ambientIndication = { if (ambientIndicationElementOptional.isPresent) { Loading @@ -141,7 +156,13 @@ constructor( } }, endShortcut = { with(shortcutElement) { Shortcut(isStart = false, applyPadding = false) } with(shortcutElement) { Shortcut( isStart = false, applyPadding = false, onTopChanged = { top -> viewModel.setShortcutTop(top) }, ) } }, settingsMenu = { with(settingsMenuElement) { SettingsMenu(onPlaced = onSettingsMenuPlaced) } Loading
packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/element/MediaCarouselElement.kt +11 −1 Original line number Diff line number Diff line Loading @@ -20,6 +20,8 @@ import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.layout.boundsInWindow import androidx.compose.ui.layout.onGloballyPositioned import androidx.compose.ui.res.dimensionResource import com.android.compose.animation.scene.ContentScope import com.android.systemui.media.controls.ui.composable.MediaCarousel Loading @@ -41,6 +43,7 @@ constructor( fun ContentScope.KeyguardMediaCarousel( isShadeLayoutWide: Boolean, modifier: Modifier = Modifier, onBottomChanged: ((Float) -> Unit)? = null, ) { val horizontalPadding = if (isShadeLayoutWide) { Loading @@ -52,8 +55,15 @@ constructor( MediaCarousel( isVisible = true, mediaHost = mediaHost, modifier = modifier.fillMaxWidth().padding(horizontal = horizontalPadding), modifier = modifier .fillMaxWidth() .padding(horizontal = horizontalPadding) .onGloballyPositioned { coordinates -> onBottomChanged?.invoke(coordinates.boundsInWindow().bottom) }, carouselController = mediaCarouselController, onReleaseCallback = { onBottomChanged?.invoke(0f) }, ) } }
packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/element/ShortcutElement.kt +11 −5 Original line number Diff line number Diff line Loading @@ -24,6 +24,8 @@ import androidx.compose.foundation.layout.size import androidx.compose.runtime.Composable import androidx.compose.runtime.mutableStateOf import androidx.compose.ui.Modifier import androidx.compose.ui.layout.boundsInWindow import androidx.compose.ui.layout.onGloballyPositioned import androidx.compose.ui.res.dimensionResource import androidx.compose.ui.unit.DpSize import androidx.compose.ui.viewinterop.AndroidView Loading Loading @@ -58,6 +60,7 @@ constructor( fun ContentScope.Shortcut( isStart: Boolean, applyPadding: Boolean, onTopChanged: ((Float) -> Unit)? = null, modifier: Modifier = Modifier, ) { Element( Loading @@ -71,10 +74,13 @@ constructor( indicationController = indicationController, binder = keyguardQuickAffordanceViewBinder, modifier = if (applyPadding) { (if (applyPadding) { Modifier.shortcutPadding() } else { Modifier }) .onGloballyPositioned { coordinates -> onTopChanged?.invoke(coordinates.boundsInWindow().top) }, ) } Loading
packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/element/SmallClockElement.kt +8 −2 Original line number Diff line number Diff line Loading @@ -21,6 +21,8 @@ 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.layout.boundsInWindow import androidx.compose.ui.layout.onGloballyPositioned import androidx.compose.ui.res.dimensionResource import androidx.lifecycle.compose.collectAsStateWithLifecycle import com.android.compose.animation.scene.ContentScope Loading @@ -44,9 +46,10 @@ constructor( @Composable fun ContentScope.SmallClock( modifier: Modifier = Modifier, burnInParams: BurnInParameters, onTopChanged: (top: Float?) -> Unit, modifier: Modifier = Modifier, onBottomChanged: ((Float) -> Unit)? = null, ) { val currentClock by viewModel.currentClock.collectAsStateWithLifecycle() val smallTopMargin by Loading @@ -66,7 +69,10 @@ constructor( .padding(top = { smallTopMargin }) .onTopPlacementChanged(onTopChanged) .burnInAware(viewModel = aodBurnInViewModel, params = burnInParams) .element(smallClockElementKey), .element(smallClockElementKey) .onGloballyPositioned { coordinates -> onBottomChanged?.invoke(coordinates.boundsInWindow().bottom) }, ) } }
packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/element/SmartSpaceElement.kt +6 −0 Original line number Diff line number Diff line Loading @@ -30,6 +30,8 @@ import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.layout.boundsInWindow import androidx.compose.ui.layout.onGloballyPositioned import androidx.compose.ui.platform.LocalResources import androidx.compose.ui.res.dimensionResource import androidx.compose.ui.unit.dp Loading Loading @@ -60,6 +62,7 @@ constructor( fun ContentScope.SmartSpace( burnInParams: BurnInParameters, onTopChanged: (top: Float?) -> Unit, onBottomChanged: ((Float) -> Unit)?, smartSpacePaddingTop: (Resources) -> Int, modifier: Modifier = Modifier, ) { Loading Loading @@ -120,6 +123,9 @@ constructor( Modifier.fillMaxWidth() .padding(start = paddingCardHorizontal, end = paddingCardHorizontal) .burnInAware(viewModel = aodBurnInViewModel, params = burnInParams) .onGloballyPositioned { coordinates -> onBottomChanged?.invoke(coordinates.boundsInWindow().bottom) } ) } } Loading