From 58b971d733a2c700cabd3db02b6ea4d5faca6939 Mon Sep 17 00:00:00 2001 From: Eric Fischer Date: Tue, 30 Jun 2009 15:22:51 -0700 Subject: Always clear the TextView drag state whenever a touch begins. Apparently it can sometimes miss a touch release, which would prevent the longpress menu from appearing if the location of the new touch was too far from the location of the previous touch. Bug 1673223 --- core/java/android/text/method/Touch.java | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'core/java/android/text') diff --git a/core/java/android/text/method/Touch.java b/core/java/android/text/method/Touch.java index f2fb9cb..dfc16f5 100644 --- a/core/java/android/text/method/Touch.java +++ b/core/java/android/text/method/Touch.java @@ -81,6 +81,12 @@ public class Touch { switch (event.getAction()) { case MotionEvent.ACTION_DOWN: + ds = buffer.getSpans(0, buffer.length(), DragState.class); + + for (int i = 0; i < ds.length; i++) { + buffer.removeSpan(ds[i]); + } + buffer.setSpan(new DragState(event.getX(), event.getY(), widget.getScrollX(), widget.getScrollY()), 0, 0, Spannable.SPAN_MARK_MARK); -- cgit v1.1