Fix bug where double swipe gets us stuck in Hint state while in Overview.

With the second swipe, we never complete the swipe to Overview

NoButtonNavbarToOverviewTouchController#maybeSwipeInteractionToOverviewComplete
- mReachedOverview = true
- mDetector.isSettlingState = false

And then the second swipe starts the state transition to Hint but then
it never gets completed because:
1. The animation starts
2. Gets cancelled
3. Starts again
4. Finishes, but is not marked as success since the cancel in #2 was never
   set back to false

Bug: 160759508
Change-Id: I8c3972e6209c3d5a4a0bdd9f9b7683de18105d57
This commit is contained in:
Jon Miranda 2020-07-16 17:32:29 -07:00
parent dbca5a4190
commit a8c08584a7
7 changed files with 15 additions and 1 deletions

View File

@ -1090,6 +1090,7 @@ public abstract class BaseSwipeUpHandlerV2<T extends StatefulActivity<?>, Q exte
anim.addAnimatorListener(new AnimationSuccessListener() {
@Override
public void onAnimationStart(Animator animation) {
super.onAnimationStart(animation);
if (mActivity != null) {
removeLiveTileOverlay();
}

View File

@ -287,6 +287,7 @@ public abstract class SwipeUpAnimationLogic {
@Override
public void onAnimationStart(Animator animation) {
super.onAnimationStart(animation);
mHomeAnim.dispatchOnStart();
}

View File

@ -282,6 +282,7 @@ public class TaskMenuView extends AbstractFloatingView {
mOpenCloseAnimator.addListener(new AnimationSuccessListener() {
@Override
public void onAnimationStart(Animator animation) {
super.onAnimationStart(animation);
setVisibility(VISIBLE);
}

View File

@ -46,7 +46,8 @@ public class AlphaUpdateListener extends AnimationSuccessListener
}
@Override
public void onAnimationStart(Animator arg0) {
public void onAnimationStart(Animator animation) {
super.onAnimationStart(animation);
// We want the views to be visible for animation, so fade-in/out is visible
mView.setVisibility(View.VISIBLE);
}

View File

@ -19,6 +19,8 @@ package com.android.launcher3.anim;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import androidx.annotation.CallSuper;
/**
* Extension of {@link AnimatorListenerAdapter} for listening for non-cancelled animations
*/
@ -26,6 +28,12 @@ public abstract class AnimationSuccessListener extends AnimatorListenerAdapter {
protected boolean mCancelled = false;
@Override
@CallSuper
public void onAnimationStart(Animator animation) {
mCancelled = false;
}
@Override
public void onAnimationCancel(Animator animation) {
mCancelled = true;

View File

@ -335,6 +335,7 @@ public class AnimatorPlaybackController implements ValueAnimator.AnimatorUpdateL
@Override
public void onAnimationStart(Animator animation) {
super.onAnimationStart(animation);
mCancelled = false;
mDispatched = false;
}

View File

@ -315,6 +315,7 @@ public class StateManager<STATE_TYPE extends BaseState<STATE_TYPE>> {
@Override
public void onAnimationStart(Animator animation) {
super.onAnimationStart(animation);
// Change the internal state only when the transition actually starts
onStateTransitionStart(state);
}