Consolidate keyOutputText with keyLabel attribute
Change-Id: I90ea2c9d5ce42fabc79599995a2fae1f5f652a6bmain
parent
6193217f5c
commit
d6f147e142
|
@ -276,9 +276,6 @@
|
|||
<flag name="altCodeWhileTyping" value="0x04" />
|
||||
<flag name="enableLongPress" value="0x08" />
|
||||
</attr>
|
||||
<!-- TODO: Remove keyOutputText attribute and consolidate with keySpec. -->
|
||||
<!-- The string of characters to output when this key is pressed. -->
|
||||
<attr name="keyOutputText" format="string" />
|
||||
<!-- TODO: Rename keyLabel to keySpec. -->
|
||||
<!-- The label to display on the key. -->
|
||||
<attr name="keyLabel" format="string" />
|
||||
|
|
|
@ -100,12 +100,6 @@
|
|||
latin:moreKeys="!icon/zwj_key|‍"
|
||||
latin:keyLabelFlags="hasPopupHint"
|
||||
latin:keyActionFlags="noKeyPreview" />
|
||||
<key-style
|
||||
latin:styleName="smileyKeyStyle"
|
||||
latin:keyLabel=":-)"
|
||||
latin:keyOutputText=":-) "
|
||||
latin:keyLabelFlags="hasPopupHint|preserveCase"
|
||||
latin:moreKeys="!text/more_keys_for_smiley" />
|
||||
<key-style
|
||||
latin:styleName="shortcutKeyStyle"
|
||||
latin:code="!code/key_shortcut"
|
||||
|
@ -190,8 +184,7 @@
|
|||
latin:parentStyle="baseForLayoutSwitchKeyStyle" />
|
||||
<key-style
|
||||
latin:styleName="comKeyStyle"
|
||||
latin:keyLabel="!text/keylabel_for_popular_domain"
|
||||
latin:keyLabel="!text/keylabel_for_popular_domain|!text/keylabel_for_popular_domain"
|
||||
latin:keyLabelFlags="autoXScale|fontNormal|hasPopupHint|preserveCase"
|
||||
latin:keyOutputText="!text/keylabel_for_popular_domain"
|
||||
latin:moreKeys="!text/more_keys_for_popular_domain" />
|
||||
</merge>
|
||||
|
|
|
@ -184,9 +184,8 @@
|
|||
latin:parentStyle="baseForToSymbolKeyStyle" />
|
||||
<key-style
|
||||
latin:styleName="comKeyStyle"
|
||||
latin:keyLabel="!text/keylabel_for_popular_domain"
|
||||
latin:keyLabel="!text/keylabel_for_popular_domain|!text/keylabel_for_popular_domain"
|
||||
latin:keyLabelFlags="autoXScale|fontNormal|hasPopupHint|preserveCase"
|
||||
latin:keyOutputText="!text/keylabel_for_popular_domain"
|
||||
latin:moreKeys="!text/more_keys_for_popular_domain"
|
||||
latin:backgroundType="functional" />
|
||||
</merge>
|
||||
|
|
|
@ -347,12 +347,8 @@ public class Key implements Comparable<Key> {
|
|||
mHintLabel = StringUtils.toUpperCaseOfStringForLocale(style.getString(keyAttr,
|
||||
R.styleable.Keyboard_Key_keyHintLabel), needsToUpperCase, locale);
|
||||
}
|
||||
final String outputTextInAttr = style.getString(
|
||||
keyAttr, R.styleable.Keyboard_Key_keyOutputText);
|
||||
final String rawOutputText = (outputTextInAttr != null) ? outputTextInAttr
|
||||
: KeySpecParser.getOutputText(keySpec);
|
||||
String outputText = StringUtils.toUpperCaseOfStringForLocale(
|
||||
rawOutputText, needsToUpperCase, locale);
|
||||
KeySpecParser.getOutputText(keySpec), needsToUpperCase, locale);
|
||||
// Choose the first letter of the label as primary code if not specified.
|
||||
if (code == CODE_UNSPECIFIED && TextUtils.isEmpty(outputText)
|
||||
&& !TextUtils.isEmpty(mLabel)) {
|
||||
|
|
|
@ -138,7 +138,6 @@ public final class KeyStylesSet {
|
|||
readString(keyAttr, R.styleable.Keyboard_Key_code);
|
||||
readString(keyAttr, R.styleable.Keyboard_Key_altCode);
|
||||
readString(keyAttr, R.styleable.Keyboard_Key_keyLabel);
|
||||
readString(keyAttr, R.styleable.Keyboard_Key_keyOutputText);
|
||||
readString(keyAttr, R.styleable.Keyboard_Key_keyHintLabel);
|
||||
readStringArray(keyAttr, R.styleable.Keyboard_Key_moreKeys);
|
||||
readStringArray(keyAttr, R.styleable.Keyboard_Key_additionalMoreKeys);
|
||||
|
|
Loading…
Reference in New Issue