summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoremancebo <emancebo@cyngn.com>2015-02-03 20:15:11 (GMT)
committeremancebo <emancebo@cyngn.com>2015-02-03 20:27:09 (GMT)
commita426812f58b320c191ed8427d145966724949d67 (patch)
treef145a7876914a9dcf5db03eb62e5f42d5ec09505
parentd7c8723e88a5b24d2cab36f92703da535901c5bb (diff)
downloadandroid_packages_apps_Trebuchet-a426812f58b320c191ed8427d145966724949d67.zip
android_packages_apps_Trebuchet-a426812f58b320c191ed8427d145966724949d67.tar.gz
android_packages_apps_Trebuchet-a426812f58b320c191ed8427d145966724949d67.tar.bz2
Trebuchet: ensure preview animation is released after exiting TransitionEffectsFragment
Change-Id: Id6253a6162ee47dd1a46886026f09c3adbdc7027
-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);