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:43:21 +0000
committerJean Chalard <jchalard@google.com>2014-03-27 09:43:21 +0000
commit26baa759d88a03b5ff01cafab5de10e6fa9f848f (patch)
tree2e4d05ffa874939d82039733ef889842495f2410 /java/src/com/android/inputmethod/latin/WordComposer.java
parent05c46f59fdc6065aad833d905fc9759ba907fc82 (diff)
downloadlatinime-26baa759d88a03b5ff01cafab5de10e6fa9f848f.tar.gz
latinime-26baa759d88a03b5ff01cafab5de10e6fa9f848f.tar.xz
latinime-26baa759d88a03b5ff01cafab5de10e6fa9f848f.zip
Revert "[CB16] Remove unused stuff"
This reverts commit 05c46f59fdc6065aad833d905fc9759ba907fc82. Change-Id: Ica0feea10fff1b2a9ef42bc55cb7c1892b3a3f58
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;
}