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

Commit a58d4614 authored by Ioana Alexandru's avatar Ioana Alexandru
Browse files

Show footer when QS are expanded in Dual Shade

We were animating the footer out when QS are expanded, which was making
it flicker on the screen in dual shade. This change ensures we only hide
the footer in single shade when QS are expanded.

Fix: 441266548
Test: NotificationListViewModelTest, manual
Flag: com.android.systemui.scene_container
Change-Id: Idefde1f0b28ae873a520aeb755e5a454b41b2b3d
parent 5ead43ff
Loading
Loading
Loading
Loading
+25 −1
Original line number Diff line number Diff line
@@ -423,8 +423,9 @@ class NotificationListViewModelTest(flags: FlagsParameterization) : SysuiTestCas
        }

    @Test
    fun shouldIncludeFooterView_falseWhenQsExpandedDefault() =
    fun shouldIncludeFooterView_falseWhenQsExpandedSingleShade() =
        kosmos.runTest {
            enableSingleShade()
            val shouldInclude by collectFooterViewVisibility()

            // WHEN has notifs
@@ -464,6 +465,29 @@ class NotificationListViewModelTest(flags: FlagsParameterization) : SysuiTestCas
            assertThat(shouldShowEmptyShadeView).isFalse()
        }

    @Test
    fun shouldIncludeFooterView_trueWhenQsExpandedDualShade() =
        kosmos.runTest {
            enableDualShade()
            runCurrent()
            val shouldIncludeFooterView by collectFooterViewVisibility()
            val shouldShowEmptyShadeView by
                collectLastValue(underTest.shouldShowEmptyShadeView.map { it.value })

            // WHEN has notifs
            activeNotificationListRepository.setActiveNotifs(count = 2)
            // AND quick settings are expanded
            shadeTestUtil.setQsExpansion(1f)
            // AND shade is open
            fakeKeyguardRepository.setStatusBarState(StatusBarState.SHADE)
            shadeTestUtil.setShadeExpansion(1f)
            runCurrent()

            // THEN footer is visible
            assertThat(shouldIncludeFooterView?.value).isTrue()
            assertThat(shouldShowEmptyShadeView).isFalse()
        }

    @Test
    fun shouldIncludeFooterView_falseWhenRemoteInputActive() =
        kosmos.runTest {
+6 −5
Original line number Diff line number Diff line
@@ -269,10 +269,11 @@ constructor(
                    isShowingOnLockscreen,
                    qsFullScreen,
                    isRemoteInputActive ->
                    val dualShade = shadeMode is ShadeMode.Dual
                    val singleShade = shadeMode is ShadeMode.Single
                    when {
                        // Hide the footer when there are no notifications, unless it's Dual Shade.
                        shadeMode != ShadeMode.Dual && !hasNotifications ->
                            VisibilityChange.DISAPPEAR_WITH_ANIMATION
                        !dualShade && !hasNotifications -> VisibilityChange.DISAPPEAR_WITH_ANIMATION
                        // Hide the footer until the user setup is complete, to prevent access
                        // to settings (b/193149550).
                        !isUserSetUp -> VisibilityChange.DISAPPEAR_WITH_ANIMATION
@@ -281,9 +282,9 @@ constructor(
                        // Do not animate, as that makes the footer appear briefly when
                        // transitioning between the shade and lockscreen.
                        isShowingOnLockscreen -> VisibilityChange.DISAPPEAR_WITHOUT_ANIMATION
                        // Do not show the footer if quick settings are fully expanded (except
                        // for the foldable split shade view). See b/201427195 && b/222699879.
                        qsFullScreen -> VisibilityChange.DISAPPEAR_WITH_ANIMATION
                        // Do not show the footer if quick settings are fully expanded (in single
                        // shade). See b/201427195 && b/222699879.
                        qsFullScreen && singleShade -> VisibilityChange.DISAPPEAR_WITH_ANIMATION
                        // Hide the footer if remote input is active (i.e. user is replying to a
                        // notification). See b/75984847.
                        isRemoteInputActive -> VisibilityChange.DISAPPEAR_WITH_ANIMATION