[DO NOT MERGE] Resolve file inconsistencies between master and tm-qpr-dev am: 3140d3530c

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

Change-Id: I3ddccb23cdb1ca1da9aef1743673e8cb1734f749
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Hawkwood Glazier
2022-09-16 15:05:19 +00:00
committed by Automerger Merge Worker
2 changed files with 12 additions and 4 deletions

View File

@@ -151,8 +151,6 @@ class AnimatableClockView @JvmOverloads constructor(
// relayout if the text didn't actually change.
if (!TextUtils.equals(text, formattedText)) {
text = formattedText
lastTextUpdate = getTimestamp()
// Because the TextLayout may mutate under the hood as a result of the new text, we
// notify the TextAnimator that it may have changed and request a measure/layout. A
// crash will occur on the next invocation of setTextStyle if the layout is mutated
@@ -161,6 +159,7 @@ class AnimatableClockView @JvmOverloads constructor(
textAnimator?.updateLayout(layout)
}
requestLayout()
lastTextUpdate = getTimestamp()
}
}

View File

@@ -90,6 +90,9 @@ class DefaultClock(
override lateinit var animations: ClockAnimations
private set
private var smallRegionDarkness = false
private var largeRegionDarkness = false
init {
val parent = FrameLayout(ctx)
@@ -148,8 +151,14 @@ class DefaultClock(
smallClockIsDark: Boolean,
largeClockIsDark: Boolean
) {
updateClockColor(smallClock, smallClockIsDark)
updateClockColor(largeClock, largeClockIsDark)
if (smallRegionDarkness != smallClockIsDark) {
smallRegionDarkness = smallClockIsDark
updateClockColor(smallClock, smallClockIsDark)
}
if (largeRegionDarkness != largeClockIsDark) {
largeRegionDarkness = largeClockIsDark
updateClockColor(largeClock, largeClockIsDark)
}
}
override fun onLocaleChanged(locale: Locale) {