diff options
author | 2012-01-31 02:26:41 -0800 | |
---|---|---|
committer | 2012-01-31 02:26:41 -0800 | |
commit | 3feb99fa6c5cf4b0a7d0ed2536b8b0891af884bf (patch) | |
tree | 1776947608e2b8e36b727e032f1a35ffd4ca8005 /java/src | |
parent | aab33aac0a3f4755e6a533dea1025b450507e116 (diff) | |
parent | 49bd49c8fbc394d277e89e8d105450d3e2818f50 (diff) | |
download | latinime-3feb99fa6c5cf4b0a7d0ed2536b8b0891af884bf.tar.gz latinime-3feb99fa6c5cf4b0a7d0ed2536b8b0891af884bf.tar.xz latinime-3feb99fa6c5cf4b0a7d0ed2536b8b0891af884bf.zip |
Merge "Save/restore alphabet shift locked state while rotating even in symbols mode"
Diffstat (limited to 'java/src')
-rw-r--r-- | java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java b/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java index 19c644d1f..1de83866f 100644 --- a/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java +++ b/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java @@ -87,14 +87,14 @@ public class KeyboardState { static class SavedKeyboardState { public boolean mIsValid; public boolean mIsAlphabetMode; - public boolean mIsShiftLocked; + public boolean mIsAlphabetShiftLocked; public boolean mIsShifted; @Override public String toString() { if (!mIsValid) return "INVALID"; if (mIsAlphabetMode) { - if (mIsShiftLocked) return "ALPHABET_SHIFT_LOCKED"; + if (mIsAlphabetShiftLocked) return "ALPHABET_SHIFT_LOCKED"; return mIsShifted ? "ALPHABET_SHIFTED" : "ALPHABET"; } else { return mIsShifted ? "SYMBOLS_SHIFTED" : "SYMBOLS"; @@ -124,11 +124,11 @@ public class KeyboardState { final SavedKeyboardState state = mSavedKeyboardState; state.mIsAlphabetMode = mIsAlphabetMode; if (mIsAlphabetMode) { - state.mIsShiftLocked = mAlphabetShiftState.isShiftLocked(); - state.mIsShifted = !state.mIsShiftLocked + state.mIsAlphabetShiftLocked = mAlphabetShiftState.isShiftLocked(); + state.mIsShifted = !state.mIsAlphabetShiftLocked && mAlphabetShiftState.isShiftedOrShiftLocked(); } else { - state.mIsShiftLocked = false; + state.mIsAlphabetShiftLocked = mPrevMainKeyboardWasShiftLocked; state.mIsShifted = mIsSymbolShifted; } state.mIsValid = true; @@ -156,10 +156,12 @@ public class KeyboardState { state.mIsValid = false; if (state.mIsAlphabetMode) { - setShiftLocked(state.mIsShiftLocked); - if (!state.mIsShiftLocked) { + setShiftLocked(state.mIsAlphabetShiftLocked); + if (!state.mIsAlphabetShiftLocked) { setShifted(state.mIsShifted ? MANUAL_SHIFT : UNSHIFT); } + } else { + mPrevMainKeyboardWasShiftLocked = state.mIsAlphabetShiftLocked; } } |