aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2013-12-27 03:55:05 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2013-12-27 03:55:05 -0800
commitb70d74a3f914cdf120007cd05837c22983cfa8f7 (patch)
tree74b169b4634272c24381b7db00585e6e08c7a7a5 /java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
parent98c0121ccd5898c10267034d95fb1b9cf7f82cd5 (diff)
parent81e0ca5fd395fd67c7b93e7d87e7d90fa136f065 (diff)
downloadlatinime-b70d74a3f914cdf120007cd05837c22983cfa8f7.tar.gz
latinime-b70d74a3f914cdf120007cd05837c22983cfa8f7.tar.xz
latinime-b70d74a3f914cdf120007cd05837c22983cfa8f7.zip
am 81e0ca5f: [IL49] Move InputLogic-related init code to InputLogic.
* commit '81e0ca5fd395fd67c7b93e7d87e7d90fa136f065': [IL49] Move InputLogic-related init code to InputLogic.
Diffstat (limited to 'java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java')
-rw-r--r--java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java21
1 files changed, 19 insertions, 2 deletions
diff --git a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
index 34377e955..5fe482bda 100644
--- a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
+++ b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
@@ -116,9 +116,22 @@ public final class InputLogic {
* some things must not be done (for example, the keyboard should not be reset to the
* alphabetic layout), so do not send false to this just in case.
*
- * @param restarting whether input is starting in the same field as before.
+ * @param restarting whether input is starting in the same field as before. Unused for now.
+ * @param editorInfo the editorInfo associated with the editor.
*/
- public void startInput(final boolean restarting) {
+ public void startInput(final boolean restarting, final EditorInfo editorInfo) {
+ mEnteredText = null;
+ resetComposingState(true /* alsoResetLastComposedWord */);
+ mDeleteCount = 0;
+ mSpaceState = SpaceState.NONE;
+ mRecapitalizeStatus.deactivate();
+ mCurrentlyPressedHardwareKeys.clear();
+ mSuggestedWords = SuggestedWords.EMPTY;
+ mLastSelectionStart = editorInfo.initialSelStart;
+ mLastSelectionEnd = editorInfo.initialSelEnd;
+ // In some cases (namely, after rotation of the device) editorInfo.initialSelStart is lying
+ // so we try using some heuristics to find out about these and fix them.
+ tryFixLyingCursorPosition();
mInputLogicHandler = new InputLogicHandler();
}
@@ -126,6 +139,10 @@ public final class InputLogic {
* Clean up the input logic after input is finished.
*/
public void finishInput() {
+ if (mWordComposer.isComposingWord()) {
+ mConnection.finishComposingText();
+ }
+ resetComposingState(true /* alsoResetLastComposedWord */);
mInputLogicHandler.destroy();
mInputLogicHandler = null;
}