aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/com/android/inputmethod/latin/KeyboardSwitcher.java5
-rw-r--r--src/com/android/inputmethod/latin/LatinIME.java14
2 files changed, 10 insertions, 9 deletions
diff --git a/src/com/android/inputmethod/latin/KeyboardSwitcher.java b/src/com/android/inputmethod/latin/KeyboardSwitcher.java
index 2da703632..c82587b71 100644
--- a/src/com/android/inputmethod/latin/KeyboardSwitcher.java
+++ b/src/com/android/inputmethod/latin/KeyboardSwitcher.java
@@ -70,14 +70,15 @@ public class KeyboardSwitcher {
mInputView = inputView;
}
- void makeKeyboards() {
+ void makeKeyboards(boolean forceCreate) {
+ if (forceCreate) mKeyboards.clear();
// Configuration change is coming after the keyboard gets recreated. So don't rely on that.
// If keyboards have already been made, check if we have a screen width change and
// create the keyboard layouts again at the correct orientation
int displayWidth = mContext.getMaxWidth();
if (displayWidth == mLastDisplayWidth) return;
mLastDisplayWidth = displayWidth;
- mKeyboards.clear();
+ if (!forceCreate) mKeyboards.clear();
mSymbolsId = new KeyboardId(R.xml.kbd_symbols);
mSymbolsShiftedId = new KeyboardId(R.xml.kbd_symbols_shift);
}
diff --git a/src/com/android/inputmethod/latin/LatinIME.java b/src/com/android/inputmethod/latin/LatinIME.java
index 6ee9bd127..8c9102d8c 100644
--- a/src/com/android/inputmethod/latin/LatinIME.java
+++ b/src/com/android/inputmethod/latin/LatinIME.java
@@ -210,16 +210,16 @@ public class LatinIME extends InputMethodService
public void onConfigurationChanged(Configuration conf) {
if (!TextUtils.equals(conf.locale.toString(), mLocale)) {
initSuggest(conf.locale.toString());
- if (mKeyboardSwitcher == null) {
- mKeyboardSwitcher = new KeyboardSwitcher(this);
- }
- mKeyboardSwitcher.makeKeyboards();
}
// If orientation changed while predicting, commit the change
if (conf.orientation != mOrientation) {
commitTyped(getCurrentInputConnection());
mOrientation = conf.orientation;
}
+ if (mKeyboardSwitcher == null) {
+ mKeyboardSwitcher = new KeyboardSwitcher(this);
+ }
+ mKeyboardSwitcher.makeKeyboards(true);
super.onConfigurationChanged(conf);
}
@@ -228,7 +228,7 @@ public class LatinIME extends InputMethodService
mInputView = (LatinKeyboardView) getLayoutInflater().inflate(
R.layout.input, null);
mKeyboardSwitcher.setInputView(mInputView);
- mKeyboardSwitcher.makeKeyboards();
+ mKeyboardSwitcher.makeKeyboards(true);
mInputView.setOnKeyboardActionListener(this);
mKeyboardSwitcher.setKeyboardMode(KeyboardSwitcher.MODE_TEXT, 0);
return mInputView;
@@ -236,7 +236,7 @@ public class LatinIME extends InputMethodService
@Override
public View onCreateCandidatesView() {
- mKeyboardSwitcher.makeKeyboards();
+ mKeyboardSwitcher.makeKeyboards(true);
mCandidateViewContainer = (CandidateViewContainer) getLayoutInflater().inflate(
R.layout.candidates, null);
mCandidateViewContainer.initViews();
@@ -253,7 +253,7 @@ public class LatinIME extends InputMethodService
return;
}
- mKeyboardSwitcher.makeKeyboards();
+ mKeyboardSwitcher.makeKeyboards(false);
TextEntryState.newSession(this);