mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-20 03:08:19 +00:00
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:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user