diff options
| author | Menny Even Danan <menny@evendanan.net> | 2014-02-13 03:54:28 +0000 |
|---|---|---|
| committer | Menny Even Danan <menny@evendanan.net> | 2014-02-13 03:54:28 +0000 |
| commit | e509d873a8fe0b2e31e3b03dd6cd7b5852675204 (patch) | |
| tree | 46912217aeae19441022426e57813831b7681f7c /src/main/java/com/anysoftkeyboard/devicespecific | |
| parent | 351988b735ce12a92d5fb6c93a41f3f2e378a899 (diff) | |
| download | AnySoftKeyboard-e509d873a8fe0b2e31e3b03dd6cd7b5852675204.tar.gz AnySoftKeyboard-e509d873a8fe0b2e31e3b03dd6cd7b5852675204.tar.bz2 | |
Fix for onFling which caused swipe up and down are not working
the gesture detector did not get the UP event since it was filtered out
(the single finger pointer ID was cleared before the event could be
processed).
Issue #316
Change-Id: I772ca0b2c7527e7a19ed7d5715cda4d8c902b75c
Diffstat (limited to 'src/main/java/com/anysoftkeyboard/devicespecific')
| -rw-r--r-- | src/main/java/com/anysoftkeyboard/devicespecific/AskV8GestureDetector.java | 8 | ||||
| -rw-r--r-- | src/main/java/com/anysoftkeyboard/devicespecific/DeviceSpecific_V8.java | 4 |
2 files changed, 7 insertions, 5 deletions
diff --git a/src/main/java/com/anysoftkeyboard/devicespecific/AskV8GestureDetector.java b/src/main/java/com/anysoftkeyboard/devicespecific/AskV8GestureDetector.java index cba2ef013..bb4d116db 100644 --- a/src/main/java/com/anysoftkeyboard/devicespecific/AskV8GestureDetector.java +++ b/src/main/java/com/anysoftkeyboard/devicespecific/AskV8GestureDetector.java @@ -61,11 +61,15 @@ public class AskV8GestureDetector extends GestureDetector { @Override public boolean onTouchEvent(MotionEvent ev) { + int singleFingerEventPointerId = mSingleFingerEventPointerId; + //I want to keep track on the first finger (https://github.com/AnySoftKeyboard/AnySoftKeyboard/issues/300) switch (MotionEventCompat.getActionMasked(ev)){ case MotionEvent.ACTION_DOWN: - if (ev.getPointerCount() == 1) + if (ev.getPointerCount() == 1) { mSingleFingerEventPointerId = ev.getPointerId(0); + singleFingerEventPointerId = mSingleFingerEventPointerId; + } break; case MotionEvent.ACTION_CANCEL: case MotionEvent.ACTION_UP: @@ -82,7 +86,7 @@ public class AskV8GestureDetector extends GestureDetector { } //I'm going to pass the event to the super, only if it is a single touch, and the event is for the first finger //https://github.com/AnySoftKeyboard/AnySoftKeyboard/issues/300 - if (ev.getPointerCount() == 1 && ev.getPointerId(0) == mSingleFingerEventPointerId) + if (ev.getPointerCount() == 1 && ev.getPointerId(0) == singleFingerEventPointerId) return super.onTouchEvent(ev); else return false; diff --git a/src/main/java/com/anysoftkeyboard/devicespecific/DeviceSpecific_V8.java b/src/main/java/com/anysoftkeyboard/devicespecific/DeviceSpecific_V8.java index 2c2837ece..89f8a79b8 100644 --- a/src/main/java/com/anysoftkeyboard/devicespecific/DeviceSpecific_V8.java +++ b/src/main/java/com/anysoftkeyboard/devicespecific/DeviceSpecific_V8.java @@ -48,9 +48,7 @@ public class DeviceSpecific_V8 extends DeviceSpecific_V7 { @Override public GestureDetector createGestureDetector(Context appContext, AskOnGestureListener listener) { - final boolean ignoreMultitouch = true; - return new AskV8GestureDetector(appContext, listener, null, - ignoreMultitouch); + return new AskV8GestureDetector(appContext, listener, null, true/*ignore multi-touch*/); } @Override |
