From d29a9ab1b607a41d41213be2cde05c59438e3d86 Mon Sep 17 00:00:00 2001 From: Selim Cinek Date: Mon, 14 May 2018 19:17:06 -0700 Subject: [PATCH] Hiding all views when the notification shade is collapsed Non-heads up views could still be visible when the shade was collapsed. Therefore they would briefly peak out after heads up views would be swiped away leading to ugly flickering. Test: add hun (with notch enabled) and swipe away hun with other views present Change-Id: I794693d7d5af5591490df7c2f4b95c01043897d2 Fixes: 76150837 --- .../statusbar/stack/StackScrollAlgorithm.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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,