From daab6f5dbffa2683d5bdb636bd1e618095350c1f Mon Sep 17 00:00:00 2001 From: Selim Cinek Date: Thu, 6 Apr 2017 16:46:34 -0700 Subject: [PATCH] Fixed the visual appearance on heads-up notifications Previously the wrong notifications were displayed on top which could lead to heads-up notifications appearing halfway. Test: manual, add 2 heads-up see that the correct one is displayed Change-Id: I723474e2fe1586e2011a9808f8b8c77a706a6070 Fixes: 36549554 --- .../systemui/statusbar/stack/StackScrollAlgorithm.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 ba91ffd04c0eb..b5db78d128ff4 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/stack/StackScrollAlgorithm.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/stack/StackScrollAlgorithm.java @@ -495,12 +495,12 @@ public class StackScrollAlgorithm { int childCount = algorithmState.visibleChildren.size(); float childrenOnTop = 0.0f; for (int i = childCount - 1; i >= 0; i--) { - updateChildZValue(i, childrenOnTop, + childrenOnTop = updateChildZValue(i, childrenOnTop, resultState, algorithmState, ambientState); } } - protected void updateChildZValue(int i, float childrenOnTop, + protected float updateChildZValue(int i, float childrenOnTop, StackScrollState resultState, StackScrollAlgorithmState algorithmState, AmbientState ambientState) { ExpandableView child = algorithmState.visibleChildren.get(i); @@ -538,6 +538,7 @@ public class StackScrollAlgorithm { } else { childViewState.zTranslation = baseZ; } + return childrenOnTop; } public void setIsExpanded(boolean isExpanded) {