Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 49e73ac7 authored by Brad Hinegardner's avatar Brad Hinegardner
Browse files

Allow date weather to fall below small clock on wallpaper picker

Bug: 372246519
Test: manual
Flag: com.android.systemui.shared.clock_reactive_smartspace_layout
Change-Id: Iee67b58382959b11b7ecab4db5087576253b3a4f
parent 3a6eef02
Loading
Loading
Loading
Loading
+32 −16
Original line number Diff line number Diff line
@@ -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
@@ -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,
@@ -336,6 +351,7 @@ constructor(
                                    ConstraintSet.BOTTOM,
                                )
                            }
                        }
                parentView.addView(largeDateView)
                parentView.addView(smallDateView)
            }
+19 −13
Original line number Diff line number Diff line
@@ -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

@@ -50,4 +53,7 @@ constructor(@Assisted private val interactor: KeyguardPreviewInteractor) {

  val previewClock: Flow<ClockController>
    get() = interactor.previewClock

  fun shouldSmallDateWeatherBeBelowSmallClock() =
      keyguardClockViewModel.shouldDateWeatherBeBelowSmallClock.value
}