Merge "Do not listen to clock change if should hide clock" into udc-dev am: b8ef48898b

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

Change-Id: I2c50c9b7c96293bc09297098e739f0420ce7da12
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
George Lin
2023-05-15 14:56:35 +00:00
committed by Automerger Merge Worker

View File

@@ -124,7 +124,9 @@ constructor(
setUpUdfps(rootView)
setUpClock(rootView)
if (!shouldHideClock) {
setUpClock(rootView)
}
rootView.measure(
View.MeasureSpec.makeMeasureSpec(
@@ -352,28 +354,23 @@ constructor(
clockController.clock = clock
colorOverride?.let { clock.events.onSeedColorChanged(it) }
if (!shouldHideClock) {
clock.largeClock.events.onTargetRegionChanged(
KeyguardClockSwitch.getLargeClockRegion(parentView)
)
clockView?.let { parentView.removeView(it) }
clockView =
clock.largeClock.view.apply {
if (shouldHighlightSelectedAffordance) {
alpha = DIM_ALPHA
}
parentView.addView(this)
visibility = View.VISIBLE
clock.largeClock.events.onTargetRegionChanged(
KeyguardClockSwitch.getLargeClockRegion(parentView)
)
clockView?.let { parentView.removeView(it) }
clockView =
clock.largeClock.view.apply {
if (shouldHighlightSelectedAffordance) {
alpha = DIM_ALPHA
}
} else {
clockView?.visibility = View.GONE
}
parentView.addView(this)
visibility = View.VISIBLE
}
// Hide smart space if the clock has weather display; otherwise show it
val hasCustomWeatherDataDisplay =
clock.largeClock.config.hasCustomWeatherDataDisplay == true
hideSmartspace(hasCustomWeatherDataDisplay)
hideSmartspace(clock.largeClock.config.hasCustomWeatherDataDisplay)
}
companion object {