am 9cb19b1b
: Merge "Remove unused keyPreviewIcon attributes"
* commit '9cb19b1bcad1326bbbeb97f62a0f7d0f443bc147': Remove unused keyPreviewIcon attributes
This commit is contained in:
commit
c9d1babb0f
11 changed files with 10 additions and 34 deletions
Binary file not shown.
Before Width: | Height: | Size: 2.3 KiB |
Binary file not shown.
Before Width: | Height: | Size: 846 B |
Binary file not shown.
Before Width: | Height: | Size: 3.3 KiB |
|
@ -238,7 +238,6 @@
|
|||
<attr name="iconSpaceKeyForNumberLayout" format="reference" />
|
||||
<attr name="iconShiftKeyShifted" format="reference" />
|
||||
<attr name="iconShortcutKeyDisabled" format="reference" />
|
||||
<attr name="iconTabKeyPreview" format="reference" />
|
||||
<attr name="iconLanguageSwitchKey" format="reference" />
|
||||
<attr name="iconZwnjKey" format="reference" />
|
||||
<attr name="iconZwjKey" format="reference" />
|
||||
|
@ -331,8 +330,6 @@
|
|||
</attr>
|
||||
<!-- The icon for disabled key -->
|
||||
<attr name="keyIconDisabled" format="string" />
|
||||
<!-- The icon to show in the popup preview. -->
|
||||
<attr name="keyIconPreview" format="string" />
|
||||
<!-- The key style to specify a set of key attributes defined by <key_style/> -->
|
||||
<attr name="keyStyle" format="string" />
|
||||
<!-- Visual insets, in the proportion of keyboard width. -->
|
||||
|
|
|
@ -32,7 +32,6 @@
|
|||
<item name="iconSpaceKeyForNumberLayout">@drawable/sym_keyboard_space_holo_dark</item>
|
||||
<item name="iconShiftKeyShifted">@drawable/sym_keyboard_shift_locked_holo_dark</item>
|
||||
<item name="iconShortcutKeyDisabled">@drawable/sym_keyboard_voice_off_holo_dark</item>
|
||||
<item name="iconTabKeyPreview">@drawable/sym_keyboard_feedback_tab</item>
|
||||
<item name="iconLanguageSwitchKey">@drawable/sym_keyboard_language_switch_dark</item>
|
||||
<item name="iconZwnjKey">@drawable/sym_keyboard_zwnj_holo_dark</item>
|
||||
<item name="iconZwjKey">@drawable/sym_keyboard_zwj_holo_dark</item>
|
||||
|
|
|
@ -38,7 +38,6 @@
|
|||
<item name="iconSpaceKeyForNumberLayout">@drawable/sym_keyboard_space_holo_dark</item>
|
||||
<item name="iconShiftKeyShifted">@drawable/sym_keyboard_shift_locked_lxx_dark</item>
|
||||
<item name="iconShortcutKeyDisabled">@drawable/sym_keyboard_voice_off_lxx_dark</item>
|
||||
<item name="iconTabKeyPreview">@drawable/sym_keyboard_feedback_tab</item>
|
||||
<item name="iconLanguageSwitchKey">@drawable/sym_keyboard_language_switch_lxx_dark</item>
|
||||
<item name="iconZwnjKey">@drawable/sym_keyboard_zwnj_holo_dark</item>
|
||||
<item name="iconZwjKey">@drawable/sym_keyboard_zwj_holo_dark</item>
|
||||
|
|
|
@ -121,7 +121,6 @@
|
|||
<key-style
|
||||
latin:styleName="tabKeyStyle"
|
||||
latin:keySpec="!icon/tab_key|!code/key_action_previous"
|
||||
latin:keyIconPreview="!icon/tab_key_preview"
|
||||
latin:backgroundType="functional" />
|
||||
</case>
|
||||
<case
|
||||
|
@ -131,14 +130,12 @@
|
|||
<key-style
|
||||
latin:styleName="tabKeyStyle"
|
||||
latin:keySpec="!icon/tab_key|!code/key_action_next"
|
||||
latin:keyIconPreview="!icon/tab_key_preview"
|
||||
latin:backgroundType="functional" />
|
||||
</case>
|
||||
<default>
|
||||
<key-style
|
||||
latin:styleName="tabKeyStyle"
|
||||
latin:keySpec="!icon/tab_key|!code/key_tab"
|
||||
latin:keyIconPreview="!icon/tab_key_preview"
|
||||
latin:backgroundType="functional" />
|
||||
</default>
|
||||
</switch>
|
||||
|
|
|
@ -119,14 +119,12 @@
|
|||
<key-style
|
||||
latin:styleName="tabKeyStyle"
|
||||
latin:keySpec="!icon/tab_key|!code/key_tab"
|
||||
latin:keyIconPreview="!icon/tab_key_preview"
|
||||
latin:backgroundType="functional" />
|
||||
<!-- Note: This key style is not for functional tab key. This is used for the tab key which is
|
||||
laid out as normal letter key. -->
|
||||
<key-style
|
||||
latin:styleName="nonSpecialBackgroundTabKeyStyle"
|
||||
latin:keySpec="!icon/tab_key|!code/key_tab"
|
||||
latin:keyIconPreview="!icon/tab_key_preview" />
|
||||
latin:keySpec="!icon/tab_key|!code/key_tab" />
|
||||
<key-style
|
||||
latin:styleName="baseForLayoutSwitchKeyStyle"
|
||||
latin:keyLabelFlags="preserveCase|followFunctionalTextColor"
|
||||
|
|
|
@ -148,33 +148,28 @@ public class Key implements Comparable<Key> {
|
|||
public final int mAltCode;
|
||||
/** Icon for disabled state */
|
||||
public final int mDisabledIconId;
|
||||
/** Preview version of the icon, for the preview popup */
|
||||
public final int mPreviewIconId;
|
||||
/** The visual insets */
|
||||
public final int mVisualInsetsLeft;
|
||||
public final int mVisualInsetsRight;
|
||||
|
||||
private OptionalAttributes(final String outputText, final int altCode,
|
||||
final int disabledIconId, final int previewIconId,
|
||||
final int visualInsetsLeft, final int visualInsetsRight) {
|
||||
final int disabledIconId, final int visualInsetsLeft, final int visualInsetsRight) {
|
||||
mOutputText = outputText;
|
||||
mAltCode = altCode;
|
||||
mDisabledIconId = disabledIconId;
|
||||
mPreviewIconId = previewIconId;
|
||||
mVisualInsetsLeft = visualInsetsLeft;
|
||||
mVisualInsetsRight = visualInsetsRight;
|
||||
}
|
||||
|
||||
public static OptionalAttributes newInstance(final String outputText, final int altCode,
|
||||
final int disabledIconId, final int previewIconId,
|
||||
final int visualInsetsLeft, final int visualInsetsRight) {
|
||||
final int disabledIconId, final int visualInsetsLeft, final int visualInsetsRight) {
|
||||
if (outputText == null && altCode == CODE_UNSPECIFIED
|
||||
&& disabledIconId == ICON_UNDEFINED && previewIconId == ICON_UNDEFINED
|
||||
&& visualInsetsLeft == 0 && visualInsetsRight == 0) {
|
||||
&& disabledIconId == ICON_UNDEFINED && visualInsetsLeft == 0
|
||||
&& visualInsetsRight == 0) {
|
||||
return null;
|
||||
}
|
||||
return new OptionalAttributes(outputText, altCode, disabledIconId, previewIconId,
|
||||
visualInsetsLeft, visualInsetsRight);
|
||||
return new OptionalAttributes(outputText, altCode, disabledIconId, visualInsetsLeft,
|
||||
visualInsetsRight);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -204,8 +199,7 @@ public class Key implements Comparable<Key> {
|
|||
mMoreKeysColumnAndFlags = 0;
|
||||
mLabel = label;
|
||||
mOptionalAttributes = OptionalAttributes.newInstance(outputText, CODE_UNSPECIFIED,
|
||||
ICON_UNDEFINED, ICON_UNDEFINED,
|
||||
0 /* visualInsetsLeft */, 0 /* visualInsetsRight */);
|
||||
ICON_UNDEFINED, 0 /* visualInsetsLeft */, 0 /* visualInsetsRight */);
|
||||
mCode = code;
|
||||
mEnabled = (code != CODE_UNSPECIFIED);
|
||||
mIconId = iconId;
|
||||
|
@ -306,8 +300,6 @@ public class Key implements Comparable<Key> {
|
|||
mIconId = KeySpecParser.getIconId(keySpec);
|
||||
final int disabledIconId = KeySpecParser.getIconId(style.getString(keyAttr,
|
||||
R.styleable.Keyboard_Key_keyIconDisabled));
|
||||
final int previewIconId = KeySpecParser.getIconId(style.getString(keyAttr,
|
||||
R.styleable.Keyboard_Key_keyIconPreview));
|
||||
|
||||
final int code = KeySpecParser.getCode(keySpec);
|
||||
if ((mLabelFlags & LABEL_FLAGS_FROM_CUSTOM_ACTION_LABEL) != 0) {
|
||||
|
@ -361,7 +353,7 @@ public class Key implements Comparable<Key> {
|
|||
final int altCode = StringUtils.toUpperCaseOfCodeForLocale(
|
||||
altCodeInAttr, needsToUpperCase, locale);
|
||||
mOptionalAttributes = OptionalAttributes.newInstance(outputText, altCode,
|
||||
disabledIconId, previewIconId, visualInsetsLeft, visualInsetsRight);
|
||||
disabledIconId, visualInsetsLeft, visualInsetsRight);
|
||||
mKeyVisualAttributes = KeyVisualAttributes.newInstance(keyAttr);
|
||||
mHashCode = computeHashCode(this);
|
||||
}
|
||||
|
@ -756,10 +748,7 @@ public class Key implements Comparable<Key> {
|
|||
}
|
||||
|
||||
public Drawable getPreviewIcon(final KeyboardIconsSet iconSet) {
|
||||
final OptionalAttributes attrs = mOptionalAttributes;
|
||||
final int previewIconId = (attrs != null) ? attrs.mPreviewIconId : ICON_UNDEFINED;
|
||||
return previewIconId != ICON_UNDEFINED
|
||||
? iconSet.getIconDrawable(previewIconId) : iconSet.getIconDrawable(getIconId());
|
||||
return iconSet.getIconDrawable(getIconId());
|
||||
}
|
||||
|
||||
public int getWidth() {
|
||||
|
|
|
@ -141,7 +141,6 @@ public final class KeyStylesSet {
|
|||
readStringArray(keyAttr, R.styleable.Keyboard_Key_additionalMoreKeys);
|
||||
readFlags(keyAttr, R.styleable.Keyboard_Key_keyLabelFlags);
|
||||
readString(keyAttr, R.styleable.Keyboard_Key_keyIconDisabled);
|
||||
readString(keyAttr, R.styleable.Keyboard_Key_keyIconPreview);
|
||||
readInt(keyAttr, R.styleable.Keyboard_Key_maxMoreKeysColumn);
|
||||
readInt(keyAttr, R.styleable.Keyboard_Key_backgroundType);
|
||||
readFlags(keyAttr, R.styleable.Keyboard_Key_keyActionFlags);
|
||||
|
|
|
@ -48,7 +48,6 @@ public final class KeyboardIconsSet {
|
|||
public static final String NAME_DONE_KEY = "done_key";
|
||||
public static final String NAME_PREVIOUS_KEY = "previous_key";
|
||||
public static final String NAME_TAB_KEY = "tab_key";
|
||||
public static final String NANE_TAB_KEY_PREVIEW = "tab_key_preview";
|
||||
public static final String NAME_SHORTCUT_KEY = "shortcut_key";
|
||||
public static final String NAME_SHORTCUT_KEY_DISABLED = "shortcut_key_disabled";
|
||||
public static final String NAME_LANGUAGE_SWITCH_KEY = "language_switch_key";
|
||||
|
@ -79,7 +78,6 @@ public final class KeyboardIconsSet {
|
|||
NAME_SPACE_KEY_FOR_NUMBER_LAYOUT, R.styleable.Keyboard_iconSpaceKeyForNumberLayout,
|
||||
NAME_SHIFT_KEY_SHIFTED, R.styleable.Keyboard_iconShiftKeyShifted,
|
||||
NAME_SHORTCUT_KEY_DISABLED, R.styleable.Keyboard_iconShortcutKeyDisabled,
|
||||
NANE_TAB_KEY_PREVIEW, R.styleable.Keyboard_iconTabKeyPreview,
|
||||
NAME_LANGUAGE_SWITCH_KEY, R.styleable.Keyboard_iconLanguageSwitchKey,
|
||||
NAME_ZWNJ_KEY, R.styleable.Keyboard_iconZwnjKey,
|
||||
NAME_ZWJ_KEY, R.styleable.Keyboard_iconZwjKey,
|
||||
|
|
Loading…
Reference in a new issue