Merge "Remove KeyboardSwitcher.updateShiftLockState method"
This commit is contained in:
commit
77ecf52a08
1 changed files with 7 additions and 15 deletions
|
@ -168,7 +168,6 @@ public class KeyboardSwitcher implements KeyboardState.SwitchActions,
|
||||||
final Keyboard oldKeyboard = mKeyboardView.getKeyboard();
|
final Keyboard oldKeyboard = mKeyboardView.getKeyboard();
|
||||||
mKeyboardView.setKeyboard(keyboard);
|
mKeyboardView.setKeyboard(keyboard);
|
||||||
mCurrentInputView.setKeyboardGeometry(keyboard.mTopPadding);
|
mCurrentInputView.setKeyboardGeometry(keyboard.mTopPadding);
|
||||||
updateShiftLockState(keyboard);
|
|
||||||
mKeyboardView.setKeyPreviewPopupEnabled(
|
mKeyboardView.setKeyPreviewPopupEnabled(
|
||||||
SettingsValues.isKeyPreviewPopupEnabled(mPrefs, mResources),
|
SettingsValues.isKeyPreviewPopupEnabled(mPrefs, mResources),
|
||||||
SettingsValues.getKeyPreviewPopupDismissDelay(mPrefs, mResources));
|
SettingsValues.getKeyPreviewPopupDismissDelay(mPrefs, mResources));
|
||||||
|
@ -178,19 +177,6 @@ public class KeyboardSwitcher implements KeyboardState.SwitchActions,
|
||||||
updateShiftState();
|
updateShiftState();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateShiftLockState(Keyboard keyboard) {
|
|
||||||
if (keyboard.mId.equals(mSymbolsShiftedKeyboardId)) {
|
|
||||||
// Symbol keyboard may have an ALT key that has a caps lock style indicator (a.k.a.
|
|
||||||
// sticky shift key). To show or dismiss the indicator, we need to call setShiftLocked()
|
|
||||||
// that takes care of the current keyboard having such ALT key or not.
|
|
||||||
keyboard.setShiftLocked(keyboard.hasShiftLockKey());
|
|
||||||
} else if (keyboard.mId.equals(mSymbolsKeyboardId)) {
|
|
||||||
// Symbol keyboard has an ALT key that has a caps lock style indicator. To disable the
|
|
||||||
// indicator, we need to call setShiftLocked(false).
|
|
||||||
keyboard.setShiftLocked(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private LatinKeyboard getKeyboard(KeyboardId id) {
|
private LatinKeyboard getKeyboard(KeyboardId id) {
|
||||||
final SoftReference<LatinKeyboard> ref = mKeyboardCache.get(id);
|
final SoftReference<LatinKeyboard> ref = mKeyboardCache.get(id);
|
||||||
LatinKeyboard keyboard = (ref == null) ? null : ref.get();
|
LatinKeyboard keyboard = (ref == null) ? null : ref.get();
|
||||||
|
@ -419,7 +405,13 @@ public class KeyboardSwitcher implements KeyboardState.SwitchActions,
|
||||||
// Implements {@link KeyboardState.SwitchActions}.
|
// Implements {@link KeyboardState.SwitchActions}.
|
||||||
@Override
|
@Override
|
||||||
public void setSymbolsShiftedKeyboard() {
|
public void setSymbolsShiftedKeyboard() {
|
||||||
setKeyboard(getKeyboard(mSymbolsShiftedKeyboardId));
|
final Keyboard keyboard = getKeyboard(mSymbolsShiftedKeyboardId);
|
||||||
|
setKeyboard(keyboard);
|
||||||
|
// TODO: Remove this logic once we introduce initial keyboard shift state attribute.
|
||||||
|
// Symbol shift keyboard may have a shift key that has a caps lock style indicator (a.k.a.
|
||||||
|
// sticky shift key). To show or dismiss the indicator, we need to call setShiftLocked()
|
||||||
|
// that takes care of the current keyboard having such shift key or not.
|
||||||
|
keyboard.setShiftLocked(keyboard.hasShiftLockKey());
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isInMomentarySwitchState() {
|
public boolean isInMomentarySwitchState() {
|
||||||
|
|
Loading…
Reference in a new issue