diff options
author | Joe Onorato <joeo@android.com> | 2010-01-11 19:39:32 -0500 |
---|---|---|
committer | Joe Onorato <joeo@android.com> | 2010-01-11 19:39:38 -0500 |
commit | c5cfa73ef979ce31da2ef6b16ebedc598fc1c8f1 (patch) | |
tree | 18b9fe5be61dc22d0e23ad1ca5333e8c1a6bae39 /src | |
parent | 34a0e1b00b9baeff19e94f1ee35dd890063489d2 (diff) | |
download | android_packages_apps_Trebuchet-c5cfa73ef979ce31da2ef6b16ebedc598fc1c8f1.tar.gz android_packages_apps_Trebuchet-c5cfa73ef979ce31da2ef6b16ebedc598fc1c8f1.tar.bz2 android_packages_apps_Trebuchet-c5cfa73ef979ce31da2ef6b16ebedc598fc1c8f1.zip |
Fix 2325492 - No icons in launcher after pressing home from within an app
It looks like the evil hack in 14f122bf847e50a3e7730ccbe57abc25d086a01b to make the workspace
not animate didn't completely work. The key to reproducing this bug is to make sure the
activity is destroyed and to have last gone to an app from a screen other than the center
screen, because that causes it to get reloaded from the icicle, which makes the timing
more amenable to missing the animation, because the view isn't attached yet.
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/launcher2/Workspace.java | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/com/android/launcher2/Workspace.java b/src/com/android/launcher2/Workspace.java index 374f0bf56..9e32dd563 100644 --- a/src/com/android/launcher2/Workspace.java +++ b/src/com/android/launcher2/Workspace.java @@ -272,6 +272,7 @@ public class Workspace extends ViewGroup implements DropTarget, DragSource, Drag * @param currentScreen */ void setCurrentScreen(int currentScreen) { + if (!mScroller.isFinished()) mScroller.abortAnimation(); clearVacantCache(); mCurrentScreen = Math.max(0, Math.min(currentScreen, getChildCount() - 1)); scrollTo(mCurrentScreen * getWidth(), 0); @@ -946,10 +947,6 @@ public class Workspace extends ViewGroup implements DropTarget, DragSource, Drag } void snapToScreen(int whichScreen) { - snapToScreen(whichScreen, true); - } - - void snapToScreen(int whichScreen, boolean animate) { //if (!mScroller.isFinished()) return; whichScreen = Math.max(0, Math.min(whichScreen, getChildCount() - 1)); @@ -973,8 +970,7 @@ public class Workspace extends ViewGroup implements DropTarget, DragSource, Drag final int delta = newX - mScrollX; final int duration = screenDelta * 300; awakenScrollBars(duration); - // 1ms is close to don't animate - mScroller.startScroll(mScrollX, 0, delta, 0, animate ? duration : 1); + mScroller.startScroll(mScrollX, 0, delta, 0, duration); invalidate(); } @@ -1425,7 +1421,11 @@ public class Workspace extends ViewGroup implements DropTarget, DragSource, Drag } void moveToDefaultScreen(boolean animate) { - snapToScreen(mDefaultScreen, animate); + if (animate) { + snapToScreen(mDefaultScreen); + } else { + setCurrentScreen(mDefaultScreen); + } getChildAt(mDefaultScreen).requestFocus(); } |