From effc4a8aef606503287dc42d1f7c0feb16e12035 Mon Sep 17 00:00:00 2001 From: Joe Onorato Date: Thu, 15 Apr 2010 11:48:13 -0700 Subject: [PATCH] Paper over bug 2592956 - Home not redrawing the shortcuts, widgets, or background. The mNext* stuff in AllApps3D got reset when onNewIntent came in too fast after an onCreate, which happened because of the configuration changed. Change-Id: I9a358b6969ac1d17ea98f58218d47bfe983936f0 --- src/com/android/launcher2/AllApps3D.java | 25 ++++++++++++------------ src/com/android/launcher2/Launcher.java | 4 ++++ 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/src/com/android/launcher2/AllApps3D.java b/src/com/android/launcher2/AllApps3D.java index 64c8c4c53c..9d3de0b79c 100644 --- a/src/com/android/launcher2/AllApps3D.java +++ b/src/com/android/launcher2/AllApps3D.java @@ -91,6 +91,10 @@ public class AllApps3D extends RSSurfaceView private static RenderScriptGL sRS; private static RolloRS sRollo; + private static boolean sZoomDirty = false; + private static boolean sAnimateNextZoom; + private static float sNextZoom; + /** * True when we are using arrow keys or trackball to drive navigation */ @@ -120,9 +124,6 @@ public class AllApps3D extends RSSurfaceView private boolean mShouldGainFocus; private boolean mHaveSurface = false; - private boolean mZoomDirty = false; - private boolean mAnimateNextZoom; - private float mNextZoom; private float mZoom; private float mVelocity; private AAMessage mMessageProc; @@ -241,7 +242,7 @@ public class AllApps3D extends RSSurfaceView } // We may lose any callbacks that are pending, so make sure that we re-sync that // on the next surfaceChanged. - mZoomDirty = true; + sZoomDirty = true; mHaveSurface = false; } @@ -801,12 +802,12 @@ public class AllApps3D extends RSSurfaceView */ public void zoom(float zoom, boolean animate) { cancelLongPress(); - mNextZoom = zoom; - mAnimateNextZoom = animate; + sNextZoom = zoom; + sAnimateNextZoom = animate; // if we do setZoom while we don't have a surface, we won't // get the callbacks that actually set mZoom. if (sRollo == null || !mHaveSurface) { - mZoomDirty = true; + sZoomDirty = true; mZoom = zoom; } else { sRollo.setZoom(zoom, animate); @@ -959,7 +960,7 @@ public class AllApps3D extends RSSurfaceView sRollo.mScrollPos = ((float)mData[0]) / (1 << 16); mVelocity = ((float)mData[1]) / (1 << 16); mZoom = ((float)mData[2]) / (1 << 16); - mZoomDirty = false; + sZoomDirty = false; } } @@ -1305,8 +1306,8 @@ public class AllApps3D extends RSSurfaceView } void dirtyCheck() { - if (mAllApps.mZoomDirty) { - setZoom(mAllApps.mNextZoom, mAllApps.mAnimateNextZoom); + if (sZoomDirty) { + setZoom(mAllApps.sNextZoom, mAllApps.sAnimateNextZoom); } } @@ -1612,8 +1613,8 @@ public class AllApps3D extends RSSurfaceView Log.d(TAG, "mVelocityTracker=" + mVelocityTracker); Log.d(TAG, "mTouchTracking=" + mTouchTracking); Log.d(TAG, "mShouldGainFocus=" + mShouldGainFocus); - Log.d(TAG, "mZoomDirty=" + mZoomDirty); - Log.d(TAG, "mAnimateNextZoom=" + mAnimateNextZoom); + Log.d(TAG, "sZoomDirty=" + sZoomDirty); + Log.d(TAG, "sAnimateNextZoom=" + sAnimateNextZoom); Log.d(TAG, "mZoom=" + mZoom); Log.d(TAG, "mScrollPos=" + sRollo.mScrollPos); Log.d(TAG, "mVelocity=" + mVelocity); diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java index b82e0cfbd4..5cfcac2870 100644 --- a/src/com/android/launcher2/Launcher.java +++ b/src/com/android/launcher2/Launcher.java @@ -1750,6 +1750,10 @@ public final class Launcher extends Activity * - Go back with back key TODO: make this not go to workspace * - From all apps * - From workspace + * - Enter and exit car mode (becuase it causes an extra configuration changed) + * - From all apps + * - From the center workspace + * - From another workspace */ void closeAllApps(boolean animated) { if (mAllAppsGrid.isVisible()) {