Merge "Decrease overview degree threshold from 45 to 15 degrees." into tm-dev

This commit is contained in:
Brian Isganitis
2022-04-20 17:14:42 +00:00
committed by Android (Google) Code Review
2 changed files with 15 additions and 5 deletions
@@ -1006,8 +1006,8 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
return false; return false;
} }
private GestureEndTarget calculateEndTarget(PointF velocity, float endVelocity, boolean isFling, private GestureEndTarget calculateEndTarget(PointF velocity, float endVelocity,
boolean isCancel) { boolean isFlingY, boolean isCancel) {
if (mGestureState.isHandlingAtomicEvent()) { if (mGestureState.isHandlingAtomicEvent()) {
// Button mode, this is only used to go to recents // Button mode, this is only used to go to recents
return RECENTS; return RECENTS;
@@ -1028,11 +1028,17 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
goingToNewTask = false; goingToNewTask = false;
} }
final boolean reachedOverviewThreshold = mCurrentShift.value >= MIN_PROGRESS_FOR_OVERVIEW; final boolean reachedOverviewThreshold = mCurrentShift.value >= MIN_PROGRESS_FOR_OVERVIEW;
if (!isFling) { final boolean isFlingX = Math.abs(velocity.x) > mContext.getResources()
.getDimension(R.dimen.quickstep_fling_threshold_speed);
if (!isFlingY) {
if (isCancel) { if (isCancel) {
endTarget = LAST_TASK; endTarget = LAST_TASK;
} else if (mDeviceState.isFullyGesturalNavMode()) { } else if (mDeviceState.isFullyGesturalNavMode()) {
if (mIsMotionPaused) { if (goingToNewTask && isFlingX) {
// Flinging towards new task takes precedence over mIsMotionPaused (which only
// checks y-velocity).
endTarget = NEW_TASK;
} else if (mIsMotionPaused) {
endTarget = RECENTS; endTarget = RECENTS;
} else if (goingToNewTask) { } else if (goingToNewTask) {
endTarget = NEW_TASK; endTarget = NEW_TASK;
@@ -84,6 +84,9 @@ public class OtherActivityInputConsumer extends ContextWrapper implements InputC
public static final float QUICKSTEP_TOUCH_SLOP_RATIO_TWO_BUTTON = 9; public static final float QUICKSTEP_TOUCH_SLOP_RATIO_TWO_BUTTON = 9;
public static final float QUICKSTEP_TOUCH_SLOP_RATIO_GESTURAL = 2; public static final float QUICKSTEP_TOUCH_SLOP_RATIO_GESTURAL = 2;
// Minimum angle of a gesture's coordinate where a release goes to overview.
public static final int OVERVIEW_MIN_DEGREES = 15;
private final RecentsAnimationDeviceState mDeviceState; private final RecentsAnimationDeviceState mDeviceState;
private final NavBarPosition mNavBarPosition; private final NavBarPosition mNavBarPosition;
private final TaskAnimationManager mTaskAnimationManager; private final TaskAnimationManager mTaskAnimationManager;
@@ -291,8 +294,9 @@ public class OtherActivityInputConsumer extends ContextWrapper implements InputC
// the gesture (in which case mPassedPilferInputSlop starts as true). // the gesture (in which case mPassedPilferInputSlop starts as true).
boolean haveNotPassedSlopOnContinuedGesture = boolean haveNotPassedSlopOnContinuedGesture =
!mPassedSlopOnThisGesture && mPassedPilferInputSlop; !mPassedSlopOnThisGesture && mPassedPilferInputSlop;
double degrees = Math.toDegrees(Math.atan(upDist / horizontalDist));
boolean isLikelyToStartNewTask = haveNotPassedSlopOnContinuedGesture boolean isLikelyToStartNewTask = haveNotPassedSlopOnContinuedGesture
|| horizontalDist > upDist; || degrees <= OVERVIEW_MIN_DEGREES;
if (!mPassedPilferInputSlop) { if (!mPassedPilferInputSlop) {
if (passedSlop) { if (passedSlop) {