summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/anim/AnimatorPlaybackController.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/launcher3/anim/AnimatorPlaybackController.java')
-rw-r--r--src/com/android/launcher3/anim/AnimatorPlaybackController.java21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/com/android/launcher3/anim/AnimatorPlaybackController.java b/src/com/android/launcher3/anim/AnimatorPlaybackController.java
index 2c440bba1..4a52795f8 100644
--- a/src/com/android/launcher3/anim/AnimatorPlaybackController.java
+++ b/src/com/android/launcher3/anim/AnimatorPlaybackController.java
@@ -26,15 +26,15 @@ import android.animation.TimeInterpolator;
import android.animation.ValueAnimator;
import android.util.Log;
+import androidx.dynamicanimation.animation.DynamicAnimation;
+import androidx.dynamicanimation.animation.SpringAnimation;
+
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
-import androidx.dynamicanimation.animation.DynamicAnimation;
-import androidx.dynamicanimation.animation.SpringAnimation;
-
/**
* Helper class to control the playback of an {@link AnimatorSet}, with custom interpolators
* and durations.
@@ -250,6 +250,17 @@ public abstract class AnimatorPlaybackController implements ValueAnimator.Animat
}
}
+ /**
+ * Sets mOnCancelRunnable = null before dispatching the cancel and restoring the runnable. This
+ * is intended to be used only if you need to cancel but want to defer cleaning up yourself.
+ */
+ public void dispatchOnCancelWithoutCancelRunnable() {
+ Runnable onCancel = mOnCancelRunnable;
+ setOnCancelRunnable(null);
+ dispatchOnCancel();
+ setOnCancelRunnable(onCancel);
+ }
+
public void dispatchOnCancel() {
dispatchOnCancelRecursively(mAnim);
}
@@ -283,10 +294,6 @@ public abstract class AnimatorPlaybackController implements ValueAnimator.Animat
mOnCancelRunnable = runnable;
}
- public Runnable getOnCancelRunnable() {
- return mOnCancelRunnable;
- }
-
public void skipToEnd() {
mSkipToEnd = true;
for (SpringAnimation spring : mSprings) {