From 6e0cca4339a43035f5b0aa82b0bfc80df0efab6e Mon Sep 17 00:00:00 2001 From: Michal Brzezinski Date: Fri, 18 Nov 2022 16:19:09 +0000 Subject: [PATCH] Fixing jumping HUN when starting swiping HUN was jumping vertically wherever we are using large screen header: all large screen configurations + handheld landscape. This was caused by different way of calculating appearEnd and appearStart positions. appearEnd was taking into account stack scroller margin introduced by large screen header, but appearStart was just using headsUpInset which ignores that margin. Accounting for margin fixes this issue. Bug: 259679234 Test: manually, pull down/up on HUN and see it not jumping vertically, videos attached Change-Id: Ib259d0eda9c80d78d517f018bccc7011dcb4203c --- .../notification/stack/NotificationStackScrollLayout.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java index 09b7d13237cf2..30b8b87c555f8 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java @@ -1553,7 +1553,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable final int pinnedHeight = firstVisibleSection != null ? firstVisibleSection.getFirstVisibleChild().getPinnedHeadsUpHeight() : 0; - return mHeadsUpInset + pinnedHeight; + return mHeadsUpInset - mAmbientState.getStackTopMargin() + pinnedHeight; } return getMinExpansionHeight(); }