Removing Launcher activity dependency on various animations
(This cl reverts change-Id: I455edcd17bda83ab51c2c04fa40e66097a4d6975)
Various animations were marked for cancellation when launcher activity is
destroyed. This this does not work with multiple activities (Launcher,
fallback recents, shortcut confirmation). Also since launcher activity
handles configuration changes, the activity is not destroyed often.
Instead associating a target with various animations which automatically
cancels the animations when that target goes away.
Change-Id: I64cd095a28075561a9e20c9dcdeb9f90c18e1047
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index a545122..9650e4e 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -31,6 +31,7 @@
import android.animation.AnimatorListenerAdapter;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
+import android.animation.PropertyValuesHolder;
import android.animation.ValueAnimator;
import android.annotation.TargetApi;
import android.app.ActivityOptions;
@@ -1332,9 +1333,6 @@
}
TextKeyListener.getInstance().release();
-
- LauncherAnimUtils.onDestroyActivity();
-
clearPendingBinds();
if (mLauncherCallbacks != null) {
@@ -1841,7 +1839,7 @@
@Override
public void bindItems(final List<ItemInfo> items, final boolean forceAnimateIcons) {
// Get the list of added items and intersect them with the set of items here
- final AnimatorSet anim = LauncherAnimUtils.createAnimatorSet();
+ final AnimatorSet anim = new AnimatorSet();
final Collection<Animator> bounceAnims = new ArrayList<>();
final boolean animateIcons = forceAnimateIcons && canRunNewAppsAnimation();
Workspace workspace = mWorkspace;
@@ -2163,7 +2161,10 @@
}
private ValueAnimator createNewAppBounceAnimation(View v, int i) {
- ValueAnimator bounceAnim = LauncherAnimUtils.ofViewAlphaAndScale(v, 1, 1, 1);
+ ValueAnimator bounceAnim = LauncherAnimUtils.ofPropertyValuesHolder(v,
+ PropertyValuesHolder.ofFloat(View.ALPHA, 1f),
+ PropertyValuesHolder.ofFloat(View.SCALE_X, 1f),
+ PropertyValuesHolder.ofFloat(View.SCALE_Y, 1f));
bounceAnim.setDuration(InstallShortcutReceiver.NEW_SHORTCUT_BOUNCE_DURATION);
bounceAnim.setStartDelay(i * InstallShortcutReceiver.NEW_SHORTCUT_STAGGER_DELAY);
bounceAnim.setInterpolator(new OvershootInterpolator(BOUNCE_ANIMATION_TENSION));