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

Commit 42fcb2de authored by Tadashi G. Takaoka's avatar Tadashi G. Takaoka
Browse files

Get rid of public reference to KeyboardIconsSet.ICON_* constants

As a consequence,
  * Add Key.iconDisabledKey has been introduced and Key.getIcon honors
    the enabled state of the key.
  * The attribute id of disabled icon for shortcut key,
    Keyboard_iconShortcutKeyDisabled, is renamed to
    Keyboard_iconDisbledShortcutKey
  * KeyboardIconsSet has getIconByIconId and getIconByAttrId methods
    instead of getIcon.

Bug: 5778201
Change-Id: Ica93b073b9a04acd18ead7a33b60e3c6d813e7a1
parent 4e1dab8c
Loading
Loading
Loading
Loading
+12 −6
Original line number Diff line number Diff line
@@ -191,8 +191,8 @@
        <attr name="iconShortcutKey" format="reference" />
        <attr name="iconShortcutForLabel" format="reference" />
        <attr name="iconSpaceKeyForNumberLayout" format="reference" />
        <attr name="iconShortcutKeyDisabled" format="reference" />
        <attr name="iconShiftKeyShifted" format="reference" />
        <attr name="iconDisabledShortcutKey" format="reference" />
        <attr name="iconPreviewTabKey" format="reference" />
    </declare-styleable>

@@ -245,23 +245,29 @@
        </attr>
        <!-- The icon to display on the key instead of the label. -->
        <attr name="keyIcon" format="enum">
            <!-- This should be aligned with KeyboardIcons.ICON_* -->
            <!-- 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" />
            <enum name="iconShortcutKeyDisabled" value="10" />
            <enum name="iconSpaceKeyForNumberLayout" value="11" />
            <enum name="iconShiftKeyShifted" value="12" />
            <enum name="iconSpaceKeyForNumberLayout" value="10" />
            <enum name="iconShiftKeyShifted" value="11" />
        </attr>
        <!-- The icon for disabled key -->
        <attr name="keyIconDisabled" format="enum">
            <!-- This should be aligned with the KeyboardIcons.ICONS_TO_ATTRS_MAP -->
            <enum name="iconDisabledShortcutKey" value="12" />
        </attr>
        <!-- The icon to show in the popup preview. -->
        <attr name="keyIconPreview" format="enum">
            <!-- This should be aligned with KeyboardIcons.ICON_PREVIEW_* -->
            <!-- This should be aligned with the KeyboardIcons.ICONS_TO_ATTRS_MAP -->
            <enum name="iconPreviewTabKey" value="13" />
        </attr>
        <!-- The key style to specify a set of key attributes defined by <key_style/> -->
+1 −1
Original line number Diff line number Diff line
@@ -30,9 +30,9 @@
        <item name="iconTabKey">@drawable/sym_bkeyboard_tab</item>
        <item name="iconShortcutKey">@drawable/sym_bkeyboard_mic</item>
        <item name="iconShortcutForLabel">@drawable/sym_bkeyboard_label_mic</item>
        <item name="iconShortcutKeyDisabled">@drawable/sym_bkeyboard_voice_off</item>
        <item name="iconSpaceKeyForNumberLayout">@drawable/sym_bkeyboard_space</item>
        <item name="iconShiftKeyShifted">@drawable/sym_bkeyboard_shift_locked</item>
        <item name="iconDisabledShortcutKey">@drawable/sym_bkeyboard_voice_off</item>
        <item name="iconPreviewTabKey">@drawable/sym_keyboard_feedback_tab</item>
    </style>
</resources>
+1 −1
Original line number Diff line number Diff line
@@ -29,9 +29,9 @@
        <item name="iconTabKey">@drawable/sym_keyboard_tab_holo</item>
        <item name="iconShortcutKey">@drawable/sym_keyboard_voice_holo</item>
        <item name="iconShortcutForLabel">@drawable/sym_keyboard_label_mic_holo</item>
        <item name="iconShortcutKeyDisabled">@drawable/sym_keyboard_voice_off_holo</item>
        <item name="iconSpaceKeyForNumberLayout">@drawable/sym_keyboard_space_holo</item>
        <item name="iconShiftKeyShifted">@drawable/sym_keyboard_shift_locked_holo</item>
        <item name="iconDisabledShortcutKey">@drawable/sym_keyboard_voice_off_holo</item>
        <item name="iconPreviewTabKey">@drawable/sym_keyboard_feedback_tab</item>
    </style>
</resources>
+2 −2
Original line number Diff line number Diff line
@@ -26,10 +26,10 @@
        <item name="iconTabKey">@drawable/sym_keyboard_tab</item>
        <item name="iconShortcutKey">@drawable/sym_keyboard_mic</item>
        <item name="iconShortcutForLabel">@drawable/sym_keyboard_label_mic</item>
        <!-- TODO: Needs non-holo disabled shortcut icon drawable -->
        <item name="iconShortcutKeyDisabled">@drawable/sym_keyboard_voice_off_holo</item>
        <item name="iconSpaceKeyForNumberLayout">@drawable/sym_keyboard_space</item>
        <item name="iconShiftKeyShifted">@drawable/sym_keyboard_shift_locked</item>
        <!-- TODO: Needs non-holo disabled shortcut icon drawable -->
        <item name="iconDisabledShortcutKey">@drawable/sym_keyboard_voice_off_holo</item>
        <item name="iconPreviewTabKey">@drawable/sym_keyboard_feedback_tab</item>
    </style>
</resources>
+1 −0
Original line number Diff line number Diff line
@@ -76,6 +76,7 @@
        latin:styleName="shortcutKeyStyle"
        latin:code="@integer/key_shortcut"
        latin:keyIcon="iconShortcutKey"
        latin:keyIconDisabled="iconDisabledShortcutKey"
        latin:keyActionFlags="noKeyPreview|altCodeWhileTyping"
        latin:altCode="@integer/key_dummy"
        latin:parentStyle="f2PopupStyle" />
Loading