diff options
author | Michael Jurka <mikejurka@google.com> | 2011-12-07 14:00:02 -0800 |
---|---|---|
committer | Michael Jurka <mikejurka@google.com> | 2011-12-12 15:30:58 -0800 |
commit | 2a4b1a809c6bc0af9ae3ad974fe50e2a91569543 (patch) | |
tree | bb2b0f63d043da08147a5ffe59d3c13344b1dc20 /src/com/android/launcher2/AppsCustomizeTabHost.java | |
parent | c02e3932c382a1854ff39c5e2714d5c07c0a8bcd (diff) | |
download | android_packages_apps_Trebuchet-2a4b1a809c6bc0af9ae3ad974fe50e2a91569543.tar.gz android_packages_apps_Trebuchet-2a4b1a809c6bc0af9ae3ad974fe50e2a91569543.tar.bz2 android_packages_apps_Trebuchet-2a4b1a809c6bc0af9ae3ad974fe50e2a91569543.zip |
Make All Apps<-->Workspace transition smoother
- grouping workspace/all apps anims into one
animator set, prevents blip when one of them ends
early and its end anim handler does lots of work
mid-animation
- updating pivots for all apps zoom if layout
changes
- avoid running unnecessary animations on
workspace pages
- prevent unnecessary reloading of pages in
All Apps
Change-Id: I53a75f7c4c7d254057e2f8f4fd17711e8862256d
Diffstat (limited to 'src/com/android/launcher2/AppsCustomizeTabHost.java')
-rw-r--r-- | src/com/android/launcher2/AppsCustomizeTabHost.java | 26 |
1 files changed, 6 insertions, 20 deletions
diff --git a/src/com/android/launcher2/AppsCustomizeTabHost.java b/src/com/android/launcher2/AppsCustomizeTabHost.java index 2963240fa..023946b26 100644 --- a/src/com/android/launcher2/AppsCustomizeTabHost.java +++ b/src/com/android/launcher2/AppsCustomizeTabHost.java @@ -54,7 +54,6 @@ public class AppsCustomizeTabHost extends TabHost implements LauncherTransitiona private boolean mInTransition; private boolean mResetAfterTransition; - private Animator mLauncherTransition; public AppsCustomizeTabHost(Context context, AttributeSet attrs) { super(context, attrs); @@ -341,29 +340,17 @@ public class AppsCustomizeTabHost extends TabHost implements LauncherTransitiona } } - protected void onLayout(boolean changed, int left, int top, int right, int bottom) { - super.onLayout(changed, left, top, right, bottom); - if (mLauncherTransition != null) { - enableAndBuildHardwareLayer(); - mLauncherTransition.start(); - mLauncherTransition = null; - } + @Override + public View getContent() { + return mContent; } /* LauncherTransitionable overrides */ @Override - public boolean onLauncherTransitionStart(Launcher l, Animator animation, boolean toWorkspace) { + public void onLauncherTransitionStart(Launcher l, Animator animation, boolean toWorkspace) { mInTransition = true; - boolean delayLauncherTransitionUntilLayout = false; boolean animated = (animation != null); - mLauncherTransition = null; - // if the content wasn't visible before, delay the launcher animation until after a call - // to layout -- this prevents a blip - if (animated && mContent.getVisibility() == GONE) { - mLauncherTransition = animation; - delayLauncherTransitionUntilLayout = true; - } mContent.setVisibility(VISIBLE); if (!toWorkspace) { @@ -371,7 +358,7 @@ public class AppsCustomizeTabHost extends TabHost implements LauncherTransitiona // transition to prevent slowing down the animation) mAppsCustomizePane.loadAssociatedPages(mAppsCustomizePane.getCurrentPage(), true); } - if (animated && !delayLauncherTransitionUntilLayout) { + if (animated) { enableAndBuildHardwareLayer(); } @@ -382,7 +369,6 @@ public class AppsCustomizeTabHost extends TabHost implements LauncherTransitiona mAppsCustomizePane.reset(); mResetAfterTransition = false; } - return delayLauncherTransitionUntilLayout; } @Override @@ -406,7 +392,7 @@ public class AppsCustomizeTabHost extends TabHost implements LauncherTransitiona } } - public void onResume() { + public void onWindowVisible() { if (getVisibility() == VISIBLE) { mContent.setVisibility(VISIBLE); // We unload the widget previews when the UI is hidden, so need to reload pages |