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

Commit af8c054d authored by Danny Burakov's avatar Danny Burakov Committed by Android (Google) Code Review
Browse files

Merge "Show footer when QS are expanded in Dual Shade" into main

parents 79a85de3 a58d4614
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