aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/WordComposer.java
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2014-03-27 09:44:24 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-03-27 09:44:24 +0000
commitf459ccf4f663d74ce43c57e9b9af9251ee0c48a1 (patch)
tree6bbe83799902e301599522be465dfc4abda3617d /java/src/com/android/inputmethod/latin/WordComposer.java
parent5154c47cbe57b51e3dac97a98d932ce6d5110d26 (diff)
parent26baa759d88a03b5ff01cafab5de10e6fa9f848f (diff)
downloadlatinime-f459ccf4f663d74ce43c57e9b9af9251ee0c48a1.tar.gz
latinime-f459ccf4f663d74ce43c57e9b9af9251ee0c48a1.tar.xz
latinime-f459ccf4f663d74ce43c57e9b9af9251ee0c48a1.zip
Merge "Revert "[CB16] Remove unused stuff""
Diffstat (limited to 'java/src/com/android/inputmethod/latin/WordComposer.java')
-rw-r--r--java/src/com/android/inputmethod/latin/WordComposer.java23
1 files changed, 21 insertions, 2 deletions
diff --git a/java/src/com/android/inputmethod/latin/WordComposer.java b/java/src/com/android/inputmethod/latin/WordComposer.java
index 52d13770b..4638c8a8b 100644
--- a/java/src/com/android/inputmethod/latin/WordComposer.java
+++ b/java/src/com/android/inputmethod/latin/WordComposer.java
@@ -426,8 +426,9 @@ public final class WordComposer {
// Note: currently, we come here whenever we commit a word. If it's a MANUAL_PICK
// or a DECIDED_WORD we may cancel the commit later; otherwise, we should deactivate
// the last composed word to ensure this does not happen.
- final LastComposedWord lastComposedWord = new LastComposedWord(
- mTypedWord.toString(), committedWord, separatorString, prevWord, mCapitalizedMode);
+ final LastComposedWord lastComposedWord = new LastComposedWord(mEvents,
+ mInputPointers, mTypedWord.toString(), committedWord, separatorString,
+ prevWord, mCapitalizedMode);
mInputPointers.reset();
if (type != LastComposedWord.COMMIT_TYPE_DECIDED_WORD
&& type != LastComposedWord.COMMIT_TYPE_MANUAL_PICK) {
@@ -458,6 +459,24 @@ public final class WordComposer {
public void discardPreviousWordForSuggestion() {
mPreviousWordForSuggestion = null;
}
+
+ public void resumeSuggestionOnLastComposedWord(final LastComposedWord lastComposedWord,
+ final String previousWord) {
+ mEvents.clear();
+ Collections.copy(mEvents, lastComposedWord.mEvents);
+ mInputPointers.set(lastComposedWord.mInputPointers);
+ mTypedWord.setLength(0);
+ mCombinerChain.reset();
+ mTypedWord.append(lastComposedWord.mTypedWord);
+ refreshSize();
+ mCapitalizedMode = lastComposedWord.mCapitalizedMode;
+ mAutoCorrection = null; // This will be filled by the next call to updateSuggestion.
+ mCursorPositionWithinWord = mCodePointSize;
+ mRejectedBatchModeSuggestion = null;
+ mIsResumed = true;
+ mPreviousWordForSuggestion = previousWord;
+ }
+
public boolean isBatchMode() {
return mIsBatchMode;
}