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

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

Merge "Deflake Lockscreen Clock Screenshot Tests"

parents 2715310d 9d6e679a
Loading
Loading
Loading
Loading
+13 −2
Original line number Diff line number Diff line
@@ -190,8 +190,13 @@ class AnimatableClockView @JvmOverloads constructor(

    override fun onDraw(canvas: Canvas) {
        lastDraw = getTimestamp()
        // intentionally doesn't call super.onDraw here or else the text will be rendered twice
        // Use textAnimator to render text if animation is enabled.
        // Otherwise default to using standard draw functions.
        if (isAnimationEnabled) {
            textAnimator?.draw(canvas)
        } else {
            super.onDraw(canvas)
        }
    }

    override fun invalidate() {
@@ -363,6 +368,9 @@ class AnimatableClockView @JvmOverloads constructor(
                onAnimationEnd = onAnimationEnd
            )
            textAnimator?.glyphFilter = glyphFilter
            if (color != null && !isAnimationEnabled) {
                setTextColor(color)
            }
        } else {
            // when the text animator is set, update its start values
            onTextAnimatorInitialized = Runnable {
@@ -377,6 +385,9 @@ class AnimatableClockView @JvmOverloads constructor(
                    onAnimationEnd = onAnimationEnd
                )
                textAnimator?.glyphFilter = glyphFilter
                if (color != null && !isAnimationEnabled) {
                    setTextColor(color)
                }
            }
        }
    }