Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a160e2bc authored by Tony Wickham's avatar Tony Wickham Committed by Android (Google) Code Review
Browse files

Merge "Defer jumping to NORMAL state if overview is still peeking" into ub-launcher3-qt-r1-dev

parents 1fd52d90 e1463f55
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -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()) {
+8 −6
Original line number Diff line number Diff line
@@ -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,12 +511,16 @@ public abstract class AbstractStateChangeTouchController
            shouldGoToTargetState = !reachedTarget;
        }
        if (shouldGoToTargetState) {
            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