am b7605910: Merge "Second finger can start gesture input" into jb-mr1-dev

* commit 'b7605910404b9fe1e50fedd040cf6563b06afa6b':
  Second finger can start gesture input
main
Tadashi G. Takaoka 2012-09-24 08:45:26 -07:00 committed by Android Git Automerger
commit 89e11609c0
1 changed files with 5 additions and 10 deletions

View File

@ -685,18 +685,13 @@ public class PointerTracker implements PointerTrackerQueue.Element {
if (!sShouldHandleGesture) {
return;
}
final int activePointerTrackerCount = getActivePointerTrackerCount();
if (activePointerTrackerCount == 1) {
mIsDetectingGesture = false;
// A gesture should start only from the letter key.
final boolean isAlphabetKeyboard = (mKeyboard != null)
&& mKeyboard.mId.isAlphabetKeyboard();
if (isAlphabetKeyboard && !mIsShowingMoreKeysPanel && key != null
&& Keyboard.isLetterCode(key.mCode)) {
mIsDetectingGesture = (mKeyboard != null) && mKeyboard.mId.isAlphabetKeyboard()
&& !mIsShowingMoreKeysPanel && key != null && Keyboard.isLetterCode(key.mCode);
if (mIsDetectingGesture) {
if (getActivePointerTrackerCount() == 1) {
sGestureFirstDownTime = eventTime;
onGestureDownEvent(x, y, eventTime);
}
} else if (sInGesture && activePointerTrackerCount > 1) {
onGestureDownEvent(x, y, eventTime);
}
}