From baeac78271a14079d62cf6c132fba233942af58d Mon Sep 17 00:00:00 2001 From: Michal Brzezinski Date: Mon, 12 Sep 2022 17:32:29 +0100 Subject: [PATCH] Part 2 of removing shade blinking while moving heads-up notification While touching HUN we're immediately setting some height of shade and in split shade - because QS are expanded by default - that causes QS height update as well which makes shade expanded for fraction of a second. Solution here is to not update QS height at this stage while HUN is visible but the rest of the shade should not be. Test: Show HUN, try dragging it up or down and see no blinking of shade Fixes: 234940017 Change-Id: I6dbaf211d15779573d89bd1bd1c87201207a5e71 --- .../shade/NotificationPanelViewController.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java b/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java index 11103861f70b4..df2212ca10a2c 100644 --- a/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java +++ b/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java @@ -3128,8 +3128,17 @@ public final class NotificationPanelViewController extends PanelViewController { positionClockAndNotifications(); } } - if (mQsExpandImmediate || (mQsExpanded && !mQsTracking && mQsExpansionAnimator == null - && !mQsExpansionFromOverscroll)) { + // Below is true when QS are expanded and we swipe up from the same bottom of panel to + // close the whole shade with one motion. Also this will be always true when closing + // split shade as there QS are always expanded so every collapsing motion is motion from + // expanded QS to closed panel + boolean collapsingShadeFromExpandedQs = mQsExpanded && !mQsTracking + && mQsExpansionAnimator == null && !mQsExpansionFromOverscroll; + boolean goingBetweenClosedShadeAndExpandedQs = + mQsExpandImmediate || collapsingShadeFromExpandedQs; + // we don't want to update QS expansion when HUN is visible because then the whole shade is + // initially hidden, even though it has non-zero height + if (goingBetweenClosedShadeAndExpandedQs && !mHeadsUpManager.isTrackingHeadsUp()) { float qsExpansionFraction; if (mSplitShadeEnabled) { qsExpansionFraction = 1;