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

Commit 0e0338f9 authored by Hawkwood Glazier's avatar Hawkwood Glazier Committed by Android (Google) Code Review
Browse files

Merge "Prevent Typeface recreation for default flex clock" into main

parents d0382f97 b7310022
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -67,11 +67,7 @@ class DefaultClockProvider(
            val buffers = messageBuffers ?: ClockMessageBuffers(LogUtil.DEFAULT_MESSAGE_BUFFER)
            val fontAxes = ClockFontAxis.merge(FlexClockController.FONT_AXES, settings.axes)
            val clockSettings = settings.copy(axes = fontAxes.map { it.toSetting() })
            val typefaceCache =
                TypefaceCache(buffers.infraMessageBuffer) {
                    // TODO(b/364680873): Move constant to config_clockFontFamily when shipping
                    return@TypefaceCache Typeface.create("google-sans-flex-clock", Typeface.NORMAL)
                }
            val typefaceCache = TypefaceCache(buffers.infraMessageBuffer) { FLEX_TYPEFACE }
            FlexClockController(
                ClockContext(
                    ctx,
@@ -131,6 +127,11 @@ class DefaultClockProvider(
                ClockFontAxisSetting("slnt", 0f),
            )

        val FLEX_TYPEFACE by lazy {
            // TODO(b/364680873): Move constant to config_clockFontFamily when shipping
            Typeface.create("google-sans-flex-clock", Typeface.NORMAL)
        }

        val FLEX_DESIGN = run {
            val largeLayer =
                listOf(