[DO NOT MERGE] Resolve file inconsistencies between master and tm-qpr-dev
Bug: 229771520 Test: Manually checked the device build Change-Id: I03bf5eac968b425344236fbea897501bc5ecbeec
This commit is contained in:
@@ -151,8 +151,6 @@ class AnimatableClockView @JvmOverloads constructor(
|
|||||||
// relayout if the text didn't actually change.
|
// relayout if the text didn't actually change.
|
||||||
if (!TextUtils.equals(text, formattedText)) {
|
if (!TextUtils.equals(text, formattedText)) {
|
||||||
text = formattedText
|
text = formattedText
|
||||||
lastTextUpdate = getTimestamp()
|
|
||||||
|
|
||||||
// Because the TextLayout may mutate under the hood as a result of the new text, we
|
// 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
|
// 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
|
// 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)
|
textAnimator?.updateLayout(layout)
|
||||||
}
|
}
|
||||||
requestLayout()
|
requestLayout()
|
||||||
|
lastTextUpdate = getTimestamp()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -90,6 +90,9 @@ class DefaultClock(
|
|||||||
override lateinit var animations: ClockAnimations
|
override lateinit var animations: ClockAnimations
|
||||||
private set
|
private set
|
||||||
|
|
||||||
|
private var smallRegionDarkness = false
|
||||||
|
private var largeRegionDarkness = false
|
||||||
|
|
||||||
init {
|
init {
|
||||||
val parent = FrameLayout(ctx)
|
val parent = FrameLayout(ctx)
|
||||||
|
|
||||||
@@ -148,9 +151,15 @@ class DefaultClock(
|
|||||||
smallClockIsDark: Boolean,
|
smallClockIsDark: Boolean,
|
||||||
largeClockIsDark: Boolean
|
largeClockIsDark: Boolean
|
||||||
) {
|
) {
|
||||||
|
if (smallRegionDarkness != smallClockIsDark) {
|
||||||
|
smallRegionDarkness = smallClockIsDark
|
||||||
updateClockColor(smallClock, smallClockIsDark)
|
updateClockColor(smallClock, smallClockIsDark)
|
||||||
|
}
|
||||||
|
if (largeRegionDarkness != largeClockIsDark) {
|
||||||
|
largeRegionDarkness = largeClockIsDark
|
||||||
updateClockColor(largeClock, largeClockIsDark)
|
updateClockColor(largeClock, largeClockIsDark)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
override fun onLocaleChanged(locale: Locale) {
|
override fun onLocaleChanged(locale: Locale) {
|
||||||
val nf = NumberFormat.getInstance(locale)
|
val nf = NumberFormat.getInstance(locale)
|
||||||
|
|||||||
Reference in New Issue
Block a user