Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java +8 −0 Original line number Diff line number Diff line Loading @@ -169,6 +169,14 @@ 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) { viewState.setAlpha(0f); } // For EmptyShadeView if on keyguard, we need to control the alpha to create // a nice transition when the user is dragging down the notification panel. if (view instanceof EmptyShadeView && ambientState.isOnKeyguard()) { Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithmTest.kt +15 −2 Original line number Diff line number Diff line Loading @@ -393,9 +393,21 @@ class StackScrollAlgorithmTest : SysuiTestCase() { assertThat(emptyShadeView.viewState.alpha).isEqualTo(expected) } @Test fun resetViewStates_shadeCollapsed_emptyShadeViewBecomesTransparent() { ambientState.expansionFraction = 0f stackScrollAlgorithm.initView(context) hostView.removeAllViews() hostView.addView(emptyShadeView) stackScrollAlgorithm.resetViewStates(ambientState, /* speedBumpIndex= */ 0) assertThat(emptyShadeView.viewState.alpha).isEqualTo(0f) } @Test fun resetViewStates_isOnKeyguard_emptyShadeViewBecomesOpaque() { ambientState.setStatusBarState(StatusBarState.SHADE) ambientState.setStatusBarState(StatusBarState.KEYGUARD) ambientState.fractionToShade = 0.25f stackScrollAlgorithm.initView(context) hostView.removeAllViews() Loading @@ -403,7 +415,8 @@ class StackScrollAlgorithmTest : SysuiTestCase() { stackScrollAlgorithm.resetViewStates(ambientState, /* speedBumpIndex= */ 0) assertThat(emptyShadeView.viewState.alpha).isEqualTo(1f) val expected = getContentAlpha(ambientState.fractionToShade) assertThat(emptyShadeView.viewState.alpha).isEqualTo(expected) } @Test Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java +8 −0 Original line number Diff line number Diff line Loading @@ -169,6 +169,14 @@ 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) { viewState.setAlpha(0f); } // For EmptyShadeView if on keyguard, we need to control the alpha to create // a nice transition when the user is dragging down the notification panel. if (view instanceof EmptyShadeView && ambientState.isOnKeyguard()) { Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithmTest.kt +15 −2 Original line number Diff line number Diff line Loading @@ -393,9 +393,21 @@ class StackScrollAlgorithmTest : SysuiTestCase() { assertThat(emptyShadeView.viewState.alpha).isEqualTo(expected) } @Test fun resetViewStates_shadeCollapsed_emptyShadeViewBecomesTransparent() { ambientState.expansionFraction = 0f stackScrollAlgorithm.initView(context) hostView.removeAllViews() hostView.addView(emptyShadeView) stackScrollAlgorithm.resetViewStates(ambientState, /* speedBumpIndex= */ 0) assertThat(emptyShadeView.viewState.alpha).isEqualTo(0f) } @Test fun resetViewStates_isOnKeyguard_emptyShadeViewBecomesOpaque() { ambientState.setStatusBarState(StatusBarState.SHADE) ambientState.setStatusBarState(StatusBarState.KEYGUARD) ambientState.fractionToShade = 0.25f stackScrollAlgorithm.initView(context) hostView.removeAllViews() Loading @@ -403,7 +415,8 @@ class StackScrollAlgorithmTest : SysuiTestCase() { stackScrollAlgorithm.resetViewStates(ambientState, /* speedBumpIndex= */ 0) assertThat(emptyShadeView.viewState.alpha).isEqualTo(1f) val expected = getContentAlpha(ambientState.fractionToShade) assertThat(emptyShadeView.viewState.alpha).isEqualTo(expected) } @Test Loading