aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorTadashi G. Takaoka <takaoka@google.com>2011-12-26 21:05:33 +0900
committerTadashi G. Takaoka <takaoka@google.com>2011-12-26 21:05:33 +0900
commit07145a3706d7692806b9c53548795fa2dbf8f4f0 (patch)
treebc4f62fb70c9b9f9737cbae791860f385b57720c /java/src
parent77e7532dabd390e96a13f6ce7ad56b3a56697bcb (diff)
downloadlatinime-07145a3706d7692806b9c53548795fa2dbf8f4f0.tar.gz
latinime-07145a3706d7692806b9c53548795fa2dbf8f4f0.tar.xz
latinime-07145a3706d7692806b9c53548795fa2dbf8f4f0.zip
Fix automatic temporary upper case mode shift key graphics
Bug: 5802387 Change-Id: I4f59fb2f971c543748ed32b37af528767a0549e4
Diffstat (limited to 'java/src')
-rw-r--r--java/src/com/android/inputmethod/keyboard/Keyboard.java22
-rw-r--r--java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java2
2 files changed, 15 insertions, 9 deletions
diff --git a/java/src/com/android/inputmethod/keyboard/Keyboard.java b/java/src/com/android/inputmethod/keyboard/Keyboard.java
index d9d28f186..3540577ca 100644
--- a/java/src/com/android/inputmethod/keyboard/Keyboard.java
+++ b/java/src/com/android/inputmethod/keyboard/Keyboard.java
@@ -205,16 +205,21 @@ public class Keyboard {
return mShiftState.isShiftLocked();
}
+ private void setShiftKeyGraphics(boolean newShiftState) {
+ if (mShiftState.isShiftLocked()) {
+ return;
+ }
+ for (final Key key : mShiftKeys) {
+ final int attrId = newShiftState
+ ? R.styleable.Keyboard_iconShiftKeyShifted
+ : R.styleable.Keyboard_iconShiftKey;
+ key.setIcon(mIconsSet.getIconByAttrId(attrId));
+ }
+ }
+
// TODO: Remove this method.
void setShifted(boolean newShiftState) {
- if (!mShiftState.isShiftLocked()) {
- for (final Key key : mShiftKeys) {
- final int attrId = newShiftState
- ? R.styleable.Keyboard_iconShiftKeyShifted
- : R.styleable.Keyboard_iconShiftKey;
- key.setIcon(mIconsSet.getIconByAttrId(attrId));
- }
- }
+ setShiftKeyGraphics(newShiftState);
mShiftState.setShifted(newShiftState);
}
@@ -225,6 +230,7 @@ public class Keyboard {
// TODO: Remove this method
void setAutomaticTemporaryUpperCase() {
+ setShiftKeyGraphics(true);
mShiftState.setAutomaticTemporaryUpperCase();
}
diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java b/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java
index e839fe7a3..fa073b671 100644
--- a/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java
+++ b/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java
@@ -134,6 +134,7 @@ public class KeyboardSwitcher implements KeyboardState.SwitchActions,
if (mainKeyboardId.isPhoneKeyboard()) {
mState.onToggleAlphabetAndSymbols();
}
+ updateShiftState();
}
public void saveKeyboardState() {
@@ -164,7 +165,6 @@ public class KeyboardSwitcher implements KeyboardState.SwitchActions,
mKeyboardView.updateSpacebar(0.0f,
mSubtypeSwitcher.needsToDisplayLanguage(keyboard.mId.mLocale));
mKeyboardView.updateShortcutKey(mSubtypeSwitcher.isShortcutImeReady());
- updateShiftState();
final boolean localeChanged = (oldKeyboard == null)
|| !keyboard.mId.mLocale.equals(oldKeyboard.mId.mLocale);
mInputMethodService.mHandler.startDisplayLanguageOnSpacebar(localeChanged);