Disable gesture detector on mini-keyboard

Gesture detector, for closing keyboard by swiping down, must be
disabled not only when mini-keyboard is on the screen, but also in the
mini-keyboard itself.

Bug: 3105595
Change-Id: I548501f7117ca2310943cabb678c1e250e5012ce
This commit is contained in:
Tadashi G. Takaoka 2010-10-18 21:10:11 +09:00
parent c7c2472afb
commit 28d8a488c0

View file

@ -226,7 +226,7 @@ public class LatinKeyboardBaseView extends View implements PointerTracker.UIProx
protected KeyDetector mKeyDetector = new ProximityKeyDetector();
// Swipe gesture detector
private final GestureDetector mGestureDetector;
private GestureDetector mGestureDetector;
private final SwipeTracker mSwipeTracker = new SwipeTracker();
private final int mSwipeThreshold;
private final boolean mDisambiguateSwipe;
@ -1132,6 +1132,8 @@ public class LatinKeyboardBaseView extends View implements PointerTracker.UIProx
});
// Override default ProximityKeyDetector.
miniKeyboard.mKeyDetector = new MiniKeyboardKeyDetector(mMiniKeyboardSlideAllowance);
// Remove gesture detector on mini-keyboard
miniKeyboard.mGestureDetector = null;
BaseKeyboard keyboard;
if (popupKey.popupCharacters != null) {
@ -1304,8 +1306,9 @@ public class LatinKeyboardBaseView extends View implements PointerTracker.UIProx
// Track the last few movements to look for spurious swipes.
mSwipeTracker.addMovement(me);
// We must disable gesture detector while mini-keyboard is on the screen.
if (mMiniKeyboard == null && mGestureDetector.onTouchEvent(me)) {
// Gesture detector must be enabled only when mini-keyboard is not on the screen.
if (mMiniKeyboard == null
&& mGestureDetector != null && mGestureDetector.onTouchEvent(me)) {
dismissKeyPreview();
mHandler.cancelKeyTimers();
return true;