Hide the workspace when launching AllApps2D.

Boosts performance and squashes some weird focus issues.

(Also: fix builds with AllApps3D)

Change-Id: Id1c4628e119c950dced9d3383993674f3d6b9a1c
diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java
index 79303d7..5146ffd 100644
--- a/src/com/android/launcher2/Launcher.java
+++ b/src/com/android/launcher2/Launcher.java
@@ -85,7 +85,7 @@
  * Default launcher application.
  */
 public final class Launcher extends Activity
-        implements View.OnClickListener, OnLongClickListener, LauncherModel.Callbacks {
+        implements View.OnClickListener, OnLongClickListener, LauncherModel.Callbacks, AllAppsView.Watcher {
     static final String TAG = "Launcher";
     static final boolean LOGD = false;
 
@@ -1685,6 +1685,13 @@
         return mAllAppsGrid.isVisible();
     }
 
+    // AllAppsView.Watcher
+    public void zoomed(float zoom) {
+        if (zoom == 1.0f) {
+            mWorkspace.setVisibility(View.GONE);
+        }
+    }
+
     void showAllApps(boolean animated) {
         mAllAppsGrid.zoom(1.0f, animated);
 
@@ -1732,6 +1739,7 @@
      */
     void closeAllApps(boolean animated) {
         if (mAllAppsGrid.isVisible()) {
+            mWorkspace.setVisibility(View.VISIBLE);
             mAllAppsGrid.zoom(0.0f, animated);
             ((View)mAllAppsGrid).setFocusable(false);
             mWorkspace.getChildAt(mWorkspace.getCurrentScreen()).requestFocus();