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

Commit 3a1844c3 authored by Tadashi G. Takaoka's avatar Tadashi G. Takaoka Committed by Android (Google) Code Review
Browse files

Merge "Support dividers in MoreKeysKeyboard"

parents 37903534 5ef4fccb
Loading
Loading
Loading
Loading
+1.01 KiB
Loading image diff...
+2.87 KiB
Loading image diff...
+1.03 KiB
Loading image diff...
+1 −1
Original line number Diff line number Diff line
@@ -49,7 +49,7 @@
            <key-style
                latin:styleName="navigateMoreKeysStyle"
                latin:keyLabelFlags="hasPopupHint|preserveCase"
                latin:moreKeys="!fixedColumnOrder!2,@string/action_previous_as_more_key,@string/action_next_as_more_key" />
                latin:moreKeys="!fixedColumnOrder!2,!needsDividers!,@string/action_previous_as_more_key,@string/action_next_as_more_key" />
        </case>
        <case
            latin:navigateNext="true"
+9 −0
Original line number Diff line number Diff line
@@ -108,9 +108,11 @@ public class Key {
    private static final int MORE_KEYS_COLUMN_MASK = 0x000000ff;
    private static final int MORE_KEYS_FLAGS_FIXED_COLUMN_ORDER = 0x80000000;
    private static final int MORE_KEYS_FLAGS_HAS_LABELS = 0x40000000;
    private static final int MORE_KEYS_FLAGS_NEEDS_DIVIDERS = 0x40000000;
    private static final String MORE_KEYS_AUTO_COLUMN_ORDER = "!autoColumnOrder!";
    private static final String MORE_KEYS_FIXED_COLUMN_ORDER = "!fixedColumnOrder!";
    private static final String MORE_KEYS_HAS_LABELS = "!hasLabels!";
    private static final String MORE_KEYS_NEEDS_DIVIDERS = "!needsDividers!";

    /** Background type that represents different key background visual than normal one. */
    public final int mBackgroundType;
@@ -253,6 +255,9 @@ public class Key {
        if (KeySpecParser.getBooleanValue(moreKeys, MORE_KEYS_HAS_LABELS)) {
            moreKeysColumn |= MORE_KEYS_FLAGS_HAS_LABELS;
        }
        if (KeySpecParser.getBooleanValue(moreKeys, MORE_KEYS_NEEDS_DIVIDERS)) {
            moreKeysColumn |= MORE_KEYS_FLAGS_NEEDS_DIVIDERS;
        }
        mMoreKeysColumnAndFlags = moreKeysColumn;

        final String[] additionalMoreKeys = style.getStringArray(
@@ -539,6 +544,10 @@ public class Key {
        return (mMoreKeysColumnAndFlags & MORE_KEYS_FLAGS_HAS_LABELS) != 0;
    }

    public boolean needsDividersInMoreKeys() {
        return (mMoreKeysColumnAndFlags & MORE_KEYS_FLAGS_NEEDS_DIVIDERS) != 0;
    }

    public Drawable getIcon(KeyboardIconsSet iconSet) {
        return iconSet.getIconDrawable(mIconId);
    }
Loading