Cleaning up some spring-loaded related dragging code.  Allow cancel spring loaded mode.

Change-Id: Ie1f0468c563bed7abc1aa6416e222cdb0853c03a
diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java
index 894e395..0c052a7 100644
--- a/src/com/android/launcher2/Launcher.java
+++ b/src/com/android/launcher2/Launcher.java
@@ -2322,7 +2322,7 @@
      * of the screen.
      * @param toState The state to zoom out to. Must be APPS_CUSTOMIZE.
      */
-    private void cameraZoomOut(State toState, boolean animated, boolean springLoaded) {
+    private void cameraZoomOut(State toState, boolean animated, final boolean springLoaded) {
         final Resources res = getResources();
 
         final int duration = res.getInteger(R.integer.config_appsCustomizeZoomInTime);
@@ -2381,9 +2381,11 @@
                     toView.setVisibility(View.VISIBLE);
                     toView.bringToFront();
 
-                    // Hide the workspace scrollbar
-                    mWorkspace.hideScrollingIndicator(true);
-                    mWorkspace.hideScrollIndicatorTrack();
+                    if (!springLoaded && !LauncherApplication.isScreenLarge()) {
+                        // Hide the workspace scrollbar
+                        mWorkspace.hideScrollingIndicator(true);
+                        mWorkspace.hideScrollIndicatorTrack();
+                    }
                 }
                 @Override
                 public void onAnimationEnd(Animator animation) {
@@ -2416,9 +2418,11 @@
                 ((LauncherTransitionable) toView).onLauncherTransitionStart(null);
                 ((LauncherTransitionable) toView).onLauncherTransitionEnd(null);
 
-                // Hide the workspace scrollbar
-                mWorkspace.hideScrollingIndicator(true);
-                mWorkspace.hideScrollIndicatorTrack();
+                if (!springLoaded && !LauncherApplication.isScreenLarge()) {
+                    // Hide the workspace scrollbar
+                    mWorkspace.hideScrollingIndicator(true);
+                    mWorkspace.hideScrollIndicatorTrack();
+                }
             }
         }
     }
@@ -2429,7 +2433,7 @@
      * @param fromState The current state (must be APPS_CUSTOMIZE).
      * @param animated If true, the transition will be animated.
      */
-    private void cameraZoomIn(State fromState, boolean animated, boolean springLoaded) {
+    private void cameraZoomIn(State fromState, boolean animated, final boolean springLoaded) {
         Resources res = getResources();
 
         final int duration = res.getInteger(R.integer.config_appsCustomizeZoomOutTime);
@@ -2477,9 +2481,11 @@
                     if (fromView instanceof LauncherTransitionable) {
                         ((LauncherTransitionable) fromView).onLauncherTransitionEnd(alphaAnim);
 
-                        // Show the workspace scrollbar
-                        mWorkspace.showScrollIndicatorTrack();
-                        mWorkspace.flashScrollingIndicator();
+                        if (!springLoaded && !LauncherApplication.isScreenLarge()) {
+                            // Show the workspace scrollbar
+                            mWorkspace.showScrollIndicatorTrack();
+                            mWorkspace.flashScrollingIndicator();
+                        }
                     }
                 }
             });
@@ -2492,9 +2498,11 @@
                 ((LauncherTransitionable) fromView).onLauncherTransitionStart(null);
                 ((LauncherTransitionable) fromView).onLauncherTransitionEnd(null);
 
-                // Show the workspace scrollbar
-                mWorkspace.showScrollIndicatorTrack();
-                mWorkspace.flashScrollingIndicator();
+                if (!springLoaded && !LauncherApplication.isScreenLarge()) {
+                    // Show the workspace scrollbar
+                    mWorkspace.showScrollIndicatorTrack();
+                    mWorkspace.flashScrollingIndicator();
+                }
             }
         }
     }
@@ -2527,12 +2535,10 @@
     }
 
     void enterSpringLoadedDragMode(CellLayout layout) {
-        // Enter spring loaded mode on a new layout
-        mWorkspace.enterSpringLoadedDragMode(layout);
-
         if (mState == State.APPS_CUSTOMIZE) {
-            mState = State.APPS_CUSTOMIZE_SPRING_LOADED;
+            mWorkspace.enterSpringLoadedDragMode(layout);
             cameraZoomIn(State.APPS_CUSTOMIZE, true, true);
+            mState = State.APPS_CUSTOMIZE_SPRING_LOADED;
         }
         // Otherwise, we are not in spring loaded mode, so don't do anything.
     }