mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-20 03:08:19 +00:00
Finish recents animation synchronously on cancel event am: 2316dc4750
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/24755062 Change-Id: Ib8bd21048402db34caf681802599517b4a37cb94 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -331,7 +331,7 @@ public class TaskAnimationManager implements RecentsAnimationCallbacks.RecentsAn
|
||||
* Finishes the running recents animation.
|
||||
* @param forceFinish will synchronously finish the controller
|
||||
*/
|
||||
private void finishRunningRecentsAnimation(boolean toHome, boolean forceFinish) {
|
||||
public void finishRunningRecentsAnimation(boolean toHome, boolean forceFinish) {
|
||||
if (mController != null) {
|
||||
ActiveGestureLog.INSTANCE.addLog(
|
||||
/* event= */ "finishRunningRecentsAnimation", toHome);
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
*/
|
||||
package com.android.quickstep.inputconsumers;
|
||||
|
||||
import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.GestureDetector;
|
||||
import android.view.GestureDetector.SimpleOnGestureListener;
|
||||
@@ -52,7 +54,7 @@ public class NavHandleLongPressInputConsumer extends DelegateInputConsumer {
|
||||
if (longPressRunnable != null) {
|
||||
setActive(motionEvent);
|
||||
|
||||
longPressRunnable.run();
|
||||
MAIN_EXECUTOR.post(longPressRunnable);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -417,8 +417,9 @@ public class OtherActivityInputConsumer extends ContextWrapper implements InputC
|
||||
private void finishTouchTracking(MotionEvent ev) {
|
||||
TraceHelper.INSTANCE.beginSection(UP_EVT);
|
||||
|
||||
boolean isCanceled = ev.getActionMasked() == ACTION_CANCEL;
|
||||
if (mPassedWindowMoveSlop && mInteractionHandler != null) {
|
||||
if (ev.getActionMasked() == ACTION_CANCEL) {
|
||||
if (isCanceled) {
|
||||
mInteractionHandler.onGestureCancelled();
|
||||
} else {
|
||||
mVelocityTracker.computeCurrentVelocity(PX_PER_MS);
|
||||
@@ -440,8 +441,10 @@ public class OtherActivityInputConsumer extends ContextWrapper implements InputC
|
||||
if (mActiveCallbacks != null && mInteractionHandler != null) {
|
||||
if (mTaskAnimationManager.isRecentsAnimationRunning()) {
|
||||
// The animation started, but with no movement, in this case, there will be no
|
||||
// animateToProgress so we have to manually finish here.
|
||||
mTaskAnimationManager.finishRunningRecentsAnimation(false /* toHome */);
|
||||
// animateToProgress so we have to manually finish here. In the case of
|
||||
// ACTION_CANCEL, someone else may be doing something so finish synchronously.
|
||||
mTaskAnimationManager.finishRunningRecentsAnimation(false /* toHome */,
|
||||
isCanceled /* forceFinish */);
|
||||
} else {
|
||||
// The animation hasn't started yet, so insert a replacement handler into the
|
||||
// callbacks which immediately finishes the animation after it starts.
|
||||
|
||||
Reference in New Issue
Block a user