Defer jumping to NORMAL state if overview is still peeking
Bug: 137316430 Change-Id: I1ace19bb229d07bd9dfe5ed6f60c63715b9f8cf2
This commit is contained in:
parent
59b5b3f2a2
commit
e1463f5580
|
@ -167,6 +167,21 @@ public class FlingAndHoldTouchController extends PortraitStatesTouchController {
|
||||||
mMotionPauseDetector.clear();
|
mMotionPauseDetector.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void goToTargetState(LauncherState targetState, int logAction) {
|
||||||
|
if (mPeekAnim != null && mPeekAnim.isStarted()) {
|
||||||
|
// Don't jump to the target state until overview is no longer peeking.
|
||||||
|
mPeekAnim.addListener(new AnimatorListenerAdapter() {
|
||||||
|
@Override
|
||||||
|
public void onAnimationEnd(Animator animation) {
|
||||||
|
FlingAndHoldTouchController.super.goToTargetState(targetState, logAction);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
super.goToTargetState(targetState, logAction);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void updateAnimatorBuilderOnReinit(AnimatorSetBuilder builder) {
|
protected void updateAnimatorBuilderOnReinit(AnimatorSetBuilder builder) {
|
||||||
if (handlingOverviewAnim()) {
|
if (handlingOverviewAnim()) {
|
||||||
|
|
|
@ -31,7 +31,6 @@ import android.animation.AnimatorListenerAdapter;
|
||||||
import android.animation.AnimatorSet;
|
import android.animation.AnimatorSet;
|
||||||
import android.animation.ValueAnimator;
|
import android.animation.ValueAnimator;
|
||||||
import android.os.SystemClock;
|
import android.os.SystemClock;
|
||||||
import android.util.Log;
|
|
||||||
import android.view.HapticFeedbackConstants;
|
import android.view.HapticFeedbackConstants;
|
||||||
import android.view.MotionEvent;
|
import android.view.MotionEvent;
|
||||||
|
|
||||||
|
@ -43,7 +42,6 @@ import com.android.launcher3.Utilities;
|
||||||
import com.android.launcher3.anim.AnimationSuccessListener;
|
import com.android.launcher3.anim.AnimationSuccessListener;
|
||||||
import com.android.launcher3.anim.AnimatorPlaybackController;
|
import com.android.launcher3.anim.AnimatorPlaybackController;
|
||||||
import com.android.launcher3.anim.AnimatorSetBuilder;
|
import com.android.launcher3.anim.AnimatorSetBuilder;
|
||||||
import com.android.launcher3.testing.TestProtocol;
|
|
||||||
import com.android.launcher3.userevent.nano.LauncherLogProto;
|
import com.android.launcher3.userevent.nano.LauncherLogProto;
|
||||||
import com.android.launcher3.userevent.nano.LauncherLogProto.Action.Direction;
|
import com.android.launcher3.userevent.nano.LauncherLogProto.Action.Direction;
|
||||||
import com.android.launcher3.userevent.nano.LauncherLogProto.Action.Touch;
|
import com.android.launcher3.userevent.nano.LauncherLogProto.Action.Touch;
|
||||||
|
@ -513,12 +511,16 @@ public abstract class AbstractStateChangeTouchController
|
||||||
shouldGoToTargetState = !reachedTarget;
|
shouldGoToTargetState = !reachedTarget;
|
||||||
}
|
}
|
||||||
if (shouldGoToTargetState) {
|
if (shouldGoToTargetState) {
|
||||||
|
goToTargetState(targetState, logAction);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void goToTargetState(LauncherState targetState, int logAction) {
|
||||||
if (targetState != mStartState) {
|
if (targetState != mStartState) {
|
||||||
logReachedState(logAction, targetState);
|
logReachedState(logAction, targetState);
|
||||||
}
|
}
|
||||||
mLauncher.getStateManager().goToState(targetState, false /* animated */);
|
mLauncher.getStateManager().goToState(targetState, false /* animated */);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
private void logReachedState(int logAction, LauncherState targetState) {
|
private void logReachedState(int logAction, LauncherState targetState) {
|
||||||
// Transition complete. log the action
|
// Transition complete. log the action
|
||||||
|
|
Loading…
Reference in New Issue