From c445a359ae1609f431f4a83399e5adc74e39afb0 Mon Sep 17 00:00:00 2001 From: Tony Wickham Date: Mon, 21 Sep 2020 16:18:43 -0700 Subject: [PATCH] Remove invisible home task view as soon as gesture to Recents ends Fixes: 168288052 Change-Id: I929d021b26dad8b2f9b1f6a659522054bbf3ec28 --- .../src/com/android/quickstep/AbsSwipeUpHandler.java | 10 +++++++--- .../quickstep/fallback/FallbackRecentsView.java | 10 ++++++---- .../src/com/android/quickstep/views/RecentsView.java | 10 +++++++++- 3 files changed, 22 insertions(+), 8 deletions(-) diff --git a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java index 26ad3778a7..22e6755eb1 100644 --- a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java +++ b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java @@ -434,9 +434,13 @@ public abstract class AbsSwipeUpHandler, Q extends mOnDeferredActivityLaunch); mGestureState.runOnceAtState(STATE_END_TARGET_SET, - () -> mDeviceState.getRotationTouchHelper(). - onEndTargetCalculated(mGestureState.getEndTarget(), - mActivityInterface)); + () -> { + mDeviceState.getRotationTouchHelper() + .onEndTargetCalculated(mGestureState.getEndTarget(), + mActivityInterface); + + mRecentsView.onGestureEndTargetCalculated(mGestureState.getEndTarget()); + }); notifyGestureStartedAsync(); } diff --git a/quickstep/src/com/android/quickstep/fallback/FallbackRecentsView.java b/quickstep/src/com/android/quickstep/fallback/FallbackRecentsView.java index f5f525965f..8f2356c696 100644 --- a/quickstep/src/com/android/quickstep/fallback/FallbackRecentsView.java +++ b/quickstep/src/com/android/quickstep/fallback/FallbackRecentsView.java @@ -15,6 +15,7 @@ */ package com.android.quickstep.fallback; +import static com.android.quickstep.GestureState.GestureEndTarget.RECENTS; import static com.android.quickstep.fallback.RecentsState.DEFAULT; import static com.android.quickstep.fallback.RecentsState.MODAL_TASK; @@ -27,6 +28,7 @@ import android.util.AttributeSet; import com.android.launcher3.anim.PendingAnimation; import com.android.launcher3.statemanager.StateManager.StateListener; import com.android.quickstep.FallbackActivityInterface; +import com.android.quickstep.GestureState; import com.android.quickstep.RecentsActivity; import com.android.quickstep.views.OverviewActionsView; import com.android.quickstep.views.RecentsView; @@ -74,14 +76,14 @@ public class FallbackRecentsView extends RecentsView } /** - * When the gesture ends and recents view become interactive, we also remove the temporary + * When the gesture ends and we're going to recents view, we also remove the temporary * invisible tile added for the home task. This also pushes the remaining tiles back * to the center. */ @Override - public void onGestureAnimationEnd() { - super.onGestureAnimationEnd(); - if (mHomeTaskInfo != null) { + public void onGestureEndTargetCalculated(GestureState.GestureEndTarget endTarget) { + super.onGestureEndTargetCalculated(endTarget); + if (mHomeTaskInfo != null && endTarget == RECENTS) { TaskView tv = getTaskView(mHomeTaskInfo.taskId); if (tv != null) { PendingAnimation pa = createTaskDismissAnimation(tv, true, false, 150); diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java index 0362377399..b617817728 100644 --- a/quickstep/src/com/android/quickstep/views/RecentsView.java +++ b/quickstep/src/com/android/quickstep/views/RecentsView.java @@ -118,6 +118,7 @@ import com.android.launcher3.util.ResourceBasedOverride.Overrides; import com.android.launcher3.util.Themes; import com.android.launcher3.util.ViewPool; import com.android.quickstep.BaseActivityInterface; +import com.android.quickstep.GestureState; import com.android.quickstep.RecentsAnimationController; import com.android.quickstep.RecentsAnimationTargets; import com.android.quickstep.RecentsModel; @@ -1183,7 +1184,14 @@ public abstract class RecentsView extends PagedView } /** - * Called when a gesture from an app has finished. + * Called when a gesture from an app has finished, and an end target has been determined. + */ + public void onGestureEndTargetCalculated(GestureState.GestureEndTarget endTarget) { + + } + + /** + * Called when a gesture from an app has finished, and the animation to the target has ended. */ public void onGestureAnimationEnd() { if (mOrientationState.setGestureActive(false)) {