diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/stack/StackScrollAlgorithm.java b/packages/SystemUI/src/com/android/systemui/statusbar/stack/StackScrollAlgorithm.java index f4d7f8d48a669..85f33d75e60cf 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/stack/StackScrollAlgorithm.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/stack/StackScrollAlgorithm.java @@ -478,6 +478,22 @@ public class StackScrollAlgorithm { childState.hidden = false; } } + // Let's hide all the views if we are not expanded. the views might otherwise be visible + // in the headsup area if a view was swiped away + if (!mIsExpanded) { + for (int i = 0; i < childCount; i++) { + boolean visible = false; + View child = algorithmState.visibleChildren.get(i); + if (child instanceof ExpandableNotificationRow) { + ExpandableNotificationRow row = (ExpandableNotificationRow) child; + visible = row.isHeadsUp() || row.isHeadsUpAnimatingAway(); + } + if (!visible) { + ExpandableViewState childState = resultState.getViewStateForView(child); + childState.hidden = true; + } + } + } } private void clampHunToTop(AmbientState ambientState, ExpandableNotificationRow row,