Merge "[CB19] Some refactoring"
This commit is contained in:
commit
4323e1126c
1 changed files with 8 additions and 6 deletions
|
@ -173,9 +173,7 @@ public final class WordComposer {
|
||||||
final int keyX = event.mX;
|
final int keyX = event.mX;
|
||||||
final int keyY = event.mY;
|
final int keyY = event.mY;
|
||||||
final int newIndex = size();
|
final int newIndex = size();
|
||||||
mCombinerChain.processEvent(mEvents, event);
|
processEvent(event);
|
||||||
mEvents.add(event);
|
|
||||||
refreshTypedWordCache();
|
|
||||||
mCursorPositionWithinWord = mCodePointSize;
|
mCursorPositionWithinWord = mCodePointSize;
|
||||||
if (newIndex < MAX_WORD_LENGTH) {
|
if (newIndex < MAX_WORD_LENGTH) {
|
||||||
mPrimaryKeyCodes[newIndex] = primaryCode >= Constants.CODE_SPACE
|
mPrimaryKeyCodes[newIndex] = primaryCode >= Constants.CODE_SPACE
|
||||||
|
@ -200,13 +198,17 @@ public final class WordComposer {
|
||||||
mAutoCorrection = null;
|
mAutoCorrection = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void processEvent(final Event event) {
|
||||||
|
mCombinerChain.processEvent(mEvents, event);
|
||||||
|
mEvents.add(event);
|
||||||
|
refreshTypedWordCache();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete the last composing unit as a result of hitting backspace.
|
* Delete the last composing unit as a result of hitting backspace.
|
||||||
*/
|
*/
|
||||||
public void deleteLast(final Event event) {
|
public void deleteLast(final Event event) {
|
||||||
mCombinerChain.processEvent(mEvents, event);
|
processEvent(event);
|
||||||
mEvents.add(event);
|
|
||||||
refreshTypedWordCache();
|
|
||||||
// We may have deleted the last one.
|
// We may have deleted the last one.
|
||||||
if (0 == size()) {
|
if (0 == size()) {
|
||||||
mIsFirstCharCapitalized = false;
|
mIsFirstCharCapitalized = false;
|
||||||
|
|
Loading…
Reference in a new issue