diff options
Diffstat (limited to 'java/src')
-rw-r--r-- | java/src/com/android/inputmethod/latin/BaseKeyboardView.java | 9 | ||||
-rw-r--r-- | java/src/com/android/inputmethod/latin/KeyboardSwitcher.java | 19 |
2 files changed, 20 insertions, 8 deletions
diff --git a/java/src/com/android/inputmethod/latin/BaseKeyboardView.java b/java/src/com/android/inputmethod/latin/BaseKeyboardView.java index 8efd0ae9a..d98cd04b2 100644 --- a/java/src/com/android/inputmethod/latin/BaseKeyboardView.java +++ b/java/src/com/android/inputmethod/latin/BaseKeyboardView.java @@ -259,10 +259,7 @@ public class BaseKeyboardView extends View implements PointerTracker.UIProxy { private final int KEY_LABEL_OPTION_ALIGN_LEFT = 1; private final int KEY_LABEL_OPTION_ALIGN_RIGHT = 2; private final int KEY_LABEL_OPTION_ALIGN_BOTTOM = 8; - private final int KEY_LABEL_OPTION_FONT_ITALIC = 16; - // TODO: Currently we don't have san-serif italic type face. This is actually san-serif - // non-italic type face. - private final Typeface TYPEFACE_ITALIC = Typeface.create(Typeface.SANS_SERIF, Typeface.ITALIC); + private final int KEY_LABEL_OPTION_FONT_NORMAL = 16; private final UIHandler mHandler = new UIHandler(); @@ -825,8 +822,8 @@ public class BaseKeyboardView extends View implements PointerTracker.UIProxy { final int labelSize; if (label.length() > 1 && key.codes.length < 2) { labelSize = mLabelTextSize; - if ((key.labelOption & KEY_LABEL_OPTION_FONT_ITALIC) != 0) { - paint.setTypeface(TYPEFACE_ITALIC); + if ((key.labelOption & KEY_LABEL_OPTION_FONT_NORMAL) != 0) { + paint.setTypeface(Typeface.DEFAULT); } else { paint.setTypeface(Typeface.DEFAULT_BOLD); } diff --git a/java/src/com/android/inputmethod/latin/KeyboardSwitcher.java b/java/src/com/android/inputmethod/latin/KeyboardSwitcher.java index 08ff41b6f..f1f8dc27d 100644 --- a/java/src/com/android/inputmethod/latin/KeyboardSwitcher.java +++ b/java/src/com/android/inputmethod/latin/KeyboardSwitcher.java @@ -412,8 +412,17 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha private void setManualTemporaryUpperCase(boolean shifted) { LatinKeyboard latinKeyboard = getLatinKeyboard(); - if (latinKeyboard != null && latinKeyboard.setShifted(shifted)) { - mInputView.invalidateAllKeys(); + if (latinKeyboard != null) { + // On non-distinct multi touch panel device, we should also turn off the shift locked + // state when shift key is pressed to go to normal mode. + // On the other hand, on distinct multi touch panel device, turning off the shift locked + // state with shift key pressing is handled by onReleaseShift(). + if (!hasDistinctMultitouch() && !shifted && latinKeyboard.isShiftLocked()) { + latinKeyboard.setShiftLocked(false); + } + if (latinKeyboard.setShifted(shifted)) { + mInputView.invalidateAllKeys(); + } } } @@ -424,6 +433,9 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha } } + /** + * Toggle keyboard shift state triggered by user touch event. + */ public void toggleShift() { mInputMethodService.mHandler.cancelUpdateShiftState(); if (DEBUG_STATE) @@ -463,6 +475,9 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha } } + /** + * Update keyboard shift state triggered by connected EditText status change. + */ public void updateShiftState() { final ShiftKeyState shiftKeyState = mShiftKeyState; if (DEBUG_STATE) |