diff options
author | Michael Jurka <mikejurka@google.com> | 2012-02-14 22:51:29 -0800 |
---|---|---|
committer | Michael Jurka <mikejurka@google.com> | 2012-02-15 20:22:50 -0800 |
commit | bed61d22bdbfcdbe04f92675c7751b83c7a8947c (patch) | |
tree | 648c41db7bc49430e839d20b481904e507eb400d /src/com/android/launcher2/AppsCustomizeTabHost.java | |
parent | 3a58b88901f6c504837dc47f01dace6d0bacaed0 (diff) | |
download | android_packages_apps_Trebuchet-bed61d22bdbfcdbe04f92675c7751b83c7a8947c.tar.gz android_packages_apps_Trebuchet-bed61d22bdbfcdbe04f92675c7751b83c7a8947c.tar.bz2 android_packages_apps_Trebuchet-bed61d22bdbfcdbe04f92675c7751b83c7a8947c.zip |
Revert "Revert "Speed up All Apps -> Workspace transition""
- also, undo enabling hardware layers for
scroll indicator, which could have caused
slowness
- fix bug where scroll indicator was not seen
after the first visit to all apps
- eliminate a some needless hardware layer redraws
- making items under All Apps invisible when we're
in All Apps
- making workspace spaces invisible if their alpha is 0
to prevent more hardware layer rebuilding
This reverts commit 9753d13c7bda09c1203c611ac6717021037f39c3.
Change-Id: Ib908ae0b456b2d4b8a171991a95f20aea4749da1
Diffstat (limited to 'src/com/android/launcher2/AppsCustomizeTabHost.java')
-rw-r--r-- | src/com/android/launcher2/AppsCustomizeTabHost.java | 52 |
1 files changed, 40 insertions, 12 deletions
diff --git a/src/com/android/launcher2/AppsCustomizeTabHost.java b/src/com/android/launcher2/AppsCustomizeTabHost.java index 023946b26..a5964dfca 100644 --- a/src/com/android/launcher2/AppsCustomizeTabHost.java +++ b/src/com/android/launcher2/AppsCustomizeTabHost.java @@ -347,38 +347,46 @@ public class AppsCustomizeTabHost extends TabHost implements LauncherTransitiona /* LauncherTransitionable overrides */ @Override - public void onLauncherTransitionStart(Launcher l, Animator animation, boolean toWorkspace) { + public void onLauncherTransitionStart(Launcher l, boolean animated, boolean toWorkspace) { mInTransition = true; - boolean animated = (animation != null); - mContent.setVisibility(VISIBLE); + if (toWorkspace) { + // Going from All Apps -> Workspace + setVisibilityOfSiblingsWithLowerZOrder(VISIBLE); + } else { + // Going from Workspace -> All Apps + mContent.setVisibility(VISIBLE); - if (!toWorkspace) { // Make sure the current page is loaded (we start loading the side pages after the // transition to prevent slowing down the animation) mAppsCustomizePane.loadAssociatedPages(mAppsCustomizePane.getCurrentPage(), true); - } - if (animated) { - enableAndBuildHardwareLayer(); - } - if (!toWorkspace && !LauncherApplication.isScreenLarge()) { - mAppsCustomizePane.showScrollingIndicator(false); + if (!LauncherApplication.isScreenLarge()) { + mAppsCustomizePane.showScrollingIndicator(true); + } } + if (mResetAfterTransition) { mAppsCustomizePane.reset(); mResetAfterTransition = false; } + + if (animated) { + enableAndBuildHardwareLayer(); + } } @Override - public void onLauncherTransitionEnd(Launcher l, Animator animation, boolean toWorkspace) { + public void onLauncherTransitionEnd(Launcher l, boolean animated, boolean toWorkspace) { mInTransition = false; - if (animation != null) { + if (animated) { setLayerType(LAYER_TYPE_NONE, null); } if (!toWorkspace) { + // Going from Workspace -> All Apps + setVisibilityOfSiblingsWithLowerZOrder(INVISIBLE); + // Dismiss the workspace cling and show the all apps cling (if not already shown) l.dismissWorkspaceCling(null); mAppsCustomizePane.showAllAppsCling(); @@ -392,6 +400,26 @@ public class AppsCustomizeTabHost extends TabHost implements LauncherTransitiona } } + private void setVisibilityOfSiblingsWithLowerZOrder(int visibility) { + ViewGroup parent = (ViewGroup) getParent(); + final int count = parent.getChildCount(); + if (!isChildrenDrawingOrderEnabled()) { + for (int i = 0; i < count; i++) { + final View child = parent.getChildAt(i); + if (child == this) { + break; + } else { + if (child.getVisibility() == GONE) { + continue; + } + child.setVisibility(visibility); + } + } + } else { + throw new RuntimeException("Failed; can't get z-order of views"); + } + } + public void onWindowVisible() { if (getVisibility() == VISIBLE) { mContent.setVisibility(VISIBLE); |