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

Commit 3c8ec943 authored by Brad Hinegardner's avatar Brad Hinegardner Committed by Android (Google) Code Review
Browse files

Merge "Allow date weather to fall below small clock on wallpaper picker" into main

parents 6150d238 49e73ac7
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
}