Modifying AppsCustomize behaviour to use springloaded mode.

Change-Id: I21d181ad3d245731ee8402915f8918b91bfc4553
diff --git a/src/com/android/launcher2/AppsCustomizePagedView.java b/src/com/android/launcher2/AppsCustomizePagedView.java
index 62a8936..464bb44 100644
--- a/src/com/android/launcher2/AppsCustomizePagedView.java
+++ b/src/com/android/launcher2/AppsCustomizePagedView.java
@@ -410,9 +410,6 @@
     protected boolean beginDragging(View v) {
         if (!super.beginDragging(v)) return false;
 
-        // Hide the pane so that the user can drop onto the workspace, we must do this first,
-        // due to how the drop target layout is computed when we start dragging to the workspace.
-        mLauncher.showWorkspace(true);
 
         if (v instanceof PagedViewIcon) {
             beginDraggingApplication(v);
@@ -420,6 +417,10 @@
             beginDraggingWidget(v);
         }
 
+        // Go into spring loaded mode
+        int currentPageIndex = mLauncher.getWorkspace().getCurrentPage();
+        CellLayout currentPage = (CellLayout) mLauncher.getWorkspace().getChildAt(currentPageIndex);
+        mLauncher.enterSpringLoadedDragMode(currentPage);
         return true;
     }
     private void endDragging(boolean success) {
@@ -439,8 +440,10 @@
                 if (allAppsInfoButton != null) allAppsInfoButton.setDragAndDropEnabled(false);
             }
         });
+        mLauncher.exitSpringLoadedDragMode();
         mLauncher.getWorkspace().onDragStopped(success);
         mLauncher.unlockScreenOrientation();
+
     }
 
     /*
@@ -781,6 +784,34 @@
         return mContentWidth;
     }
 
+    @Override
+    protected void onPageBeginMoving() {
+        /* TO BE ENABLED LATER
+        setChildrenDrawnWithCacheEnabled(true);
+        for (int i = 0; i < getChildCount(); ++i) {
+            View v = getChildAt(i);
+            if (v instanceof PagedViewCellLayout) {
+                ((PagedViewCellLayout) v).setChildrenDrawingCacheEnabled(true);
+            }
+        }
+        */
+        super.onPageBeginMoving();
+    }
+
+    @Override
+    protected void onPageEndMoving() {
+        /* TO BE ENABLED LATER
+        for (int i = 0; i < getChildCount(); ++i) {
+            View v = getChildAt(i);
+            if (v instanceof PagedViewCellLayout) {
+                ((PagedViewCellLayout) v).setChildrenDrawingCacheEnabled(false);
+            }
+        }
+        setChildrenDrawnWithCacheEnabled(false);
+        */
+        super.onPageEndMoving();
+    }
+
     /*
      * AllAppsView implementation
      */