summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Jurka <mikejurka@google.com>2012-05-31 08:56:50 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2012-05-31 08:56:50 -0700
commit0eb8d31430fb8f9e1f25119220312918206b05ea (patch)
tree011cc455212d55ab3f0df3b41071a04a34ddb637
parentcb68fa5be7794b41e9079666efee4a4303707246 (diff)
parent3dcd79ecb39af92b94ac7f41558c2743a51f0596 (diff)
downloadandroid_packages_apps_Trebuchet-0eb8d31430fb8f9e1f25119220312918206b05ea.zip
android_packages_apps_Trebuchet-0eb8d31430fb8f9e1f25119220312918206b05ea.tar.gz
android_packages_apps_Trebuchet-0eb8d31430fb8f9e1f25119220312918206b05ea.tar.bz2
am 3dcd79ec: Preventing stutter at beginning of All Apps animation
* commit '3dcd79ecb39af92b94ac7f41558c2743a51f0596': Preventing stutter at beginning of All Apps animation
-rw-r--r--src/com/android/launcher2/Launcher.java50
1 files changed, 31 insertions, 19 deletions
diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java
index 9dc1fe4..9fbf50e 100644
--- a/src/com/android/launcher2/Launcher.java
+++ b/src/com/android/launcher2/Launcher.java
@@ -2403,32 +2403,37 @@ public final class Launcher extends Activity
observer = null;
}
+ final AnimatorSet stateAnimation = mStateAnimation;
+ final Runnable startAnimRunnable = new Runnable() {
+ public void run() {
+ // Check that mStateAnimation hasn't changed while
+ // we waited for a layout/draw pass
+ if (mStateAnimation != stateAnimation)
+ return;
+ setPivotsForZoom(toView, scale);
+ dispatchOnLauncherTransitionStart(fromView, animated, false);
+ dispatchOnLauncherTransitionStart(toView, animated, false);
+ mWorkspace.post(new Runnable() {
+ public void run() {
+ // Check that mStateAnimation hasn't changed while
+ // we waited for a layout/draw pass
+ if (mStateAnimation != stateAnimation)
+ return;
+ mStateAnimation.start();
+ }
+ });
+ }
+ };
if (delayAnim) {
- final AnimatorSet stateAnimation = mStateAnimation;
final OnGlobalLayoutListener delayedStart = new OnGlobalLayoutListener() {
public void onGlobalLayout() {
- mWorkspace.post(new Runnable() {
- public void run() {
- // Check that mStateAnimation hasn't changed while
- // we waited for a layout pass
- if (mStateAnimation == stateAnimation) {
- // Need to update pivots for zoom if layout changed
- setPivotsForZoom(toView, scale);
- dispatchOnLauncherTransitionStart(fromView, animated, false);
- dispatchOnLauncherTransitionStart(toView, animated, false);
- mStateAnimation.start();
- }
- }
- });
+ mWorkspace.post(startAnimRunnable);
observer.removeOnGlobalLayoutListener(this);
}
};
observer.addOnGlobalLayoutListener(delayedStart);
} else {
- setPivotsForZoom(toView, scale);
- dispatchOnLauncherTransitionStart(fromView, animated, false);
- dispatchOnLauncherTransitionStart(toView, animated, false);
- mStateAnimation.start();
+ startAnimRunnable.run();
}
} else {
toView.setTranslationX(0.0f);
@@ -2539,7 +2544,14 @@ public final class Launcher extends Activity
}
dispatchOnLauncherTransitionStart(fromView, animated, true);
dispatchOnLauncherTransitionStart(toView, animated, true);
- mStateAnimation.start();
+ final Animator stateAnimation = mStateAnimation;
+ mWorkspace.post(new Runnable() {
+ public void run() {
+ if (stateAnimation != mStateAnimation)
+ return;
+ mStateAnimation.start();
+ }
+ });
} else {
fromView.setVisibility(View.GONE);
dispatchOnLauncherTransitionPrepare(fromView, animated, true);