Merge "Deflake Lockscreen Clock Screenshot Tests" into tm-qpr-dev am: 0b6c884d34

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19885778

Change-Id: Iae1596934801cdb1af1dc76c532c88411ddd5f1f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Hawkwood Glazier
2022-10-21 15:15:14 +00:00
committed by Automerger Merge Worker

View File

@@ -189,8 +189,13 @@ class AnimatableClockView @JvmOverloads constructor(
override fun onDraw(canvas: Canvas) { override fun onDraw(canvas: Canvas) {
lastDraw = getTimestamp() 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) textAnimator?.draw(canvas)
} else {
super.onDraw(canvas)
}
} }
override fun invalidate() { override fun invalidate() {
@@ -345,6 +350,9 @@ class AnimatableClockView @JvmOverloads constructor(
onAnimationEnd = onAnimationEnd onAnimationEnd = onAnimationEnd
) )
textAnimator?.glyphFilter = glyphFilter textAnimator?.glyphFilter = glyphFilter
if (color != null && !isAnimationEnabled) {
setTextColor(color)
}
} else { } else {
// when the text animator is set, update its start values // when the text animator is set, update its start values
onTextAnimatorInitialized = Runnable { onTextAnimatorInitialized = Runnable {
@@ -359,6 +367,9 @@ class AnimatableClockView @JvmOverloads constructor(
onAnimationEnd = onAnimationEnd onAnimationEnd = onAnimationEnd
) )
textAnimator?.glyphFilter = glyphFilter textAnimator?.glyphFilter = glyphFilter
if (color != null && !isAnimationEnabled) {
setTextColor(color)
}
} }
} }
} }