aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmith Yamasani <yamasani@google.com>2010-02-21 15:59:15 -0800
committerAmith Yamasani <yamasani@google.com>2010-02-21 18:11:39 -0800
commita9f4b19ca409f55a88f7dbe0e8b1c17a37717ac7 (patch)
treee007e7a598fb727e16f5c7e8b799c55b13d6d20a
parenta6a6617101a647235a7d94726e4a7a0d48e5007b (diff)
downloadlatinime-a9f4b19ca409f55a88f7dbe0e8b1c17a37717ac7.tar.gz
latinime-a9f4b19ca409f55a88f7dbe0e8b1c17a37717ac7.tar.xz
latinime-a9f4b19ca409f55a88f7dbe0e8b1c17a37717ac7.zip
Switch keyboards when configuration changes. Bug 2432435
-rw-r--r--src/com/android/inputmethod/latin/LatinIME.java14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/com/android/inputmethod/latin/LatinIME.java b/src/com/android/inputmethod/latin/LatinIME.java
index 0f91c3b65..bcd190bfd 100644
--- a/src/com/android/inputmethod/latin/LatinIME.java
+++ b/src/com/android/inputmethod/latin/LatinIME.java
@@ -360,8 +360,18 @@ public class LatinIME extends InputMethodService
@Override
public void onConfigurationChanged(Configuration conf) {
+ // If the system locale changes and is different from the saved
+ // locale (mLocale), then reload the input locale list from the
+ // latin ime settings (shared prefs) and reset the input locale
+ // to the first one.
if (!TextUtils.equals(conf.locale.toString(), mLocale)) {
- initSuggest(conf.locale.toString());
+ if (mLanguageSwitcher != null) {
+ mLanguageSwitcher.loadLocales(
+ PreferenceManager.getDefaultSharedPreferences(this));
+ toggleLanguage(true, true);
+ } else {
+ reloadKeyboards();
+ }
}
// If orientation changed while predicting, commit the change
if (conf.orientation != mOrientation) {
@@ -369,8 +379,8 @@ public class LatinIME extends InputMethodService
commitTyped(ic);
if (ic != null) ic.finishComposingText(); // For voice input
mOrientation = conf.orientation;
+ reloadKeyboards();
}
- reloadKeyboards();
super.onConfigurationChanged(conf);
}