diff options
author | Winson Chung <winsonc@google.com> | 2012-05-29 17:03:45 -0700 |
---|---|---|
committer | Winson Chung <winsonc@google.com> | 2012-05-29 17:04:43 -0700 |
commit | 6e1bdaf4198f9eb7b4124550d3ad07da2a0226e4 (patch) | |
tree | 23d0a219865fd0ecc3d74f76535653330818e56e /src/com/android/launcher2/DragController.java | |
parent | 68f681bc7a10fc014ae0864c6e2db465ce4c30df (diff) | |
download | android_packages_apps_Trebuchet-6e1bdaf4198f9eb7b4124550d3ad07da2a0226e4.tar.gz android_packages_apps_Trebuchet-6e1bdaf4198f9eb7b4124550d3ad07da2a0226e4.tar.bz2 android_packages_apps_Trebuchet-6e1bdaf4198f9eb7b4124550d3ad07da2a0226e4.zip |
Lowering the threshold for flinging on larger devices. (Bug 6575670)
Change-Id: I969057d6135babef430c60f5b2705179210719bb
Diffstat (limited to 'src/com/android/launcher2/DragController.java')
-rw-r--r-- | src/com/android/launcher2/DragController.java | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/com/android/launcher2/DragController.java b/src/com/android/launcher2/DragController.java index 1b0ccf519..84f151581 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 @@ public class DragController { 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 @@ public class DragController { * @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() { |