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

Commit 744b7fed authored by Hawkwood Glazier's avatar Hawkwood Glazier
Browse files

Disable AOD translation for flex clock as temp fix

Also fix an animation crash when initializing from legacy picker ui

Bug: 376687020
Test: Manually checked aod positioning
Flag: com.android.systemui.clock_reactive_variants
Change-Id: I960f5d52101e91e5a00a8ef90820aba481c5444c
parent 65629114
Loading
Loading
Loading
Loading
+2 −6
Original line number Diff line number Diff line
@@ -39,7 +39,7 @@ class FlexClockView(context: Context, val assets: AssetLoader, messageBuffer: Me
    val digitLeftTopMap = mutableMapOf<Int, Point>()
    var maxSingleDigitSize = Point(-1, -1)
    val lockscreenTranslate = Point(0, 0)
    val aodTranslate = Point(0, 0)
    var aodTranslate = Point(0, 0)

    init {
        setWillNotDraw(false)
@@ -64,8 +64,7 @@ class FlexClockView(context: Context, val assets: AssetLoader, messageBuffer: Me
            maxSingleDigitSize.y = max(maxSingleDigitSize.y, textView.measuredHeight)
        }
        val textView = digitalClockTextViewMap[R.id.HOUR_FIRST_DIGIT]!!
        aodTranslate.x = -(maxSingleDigitSize.x * AOD_HORIZONTAL_TRANSLATE_RATIO).toInt()
        aodTranslate.y = (maxSingleDigitSize.y * AOD_VERTICAL_TRANSLATE_RATIO).toInt()
        aodTranslate = Point(0, 0)
        return Point(
            ((maxSingleDigitSize.x + abs(aodTranslate.x)) * 2),
            ((maxSingleDigitSize.y + abs(aodTranslate.y)) * 2),
@@ -162,9 +161,6 @@ class FlexClockView(context: Context, val assets: AssetLoader, messageBuffer: Me
        val AOD_TRANSITION_DURATION = 750L
        val CHARGING_TRANSITION_DURATION = 300L

        val AOD_HORIZONTAL_TRANSLATE_RATIO = 0.15F
        val AOD_VERTICAL_TRANSLATE_RATIO = 0.075F

        // Use the sign of targetTranslation to control the direction of digit translation
        fun updateDirectionalTargetTranslate(id: Int, targetTranslation: Point): Point {
            val outPoint = Point(targetTranslation)
+1 −1
Original line number Diff line number Diff line
@@ -148,7 +148,7 @@ open class SimpleDigitalClockTextView(
        lsFontVariation = ClockFontAxisSetting.toFVar(axes + OPTICAL_SIZE_AXIS)
        lockScreenPaint.typeface = typefaceCache.getTypefaceForVariant(lsFontVariation)
        typeface = lockScreenPaint.typeface
        textAnimator.setTextStyle(fvar = lsFontVariation, animate = true)
        textAnimator.setTextStyle(fvar = lsFontVariation, animate = false)
        measure(MeasureSpec.UNSPECIFIED, MeasureSpec.UNSPECIFIED)
        recomputeMaxSingleDigitSizes()
        requestLayout()