summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoremancebo <emancebo@cyngn.com>2015-02-03 20:15:11 (GMT)
committerEd Mancebo <emancebo@cyngn.com>2015-02-03 21:22:48 (GMT)
commit7b54a22a9ecc15ae3c5364ebd14721cb5f474992 (patch)
tree6319743dbd772c0e9dd933d6155652b5d70f66f1
parentedbea0af1226978b06d7f877ae435797d31419af (diff)
downloadandroid_packages_apps_Trebuchet-7b54a22a9ecc15ae3c5364ebd14721cb5f474992.zip
android_packages_apps_Trebuchet-7b54a22a9ecc15ae3c5364ebd14721cb5f474992.tar.gz
android_packages_apps_Trebuchet-7b54a22a9ecc15ae3c5364ebd14721cb5f474992.tar.bz2
Trebuchet: ensure preview animation is released after exiting TransitionEffectsFragment
Change-Id: Id6253a6162ee47dd1a46886026f09c3adbdc7027 (cherry picked from commit a426812f58b320c191ed8427d145966724949d67)
-rw-r--r--src/com/android/launcher3/Launcher.java1
-rw-r--r--src/com/android/launcher3/TransitionEffectsFragment.java12
2 files changed, 13 insertions, 0 deletions
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index 937a167..3657093 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -1359,6 +1359,7 @@ public class Launcher extends Activity
}
fragmentTransaction
.remove(mTransitionEffectsFragment).commit();
+ mTransitionEffectsFragment = null;
mDarkPanel.setVisibility(View.VISIBLE);
ObjectAnimator anim = ObjectAnimator.ofFloat(
diff --git a/src/com/android/launcher3/TransitionEffectsFragment.java b/src/com/android/launcher3/TransitionEffectsFragment.java
index d490a00..5fb5d22 100644
--- a/src/com/android/launcher3/TransitionEffectsFragment.java
+++ b/src/com/android/launcher3/TransitionEffectsFragment.java
@@ -153,6 +153,18 @@ public class TransitionEffectsFragment extends Fragment {
frameAnimation.start();
}
+ @Override
+ public void onStop() {
+ super.onStop();
+
+ // explicitly stop animation to ensure that we release references from the
+ // view root's run queue
+ AnimationDrawable frameAnimation = (AnimationDrawable) mTransitionIcon.getBackground();
+ if (frameAnimation != null) {
+ frameAnimation.stop();
+ }
+ }
+
private void setSelected(View v) {
v.setBackgroundColor(Color.WHITE);
TextView t = (TextView) v.findViewById(R.id.item_name);