diff options
author | 2024-03-22 10:38:36 +0000 | |
---|---|---|
committer | 2024-03-22 10:38:36 +0000 | |
commit | 1533eb8de0882b5e43c60e824a69eedc8424b597 (patch) | |
tree | a620fdb1926efa988632f7d9a1c287fe82508ff6 | |
parent | 3ef27454882313a89bc6ad84a7ff28307008f7d1 (diff) | |
parent | 7c975ff02540888c699eb24782eb874b692ceca6 (diff) |
Merge "Fix volume label position when its width is too short" into main
-rw-r--r-- | packages/SystemUI/compose/features/src/com/android/systemui/volume/panel/component/volume/ui/composable/VolumeSliderContent.kt | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/packages/SystemUI/compose/features/src/com/android/systemui/volume/panel/component/volume/ui/composable/VolumeSliderContent.kt b/packages/SystemUI/compose/features/src/com/android/systemui/volume/panel/component/volume/ui/composable/VolumeSliderContent.kt index 6b9af239eb6f..4ae4eb875953 100644 --- a/packages/SystemUI/compose/features/src/com/android/systemui/volume/panel/component/volume/ui/composable/VolumeSliderContent.kt +++ b/packages/SystemUI/compose/features/src/com/android/systemui/volume/panel/component/volume/ui/composable/VolumeSliderContent.kt @@ -108,15 +108,20 @@ private class VolumeSliderContentMeasurePolicy(private val isEnabled: Boolean) : measurables .fastFirst { it.layoutId == VolumeSliderContentComponent.Label } .measure(constraints) - val layoutWidth: Int = constraints.maxWidth + val layoutWidth: Int = + if (isEnabled) { + labelPlaceable.width + } else { + constraints.maxWidth + } val fullLayoutWidth: Int = if (isEnabled) { // PlatformSlider uses half of the available space for the enabled state. // This is using it to allow disabled message to take whole space when animating to // prevent it from jumping left to right - layoutWidth * 2 + constraints.maxWidth * 2 } else { - layoutWidth + constraints.maxWidth } val disabledMessagePlaceable = |