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
diff --git a/src/com/android/launcher2/AppsCustomizeTabHost.java b/src/com/android/launcher2/AppsCustomizeTabHost.java
index 2963240..023946b 100644
--- a/src/com/android/launcher2/AppsCustomizeTabHost.java
+++ b/src/com/android/launcher2/AppsCustomizeTabHost.java
@@ -54,7 +54,6 @@
private boolean mInTransition;
private boolean mResetAfterTransition;
- private Animator mLauncherTransition;
public AppsCustomizeTabHost(Context context, AttributeSet attrs) {
super(context, attrs);
@@ -341,29 +340,17 @@
}
}
- 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 @@
// transition to prevent slowing down the animation)
mAppsCustomizePane.loadAssociatedPages(mAppsCustomizePane.getCurrentPage(), true);
}
- if (animated && !delayLauncherTransitionUntilLayout) {
+ if (animated) {
enableAndBuildHardwareLayer();
}
@@ -382,7 +369,6 @@
mAppsCustomizePane.reset();
mResetAfterTransition = false;
}
- return delayLauncherTransitionUntilLayout;
}
@Override
@@ -406,7 +392,7 @@
}
}
- 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