diff options
3 files changed, 24 insertions, 5 deletions
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithmTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithmTest.kt index 01ba4df3a314..7603eecd27ff 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithmTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithmTest.kt @@ -146,6 +146,20 @@ class StackScrollAlgorithmTest(flags: FlagsParameterization) : SysuiTestCase() { } @Test + @EnableSceneContainer + fun resetViewStates_defaultHun_hasShadow() { + val headsUpTop = 200f + ambientState.headsUpTop = headsUpTop + + whenever(notificationRow.isPinned).thenReturn(true) + whenever(notificationRow.isHeadsUp).thenReturn(true) + + stackScrollAlgorithm.resetViewStates(ambientState, 0) + + assertThat(notificationRow.viewState.zTranslation).isGreaterThan(baseZ) + } + + @Test @DisableSceneContainer fun resetViewStates_defaultHunWhenShadeIsOpening_yTranslationIsInset() { whenever(notificationRow.isPinned).thenReturn(true) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java index 473460b77e46..6f7eade1c0f2 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java @@ -4265,6 +4265,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView pw.print(", isPinned: " + isPinned()); pw.print(", expandedWhenPinned: " + mExpandedWhenPinned); pw.print(", isMinimized: " + mIsMinimized); + pw.print(", isAboveShelf: " + isAboveShelf()); pw.println(); if (NotificationContentView.INCLUDE_HEIGHTS_TO_DUMP) { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java index 06b989aaab57..08692bea2292 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java @@ -1227,13 +1227,17 @@ public class StackScrollAlgorithm { float baseZ = ambientState.getBaseZHeight(); if (SceneContainerFlag.isEnabled()) { - // SceneContainer flags off this logic, and just sets the baseZ because: + // SceneContainer simplifies this logic, because: // - there are no overlapping HUNs anymore, no need for multiplying their shadows // - shadows for HUNs overlapping with the stack are now set from updateHeadsUpStates - // - shadows for HUNs overlapping with the shelf are NOT set anymore, because it only - // happens on AOD/Pulsing, where they're displayed on a black background so a shadow - // wouldn't be visible. - childViewState.setZTranslation(baseZ); + if (child.isPinned() || ambientState.getTrackedHeadsUpRow() == child) { + // set a default elevation on the HUN, which would be overridden + // from updateHeadsUpStates if it is displayed in the shade + childViewState.setZTranslation(baseZ + mPinnedZTranslationExtra); + } else { + // set baseZ for every notification + childViewState.setZTranslation(baseZ); + } } else { if (child.mustStayOnScreen() && !childViewState.headsUpIsVisible && !ambientState.isDozingAndNotPulsing(child) |