diff options
author | 2013-04-17 19:47:10 -0700 | |
---|---|---|
committer | 2013-04-17 19:47:10 -0700 | |
commit | ae731331880f81534d1a0bf0bd6e2235b4204d63 (patch) | |
tree | 960454a0c798333e92900f001cade3882ef4d332 /java/src/com/android/inputmethod/latin/WordComposer.java | |
parent | 577dc1890626862f581a14badee5a0b85cbc4aa2 (diff) | |
parent | be0e013be879aec19197a9e1b0a1d2631a8d4c79 (diff) | |
download | latinime-ae731331880f81534d1a0bf0bd6e2235b4204d63.tar.gz latinime-ae731331880f81534d1a0bf0bd6e2235b4204d63.tar.xz latinime-ae731331880f81534d1a0bf0bd6e2235b4204d63.zip |
am be0e013b: am 059e084e: Merge "Reject a previously user-refused suggestion."
* commit 'be0e013be879aec19197a9e1b0a1d2631a8d4c79':
Reject a previously user-refused suggestion.
Diffstat (limited to 'java/src/com/android/inputmethod/latin/WordComposer.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/WordComposer.java | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/java/src/com/android/inputmethod/latin/WordComposer.java b/java/src/com/android/inputmethod/latin/WordComposer.java index 1af12428d..098e8ac7b 100644 --- a/java/src/com/android/inputmethod/latin/WordComposer.java +++ b/java/src/com/android/inputmethod/latin/WordComposer.java @@ -42,6 +42,13 @@ public final class WordComposer { private String mAutoCorrection; private boolean mIsResumed; private boolean mIsBatchMode; + // A memory of the last rejected batch mode suggestion, if any. This goes like this: the user + // gestures a word, is displeased with the results and hits backspace, then gestures again. + // At the very least we should avoid re-suggesting the same thing, and to do that we memorize + // the rejected suggestion in this variable. + // TODO: this should be done in a comprehensive way by the User History feature instead of + // as an ad-hockery here. + private String mRejectedBatchModeSuggestion; // Cache these values for performance private int mCapsCount; @@ -64,6 +71,7 @@ public final class WordComposer { mIsResumed = false; mIsBatchMode = false; mCursorPositionWithinWord = 0; + mRejectedBatchModeSuggestion = null; refreshSize(); } @@ -79,6 +87,7 @@ public final class WordComposer { mIsResumed = source.mIsResumed; mIsBatchMode = source.mIsBatchMode; mCursorPositionWithinWord = source.mCursorPositionWithinWord; + mRejectedBatchModeSuggestion = source.mRejectedBatchModeSuggestion; refreshSize(); } @@ -95,6 +104,7 @@ public final class WordComposer { mIsResumed = false; mIsBatchMode = false; mCursorPositionWithinWord = 0; + mRejectedBatchModeSuggestion = null; refreshSize(); } @@ -384,6 +394,7 @@ public final class WordComposer { mAutoCorrection = null; mCursorPositionWithinWord = 0; mIsResumed = false; + mRejectedBatchModeSuggestion = null; return lastComposedWord; } @@ -396,10 +407,19 @@ public final class WordComposer { mCapitalizedMode = lastComposedWord.mCapitalizedMode; mAutoCorrection = null; // This will be filled by the next call to updateSuggestion. mCursorPositionWithinWord = mCodePointSize; + mRejectedBatchModeSuggestion = null; mIsResumed = true; } public boolean isBatchMode() { return mIsBatchMode; } + + public void setRejectedBatchModeSuggestion(final String rejectedSuggestion) { + mRejectedBatchModeSuggestion = rejectedSuggestion; + } + + public String getRejectedBatchModeSuggestion() { + return mRejectedBatchModeSuggestion; + } } |