Remove invisible home task view as soon as gesture to Recents ends

Fixes: 168288052
Change-Id: I929d021b26dad8b2f9b1f6a659522054bbf3ec28
This commit is contained in:
Tony Wickham
2020-09-21 16:18:43 -07:00
parent 445e4b4b9b
commit c445a359ae
3 changed files with 22 additions and 8 deletions
@@ -434,9 +434,13 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<?>, 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();
}
@@ -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<RecentsActivity>
}
/**
* 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);
@@ -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<T extends StatefulActivity> 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)) {