Lowering the threshold for flinging on larger devices. (Bug 6575670)
Change-Id: I969057d6135babef430c60f5b2705179210719bb
diff --git a/src/com/android/launcher2/DragController.java b/src/com/android/launcher2/DragController.java
index 1b0ccf5..84f1515 100644
--- a/src/com/android/launcher2/DragController.java
+++ b/src/com/android/launcher2/DragController.java
@@ -17,6 +17,7 @@
package com.android.launcher2;
import android.content.Context;
+import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.Point;
import android.graphics.PointF;
@@ -62,7 +63,6 @@
static final int SCROLL_RIGHT = 1;
private static final float MAX_FLING_DEGREES = 35f;
- private static final int FLING_TO_DELETE_THRESHOLD_Y_VELOCITY = -1500;
private Launcher mLauncher;
private Handler mHandler;
@@ -146,14 +146,16 @@
* @param context The application's context.
*/
public DragController(Launcher launcher) {
+ Resources r = launcher.getResources();
mLauncher = launcher;
mHandler = new Handler();
- mScrollZone = launcher.getResources().getDimensionPixelSize(R.dimen.scroll_zone);
+ mScrollZone = r.getDimensionPixelSize(R.dimen.scroll_zone);
mVelocityTracker = VelocityTracker.obtain();
- mVibrator = (Vibrator)launcher.getSystemService(Context.VIBRATOR_SERVICE);
+ mVibrator = (Vibrator) launcher.getSystemService(Context.VIBRATOR_SERVICE);
- float density = launcher.getResources().getDisplayMetrics().density;
- mFlingToDeleteThresholdVelocity = (int) (FLING_TO_DELETE_THRESHOLD_Y_VELOCITY * density);
+ float density = r.getDisplayMetrics().density;
+ mFlingToDeleteThresholdVelocity =
+ (int) (r.getInteger(R.integer.config_flingToDeleteMinVelocity) * density);
}
public boolean dragging() {