Loading packages/SystemUI/compose/features/src/com/android/systemui/communal/ui/compose/CommunalContent.kt +23 −17 Original line number Original line Diff line number Diff line Loading @@ -71,7 +71,7 @@ constructor( @Composable @Composable fun ContentScope.Content(modifier: Modifier = Modifier) { fun ContentScope.Content(modifier: Modifier = Modifier) { val showLockIcon = !communalSettingsInteractor.isV2FlagEnabled() val showLockIconAndChargingStatus = !communalSettingsInteractor.isV2FlagEnabled() CommunalTouchableSurface(viewModel = viewModel, modifier = modifier) { CommunalTouchableSurface(viewModel = viewModel, modifier = modifier) { val orientation = LocalConfiguration.current.orientation val orientation = LocalConfiguration.current.orientation Loading Loading @@ -100,29 +100,33 @@ constructor( ) ) with(hubOnboardingSection) { BottomSheet() } with(hubOnboardingSection) { BottomSheet() } } } if (showLockIcon) { if (showLockIconAndChargingStatus) { with(lockElement) { with(lockElement) { LockIcon( LockIcon( overrideColor = MaterialTheme.colorScheme.onPrimaryContainer, overrideColor = MaterialTheme.colorScheme.onPrimaryContainer, modifier = Modifier.element(Communal.Elements.LockIcon), modifier = Modifier.element(Communal.Elements.LockIcon), ) ) } } } with(indicationAreaElement) { with(indicationAreaElement) { IndicationArea( IndicationArea( Modifier.element(Communal.Elements.IndicationArea) Modifier.element(Communal.Elements.IndicationArea) .fillMaxWidth() .fillMaxWidth() .padding( .padding( bottom = bottom = dimensionResource(R.dimen.keyguard_indication_margin_bottom) dimensionResource( R.dimen.keyguard_indication_margin_bottom ) ) ) ) ) } } } }, }, ) { measurables, constraints -> ) { measurables, constraints -> val communalGridMeasurable = measurables[0] val communalGridMeasurable = measurables[0] val lockIconMeasurable = if (showLockIcon) measurables[1] else null val lockIconMeasurable = if (showLockIconAndChargingStatus) measurables[1] else null val bottomAreaMeasurable = measurables[if (showLockIcon) 2 else 1] val bottomAreaMeasurable = if (showLockIconAndChargingStatus) measurables[2] else null val noMinConstraints = constraints.copy(minWidth = 0, minHeight = 0) val noMinConstraints = constraints.copy(minWidth = 0, minHeight = 0) Loading @@ -139,7 +143,7 @@ constructor( ) ) } } val bottomAreaPlaceable = bottomAreaMeasurable.measure(noMinConstraints) val bottomAreaPlaceable = bottomAreaMeasurable?.measure(noMinConstraints) val communalGridMaxHeight: Int val communalGridMaxHeight: Int val communalGridPositionY: Int val communalGridPositionY: Int Loading Loading @@ -173,6 +177,7 @@ constructor( lockIconPlaceable!!.place(x = lockIconBounds.left, y = lockIconBounds.top) lockIconPlaceable!!.place(x = lockIconBounds.left, y = lockIconBounds.top) } } if (bottomAreaPlaceable != null) { val bottomAreaTop = constraints.maxHeight - bottomAreaPlaceable.height val bottomAreaTop = constraints.maxHeight - bottomAreaPlaceable.height bottomAreaPlaceable.place(x = 0, y = bottomAreaTop) bottomAreaPlaceable.place(x = 0, y = bottomAreaTop) } } Loading @@ -180,3 +185,4 @@ constructor( } } } } } } } Loading
packages/SystemUI/compose/features/src/com/android/systemui/communal/ui/compose/CommunalContent.kt +23 −17 Original line number Original line Diff line number Diff line Loading @@ -71,7 +71,7 @@ constructor( @Composable @Composable fun ContentScope.Content(modifier: Modifier = Modifier) { fun ContentScope.Content(modifier: Modifier = Modifier) { val showLockIcon = !communalSettingsInteractor.isV2FlagEnabled() val showLockIconAndChargingStatus = !communalSettingsInteractor.isV2FlagEnabled() CommunalTouchableSurface(viewModel = viewModel, modifier = modifier) { CommunalTouchableSurface(viewModel = viewModel, modifier = modifier) { val orientation = LocalConfiguration.current.orientation val orientation = LocalConfiguration.current.orientation Loading Loading @@ -100,29 +100,33 @@ constructor( ) ) with(hubOnboardingSection) { BottomSheet() } with(hubOnboardingSection) { BottomSheet() } } } if (showLockIcon) { if (showLockIconAndChargingStatus) { with(lockElement) { with(lockElement) { LockIcon( LockIcon( overrideColor = MaterialTheme.colorScheme.onPrimaryContainer, overrideColor = MaterialTheme.colorScheme.onPrimaryContainer, modifier = Modifier.element(Communal.Elements.LockIcon), modifier = Modifier.element(Communal.Elements.LockIcon), ) ) } } } with(indicationAreaElement) { with(indicationAreaElement) { IndicationArea( IndicationArea( Modifier.element(Communal.Elements.IndicationArea) Modifier.element(Communal.Elements.IndicationArea) .fillMaxWidth() .fillMaxWidth() .padding( .padding( bottom = bottom = dimensionResource(R.dimen.keyguard_indication_margin_bottom) dimensionResource( R.dimen.keyguard_indication_margin_bottom ) ) ) ) ) } } } }, }, ) { measurables, constraints -> ) { measurables, constraints -> val communalGridMeasurable = measurables[0] val communalGridMeasurable = measurables[0] val lockIconMeasurable = if (showLockIcon) measurables[1] else null val lockIconMeasurable = if (showLockIconAndChargingStatus) measurables[1] else null val bottomAreaMeasurable = measurables[if (showLockIcon) 2 else 1] val bottomAreaMeasurable = if (showLockIconAndChargingStatus) measurables[2] else null val noMinConstraints = constraints.copy(minWidth = 0, minHeight = 0) val noMinConstraints = constraints.copy(minWidth = 0, minHeight = 0) Loading @@ -139,7 +143,7 @@ constructor( ) ) } } val bottomAreaPlaceable = bottomAreaMeasurable.measure(noMinConstraints) val bottomAreaPlaceable = bottomAreaMeasurable?.measure(noMinConstraints) val communalGridMaxHeight: Int val communalGridMaxHeight: Int val communalGridPositionY: Int val communalGridPositionY: Int Loading Loading @@ -173,6 +177,7 @@ constructor( lockIconPlaceable!!.place(x = lockIconBounds.left, y = lockIconBounds.top) lockIconPlaceable!!.place(x = lockIconBounds.left, y = lockIconBounds.top) } } if (bottomAreaPlaceable != null) { val bottomAreaTop = constraints.maxHeight - bottomAreaPlaceable.height val bottomAreaTop = constraints.maxHeight - bottomAreaPlaceable.height bottomAreaPlaceable.place(x = 0, y = bottomAreaTop) bottomAreaPlaceable.place(x = 0, y = bottomAreaTop) } } Loading @@ -180,3 +185,4 @@ constructor( } } } } } } }