Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java +1 −1 Original line number Diff line number Diff line Loading @@ -163,7 +163,7 @@ public class StackScrollAlgorithm { // which is more expensive. if (shelfState.hidden) { // When the shelf is hidden, it won't clip views, so we don't hide rows return; continue; } final float shelfTop = shelfState.yTranslation; Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithmTest.kt +28 −1 Original line number Diff line number Diff line Loading @@ -179,7 +179,28 @@ class StackScrollAlgorithmTest : SysuiTestCase() { } @Test fun resetViewStates_hiddenShelf_viewAlphaDoesNotChange() { fun resetViewStates_hiddenShelf_allRowsBecomesTransparent() { hostView.removeAllViews() val row1 = mockExpandableNotificationRow() hostView.addView(row1) val row2 = mockExpandableNotificationRow() hostView.addView(row2) ambientState.setStatusBarState(StatusBarState.KEYGUARD) ambientState.hideAmount = 0.25f notificationShelf.viewState.hidden = true ambientState.shelf = notificationShelf stackScrollAlgorithm.initView(context) stackScrollAlgorithm.resetViewStates(ambientState, /* speedBumpIndex= */ 0) val expected = 1f - ambientState.hideAmount assertThat(row1.viewState.alpha).isEqualTo(expected) assertThat(row2.viewState.alpha).isEqualTo(expected) } @Test fun resetViewStates_hiddenShelf_shelfAlphaDoesNotChange() { val expected = notificationShelf.viewState.alpha notificationShelf.viewState.hidden = true ambientState.shelf = notificationShelf Loading Loading @@ -459,3 +480,9 @@ class StackScrollAlgorithmTest : SysuiTestCase() { assertEquals(1f, currentRoundness) } } private fun mockExpandableNotificationRow(): ExpandableNotificationRow { return mock(ExpandableNotificationRow::class.java).apply { whenever(viewState).thenReturn(ExpandableViewState()) } } Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java +1 −1 Original line number Diff line number Diff line Loading @@ -163,7 +163,7 @@ public class StackScrollAlgorithm { // which is more expensive. if (shelfState.hidden) { // When the shelf is hidden, it won't clip views, so we don't hide rows return; continue; } final float shelfTop = shelfState.yTranslation; Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithmTest.kt +28 −1 Original line number Diff line number Diff line Loading @@ -179,7 +179,28 @@ class StackScrollAlgorithmTest : SysuiTestCase() { } @Test fun resetViewStates_hiddenShelf_viewAlphaDoesNotChange() { fun resetViewStates_hiddenShelf_allRowsBecomesTransparent() { hostView.removeAllViews() val row1 = mockExpandableNotificationRow() hostView.addView(row1) val row2 = mockExpandableNotificationRow() hostView.addView(row2) ambientState.setStatusBarState(StatusBarState.KEYGUARD) ambientState.hideAmount = 0.25f notificationShelf.viewState.hidden = true ambientState.shelf = notificationShelf stackScrollAlgorithm.initView(context) stackScrollAlgorithm.resetViewStates(ambientState, /* speedBumpIndex= */ 0) val expected = 1f - ambientState.hideAmount assertThat(row1.viewState.alpha).isEqualTo(expected) assertThat(row2.viewState.alpha).isEqualTo(expected) } @Test fun resetViewStates_hiddenShelf_shelfAlphaDoesNotChange() { val expected = notificationShelf.viewState.alpha notificationShelf.viewState.hidden = true ambientState.shelf = notificationShelf Loading Loading @@ -459,3 +480,9 @@ class StackScrollAlgorithmTest : SysuiTestCase() { assertEquals(1f, currentRoundness) } } private fun mockExpandableNotificationRow(): ExpandableNotificationRow { return mock(ExpandableNotificationRow::class.java).apply { whenever(viewState).thenReturn(ExpandableViewState()) } }