diff options
author | 2010-04-15 14:44:22 -0700 | |
---|---|---|
committer | 2010-04-15 14:44:22 -0700 | |
commit | 938c178215d38c6f085b32b0994598f9e8bc5ab5 (patch) | |
tree | fdb50b1e9ae35ced522c6440131995ce1a1a071a /java/src/com/android/inputmethod/latin/LatinKeyboardView.java | |
parent | 48832c860377e5515be6ccf57fce9299a408584a (diff) | |
download | latinime-938c178215d38c6f085b32b0994598f9e8bc5ab5.tar.gz latinime-938c178215d38c6f085b32b0994598f9e8bc5ab5.tar.xz latinime-938c178215d38c6f085b32b0994598f9e8bc5ab5.zip |
Fix for hanging extension keyboard. Bug: 2593488
Sometimes the only motion event that is above the keyboard is the UP
event. In that case we can't expect one more event to come that will
dismiss the extension. So don't show the extension if the only Y < 0
event is an UP event.
Change-Id: I04a8b742dea03cd700006dc5df740ac7d9620c0b
Diffstat (limited to 'java/src/com/android/inputmethod/latin/LatinKeyboardView.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/LatinKeyboardView.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinKeyboardView.java b/java/src/com/android/inputmethod/latin/LatinKeyboardView.java index c25fe3942..ddfb4047c 100644 --- a/java/src/com/android/inputmethod/latin/LatinKeyboardView.java +++ b/java/src/com/android/inputmethod/latin/LatinKeyboardView.java @@ -192,12 +192,12 @@ public class LatinKeyboardView extends KeyboardView { mLastY = (int) me.getY(); invalidate(); } + // If an extension keyboard is visible or this is an extension keyboard, don't look // for sudden jumps. Otherwise, if there was a sudden jump, return without processing the // actual motion event. if (!mExtensionVisible && !mIsExtensionType && handleSuddenJump(me)) return true; - // Reset any bounding box controls in the keyboard if (me.getAction() == MotionEvent.ACTION_DOWN) { keyboard.keyReleased(); @@ -219,7 +219,9 @@ public class LatinKeyboardView extends KeyboardView { if (keyboard.getExtension() == 0) { return super.onTouchEvent(me); } - if (me.getY() < 0) { + // If the motion event is above the keyboard and it's not an UP event coming + // even before the first MOVE event into the extension area + if (me.getY() < 0 && (mExtensionVisible || me.getAction() != MotionEvent.ACTION_UP)) { if (mExtensionVisible) { int action = me.getAction(); if (mFirstEvent) action = MotionEvent.ACTION_DOWN; |