summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/BubbleTextView.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/launcher3/BubbleTextView.java')
-rw-r--r--src/com/android/launcher3/BubbleTextView.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/com/android/launcher3/BubbleTextView.java b/src/com/android/launcher3/BubbleTextView.java
index c180d3227..95300c133 100644
--- a/src/com/android/launcher3/BubbleTextView.java
+++ b/src/com/android/launcher3/BubbleTextView.java
@@ -28,6 +28,7 @@ import android.util.AttributeSet;
import android.util.Log;
import android.util.TypedValue;
import android.view.MotionEvent;
+import android.view.ViewConfiguration;
import android.widget.TextView;
/**
@@ -60,6 +61,8 @@ public class BubbleTextView extends TextView {
private int mPressedOutlineColor;
private int mPressedGlowColor;
+ private float mSlop;
+
private int mTextColor;
private boolean mShadowsEnabled = true;
private boolean mIsTextVisible;
@@ -272,6 +275,11 @@ public class BubbleTextView extends TextView {
mLongPressHelper.cancelLongPress();
break;
+ case MotionEvent.ACTION_MOVE:
+ if (!Utilities.pointInView(this, event.getX(), event.getY(), mSlop)) {
+ mLongPressHelper.cancelLongPress();
+ }
+ break;
}
return result;
}
@@ -356,6 +364,7 @@ public class BubbleTextView extends TextView {
protected void onAttachedToWindow() {
super.onAttachedToWindow();
if (mBackground != null) mBackground.setCallback(this);
+ mSlop = ViewConfiguration.get(getContext()).getScaledTouchSlop();
}
@Override