diff options
author | 2012-11-06 14:29:45 -0800 | |
---|---|---|
committer | 2012-11-06 14:29:45 -0800 | |
commit | aa5d6fe05ce45e36b732a3abc849508cd8279257 (patch) | |
tree | d47d1f3479b12d440cbe257838b8b3be638685b3 /java/src | |
parent | 4d09554794ace67b01a6674c36edd5495b32cc38 (diff) | |
parent | 9cc22c45ec04f3b1772631e1ef18103dc55c2a0b (diff) | |
download | latinime-aa5d6fe05ce45e36b732a3abc849508cd8279257.tar.gz latinime-aa5d6fe05ce45e36b732a3abc849508cd8279257.tar.xz latinime-aa5d6fe05ce45e36b732a3abc849508cd8279257.zip |
am 9cc22c45: am 5d2556b9: Reset the IME if requested by the app.
* commit '9cc22c45ec04f3b1772631e1ef18103dc55c2a0b':
Reset the IME if requested by the app.
Diffstat (limited to 'java/src')
3 files changed, 35 insertions, 0 deletions
diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java b/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java index 38025e8e4..de8097b55 100644 --- a/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java +++ b/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java @@ -200,6 +200,12 @@ public final class KeyboardSwitcher implements KeyboardState.SwitchActions { mState.onUpdateShiftState(mLatinIME.getCurrentAutoCapsState()); } + // TODO: Remove this method. Come up with a more comprehensive way to reset the keyboard layout + // when a keyboard layout set doesn't get reloaded in LatinIME.onStartInputViewInternal(). + public void resetKeyboardStateToAlphabet() { + mState.onResetKeyboardStateToAlphabet(); + } + public void onPressKey(int code) { if (isVibrateAndSoundFeedbackRequired()) { mLatinIME.hapticAndAudioFeedback(code); diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java b/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java index 58cc8972a..5e111fb9a 100644 --- a/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java +++ b/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java @@ -254,6 +254,22 @@ public final class KeyboardState { } } + // TODO: Remove this method. Come up with a more comprehensive way to reset the keyboard layout + // when a keyboard layout set doesn't get reloaded in LatinIME.onStartInputViewInternal(). + private void resetKeyboardStateToAlphabet() { + if (DEBUG_ACTION) { + Log.d(TAG, "resetKeyboardStateToAlphabet: " + this); + } + if (mIsAlphabetMode) return; + + mPrevSymbolsKeyboardWasShifted = mIsSymbolShifted; + setAlphabetKeyboard(); + if (mPrevMainKeyboardWasShiftLocked) { + setShiftLocked(true); + } + mPrevMainKeyboardWasShiftLocked = false; + } + private void toggleShiftInSymbols() { if (mIsSymbolShifted) { setSymbolsKeyboard(); @@ -380,6 +396,15 @@ public final class KeyboardState { updateAlphabetShiftState(autoCaps); } + // TODO: Remove this method. Come up with a more comprehensive way to reset the keyboard layout + // when a keyboard layout set doesn't get reloaded in LatinIME.onStartInputViewInternal(). + public void onResetKeyboardStateToAlphabet() { + if (DEBUG_EVENT) { + Log.d(TAG, "onResetKeyboardStateToAlphabet: " + this); + } + resetKeyboardStateToAlphabet(); + } + private void updateAlphabetShiftState(int autoCaps) { if (!mIsAlphabetMode) return; if (!mShiftKeyState.isReleasing()) { diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index 8ac0cd4ca..cf7eea70b 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -732,6 +732,10 @@ public final class LatinIME extends InputMethodService implements KeyboardAction } switcher.loadKeyboard(editorInfo, mCurrentSettings); + } else if (restarting) { + // TODO: Come up with a more comprehensive way to reset the keyboard layout when + // a keyboard layout set doesn't get reloaded in this method. + switcher.resetKeyboardStateToAlphabet(); } setSuggestionStripShownInternal( isSuggestionsStripVisible(), /* needsInputViewShown */ false); |