summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRoman Birg <roman@cyngn.com>2016-03-10 16:19:36 -0800
committerRoman Birg <roman@cyngn.com>2016-03-11 01:16:20 +0000
commit0f06e3edf344f7dbccaa53d1465332ccf77cbf8a (patch)
treeecf8d3fdfa455c0caa4d8b0bbcad358241acaea0 /src
parentfc7cdbe50467ed3facd6c7125e2c7e4d34bf164d (diff)
downloadandroid_packages_apps_AudioFX-0f06e3edf344f7dbccaa53d1465332ccf77cbf8a.tar.gz
android_packages_apps_AudioFX-0f06e3edf344f7dbccaa53d1465332ccf77cbf8a.tar.bz2
android_packages_apps_AudioFX-0f06e3edf344f7dbccaa53d1465332ccf77cbf8a.zip
AudioFX: make eq bars require a little long press time
Earlier patch made it just check distance, so it would be really easy to grab bars, TOO EASY. Change-Id: If8e577f41232daa3ba0e878ae6d4fceadd9bae17 Signed-off-by: Roman Birg <roman@cyngn.com>
Diffstat (limited to 'src')
-rw-r--r--src/com/cyngn/audiofx/eq/EqSwipeController.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/com/cyngn/audiofx/eq/EqSwipeController.java b/src/com/cyngn/audiofx/eq/EqSwipeController.java
index 637be6e..c89bece 100644
--- a/src/com/cyngn/audiofx/eq/EqSwipeController.java
+++ b/src/com/cyngn/audiofx/eq/EqSwipeController.java
@@ -1,6 +1,7 @@
package com.cyngn.audiofx.eq;
import android.content.Context;
+import android.provider.Settings;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.VelocityTracker;
@@ -18,7 +19,9 @@ public class EqSwipeController extends LinearLayout {
/*
* x velocity max for deciding whether to try to grab a bar
*/
- private static int X_VELOCITY_THRESH = 20;
+ private static final int X_VELOCITY_THRESH = 20;
+
+ private static final int MINIMUM_TIME_HOLD_TIME = 150;
EqContainerView mEq;
InfiniteViewPager mPager;
@@ -93,7 +96,8 @@ public class EqSwipeController extends LinearLayout {
if (!mBarActive && !mEqManager.isChangingPresets()
&& !mEqManager.isEqualizerLocked()
- && Math.abs(xVelocity) < X_VELOCITY_THRESH) {
+ && Math.abs(xVelocity) < X_VELOCITY_THRESH
+ && System.currentTimeMillis() - mDownTime > MINIMUM_TIME_HOLD_TIME) {
if (distanceSquared < touchSlop * touchSlop) {
mBarActive = true;
mBar = mEq.startTouchingBarUnder(event);