From 6f97c0a8bf3c58c89d5ccd5ede7e32b6a02c5f83 Mon Sep 17 00:00:00 2001 From: Lucas Dupin Date: Mon, 26 Apr 2021 16:38:54 -0700 Subject: [PATCH] Fix notification top clipping Test: scroll through notifications on shade locked and shade Fixes: 185683835 Change-Id: I7b104a98565cf7bb85190f69d042d9fd592f721c --- .../statusbar/notification/stack/StackScrollAlgorithm.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java index 6cacec71db39a..33aa18fcf5a31 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java @@ -153,9 +153,7 @@ public class StackScrollAlgorithm { private void updateClipping(StackScrollAlgorithmState algorithmState, AmbientState ambientState) { - float drawStart = !ambientState.isOnKeyguard() ? ambientState.getTopPadding() - + ambientState.getStackTranslation() - : 0; + float drawStart = !ambientState.isOnKeyguard() ? ambientState.getStackY() : 0; float clipStart = 0; int childCount = algorithmState.visibleChildren.size(); boolean firstHeadsUp = true; @@ -168,8 +166,7 @@ public class StackScrollAlgorithm { float newYTranslation = state.yTranslation; float newHeight = state.height; float newNotificationEnd = newYTranslation + newHeight; - boolean isHeadsUp = (child instanceof ExpandableNotificationRow) - && ((ExpandableNotificationRow) child).isPinned(); + boolean isHeadsUp = (child instanceof ExpandableNotificationRow) && child.isPinned(); if (mClipNotificationScrollToTop && (!state.inShelf || (isHeadsUp && !firstHeadsUp)) && newYTranslation < clipStart