diff options
| author | Tadashi G. Takaoka <takaoka@google.com> | 2012-01-26 18:03:30 +0900 |
|---|---|---|
| committer | Tadashi G. Takaoka <takaoka@google.com> | 2012-01-31 12:55:45 +0900 |
| commit | ca2f051cc173acc3bce384ebfe08068564bc8e07 (patch) | |
| tree | e6521ddbe372710fd703dac4574552e8b7e96e3c /java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java | |
| parent | 3b0f2bf169c23ea94c5a0adb275ce41b5c34ea83 (diff) | |
Auto generate various shift states alphabet keyboard automatically
If any shift state variants of alphabet keyboard layout is not
specified in KeyboardSet.Element, it will be automatically generated
from base alphabet keyboard definition.
This change also
* Eliminates KeyboardShiftState object from Keyboard.
* Removes various set shift state methods from Keyboard.
* Removes KeyboardSet.Element.elementAutoGenerate attribute.
* Separates "sticky" Key.backgroundType to "stickyOff" and "stickyOn"
* Add preserveCase flag to smiley, .com, and labeled special keys.
* Rename KeyboardShiftState class to AlphabetShiftState.
* Rename some attributes from *UppercaseLetter* to *ShiftedLetterHint*.
* Introduce shiftedLetterActivated to Key.keyLabelFlags
Change-Id: I01a0a8efeeaa76820ae728a5bdfa8d02b6ce74b7
Diffstat (limited to 'java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java')
| -rw-r--r-- | java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java b/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java index 5542bd32a..4af4e3cdf 100644 --- a/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java +++ b/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java @@ -70,7 +70,7 @@ public class KeyboardState { private String mLayoutSwitchBackSymbols; private boolean mIsAlphabetMode; - private KeyboardShiftState mAlphabetShiftState = new KeyboardShiftState(); + private AlphabetShiftState mAlphabetShiftState = new AlphabetShiftState(); private boolean mIsSymbolShifted; private boolean mPrevMainKeyboardWasShiftLocked; private boolean mPrevSymbolsKeyboardWasShifted; @@ -167,16 +167,16 @@ public class KeyboardState { } if (!mIsAlphabetMode) return; final int prevShiftMode; - if (mAlphabetShiftState.isAutomaticTemporaryUpperCase()) { + if (mAlphabetShiftState.isAutomaticShifted()) { prevShiftMode = AUTOMATIC_SHIFT; - } else if (mAlphabetShiftState.isManualTemporaryUpperCase()) { + } else if (mAlphabetShiftState.isManualShifted()) { prevShiftMode = MANUAL_SHIFT; } else { prevShiftMode = UNSHIFT; } switch (shiftMode) { case AUTOMATIC_SHIFT: - mAlphabetShiftState.setAutomaticTemporaryUpperCase(); + mAlphabetShiftState.setAutomaticShifted(); if (shiftMode != prevShiftMode) { mSwitchActions.setAlphabetAutomaticShiftedKeyboard(); } @@ -353,7 +353,7 @@ public class KeyboardState { // caps lock state and mark as if shift key pressed while normal state. setShifted(SHIFT_LOCK_SHIFTED); mShiftKeyState.onPress(); - } else if (mAlphabetShiftState.isAutomaticTemporaryUpperCase()) { + } else if (mAlphabetShiftState.isAutomaticShifted()) { // Shift key is pressed while automatic temporary upper case, we have to move to // manual temporary upper case. setShifted(MANUAL_SHIFT); @@ -400,7 +400,7 @@ public class KeyboardState { && mShiftKeyState.isPressingOnShifted() && !withSliding) { // Shift has been pressed without chording while shifted state. setShifted(UNSHIFT); - } else if (mAlphabetShiftState.isManualTemporaryUpperCaseFromAuto() + } else if (mAlphabetShiftState.isManualShiftedFromAutomaticShifted() && mShiftKeyState.isPressing() && !withSliding) { // Shift has been pressed without chording while manual temporary upper case // transited from automatic temporary upper case. |
