Fix automatic temporary upper case mode shift key graphics
Bug: 5802387 Change-Id: I4f59fb2f971c543748ed32b37af528767a0549e4
This commit is contained in:
parent
77e7532dab
commit
07145a3706
2 changed files with 15 additions and 9 deletions
|
@ -205,16 +205,21 @@ public class Keyboard {
|
||||||
return mShiftState.isShiftLocked();
|
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.
|
// TODO: Remove this method.
|
||||||
void setShifted(boolean newShiftState) {
|
void setShifted(boolean newShiftState) {
|
||||||
if (!mShiftState.isShiftLocked()) {
|
setShiftKeyGraphics(newShiftState);
|
||||||
for (final Key key : mShiftKeys) {
|
|
||||||
final int attrId = newShiftState
|
|
||||||
? R.styleable.Keyboard_iconShiftKeyShifted
|
|
||||||
: R.styleable.Keyboard_iconShiftKey;
|
|
||||||
key.setIcon(mIconsSet.getIconByAttrId(attrId));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
mShiftState.setShifted(newShiftState);
|
mShiftState.setShifted(newShiftState);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -225,6 +230,7 @@ public class Keyboard {
|
||||||
|
|
||||||
// TODO: Remove this method
|
// TODO: Remove this method
|
||||||
void setAutomaticTemporaryUpperCase() {
|
void setAutomaticTemporaryUpperCase() {
|
||||||
|
setShiftKeyGraphics(true);
|
||||||
mShiftState.setAutomaticTemporaryUpperCase();
|
mShiftState.setAutomaticTemporaryUpperCase();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -134,6 +134,7 @@ public class KeyboardSwitcher implements KeyboardState.SwitchActions,
|
||||||
if (mainKeyboardId.isPhoneKeyboard()) {
|
if (mainKeyboardId.isPhoneKeyboard()) {
|
||||||
mState.onToggleAlphabetAndSymbols();
|
mState.onToggleAlphabetAndSymbols();
|
||||||
}
|
}
|
||||||
|
updateShiftState();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void saveKeyboardState() {
|
public void saveKeyboardState() {
|
||||||
|
@ -164,7 +165,6 @@ public class KeyboardSwitcher implements KeyboardState.SwitchActions,
|
||||||
mKeyboardView.updateSpacebar(0.0f,
|
mKeyboardView.updateSpacebar(0.0f,
|
||||||
mSubtypeSwitcher.needsToDisplayLanguage(keyboard.mId.mLocale));
|
mSubtypeSwitcher.needsToDisplayLanguage(keyboard.mId.mLocale));
|
||||||
mKeyboardView.updateShortcutKey(mSubtypeSwitcher.isShortcutImeReady());
|
mKeyboardView.updateShortcutKey(mSubtypeSwitcher.isShortcutImeReady());
|
||||||
updateShiftState();
|
|
||||||
final boolean localeChanged = (oldKeyboard == null)
|
final boolean localeChanged = (oldKeyboard == null)
|
||||||
|| !keyboard.mId.mLocale.equals(oldKeyboard.mId.mLocale);
|
|| !keyboard.mId.mLocale.equals(oldKeyboard.mId.mLocale);
|
||||||
mInputMethodService.mHandler.startDisplayLanguageOnSpacebar(localeChanged);
|
mInputMethodService.mHandler.startDisplayLanguageOnSpacebar(localeChanged);
|
||||||
|
|
Loading…
Reference in a new issue