Loading packages/SystemUI/src/com/android/systemui/keyguard/ui/preview/KeyguardPreviewRenderer.kt +32 −16 Original line number Diff line number Diff line Loading @@ -36,6 +36,7 @@ import android.view.View import android.view.ViewGroup import android.view.WindowManager import android.widget.FrameLayout import android.widget.LinearLayout import android.window.InputTransferToken import androidx.constraintlayout.widget.ConstraintLayout import androidx.constraintlayout.widget.ConstraintSet Loading Loading @@ -319,6 +320,20 @@ constructor( ?.also { view -> constrainWidth(view.id, ConstraintSet.WRAP_CONTENT) constrainHeight(view.id, ConstraintSet.WRAP_CONTENT) if (clockViewModel.shouldSmallDateWeatherBeBelowSmallClock()) { (view as? LinearLayout)?.orientation = LinearLayout.HORIZONTAL connect(view.id, START, smallClockViewId, START) connect( view.id, TOP, smallClockViewId, ConstraintSet.BOTTOM, context.resources.getDimensionPixelSize( R.dimen.smartspace_padding_vertical ), ) } else { (view as? LinearLayout)?.orientation = LinearLayout.VERTICAL connect( view.id, START, Loading @@ -336,6 +351,7 @@ constructor( ConstraintSet.BOTTOM, ) } } parentView.addView(largeDateView) parentView.addView(smallDateView) } Loading packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardPreviewClockViewModel.kt +19 −13 Original line number Diff line number Diff line Loading @@ -33,7 +33,10 @@ interface KeyguardPreviewClockViewModelFactory { /** View model for the small clock view, large clock view. */ class KeyguardPreviewClockViewModel @AssistedInject constructor(@Assisted private val interactor: KeyguardPreviewInteractor) { constructor( @Assisted private val interactor: KeyguardPreviewInteractor, private val keyguardClockViewModel: KeyguardClockViewModel ) { val shouldHideClock: Boolean get() = interactor.shouldHideClock Loading @@ -50,4 +53,7 @@ constructor(@Assisted private val interactor: KeyguardPreviewInteractor) { val previewClock: Flow<ClockController> get() = interactor.previewClock fun shouldSmallDateWeatherBeBelowSmallClock() = keyguardClockViewModel.shouldDateWeatherBeBelowSmallClock.value } Loading
packages/SystemUI/src/com/android/systemui/keyguard/ui/preview/KeyguardPreviewRenderer.kt +32 −16 Original line number Diff line number Diff line Loading @@ -36,6 +36,7 @@ import android.view.View import android.view.ViewGroup import android.view.WindowManager import android.widget.FrameLayout import android.widget.LinearLayout import android.window.InputTransferToken import androidx.constraintlayout.widget.ConstraintLayout import androidx.constraintlayout.widget.ConstraintSet Loading Loading @@ -319,6 +320,20 @@ constructor( ?.also { view -> constrainWidth(view.id, ConstraintSet.WRAP_CONTENT) constrainHeight(view.id, ConstraintSet.WRAP_CONTENT) if (clockViewModel.shouldSmallDateWeatherBeBelowSmallClock()) { (view as? LinearLayout)?.orientation = LinearLayout.HORIZONTAL connect(view.id, START, smallClockViewId, START) connect( view.id, TOP, smallClockViewId, ConstraintSet.BOTTOM, context.resources.getDimensionPixelSize( R.dimen.smartspace_padding_vertical ), ) } else { (view as? LinearLayout)?.orientation = LinearLayout.VERTICAL connect( view.id, START, Loading @@ -336,6 +351,7 @@ constructor( ConstraintSet.BOTTOM, ) } } parentView.addView(largeDateView) parentView.addView(smallDateView) } Loading
packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardPreviewClockViewModel.kt +19 −13 Original line number Diff line number Diff line Loading @@ -33,7 +33,10 @@ interface KeyguardPreviewClockViewModelFactory { /** View model for the small clock view, large clock view. */ class KeyguardPreviewClockViewModel @AssistedInject constructor(@Assisted private val interactor: KeyguardPreviewInteractor) { constructor( @Assisted private val interactor: KeyguardPreviewInteractor, private val keyguardClockViewModel: KeyguardClockViewModel ) { val shouldHideClock: Boolean get() = interactor.shouldHideClock Loading @@ -50,4 +53,7 @@ constructor(@Assisted private val interactor: KeyguardPreviewInteractor) { val previewClock: Flow<ClockController> get() = interactor.previewClock fun shouldSmallDateWeatherBeBelowSmallClock() = keyguardClockViewModel.shouldDateWeatherBeBelowSmallClock.value }