Use movement on the trackpad instead of on screen for trackpad gestures used for gesture nav

Bug: 254783214
Test: https://recall.googleplex.com/projects/3388b17c-d22f-46f8-b140-a102690377b4/sessions/f3311fbc-d8cf-4f19-b83c-8626aa285452
Change-Id: Iad2da5831af85dd3647e1e31b42fea0a6302b49c
This commit is contained in:
Tracy Zhou
2022-11-05 00:19:35 -07:00
parent ce6e5a3cb5
commit aef9d75f78
5 changed files with 177 additions and 44 deletions
@@ -293,7 +293,6 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
private boolean mPassedOverviewThreshold;
private boolean mGestureStarted;
private boolean mLogDirectionUpOrLeft = true;
private PointF mDownPos;
private boolean mIsLikelyToStartNewTask;
private final long mTouchTimeMs;
@@ -991,10 +990,9 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
/**
* @param endVelocity The velocity in the direction of the nav bar to the middle of the screen.
* @param velocity The x and y components of the velocity when the gesture ends.
* @param downPos The x and y value of where the gesture started.
*/
@UiThread
public void onGestureEnded(float endVelocity, PointF velocity, PointF downPos) {
public void onGestureEnded(float endVelocity, PointF velocity) {
float flingThreshold = mContext.getResources()
.getDimension(R.dimen.quickstep_fling_threshold_speed);
boolean isFling = mGestureStarted && !mIsMotionPaused
@@ -1006,7 +1004,6 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
} else {
mLogDirectionUpOrLeft = velocity.x < 0;
}
mDownPos = downPos;
Runnable handleNormalGestureEndCallback = () ->
handleNormalGestureEnd(endVelocity, isFling, velocity, /* isCancel= */ false);
if (mRecentsView != null) {
@@ -1281,7 +1278,7 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
}
private void doLogGesture(GestureEndTarget endTarget, @Nullable TaskView targetTask) {
if (mDp == null || !mDp.isGestureMode || mDownPos == null) {
if (mDp == null || !mDp.isGestureMode) {
// We probably never received an animation controller, skip logging.
return;
}