diff options
author | 2014-04-07 06:59:07 +0000 | |
---|---|---|
committer | 2014-04-07 06:59:07 +0000 | |
commit | b724617b41accc60ee12eb200d3b712c7a910997 (patch) | |
tree | e8d20b647b5a364c51f5315054d1dd6dab193f17 /java/src | |
parent | df8019285868e8d9d9769d282df9d81bca26a95b (diff) | |
parent | 633e4f45330cf32d76c29d999b723ddeafd3a90c (diff) | |
download | latinime-b724617b41accc60ee12eb200d3b712c7a910997.tar.gz latinime-b724617b41accc60ee12eb200d3b712c7a910997.tar.xz latinime-b724617b41accc60ee12eb200d3b712c7a910997.zip |
Merge "[CB22] Merge add and delete"
Diffstat (limited to 'java/src')
-rw-r--r-- | java/src/com/android/inputmethod/latin/WordComposer.java | 34 |
1 files changed, 15 insertions, 19 deletions
diff --git a/java/src/com/android/inputmethod/latin/WordComposer.java b/java/src/com/android/inputmethod/latin/WordComposer.java index 87cf64461..d30ed2ef8 100644 --- a/java/src/com/android/inputmethod/latin/WordComposer.java +++ b/java/src/com/android/inputmethod/latin/WordComposer.java @@ -169,26 +169,7 @@ public final class WordComposer { * coordinates. */ public void add(final Event event) { - final int primaryCode = event.mCodePoint; - final int keyX = event.mX; - final int keyY = event.mY; - final int newIndex = size(); processEvent(event); - if (newIndex < MAX_WORD_LENGTH) { - mPrimaryKeyCodes[newIndex] = primaryCode >= Constants.CODE_SPACE - ? Character.toLowerCase(primaryCode) : primaryCode; - // In the batch input mode, the {@code mInputPointers} holds batch input points and - // shouldn't be overridden by the "typed key" coordinates - // (See {@link #setBatchInputWord}). - if (!mIsBatchMode) { - // TODO: Set correct pointer id and time - mInputPointers.addPointerAt(newIndex, keyX, keyY, 0, 0); - } - } - mIsFirstCharCapitalized = isFirstCharCapitalized( - newIndex, primaryCode, mIsFirstCharCapitalized); - if (Character.isUpperCase(primaryCode)) mCapsCount++; - if (Character.isDigit(primaryCode)) mDigitsCount++; } private void processEvent(final Event event) { @@ -223,6 +204,21 @@ public final class WordComposer { } else { mTrailingSingleQuotesCount = 0; } + if (newIndex < MAX_WORD_LENGTH) { + mPrimaryKeyCodes[newIndex] = primaryCode >= Constants.CODE_SPACE + ? Character.toLowerCase(primaryCode) : primaryCode; + // In the batch input mode, the {@code mInputPointers} holds batch input points and + // shouldn't be overridden by the "typed key" coordinates + // (See {@link #setBatchInputWord}). + if (!mIsBatchMode) { + // TODO: Set correct pointer id and time + mInputPointers.addPointerAt(newIndex, keyX, keyY, 0, 0); + } + } + mIsFirstCharCapitalized = isFirstCharCapitalized( + newIndex, primaryCode, mIsFirstCharCapitalized); + if (Character.isUpperCase(primaryCode)) mCapsCount++; + if (Character.isDigit(primaryCode)) mDigitsCount++; } mAutoCorrection = null; } |