Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0b368d76 authored by Darrell Shi's avatar Darrell Shi
Browse files

Remove charging status on hub v2

This change removes the charging status at the bottom of the glanceable
hub if v2 is enabled.

Test: manual
Bug: 419357983
Flag: com.android.systemui.glanceable_hub_v2
Change-Id: I9850d69cd36ad40f9fd27c2b8a4191f491b27b7c
parent 8d2674c1
Loading
Loading
Loading
Loading
+23 −17
Original line number Diff line number Diff line
@@ -71,7 +71,7 @@ constructor(

    @Composable
    fun ContentScope.Content(modifier: Modifier = Modifier) {
        val showLockIcon = !communalSettingsInteractor.isV2FlagEnabled()
        val showLockIconAndChargingStatus = !communalSettingsInteractor.isV2FlagEnabled()

        CommunalTouchableSurface(viewModel = viewModel, modifier = modifier) {
            val orientation = LocalConfiguration.current.orientation
@@ -100,29 +100,33 @@ constructor(
                        )
                        with(hubOnboardingSection) { BottomSheet() }
                    }
                    if (showLockIcon) {
                    if (showLockIconAndChargingStatus) {
                        with(lockElement) {
                            LockIcon(
                                overrideColor = MaterialTheme.colorScheme.onPrimaryContainer,
                                modifier = Modifier.element(Communal.Elements.LockIcon),
                            )
                        }
                    }

                        with(indicationAreaElement) {
                            IndicationArea(
                                Modifier.element(Communal.Elements.IndicationArea)
                                    .fillMaxWidth()
                                    .padding(
                                        bottom =
                                        dimensionResource(R.dimen.keyguard_indication_margin_bottom)
                                            dimensionResource(
                                                R.dimen.keyguard_indication_margin_bottom
                                            )
                                    )
                            )
                        }
                    }
                },
            ) { measurables, constraints ->
                val communalGridMeasurable = measurables[0]
                val lockIconMeasurable = if (showLockIcon) measurables[1] else null
                val bottomAreaMeasurable = measurables[if (showLockIcon) 2 else 1]
                val lockIconMeasurable = if (showLockIconAndChargingStatus) measurables[1] else null
                val bottomAreaMeasurable =
                    if (showLockIconAndChargingStatus) measurables[2] else null

                val noMinConstraints = constraints.copy(minWidth = 0, minHeight = 0)

@@ -139,7 +143,7 @@ constructor(
                        )
                    }

                val bottomAreaPlaceable = bottomAreaMeasurable.measure(noMinConstraints)
                val bottomAreaPlaceable = bottomAreaMeasurable?.measure(noMinConstraints)

                val communalGridMaxHeight: Int
                val communalGridPositionY: Int
@@ -173,6 +177,7 @@ constructor(
                        lockIconPlaceable!!.place(x = lockIconBounds.left, y = lockIconBounds.top)
                    }

                    if (bottomAreaPlaceable != null) {
                        val bottomAreaTop = constraints.maxHeight - bottomAreaPlaceable.height
                        bottomAreaPlaceable.place(x = 0, y = bottomAreaTop)
                    }
@@ -180,3 +185,4 @@ constructor(
            }
        }
    }
}