Loading packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithmTest.kt +15 −0 Original line number Diff line number Diff line Loading @@ -1110,6 +1110,21 @@ class StackScrollAlgorithmTest(flags: FlagsParameterization) : SysuiTestCase() { assertThat((footerView.viewState as FooterViewState).hideContent).isTrue() } @Test @EnableSceneContainer fun resetViewStates_noSpaceForFooterDuringExpansion_footerShown_withSceneContainer() { ambientState.isShadeExpanded = true ambientState.isExpansionChanging = true ambientState.stackTop = 0f ambientState.drawBounds = RectF(0f, 0f, 400f, 100f) val footerView = mockFooterView(height = 200) // no space for the footer in the stack hostView.addView(footerView) stackScrollAlgorithm.resetViewStates(ambientState, 0) assertThat((footerView.viewState as FooterViewState).hideContent).isFalse() } @Test fun resetViewStates_clearAllInProgress_hasNonClearableRow_footerVisible() { whenever(notificationRow.canViewBeCleared()).thenReturn(false) Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java +8 −6 Original line number Diff line number Diff line Loading @@ -714,12 +714,14 @@ public class StackScrollAlgorithm { ); if (view instanceof FooterView) { if (SceneContainerFlag.isEnabled()) { if (!ambientState.isExpansionChanging()) { final float footerEnd = stackTop + viewState.getYTranslation() + view.getIntrinsicHeight(); final boolean noSpaceForFooter = footerEnd > ambientState.getStackCutoff(); ((FooterView.FooterViewState) viewState).hideContent = noSpaceForFooter || (ambientState.isClearAllInProgress() && !hasNonClearableNotifs(algorithmState)); } } else { // TODO(b/333445519): shouldBeHidden should reflect whether the shade is closed // already, so we shouldn't need to use ambientState here. However, Loading Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithmTest.kt +15 −0 Original line number Diff line number Diff line Loading @@ -1110,6 +1110,21 @@ class StackScrollAlgorithmTest(flags: FlagsParameterization) : SysuiTestCase() { assertThat((footerView.viewState as FooterViewState).hideContent).isTrue() } @Test @EnableSceneContainer fun resetViewStates_noSpaceForFooterDuringExpansion_footerShown_withSceneContainer() { ambientState.isShadeExpanded = true ambientState.isExpansionChanging = true ambientState.stackTop = 0f ambientState.drawBounds = RectF(0f, 0f, 400f, 100f) val footerView = mockFooterView(height = 200) // no space for the footer in the stack hostView.addView(footerView) stackScrollAlgorithm.resetViewStates(ambientState, 0) assertThat((footerView.viewState as FooterViewState).hideContent).isFalse() } @Test fun resetViewStates_clearAllInProgress_hasNonClearableRow_footerVisible() { whenever(notificationRow.canViewBeCleared()).thenReturn(false) Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java +8 −6 Original line number Diff line number Diff line Loading @@ -714,12 +714,14 @@ public class StackScrollAlgorithm { ); if (view instanceof FooterView) { if (SceneContainerFlag.isEnabled()) { if (!ambientState.isExpansionChanging()) { final float footerEnd = stackTop + viewState.getYTranslation() + view.getIntrinsicHeight(); final boolean noSpaceForFooter = footerEnd > ambientState.getStackCutoff(); ((FooterView.FooterViewState) viewState).hideContent = noSpaceForFooter || (ambientState.isClearAllInProgress() && !hasNonClearableNotifs(algorithmState)); } } else { // TODO(b/333445519): shouldBeHidden should reflect whether the shade is closed // already, so we shouldn't need to use ambientState here. However, Loading