diff options
author | 2014-07-01 09:26:56 +0000 | |
---|---|---|
committer | 2014-06-26 23:14:30 +0000 | |
commit | 0100a49bdd7658814b016fbefe63148e57d6096f (patch) | |
tree | 586a6d2ae8a92d1e2776d873b12fef5ba171ea9a /java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java | |
parent | b10ca308afa40bdc9d003494e30d21df03a0063c (diff) | |
parent | 28ebbd481ad38f41211d853bf5eb39b36842be36 (diff) | |
download | latinime-0100a49bdd7658814b016fbefe63148e57d6096f.tar.gz latinime-0100a49bdd7658814b016fbefe63148e57d6096f.tar.xz latinime-0100a49bdd7658814b016fbefe63148e57d6096f.zip |
Merge "[HW5] Make the word composer package private."
Diffstat (limited to 'java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java index 213fe0b81..5ab7db8ce 100644 --- a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java +++ b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java @@ -80,7 +80,8 @@ public final class InputLogic { private final DictionaryFacilitator mDictionaryFacilitator; public LastComposedWord mLastComposedWord = LastComposedWord.NOT_A_COMPOSED_WORD; - public final WordComposer mWordComposer; + // This has package visibility so it can be accessed from InputLogicHandler. + /* package */ final WordComposer mWordComposer; public final RichInputConnection mConnection; private final RecapitalizeStatus mRecapitalizeStatus = new RecapitalizeStatus(); @@ -152,6 +153,23 @@ public final class InputLogic { } /** + * Call this when the orientation changes. + * @param settingsValues the current values of the settings. + */ + public void onOrientationChange(final SettingsValues settingsValues) { + // If !isComposingWord, #commitTyped() is a no-op, but still, it's better to avoid + // the useless IPC of {begin,end}BatchEdit. + if (mWordComposer.isComposingWord()) { + mConnection.beginBatchEdit(); + // If we had a composition in progress, we need to commit the word so that the + // suggestionsSpan will be added. This will allow resuming on the same suggestions + // after rotation is finished. + commitTyped(settingsValues, LastComposedWord.NOT_A_SEPARATOR); + mConnection.endBatchEdit(); + } + } + + /** * Clean up the input logic after input is finished. */ public void finishInput() { |