diff options
author | 2010-09-02 23:26:06 -0700 | |
---|---|---|
committer | 2010-09-02 23:26:06 -0700 | |
commit | c5841994affbca41a7070a769f4f8e51bee4773b (patch) | |
tree | c2386736b24cd00fdda9f333880f03fe20a546bd /java/src/com/android/inputmethod/latin/KeyboardSwitcher.java | |
parent | c5d33b16521de56ad01b0b6308217efb009078b7 (diff) | |
parent | 41feaaadb758a8b31d3e436063b4b5faed104d4d (diff) | |
download | latinime-c5841994affbca41a7070a769f4f8e51bee4773b.tar.gz latinime-c5841994affbca41a7070a769f4f8e51bee4773b.tar.xz latinime-c5841994affbca41a7070a769f4f8e51bee4773b.zip |
Merge "Change symbol on space bar when autocompletion is activated" into gingerbread
Diffstat (limited to 'java/src/com/android/inputmethod/latin/KeyboardSwitcher.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/KeyboardSwitcher.java | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/java/src/com/android/inputmethod/latin/KeyboardSwitcher.java b/java/src/com/android/inputmethod/latin/KeyboardSwitcher.java index 9c0a5a3aa..2919e9b56 100644 --- a/java/src/com/android/inputmethod/latin/KeyboardSwitcher.java +++ b/java/src/com/android/inputmethod/latin/KeyboardSwitcher.java @@ -88,6 +88,9 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha private int mMode = MODE_NONE; /** One of the MODE_XXX values */ private int mImeOptions; private boolean mIsSymbols; + /** mIsAutoCompletionActive indicates that auto completed word will be input instead of + * what user actually typed. */ + private boolean mIsAutoCompletionActive; private boolean mHasVoice; private boolean mVoiceOnPrimary; private boolean mPreferSymbols; @@ -239,7 +242,7 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha keyboard.setShifted(false); keyboard.setShiftLocked(keyboard.isShiftLocked()); keyboard.setImeOptions(mContext.getResources(), mMode, imeOptions); - keyboard.setBlackFlag(isBlackSym()); + keyboard.setColorOfSymbolIcons(mIsAutoCompletionActive, isBlackSym()); } private LatinKeyboard getKeyboard(KeyboardId id) { @@ -249,12 +252,10 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha Locale saveLocale = conf.locale; conf.locale = mInputLocale; orig.updateConfiguration(conf, null); - LatinKeyboard keyboard = new LatinKeyboard( - mContext, id.mXml, id.mKeyboardMode); + LatinKeyboard keyboard = new LatinKeyboard(mContext, id.mXml, id.mKeyboardMode); keyboard.setVoiceMode(hasVoiceButton(id.mXml == R.xml.kbd_symbols || id.mXml == R.xml.kbd_symbols_black), mHasVoice); - keyboard.setLanguageSwitcher(mLanguageSwitcher); - keyboard.setBlackFlag(isBlackSym()); + keyboard.setLanguageSwitcher(mLanguageSwitcher, mIsAutoCompletionActive, isBlackSym()); if (id.mEnableShiftLock) { keyboard.enableShiftLock(); @@ -450,4 +451,12 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha } } + public void onAutoCompletionStateChanged(boolean isAutoCompletion) { + if (isAutoCompletion != mIsAutoCompletionActive) { + LatinKeyboardView keyboardView = getInputView(); + mIsAutoCompletionActive = isAutoCompletion; + keyboardView.invalidateKey(((LatinKeyboard) keyboardView.getKeyboard()) + .onAutoCompletionStateChanged(isAutoCompletion)); + } + } } |