Merge "Fix case of gesture being stuck when the Launcher is stopped mid-gesture" into tm-qpr-dev am: a4512046cf
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/19939112 Change-Id: I59734e44784feda5d7920060a66b2db2cc681f15 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -1140,6 +1140,13 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
|
|||||||
boolean isCancel) {
|
boolean isCancel) {
|
||||||
long duration = MAX_SWIPE_DURATION;
|
long duration = MAX_SWIPE_DURATION;
|
||||||
float currentShift = mCurrentShift.value;
|
float currentShift = mCurrentShift.value;
|
||||||
|
boolean recentsVisible = mRecentsView != null
|
||||||
|
&& (mRecentsView.getWindowVisibility() == View.VISIBLE);
|
||||||
|
if (!recentsVisible) {
|
||||||
|
// We've hit a case where Launcher is been stopped mid-gesture, in this case, force
|
||||||
|
// a LAST_TASK end target
|
||||||
|
isCancel = true;
|
||||||
|
}
|
||||||
final GestureEndTarget endTarget = calculateEndTarget(velocity, endVelocity,
|
final GestureEndTarget endTarget = calculateEndTarget(velocity, endVelocity,
|
||||||
isFling, isCancel);
|
isFling, isCancel);
|
||||||
// Set the state, but don't notify until the animation completes
|
// Set the state, but don't notify until the animation completes
|
||||||
@@ -1219,7 +1226,7 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
|
|||||||
|
|
||||||
// Let RecentsView handle the scrolling to the task, which we launch in startNewTask()
|
// Let RecentsView handle the scrolling to the task, which we launch in startNewTask()
|
||||||
// or resumeLastTask().
|
// or resumeLastTask().
|
||||||
if (mRecentsView != null) {
|
if (recentsVisible) {
|
||||||
ActiveGestureLog.INSTANCE.trackEvent(ActiveGestureErrorDetector.GestureEvent
|
ActiveGestureLog.INSTANCE.trackEvent(ActiveGestureErrorDetector.GestureEvent
|
||||||
.SET_ON_PAGE_TRANSITION_END_CALLBACK);
|
.SET_ON_PAGE_TRANSITION_END_CALLBACK);
|
||||||
mRecentsView.setOnPageTransitionEndCallback(
|
mRecentsView.setOnPageTransitionEndCallback(
|
||||||
|
|||||||
Reference in New Issue
Block a user