diff options
author | 2010-09-15 13:37:52 +0900 | |
---|---|---|
committer | 2010-09-16 02:48:10 +0900 | |
commit | 1508c0e84f0cd93ab6f5d46fea5026e833f299bc (patch) | |
tree | a2755c38c6839d205e610ba19bd1c3819d4c760d /java/src/com/android/inputmethod/latin/LatinIME.java | |
parent | dd5d4e378a774773678791eab9aed552fd444cd9 (diff) | |
download | latinime-1508c0e84f0cd93ab6f5d46fea5026e833f299bc.tar.gz latinime-1508c0e84f0cd93ab6f5d46fea5026e833f299bc.tar.xz latinime-1508c0e84f0cd93ab6f5d46fea5026e833f299bc.zip |
Add a new preference item to show/hide the settings key.
bug: 2998722
Change-Id: Iac1641c338388fd8f85e0cf47e31afdaeb34c0c0
Diffstat (limited to 'java/src/com/android/inputmethod/latin/LatinIME.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/LatinIME.java | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index f80ecc6d4..ecfd41651 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -356,7 +356,7 @@ public class LatinIME extends InputMethodService final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this); mLanguageSwitcher = new LanguageSwitcher(this); mLanguageSwitcher.loadLocales(prefs); - mKeyboardSwitcher = new KeyboardSwitcher(this, this); + mKeyboardSwitcher = new KeyboardSwitcher(this); mKeyboardSwitcher.setLanguageSwitcher(mLanguageSwitcher); mSystemLocale = conf.locale.toString(); mLanguageSwitcher.setSystemLocale(conf.locale); @@ -984,7 +984,7 @@ public class LatinIME extends InputMethodService private void reloadKeyboards() { if (mKeyboardSwitcher == null) { - mKeyboardSwitcher = new KeyboardSwitcher(this, this); + mKeyboardSwitcher = new KeyboardSwitcher(this); } mKeyboardSwitcher.setLanguageSwitcher(mLanguageSwitcher); if (mKeyboardSwitcher.getInputView() != null @@ -1122,11 +1122,6 @@ public class LatinIME extends InputMethodService } } - private boolean hasMultipleEnabledIMEs() { - return ((InputMethodManager) getSystemService( - INPUT_METHOD_SERVICE)).getEnabledInputMethodList().size() > 1; - } - private void showInputMethodPicker() { ((InputMethodManager) getSystemService(INPUT_METHOD_SERVICE)) .showInputMethodPicker(); @@ -1134,7 +1129,7 @@ public class LatinIME extends InputMethodService private void onOptionKeyPressed() { if (!isShowingOptionDialog()) { - if (hasMultipleEnabledIMEs()) { + if (LatinIMEUtil.hasMultipleEnabledIMEs(this)) { showOptionsMenu(); } else { launchSettings(); @@ -1144,7 +1139,7 @@ public class LatinIME extends InputMethodService private void onOptionKeyLongPressed() { if (!isShowingOptionDialog()) { - if (hasMultipleEnabledIMEs()) { + if (LatinIMEUtil.hasMultipleEnabledIMEs(this)) { showInputMethodPicker(); } else { launchSettings(); |