Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a4c53b8f authored by Michał Brzeziński's avatar Michał Brzeziński Committed by Automerger Merge Worker
Browse files

Merge "Fixing QS reacting to touches in notifications area in split shade"...

Merge "Fixing QS reacting to touches in notifications area in split shade" into sc-v2-dev am: df844e0c am: cdc2d39c

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15675160

Change-Id: I26a5e7cce030df010e8dc0c9b8aa158c86bcbcd8
parents a7bc3b3b cdc2d39c
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -2000,6 +2000,9 @@ public class NotificationPanelViewController extends PanelViewController {


    private boolean handleQsTouch(MotionEvent event) {
        if (mShouldUseSplitNotificationShade && touchXOutsideOfQs(event.getX())) {
            return false;
        }
        final int action = event.getActionMasked();
        if (action == MotionEvent.ACTION_DOWN && getExpandedFraction() == 1f
                && mBarState != KEYGUARD && !mQsExpanded && isQsExpansionEnabled()) {
@@ -2041,8 +2044,12 @@ public class NotificationPanelViewController extends PanelViewController {
        return false;
    }

    private boolean touchXOutsideOfQs(float touchX) {
        return touchX < mQsFrame.getX() || touchX > mQsFrame.getX() + mQsFrame.getWidth();
    }

    private boolean isInQsArea(float x, float y) {
        if (x < mQsFrame.getX() || x > mQsFrame.getX() + mQsFrame.getWidth()) {
        if (touchXOutsideOfQs(x)) {
            return false;
        }
        // Let's reject anything at the very bottom around the home handle in gesture nav
@@ -4200,9 +4207,7 @@ 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())) {
            if (mShouldUseSplitNotificationShade && touchXOutsideOfQs(mInitialTouchX)) {
                return;
            }
            mLastOverscroll = 0f;