Loading packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardPreviewClockViewBinder.kt +28 −22 Original line number Diff line number Diff line Loading @@ -44,6 +44,7 @@ import com.android.systemui.keyguard.ui.viewmodel.KeyguardPreviewClockViewModel import com.android.systemui.lifecycle.repeatWhenAttached import com.android.systemui.plugins.clocks.ClockController import com.android.systemui.res.R import com.android.systemui.shared.clocks.ClockRegistry import com.android.systemui.util.Utils import kotlin.reflect.KSuspendFunction1 Loading Loading @@ -77,12 +78,13 @@ object KeyguardPreviewClockViewBinder { context: Context, rootView: ConstraintLayout, viewModel: KeyguardPreviewClockViewModel, clockRegistry: ClockRegistry, updateClockAppearance: KSuspendFunction1<ClockController, Unit>, ) { rootView.repeatWhenAttached { repeatOnLifecycle(Lifecycle.State.STARTED) { launch("$TAG#viewModel.previewClock") { var lastClock: ClockController? = null launch("$TAG#viewModel.previewClock") { viewModel.previewClock.collect { currentClock -> lastClock?.let { clock -> (clock.largeClock.layout.views + clock.smallClock.layout.views) Loading @@ -108,6 +110,10 @@ object KeyguardPreviewClockViewBinder { applyPreviewConstraints(context, rootView, currentClock, viewModel) } } .invokeOnCompletion { // recover seed color especially for Transit clock lastClock?.events?.onSeedColorChanged(clockRegistry.seedColor) } } } } Loading packages/SystemUI/src/com/android/systemui/keyguard/ui/preview/KeyguardPreviewRenderer.kt +2 −1 Original line number Diff line number Diff line Loading @@ -416,7 +416,8 @@ constructor( previewContext, keyguardRootView, clockViewModel, ::updateClockAppearance clockRegistry, ::updateClockAppearance, ) } else { KeyguardPreviewClockViewBinder.bind( Loading Loading
packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardPreviewClockViewBinder.kt +28 −22 Original line number Diff line number Diff line Loading @@ -44,6 +44,7 @@ import com.android.systemui.keyguard.ui.viewmodel.KeyguardPreviewClockViewModel import com.android.systemui.lifecycle.repeatWhenAttached import com.android.systemui.plugins.clocks.ClockController import com.android.systemui.res.R import com.android.systemui.shared.clocks.ClockRegistry import com.android.systemui.util.Utils import kotlin.reflect.KSuspendFunction1 Loading Loading @@ -77,12 +78,13 @@ object KeyguardPreviewClockViewBinder { context: Context, rootView: ConstraintLayout, viewModel: KeyguardPreviewClockViewModel, clockRegistry: ClockRegistry, updateClockAppearance: KSuspendFunction1<ClockController, Unit>, ) { rootView.repeatWhenAttached { repeatOnLifecycle(Lifecycle.State.STARTED) { launch("$TAG#viewModel.previewClock") { var lastClock: ClockController? = null launch("$TAG#viewModel.previewClock") { viewModel.previewClock.collect { currentClock -> lastClock?.let { clock -> (clock.largeClock.layout.views + clock.smallClock.layout.views) Loading @@ -108,6 +110,10 @@ object KeyguardPreviewClockViewBinder { applyPreviewConstraints(context, rootView, currentClock, viewModel) } } .invokeOnCompletion { // recover seed color especially for Transit clock lastClock?.events?.onSeedColorChanged(clockRegistry.seedColor) } } } } Loading
packages/SystemUI/src/com/android/systemui/keyguard/ui/preview/KeyguardPreviewRenderer.kt +2 −1 Original line number Diff line number Diff line Loading @@ -416,7 +416,8 @@ constructor( previewContext, keyguardRootView, clockViewModel, ::updateClockAppearance clockRegistry, ::updateClockAppearance, ) } else { KeyguardPreviewClockViewBinder.bind( Loading