From b8836060f32f284236f9ef2fab9dbd3108a8f524 Mon Sep 17 00:00:00 2001 From: Michal Brzezinski Date: Thu, 15 Apr 2021 17:02:31 +0000 Subject: [PATCH] Fixing QS expanding in split shade when swipe happens on notifications Now QuickSettings expand only when swipe begins on them, measured by initial touch X position. NSSL is receiving touches correctly from NotificationPanelViewController (shouldn't be intercepted) but then if nothing wants to handle that internally, it's passing it back to OnOverscrollTopChangedListener where we are aware of split shade mode and can cancel expansion of quick settings. Bug: 181235927 Test: manual Change-Id: Ic288c468770bf199435fed9a0896f757e41fa721 --- .../statusbar/phone/NotificationPanelViewController.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java index 7032aefc7a4dd..31545b84514da 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java @@ -3599,6 +3599,12 @@ public class NotificationPanelViewController extends PanelViewController { @Override public void flingTopOverscroll(float velocity, boolean open) { + // in split shade mode we want to expand/collapse QS only when touch happens within QS + if (mShouldUseSplitNotificationShade + && (mInitialTouchX < mQsFrame.getX() + || mInitialTouchX > mQsFrame.getX() + mQsFrame.getWidth())) { + return; + } mLastOverscroll = 0f; mQsExpansionFromOverscroll = false; setQsExpansion(mQsExpansionHeight);