Fix bug 2261637 - Workspace previews home screens on long pressing
at the bottom of app drawer

This includes some contortions to get it not to perform the vibrate
haptic feedback then.

(By the way, it appears that we're vibrating on the add context menu
long press, so also do it when when we show the previews.
diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java
index c04176f..a8235a2 100644
--- a/src/com/android/launcher2/Launcher.java
+++ b/src/com/android/launcher2/Launcher.java
@@ -55,6 +55,7 @@
 import android.text.method.TextKeyListener;
 import android.util.Log;
 import android.view.Display;
+import android.view.HapticFeedbackConstants;
 import android.view.KeyEvent;
 import android.view.LayoutInflater;
 import android.view.Menu;
@@ -563,7 +564,9 @@
         Drawable next = mNextView.getDrawable();
         mWorkspace.setIndicators(previous, next);
 
+        mPreviousView.setHapticFeedbackEnabled(false);
         mPreviousView.setOnLongClickListener(this);
+        mNextView.setHapticFeedbackEnabled(false);
         mNextView.setOnLongClickListener(this);
 
         workspace.setOnLongClickListener(this);
@@ -1469,10 +1472,18 @@
     public boolean onLongClick(View v) {
         switch (v.getId()) {
             case R.id.previous_screen:
-                showPreviousPreview(v);
+                if (!isAllAppsVisible()) {
+                    mWorkspace.performHapticFeedback(HapticFeedbackConstants.LONG_PRESS,
+                            HapticFeedbackConstants.FLAG_IGNORE_VIEW_SETTING);
+                    showPreviousPreview(v);
+                }
                 return true;
             case R.id.next_screen:
-                showNextPreview(v);
+                if (!isAllAppsVisible()) {
+                    mWorkspace.performHapticFeedback(HapticFeedbackConstants.LONG_PRESS,
+                            HapticFeedbackConstants.FLAG_IGNORE_VIEW_SETTING);
+                    showNextPreview(v);
+                }
                 return true;
         }
 
@@ -1501,6 +1512,8 @@
             } else {
                 if (!(cellInfo.cell instanceof Folder)) {
                     // User long pressed on an item
+                    mWorkspace.performHapticFeedback(HapticFeedbackConstants.LONG_PRESS,
+                            HapticFeedbackConstants.FLAG_IGNORE_VIEW_SETTING);
                     mWorkspace.startDrag(cellInfo);
                 }
             }