Swipe down on hotseat to launch recent task

If you're ever in overview and swipe down on the hotseat, it will launch
the focused task *unless* you entered overview from the workspace and
have not scrolled past the first task. This is a hidden state to allow
for reversibility of the swipe up from workspace.

Also moved PendingAnimation from quickstep to launcher3.

Change-Id: Iea077bc0ef7c74f6bf7b98d0a638892b9c5fe36c
This commit is contained in:
Tony Wickham
2018-04-02 15:22:06 -07:00
committed by Tony
parent 274b9529ff
commit 1c6f12d119
8 changed files with 61 additions and 11 deletions

View File

@@ -30,6 +30,7 @@ import com.android.launcher3.anim.AnimatorPlaybackController;
import com.android.launcher3.userevent.nano.LauncherLogProto.Action.Direction;
import com.android.launcher3.userevent.nano.LauncherLogProto.Action.Touch;
import com.android.launcher3.util.TouchController;
import com.android.launcher3.util.PendingAnimation;
/**
* TouchController for handling state changes
@@ -53,6 +54,7 @@ public abstract class AbstractStateChangeTouchController extends AnimatorListene
protected LauncherState mFromState;
protected LauncherState mToState;
protected AnimatorPlaybackController mCurrentAnimation;
protected PendingAnimation mPendingAnimation;
private float mStartProgress;
// Ratio of transition process [0, 1] to drag displacement (px)
@@ -254,7 +256,16 @@ public abstract class AbstractStateChangeTouchController extends AnimatorListene
mLauncher.getWorkspace().getCurrentPage());
}
clearState();
mLauncher.getStateManager().goToState(targetState, false /* animated */);
boolean shouldGoToTargetState = true;
if (mPendingAnimation != null) {
boolean reachedTarget = mToState == targetState;
mPendingAnimation.finish(reachedTarget);
mPendingAnimation = null;
shouldGoToTargetState = !reachedTarget;
}
if (shouldGoToTargetState) {
mLauncher.getStateManager().goToState(targetState, false /* animated */);
}
}
protected void clearState() {