mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-04 09:56:49 +00:00
Merge "Cleanup overview threshold which was only needed for 2-button mode" into tm-qpr-dev am: 654ba7f6a8
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/20524510 Change-Id: I4b79ec1b38509bdc5c7e855d06b529e756f2cdbf Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -292,7 +292,6 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
|
||||
|
||||
private boolean mWasLauncherAlreadyVisible;
|
||||
|
||||
private boolean mPassedOverviewThreshold;
|
||||
private boolean mGestureStarted;
|
||||
private boolean mLogDirectionUpOrLeft = true;
|
||||
private PointF mDownPos;
|
||||
@@ -319,8 +318,8 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
|
||||
private final int mTaskbarCatchUpThreshold;
|
||||
private boolean mTaskbarAlreadyOpen;
|
||||
private final boolean mIsTransientTaskbar;
|
||||
// Only used when mIsTransientTaskbar is true.
|
||||
private boolean mHasReachedHomeOverviewThreshold;
|
||||
// May be set to false when mIsTransientTaskbar is true.
|
||||
private boolean mCanSlowSwipeGoHome = true;
|
||||
|
||||
public AbsSwipeUpHandler(Context context, RecentsAnimationDeviceState deviceState,
|
||||
TaskAnimationManager taskAnimationManager, GestureState gestureState,
|
||||
@@ -811,14 +810,6 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
|
||||
@UiThread
|
||||
@Override
|
||||
public void updateFinalShift() {
|
||||
final boolean passed = hasReachedHomeOverviewThreshold();
|
||||
if (passed != mPassedOverviewThreshold) {
|
||||
mPassedOverviewThreshold = passed;
|
||||
if (mDeviceState.isTwoButtonNavMode() && !mGestureState.isHandlingAtomicEvent()) {
|
||||
performHapticFeedback();
|
||||
}
|
||||
}
|
||||
|
||||
updateSysUiFlags(mCurrentShift.value);
|
||||
applyScrollAndTransform();
|
||||
|
||||
@@ -903,8 +894,6 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
|
||||
mStateCallback.runOnceAtState(STATE_APP_CONTROLLER_RECEIVED | STATE_GESTURE_STARTED,
|
||||
this::startInterceptingTouchesForGesture);
|
||||
mStateCallback.setStateOnUiThread(STATE_APP_CONTROLLER_RECEIVED);
|
||||
|
||||
mPassedOverviewThreshold = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1132,20 +1121,11 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
|
||||
return willGoToNewTask || isCenteredOnNewTask ? NEW_TASK : LAST_TASK;
|
||||
}
|
||||
|
||||
if (!mDeviceState.isFullyGesturalNavMode()) {
|
||||
return (!hasReachedHomeOverviewThreshold() && willGoToNewTask) ? NEW_TASK : RECENTS;
|
||||
}
|
||||
return willGoToNewTask ? NEW_TASK : HOME;
|
||||
}
|
||||
|
||||
private GestureEndTarget calculateEndTargetForNonFling(PointF velocity) {
|
||||
final boolean isScrollingToNewTask = isScrollingToNewTask();
|
||||
final boolean reachedHomeOverviewThreshold = hasReachedHomeOverviewThreshold();
|
||||
if (!mDeviceState.isFullyGesturalNavMode()) {
|
||||
return reachedHomeOverviewThreshold && mGestureStarted
|
||||
? RECENTS
|
||||
: (isScrollingToNewTask ? NEW_TASK : LAST_TASK);
|
||||
}
|
||||
|
||||
// Fully gestural mode.
|
||||
final boolean isFlingX = Math.abs(velocity.x) > mContext.getResources()
|
||||
@@ -1158,10 +1138,8 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
|
||||
return RECENTS;
|
||||
} else if (isScrollingToNewTask) {
|
||||
return NEW_TASK;
|
||||
} else if (reachedHomeOverviewThreshold) {
|
||||
return HOME;
|
||||
}
|
||||
return LAST_TASK;
|
||||
return velocity.y < 0 && mCanSlowSwipeGoHome ? HOME : LAST_TASK;
|
||||
}
|
||||
|
||||
private boolean isScrollingToNewTask() {
|
||||
@@ -1178,21 +1156,15 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets whether the current swipe has reached the threshold where if user lets go they would
|
||||
* go to either the home state or overview state.
|
||||
* Sets whether a slow swipe can go to the HOME end target when the user lets go. A slow swipe
|
||||
* for this purpose must meet two criteria:
|
||||
* 1) y-velocity is less than quickstep_fling_threshold_speed
|
||||
* AND
|
||||
* 2) motion pause has not been detected (possibly because
|
||||
* {@link MotionPauseDetector#setDisallowPause} has been called with disallowPause == true)
|
||||
*/
|
||||
public void setHasReachedHomeOverviewThreshold(boolean hasReachedHomeOverviewThreshold) {
|
||||
mHasReachedHomeOverviewThreshold = hasReachedHomeOverviewThreshold;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true iff swipe has reached the overview threshold.
|
||||
*/
|
||||
public boolean hasReachedHomeOverviewThreshold() {
|
||||
if (mIsTransientTaskbar) {
|
||||
return mHasReachedHomeOverviewThreshold;
|
||||
}
|
||||
return mCurrentShift.value > MIN_PROGRESS_FOR_OVERVIEW;
|
||||
public void setCanSlowSwipeGoHome(boolean canSlowSwipeGoHome) {
|
||||
mCanSlowSwipeGoHome = canSlowSwipeGoHome;
|
||||
}
|
||||
|
||||
@UiThread
|
||||
|
||||
@@ -340,8 +340,8 @@ public class OtherActivityInputConsumer extends ContextWrapper implements InputC
|
||||
boolean minSwipeMet = upDist >= mMotionPauseMinDisplacement;
|
||||
if (mIsTransientTaskbar) {
|
||||
minSwipeMet = upDist >= mTaskbarHomeOverviewThreshold;
|
||||
mInteractionHandler.setHasReachedHomeOverviewThreshold(minSwipeMet);
|
||||
}
|
||||
mInteractionHandler.setCanSlowSwipeGoHome(minSwipeMet);
|
||||
mMotionPauseDetector.setDisallowPause(!minSwipeMet
|
||||
|| isLikelyToStartNewTask);
|
||||
mMotionPauseDetector.addPosition(ev);
|
||||
|
||||
Reference in New Issue
Block a user