From c0ef565080da31ffceb7ef613e8578bf2f6e6539 Mon Sep 17 00:00:00 2001 From: Arthur Hung Date: Tue, 22 May 2018 14:00:42 +0800 Subject: FixBug: Round corner gone when scroll to non-first item and drag to close Add some notification and scroll to non-first item, Then drag to close notification panel, the top round corner will become rectangle corner. Case 1: the round corner only in first item. Case 2: the round corner cross first and second. Bug: 80110795 Test: add notifications, scroll, drag to close Test: atest SystemUITest Change-Id: I64146ebd1e3b7d19fd5b466290fc9fd5de5b8d5d --- .../systemui/statusbar/stack/NotificationStackScrollLayout.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java index a2b33fa1a581..0aa51c99c24b 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java @@ -760,7 +760,9 @@ public class NotificationStackScrollLayout extends ViewGroup } private void updateClippingToTopRoundedCorner() { - Float clipStart = (float) mTopPadding + mAmbientState.getExpandAnimationTopChange(); + Float clipStart = (float) mTopPadding + + mStackTranslation + + mAmbientState.getExpandAnimationTopChange(); Float clipEnd = clipStart + mCornerRadius; boolean first = true; for (int i = 0; i < getChildCount(); i++) { @@ -769,8 +771,7 @@ public class NotificationStackScrollLayout extends ViewGroup continue; } float start = child.getTranslationY(); - float end = start + Math.max(child.getActualHeight() - child.getClipBottomAmount(), - 0); + float end = start + child.getActualHeight(); boolean clip = clipStart > start && clipStart < end || clipEnd >= start && clipEnd <= end; clip &= !(first && mOwnScrollY == 0); -- cgit v1.2.3-59-g8ed1b