Loading java/src/com/android/inputmethod/keyboard/Keyboard.java +5 −16 Original line number Diff line number Diff line Loading @@ -112,7 +112,8 @@ public class Keyboard { public final KeyboardIconsSet mIconsSet; private final Map<Integer, Key> mKeyCache = new HashMap<Integer, Key>(); private final KeyboardShiftState mShiftState = new KeyboardShiftState(); // TODO: Move this state to KeyboardSwitcher /* package for debug */ final KeyboardShiftState mShiftState = new KeyboardShiftState(); private final ProximityInfo mProximityInfo; Loading Loading @@ -211,27 +212,15 @@ public class Keyboard { } public boolean isAutomaticTemporaryUpperCase() { return isAlphaKeyboard() && mShiftState.isAutomaticTemporaryUpperCase(); return mId.isAlphabetKeyboard() && mShiftState.isAutomaticTemporaryUpperCase(); } public boolean isManualTemporaryUpperCase() { return isAlphaKeyboard() && mShiftState.isManualTemporaryUpperCase(); return mId.isAlphabetKeyboard() && mShiftState.isManualTemporaryUpperCase(); } public boolean isManualTemporaryUpperCaseFromAuto() { return isAlphaKeyboard() && mShiftState.isManualTemporaryUpperCaseFromAuto(); } public KeyboardShiftState getKeyboardShiftState() { return mShiftState; } public boolean isAlphaKeyboard() { return mId.isAlphabetKeyboard(); } public boolean isPhoneKeyboard() { return mId.isPhoneKeyboard(); return mId.isAlphabetKeyboard() && mShiftState.isManualTemporaryUpperCaseFromAuto(); } public CharSequence adjustLabelCase(CharSequence label) { Loading java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java +9 −9 Original line number Diff line number Diff line Loading @@ -451,7 +451,7 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha mInputMethodService.mHandler.cancelUpdateShiftState(); if (DEBUG_STATE) { Log.d(TAG, "toggleShift:" + " keyboard=" + getLatinKeyboard().getKeyboardShiftState() + " keyboard=" + getLatinKeyboard().mShiftState + " state=" + mState); } if (isAlphabetMode()) { Loading @@ -465,7 +465,7 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha mInputMethodService.mHandler.cancelUpdateShiftState(); if (DEBUG_STATE) { Log.d(TAG, "toggleCapsLock:" + " keyboard=" + getLatinKeyboard().getKeyboardShiftState() + " keyboard=" + getLatinKeyboard().mShiftState + " state=" + mState); } if (isAlphabetMode()) { Loading @@ -483,7 +483,7 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha public void changeKeyboardMode() { if (DEBUG_STATE) { Log.d(TAG, "changeKeyboardMode:" + " keyboard=" + getLatinKeyboard().getKeyboardShiftState() + " keyboard=" + getLatinKeyboard().mShiftState + " state=" + mState); } toggleKeyboardMode(); Loading @@ -508,7 +508,7 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha if (DEBUG_STATE) { Log.d(TAG, "updateShiftState:" + " autoCaps=" + mInputMethodService.getCurrentAutoCapsState() + " keyboard=" + getLatinKeyboard().getKeyboardShiftState() + " keyboard=" + getLatinKeyboard().mShiftState + " isAlphabetMode=" + isAlphabetMode + " isShiftLocked=" + isShiftLocked + " state=" + mState); Loading @@ -531,7 +531,7 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha return; if (DEBUG_STATE) { Log.d(TAG, "onPressShift:" + " keyboard=" + getLatinKeyboard().getKeyboardShiftState() + " keyboard=" + getLatinKeyboard().mShiftState + " state=" + mState + " sliding=" + withSliding); } final boolean isAlphabetMode = isAlphabetMode(); Loading Loading @@ -568,7 +568,7 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha return; if (DEBUG_STATE) { Log.d(TAG, "onReleaseShift:" + " keyboard=" + getLatinKeyboard().getKeyboardShiftState() + " keyboard=" + getLatinKeyboard().mShiftState + " state=" + mState + " sliding=" + withSliding); } final boolean isAlphabetMode = isAlphabetMode(); Loading Loading @@ -613,7 +613,7 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha public void onPressSymbol() { if (DEBUG_STATE) { Log.d(TAG, "onPressSymbol:" + " keyboard=" + getLatinKeyboard().getKeyboardShiftState() + " keyboard=" + getLatinKeyboard().mShiftState + " state=" + mState); } changeKeyboardMode(); Loading @@ -624,7 +624,7 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha public void onReleaseSymbol() { if (DEBUG_STATE) { Log.d(TAG, "onReleaseSymbol:" + " keyboard=" + getLatinKeyboard().getKeyboardShiftState() + " keyboard=" + getLatinKeyboard().mShiftState + " state=" + mState); } // Snap back to the previous keyboard mode if the user chords the mode change key and Loading @@ -638,7 +638,7 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha public void onOtherKeyPressed() { if (DEBUG_STATE) { Log.d(TAG, "onOtherKeyPressed:" + " keyboard=" + getLatinKeyboard().getKeyboardShiftState() + " keyboard=" + getLatinKeyboard().mShiftState + " state=" + mState); } mState.onOtherKeyPressed(); Loading java/src/com/android/inputmethod/keyboard/LatinKeyboard.java +1 −1 Original line number Diff line number Diff line Loading @@ -176,7 +176,7 @@ public class LatinKeyboard extends Keyboard { @Override public CharSequence adjustLabelCase(CharSequence label) { if (isAlphaKeyboard() && isShiftedOrShiftLocked() && !TextUtils.isEmpty(label) if (mId.isAlphabetKeyboard() && isShiftedOrShiftLocked() && !TextUtils.isEmpty(label) && label.length() < 3 && Character.isLowerCase(label.charAt(0))) { return label.toString().toUpperCase(mId.mLocale); } Loading java/src/com/android/inputmethod/keyboard/LatinKeyboardView.java +3 −3 Original line number Diff line number Diff line Loading @@ -177,7 +177,7 @@ public class LatinKeyboardView extends KeyboardView implements PointerTracker.Ke public boolean onDoubleTap(MotionEvent firstDown) { final Keyboard keyboard = getKeyboard(); if (ENABLE_CAPSLOCK_BY_DOUBLETAP && keyboard instanceof LatinKeyboard && ((LatinKeyboard) keyboard).isAlphaKeyboard()) { && ((LatinKeyboard) keyboard).mId.isAlphabetKeyboard()) { final int pointerIndex = firstDown.getActionIndex(); final int id = firstDown.getPointerId(pointerIndex); final PointerTracker tracker = getPointerTracker(id); Loading Loading @@ -396,14 +396,14 @@ public class LatinKeyboardView extends KeyboardView implements PointerTracker.Ke final Keyboard keyboard = getKeyboard(); if (keyboard instanceof LatinKeyboard) { final LatinKeyboard latinKeyboard = (LatinKeyboard) keyboard; if (primaryCode == Keyboard.CODE_DIGIT0 && latinKeyboard.isPhoneKeyboard()) { if (primaryCode == Keyboard.CODE_DIGIT0 && latinKeyboard.mId.isPhoneKeyboard()) { tracker.onLongPressed(); // Long pressing on 0 in phone number keypad gives you a '+'. invokeCodeInput(Keyboard.CODE_PLUS); invokeReleaseKey(primaryCode); return true; } if (primaryCode == Keyboard.CODE_SHIFT && latinKeyboard.isAlphaKeyboard()) { if (primaryCode == Keyboard.CODE_SHIFT && latinKeyboard.mId.isAlphabetKeyboard()) { tracker.onLongPressed(); invokeCodeInput(Keyboard.CODE_CAPSLOCK); invokeReleaseKey(primaryCode); Loading Loading
java/src/com/android/inputmethod/keyboard/Keyboard.java +5 −16 Original line number Diff line number Diff line Loading @@ -112,7 +112,8 @@ public class Keyboard { public final KeyboardIconsSet mIconsSet; private final Map<Integer, Key> mKeyCache = new HashMap<Integer, Key>(); private final KeyboardShiftState mShiftState = new KeyboardShiftState(); // TODO: Move this state to KeyboardSwitcher /* package for debug */ final KeyboardShiftState mShiftState = new KeyboardShiftState(); private final ProximityInfo mProximityInfo; Loading Loading @@ -211,27 +212,15 @@ public class Keyboard { } public boolean isAutomaticTemporaryUpperCase() { return isAlphaKeyboard() && mShiftState.isAutomaticTemporaryUpperCase(); return mId.isAlphabetKeyboard() && mShiftState.isAutomaticTemporaryUpperCase(); } public boolean isManualTemporaryUpperCase() { return isAlphaKeyboard() && mShiftState.isManualTemporaryUpperCase(); return mId.isAlphabetKeyboard() && mShiftState.isManualTemporaryUpperCase(); } public boolean isManualTemporaryUpperCaseFromAuto() { return isAlphaKeyboard() && mShiftState.isManualTemporaryUpperCaseFromAuto(); } public KeyboardShiftState getKeyboardShiftState() { return mShiftState; } public boolean isAlphaKeyboard() { return mId.isAlphabetKeyboard(); } public boolean isPhoneKeyboard() { return mId.isPhoneKeyboard(); return mId.isAlphabetKeyboard() && mShiftState.isManualTemporaryUpperCaseFromAuto(); } public CharSequence adjustLabelCase(CharSequence label) { Loading
java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java +9 −9 Original line number Diff line number Diff line Loading @@ -451,7 +451,7 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha mInputMethodService.mHandler.cancelUpdateShiftState(); if (DEBUG_STATE) { Log.d(TAG, "toggleShift:" + " keyboard=" + getLatinKeyboard().getKeyboardShiftState() + " keyboard=" + getLatinKeyboard().mShiftState + " state=" + mState); } if (isAlphabetMode()) { Loading @@ -465,7 +465,7 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha mInputMethodService.mHandler.cancelUpdateShiftState(); if (DEBUG_STATE) { Log.d(TAG, "toggleCapsLock:" + " keyboard=" + getLatinKeyboard().getKeyboardShiftState() + " keyboard=" + getLatinKeyboard().mShiftState + " state=" + mState); } if (isAlphabetMode()) { Loading @@ -483,7 +483,7 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha public void changeKeyboardMode() { if (DEBUG_STATE) { Log.d(TAG, "changeKeyboardMode:" + " keyboard=" + getLatinKeyboard().getKeyboardShiftState() + " keyboard=" + getLatinKeyboard().mShiftState + " state=" + mState); } toggleKeyboardMode(); Loading @@ -508,7 +508,7 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha if (DEBUG_STATE) { Log.d(TAG, "updateShiftState:" + " autoCaps=" + mInputMethodService.getCurrentAutoCapsState() + " keyboard=" + getLatinKeyboard().getKeyboardShiftState() + " keyboard=" + getLatinKeyboard().mShiftState + " isAlphabetMode=" + isAlphabetMode + " isShiftLocked=" + isShiftLocked + " state=" + mState); Loading @@ -531,7 +531,7 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha return; if (DEBUG_STATE) { Log.d(TAG, "onPressShift:" + " keyboard=" + getLatinKeyboard().getKeyboardShiftState() + " keyboard=" + getLatinKeyboard().mShiftState + " state=" + mState + " sliding=" + withSliding); } final boolean isAlphabetMode = isAlphabetMode(); Loading Loading @@ -568,7 +568,7 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha return; if (DEBUG_STATE) { Log.d(TAG, "onReleaseShift:" + " keyboard=" + getLatinKeyboard().getKeyboardShiftState() + " keyboard=" + getLatinKeyboard().mShiftState + " state=" + mState + " sliding=" + withSliding); } final boolean isAlphabetMode = isAlphabetMode(); Loading Loading @@ -613,7 +613,7 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha public void onPressSymbol() { if (DEBUG_STATE) { Log.d(TAG, "onPressSymbol:" + " keyboard=" + getLatinKeyboard().getKeyboardShiftState() + " keyboard=" + getLatinKeyboard().mShiftState + " state=" + mState); } changeKeyboardMode(); Loading @@ -624,7 +624,7 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha public void onReleaseSymbol() { if (DEBUG_STATE) { Log.d(TAG, "onReleaseSymbol:" + " keyboard=" + getLatinKeyboard().getKeyboardShiftState() + " keyboard=" + getLatinKeyboard().mShiftState + " state=" + mState); } // Snap back to the previous keyboard mode if the user chords the mode change key and Loading @@ -638,7 +638,7 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha public void onOtherKeyPressed() { if (DEBUG_STATE) { Log.d(TAG, "onOtherKeyPressed:" + " keyboard=" + getLatinKeyboard().getKeyboardShiftState() + " keyboard=" + getLatinKeyboard().mShiftState + " state=" + mState); } mState.onOtherKeyPressed(); Loading
java/src/com/android/inputmethod/keyboard/LatinKeyboard.java +1 −1 Original line number Diff line number Diff line Loading @@ -176,7 +176,7 @@ public class LatinKeyboard extends Keyboard { @Override public CharSequence adjustLabelCase(CharSequence label) { if (isAlphaKeyboard() && isShiftedOrShiftLocked() && !TextUtils.isEmpty(label) if (mId.isAlphabetKeyboard() && isShiftedOrShiftLocked() && !TextUtils.isEmpty(label) && label.length() < 3 && Character.isLowerCase(label.charAt(0))) { return label.toString().toUpperCase(mId.mLocale); } Loading
java/src/com/android/inputmethod/keyboard/LatinKeyboardView.java +3 −3 Original line number Diff line number Diff line Loading @@ -177,7 +177,7 @@ public class LatinKeyboardView extends KeyboardView implements PointerTracker.Ke public boolean onDoubleTap(MotionEvent firstDown) { final Keyboard keyboard = getKeyboard(); if (ENABLE_CAPSLOCK_BY_DOUBLETAP && keyboard instanceof LatinKeyboard && ((LatinKeyboard) keyboard).isAlphaKeyboard()) { && ((LatinKeyboard) keyboard).mId.isAlphabetKeyboard()) { final int pointerIndex = firstDown.getActionIndex(); final int id = firstDown.getPointerId(pointerIndex); final PointerTracker tracker = getPointerTracker(id); Loading Loading @@ -396,14 +396,14 @@ public class LatinKeyboardView extends KeyboardView implements PointerTracker.Ke final Keyboard keyboard = getKeyboard(); if (keyboard instanceof LatinKeyboard) { final LatinKeyboard latinKeyboard = (LatinKeyboard) keyboard; if (primaryCode == Keyboard.CODE_DIGIT0 && latinKeyboard.isPhoneKeyboard()) { if (primaryCode == Keyboard.CODE_DIGIT0 && latinKeyboard.mId.isPhoneKeyboard()) { tracker.onLongPressed(); // Long pressing on 0 in phone number keypad gives you a '+'. invokeCodeInput(Keyboard.CODE_PLUS); invokeReleaseKey(primaryCode); return true; } if (primaryCode == Keyboard.CODE_SHIFT && latinKeyboard.isAlphaKeyboard()) { if (primaryCode == Keyboard.CODE_SHIFT && latinKeyboard.mId.isAlphabetKeyboard()) { tracker.onLongPressed(); invokeCodeInput(Keyboard.CODE_CAPSLOCK); invokeReleaseKey(primaryCode); Loading