summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/SystemUI/customization/src/com/android/systemui/shared/clocks/FlexClockFaceController.kt15
1 files changed, 14 insertions, 1 deletions
diff --git a/packages/SystemUI/customization/src/com/android/systemui/shared/clocks/FlexClockFaceController.kt b/packages/SystemUI/customization/src/com/android/systemui/shared/clocks/FlexClockFaceController.kt
index 827bd6898310..67cbf3082632 100644
--- a/packages/SystemUI/customization/src/com/android/systemui/shared/clocks/FlexClockFaceController.kt
+++ b/packages/SystemUI/customization/src/com/android/systemui/shared/clocks/FlexClockFaceController.kt
@@ -125,7 +125,19 @@ class FlexClockFaceController(clockCtx: ClockContext, private val isLargeClock:
layerController.faceEvents.onThemeChanged(theme)
}
- override fun onFontAxesChanged(axes: List<ClockFontAxisSetting>) {
+ override fun onFontAxesChanged(settings: List<ClockFontAxisSetting>) {
+ var axes = settings
+ if (!isLargeClock) {
+ axes =
+ axes.map { axis ->
+ if (axis.key == "wdth" && axis.value > SMALL_CLOCK_MAX_WDTH) {
+ axis.copy(value = SMALL_CLOCK_MAX_WDTH)
+ } else {
+ axis
+ }
+ }
+ }
+
layerController.events.onFontAxesChanged(axes)
}
@@ -236,6 +248,7 @@ class FlexClockFaceController(clockCtx: ClockContext, private val isLargeClock:
}
companion object {
+ val SMALL_CLOCK_MAX_WDTH = 120f
val SMALL_LAYER_CONFIG =
LayerConfig(
timespec = DigitalTimespec.TIME_FULL_FORMAT,