Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java +5 −10 Original line number Original line Diff line number Diff line Loading @@ -826,16 +826,11 @@ public class StackScrollAlgorithm { } } } } if (row.isPinned()) { if (row.isPinned()) { if (NotificationsImprovedHunAnimation.isEnabled()) { // Make sure row yTranslation is at at least the HUN yTranslation, // Make sure row yTranslation is at the HUN yTranslation, // which accounts for AmbientState.stackTopMargin in split-shade. childState.setYTranslation(headsUpTranslation); } else { // Make sure row yTranslation is at maximum the HUN yTranslation, // which accounts for AmbientState.stackTopMargin in split-shade. // which accounts for AmbientState.stackTopMargin in split-shade. // Once we start opening the shade, we keep the previously calculated translation. childState.setYTranslation( childState.setYTranslation( Math.max(childState.getYTranslation(), headsUpTranslation)); Math.max(childState.getYTranslation(), headsUpTranslation)); } childState.height = Math.max(row.getIntrinsicHeight(), childState.height); childState.height = Math.max(row.getIntrinsicHeight(), childState.height); childState.hidden = false; childState.hidden = false; ExpandableViewState topState = ExpandableViewState topState = Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithmTest.kt +13 −0 Original line number Original line Diff line number Diff line Loading @@ -85,6 +85,7 @@ class StackScrollAlgorithmTest : SysuiTestCase() { private val bigGap = px(R.dimen.notification_section_divider_height) private val bigGap = px(R.dimen.notification_section_divider_height) private val smallGap = px(R.dimen.notification_section_divider_height_lockscreen) private val smallGap = px(R.dimen.notification_section_divider_height_lockscreen) private val scrimPadding = px(R.dimen.notification_side_paddings) @Before @Before fun setUp() { fun setUp() { Loading Loading @@ -118,6 +119,18 @@ class StackScrollAlgorithmTest : SysuiTestCase() { resetViewStates_stackMargin_changesHunYTranslation() resetViewStates_stackMargin_changesHunYTranslation() } } @Test fun resetViewStates_defaultHunWhenShadeIsOpening_yTranslationIsInset() { whenever(notificationRow.isPinned).thenReturn(true) whenever(notificationRow.isHeadsUp).thenReturn(true) // scroll the panel over the HUN inset ambientState.stackY = stackScrollAlgorithm.mHeadsUpInset + bigGap // the HUN translation should be the panel scroll position + the scrim padding resetViewStates_hunYTranslationIs(ambientState.stackY + scrimPadding) } @Test @Test @DisableFlags(NotificationsImprovedHunAnimation.FLAG_NAME) @DisableFlags(NotificationsImprovedHunAnimation.FLAG_NAME) fun resetViewStates_hunAnimatingAway_yTranslationIsInset() { fun resetViewStates_hunAnimatingAway_yTranslationIsInset() { Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java +5 −10 Original line number Original line Diff line number Diff line Loading @@ -826,16 +826,11 @@ public class StackScrollAlgorithm { } } } } if (row.isPinned()) { if (row.isPinned()) { if (NotificationsImprovedHunAnimation.isEnabled()) { // Make sure row yTranslation is at at least the HUN yTranslation, // Make sure row yTranslation is at the HUN yTranslation, // which accounts for AmbientState.stackTopMargin in split-shade. childState.setYTranslation(headsUpTranslation); } else { // Make sure row yTranslation is at maximum the HUN yTranslation, // which accounts for AmbientState.stackTopMargin in split-shade. // which accounts for AmbientState.stackTopMargin in split-shade. // Once we start opening the shade, we keep the previously calculated translation. childState.setYTranslation( childState.setYTranslation( Math.max(childState.getYTranslation(), headsUpTranslation)); Math.max(childState.getYTranslation(), headsUpTranslation)); } childState.height = Math.max(row.getIntrinsicHeight(), childState.height); childState.height = Math.max(row.getIntrinsicHeight(), childState.height); childState.hidden = false; childState.hidden = false; ExpandableViewState topState = ExpandableViewState topState = Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithmTest.kt +13 −0 Original line number Original line Diff line number Diff line Loading @@ -85,6 +85,7 @@ class StackScrollAlgorithmTest : SysuiTestCase() { private val bigGap = px(R.dimen.notification_section_divider_height) private val bigGap = px(R.dimen.notification_section_divider_height) private val smallGap = px(R.dimen.notification_section_divider_height_lockscreen) private val smallGap = px(R.dimen.notification_section_divider_height_lockscreen) private val scrimPadding = px(R.dimen.notification_side_paddings) @Before @Before fun setUp() { fun setUp() { Loading Loading @@ -118,6 +119,18 @@ class StackScrollAlgorithmTest : SysuiTestCase() { resetViewStates_stackMargin_changesHunYTranslation() resetViewStates_stackMargin_changesHunYTranslation() } } @Test fun resetViewStates_defaultHunWhenShadeIsOpening_yTranslationIsInset() { whenever(notificationRow.isPinned).thenReturn(true) whenever(notificationRow.isHeadsUp).thenReturn(true) // scroll the panel over the HUN inset ambientState.stackY = stackScrollAlgorithm.mHeadsUpInset + bigGap // the HUN translation should be the panel scroll position + the scrim padding resetViewStates_hunYTranslationIs(ambientState.stackY + scrimPadding) } @Test @Test @DisableFlags(NotificationsImprovedHunAnimation.FLAG_NAME) @DisableFlags(NotificationsImprovedHunAnimation.FLAG_NAME) fun resetViewStates_hunAnimatingAway_yTranslationIsInset() { fun resetViewStates_hunAnimatingAway_yTranslationIsInset() { Loading