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

Commit 186787a2 authored by Sherry Zhou's avatar Sherry Zhou Committed by Android (Google) Code Review
Browse files

Merge "Fix large clock not changing font size when the screen rotates" into main

parents 7e52d8d8 7c973e49
Loading
Loading
Loading
Loading
+15 −4
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ import androidx.constraintlayout.widget.ConstraintLayout
import androidx.constraintlayout.widget.ConstraintSet
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.repeatOnLifecycle
import com.android.app.tracing.coroutines.launchTraced as launch
import com.android.systemui.keyguard.MigrateClocksToBlueprint
import com.android.systemui.keyguard.domain.interactor.KeyguardBlueprintInteractor
import com.android.systemui.keyguard.domain.interactor.KeyguardClockInteractor
@@ -44,7 +45,6 @@ import kotlinx.coroutines.DisposableHandle
import kotlinx.coroutines.flow.combine
import kotlinx.coroutines.flow.distinctUntilChanged
import kotlinx.coroutines.flow.map
import com.android.app.tracing.coroutines.launchTraced as launch

object KeyguardClockViewBinder {
    private val TAG = KeyguardClockViewBinder::class.simpleName!!
@@ -133,8 +133,10 @@ object KeyguardClockViewBinder {
                    launch {
                        if (!MigrateClocksToBlueprint.isEnabled) return@launch
                        aodBurnInViewModel.movement.collect { burnInModel ->
                            viewModel.currentClock.value?.let {
                                it.largeClock.layout.applyAodBurnIn(
                            viewModel.currentClock.value
                                ?.largeClock
                                ?.layout
                                ?.applyAodBurnIn(
                                    AodClockBurnInModel(
                                        translationX = burnInModel.translationX.toFloat(),
                                        translationY = burnInModel.translationY.toFloat(),
@@ -143,6 +145,15 @@ object KeyguardClockViewBinder {
                                )
                        }
                    }

                    launch {
                        if (!MigrateClocksToBlueprint.isEnabled) return@launch
                        viewModel.largeClockTextSize.collect { fontSizePx ->
                            viewModel.currentClock.value
                                ?.largeClock
                                ?.events
                                ?.onFontSettingChanged(fontSizePx = fontSizePx.toFloat())
                        }
                    }
                }
            }
+3 −0
Original line number Diff line number Diff line
@@ -187,6 +187,9 @@ constructor(
    val largeClockTopMargin: Flow<Int> =
        configurationInteractor.onAnyConfigurationChange.map { getLargeClockTopMargin() }

    val largeClockTextSize: Flow<Int> =
        configurationInteractor.dimensionPixelSize(customR.dimen.large_clock_text_size)

    enum class ClockLayout {
        LARGE_CLOCK,
        SMALL_CLOCK,