Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 07145a37 authored by Tadashi G. Takaoka's avatar Tadashi G. Takaoka
Browse files

Fix automatic temporary upper case mode shift key graphics

Bug: 5802387
Change-Id: I4f59fb2f971c543748ed32b37af528767a0549e4
parent 77e7532d
Loading
Loading
Loading
Loading
+14 −8
Original line number Diff line number Diff line
@@ -205,9 +205,10 @@ public class Keyboard {
        return mShiftState.isShiftLocked();
    }

    // TODO: Remove this method.
    void setShifted(boolean newShiftState) {
        if (!mShiftState.isShiftLocked()) {
    private void setShiftKeyGraphics(boolean newShiftState) {
        if (mShiftState.isShiftLocked()) {
            return;
        }
        for (final Key key : mShiftKeys) {
            final int attrId = newShiftState
                    ? R.styleable.Keyboard_iconShiftKeyShifted
@@ -215,6 +216,10 @@ public class Keyboard {
            key.setIcon(mIconsSet.getIconByAttrId(attrId));
        }
    }

    // TODO: Remove this method.
    void setShifted(boolean newShiftState) {
        setShiftKeyGraphics(newShiftState);
        mShiftState.setShifted(newShiftState);
    }

@@ -225,6 +230,7 @@ public class Keyboard {

    // TODO: Remove this method
    void setAutomaticTemporaryUpperCase() {
        setShiftKeyGraphics(true);
        mShiftState.setAutomaticTemporaryUpperCase();
    }

+1 −1
Original line number Diff line number Diff line
@@ -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);