OSDN Git Service

Fixed the visual appearance on heads-up notifications
authorSelim Cinek <cinek@google.com>
Thu, 6 Apr 2017 23:46:34 +0000 (16:46 -0700)
committerSelim Cinek <cinek@google.com>
Thu, 6 Apr 2017 23:46:34 +0000 (16:46 -0700)
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

packages/SystemUI/src/com/android/systemui/statusbar/stack/StackScrollAlgorithm.java

index ba91ffd..b5db78d 100644 (file)
@@ -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) {