Merge "Set mState = mCurrentStableState in onAnimationCancel()" into tm-dev am: b73c57b2f6 am: 47b7c389a0
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/17829990 Change-Id: Ia3fbebcd1e13a256b347c6c16ff36cb760df53c1 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -19,6 +19,8 @@ package com.android.launcher3.anim;
|
|||||||
import android.animation.Animator;
|
import android.animation.Animator;
|
||||||
import android.animation.AnimatorListenerAdapter;
|
import android.animation.AnimatorListenerAdapter;
|
||||||
|
|
||||||
|
import androidx.annotation.CallSuper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Extension of {@link AnimatorListenerAdapter} for listening for non-cancelled animations
|
* Extension of {@link AnimatorListenerAdapter} for listening for non-cancelled animations
|
||||||
*/
|
*/
|
||||||
@@ -27,6 +29,7 @@ public abstract class AnimationSuccessListener extends AnimatorListenerAdapter {
|
|||||||
protected boolean mCancelled = false;
|
protected boolean mCancelled = false;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@CallSuper
|
||||||
public void onAnimationCancel(Animator animation) {
|
public void onAnimationCancel(Animator animation) {
|
||||||
mCancelled = true;
|
mCancelled = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -335,7 +335,13 @@ public class StateManager<STATE_TYPE extends BaseState<STATE_TYPE>> {
|
|||||||
@Override
|
@Override
|
||||||
public void onAnimationStart(Animator animation) {
|
public void onAnimationStart(Animator animation) {
|
||||||
// Change the internal state only when the transition actually starts
|
// Change the internal state only when the transition actually starts
|
||||||
onStateTransitionStart(state);
|
onStateTransitionStart(mCancelled ? mCurrentStableState : state);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onAnimationCancel(Animator animation) {
|
||||||
|
super.onAnimationCancel(animation);
|
||||||
|
mState = mCurrentStableState;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user