summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author William Xiao <wxyz@google.com> 2024-07-24 12:23:41 -0700
committer William Xiao <wxyz@google.com> 2024-07-24 12:27:35 -0700
commitfbc46287b29fc0511f1ebdd86330a317f2a0a425 (patch)
treea9323fd8e544648f5b690a366c2e3f4829ac55c1
parent7fe4dd3f291bf8e0f1c15feca0387805decf8112 (diff)
Fix keyguard indication text on hub getting cut off with larger display/text sizes
The view-based keyguard indication text is placed via constraints to a fixed distance from the bottom of the screen and is allowed to expand as much as it wants. The compose-based one brings its own padding but has its height limited to fit under the lock icon. Since the lock icon UI element is much larger than the icon image itself, this leads to the indication text being cut off. This CL uses the correct bottom padding for the compose-based indication area and removes its heigh restriction. See bug for hierarchy snapshots. Bug: 349510838 Fix: 349510838 Test: verified locally on device Flag: com.android.systemui.communal_hub Change-Id: I36a061c9dc585234ac62565ab63238106c4d2d54
-rw-r--r--packages/SystemUI/compose/features/src/com/android/systemui/communal/ui/compose/CommunalContent.kt8
-rw-r--r--packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/section/BottomAreaSection.kt7
2 files changed, 7 insertions, 8 deletions
diff --git a/packages/SystemUI/compose/features/src/com/android/systemui/communal/ui/compose/CommunalContent.kt b/packages/SystemUI/compose/features/src/com/android/systemui/communal/ui/compose/CommunalContent.kt
index 1ce51afb4fdc..8c38253d6469 100644
--- a/packages/SystemUI/compose/features/src/com/android/systemui/communal/ui/compose/CommunalContent.kt
+++ b/packages/SystemUI/compose/features/src/com/android/systemui/communal/ui/compose/CommunalContent.kt
@@ -98,13 +98,7 @@ constructor(
bottom = lockIconPlaceable[BlueprintAlignmentLines.LockIcon.Bottom],
)
- val bottomAreaPlaceable =
- bottomAreaMeasurable.measure(
- noMinConstraints.copy(
- maxHeight =
- (constraints.maxHeight - lockIconBounds.bottom).coerceAtLeast(0)
- )
- )
+ val bottomAreaPlaceable = bottomAreaMeasurable.measure(noMinConstraints)
val communalGridPlaceable =
communalGridMeasurable.measure(
diff --git a/packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/section/BottomAreaSection.kt b/packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/section/BottomAreaSection.kt
index 86639fa02a92..b40bccb98597 100644
--- a/packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/section/BottomAreaSection.kt
+++ b/packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/section/BottomAreaSection.kt
@@ -98,7 +98,7 @@ constructor(
) {
MovableElement(
key = IndicationAreaElementKey,
- modifier = modifier.shortcutPadding(),
+ modifier = modifier.indicationAreaPadding(),
) {
content {
IndicationArea(
@@ -210,6 +210,11 @@ constructor(
)
.padding(bottom = dimensionResource(R.dimen.keyguard_affordance_vertical_offset))
}
+
+ @Composable
+ private fun Modifier.indicationAreaPadding(): Modifier {
+ return this.padding(bottom = dimensionResource(R.dimen.keyguard_indication_margin_bottom))
+ }
}
private val StartButtonElementKey = ElementKey("StartButton")