diff options
author | 2010-11-13 00:16:34 -0800 | |
---|---|---|
committer | 2010-11-18 19:32:59 -0800 | |
commit | f27364600c742509b48857e6b8f17312033e0dc7 (patch) | |
tree | a07e3d98753fac073d34a643957204beaadcd4c4 /java/src/com/android/inputmethod/latin/BaseKeyboardView.java | |
parent | 1d2d3228a393b3c562226936e3523eed4894def4 (diff) | |
download | latinime-f27364600c742509b48857e6b8f17312033e0dc7.tar.gz latinime-f27364600c742509b48857e6b8f17312033e0dc7.tar.xz latinime-f27364600c742509b48857e6b8f17312033e0dc7.zip |
Implement both automatic and manual temporary upper cases
With this change,
- Shift and Shift lock state of keyboard is maintained by
LatinKeyboard.ShiftState.
- Shift key state is maintained by ShiftKeyState object in
KeyboardSwitcher.
- LatinIME informs KeyboardSwitcher that shift key press, release and
long press and KeyboardSwitcher determines which state LatinKeyboard
and ShiftLeyState should be.
Bug: 3193390
Change-Id: I948ef26fda512eb1cb0ebddc89d322c4f4f4d670
Diffstat (limited to 'java/src/com/android/inputmethod/latin/BaseKeyboardView.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/BaseKeyboardView.java | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/java/src/com/android/inputmethod/latin/BaseKeyboardView.java b/java/src/com/android/inputmethod/latin/BaseKeyboardView.java index ad0e8d41a..89c9572b1 100644 --- a/java/src/com/android/inputmethod/latin/BaseKeyboardView.java +++ b/java/src/com/android/inputmethod/latin/BaseKeyboardView.java @@ -683,7 +683,7 @@ public class BaseKeyboardView extends View implements PointerTracker.UIProxy { } protected CharSequence adjustCase(CharSequence label) { - if (mKeyboard.isShifted() && label != null && label.length() < 3 + if (mKeyboard.isShiftedOrShiftLocked() && label != null && label.length() < 3 && Character.isLowerCase(label.charAt(0))) { label = label.toString().toUpperCase(); } @@ -772,8 +772,8 @@ public class BaseKeyboardView extends View implements PointerTracker.UIProxy { final int kbdPaddingTop = getPaddingTop(); final Key[] keys = mKeys; final Key invalidKey = mInvalidatedKey; - final boolean isTemporaryUpperCase = (mKeyboard instanceof LatinKeyboard - && ((LatinKeyboard)mKeyboard).isTemporaryUpperCase()); + final boolean isManualTemporaryUpperCase = (mKeyboard instanceof LatinKeyboard + && ((LatinKeyboard)mKeyboard).isManualTemporaryUpperCase()); paint.setColor(mKeyTextColor); boolean drawSingleKey = false; @@ -853,7 +853,7 @@ public class BaseKeyboardView extends View implements PointerTracker.UIProxy { int drawableHeight = key.height; int drawableX = 0; int drawableY = HINT_ICON_VERTICAL_ADJUSTMENT_PIXEL; - Drawable icon = (isTemporaryUpperCase + Drawable icon = (isManualTemporaryUpperCase && key.manualTemporaryUpperCaseHintIcon != null) ? key.manualTemporaryUpperCaseHintIcon : key.hintIcon; drawIcon(canvas, icon, drawableX, drawableY, drawableWidth, drawableHeight); @@ -1226,7 +1226,7 @@ public class BaseKeyboardView extends View implements PointerTracker.UIProxy { // TODO: change the below line to use getLatinKeyboard() instead of getKeyboard() BaseKeyboard baseMiniKeyboard = mMiniKeyboard.getKeyboard(); if (baseMiniKeyboard != null && baseMiniKeyboard.setShifted(mKeyboard == null - ? false : mKeyboard.isShifted())) { + ? false : mKeyboard.isShiftedOrShiftLocked())) { mMiniKeyboard.invalidateAllKeys(); } // Mini keyboard needs no pop-up key preview displayed. |