aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/LatinIME.java
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2012-08-15 02:35:20 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-08-15 02:35:21 -0700
commit91c64902b038976ae44d69dae7818f2c7adde863 (patch)
tree6a6f333d95811be9710f3e5b00f9c45689d7dfbb /java/src/com/android/inputmethod/latin/LatinIME.java
parentcd0e0048881eb854a4d1524c2d54d6b9bb00f614 (diff)
parente234aed4288efd7b4336f3755a958c25a1540b98 (diff)
downloadlatinime-91c64902b038976ae44d69dae7818f2c7adde863.tar.gz
latinime-91c64902b038976ae44d69dae7818f2c7adde863.tar.xz
latinime-91c64902b038976ae44d69dae7818f2c7adde863.zip
Merge "Refresh editor info when the text field attributes changes." into jb-mr1-dev
Diffstat (limited to 'java/src/com/android/inputmethod/latin/LatinIME.java')
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java12
1 files changed, 7 insertions, 5 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index 446d44e7a..884e6db29 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -670,7 +670,11 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
accessUtils.onStartInputViewInternal(mainKeyboardView, editorInfo, restarting);
}
- if (!restarting) {
+ final boolean selectionChanged = mLastSelectionStart != editorInfo.initialSelStart
+ || mLastSelectionEnd != editorInfo.initialSelEnd;
+ final boolean inputTypeChanged = !mCurrentSettings.isSameInputType(editorInfo);
+ final boolean isDifferentTextField = !restarting || inputTypeChanged;
+ if (isDifferentTextField) {
mSubtypeSwitcher.updateParametersOnStartInputView();
}
@@ -679,9 +683,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
updateFullscreenMode();
mApplicationSpecifiedCompletions = null;
- final boolean selectionChanged = mLastSelectionStart != editorInfo.initialSelStart
- || mLastSelectionEnd != editorInfo.initialSelEnd;
- if (!restarting || selectionChanged) {
+ if (isDifferentTextField || selectionChanged) {
// If the selection changed, we reset the input state. Essentially, we come here with
// restarting == true when the app called setText() or similar. We should reset the
// state if the app set the text to something else, but keep it if it set a suggestion
@@ -696,7 +698,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
}
}
- if (!restarting) {
+ if (isDifferentTextField) {
mainKeyboardView.closing();
loadSettings();