am 9cb19b1b: Merge "Remove unused keyPreviewIcon attributes"

* commit '9cb19b1bcad1326bbbeb97f62a0f7d0f443bc147':
  Remove unused keyPreviewIcon attributes
main
Tadashi G. Takaoka 2014-07-08 08:54:22 +00:00 committed by Android Git Automerger
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

View File

@ -238,7 +238,6 @@
<attr name="iconSpaceKeyForNumberLayout" format="reference" /> <attr name="iconSpaceKeyForNumberLayout" format="reference" />
<attr name="iconShiftKeyShifted" format="reference" /> <attr name="iconShiftKeyShifted" format="reference" />
<attr name="iconShortcutKeyDisabled" format="reference" /> <attr name="iconShortcutKeyDisabled" format="reference" />
<attr name="iconTabKeyPreview" format="reference" />
<attr name="iconLanguageSwitchKey" format="reference" /> <attr name="iconLanguageSwitchKey" format="reference" />
<attr name="iconZwnjKey" format="reference" /> <attr name="iconZwnjKey" format="reference" />
<attr name="iconZwjKey" format="reference" /> <attr name="iconZwjKey" format="reference" />
@ -331,8 +330,6 @@
</attr> </attr>
<!-- The icon for disabled key --> <!-- The icon for disabled key -->
<attr name="keyIconDisabled" format="string" /> <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/> --> <!-- The key style to specify a set of key attributes defined by <key_style/> -->
<attr name="keyStyle" format="string" /> <attr name="keyStyle" format="string" />
<!-- Visual insets, in the proportion of keyboard width. --> <!-- Visual insets, in the proportion of keyboard width. -->

View File

@ -32,7 +32,6 @@
<item name="iconSpaceKeyForNumberLayout">@drawable/sym_keyboard_space_holo_dark</item> <item name="iconSpaceKeyForNumberLayout">@drawable/sym_keyboard_space_holo_dark</item>
<item name="iconShiftKeyShifted">@drawable/sym_keyboard_shift_locked_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="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="iconLanguageSwitchKey">@drawable/sym_keyboard_language_switch_dark</item>
<item name="iconZwnjKey">@drawable/sym_keyboard_zwnj_holo_dark</item> <item name="iconZwnjKey">@drawable/sym_keyboard_zwnj_holo_dark</item>
<item name="iconZwjKey">@drawable/sym_keyboard_zwj_holo_dark</item> <item name="iconZwjKey">@drawable/sym_keyboard_zwj_holo_dark</item>

View File

@ -38,7 +38,6 @@
<item name="iconSpaceKeyForNumberLayout">@drawable/sym_keyboard_space_holo_dark</item> <item name="iconSpaceKeyForNumberLayout">@drawable/sym_keyboard_space_holo_dark</item>
<item name="iconShiftKeyShifted">@drawable/sym_keyboard_shift_locked_lxx_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="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="iconLanguageSwitchKey">@drawable/sym_keyboard_language_switch_lxx_dark</item>
<item name="iconZwnjKey">@drawable/sym_keyboard_zwnj_holo_dark</item> <item name="iconZwnjKey">@drawable/sym_keyboard_zwnj_holo_dark</item>
<item name="iconZwjKey">@drawable/sym_keyboard_zwj_holo_dark</item> <item name="iconZwjKey">@drawable/sym_keyboard_zwj_holo_dark</item>

View File

@ -121,7 +121,6 @@
<key-style <key-style
latin:styleName="tabKeyStyle" latin:styleName="tabKeyStyle"
latin:keySpec="!icon/tab_key|!code/key_action_previous" latin:keySpec="!icon/tab_key|!code/key_action_previous"
latin:keyIconPreview="!icon/tab_key_preview"
latin:backgroundType="functional" /> latin:backgroundType="functional" />
</case> </case>
<case <case
@ -131,14 +130,12 @@
<key-style <key-style
latin:styleName="tabKeyStyle" latin:styleName="tabKeyStyle"
latin:keySpec="!icon/tab_key|!code/key_action_next" latin:keySpec="!icon/tab_key|!code/key_action_next"
latin:keyIconPreview="!icon/tab_key_preview"
latin:backgroundType="functional" /> latin:backgroundType="functional" />
</case> </case>
<default> <default>
<key-style <key-style
latin:styleName="tabKeyStyle" latin:styleName="tabKeyStyle"
latin:keySpec="!icon/tab_key|!code/key_tab" latin:keySpec="!icon/tab_key|!code/key_tab"
latin:keyIconPreview="!icon/tab_key_preview"
latin:backgroundType="functional" /> latin:backgroundType="functional" />
</default> </default>
</switch> </switch>

View File

