diff options
Diffstat (limited to 'java/src/com/android/inputmethod/latin/LatinIME.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/LatinIME.java | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index c5f7dd2c7..3457ac984 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -151,6 +151,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar private UserDictionary mUserDictionary; private UserBigramDictionary mUserBigramDictionary; private UserUnigramDictionary mUserUnigramDictionary; + private boolean mIsUserDictionaryAvaliable; // TODO: Create an inner class to group options and pseudo-options to improve readability. // These variables are initialized according to the {@link EditorInfo#inputType}. @@ -504,6 +505,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar mUserDictionary = new UserDictionary(this, localeStr); mSuggest.setUserDictionary(mUserDictionary); + mIsUserDictionaryAvaliable = mUserDictionary.isEnabled(); resetContactsDictionary(); @@ -645,9 +647,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar LanguageSwitcherProxy.loadSettings(); if (mSubtypeSwitcher.isKeyboardMode()) { - switcher.loadKeyboard(attribute, - mSubtypeSwitcher.isShortcutImeEnabled() && voiceIme.isVoiceButtonEnabled(), - voiceIme.isVoiceButtonOnPrimary()); + switcher.loadKeyboard(attribute, mSettingsValues); switcher.updateShiftState(); } @@ -1763,7 +1763,11 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar // take a noticeable delay to update them which may feel uneasy. } if (showingAddToDictionaryHint) { - mCandidateView.showAddToDictionaryHint(suggestion); + if (mIsUserDictionaryAvaliable) { + mCandidateView.showAddToDictionaryHint(suggestion); + } else { + mHandler.postUpdateSuggestions(); + } } if (ic != null) { ic.endBatchEdit(); @@ -1966,9 +1970,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar setInputView(mKeyboardSwitcher.onCreateInputView()); } // Reload keyboard because the current language has been changed. - mKeyboardSwitcher.loadKeyboard(getCurrentInputEditorInfo(), - mSubtypeSwitcher.isShortcutImeEnabled() && mVoiceProxy.isVoiceButtonEnabled(), - mVoiceProxy.isVoiceButtonOnPrimary()); + mKeyboardSwitcher.loadKeyboard(getCurrentInputEditorInfo(), mSettingsValues); initSuggest(); loadSettings(); mKeyboardSwitcher.updateShiftState(); |