[CB22] Merge add and delete
...but this time, it works. Bug: 13406701 Change-Id: Iaa00339a6be76413ffaeb74ff1556e15b3bb039d
This commit is contained in:
parent
e2e41dc22c
commit
633e4f4533
1 changed files with 15 additions and 19 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue