Loading packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/NotificationListViewModelTest.kt +25 −1 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -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 { Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/NotificationListViewModel.kt +6 −5 Original line number Diff line number Diff line Loading @@ -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 Loading @@ -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 Loading Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/NotificationListViewModelTest.kt +25 −1 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -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 { Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/NotificationListViewModel.kt +6 −5 Original line number Diff line number Diff line Loading @@ -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 Loading @@ -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 Loading