diff options
author | 2011-12-12 02:20:49 -0800 | |
---|---|---|
committer | 2011-12-12 02:20:49 -0800 | |
commit | f162ed7ec86be695fedd98e872d313f161fcdecd (patch) | |
tree | ecc0682ef9a3157aec59ddf7f1f34317c5628d20 /java/src/com/android/inputmethod/latin/LatinIME.java | |
parent | 267cd0151f038d4d1654b9cbea5066d1927dd032 (diff) | |
parent | 406d192a9e8f07ed6c6a408650feb0a757ca388e (diff) | |
download | latinime-f162ed7ec86be695fedd98e872d313f161fcdecd.tar.gz latinime-f162ed7ec86be695fedd98e872d313f161fcdecd.tar.xz latinime-f162ed7ec86be695fedd98e872d313f161fcdecd.zip |
Merge "Remove side-effects from TextEntryState"
Diffstat (limited to 'java/src/com/android/inputmethod/latin/LatinIME.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/LatinIME.java | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index b4ad2255c..711afdfdd 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -1431,6 +1431,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar // TODO: Merge space state with TextEntryState TextEntryState.backspace(); if (null != mWordSavedForAutoCorrectCancellation) { + Utils.Stats.onAutoCorrectionCancellation(); cancelAutoCorrect(ic); mWordSavedForAutoCorrectCancellation = null; ic.endBatchEdit(); @@ -1574,7 +1575,13 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar } switcher.updateShiftState(); - TextEntryState.typedCharacter((char) code, mSettingsValues.isWordSeparator(code), x, y); + if (mSettingsValues.isWordSeparator(code)) { + TextEntryState.typedCharacter((char) code, true, x, y); + Utils.Stats.onSeparator((char)code, x, y); + } else { + TextEntryState.typedCharacter((char) code, false, x, y); + Utils.Stats.onNonSeparator((char)code, x, y); + } if (null != ic) ic.endBatchEdit(); } @@ -1657,6 +1664,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar } TextEntryState.typedCharacter((char) primaryCode, true, x, y); + Utils.Stats.onSeparator((char)primaryCode, x, y); if (pickedDefault) { CharSequence typedWord = mWordComposer.getTypedWord(); @@ -1868,7 +1876,10 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar updateSuggestions(); } if (mBestWord != null && mBestWord.length() > 0) { - TextEntryState.acceptedDefault(mWordComposer.getTypedWord(), mBestWord, separatorCode); + Utils.Stats.onAutoCorrection(mWordComposer.getTypedWord(), mBestWord.toString(), + separatorCode); + TextEntryState.acceptedDefault(mWordComposer.getTypedWord(), mBestWord, + separatorCode); mExpectingUpdateSelection = true; commitBestWord(mBestWord); if (!mBestWord.equals(mWordComposer.getTypedWord())) { @@ -1976,6 +1987,8 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar // TextEntryState.State.PICKED_SUGGESTION state. TextEntryState.typedCharacter((char) Keyboard.CODE_SPACE, true, WordComposer.NOT_A_COORDINATE, WordComposer.NOT_A_COORDINATE); + Utils.Stats.onSeparator((char)Keyboard.CODE_SPACE, WordComposer.NOT_A_COORDINATE, + WordComposer.NOT_A_COORDINATE); if (!showingAddToDictionaryHint) { // If we're not showing the "Touch again to save", then show corrections again. // In case the cursor position doesn't change, make sure we show the suggestions again. @@ -2195,6 +2208,8 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar ic.commitText(separator, 1); TextEntryState.typedCharacter(separator.charAt(0), true, WordComposer.NOT_A_COORDINATE, WordComposer.NOT_A_COORDINATE); + Utils.Stats.onSeparator(separator.charAt(0), WordComposer.NOT_A_COORDINATE, + WordComposer.NOT_A_COORDINATE); mHandler.cancelUpdateBigramPredictions(); mHandler.postUpdateSuggestions(); } |