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

Commit 675bb4a3 authored by Hawkwood Glazier's avatar Hawkwood Glazier
Browse files

Apply max wdth of 120 to small gsf clock

Bug: 391857411
Test: Manually checked device
Flag: com.android.systemui.clock_reactive_variants
Change-Id: Ide9db0a74e89983febacb717df2c2245451fe69f
parent ddd2bbc2
Loading
Loading
Loading
Loading
+14 −1
Original line number Diff line number Diff line
@@ -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,