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

Commit 97ef6a07 authored by Matt Pietal's avatar Matt Pietal Committed by Android (Google) Code Review
Browse files

Merge "Ensure alpha is reset on QS expansion" into main

parents ef10f0dc b302761d
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
@@ -38,6 +38,7 @@ import com.android.systemui.keyguard.shared.model.TransitionState
import com.android.systemui.keyguard.shared.model.TransitionStep
import com.android.systemui.keyguard.ui.viewmodel.AodBurnInViewModel
import com.android.systemui.keyguard.ui.viewmodel.BurnInParameters
import com.android.systemui.keyguard.ui.viewmodel.ViewStateAccessor
import com.android.systemui.keyguard.ui.viewmodel.aodBurnInViewModel
import com.android.systemui.keyguard.ui.viewmodel.keyguardRootViewModel
import com.android.systemui.kosmos.testScope
@@ -698,6 +699,25 @@ class SharedNotificationContainerViewModelTest : SysuiTestCase() {
            assertThat(bounds).isEqualTo(NotificationContainerBounds(top = top, bottom = bottom))
        }

    @Test
    fun alphaOnFullQsExpansion() =
        testScope.runTest {
            val viewState = ViewStateAccessor()
            val alpha by collectLastValue(underTest.keyguardAlpha(viewState))

            showLockscreenWithQSExpanded()

            // Alpha fades out as QS expands
            shadeRepository.setQsExpansion(0.5f)
            assertThat(alpha).isWithin(0.01f).of(0.5f)
            shadeRepository.setQsExpansion(0.9f)
            assertThat(alpha).isWithin(0.01f).of(0.1f)

            // Ensure that alpha is set back to 1f when QS is fully expanded
            shadeRepository.setQsExpansion(1f)
            assertThat(alpha).isEqualTo(1f)
        }

    @Test
    fun shadeCollapseFadeIn() =
        testScope.runTest {
+3 −0
Original line number Diff line number Diff line
@@ -350,6 +350,9 @@ constructor(
                    if (shadeExpansion > 0f || qsExpansion > 0f) {
                        if (configurationBasedDimensions.useSplitShade) {
                            emit(1f)
                        } else if (qsExpansion == 1f) {
                            // Ensure HUNs will be visible in QS shade (at least while unlocked)
                            emit(1f)
                        } else {
                            // Fade as QS shade expands
                            emit(1f - qsExpansion)