Improved support for workspace screen thumbnails

- Shrinking workspace view in All Apps
- Added vertical margin for workspace screen thumnbnails
- Fixed bugs in a few of the Launcher state transitions (e.g. customization to all apps)

Change-Id: I9ad1c8861585d78fdb2e3bc986a614526b3cfe5f
diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java
index be60e98..8102d19 100644
--- a/src/com/android/launcher2/Launcher.java
+++ b/src/com/android/launcher2/Launcher.java
@@ -1266,7 +1266,7 @@
             // Animate the widget chooser up from the bottom of the screen
             if (!isCustomizationDrawerVisible()) {
                 showCustomizationDrawer();
-                mWorkspace.shrink();
+                mWorkspace.shrinkToTop();
             }
         } else {
             showAddDialog(mMenuAddInfo);
@@ -2023,7 +2023,8 @@
 
     // AllAppsView.Watcher
     public void zoomed(float zoom) {
-        if (zoom == 1.0f) {
+        // In XLarge view, we zoom down the workspace below all apps so it's still visible
+        if (zoom == 1.0f && !LauncherApplication.isScreenXLarge()) {
             mWorkspace.setVisibility(View.GONE);
         }
     }
@@ -2036,6 +2037,7 @@
             mAllAppsGrid.zoom(1.0f, false);
             Animation anim = AnimationUtils.loadAnimation(this, R.anim.all_apps_zoom_in);
             ((View) mAllAppsGrid).startAnimation(anim);
+            mWorkspace.shrinkToBottom();
         } else {
             mAllAppsGrid.zoom(1.0f, animated);
         }
@@ -2099,6 +2101,7 @@
                     }
                 });
                 ((View)mAllAppsGrid).startAnimation(anim);
+                mWorkspace.unshrink();
             } else {
                 mAllAppsGrid.zoom(0.0f, animated);
             }
@@ -2128,7 +2131,7 @@
         mHomeCustomizationDrawer.startAnimation(AnimationUtils.loadAnimation(this, R.anim.home_customization_drawer_slide_up));
     }
 
-    void hideCustomizationDrawer() {
+    private void hideCustomizationDrawer() {
         if (isCustomizationDrawerVisible()) {
             Animation slideDownAnimation = AnimationUtils.loadAnimation(this, R.anim.home_customization_drawer_slide_down);
             slideDownAnimation.setAnimationListener(new Animation.AnimationListener() {
@@ -2142,6 +2145,16 @@
         }
     }
 
+    void onWorkspaceUnshrink() {
+        if (isAllAppsVisible()) {
+            // TODO: Make a smoother transition here
+            closeAllApps(false);
+        }
+        if (isCustomizationDrawerVisible()) {
+            hideCustomizationDrawer();
+        }
+    }
+
     /**
      * Displays the shortcut creation dialog and launches, if necessary, the
      * appropriate activity.