summaryrefslogtreecommitdiffstats
path: root/core/java/android/text/method
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2009-12-02 13:47:25 -0800
committerDianne Hackborn <hackbod@google.com>2009-12-02 15:35:35 -0800
commit27d377221c7970a5205c83f8a9f62f755dc1fa5d (patch)
tree8f58bbe9bc87fb19acf7ce1999b6d8ae1ec5ada4 /core/java/android/text/method
parent5886050fad97923c33cbc831fe07a5b1746b2b58 (diff)
downloadframeworks_base-27d377221c7970a5205c83f8a9f62f755dc1fa5d.zip
frameworks_base-27d377221c7970a5205c83f8a9f62f755dc1fa5d.tar.gz
frameworks_base-27d377221c7970a5205c83f8a9f62f755dc1fa5d.tar.bz2
Some work on issue #2286804: sometimes text field doesn't accept input
This doesn't really fix the problem being brought up here, but fixes a related issue I found while investigating it -- if you tap a text view enough to cause it to try to scroll, this will cause the touch to become a scroll instead of a click, even if there is nothing to scroll. So often quick taps to bring up the IME would be canceled because they became a non-scroll. Unfortuntately after syncing the latest build, I was having a lot of trouble reproducing the original problem. I think I need to punt it to MR2 at this point. Change-Id: If1f0bf33de1b4d71c9f677cdad07639b7a3fb772
Diffstat (limited to 'core/java/android/text/method')
-rw-r--r--core/java/android/text/method/Touch.java12
1 files changed, 11 insertions, 1 deletions
diff --git a/core/java/android/text/method/Touch.java b/core/java/android/text/method/Touch.java
index 6995107..aa8d979 100644
--- a/core/java/android/text/method/Touch.java
+++ b/core/java/android/text/method/Touch.java
@@ -20,6 +20,7 @@ import android.text.Layout;
import android.text.NoCopySpan;
import android.text.Layout.Alignment;
import android.text.Spannable;
+import android.util.Log;
import android.view.MotionEvent;
import android.view.ViewConfiguration;
import android.widget.TextView;
@@ -156,8 +157,17 @@ public class Touch {
padding));
ny = Math.max(ny, 0);
+ int oldX = widget.getScrollX();
+ int oldY = widget.getScrollY();
+
scrollTo(widget, layout, nx, ny);
- widget.cancelLongPress();
+
+ // If we actually scrolled, then cancel the up action.
+ if (oldX != widget.getScrollX()
+ || oldY != widget.getScrollY()) {
+ widget.cancelLongPress();
+ }
+
return true;
}
}