Merge "Fix 3272584: home button should return to previous workspace"

This commit is contained in:
Patrick Dubroy 2011-02-23 15:23:07 -08:00 committed by Android (Google) Code Review
commit f87e4dbff4
1 changed files with 5 additions and 7 deletions

View File

@ -1443,16 +1443,14 @@ public final class Launcher extends Activity
boolean alreadyOnHome = ((intent.getFlags() & Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT)
!= Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT);
// in all these cases, only animate if we're already on home
// In all these cases, only animate if we're already on home
if (LauncherApplication.isScreenXLarge()) {
mWorkspace.unshrink(alreadyOnHome);
}
if (!mWorkspace.isDefaultPageShowing()) {
// on the phone, we don't animate the change to the workspace if all apps is visible
boolean animate = alreadyOnHome &&
(LauncherApplication.isScreenXLarge() || mState != State.ALL_APPS);
mWorkspace.moveToDefaultScreen(animate);
if (!animate) mWorkspace.updateWallpaperOffsetImmediately();
if (alreadyOnHome && mState == State.WORKSPACE && !mWorkspace.isDefaultPageShowing()) {
mWorkspace.moveToDefaultScreen(true);
}
showWorkspace(alreadyOnHome);