Loading packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/section/BottomAreaSection.kt +17 −21 Original line number Diff line number Diff line Loading @@ -70,7 +70,6 @@ constructor( key = if (isStart) StartButtonElementKey else EndButtonElementKey, modifier = modifier, ) { content { Shortcut( viewId = if (isStart) R.id.start_button else R.id.end_button, viewModel = if (isStart) viewModel.startButton else viewModel.endButton, Loading @@ -86,19 +85,16 @@ constructor( ) } } } @Composable fun ContentScope.IndicationArea(modifier: Modifier = Modifier) { Element(key = IndicationAreaElementKey, modifier = modifier.indicationAreaPadding()) { content { IndicationArea( indicationAreaViewModel = indicationAreaViewModel, indicationController = indicationController, ) } } } @Composable fun shortcutSizeDp(): DpSize { Loading packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/section/DefaultClockSection.kt +10 −14 Original line number Diff line number Diff line Loading @@ -26,11 +26,9 @@ import androidx.compose.foundation.layout.padding import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.getValue import androidx.compose.runtime.key import androidx.compose.ui.Modifier import androidx.compose.ui.res.dimensionResource import androidx.compose.ui.viewinterop.AndroidView import androidx.core.view.contains import androidx.lifecycle.compose.collectAsStateWithLifecycle import com.android.compose.animation.scene.ContentScope import com.android.compose.modifiers.padding Loading Loading @@ -132,7 +130,6 @@ constructor( } Element(key = largeClockElementKey, modifier = modifier) { content { ClockView( checkNotNull(currentClock).largeClock.view, modifier = Loading @@ -145,7 +142,6 @@ constructor( ) } } } fun getClockCenteringDistance(): Float { return Resources.getSystem().displayMetrics.widthPixels / 4f Loading packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/section/SmartSpaceSection.kt +50 −53 Original line number Diff line number Diff line Loading @@ -66,7 +66,6 @@ constructor( val resources = LocalContext.current.resources Element(key = ClockElementKeys.smartspaceElementKey, modifier = modifier) { content { Column( modifier = modifier Loading @@ -84,8 +83,7 @@ constructor( return@Column } val paddingBelowClockStart = dimensionResource(R.dimen.below_clock_padding_start) val paddingBelowClockStart = dimensionResource(R.dimen.below_clock_padding_start) val paddingBelowClockEnd = dimensionResource(R.dimen.below_clock_padding_end) val paddingCardHorizontal = paddingBelowClockEnd Loading Loading @@ -126,7 +124,6 @@ constructor( } } } } @Composable private fun Card(modifier: Modifier = Modifier) { Loading packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/section/WeatherClockSection.kt +4 −9 Original line number Diff line number Diff line Loading @@ -24,7 +24,6 @@ import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.wrapContentSize import androidx.compose.runtime.Composable import androidx.compose.runtime.key import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.res.dimensionResource Loading Loading @@ -109,16 +108,12 @@ constructor( modifier: Modifier = Modifier, ) { Element(key = elementKey, modifier) { content { ClockView( clock.largeClock.layout.views.firstOrNull { it.id == weatherClockElementViewId }, clock.largeClock.layout.views.firstOrNull { it.id == weatherClockElementViewId }, modifier, ) } } } @Composable fun ContentScope.LargeClockSectionBelowSmartspace( Loading packages/SystemUI/compose/features/src/com/android/systemui/shade/ui/composable/ShadeHeader.kt +29 −26 Original line number Diff line number Diff line Loading @@ -466,8 +466,10 @@ private fun CutoutAwareShadeHeader( private fun ContentScope.Clock(scale: Float, onClick: () -> Unit, modifier: Modifier = Modifier) { val layoutDirection = LocalLayoutDirection.current Element(key = ShadeHeader.Elements.Clock, modifier = modifier) { ElementWithValues(key = ShadeHeader.Elements.Clock, modifier = modifier) { val animatedScale by animateElementFloatAsState(scale, ClockScale, canOverflow = false) content { AndroidView( factory = { context -> Clock( Loading @@ -477,8 +479,8 @@ private fun ContentScope.Clock(scale: Float, onClick: () -> Unit, modifier: Modi }, modifier = modifier // use graphicsLayer instead of Modifier.scale to anchor transform // to the (start, top) corner // use graphicsLayer instead of Modifier.scale to anchor transform to the // (start, top) corner .graphicsLayer { scaleX = animatedScale scaleY = animatedScale Loading @@ -495,6 +497,7 @@ private fun ContentScope.Clock(scale: Float, onClick: () -> Unit, modifier: Modi ) } } } @Composable private fun BatteryIcon( Loading Loading
packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/section/BottomAreaSection.kt +17 −21 Original line number Diff line number Diff line Loading @@ -70,7 +70,6 @@ constructor( key = if (isStart) StartButtonElementKey else EndButtonElementKey, modifier = modifier, ) { content { Shortcut( viewId = if (isStart) R.id.start_button else R.id.end_button, viewModel = if (isStart) viewModel.startButton else viewModel.endButton, Loading @@ -86,19 +85,16 @@ constructor( ) } } } @Composable fun ContentScope.IndicationArea(modifier: Modifier = Modifier) { Element(key = IndicationAreaElementKey, modifier = modifier.indicationAreaPadding()) { content { IndicationArea( indicationAreaViewModel = indicationAreaViewModel, indicationController = indicationController, ) } } } @Composable fun shortcutSizeDp(): DpSize { Loading
packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/section/DefaultClockSection.kt +10 −14 Original line number Diff line number Diff line Loading @@ -26,11 +26,9 @@ import androidx.compose.foundation.layout.padding import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.getValue import androidx.compose.runtime.key import androidx.compose.ui.Modifier import androidx.compose.ui.res.dimensionResource import androidx.compose.ui.viewinterop.AndroidView import androidx.core.view.contains import androidx.lifecycle.compose.collectAsStateWithLifecycle import com.android.compose.animation.scene.ContentScope import com.android.compose.modifiers.padding Loading Loading @@ -132,7 +130,6 @@ constructor( } Element(key = largeClockElementKey, modifier = modifier) { content { ClockView( checkNotNull(currentClock).largeClock.view, modifier = Loading @@ -145,7 +142,6 @@ constructor( ) } } } fun getClockCenteringDistance(): Float { return Resources.getSystem().displayMetrics.widthPixels / 4f Loading
packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/section/SmartSpaceSection.kt +50 −53 Original line number Diff line number Diff line Loading @@ -66,7 +66,6 @@ constructor( val resources = LocalContext.current.resources Element(key = ClockElementKeys.smartspaceElementKey, modifier = modifier) { content { Column( modifier = modifier Loading @@ -84,8 +83,7 @@ constructor( return@Column } val paddingBelowClockStart = dimensionResource(R.dimen.below_clock_padding_start) val paddingBelowClockStart = dimensionResource(R.dimen.below_clock_padding_start) val paddingBelowClockEnd = dimensionResource(R.dimen.below_clock_padding_end) val paddingCardHorizontal = paddingBelowClockEnd Loading Loading @@ -126,7 +124,6 @@ constructor( } } } } @Composable private fun Card(modifier: Modifier = Modifier) { Loading
packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/section/WeatherClockSection.kt +4 −9 Original line number Diff line number Diff line Loading @@ -24,7 +24,6 @@ import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.wrapContentSize import androidx.compose.runtime.Composable import androidx.compose.runtime.key import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.res.dimensionResource Loading Loading @@ -109,16 +108,12 @@ constructor( modifier: Modifier = Modifier, ) { Element(key = elementKey, modifier) { content { ClockView( clock.largeClock.layout.views.firstOrNull { it.id == weatherClockElementViewId }, clock.largeClock.layout.views.firstOrNull { it.id == weatherClockElementViewId }, modifier, ) } } } @Composable fun ContentScope.LargeClockSectionBelowSmartspace( Loading
packages/SystemUI/compose/features/src/com/android/systemui/shade/ui/composable/ShadeHeader.kt +29 −26 Original line number Diff line number Diff line Loading @@ -466,8 +466,10 @@ private fun CutoutAwareShadeHeader( private fun ContentScope.Clock(scale: Float, onClick: () -> Unit, modifier: Modifier = Modifier) { val layoutDirection = LocalLayoutDirection.current Element(key = ShadeHeader.Elements.Clock, modifier = modifier) { ElementWithValues(key = ShadeHeader.Elements.Clock, modifier = modifier) { val animatedScale by animateElementFloatAsState(scale, ClockScale, canOverflow = false) content { AndroidView( factory = { context -> Clock( Loading @@ -477,8 +479,8 @@ private fun ContentScope.Clock(scale: Float, onClick: () -> Unit, modifier: Modi }, modifier = modifier // use graphicsLayer instead of Modifier.scale to anchor transform // to the (start, top) corner // use graphicsLayer instead of Modifier.scale to anchor transform to the // (start, top) corner .graphicsLayer { scaleX = animatedScale scaleY = animatedScale Loading @@ -495,6 +497,7 @@ private fun ContentScope.Clock(scale: Float, onClick: () -> Unit, modifier: Modi ) } } } @Composable private fun BatteryIcon( Loading