Defer jumping to NORMAL state if overview is still peeking

Bug: 137316430
Change-Id: I1ace19bb229d07bd9dfe5ed6f60c63715b9f8cf2
This commit is contained in:
Tony Wickham 2019-07-11 16:55:01 -07:00
parent 59b5b3f2a2
commit e1463f5580
2 changed files with 23 additions and 6 deletions

View File

@ -167,6 +167,21 @@ public class FlingAndHoldTouchController extends PortraitStatesTouchController {
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
protected void updateAnimatorBuilderOnReinit(AnimatorSetBuilder builder) {
if (handlingOverviewAnim()) {

View File

@ -31,7 +31,6 @@ import android.animation.AnimatorListenerAdapter;
import android.animation.AnimatorSet;
import android.animation.ValueAnimator;
import android.os.SystemClock;
import android.util.Log;
import android.view.HapticFeedbackConstants;
import android.view.MotionEvent;
@ -43,7 +42,6 @@ import com.android.launcher3.Utilities;
import com.android.launcher3.anim.AnimationSuccessListener;
import com.android.launcher3.anim.AnimatorPlaybackController;
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.Action.Direction;
import com.android.launcher3.userevent.nano.LauncherLogProto.Action.Touch;
@ -513,13 +511,17 @@ public abstract class AbstractStateChangeTouchController
shouldGoToTargetState = !reachedTarget;
}
if (shouldGoToTargetState) {
if (targetState != mStartState) {
logReachedState(logAction, targetState);
}
mLauncher.getStateManager().goToState(targetState, false /* animated */);
goToTargetState(targetState, logAction);
}
}
protected void goToTargetState(LauncherState targetState, int logAction) {
if (targetState != mStartState) {
logReachedState(logAction, targetState);
}
mLauncher.getStateManager().goToState(targetState, false /* animated */);
}
private void logReachedState(int logAction, LauncherState targetState) {
// Transition complete. log the action
mLauncher.getUserEventDispatcher().logStateChangeAction(logAction,