diff options
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/ExpandableView.java | 6 | ||||
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/stack/StackScrollAlgorithm.java | 4 |
2 files changed, 8 insertions, 2 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableView.java b/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableView.java index ccec759..71baf57 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableView.java @@ -374,7 +374,11 @@ public abstract class ExpandableView extends FrameLayout { } private void updateClipping() { - mClipRect.set(0, mClipTopOptimization, getWidth(), getActualHeight()); + int top = mClipTopOptimization; + if (top >= getActualHeight()) { + top = getActualHeight() - 1; + } + mClipRect.set(0, top, getWidth(), getActualHeight()); setClipBounds(mClipRect); } 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 5d2e5b7..82064a7 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/stack/StackScrollAlgorithm.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/stack/StackScrollAlgorithm.java @@ -413,7 +413,9 @@ public class StackScrollAlgorithm { ExpandableNotificationRow topHeadsUpEntry = ambientState.getTopHeadsUpEntry(); int childCount = algorithmState.visibleChildren.size(); - int numberOfElementsCompletelyIn = (int) algorithmState.itemsInTopStack; + int numberOfElementsCompletelyIn = algorithmState.partialInTop == 1.0f + ? algorithmState.lastTopStackIndex + : (int) algorithmState.itemsInTopStack; for (int i = 0; i < childCount; i++) { ExpandableView child = algorithmState.visibleChildren.get(i); StackViewState childViewState = resultState.getViewStateForView(child); |