diff --git a/src/com/android/inputmethod/latin/KeyboardSwitcher.java b/src/com/android/inputmethod/latin/KeyboardSwitcher.java index 16dd7b9a7..2da703632 100644 --- a/src/com/android/inputmethod/latin/KeyboardSwitcher.java +++ b/src/com/android/inputmethod/latin/KeyboardSwitcher.java @@ -54,6 +54,7 @@ public class KeyboardSwitcher { private int mImeOptions; private int mTextMode = MODE_TEXT_QWERTY; private boolean mIsSymbols; + private boolean mPreferSymbols; private int mSymbolsModeState = SYMBOLS_MODE_STATE_NONE; private int mLastDisplayWidth; @@ -114,7 +115,10 @@ public class KeyboardSwitcher { } void setKeyboardMode(int mode, int imeOptions) { - setKeyboardMode(mode, imeOptions, false); + mSymbolsModeState = SYMBOLS_MODE_STATE_NONE; + mPreferSymbols = mode == MODE_SYMBOLS; + setKeyboardMode(mode == MODE_SYMBOLS ? MODE_TEXT : mode, imeOptions, + mPreferSymbols); } void setKeyboardMode(int mode, int imeOptions, boolean isSymbols) { @@ -233,7 +237,7 @@ public class KeyboardSwitcher { void toggleSymbols() { setKeyboardMode(mMode, mImeOptions, !mIsSymbols); - if (mIsSymbols) { + if (mIsSymbols && !mPreferSymbols) { mSymbolsModeState = SYMBOLS_MODE_STATE_BEGIN; } else { mSymbolsModeState = SYMBOLS_MODE_STATE_NONE; diff --git a/src/com/android/inputmethod/latin/LatinIME.java b/src/com/android/inputmethod/latin/LatinIME.java index 01d70df6c..49ae93e48 100644 --- a/src/com/android/inputmethod/latin/LatinIME.java +++ b/src/com/android/inputmethod/latin/LatinIME.java @@ -260,9 +260,8 @@ public class LatinIME extends InputMethodService switch (attribute.inputType&EditorInfo.TYPE_MASK_CLASS) { case EditorInfo.TYPE_CLASS_NUMBER: case EditorInfo.TYPE_CLASS_DATETIME: - mKeyboardSwitcher.setKeyboardMode(KeyboardSwitcher.MODE_TEXT, + mKeyboardSwitcher.setKeyboardMode(KeyboardSwitcher.MODE_SYMBOLS, attribute.imeOptions); - mKeyboardSwitcher.toggleSymbols(); break; case EditorInfo.TYPE_CLASS_PHONE: mKeyboardSwitcher.setKeyboardMode(KeyboardSwitcher.MODE_PHONE,