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

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

Merge "Support @icon/icon_name for more keys specification"

parents 482588c5 b009a24b
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -70,10 +70,8 @@
    <string name="keylabel_for_symbols_percent">\u066a</string>
    <string name="more_keys_for_comma">,</string>
    <string name="more_keys_for_f1">,</string>
    <!-- @icon/3 is iconSettingsKey -->
    <string name="more_keys_for_f1_settings">\\,,\@icon/3|\@integer/key_settings</string>
    <!-- @icon/7 is iconTabKey -->
    <string name="more_keys_for_f1_navigate">\\,,\@icon/7|\@integer/key_tab</string>
    <string name="more_keys_for_f1_settings">\\,,\@icon/settingsKey|\@integer/key_settings</string>
    <string name="more_keys_for_f1_navigate">\\,,\@icon/tabKey|\@integer/key_tab</string>
    <string name="more_keys_for_symbols_question">\?</string>
    <string name="more_keys_for_symbols_semicolon">;</string>
    <string name="more_keys_for_symbols_percent">%,‰</string>
+0 −2
Original line number Diff line number Diff line
@@ -248,12 +248,10 @@
            <!-- This should be aligned with the KeyboardIcons.ICONS_TO_ATTRS_MAP -->
            <enum name="iconShiftKey" value="1" />
            <enum name="iconDeleteKey" value="2" />
            <!-- This is also represented as "@icon/3" in keyboard layout XML. -->
            <enum name="iconSettingsKey" value="3" />
            <enum name="iconSpaceKey" value="4" />
            <enum name="iconReturnKey" value="5" />
            <enum name="iconSearchKey" value="6" />
            <!-- This is also represented as "@icon/7" in keyboard layout XML. -->
            <enum name="iconTabKey" value="7" />
            <enum name="iconShortcutKey" value="8" />
            <enum name="iconShortcutForLabel" value="9" />
+2 −4
Original line number Diff line number Diff line
@@ -91,10 +91,8 @@
    <string name="keylabel_for_symbols_percent">%</string>
    <string name="more_keys_for_comma"></string>
    <string name="more_keys_for_f1"></string>
    <!-- @icon/3 is iconSettingsKey -->
    <string name="more_keys_for_f1_settings">\@icon/3|\@integer/key_settings</string>
    <!-- @icon/7 is iconTabKey -->
    <string name="more_keys_for_f1_navigate">\@icon/7|\@integer/key_tab</string>
    <string name="more_keys_for_f1_settings">\@icon/settingsKey|\@integer/key_settings</string>
    <string name="more_keys_for_f1_navigate">\@icon/tabKey|\@integer/key_tab</string>
    <string name="more_keys_for_symbols_question">¿</string>
    <string name="more_keys_for_symbols_semicolon"></string>
    <string name="more_keys_for_symbols_percent"></string>
+1 −1
Original line number Diff line number Diff line
@@ -34,7 +34,7 @@
            <key-style
                latin:styleName="f2PopupStyle"
                latin:keyLabelFlags="hasPopupHint"
                latin:moreKeys="\@icon/3|\@integer/key_settings"
                latin:moreKeys="\@icon/settingsKey|\@integer/key_settings"
                latin:backgroundType="functional" />
        </default>
    </switch>
+12 −4
Original line number Diff line number Diff line
@@ -166,7 +166,12 @@ public class Key {
    }

    private static Drawable getIcon(Keyboard.Params params, String moreKeySpec) {
        return params.mIconsSet.getIconByIconId(MoreKeySpecParser.getIconId(moreKeySpec));
        final int iconAttrId = MoreKeySpecParser.getIconAttrId(moreKeySpec);
        if (iconAttrId == KeyboardIconsSet.ICON_UNDEFINED) {
            return null;
        } else {
            return params.mIconsSet.getIconByAttrId(iconAttrId);
        }
    }

    /**
@@ -277,12 +282,15 @@ public class Key {
                R.styleable.Keyboard_Key_visualInsetsLeft, params.mBaseWidth, 0);
        mVisualInsetsRight = (int) Keyboard.Builder.getDimensionOrFraction(keyAttr,
                R.styleable.Keyboard_Key_visualInsetsRight, params.mBaseWidth, 0);
        mPreviewIcon = iconsSet.getIconByIconId(style.getInt(keyAttr,
        final int previewIconAttrId = KeyboardIconsSet.getIconAttrId(style.getInt(keyAttr,
                R.styleable.Keyboard_Key_keyIconPreview, KeyboardIconsSet.ICON_UNDEFINED));
        mIcon = iconsSet.getIconByIconId(style.getInt(keyAttr,
        mPreviewIcon = iconsSet.getIconByAttrId(previewIconAttrId);
        final int iconAttrId = KeyboardIconsSet.getIconAttrId(style.getInt(keyAttr,
                R.styleable.Keyboard_Key_keyIcon, KeyboardIconsSet.ICON_UNDEFINED));
        mDisabledIcon = iconsSet.getIconByIconId(style.getInt(keyAttr,
        mIcon = iconsSet.getIconByAttrId(iconAttrId);
        final int disabledIconAttrId = KeyboardIconsSet.getIconAttrId(style.getInt(keyAttr,
                R.styleable.Keyboard_Key_keyIconDisabled, KeyboardIconsSet.ICON_UNDEFINED));
        mDisabledIcon = iconsSet.getIconByAttrId(disabledIconAttrId);
        mHintLabel = style.getText(keyAttr, R.styleable.Keyboard_Key_keyHintLabel);

        mLabel = style.getText(keyAttr, R.styleable.Keyboard_Key_keyLabel);
Loading