Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +5 −1 Original line number Diff line number Diff line Loading @@ -1284,7 +1284,11 @@ public class NotificationStackScrollLayout @Override public void setStackCutoff(float stackCutoff) { if (SceneContainerFlag.isUnexpectedlyInLegacyMode()) return; if (mAmbientState.getStackCutoff() != stackCutoff) { mAmbientState.setStackCutoff(stackCutoff); updateStackEndHeightAndStackHeight(mAmbientState.getExpansionFraction()); requestChildrenUpdate(); } } @Override Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java +26 −1 Original line number Diff line number Diff line Loading @@ -95,6 +95,7 @@ import com.android.systemui.statusbar.notification.emptyshade.ui.view.EmptyShade import com.android.systemui.statusbar.notification.footer.shared.FooterViewRefactor; import com.android.systemui.statusbar.notification.footer.shared.NotifRedesignFooter; import com.android.systemui.statusbar.notification.footer.ui.view.FooterView; import com.android.systemui.statusbar.notification.headsup.AvalancheController; import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow; import com.android.systemui.statusbar.notification.row.ExpandableView; import com.android.systemui.statusbar.notification.shared.NotificationThrottleHun; Loading @@ -103,7 +104,6 @@ import com.android.systemui.statusbar.notification.stack.shared.model.ShadeScrim import com.android.systemui.statusbar.phone.KeyguardBypassController; import com.android.systemui.statusbar.phone.ScreenOffAnimationController; import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager; import com.android.systemui.statusbar.notification.headsup.AvalancheController; import com.android.systemui.statusbar.policy.ResourcesSplitShadeStateController; import com.android.systemui.wallpapers.domain.interactor.WallpaperInteractor; Loading Loading @@ -354,6 +354,31 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { verify(mAmbientState).setInterpolatedStackHeight(stackEndHeight); } @Test @EnableSceneContainer public void updateStackCutoff_updatesStackEndHeight() { // GIVEN shade is fully open final float stackTop = 200f; final float stackCutoff = 1000f; final float stackHeight = stackCutoff - stackTop; mAmbientState.setStackTop(stackTop); mAmbientState.setStackCutoff(stackCutoff); mAmbientState.setStatusBarState(StatusBarState.SHADE); mStackScroller.setMaxDisplayedNotifications(-1); // no limit on the shade mStackScroller.setExpandFraction(1f); // shade is fully expanded assertThat(mAmbientState.getStackEndHeight()).isEqualTo(stackHeight); assertThat(mAmbientState.getInterpolatedStackHeight()).isEqualTo(stackHeight); // WHEN stackCutoff changes final float newStackCutoff = 800; mStackScroller.setStackCutoff(newStackCutoff); // THEN stackEndHeight is updated final float newStackHeight = newStackCutoff - stackTop; assertThat(mAmbientState.getStackEndHeight()).isEqualTo(newStackHeight); assertThat(mAmbientState.getInterpolatedStackHeight()).isEqualTo(newStackHeight); } @Test @EnableSceneContainer public void updateStackEndHeightAndStackHeight_maxNotificationsSet_withSceneContainer() { Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +5 −1 Original line number Diff line number Diff line Loading @@ -1284,7 +1284,11 @@ public class NotificationStackScrollLayout @Override public void setStackCutoff(float stackCutoff) { if (SceneContainerFlag.isUnexpectedlyInLegacyMode()) return; if (mAmbientState.getStackCutoff() != stackCutoff) { mAmbientState.setStackCutoff(stackCutoff); updateStackEndHeightAndStackHeight(mAmbientState.getExpansionFraction()); requestChildrenUpdate(); } } @Override Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java +26 −1 Original line number Diff line number Diff line Loading @@ -95,6 +95,7 @@ import com.android.systemui.statusbar.notification.emptyshade.ui.view.EmptyShade import com.android.systemui.statusbar.notification.footer.shared.FooterViewRefactor; import com.android.systemui.statusbar.notification.footer.shared.NotifRedesignFooter; import com.android.systemui.statusbar.notification.footer.ui.view.FooterView; import com.android.systemui.statusbar.notification.headsup.AvalancheController; import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow; import com.android.systemui.statusbar.notification.row.ExpandableView; import com.android.systemui.statusbar.notification.shared.NotificationThrottleHun; Loading @@ -103,7 +104,6 @@ import com.android.systemui.statusbar.notification.stack.shared.model.ShadeScrim import com.android.systemui.statusbar.phone.KeyguardBypassController; import com.android.systemui.statusbar.phone.ScreenOffAnimationController; import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager; import com.android.systemui.statusbar.notification.headsup.AvalancheController; import com.android.systemui.statusbar.policy.ResourcesSplitShadeStateController; import com.android.systemui.wallpapers.domain.interactor.WallpaperInteractor; Loading Loading @@ -354,6 +354,31 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { verify(mAmbientState).setInterpolatedStackHeight(stackEndHeight); } @Test @EnableSceneContainer public void updateStackCutoff_updatesStackEndHeight() { // GIVEN shade is fully open final float stackTop = 200f; final float stackCutoff = 1000f; final float stackHeight = stackCutoff - stackTop; mAmbientState.setStackTop(stackTop); mAmbientState.setStackCutoff(stackCutoff); mAmbientState.setStatusBarState(StatusBarState.SHADE); mStackScroller.setMaxDisplayedNotifications(-1); // no limit on the shade mStackScroller.setExpandFraction(1f); // shade is fully expanded assertThat(mAmbientState.getStackEndHeight()).isEqualTo(stackHeight); assertThat(mAmbientState.getInterpolatedStackHeight()).isEqualTo(stackHeight); // WHEN stackCutoff changes final float newStackCutoff = 800; mStackScroller.setStackCutoff(newStackCutoff); // THEN stackEndHeight is updated final float newStackHeight = newStackCutoff - stackTop; assertThat(mAmbientState.getStackEndHeight()).isEqualTo(newStackHeight); assertThat(mAmbientState.getInterpolatedStackHeight()).isEqualTo(newStackHeight); } @Test @EnableSceneContainer public void updateStackEndHeightAndStackHeight_maxNotificationsSet_withSceneContainer() { Loading