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

Commit a4d33992 authored by Jorim Jaggi's avatar Jorim Jaggi Committed by Android (Google) Code Review
Browse files

Merge "Fix weird state when flinging with open quick settings."

parents 54424bc1 c9a52ab0
Loading
Loading
Loading
Loading
+13 −6
Original line number Diff line number Diff line
@@ -249,6 +249,11 @@ public class NotificationPanelView extends PanelView implements

            case MotionEvent.ACTION_CANCEL:
            case MotionEvent.ACTION_UP:
                trackMovement(event);
                if (mTracking) {
                    flingWithCurrentVelocity();
                    mTracking = false;
                }
                mIntercepting = false;
                break;
        }
@@ -264,6 +269,13 @@ public class NotificationPanelView extends PanelView implements
        }
    }

    private void flingWithCurrentVelocity() {
        float vel = getCurrentVelocity();

        // TODO: Better logic whether we should expand or not.
        flingSettings(vel, vel > 0);
    }

    @Override
    public boolean onTouchEvent(MotionEvent event) {
        // TODO: Handle doublefinger swipe to notifications again. Look at history for a reference
@@ -313,12 +325,7 @@ public class NotificationPanelView extends PanelView implements
                    mTracking = false;
                    mTrackingPointer = -1;
                    trackMovement(event);

                    float vel = getCurrentVelocity();

                    // TODO: Better logic whether we should expand or not.
                    flingSettings(vel, vel > 0);

                    flingWithCurrentVelocity();
                    if (mVelocityTracker != null) {
                        mVelocityTracker.recycle();
                        mVelocityTracker = null;