diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java
index 6b00742..c4bb69e 100644
--- a/src/com/android/launcher2/Launcher.java
+++ b/src/com/android/launcher2/Launcher.java
@@ -1,3 +1,4 @@
+
 /*
  * Copyright (C) 2008 The Android Open Source Project
  *
@@ -1110,16 +1111,20 @@
             boolean alreadyOnHome = ((intent.getFlags() & Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT)
                         != Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT);
             boolean allAppsVisible = isAllAppsVisible();
+            boolean customizationDrawerVisible = isCustomizationDrawerVisible();
+
 
             // in all these cases, only animate if we're already on home
             if (LauncherApplication.isScreenXLarge()) {
-                mWorkspace.unshrink(alreadyOnHome);
-            }
-            if (!mWorkspace.isDefaultScreenShowing()) {
+                if (alreadyOnHome && !mWorkspace.isSmall() &&
+                        !allAppsVisible && !customizationDrawerVisible) {
+                    mWorkspace.shrinkToMiddle();
+                } else {
+                    mWorkspace.unshrink(alreadyOnHome);
+                }
+            } else if (!mWorkspace.isDefaultScreenShowing()) {
                 // on the phone, we don't animate the change to the workspace if all apps is visible
-                // on xlarge screens, however, we want an animated transition
-                mWorkspace.moveToDefaultScreen(alreadyOnHome &&
-                        (LauncherApplication.isScreenXLarge() || !allAppsVisible));
+                mWorkspace.moveToDefaultScreen(alreadyOnHome && !allAppsVisible);
             }
             closeAllApps(alreadyOnHome && allAppsVisible);
             hideCustomizationDrawer();
diff --git a/src/com/android/launcher2/Workspace.java b/src/com/android/launcher2/Workspace.java
index 5d75c0f..73eaeab 100644
--- a/src/com/android/launcher2/Workspace.java
+++ b/src/com/android/launcher2/Workspace.java
@@ -70,6 +70,9 @@
     // This is how much the workspace shrinks when we enter all apps or
     // customization mode
     private static final float SHRINK_FACTOR = 0.16f;
+    private static final int SHRINK_TO_TOP = 0;
+    private static final int SHRINK_TO_MIDDLE = 1;
+    private static final int SHRINK_TO_BOTTOM = 2;
 
     /**
      * The velocity at which a fling gesture will cause us to snap to the next
@@ -1061,8 +1064,16 @@
         return true;
     }
 
+    public boolean isSmall() {
+        return mIsSmall;
+    }
+
     void shrinkToTop() {
-        shrink(true, true);
+        shrink(SHRINK_TO_TOP, true);
+    }
+
+    void shrinkToMiddle() {
+        shrink(SHRINK_TO_MIDDLE, true);
     }
 
     void shrinkToBottom() {
@@ -1077,12 +1088,12 @@
             // to get our width so we can layout the mini-screen views correctly
             mWaitingToShrinkToBottom = true;
         } else {
-            shrink(false, animated);
+            shrink(SHRINK_TO_BOTTOM, animated);
         }
     }
 
     // we use this to shrink the workspace for the all apps view and the customize view
-    private void shrink(boolean shrinkToTop, boolean animated) {
+    private void shrink(int shrinkPosition, boolean animated) {
         mIsSmall = true;
         final Resources res = getResources();
         final int screenWidth = getWidth();
@@ -1095,8 +1106,10 @@
         float totalWidth = screenCount * scaledScreenWidth + (screenCount - 1) * scaledSpacing;
 
         float newY = getResources().getDimension(R.dimen.smallScreenVerticalMargin);
-        if (!shrinkToTop) {
+        if (shrinkPosition == SHRINK_TO_BOTTOM) {
             newY = screenHeight - newY - scaledScreenHeight;
+        } else if (shrinkPosition == SHRINK_TO_MIDDLE) {
+            newY = screenHeight / 2 - scaledScreenHeight / 2;
         }
 
         // We animate all the screens to the centered position in workspace