@ -119,14 +119,12 @@
<key-style <key-style
latin:styleName="tabKeyStyle" latin:styleName="tabKeyStyle"
latin:keySpec="!icon/tab_key|!code/key_tab" latin:keySpec="!icon/tab_key|!code/key_tab"
latin:keyIconPreview="!icon/tab_key_preview"
latin:backgroundType="functional" /> latin:backgroundType="functional" />
<!-- Note: This key style is not for functional tab key. This is used for the tab key which is <!-- 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. --> laid out as normal letter key. -->
<key-style <key-style
latin:styleName="nonSpecialBackgroundTabKeyStyle" latin:styleName="nonSpecialBackgroundTabKeyStyle"
latin:keySpec="!icon/tab_key|!code/key_tab" latin:keySpec="!icon/tab_key|!code/key_tab" />
latin:keyIconPreview="!icon/tab_key_preview" />
<key-style <key-style
latin:styleName="baseForLayoutSwitchKeyStyle" latin:styleName="baseForLayoutSwitchKeyStyle"
latin:keyLabelFlags="preserveCase|followFunctionalTextColor" latin:keyLabelFlags="preserveCase|followFunctionalTextColor"

View File

@ -148,33 +148,28 @@ public class Key implements Comparable<Key> {
public final int mAltCode; public final int mAltCode;
/** Icon for disabled state */ /** Icon for disabled state */
public final int mDisabledIconId; public final int mDisabledIconId;
/** Preview version of the icon, for the preview popup */
public final int mPreviewIconId;
/** The visual insets */ /** The visual insets */
public final int mVisualInsetsLeft; public final int mVisualInsetsLeft;
public final int mVisualInsetsRight; public final int mVisualInsetsRight;
private OptionalAttributes(final String outputText, final int altCode, private OptionalAttributes(final String outputText, final int altCode,
final int disabledIconId, final int previewIconId, final int disabledIconId, final int visualInsetsLeft, final int visualInsetsRight) {
final int visualInsetsLeft, final int visualInsetsRight) {
mOutputText = outputText; mOutputText = outputText;
mAltCode = altCode; mAltCode = altCode;
mDisabledIconId = disabledIconId; mDisabledIconId = disabledIconId;
mPreviewIconId = previewIconId;
mVisualInsetsLeft = visualInsetsLeft; mVisualInsetsLeft = visualInsetsLeft;
mVisualInsetsRight = visualInsetsRight; mVisualInsetsRight = visualInsetsRight;
} }
public static OptionalAttributes newInstance(final String outputText, final int altCode, public static OptionalAttributes newInstance(final String outputText, final int altCode,
final int disabledIconId, final int previewIconId, final int disabledIconId, final int visualInsetsLeft, final int visualInsetsRight) {
final int visualInsetsLeft, final int visualInsetsRight) {
if (outputText == null && altCode == CODE_UNSPECIFIED if (outputText == null && altCode == CODE_UNSPECIFIED
&& disabledIconId == ICON_UNDEFINED && previewIconId == ICON_UNDEFINED && disabledIconId == ICON_UNDEFINED && visualInsetsLeft == 0
&& visualInsetsLeft == 0 && visualInsetsRight == 0) { && visualInsetsRight == 0) {
return null; return null;
} }
return new OptionalAttributes(outputText, altCode, disabledIconId, previewIconId, return new OptionalAttributes(outputText, altCode, disabledIconId, visualInsetsLeft,
visualInsetsLeft, visualInsetsRight); visualInsetsRight);
} }
} }
@ -204,8 +199,7 @@ public class Key implements Comparable<Key> {
mMoreKeysColumnAndFlags = 0; mMoreKeysColumnAndFlags = 0;
mLabel = label; mLabel = label;
mOptionalAttributes = OptionalAttributes.newInstance(outputText, CODE_UNSPECIFIED, mOptionalAttributes = OptionalAttributes.newInstance(outputText, CODE_UNSPECIFIED,
ICON_UNDEFINED, ICON_UNDEFINED, ICON_UNDEFINED, 0 /* visualInsetsLeft */, 0 /* visualInsetsRight */);
0 /* visualInsetsLeft */, 0 /* visualInsetsRight */);
mCode = code; mCode = code;
mEnabled = (code != CODE_UNSPECIFIED); mEnabled = (code != CODE_UNSPECIFIED);
mIconId = iconId; mIconId = iconId;
@ -306,8 +300,6 @@ public class Key implements Comparable<Key> {
mIconId = KeySpecParser.getIconId(keySpec); mIconId = KeySpecParser.getIconId(keySpec);
final int disabledIconId = KeySpecParser.getIconId(style.getString(keyAttr, final int disabledIconId = KeySpecParser.getIconId(style.getString(keyAttr,
R.styleable.Keyboard_Key_keyIconDisabled)); R.styleable.Keyboard_Key_keyIconDisabled));
final int previewIconId = KeySpecParser.getIconId(style.getString(keyAttr,
R.styleable.Keyboard_Key_keyIconPreview));
final int code = KeySpecParser.getCode(keySpec); final int code = KeySpecParser.getCode(keySpec);
if ((mLabelFlags & LABEL_FLAGS_FROM_CUSTOM_ACTION_LABEL) != 0) { if ((mLabelFlags & LABEL_FLAGS_FROM_CUSTOM_ACTION_LABEL) != 0) {
@ -361,7 +353,7 @@ public class Key implements Comparable<Key> {
final int altCode = StringUtils.toUpperCaseOfCodeForLocale( final int altCode = StringUtils.toUpperCaseOfCodeForLocale(
altCodeInAttr, needsToUpperCase, locale); altCodeInAttr, needsToUpperCase, locale);
mOptionalAttributes = OptionalAttributes.newInstance(outputText, altCode, mOptionalAttributes = OptionalAttributes.newInstance(outputText, altCode,
disabledIconId, previewIconId, visualInsetsLeft, visualInsetsRight); disabledIconId, visualInsetsLeft, visualInsetsRight);
mKeyVisualAttributes = KeyVisualAttributes.newInstance(keyAttr); mKeyVisualAttributes = KeyVisualAttributes.newInstance(keyAttr);
mHashCode = computeHashCode(this); mHashCode = computeHashCode(this);
} }
@ -756,10 +748,7 @@ public class Key implements Comparable<Key> {
} }
public Drawable getPreviewIcon(final KeyboardIconsSet iconSet) { public Drawable getPreviewIcon(final KeyboardIconsSet iconSet) {
final OptionalAttributes attrs = mOptionalAttributes; return iconSet.getIconDrawable(getIconId());
final int previewIconId = (attrs != null) ? attrs.mPreviewIconId : ICON_UNDEFINED;
return previewIconId != ICON_UNDEFINED
? iconSet.getIconDrawable(previewIconId) : iconSet.getIconDrawable(getIconId());
} }
public int getWidth() { public int getWidth() {

View File

@ -141,7 +141,6 @@ public final class KeyStylesSet {
readStringArray(keyAttr, R.styleable.Keyboard_Key_additionalMoreKeys); readStringArray(keyAttr, R.styleable.Keyboard_Key_additionalMoreKeys);
readFlags(keyAttr, R.styleable.Keyboard_Key_keyLabelFlags); readFlags(keyAttr, R.styleable.Keyboard_Key_keyLabelFlags);
readString(keyAttr, R.styleable.Keyboard_Key_keyIconDisabled); 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_maxMoreKeysColumn);
readInt(keyAttr, R.styleable.Keyboard_Key_backgroundType); readInt(keyAttr, R.styleable.Keyboard_Key_backgroundType);
readFlags(keyAttr, R.styleable.Keyboard_Key_keyActionFlags); readFlags(keyAttr, R.styleable.Keyboard_Key_keyActionFlags);

View File

@ -48,7 +48,6 @@ public final class KeyboardIconsSet {
public static final String NAME_DONE_KEY = "done_key"; public static final String NAME_DONE_KEY = "done_key";
public static final String NAME_PREVIOUS_KEY = "previous_key"; public static final String NAME_PREVIOUS_KEY = "previous_key";
public static final String NAME_TAB_KEY = "tab_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 = "shortcut_key";
public static final String NAME_SHORTCUT_KEY_DISABLED = "shortcut_key_disabled"; public static final String NAME_SHORTCUT_KEY_DISABLED = "shortcut_key_disabled";
public static final String NAME_LANGUAGE_SWITCH_KEY = "language_switch_key"; 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_SPACE_KEY_FOR_NUMBER_LAYOUT, R.styleable.Keyboard_iconSpaceKeyForNumberLayout,
NAME_SHIFT_KEY_SHIFTED, R.styleable.Keyboard_iconShiftKeyShifted, NAME_SHIFT_KEY_SHIFTED, R.styleable.Keyboard_iconShiftKeyShifted,
NAME_SHORTCUT_KEY_DISABLED, R.styleable.Keyboard_iconShortcutKeyDisabled, 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_LANGUAGE_SWITCH_KEY, R.styleable.Keyboard_iconLanguageSwitchKey,
NAME_ZWNJ_KEY, R.styleable.Keyboard_iconZwnjKey, NAME_ZWNJ_KEY, R.styleable.Keyboard_iconZwnjKey,
NAME_ZWJ_KEY, R.styleable.Keyboard_iconZwjKey, NAME_ZWJ_KEY, R.styleable.Keyboard_iconZwjKey,