Be a little more lenient with panel-open gestures.
The code would not consider any drag that did not complete
the "peek" distance (the distance the panel opens when you
press and hold on the status bar; on tablets this is
statusbarheight + closehandleheight, and on phones it's
headerheight + closehandleheight) as a candidate for a
fling, and set that drag's effective velocity to 0.
This CL just removes that check. Now a fling must meet the
minimum linear velocity and minimum Y distance thresholds
(100dp/sec and 20dp, respectively) to change the position of
the panel (closed->open or open->closed).
Bug: 7390976
Change-Id: Ia0c2450f9fdf3f27b890aab240a155dad1ab052f
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java
index 6dee015..7035006 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java
@@ -336,7 +336,7 @@
final float deltaY = Math.abs(mFinalTouchY - mInitialTouchY);
if (deltaY < mFlingGestureMinDistPx
|| vel < mFlingExpandMinVelocityPx
- || mJustPeeked) {
+ ) {
vel = 0;
}
@@ -344,10 +344,8 @@
vel = -vel;
}
- if (DEBUG) LOG("gesture: dy=%f vraw=(%f,%f) vnorm=(%f,%f) vlinear=%f",
+ if (DEBUG) LOG("gesture: dy=%f vel=(%f,%f) vlinear=%f",
deltaY,
- mVelocityTracker.getXVelocity(),
- mVelocityTracker.getYVelocity(),
xVel, yVel,
vel);