Loading packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithmTest.kt +14 −2 Original line number Diff line number Diff line Loading @@ -141,8 +141,7 @@ class StackScrollAlgorithmTest(flags: FlagsParameterization) : SysuiTestCase() { hostView.addView(notificationRow) headsUpAnimator = HeadsUpAnimator(context, kosmos.fakeSystemBarUtilsProxy) stackScrollAlgorithm = StackScrollAlgorithm(context, hostView, headsUpAnimator) stackScrollAlgorithm = StackScrollAlgorithm(context, hostView, headsUpAnimator) } private fun isTv(): Boolean { Loading Loading @@ -981,6 +980,19 @@ class StackScrollAlgorithmTest(flags: FlagsParameterization) : SysuiTestCase() { assertThat(notificationRow.viewState.alpha).isEqualTo(1f - ambientState.hideAmount) } @Test @EnableSceneContainer fun resetViewStates_shadeCollapsed_footerViewBecomesTransparent() { ambientState.expansionFraction = 0f stackScrollAlgorithm.initView(context) hostView.removeAllViews() hostView.addView(footerView) stackScrollAlgorithm.resetViewStates(ambientState, /* speedBumpIndex= */ 0) assertThat(footerView.viewState.alpha).isEqualTo(0f) } @Test fun resetViewStates_isOnKeyguard_emptyShadeViewBecomesTransparent() { ambientState.setStatusBarState(StatusBarState.KEYGUARD) Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java +4 −3 Original line number Diff line number Diff line Loading @@ -200,9 +200,10 @@ public class StackScrollAlgorithm { // On the final call to {@link #resetViewState}, the alpha is set back to 1f but // ambientState.isExpansionChanging() is now false. This causes a flicker on the // EmptyShadeView after the shade is collapsed. Make sure the empty shade view // isn't visible unless the shade is expanded. if (view instanceof EmptyShadeView && ambientState.getExpansionFraction() == 0f) { // EmptyShadeView or the FooterView after the shade is collapsed. Make sure these views // aren't visible unless the shade is expanded. if (ambientState.getExpansionFraction() == 0f && ((view instanceof EmptyShadeView) || ( SceneContainerFlag.isEnabled() && view instanceof FooterView))) { viewState.setAlpha(0f); } Loading Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithmTest.kt +14 −2 Original line number Diff line number Diff line Loading @@ -141,8 +141,7 @@ class StackScrollAlgorithmTest(flags: FlagsParameterization) : SysuiTestCase() { hostView.addView(notificationRow) headsUpAnimator = HeadsUpAnimator(context, kosmos.fakeSystemBarUtilsProxy) stackScrollAlgorithm = StackScrollAlgorithm(context, hostView, headsUpAnimator) stackScrollAlgorithm = StackScrollAlgorithm(context, hostView, headsUpAnimator) } private fun isTv(): Boolean { Loading Loading @@ -981,6 +980,19 @@ class StackScrollAlgorithmTest(flags: FlagsParameterization) : SysuiTestCase() { assertThat(notificationRow.viewState.alpha).isEqualTo(1f - ambientState.hideAmount) } @Test @EnableSceneContainer fun resetViewStates_shadeCollapsed_footerViewBecomesTransparent() { ambientState.expansionFraction = 0f stackScrollAlgorithm.initView(context) hostView.removeAllViews() hostView.addView(footerView) stackScrollAlgorithm.resetViewStates(ambientState, /* speedBumpIndex= */ 0) assertThat(footerView.viewState.alpha).isEqualTo(0f) } @Test fun resetViewStates_isOnKeyguard_emptyShadeViewBecomesTransparent() { ambientState.setStatusBarState(StatusBarState.KEYGUARD) Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java +4 −3 Original line number Diff line number Diff line Loading @@ -200,9 +200,10 @@ public class StackScrollAlgorithm { // On the final call to {@link #resetViewState}, the alpha is set back to 1f but // ambientState.isExpansionChanging() is now false. This causes a flicker on the // EmptyShadeView after the shade is collapsed. Make sure the empty shade view // isn't visible unless the shade is expanded. if (view instanceof EmptyShadeView && ambientState.getExpansionFraction() == 0f) { // EmptyShadeView or the FooterView after the shade is collapsed. Make sure these views // aren't visible unless the shade is expanded. if (ambientState.getExpansionFraction() == 0f && ((view instanceof EmptyShadeView) || ( SceneContainerFlag.isEnabled() && view instanceof FooterView))) { viewState.setAlpha(0f); } Loading