Generate KeyboardLabelsSet from donottranslate-more-keys.xml
This change introduces makelabel tool that reads all languages' donottranslate-more-keys and generate KeyboardLabelsSet.java source file. The makelabel command must be invoked prior to compile LatinIME. Change-Id: I7515c7919c535e30f9c80a37bdc831d0f682cd43main
parent
7be6ce0fd7
commit
2be51f4fd0
|
@ -45,24 +45,6 @@
|
|||
<!-- <string name="layout_switch_back_symbols">\"\'‘’‚‛“”„‟«»</string> -->
|
||||
<string name="layout_switch_back_symbols"></string>
|
||||
|
||||
<!-- Label for "switch to more symbol" modifier key. Must be short to fit on key! -->
|
||||
<string name="label_to_more_symbol_key">= \\ <</string>
|
||||
<!-- Label for "switch to more symbol" modifier key on tablets. Must be short to fit on key! -->
|
||||
<string name="label_to_more_symbol_for_tablet_key">~ \\ {</string>
|
||||
|
||||
<!-- Label for "Tab" key. Must be short to fit on key! -->
|
||||
<string name="label_tab_key">Tab</string>
|
||||
<!-- Label for "switch to phone numeric" key. Must be short to fit on key! -->
|
||||
<string name="label_to_phone_numeric_key">123</string>
|
||||
<!-- Label for "switch to phone symbols" key. Must be short to fit on key! -->
|
||||
<!-- U+FF0A: "*" FULLWIDTH ASTERISK
|
||||
U+FF03: "#" FULLWIDTH NUMBER SIGN -->
|
||||
<string name="label_to_phone_symbols_key">*#</string>
|
||||
<!-- Key label for "ante meridiem" -->
|
||||
<string name="label_time_am">"AM"</string>
|
||||
<!-- Key label for "post meridiem" -->
|
||||
<string name="label_time_pm">"PM"</string>
|
||||
|
||||
<!-- Always show the suggestion strip -->
|
||||
<string name="prefs_suggestion_visibility_show_value">0</string>
|
||||
<!-- Show the suggestion strip only on portrait mode -->
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
<Key
|
||||
latin:keyStyle="shortcutKeyStyle"
|
||||
latin:keyLabelFlags="hasPopupHint|preserveCase"
|
||||
latin:moreKeys="@string/settings_as_more_key"
|
||||
latin:moreKeys="!label/settings_as_more_key"
|
||||
latin:keyWidth="fillBoth" />
|
||||
</case>
|
||||
<case
|
||||
|
|
|
@ -92,7 +92,7 @@
|
|||
latin:keyLabel=":-)"
|
||||
latin:keyOutputText=":-) "
|
||||
latin:keyLabelFlags="hasPopupHint|preserveCase"
|
||||
latin:moreKeys="@string/more_keys_for_smiley" />
|
||||
latin:moreKeys="!label/more_keys_for_smiley" />
|
||||
<key-style
|
||||
latin:styleName="shortcutKeyStyle"
|
||||
latin:code="!code/key_shortcut"
|
||||
|
@ -131,35 +131,35 @@
|
|||
<key-style
|
||||
latin:styleName="toSymbolKeyStyle"
|
||||
latin:code="!code/key_switch_alpha_symbol"
|
||||
latin:keyLabel="@string/label_to_symbol_key"
|
||||
latin:keyLabel="!label/label_to_symbol_key"
|
||||
latin:keyLabelFlags="preserveCase"
|
||||
latin:keyActionFlags="noKeyPreview"
|
||||
latin:backgroundType="functional" />
|
||||
<key-style
|
||||
latin:styleName="toAlphaKeyStyle"
|
||||
latin:code="!code/key_switch_alpha_symbol"
|
||||
latin:keyLabel="@string/label_to_alpha_key"
|
||||
latin:keyLabel="!label/label_to_alpha_key"
|
||||
latin:keyLabelFlags="preserveCase"
|
||||
latin:keyActionFlags="noKeyPreview"
|
||||
latin:backgroundType="functional" />
|
||||
<key-style
|
||||
latin:styleName="toMoreSymbolKeyStyle"
|
||||
latin:code="!code/key_shift"
|
||||
latin:keyLabel="@string/label_to_more_symbol_for_tablet_key"
|
||||
latin:keyLabel="!label/label_to_more_symbol_for_tablet_key"
|
||||
latin:keyLabelFlags="preserveCase"
|
||||
latin:keyActionFlags="noKeyPreview"
|
||||
latin:backgroundType="functional" />
|
||||
<key-style
|
||||
latin:styleName="backFromMoreSymbolKeyStyle"
|
||||
latin:code="!code/key_shift"
|
||||
latin:keyLabel="@string/label_to_symbol_key"
|
||||
latin:keyLabel="!label/label_to_symbol_key"
|
||||
latin:keyLabelFlags="preserveCase"
|
||||
latin:keyActionFlags="noKeyPreview"
|
||||
latin:backgroundType="functional" />
|
||||
<key-style
|
||||
latin:styleName="comKeyStyle"
|
||||
latin:keyLabel="@string/keylabel_for_popular_domain"
|
||||
latin:keyLabel="!label/keylabel_for_popular_domain"
|
||||
latin:keyLabelFlags="fontNormal|hasPopupHint|preserveCase"
|
||||
latin:keyOutputText="@string/keylabel_for_popular_domain"
|
||||
latin:moreKeys="@string/more_keys_for_popular_domain" />
|
||||
latin:keyOutputText="!label/keylabel_for_popular_domain"
|
||||
latin:moreKeys="!label/more_keys_for_popular_domain" />
|
||||
</merge>
|
||||
|
|
|
@ -39,9 +39,9 @@
|
|||
</case>
|
||||
<default>
|
||||
<Key
|
||||
latin:keyLabel="@string/keylabel_for_apostrophe"
|
||||
latin:keyHintLabel="@string/keyhintlabel_for_apostrophe"
|
||||
latin:moreKeys="@string/more_keys_for_apostrophe"
|
||||
latin:keyLabel="!label/keylabel_for_apostrophe"
|
||||
latin:keyHintLabel="!label/keyhintlabel_for_apostrophe"
|
||||
latin:moreKeys="!label/more_keys_for_apostrophe"
|
||||
latin:keyStyle="hasShiftedLetterHintStyle" />
|
||||
</default>
|
||||
</switch>
|
||||
|
@ -54,9 +54,9 @@
|
|||
</case>
|
||||
<default>
|
||||
<Key
|
||||
latin:keyLabel="@string/keylabel_for_dash"
|
||||
latin:keyHintLabel="@string/keyhintlabel_for_dash"
|
||||
latin:moreKeys="@string/more_keys_for_dash"
|
||||
latin:keyLabel="!label/keylabel_for_dash"
|
||||
latin:keyHintLabel="!label/keyhintlabel_for_dash"
|
||||
latin:moreKeys="!label/more_keys_for_dash"
|
||||
latin:keyStyle="hasShiftedLetterHintStyle" />
|
||||
</default>
|
||||
</switch>
|
||||
|
|
|
@ -32,14 +32,14 @@
|
|||
</case>
|
||||
<default>
|
||||
<Key
|
||||
latin:keyLabel="@string/keylabel_for_tablet_comma"
|
||||
latin:keyHintLabel="@string/keyhintlabel_for_tablet_comma"
|
||||
latin:moreKeys="@string/more_keys_for_tablet_comma"
|
||||
latin:keyLabel="!label/keylabel_for_tablet_comma"
|
||||
latin:keyHintLabel="!label/keyhintlabel_for_tablet_comma"
|
||||
latin:moreKeys="!label/more_keys_for_tablet_comma"
|
||||
latin:keyStyle="hasShiftedLetterHintStyle" />
|
||||
<Key
|
||||
latin:keyLabel="."
|
||||
latin:keyHintLabel="@string/keyhintlabel_for_tablet_period"
|
||||
latin:moreKeys="@string/more_keys_for_tablet_period"
|
||||
latin:keyHintLabel="!label/keyhintlabel_for_tablet_period"
|
||||
latin:moreKeys="!label/more_keys_for_tablet_period"
|
||||
latin:keyStyle="hasShiftedLetterHintStyle" />
|
||||
</default>
|
||||
</switch>
|
||||
|
|
|
@ -26,13 +26,13 @@
|
|||
<Key
|
||||
latin:keyStyle="currencyKeyStyle" />
|
||||
<Key
|
||||
latin:keyLabel="@string/keylabel_for_symbols_percent"
|
||||
latin:moreKeys="@string/more_keys_for_symbols_percent" />
|
||||
latin:keyLabel="!label/keylabel_for_symbols_percent"
|
||||
latin:moreKeys="!label/more_keys_for_symbols_percent" />
|
||||
<Key
|
||||
latin:keyLabel="&" />
|
||||
<Key
|
||||
latin:keyLabel="*"
|
||||
latin:moreKeys="@string/more_keys_for_star" />
|
||||
latin:moreKeys="!label/more_keys_for_star" />
|
||||
<!-- U+2013: "–" EN DASH
|
||||
U+2014: "—" EM DASH -->
|
||||
<Key
|
||||
|
@ -40,7 +40,7 @@
|
|||
latin:moreKeys="_,–,—" />
|
||||
<Key
|
||||
latin:keyLabel="+"
|
||||
latin:moreKeys="@string/more_keys_for_plus" />
|
||||
latin:moreKeys="!label/more_keys_for_plus" />
|
||||
<include
|
||||
latin:keyboardLayout="@xml/keys_parentheses" />
|
||||
</merge>
|
||||
|
|
|
@ -41,11 +41,11 @@
|
|||
</default>
|
||||
</switch>
|
||||
<Key
|
||||
latin:keyLabel="@string/keylabel_for_symbols_semicolon"
|
||||
latin:moreKeys="@string/more_keys_for_symbols_semicolon" />
|
||||
latin:keyLabel="!label/keylabel_for_symbols_semicolon"
|
||||
latin:moreKeys="!label/more_keys_for_symbols_semicolon" />
|
||||
<Key
|
||||
latin:keyLabel="@string/keylabel_for_comma"
|
||||
latin:moreKeys="@string/more_keys_for_comma" />
|
||||
latin:keyLabel="!label/keylabel_for_comma"
|
||||
latin:moreKeys="!label/more_keys_for_comma" />
|
||||
<Key
|
||||
latin:keyLabel="." />
|
||||
<!-- U+00A1: "¡" INVERTED EXCLAMATION MARK -->
|
||||
|
@ -53,6 +53,6 @@
|
|||
latin:keyLabel="!"
|
||||
latin:moreKeys="¡" />
|
||||
<Key
|
||||
latin:keyLabel="@string/keylabel_for_symbols_question"
|
||||
latin:moreKeys="@string/more_keys_for_symbols_question" />
|
||||
latin:keyLabel="!label/keylabel_for_symbols_question"
|
||||
latin:moreKeys="!label/more_keys_for_symbols_question" />
|
||||
</merge>
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
<!-- U+2022: "•" BULLET -->
|
||||
<Key
|
||||
latin:keyLabel="•"
|
||||
latin:moreKeys="@string/more_keys_for_bullet" />
|
||||
latin:moreKeys="!label/more_keys_for_bullet" />
|
||||
<!-- U+221A: "√" SQUARE ROOT -->
|
||||
<Key
|
||||
latin:keyLabel="√" />
|
||||
|
|
|
@ -70,7 +70,7 @@
|
|||
<Key
|
||||
latin:keyLabel=","
|
||||
latin:keyLabelFlags="hasPopupHint"
|
||||
latin:moreKeys="@string/more_keys_for_am_pm"
|
||||
latin:moreKeys="!label/more_keys_for_am_pm"
|
||||
latin:keyStyle="numKeyStyle"
|
||||
latin:keyWidth="9.25%p" />
|
||||
</case>
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
latin:keyWidth="39.750%p" />
|
||||
<Key
|
||||
latin:keyLabel="""
|
||||
latin:moreKeys="@string/more_keys_for_tablet_double_quote" />
|
||||
latin:moreKeys="!label/more_keys_for_tablet_double_quote" />
|
||||
<Key
|
||||
latin:keyLabel="_" />
|
||||
<Spacer
|
||||
|
|
|
@ -91,7 +91,7 @@
|
|||
latin:keyLabel=":-)"
|
||||
latin:keyOutputText=":-) "
|
||||
latin:keyLabelFlags="hasPopupHint|preserveCase"
|
||||
latin:moreKeys="@string/more_keys_for_smiley" />
|
||||
latin:moreKeys="!label/more_keys_for_smiley" />
|
||||
<key-style
|
||||
latin:styleName="shortcutKeyStyle"
|
||||
latin:code="!code/key_shortcut"
|
||||
|
@ -114,7 +114,7 @@
|
|||
<key-style
|
||||
latin:styleName="tabKeyStyle"
|
||||
latin:code="!code/key_action_previous"
|
||||
latin:keyLabel="@string/label_tab_key"
|
||||
latin:keyLabel="!label/label_tab_key"
|
||||
latin:keyLabelFlags="fontNormal|preserveCase"
|
||||
latin:backgroundType="functional" />
|
||||
</case>
|
||||
|
@ -122,7 +122,7 @@
|
|||
<key-style
|
||||
latin:styleName="tabKeyStyle"
|
||||
latin:code="!code/key_tab"
|
||||
latin:keyLabel="@string/label_tab_key"
|
||||
latin:keyLabel="!label/label_tab_key"
|
||||
latin:keyLabelFlags="fontNormal|preserveCase"
|
||||
latin:backgroundType="functional" />
|
||||
</default>
|
||||
|
@ -130,35 +130,35 @@
|
|||
<key-style
|
||||
latin:styleName="toSymbolKeyStyle"
|
||||
latin:code="!code/key_switch_alpha_symbol"
|
||||
latin:keyLabel="@string/label_to_symbol_key"
|
||||
latin:keyLabel="!label/label_to_symbol_key"
|
||||
latin:keyLabelFlags="fontNormal|preserveCase"
|
||||
latin:keyActionFlags="noKeyPreview"
|
||||
latin:backgroundType="functional" />
|
||||
<key-style
|
||||
latin:styleName="toAlphaKeyStyle"
|
||||
latin:code="!code/key_switch_alpha_symbol"
|
||||
latin:keyLabel="@string/label_to_alpha_key"
|
||||
latin:keyLabel="!label/label_to_alpha_key"
|
||||
latin:keyLabelFlags="fontNormal|preserveCase"
|
||||
latin:keyActionFlags="noKeyPreview"
|
||||
latin:backgroundType="functional" />
|
||||
<key-style
|
||||
latin:styleName="toMoreSymbolKeyStyle"
|
||||
latin:code="!code/key_shift"
|
||||
latin:keyLabel="@string/label_to_more_symbol_for_tablet_key"
|
||||
latin:keyLabel="!label/label_to_more_symbol_for_tablet_key"
|
||||
latin:keyLabelFlags="fontNormal|preserveCase"
|
||||
latin:keyActionFlags="noKeyPreview"
|
||||
latin:backgroundType="functional" />
|
||||
<key-style
|
||||
latin:styleName="backFromMoreSymbolKeyStyle"
|
||||
latin:code="!code/key_shift"
|
||||
latin:keyLabel="@string/label_to_symbol_key"
|
||||
latin:keyLabel="!label/label_to_symbol_key"
|
||||
latin:keyLabelFlags="fontNormal|preserveCase"
|
||||
latin:keyActionFlags="noKeyPreview"
|
||||
latin:backgroundType="functional" />
|
||||
<key-style
|
||||
latin:styleName="comKeyStyle"
|
||||
latin:keyLabel="@string/keylabel_for_popular_domain"
|
||||
latin:keyLabel="!label/keylabel_for_popular_domain"
|
||||
latin:keyLabelFlags="fontNormal|hasPopupHint|preserveCase"
|
||||
latin:keyOutputText="@string/keylabel_for_popular_domain"
|
||||
latin:moreKeys="@string/more_keys_for_popular_domain" />
|
||||
latin:keyOutputText="!label/keylabel_for_popular_domain"
|
||||
latin:moreKeys="!label/more_keys_for_popular_domain" />
|
||||
</merge>
|
||||
|
|
|
@ -39,9 +39,9 @@
|
|||
</case>
|
||||
<default>
|
||||
<Key
|
||||
latin:keyLabel="@string/keylabel_for_apostrophe"
|
||||
latin:keyHintLabel="@string/keyhintlabel_for_apostrophe"
|
||||
latin:moreKeys="@string/more_keys_for_apostrophe"
|
||||
latin:keyLabel="!label/keylabel_for_apostrophe"
|
||||
latin:keyHintLabel="!label/keyhintlabel_for_apostrophe"
|
||||
latin:moreKeys="!label/more_keys_for_apostrophe"
|
||||
latin:keyStyle="hasShiftedLetterHintStyle" />
|
||||
</default>
|
||||
</switch>
|
||||
|
@ -54,9 +54,9 @@
|
|||
</case>
|
||||
<default>
|
||||
<Key
|
||||
latin:keyLabel="@string/keylabel_for_dash"
|
||||
latin:keyHintLabel="@string/keyhintlabel_for_dash"
|
||||
latin:moreKeys="@string/more_keys_for_dash"
|
||||
latin:keyLabel="!label/keylabel_for_dash"
|
||||
latin:keyHintLabel="!label/keyhintlabel_for_dash"
|
||||
latin:moreKeys="!label/more_keys_for_dash"
|
||||
latin:keyStyle="hasShiftedLetterHintStyle" />
|
||||
</default>
|
||||
</switch>
|
||||
|
|
|
@ -72,7 +72,7 @@
|
|||
<Key
|
||||
latin:keyLabel=","
|
||||
latin:keyLabelFlags="hasPopupHint"
|
||||
latin:moreKeys="@string/more_keys_for_am_pm"
|
||||
latin:moreKeys="!label/more_keys_for_am_pm"
|
||||
latin:keyStyle="numKeyStyle"
|
||||
latin:keyWidth="8.047%p" />
|
||||
</case>
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
latin:keyWidth="37.500%p" />
|
||||
<Key
|
||||
latin:keyLabel="""
|
||||
latin:moreKeys="@string/more_keys_for_tablet_double_quote" />
|
||||
latin:moreKeys="!label/more_keys_for_tablet_double_quote" />
|
||||
<Key
|
||||
latin:keyLabel="_" />
|
||||
<switch>
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
<default>
|
||||
<Key
|
||||
latin:keyLabel="\'"
|
||||
latin:moreKeys="\@string/more_keys_for_single_quote" />
|
||||
latin:moreKeys="!label/more_keys_for_single_quote" />
|
||||
</default>
|
||||
</switch>
|
||||
</merge>
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
<key-style
|
||||
latin:styleName="f1MoreKeysStyle"
|
||||
latin:keyLabelFlags="hasPopupHint|preserveCase"
|
||||
latin:moreKeys="@string/settings_as_more_key"
|
||||
latin:moreKeys="!label/settings_as_more_key"
|
||||
latin:backgroundType="functional" />
|
||||
</default>
|
||||
</switch>
|
||||
|
@ -98,7 +98,7 @@
|
|||
latin:keyLabel=":-)"
|
||||
latin:keyOutputText=":-) "
|
||||
latin:keyLabelFlags="hasPopupHint"
|
||||
latin:moreKeys="@string/more_keys_for_smiley"
|
||||
latin:moreKeys="!label/more_keys_for_smiley"
|
||||
latin:backgroundType="functional" />
|
||||
</case>
|
||||
</switch>
|
||||
|
@ -158,7 +158,7 @@
|
|||
latin:styleName="toSymbolKeyStyle"
|
||||
latin:code="!code/key_switch_alpha_symbol"
|
||||
latin:keyIcon="iconShortcutForLabel"
|
||||
latin:keyLabel="@string/label_to_symbol_with_microphone_key"
|
||||
latin:keyLabel="!label/label_to_symbol_with_microphone_key"
|
||||
latin:keyLabelFlags="withIconRight|preserveCase"
|
||||
latin:keyActionFlags="noKeyPreview"
|
||||
latin:backgroundType="functional" />
|
||||
|
@ -167,7 +167,7 @@
|
|||
<key-style
|
||||
latin:styleName="toSymbolKeyStyle"
|
||||
latin:code="!code/key_switch_alpha_symbol"
|
||||
latin:keyLabel="@string/label_to_symbol_key"
|
||||
latin:keyLabel="!label/label_to_symbol_key"
|
||||
latin:keyLabelFlags="preserveCase"
|
||||
latin:keyActionFlags="noKeyPreview"
|
||||
latin:backgroundType="functional" />
|
||||
|
@ -176,29 +176,29 @@
|
|||
<key-style
|
||||
latin:styleName="toAlphaKeyStyle"
|
||||
latin:code="!code/key_switch_alpha_symbol"
|
||||
latin:keyLabel="@string/label_to_alpha_key"
|
||||
latin:keyLabel="!label/label_to_alpha_key"
|
||||
latin:keyLabelFlags="preserveCase"
|
||||
latin:keyActionFlags="noKeyPreview"
|
||||
latin:backgroundType="functional" />
|
||||
<key-style
|
||||
latin:styleName="toMoreSymbolKeyStyle"
|
||||
latin:code="!code/key_shift"
|
||||
latin:keyLabel="@string/label_to_more_symbol_key"
|
||||
latin:keyLabel="!label/label_to_more_symbol_key"
|
||||
latin:keyLabelFlags="preserveCase"
|
||||
latin:keyActionFlags="noKeyPreview"
|
||||
latin:backgroundType="functional" />
|
||||
<key-style
|
||||
latin:styleName="backFromMoreSymbolKeyStyle"
|
||||
latin:code="!code/key_shift"
|
||||
latin:keyLabel="@string/label_to_symbol_key"
|
||||
latin:keyLabel="!label/label_to_symbol_key"
|
||||
latin:keyLabelFlags="preserveCase"
|
||||
latin:keyActionFlags="noKeyPreview"
|
||||
latin:backgroundType="functional" />
|
||||
<key-style
|
||||
latin:styleName="punctuationKeyStyle"
|
||||
latin:keyLabel="."
|
||||
latin:keyHintLabel="@string/keyhintlabel_for_punctuation"
|
||||
latin:keyHintLabel="!label/keyhintlabel_for_punctuation"
|
||||
latin:keyLabelFlags="hasPopupHint|preserveCase"
|
||||
latin:moreKeys="@string/more_keys_for_punctuation"
|
||||
latin:moreKeys="!label/more_keys_for_punctuation"
|
||||
latin:backgroundType="functional" />
|
||||
</merge>
|
||||
|
|
|
@ -86,7 +86,7 @@
|
|||
<key-style
|
||||
latin:styleName="currencyKeyStyle"
|
||||
latin:keyLabel="₪"
|
||||
latin:moreKeys="@string/more_keys_for_currency_general" />
|
||||
latin:moreKeys="!label/more_keys_for_currency_general" />
|
||||
<key-style
|
||||
latin:styleName="moreCurrency1KeyStyle"
|
||||
latin:keyLabel="£" />
|
||||
|
@ -112,7 +112,7 @@
|
|||
<key-style
|
||||
latin:styleName="currencyKeyStyle"
|
||||
latin:keyLabel="﷼"
|
||||
latin:moreKeys="@string/more_keys_for_currency_general" />
|
||||
latin:moreKeys="!label/more_keys_for_currency_general" />
|
||||
<key-style
|
||||
latin:styleName="moreCurrency1KeyStyle"
|
||||
latin:keyLabel="£" />
|
||||
|
@ -138,7 +138,7 @@
|
|||
<key-style
|
||||
latin:styleName="currencyKeyStyle"
|
||||
latin:keyLabel="£"
|
||||
latin:moreKeys="@string/more_keys_for_currency_pound" />
|
||||
latin:moreKeys="!label/more_keys_for_currency_pound" />
|
||||
<key-style
|
||||
latin:styleName="moreCurrency1KeyStyle"
|
||||
latin:keyLabel="€" />
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
<key-style
|
||||
latin:styleName="currencyKeyStyle"
|
||||
latin:keyLabel="$"
|
||||
latin:moreKeys="@string/more_keys_for_currency_dollar" />
|
||||
latin:moreKeys="!label/more_keys_for_currency_dollar" />
|
||||
<key-style
|
||||
latin:styleName="moreCurrency1KeyStyle"
|
||||
latin:keyLabel="£" />
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
<key-style
|
||||
latin:styleName="currencyKeyStyle"
|
||||
latin:keyLabel="€"
|
||||
latin:moreKeys="@string/more_keys_for_currency_euro" />
|
||||
latin:moreKeys="!abel/more_keys_for_currency_euro" />
|
||||
<key-style
|
||||
latin:styleName="moreCurrency1KeyStyle"
|
||||
latin:keyLabel="£" />
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
<key-style
|
||||
latin:styleName="navigateMoreKeysStyle"
|
||||
latin:keyLabelFlags="hasPopupHint|preserveCase"
|
||||
latin:moreKeys="@string/action_previous_as_more_key" />
|
||||
latin:moreKeys="!label/action_previous_as_more_key" />
|
||||
</case>
|
||||
<case
|
||||
latin:imeAction="actionNext"
|
||||
|
@ -46,7 +46,7 @@
|
|||
<key-style
|
||||
latin:styleName="navigateMoreKeysStyle"
|
||||
latin:keyLabelFlags="hasPopupHint|preserveCase"
|
||||
latin:moreKeys="@string/action_next_as_more_key" />
|
||||
latin:moreKeys="!label/action_next_as_more_key" />
|
||||
</case>
|
||||
<case
|
||||
latin:imeAction="actionPrevious"
|
||||
|
@ -63,7 +63,7 @@
|
|||
<key-style
|
||||
latin:styleName="navigateMoreKeysStyle"
|
||||
latin:keyLabelFlags="hasPopupHint|preserveCase"
|
||||
latin:moreKeys="!fixedColumnOrder!2,!needsDividers!,@string/action_previous_as_more_key,@string/action_next_as_more_key" />
|
||||
latin:moreKeys="!fixedColumnOrder!2,!needsDividers!,!label/action_previous_as_more_key,!label/action_next_as_more_key" />
|
||||
</case>
|
||||
<case
|
||||
latin:navigateNext="true"
|
||||
|
@ -72,7 +72,7 @@
|
|||
<key-style
|
||||
latin:styleName="navigateMoreKeysStyle"
|
||||
latin:keyLabelFlags="hasPopupHint|preserveCase"
|
||||
latin:moreKeys="@string/action_next_as_more_key" />
|
||||
latin:moreKeys="!label/action_next_as_more_key" />
|
||||
</case>
|
||||
<case
|
||||
latin:navigateNext="false"
|
||||
|
@ -81,7 +81,7 @@
|
|||
<key-style
|
||||
latin:styleName="navigateMoreKeysStyle"
|
||||
latin:keyLabelFlags="hasPopupHint|preserveCase"
|
||||
latin:moreKeys="@string/action_previous_as_more_key" />
|
||||
latin:moreKeys="!label/action_previous_as_more_key" />
|
||||
</case>
|
||||
<!-- naviagteNext="false" and navigatePrevious="false" -->
|
||||
<default>
|
||||
|
@ -119,7 +119,7 @@
|
|||
>
|
||||
<key-style
|
||||
latin:styleName="enterKeyStyle"
|
||||
latin:keyLabel="@string/label_go_key"
|
||||
latin:keyLabel="!label/label_go_key"
|
||||
latin:parentStyle="defaultActionKeyStyle" />
|
||||
</case>
|
||||
<case
|
||||
|
@ -127,7 +127,7 @@
|
|||
>
|
||||
<key-style
|
||||
latin:styleName="enterKeyStyle"
|
||||
latin:keyLabel="@string/label_next_key"
|
||||
latin:keyLabel="!label/label_next_key"
|
||||
latin:parentStyle="defaultActionKeyStyle" />
|
||||
</case>
|
||||
<case
|
||||
|
@ -135,7 +135,7 @@
|
|||
>
|
||||
<key-style
|
||||
latin:styleName="enterKeyStyle"
|
||||
latin:keyLabel="@string/label_previous_key"
|
||||
latin:keyLabel="!label/label_previous_key"
|
||||
latin:parentStyle="defaultActionKeyStyle" />
|
||||
</case>
|
||||
<case
|
||||
|
@ -143,7 +143,7 @@
|
|||
>
|
||||
<key-style
|
||||
latin:styleName="enterKeyStyle"
|
||||
latin:keyLabel="@string/label_done_key"
|
||||
latin:keyLabel="!label/label_done_key"
|
||||
latin:parentStyle="defaultActionKeyStyle" />
|
||||
</case>
|
||||
<case
|
||||
|
@ -151,7 +151,7 @@
|
|||
>
|
||||
<key-style
|
||||
latin:styleName="enterKeyStyle"
|
||||
latin:keyLabel="@string/label_send_key"
|
||||
latin:keyLabel="!label/label_send_key"
|
||||
latin:parentStyle="defaultActionKeyStyle" />
|
||||
</case>
|
||||
<case
|
||||
|
|
|
@ -100,25 +100,25 @@
|
|||
<key-style
|
||||
latin:styleName="numPhoneToSymbolKeyStyle"
|
||||
latin:code="!code/key_switch_alpha_symbol"
|
||||
latin:keyLabel="@string/label_to_phone_symbols_key"
|
||||
latin:keyLabel="!label/label_to_phone_symbols_key"
|
||||
latin:parentStyle="numModeKeyStyle" />
|
||||
<key-style
|
||||
latin:styleName="numPhoneToNumericKeyStyle"
|
||||
latin:code="!code/key_switch_alpha_symbol"
|
||||
latin:keyLabel="@string/label_to_phone_numeric_key"
|
||||
latin:keyLabel="!label/label_to_phone_numeric_key"
|
||||
latin:parentStyle="numModeKeyStyle" />
|
||||
<!-- U+002C: "," COMMA -->
|
||||
<key-style
|
||||
latin:styleName="numPauseKeyStyle"
|
||||
latin:code="0x002C"
|
||||
latin:keyLabel="@string/label_pause_key"
|
||||
latin:keyLabel="!label/label_pause_key"
|
||||
latin:keyLabelFlags="followKeyHintLabelRatio|autoXScale"
|
||||
latin:parentStyle="numKeyBaseStyle" />
|
||||
<!-- U+003B: ";" SEMICOLON -->
|
||||
<key-style
|
||||
latin:styleName="numWaitKeyStyle"
|
||||
latin:code="0x003B"
|
||||
latin:keyLabel="@string/label_wait_key"
|
||||
latin:keyLabel="!label/label_wait_key"
|
||||
latin:keyLabelFlags="followKeyHintLabelRatio|autoXScale"
|
||||
latin:parentStyle="numKeyBaseStyle" />
|
||||
<key-style
|
||||
|
|
|
@ -24,9 +24,9 @@
|
|||
<Key
|
||||
latin:keyLabel="<"
|
||||
latin:code="!code/key_less_than"
|
||||
latin:moreKeys="@string/more_keys_for_less_than" />
|
||||
latin:moreKeys="!label/more_keys_for_less_than" />
|
||||
<Key
|
||||
latin:keyLabel=">"
|
||||
latin:code="!code/key_greater_than"
|
||||
latin:moreKeys="@string/more_keys_for_greater_than" />
|
||||
latin:moreKeys="!label/more_keys_for_greater_than" />
|
||||
</merge>
|
||||
|
|
|
@ -24,9 +24,9 @@
|
|||
<Key
|
||||
latin:keyLabel="("
|
||||
latin:code="!code/key_left_parenthesis"
|
||||
latin:moreKeys="@string/more_keys_for_left_parenthesis" />
|
||||
latin:moreKeys="!label/more_keys_for_left_parenthesis" />
|
||||
<Key
|
||||
latin:keyLabel=")"
|
||||
latin:code="!code/key_right_parenthesis"
|
||||
latin:moreKeys="@string/more_keys_for_right_parenthesis" />
|
||||
latin:moreKeys="!label/more_keys_for_right_parenthesis" />
|
||||
</merge>
|
||||
|
|
|
@ -51,9 +51,9 @@
|
|||
<!-- latin:hasShortcutKey="false" -->
|
||||
<default>
|
||||
<Key
|
||||
latin:keyLabel="@string/keylabel_for_comma"
|
||||
latin:keyLabel="!label/keylabel_for_comma"
|
||||
latin:keyLabelFlags="hasPopupHint"
|
||||
latin:additionalMoreKeys="@string/more_keys_for_comma"
|
||||
latin:additionalMoreKeys="!label/more_keys_for_comma"
|
||||
latin:keyStyle="f1MoreKeysStyle" />
|
||||
</default>
|
||||
</switch>
|
||||
|
|
|
@ -25,47 +25,47 @@
|
|||
latin:keyLabel="a"
|
||||
latin:keyHintLabel="1"
|
||||
latin:additionalMoreKeys="1"
|
||||
latin:moreKeys="@string/more_keys_for_a" />
|
||||
latin:moreKeys="!label/more_keys_for_a" />
|
||||
<Key
|
||||
latin:keyLabel="z"
|
||||
latin:keyHintLabel="2"
|
||||
latin:additionalMoreKeys="2"
|
||||
latin:moreKeys="@string/more_keys_for_z" />
|
||||
latin:moreKeys="!label/more_keys_for_z" />
|
||||
<Key
|
||||
latin:keyLabel="e"
|
||||
latin:keyHintLabel="3"
|
||||
latin:additionalMoreKeys="3"
|
||||
latin:moreKeys="@string/more_keys_for_e" />
|
||||
latin:moreKeys="!label/more_keys_for_e" />
|
||||
<Key
|
||||
latin:keyLabel="r"
|
||||
latin:keyHintLabel="4"
|
||||
latin:additionalMoreKeys="4"
|
||||
latin:moreKeys="@string/more_keys_for_r" />
|
||||
latin:moreKeys="!label/more_keys_for_r" />
|
||||
<Key
|
||||
latin:keyLabel="t"
|
||||
latin:keyHintLabel="5"
|
||||
latin:additionalMoreKeys="5"
|
||||
latin:moreKeys="@string/more_keys_for_t" />
|
||||
latin:moreKeys="!label/more_keys_for_t" />
|
||||
<Key
|
||||
latin:keyLabel="y"
|
||||
latin:keyHintLabel="6"
|
||||
latin:additionalMoreKeys="6"
|
||||
latin:moreKeys="@string/more_keys_for_y" />
|
||||
latin:moreKeys="!label/more_keys_for_y" />
|
||||
<Key
|
||||
latin:keyLabel="u"
|
||||
latin:keyHintLabel="7"
|
||||
latin:additionalMoreKeys="7"
|
||||
latin:moreKeys="@string/more_keys_for_u" />
|
||||
latin:moreKeys="!label/more_keys_for_u" />
|
||||
<Key
|
||||
latin:keyLabel="i"
|
||||
latin:keyHintLabel="8"
|
||||
latin:additionalMoreKeys="8"
|
||||
latin:moreKeys="@string/more_keys_for_i" />
|
||||
latin:moreKeys="!label/more_keys_for_i" />
|
||||
<Key
|
||||
latin:keyLabel="o"
|
||||
latin:keyHintLabel="9"
|
||||
latin:additionalMoreKeys="9"
|
||||
latin:moreKeys="@string/more_keys_for_o" />
|
||||
latin:moreKeys="!label/more_keys_for_o" />
|
||||
<Key
|
||||
latin:keyLabel="p"
|
||||
latin:keyHintLabel="0"
|
||||
|
|
|
@ -25,27 +25,27 @@
|
|||
latin:keyLabel="q" />
|
||||
<Key
|
||||
latin:keyLabel="s"
|
||||
latin:moreKeys="@string/more_keys_for_s" />
|
||||
latin:moreKeys="!label/more_keys_for_s" />
|
||||
<Key
|
||||
latin:keyLabel="d"
|
||||
latin:moreKeys="@string/more_keys_for_d" />
|
||||
latin:moreKeys="!label/more_keys_for_d" />
|
||||
<Key
|
||||
latin:keyLabel="f" />
|
||||
<Key
|
||||
latin:keyLabel="g"
|
||||
latin:moreKeys="@string/more_keys_for_g" />
|
||||
latin:moreKeys="!label/more_keys_for_g" />
|
||||
<Key
|
||||
latin:keyLabel="h"
|
||||
latin:moreKeys="@string/more_keys_for_h" />
|
||||
latin:moreKeys="!label/more_keys_for_h" />
|
||||
<Key
|
||||
latin:keyLabel="j"
|
||||
latin:moreKeys="@string/more_keys_for_j" />
|
||||
latin:moreKeys="!label/more_keys_for_j" />
|
||||
<Key
|
||||
latin:keyLabel="k"
|
||||
latin:moreKeys="@string/more_keys_for_k" />
|
||||
latin:moreKeys="!label/more_keys_for_k" />
|
||||
<Key
|
||||
latin:keyLabel="l"
|
||||
latin:moreKeys="@string/more_keys_for_l" />
|
||||
latin:moreKeys="!label/more_keys_for_l" />
|
||||
<Key
|
||||
latin:keyLabel="m" />
|
||||
</merge>
|
||||
|
|
|
@ -23,20 +23,20 @@
|
|||
>
|
||||
<Key
|
||||
latin:keyLabel="w"
|
||||
latin:moreKeys="@string/more_keys_for_w" />
|
||||
latin:moreKeys="!label/more_keys_for_w" />
|
||||
<Key
|
||||
latin:keyLabel="x" />
|
||||
<Key
|
||||
latin:keyLabel="c"
|
||||
latin:moreKeys="@string/more_keys_for_c" />
|
||||
latin:moreKeys="!label/more_keys_for_c" />
|
||||
<Key
|
||||
latin:keyLabel="v"
|
||||
latin:moreKeys="@string/more_keys_for_v" />
|
||||
latin:moreKeys="!label/more_keys_for_v" />
|
||||
<Key
|
||||
latin:keyLabel="b" />
|
||||
<Key
|
||||
latin:keyLabel="n"
|
||||
latin:moreKeys="@string/more_keys_for_n" />
|
||||
latin:moreKeys="!label/more_keys_for_n" />
|
||||
<include
|
||||
latin:keyboardLayout="@xml/key_azerty_quote" />
|
||||
</merge>
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
latin:keyLabel="у"
|
||||
latin:keyHintLabel="3"
|
||||
latin:additionalMoreKeys="3"
|
||||
latin:moreKeys="@string/more_keys_for_cyrillic_u" />
|
||||
latin:moreKeys="!label/more_keys_for_cyrillic_u" />
|
||||
<!-- U+043A: "к" CYRILLIC SMALL LETTER KA -->
|
||||
<Key
|
||||
latin:keyLabel="к"
|
||||
|
@ -47,13 +47,13 @@
|
|||
latin:keyLabel="е"
|
||||
latin:keyHintLabel="5"
|
||||
latin:additionalMoreKeys="5"
|
||||
latin:moreKeys="@string/more_keys_for_cyrillic_ye" />
|
||||
latin:moreKeys="!label/more_keys_for_cyrillic_ye" />
|
||||
<!-- U+043D: "н" CYRILLIC SMALL LETTER EN -->
|
||||
<Key
|
||||
latin:keyLabel="н"
|
||||
latin:keyHintLabel="6"
|
||||
latin:additionalMoreKeys="6"
|
||||
latin:moreKeys="@string/more_keys_for_cyrillic_en" />
|
||||
latin:moreKeys="!label/more_keys_for_cyrillic_en" />
|
||||
<!-- U+0433: "г" CYRILLIC SMALL LETTER GHE -->
|
||||
<Key
|
||||
latin:keyLabel="г"
|
||||
|
@ -65,7 +65,7 @@
|
|||
latin:keyHintLabel="8"
|
||||
latin:additionalMoreKeys="8" />
|
||||
<Key
|
||||
latin:keyLabel="@string/keylabel_for_east_slavic_row1_9"
|
||||
latin:keyLabel="!label/keylabel_for_east_slavic_row1_9"
|
||||
latin:keyHintLabel="9"
|
||||
latin:additionalMoreKeys="9" />
|
||||
<!-- U+0437: "з" CYRILLIC SMALL LETTER ZE -->
|
||||
|
@ -76,5 +76,5 @@
|
|||
<!-- U+0445: "х" CYRILLIC SMALL LETTER HA -->
|
||||
<Key
|
||||
latin:keyLabel="х"
|
||||
latin:moreKeys="@string/more_keys_for_cyrillic_ha" />
|
||||
latin:moreKeys="!label/more_keys_for_cyrillic_ha" />
|
||||
</merge>
|
||||
|
|
|
@ -25,8 +25,8 @@
|
|||
<Key
|
||||
latin:keyLabel="ф" />
|
||||
<Key
|
||||
latin:keyLabel="@string/keylabel_for_east_slavic_row2_1"
|
||||
latin:moreKeys="@string/more_keys_for_east_slavic_row2_1" />
|
||||
latin:keyLabel="!label/keylabel_for_east_slavic_row2_1"
|
||||
latin:moreKeys="!label/more_keys_for_east_slavic_row2_1" />
|
||||
<!-- U+0432: "в" CYRILLIC SMALL LETTER VE -->
|
||||
<Key
|
||||
latin:keyLabel="в" />
|
||||
|
@ -42,7 +42,7 @@
|
|||
<!-- U+043E: "о" CYRILLIC SMALL LETTER O -->
|
||||
<Key
|
||||
latin:keyLabel="о"
|
||||
latin:moreKeys="@string/more_keys_for_cyrillic_o" />
|
||||
latin:moreKeys="!label/more_keys_for_cyrillic_o" />
|
||||
<!-- U+043B: "л" CYRILLIC SMALL LETTER EL -->
|
||||
<Key
|
||||
latin:keyLabel="л" />
|
||||
|
|
|
@ -34,14 +34,14 @@
|
|||
<Key
|
||||
latin:keyLabel="м" />
|
||||
<Key
|
||||
latin:keyLabel="@string/keylabel_for_east_slavic_row3_5" />
|
||||
latin:keyLabel="!label/keylabel_for_east_slavic_row3_5" />
|
||||
<!-- U+0442: "т" CYRILLIC SMALL LETTER TE -->
|
||||
<Key
|
||||
latin:keyLabel="т" />
|
||||
<!-- U+044C: "ь" CYRILLIC SMALL LETTER SOFT SIGN -->
|
||||
<Key
|
||||
latin:keyLabel="ь"
|
||||
latin:moreKeys="@string/more_keys_for_cyrillic_soft_sign" />
|
||||
latin:moreKeys="!label/more_keys_for_cyrillic_soft_sign" />
|
||||
<!-- U+0431: "б" CYRILLIC SMALL LETTER BE -->
|
||||
<Key
|
||||
latin:keyLabel="б" />
|
||||
|
|
|
@ -24,5 +24,5 @@
|
|||
<include
|
||||
latin:keyboardLayout="@xml/rowkeys_qwerty1" />
|
||||
<Key
|
||||
latin:keyLabel="@string/keylabel_for_nordic_row1_11" />
|
||||
latin:keyLabel="!label/keylabel_for_nordic_row1_11" />
|
||||
</merge>
|
||||
|
|
|
@ -24,9 +24,9 @@
|
|||
<include
|
||||
latin:keyboardLayout="@xml/rowkeys_qwerty2" />
|
||||
<Key
|
||||
latin:keyLabel="@string/keylabel_for_nordic_row2_10"
|
||||
latin:moreKeys="@string/more_keys_for_nordic_row2_10" />
|
||||
latin:keyLabel="!label/keylabel_for_nordic_row2_10"
|
||||
latin:moreKeys="!label/more_keys_for_nordic_row2_10" />
|
||||
<Key
|
||||
latin:keyLabel="@string/keylabel_for_nordic_row2_11"
|
||||
latin:moreKeys="@string/more_keys_for_nordic_row2_11" />
|
||||
latin:keyLabel="!label/keylabel_for_nordic_row2_11"
|
||||
latin:moreKeys="!label/more_keys_for_nordic_row2_11" />
|
||||
</merge>
|
||||
|
|
|
@ -29,42 +29,42 @@
|
|||
latin:keyLabel="w"
|
||||
latin:keyHintLabel="2"
|
||||
latin:additionalMoreKeys="2"
|
||||
latin:moreKeys="@string/more_keys_for_w" />
|
||||
latin:moreKeys="!label/more_keys_for_w" />
|
||||
<Key
|
||||
latin:keyLabel="e"
|
||||
latin:keyHintLabel="3"
|
||||
latin:additionalMoreKeys="3"
|
||||
latin:moreKeys="@string/more_keys_for_e" />
|
||||
latin:moreKeys="!label/more_keys_for_e" />
|
||||
<Key
|
||||
latin:keyLabel="r"
|
||||
latin:keyHintLabel="4"
|
||||
latin:additionalMoreKeys="4"
|
||||
latin:moreKeys="@string/more_keys_for_r" />
|
||||
latin:moreKeys="!label/more_keys_for_r" />
|
||||
<Key
|
||||
latin:keyLabel="t"
|
||||
latin:keyHintLabel="5"
|
||||
latin:additionalMoreKeys="5"
|
||||
latin:moreKeys="@string/more_keys_for_t" />
|
||||
latin:moreKeys="!label/more_keys_for_t" />
|
||||
<Key
|
||||
latin:keyLabel="y"
|
||||
latin:keyHintLabel="6"
|
||||
latin:additionalMoreKeys="6"
|
||||
latin:moreKeys="@string/more_keys_for_y" />
|
||||
latin:moreKeys="!label/more_keys_for_y" />
|
||||
<Key
|
||||
latin:keyLabel="u"
|
||||
latin:keyHintLabel="7"
|
||||
latin:additionalMoreKeys="7"
|
||||
latin:moreKeys="@string/more_keys_for_u" />
|
||||
latin:moreKeys="!label/more_keys_for_u" />
|
||||
<Key
|
||||
latin:keyLabel="i"
|
||||
latin:keyHintLabel="8"
|
||||
latin:additionalMoreKeys="8"
|
||||
latin:moreKeys="@string/more_keys_for_i" />
|
||||
latin:moreKeys="!label/more_keys_for_i" />
|
||||
<Key
|
||||
latin:keyLabel="o"
|
||||
latin:keyHintLabel="9"
|
||||
latin:additionalMoreKeys="9"
|
||||
latin:moreKeys="@string/more_keys_for_o" />
|
||||
latin:moreKeys="!label/more_keys_for_o" />
|
||||
<Key
|
||||
latin:keyLabel="p"
|
||||
latin:keyHintLabel="0"
|
||||
|
|
|
@ -23,28 +23,28 @@
|
|||
>
|
||||
<Key
|
||||
latin:keyLabel="a"
|
||||
latin:moreKeys="@string/more_keys_for_a" />
|
||||
latin:moreKeys="!label/more_keys_for_a" />
|
||||
<Key
|
||||
latin:keyLabel="s"
|
||||
latin:moreKeys="@string/more_keys_for_s" />
|
||||
latin:moreKeys="!label/more_keys_for_s" />
|
||||
<Key
|
||||
latin:keyLabel="d"
|
||||
latin:moreKeys="@string/more_keys_for_d" />
|
||||
latin:moreKeys="!label/more_keys_for_d" />
|
||||
<Key
|
||||
latin:keyLabel="f" />
|
||||
<Key
|
||||
latin:keyLabel="g"
|
||||
latin:moreKeys="@string/more_keys_for_g" />
|
||||
latin:moreKeys="!label/more_keys_for_g" />
|
||||
<Key
|
||||
latin:keyLabel="h"
|
||||
latin:moreKeys="@string/more_keys_for_h" />
|
||||
latin:moreKeys="!label/more_keys_for_h" />
|
||||
<Key
|
||||
latin:keyLabel="j"
|
||||
latin:moreKeys="@string/more_keys_for_j" />
|
||||
latin:moreKeys="!label/more_keys_for_j" />
|
||||
<Key
|
||||
latin:keyLabel="k"
|
||||
latin:moreKeys="@string/more_keys_for_k" />
|
||||
latin:moreKeys="!label/more_keys_for_k" />
|
||||
<Key
|
||||
latin:keyLabel="l"
|
||||
latin:moreKeys="@string/more_keys_for_l" />
|
||||
latin:moreKeys="!label/more_keys_for_l" />
|
||||
</merge>
|
||||
|
|
|
@ -23,20 +23,20 @@
|
|||
>
|
||||
<Key
|
||||
latin:keyLabel="z"
|
||||
latin:moreKeys="@string/more_keys_for_z" />
|
||||
latin:moreKeys="!label/more_keys_for_z" />
|
||||
<Key
|
||||
latin:keyLabel="x" />
|
||||
<Key
|
||||
latin:keyLabel="c"
|
||||
latin:moreKeys="@string/more_keys_for_c" />
|
||||
latin:moreKeys="!label/more_keys_for_c" />
|
||||
<Key
|
||||
latin:keyLabel="v"
|
||||
latin:moreKeys="@string/more_keys_for_v" />
|
||||
latin:moreKeys="!label/more_keys_for_v" />
|
||||
<Key
|
||||
latin:keyLabel="b" />
|
||||
<Key
|
||||
latin:keyLabel="n"
|
||||
latin:moreKeys="@string/more_keys_for_n" />
|
||||
latin:moreKeys="!label/more_keys_for_n" />
|
||||
<Key
|
||||
latin:keyLabel="m" />
|
||||
</merge>
|
||||
|
|
|
@ -29,42 +29,42 @@
|
|||
latin:keyLabel="w"
|
||||
latin:keyHintLabel="2"
|
||||
latin:additionalMoreKeys="2"
|
||||
latin:moreKeys="@string/more_keys_for_w" />
|
||||
latin:moreKeys="!label/more_keys_for_w" />
|
||||
<Key
|
||||
latin:keyLabel="e"
|
||||
latin:keyHintLabel="3"
|
||||
latin:additionalMoreKeys="3"
|
||||
latin:moreKeys="@string/more_keys_for_e" />
|
||||
latin:moreKeys="!label/more_keys_for_e" />
|
||||
<Key
|
||||
latin:keyLabel="r"
|
||||
latin:keyHintLabel="4"
|
||||
latin:additionalMoreKeys="4"
|
||||
latin:moreKeys="@string/more_keys_for_r" />
|
||||
latin:moreKeys="!label/more_keys_for_r" />
|
||||
<Key
|
||||
latin:keyLabel="t"
|
||||
latin:keyHintLabel="5"
|
||||
latin:additionalMoreKeys="5"
|
||||
latin:moreKeys="@string/more_keys_for_t" />
|
||||
latin:moreKeys="!label/more_keys_for_t" />
|
||||
<Key
|
||||
latin:keyLabel="z"
|
||||
latin:keyHintLabel="6"
|
||||
latin:additionalMoreKeys="6"
|
||||
latin:moreKeys="@string/more_keys_for_z" />
|
||||
latin:moreKeys="!label/more_keys_for_z" />
|
||||
<Key
|
||||
latin:keyLabel="u"
|
||||
latin:keyHintLabel="7"
|
||||
latin:additionalMoreKeys="7"
|
||||
latin:moreKeys="@string/more_keys_for_u" />
|
||||
latin:moreKeys="!label/more_keys_for_u" />
|
||||
<Key
|
||||
latin:keyLabel="i"
|
||||
latin:keyHintLabel="8"
|
||||
latin:additionalMoreKeys="8"
|
||||
latin:moreKeys="@string/more_keys_for_i" />
|
||||
latin:moreKeys="!label/more_keys_for_i" />
|
||||
<Key
|
||||
latin:keyLabel="o"
|
||||
latin:keyHintLabel="9"
|
||||
latin:additionalMoreKeys="9"
|
||||
latin:moreKeys="@string/more_keys_for_o" />
|
||||
latin:moreKeys="!label/more_keys_for_o" />
|
||||
<Key
|
||||
latin:keyLabel="p"
|
||||
latin:keyHintLabel="0"
|
||||
|
|
|
@ -23,20 +23,20 @@
|
|||
>
|
||||
<Key
|
||||
latin:keyLabel="y"
|
||||
latin:moreKeys="@string/more_keys_for_y" />
|
||||
latin:moreKeys="!label/more_keys_for_y" />
|
||||
<Key
|
||||
latin:keyLabel="x" />
|
||||
<Key
|
||||
latin:keyLabel="c"
|
||||
latin:moreKeys="@string/more_keys_for_c" />
|
||||
latin:moreKeys="!label/more_keys_for_c" />
|
||||
<Key
|
||||
latin:keyLabel="v"
|
||||
latin:moreKeys="@string/more_keys_for_v" />
|
||||
latin:moreKeys="!label/more_keys_for_v" />
|
||||
<Key
|
||||
latin:keyLabel="b" />
|
||||
<Key
|
||||
latin:keyLabel="n"
|
||||
latin:moreKeys="@string/more_keys_for_n" />
|
||||
latin:moreKeys="!label/more_keys_for_n" />
|
||||
<Key
|
||||
latin:keyLabel="m" />
|
||||
</merge>
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
latin:keyLabel="е"
|
||||
latin:keyHintLabel="3"
|
||||
latin:additionalMoreKeys="3"
|
||||
latin:moreKeys="@string/more_keys_for_cyrillic_ie" />
|
||||
latin:moreKeys="!label/more_keys_for_cyrillic_ie" />
|
||||
<!-- U+0440: "р" CYRILLIC SMALL LETTER ER -->
|
||||
<Key
|
||||
latin:keyLabel="р"
|
||||
|
@ -48,7 +48,7 @@
|
|||
latin:keyHintLabel="5"
|
||||
latin:additionalMoreKeys="5" />
|
||||
<Key
|
||||
latin:keyLabel="@string/keylabel_for_south_slavic_row1_6"
|
||||
latin:keyLabel="!label/keylabel_for_south_slavic_row1_6"
|
||||
latin:keyHintLabel="6"
|
||||
latin:additionalMoreKeys="6" />
|
||||
<!-- U+0443: "у" CYRILLIC SMALL LETTER U -->
|
||||
|
@ -61,7 +61,7 @@
|
|||
latin:keyLabel="и"
|
||||
latin:keyHintLabel="8"
|
||||
latin:additionalMoreKeys="8"
|
||||
latin:moreKeys="@string/more_keys_for_cyrillic_i" />
|
||||
latin:moreKeys="!label/more_keys_for_cyrillic_i" />
|
||||
<!-- U+043E: "о" CYRILLIC SMALL LETTER O -->
|
||||
<Key
|
||||
latin:keyLabel="о"
|
||||
|
|
|
@ -52,5 +52,5 @@
|
|||
<Key
|
||||
latin:keyLabel="ч" />
|
||||
<Key
|
||||
latin:keyLabel="@string/keylabel_for_south_slavic_row2_11" />
|
||||
latin:keyLabel="!label/keylabel_for_south_slavic_row2_11" />
|
||||
</merge>
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
|
||||
>
|
||||
<Key
|
||||
latin:keyLabel="@string/keylabel_for_south_slavic_row3_1" />
|
||||
latin:keyLabel="!label/keylabel_for_south_slavic_row3_1" />
|
||||
<!-- U+045F: "џ" CYRILLIC SMALL LETTER DZHE -->
|
||||
<Key
|
||||
latin:keyLabel="џ" />
|
||||
|
@ -42,7 +42,7 @@
|
|||
<Key
|
||||
latin:keyLabel="м" />
|
||||
<Key
|
||||
latin:keyLabel="@string/keylabel_for_south_slavic_row3_8" />
|
||||
latin:keyLabel="!label/keylabel_for_south_slavic_row3_8" />
|
||||
<!-- U+0436: "ж" CYRILLIC SMALL LETTER ZHE -->
|
||||
<Key
|
||||
latin:keyLabel="ж" />
|
||||
|
|
|
@ -22,43 +22,43 @@
|
|||
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
|
||||
>
|
||||
<Key
|
||||
latin:keyLabel="@string/keylabel_for_symbols_1"
|
||||
latin:additionalMoreKeys="@string/additional_more_keys_for_symbols_1"
|
||||
latin:moreKeys="@string/more_keys_for_symbols_1" />
|
||||
latin:keyLabel="!label/keylabel_for_symbols_1"
|
||||
latin:additionalMoreKeys="!label/additional_more_keys_for_symbols_1"
|
||||
latin:moreKeys="!label/more_keys_for_symbols_1" />
|
||||
<Key
|
||||
latin:keyLabel="@string/keylabel_for_symbols_2"
|
||||
latin:additionalMoreKeys="@string/additional_more_keys_for_symbols_2"
|
||||
latin:moreKeys="@string/more_keys_for_symbols_2" />
|
||||
latin:keyLabel="!label/keylabel_for_symbols_2"
|
||||
latin:additionalMoreKeys="!label/additional_more_keys_for_symbols_2"
|
||||
latin:moreKeys="!label/more_keys_for_symbols_2" />
|
||||
<Key
|
||||
latin:keyLabel="@string/keylabel_for_symbols_3"
|
||||
latin:additionalMoreKeys="@string/additional_more_keys_for_symbols_3"
|
||||
latin:moreKeys="@string/more_keys_for_symbols_3" />
|
||||
latin:keyLabel="!label/keylabel_for_symbols_3"
|
||||
latin:additionalMoreKeys="!label/additional_more_keys_for_symbols_3"
|
||||
latin:moreKeys="!label/more_keys_for_symbols_3" />
|
||||
<Key
|
||||
latin:keyLabel="@string/keylabel_for_symbols_4"
|
||||
latin:additionalMoreKeys="@string/additional_more_keys_for_symbols_4"
|
||||
latin:moreKeys="@string/more_keys_for_symbols_4" />
|
||||
latin:keyLabel="!label/keylabel_for_symbols_4"
|
||||
latin:additionalMoreKeys="!label/additional_more_keys_for_symbols_4"
|
||||
latin:moreKeys="!label/more_keys_for_symbols_4" />
|
||||
<Key
|
||||
latin:keyLabel="@string/keylabel_for_symbols_5"
|
||||
latin:additionalMoreKeys="@string/additional_more_keys_for_symbols_5"
|
||||
latin:moreKeys="@string/more_keys_for_symbols_5" />
|
||||
latin:keyLabel="!label/keylabel_for_symbols_5"
|
||||
latin:additionalMoreKeys="!label/additional_more_keys_for_symbols_5"
|
||||
latin:moreKeys="!label/more_keys_for_symbols_5" />
|
||||
<Key
|
||||
latin:keyLabel="@string/keylabel_for_symbols_6"
|
||||
latin:additionalMoreKeys="@string/additional_more_keys_for_symbols_6"
|
||||
latin:moreKeys="@string/more_keys_for_symbols_6" />
|
||||
latin:keyLabel="!label/keylabel_for_symbols_6"
|
||||
latin:additionalMoreKeys="!label/additional_more_keys_for_symbols_6"
|
||||
latin:moreKeys="!label/more_keys_for_symbols_6" />
|
||||
<Key
|
||||
latin:keyLabel="@string/keylabel_for_symbols_7"
|
||||
latin:additionalMoreKeys="@string/additional_more_keys_for_symbols_7"
|
||||
latin:moreKeys="@string/more_keys_for_symbols_7" />
|
||||
latin:keyLabel="!label/keylabel_for_symbols_7"
|
||||
latin:additionalMoreKeys="!label/additional_more_keys_for_symbols_7"
|
||||
latin:moreKeys="!label/more_keys_for_symbols_7" />
|
||||
<Key
|
||||
latin:keyLabel="@string/keylabel_for_symbols_8"
|
||||
latin:additionalMoreKeys="@string/additional_more_keys_for_symbols_8"
|
||||
latin:moreKeys="@string/more_keys_for_symbols_8" />
|
||||
latin:keyLabel="!label/keylabel_for_symbols_8"
|
||||
latin:additionalMoreKeys="!label/additional_more_keys_for_symbols_8"
|
||||
latin:moreKeys="!label/more_keys_for_symbols_8" />
|
||||
<Key
|
||||
latin:keyLabel="@string/keylabel_for_symbols_9"
|
||||
latin:additionalMoreKeys="@string/additional_more_keys_for_symbols_9"
|
||||
latin:moreKeys="@string/more_keys_for_symbols_9" />
|
||||
latin:keyLabel="!label/keylabel_for_symbols_9"
|
||||
latin:additionalMoreKeys="!label/additional_more_keys_for_symbols_9"
|
||||
latin:moreKeys="!label/more_keys_for_symbols_9" />
|
||||
<Key
|
||||
latin:keyLabel="@string/keylabel_for_symbols_0"
|
||||
latin:additionalMoreKeys="@string/additional_more_keys_for_symbols_0"
|
||||
latin:moreKeys="@string/more_keys_for_symbols_0" />
|
||||
latin:keyLabel="!label/keylabel_for_symbols_0"
|
||||
latin:additionalMoreKeys="!label/additional_more_keys_for_symbols_0"
|
||||
latin:moreKeys="!label/more_keys_for_symbols_0" />
|
||||
</merge>
|
||||
|
|
|
@ -28,21 +28,21 @@
|
|||
<Key
|
||||
latin:keyStyle="currencyKeyStyle" />
|
||||
<Key
|
||||
latin:keyLabel="@string/keylabel_for_symbols_percent"
|
||||
latin:moreKeys="@string/more_keys_for_symbols_percent" />
|
||||
latin:keyLabel="!label/keylabel_for_symbols_percent"
|
||||
latin:moreKeys="!label/more_keys_for_symbols_percent" />
|
||||
<Key
|
||||
latin:keyLabel="&" />
|
||||
<Key
|
||||
latin:keyLabel="*"
|
||||
latin:moreKeys="@string/more_keys_for_star" />
|
||||
latin:moreKeys="!label/more_keys_for_star" />
|
||||
<!-- U+2013: "–" EN DASH
|
||||
U+2014: "—" EM DASH -->
|
||||
U+2014: "—" EM DASH -->
|
||||
<Key
|
||||
latin:keyLabel="-"
|
||||
latin:moreKeys="_,–,—" />
|
||||
<Key
|
||||
latin:keyLabel="+"
|
||||
latin:moreKeys="@string/more_keys_for_plus" />
|
||||
latin:moreKeys="!label/more_keys_for_plus" />
|
||||
<include
|
||||
latin:keyboardLayout="@xml/keys_parentheses" />
|
||||
</merge>
|
||||
|
|
|
@ -31,20 +31,20 @@
|
|||
latin:moreKeys="¡" />
|
||||
<Key
|
||||
latin:keyLabel="""
|
||||
latin:moreKeys="@string/more_keys_for_double_quote" />
|
||||
latin:moreKeys="!label/more_keys_for_double_quote" />
|
||||
<Key
|
||||
latin:keyLabel="\'"
|
||||
latin:moreKeys="@string/more_keys_for_single_quote" />
|
||||
latin:moreKeys="!label/more_keys_for_single_quote" />
|
||||
<Key
|
||||
latin:keyLabel=":" />
|
||||
<Key
|
||||
latin:keyLabel="@string/keylabel_for_symbols_semicolon"
|
||||
latin:moreKeys="@string/more_keys_for_symbols_semicolon" />
|
||||
latin:keyLabel="!label/keylabel_for_symbols_semicolon"
|
||||
latin:moreKeys="!label/more_keys_for_symbols_semicolon" />
|
||||
<Key
|
||||
latin:keyLabel="/" />
|
||||
<Key
|
||||
latin:keyLabel="@string/keylabel_for_symbols_question"
|
||||
latin:moreKeys="@string/more_keys_for_symbols_question" />
|
||||
latin:keyLabel="!label/keylabel_for_symbols_question"
|
||||
latin:moreKeys="!label/more_keys_for_symbols_question" />
|
||||
<Key
|
||||
latin:keyStyle="deleteKeyStyle"
|
||||
latin:keyWidth="fillRight"
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
<!-- U+2022: "•" BULLET -->
|
||||
<Key
|
||||
latin:keyLabel="•"
|
||||
latin:moreKeys="@string/more_keys_for_bullet" />
|
||||
latin:moreKeys="!label/more_keys_for_bullet" />
|
||||
<!-- U+221A: "√" SQUARE ROOT -->
|
||||
<Key
|
||||
latin:keyLabel="√" />
|
||||
|
|
|
@ -61,7 +61,7 @@
|
|||
<Key
|
||||
latin:keyLabel="."
|
||||
latin:keyLabelFlags="hasPopupHint"
|
||||
latin:moreKeys="@string/more_keys_for_am_pm"
|
||||
latin:moreKeys="!label/more_keys_for_am_pm"
|
||||
latin:keyStyle="numFunctionalKeyStyle"
|
||||
latin:keyWidth="fillRight" />
|
||||
</case>
|
||||
|
|
|
@ -37,9 +37,9 @@
|
|||
<!-- latin:hasShortcutKey="false" -->
|
||||
<default>
|
||||
<Key
|
||||
latin:keyLabel="@string/keylabel_for_comma"
|
||||
latin:keyLabel="!label/keylabel_for_comma"
|
||||
latin:keyLabelFlags="hasPopupHint"
|
||||
latin:additionalMoreKeys="@string/more_keys_for_comma"
|
||||
latin:additionalMoreKeys="!label/more_keys_for_comma"
|
||||
latin:keyStyle="f1MoreKeysStyle" />
|
||||
</default>
|
||||
</switch>
|
||||
|
|
|
@ -189,11 +189,11 @@ public class Key {
|
|||
* @param row the row that this key belongs to. row's x-coordinate will be the right edge of
|
||||
* this key.
|
||||
* @param parser the XML parser containing the attributes for this key
|
||||
* @param keyStyles active key styles set
|
||||
* @throws XmlPullParserException
|
||||
*/
|
||||
public Key(Resources res, Keyboard.Params params, Keyboard.Builder.Row row,
|
||||
XmlPullParser parser, KeyStyles keyStyles) throws XmlPullParserException {
|
||||
XmlPullParser parser) throws XmlPullParserException {
|
||||
final KeyStyles keyStyles = params.mKeyStyles;
|
||||
final float horizontalGap = isSpacer() ? 0 : params.mHorizontalGap;
|
||||
final int keyHeight = row.mRowHeight;
|
||||
mVerticalGap = params.mVerticalGap;
|
||||
|
@ -210,7 +210,7 @@ public class Key {
|
|||
throw new XmlParseUtils.ParseException(
|
||||
"Unknown key style: " + styleName, parser);
|
||||
} else {
|
||||
style = KeyStyles.getEmptyKeyStyle();
|
||||
style = keyStyles.getEmptyKeyStyle();
|
||||
}
|
||||
|
||||
final float keyXPos = row.getKeyX(keyAttr);
|
||||
|
@ -709,8 +709,8 @@ public class Key {
|
|||
|
||||
public static class Spacer extends Key {
|
||||
public Spacer(Resources res, Keyboard.Params params, Keyboard.Builder.Row row,
|
||||
XmlPullParser parser, KeyStyles keyStyles) throws XmlPullParserException {
|
||||
super(res, params, row, parser, keyStyles);
|
||||
XmlPullParser parser) throws XmlPullParserException {
|
||||
super(res, params, row, parser);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -30,6 +30,7 @@ import android.view.InflateException;
|
|||
import com.android.inputmethod.keyboard.internal.KeyStyles;
|
||||
import com.android.inputmethod.keyboard.internal.KeyboardCodesSet;
|
||||
import com.android.inputmethod.keyboard.internal.KeyboardIconsSet;
|
||||
import com.android.inputmethod.keyboard.internal.KeyboardLabelsSet;
|
||||
import com.android.inputmethod.latin.LatinImeLogger;
|
||||
import com.android.inputmethod.latin.R;
|
||||
import com.android.inputmethod.latin.Utils;
|
||||
|
@ -240,6 +241,8 @@ public class Keyboard {
|
|||
public final ArrayList<Key> mAltCodeKeysWhileTyping = new ArrayList<Key>();
|
||||
public final KeyboardIconsSet mIconsSet = new KeyboardIconsSet();
|
||||
public final KeyboardCodesSet mCodesSet = new KeyboardCodesSet();
|
||||
public final KeyboardLabelsSet mLabelsSet = new KeyboardLabelsSet();
|
||||
public final KeyStyles mKeyStyles = new KeyStyles(mLabelsSet);
|
||||
|
||||
public KeyboardLayoutSet.KeysCache mKeysCache;
|
||||
|
||||
|
@ -500,7 +503,6 @@ public class Keyboard {
|
|||
private boolean mLeftEdge;
|
||||
private boolean mTopEdge;
|
||||
private Key mRightEdgeKey = null;
|
||||
private final KeyStyles mKeyStyles = new KeyStyles();
|
||||
|
||||
/**
|
||||
* Container for keys in the keyboard. All keys in a row are at the same Y-coordinate.
|
||||
|
@ -777,7 +779,10 @@ public class Keyboard {
|
|||
|
||||
params.mThemeId = keyboardAttr.getInt(R.styleable.Keyboard_themeId, 0);
|
||||
params.mIconsSet.loadIcons(keyboardAttr);
|
||||
params.mCodesSet.setLanguage(params.mId.mLocale.getLanguage());
|
||||
final String language = params.mId.mLocale.getLanguage();
|
||||
params.mCodesSet.setLanguage(language);
|
||||
params.mLabelsSet.setLanguage(language);
|
||||
params.mLabelsSet.loadStringResources(mContext);
|
||||
|
||||
final int resourceId = keyboardAttr.getResourceId(
|
||||
R.styleable.Keyboard_touchPositionCorrectionData, 0);
|
||||
|
@ -887,7 +892,7 @@ public class Keyboard {
|
|||
XmlParseUtils.checkEndTag(TAG_KEY, parser);
|
||||
if (DEBUG) startEndTag("<%s /> skipped", TAG_KEY);
|
||||
} else {
|
||||
final Key key = new Key(mResources, mParams, row, parser, mKeyStyles);
|
||||
final Key key = new Key(mResources, mParams, row, parser);
|
||||
if (DEBUG) {
|
||||
startEndTag("<%s%s %s moreKeys=%s />", TAG_KEY,
|
||||
(key.isEnabled() ? "" : " disabled"), key,
|
||||
|
@ -904,8 +909,7 @@ public class Keyboard {
|
|||
XmlParseUtils.checkEndTag(TAG_SPACER, parser);
|
||||
if (DEBUG) startEndTag("<%s /> skipped", TAG_SPACER);
|
||||
} else {
|
||||
final Key.Spacer spacer = new Key.Spacer(
|
||||
mResources, mParams, row, parser, mKeyStyles);
|
||||
final Key.Spacer spacer = new Key.Spacer(mResources, mParams, row, parser);
|
||||
if (DEBUG) startEndTag("<%s />", TAG_SPACER);
|
||||
XmlParseUtils.checkEndTag(TAG_SPACER, parser);
|
||||
endKey(spacer);
|
||||
|
@ -1210,7 +1214,7 @@ public class Keyboard {
|
|||
skip ? " skipped" : "");
|
||||
}
|
||||
if (!skip)
|
||||
mKeyStyles.parseKeyStyleAttributes(keyStyleAttr, keyAttrs, parser);
|
||||
mParams.mKeyStyles.parseKeyStyleAttributes(keyStyleAttr, keyAttrs, parser);
|
||||
} finally {
|
||||
keyStyleAttr.recycle();
|
||||
keyAttrs.recycle();
|
||||
|
|
|
@ -65,9 +65,7 @@ public class KeyboardLayoutSet {
|
|||
|
||||
private static final String DEFAULT_KEYBOARD_LAYOUT_SET = "qwerty";
|
||||
private static final char KEYBOARD_LAYOUT_SET_LOCALE_DELIMITER = ':';
|
||||
private static final String KEYBOARD_LAYOUT_SET_RESOURCE_PREFIX = "xml/keyboard_layout_set_";
|
||||
private static final int DEFAULT_KEYBOARD_LAYOUT_SET_RESOURCE_ID =
|
||||
R.xml.keyboard_layout_set_qwerty;
|
||||
private static final String KEYBOARD_LAYOUT_SET_RESOURCE_PREFIX = "keyboard_layout_set_";
|
||||
|
||||
private final Context mContext;
|
||||
private final Params mParams;
|
||||
|
@ -319,9 +317,10 @@ public class KeyboardLayoutSet {
|
|||
throw new RuntimeException("Screen geometry is not specified");
|
||||
if (mParams.mLocale == null)
|
||||
throw new RuntimeException("KeyboardLayoutSet subtype is not specified");
|
||||
final String packageName = mResources.getResourcePackageName(
|
||||
R.xml.keyboard_layout_set_qwerty);
|
||||
final String keyboardLayoutSetName = mParams.mKeyboardLayoutSetName;
|
||||
final int xmlId = KeySpecParser.getResourceId(
|
||||
mResources, keyboardLayoutSetName, DEFAULT_KEYBOARD_LAYOUT_SET_RESOURCE_ID);
|
||||
final int xmlId = mResources.getIdentifier(keyboardLayoutSetName, "xml", packageName);
|
||||
final RunInLocale<Void> job = new RunInLocale<Void>() {
|
||||
@Override
|
||||
protected Void job(Resources res) {
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
|
||||
package com.android.inputmethod.keyboard.internal;
|
||||
|
||||
import android.content.res.Resources;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.android.inputmethod.keyboard.Keyboard;
|
||||
|
@ -27,18 +26,20 @@ import java.util.ArrayList;
|
|||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* String parser of moreKeys attribute of Key.
|
||||
* The string is comma separated texts each of which represents one "more key".
|
||||
* - String resource can be embedded into specification @string/name. This is done before parsing
|
||||
* comma.
|
||||
* The string parser of more keys specification.
|
||||
* The specification is comma separated texts each of which represents one "more key".
|
||||
* The specification might have label or string resource reference in it. These references are
|
||||
* expanded before parsing comma.
|
||||
* - Label reference should be a string representation of label (!label/label_name)
|
||||
* - String resource reference should be a string representation of resource (!label/resource_name)
|
||||
* Each "more key" specification is one of the following:
|
||||
* - Label optionally followed by keyOutputText or code (keyLabel|keyOutputText).
|
||||
* - Icon followed by keyOutputText or code (!icon/icon_name|!code/code_name)
|
||||
* - Icon should be a string representation of icon (!icon/icon_name).
|
||||
* - Code should be a code point presented by hexadecimal string prefixed with "0x".
|
||||
* Or a string representation of code (!code/code_name).
|
||||
* - Code should be a code point presented by hexadecimal string prefixed with "0x", or a string
|
||||
* representation of code (!code/code_name).
|
||||
* Special character, comma ',' backslash '\', and bar '|' can be escaped by '\' character.
|
||||
* Note that the character '@' and '\' are also parsed by XML parser and CSV parser as well.
|
||||
* Note that the '\' is also parsed by XML parser and CSV parser as well.
|
||||
* See {@link KeyboardIconsSet} about icon_name.
|
||||
*/
|
||||
public class KeySpecParser {
|
||||
|
@ -49,10 +50,8 @@ public class KeySpecParser {
|
|||
// Constants for parsing.
|
||||
private static int COMMA = ',';
|
||||
private static final char ESCAPE_CHAR = '\\';
|
||||
private static final char PREFIX_AT = '@';
|
||||
private static final char SUFFIX_SLASH = '/';
|
||||
private static final String PREFIX_STRING = PREFIX_AT + "string" + SUFFIX_SLASH;
|
||||
private static final char LABEL_END = '|';
|
||||
private static final String PREFIX_LABEL = "!label/";
|
||||
private static final String PREFIX_ICON = "!icon/";
|
||||
private static final String PREFIX_CODE = "!code/";
|
||||
private static final String PREFIX_HEX = "0x";
|
||||
|
@ -341,17 +340,7 @@ public class KeySpecParser {
|
|||
}
|
||||
}
|
||||
|
||||
public static int getResourceId(Resources res, String name, int packageNameResId) {
|
||||
String packageName = res.getResourcePackageName(packageNameResId);
|
||||
int resId = res.getIdentifier(name, null, packageName);
|
||||
if (resId == 0) {
|
||||
throw new RuntimeException("Unknown resource: " + name);
|
||||
}
|
||||
return resId;
|
||||
}
|
||||
|
||||
private static String resolveStringResource(String rawText, Resources res,
|
||||
int packageNameResId) {
|
||||
public static String resolveLabelReference(String rawText, KeyboardLabelsSet labelsSet) {
|
||||
int level = 0;
|
||||
String text = rawText;
|
||||
StringBuilder sb;
|
||||
|
@ -362,21 +351,20 @@ public class KeySpecParser {
|
|||
}
|
||||
|
||||
final int size = text.length();
|
||||
if (size < PREFIX_STRING.length()) {
|
||||
if (size < PREFIX_LABEL.length()) {
|
||||
return text;
|
||||
}
|
||||
|
||||
sb = null;
|
||||
for (int pos = 0; pos < size; pos++) {
|
||||
final char c = text.charAt(pos);
|
||||
if (c == PREFIX_AT && text.startsWith(PREFIX_STRING, pos)) {
|
||||
if (text.startsWith(PREFIX_LABEL, pos) && labelsSet != null) {
|
||||
if (sb == null) {
|
||||
sb = new StringBuilder(text.substring(0, pos));
|
||||
}
|
||||
final int end = searchResourceNameEnd(text, pos + PREFIX_STRING.length());
|
||||
final String resName = text.substring(pos + 1, end);
|
||||
final int resId = getResourceId(res, resName, packageNameResId);
|
||||
sb.append(res.getString(resId));
|
||||
final int end = searchLabelNameEnd(text, pos + PREFIX_LABEL.length());
|
||||
final String name = text.substring(pos + PREFIX_LABEL.length(), end);
|
||||
sb.append(labelsSet.getLabel(name));
|
||||
pos = end - 1;
|
||||
} else if (c == ESCAPE_CHAR) {
|
||||
if (sb != null) {
|
||||
|
@ -397,7 +385,7 @@ public class KeySpecParser {
|
|||
return text;
|
||||
}
|
||||
|
||||
private static int searchResourceNameEnd(String text, int start) {
|
||||
private static int searchLabelNameEnd(String text, int start) {
|
||||
final int size = text.length();
|
||||
for (int pos = start; pos < size; pos++) {
|
||||
final char c = text.charAt(pos);
|
||||
|
@ -410,8 +398,8 @@ public class KeySpecParser {
|
|||
return size;
|
||||
}
|
||||
|
||||
public static String[] parseCsvString(String rawText, Resources res, int packageNameResId) {
|
||||
final String text = resolveStringResource(rawText, res, packageNameResId);
|
||||
public static String[] parseCsvString(String rawText, KeyboardLabelsSet labelsSet) {
|
||||
final String text = resolveLabelReference(rawText, labelsSet);
|
||||
final int size = text.length();
|
||||
if (size == 0) {
|
||||
return null;
|
||||
|
|
|
@ -34,24 +34,55 @@ public class KeyStyles {
|
|||
|
||||
private final HashMap<String, DeclaredKeyStyle> mStyles =
|
||||
new HashMap<String, DeclaredKeyStyle>();
|
||||
private static final KeyStyle EMPTY_KEY_STYLE = new EmptyKeyStyle();
|
||||
|
||||
public interface KeyStyle {
|
||||
public String[] getStringArray(TypedArray a, int index);
|
||||
public String getString(TypedArray a, int index);
|
||||
public int getInt(TypedArray a, int index, int defaultValue);
|
||||
public int getFlag(TypedArray a, int index);
|
||||
private final KeyboardLabelsSet mLabelsSet;
|
||||
private final KeyStyle mEmptyKeyStyle;
|
||||
|
||||
public KeyStyles(KeyboardLabelsSet labelsSet) {
|
||||
mLabelsSet = labelsSet;
|
||||
mEmptyKeyStyle = new EmptyKeyStyle(labelsSet);
|
||||
}
|
||||
|
||||
static class EmptyKeyStyle implements KeyStyle {
|
||||
public static abstract class KeyStyle {
|
||||
protected final KeyboardLabelsSet mLabelsSet;
|
||||
|
||||
public KeyStyle(KeyboardLabelsSet labelsSet) {
|
||||
mLabelsSet = labelsSet;
|
||||
}
|
||||
|
||||
public abstract String[] getStringArray(TypedArray a, int index);
|
||||
public abstract String getString(TypedArray a, int index);
|
||||
public abstract int getInt(TypedArray a, int index, int defaultValue);
|
||||
public abstract int getFlag(TypedArray a, int index);
|
||||
|
||||
protected String parseString(TypedArray a, int index) {
|
||||
if (a.hasValue(index)) {
|
||||
return KeySpecParser.resolveLabelReference(a.getString(index), mLabelsSet);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
protected String[] parseStringArray(TypedArray a, int index) {
|
||||
if (a.hasValue(index)) {
|
||||
return KeySpecParser.parseCsvString(a.getString(index), mLabelsSet);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private static class EmptyKeyStyle extends KeyStyle {
|
||||
public EmptyKeyStyle(KeyboardLabelsSet labelsSet) {
|
||||
super(labelsSet);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getStringArray(TypedArray a, int index) {
|
||||
return KeyStyles.parseStringArray(a, index);
|
||||
return parseStringArray(a, index);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getString(TypedArray a, int index) {
|
||||
return a.getString(index);
|
||||
return parseString(a, index);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -65,9 +96,13 @@ public class KeyStyles {
|
|||
}
|
||||
}
|
||||
|
||||
static class DeclaredKeyStyle implements KeyStyle {
|
||||
private static class DeclaredKeyStyle extends KeyStyle {
|
||||
private final HashMap<Integer, Object> mStyleAttributes = new HashMap<Integer, Object>();
|
||||
|
||||
public DeclaredKeyStyle(KeyboardLabelsSet labelsSet) {
|
||||
super(labelsSet);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getStringArray(TypedArray a, int index) {
|
||||
if (a.hasValue(index)) {
|
||||
|
@ -79,7 +114,7 @@ public class KeyStyles {
|
|||
@Override
|
||||
public String getString(TypedArray a, int index) {
|
||||
if (a.hasValue(index)) {
|
||||
return a.getString(index);
|
||||
return parseString(a, index);
|
||||
}
|
||||
return (String)mStyleAttributes.get(index);
|
||||
}
|
||||
|
@ -120,7 +155,7 @@ public class KeyStyles {
|
|||
|
||||
private void readString(TypedArray a, int index) {
|
||||
if (a.hasValue(index)) {
|
||||
mStyleAttributes.put(index, a.getString(index));
|
||||
mStyleAttributes.put(index, parseString(a, index));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -131,16 +166,15 @@ public class KeyStyles {
|
|||
}
|
||||
|
||||
private void readFlag(TypedArray a, int index) {
|
||||
final Integer value = (Integer)mStyleAttributes.get(index);
|
||||
if (a.hasValue(index)) {
|
||||
final Integer value = (Integer)mStyleAttributes.get(index);
|
||||
mStyleAttributes.put(index, a.getInt(index, 0) | (value != null ? value : 0));
|
||||
}
|
||||
}
|
||||
|
||||
private void readStringArray(TypedArray a, int index) {
|
||||
final String[] value = parseStringArray(a, index);
|
||||
if (value != null) {
|
||||
mStyleAttributes.put(index, value);
|
||||
if (a.hasValue(index)) {
|
||||
mStyleAttributes.put(index, parseStringArray(a, index));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -149,14 +183,6 @@ public class KeyStyles {
|
|||
}
|
||||
}
|
||||
|
||||
static String[] parseStringArray(TypedArray a, int index) {
|
||||
if (a.hasValue(index)) {
|
||||
return KeySpecParser.parseCsvString(
|
||||
a.getString(index), a.getResources(), R.string.english_ime_name);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public void parseKeyStyleAttributes(TypedArray keyStyleAttr, TypedArray keyAttrs,
|
||||
XmlPullParser parser) throws XmlPullParserException {
|
||||
final String styleName = keyStyleAttr.getString(R.styleable.Keyboard_KeyStyle_styleName);
|
||||
|
@ -169,7 +195,7 @@ public class KeyStyles {
|
|||
}
|
||||
}
|
||||
|
||||
final DeclaredKeyStyle style = new DeclaredKeyStyle();
|
||||
final DeclaredKeyStyle style = new DeclaredKeyStyle(mLabelsSet);
|
||||
if (keyStyleAttr.hasValue(R.styleable.Keyboard_KeyStyle_parentStyle)) {
|
||||
final String parentStyle = keyStyleAttr.getString(
|
||||
R.styleable.Keyboard_KeyStyle_parentStyle);
|
||||
|
@ -188,7 +214,7 @@ public class KeyStyles {
|
|||
return mStyles.get(styleName);
|
||||
}
|
||||
|
||||
public static KeyStyle getEmptyKeyStyle() {
|
||||
return EMPTY_KEY_STYLE;
|
||||
public KeyStyle getEmptyKeyStyle() {
|
||||
return mEmptyKeyStyle;
|
||||
}
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -97,7 +97,7 @@ public class SettingsValues {
|
|||
}
|
||||
}
|
||||
final String[] suggestPuncsSpec = KeySpecParser.parseCsvString(
|
||||
res.getString(R.string.suggested_punctuations), res, R.string.english_ime_name);
|
||||
res.getString(R.string.suggested_punctuations), null);
|
||||
mSuggestPuncList = createSuggestPuncList(suggestPuncsSpec);
|
||||
mSymbolsExcludedFromWordSeparators =
|
||||
res.getString(R.string.symbols_excluded_from_word_separators);
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
<string name="multiple_labels_with_escape_surrounded_by_spaces">" \\abc , d\\ef , gh\\i "</string>
|
||||
<string name="multiple_labels_with_comma_and_escape">"ab\\\\,d\\\\\\,,g\\,i"</string>
|
||||
<string name="multiple_labels_with_comma_and_escape_surrounded_by_spaces">" ab\\\\ , d\\\\\\, , g\\,i "</string>
|
||||
<string name="indirect_string">@string/multiple_chars</string>
|
||||
<string name="indirect_string_with_literal">x,@string/multiple_chars,y</string>
|
||||
<string name="infinite_indirection">infinite,@string/infinite_indirection,loop</string>
|
||||
<string name="indirect_string">!label/multiple_chars</string>
|
||||
<string name="indirect_string_with_literal">x,!label/multiple_chars,y</string>
|
||||
<string name="infinite_indirection">infinite,!label/infinite_indirection,loop</string>
|
||||
</resources>
|
||||
|
|
|
@ -16,22 +16,37 @@
|
|||
|
||||
package com.android.inputmethod.keyboard.internal;
|
||||
|
||||
import android.content.res.Resources;
|
||||
import android.test.AndroidTestCase;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.android.inputmethod.latin.tests.R;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Locale;
|
||||
|
||||
public class KeySpecParserCsvTests extends AndroidTestCase {
|
||||
private Resources mTestResources;
|
||||
private final KeyboardLabelsSet mLabelsSet = new KeyboardLabelsSet();
|
||||
|
||||
@Override
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
|
||||
mTestResources = getTestContext().getResources();
|
||||
mLabelsSet.setLanguage(Locale.ENGLISH.getLanguage());
|
||||
final String[] testResourceNames = getAllResourceIdNames(
|
||||
com.android.inputmethod.latin.tests.R.string.class);
|
||||
mLabelsSet.loadStringResourcesInternal(getTestContext(),
|
||||
testResourceNames,
|
||||
com.android.inputmethod.latin.tests.R.string.empty_string);
|
||||
}
|
||||
|
||||
private static String[] getAllResourceIdNames(final Class<?> resourceIdClass) {
|
||||
final ArrayList<String> names = new ArrayList<String>();
|
||||
for (final Field field : resourceIdClass.getFields()) {
|
||||
if (field.getType() == Integer.TYPE) {
|
||||
names.add(field.getName());
|
||||
}
|
||||
}
|
||||
return names.toArray(new String[names.size()]);
|
||||
}
|
||||
|
||||
private static String format(String message, Object expected, Object actual) {
|
||||
|
@ -39,8 +54,7 @@ public class KeySpecParserCsvTests extends AndroidTestCase {
|
|||
}
|
||||
|
||||
private void assertTextArray(String message, String value, String ... expected) {
|
||||
final String actual[] = KeySpecParser.parseCsvString(value, mTestResources,
|
||||
R.string.empty_string);
|
||||
final String actual[] = KeySpecParser.parseCsvString(value, mLabelsSet);
|
||||
if (expected.length == 0) {
|
||||
assertNull(message + ": expected=null actual=" + Arrays.toString(actual),
|
||||
actual);
|
||||
|
@ -104,10 +118,10 @@ public class KeySpecParserCsvTests extends AndroidTestCase {
|
|||
"ab" + SURROGATE1 + "cd",
|
||||
"ab" + SURROGATE1 + "cd");
|
||||
|
||||
assertTextArray("Incomplete resource reference 1", "string", "string");
|
||||
assertTextArray("Incomplete resource reference 2", "@string", "@string");
|
||||
assertTextArray("Incomplete resource reference 3", "string/", "string/");
|
||||
assertTextArray("Incomplete resource reference 4", "@" + SURROGATE2, "@" + SURROGATE2);
|
||||
assertTextArray("Incomplete resource reference 1", "label", "label");
|
||||
assertTextArray("Incomplete resource reference 2", "!label", "!label");
|
||||
assertTextArray("Incomplete resource reference 3", "label/", "label/");
|
||||
assertTextArray("Incomplete resource reference 4", "!" + SURROGATE2, "!" + SURROGATE2);
|
||||
}
|
||||
|
||||
public void testParseCsvTextSingleEscaped() {
|
||||
|
@ -138,9 +152,9 @@ public class KeySpecParserCsvTests extends AndroidTestCase {
|
|||
assertTextArray("Escaped surrogate with escape",
|
||||
PAIR1 + "\\\\" + PAIR2, PAIR1 + "\\\\" + PAIR2);
|
||||
|
||||
assertTextArray("Escaped @string", "\\@string", "\\@string");
|
||||
assertTextArray("Escaped @string/", "\\@string/", "\\@string/");
|
||||
assertTextArray("Escaped @string/", "\\@string/empty_string", "\\@string/empty_string");
|
||||
assertTextArray("Escaped !label", "\\!label", "\\!label");
|
||||
assertTextArray("Escaped !label/", "\\!label/", "\\!label/");
|
||||
assertTextArray("Escaped !label/", "\\!label/empty_string", "\\!label/empty_string");
|
||||
}
|
||||
|
||||
public void testParseCsvTextMulti() {
|
||||
|
@ -171,133 +185,133 @@ public class KeySpecParserCsvTests extends AndroidTestCase {
|
|||
assertTextArray("Multiple labels with comma and escape surrounded by spaces",
|
||||
" ab\\\\ , d\\\\\\, , g\\,i ", " ab\\\\ ", " d\\\\\\, ", " g\\,i ");
|
||||
|
||||
assertTextArray("Multiple escaped @string", "\\@,\\@string/empty_string",
|
||||
"\\@", "\\@string/empty_string");
|
||||
assertTextArray("Multiple escaped !label", "\\!,\\!label/empty_string",
|
||||
"\\!", "\\!label/empty_string");
|
||||
}
|
||||
|
||||
public void testParseCsvResourceError() {
|
||||
assertError("Incomplete resource name", "@string/", "@string/");
|
||||
assertError("Non existing resource", "@string/non_existing");
|
||||
assertError("Incomplete resource name", "!label/", "!label/");
|
||||
assertError("Non existing resource", "!label/non_existing");
|
||||
}
|
||||
|
||||
public void testParseCsvResourceZero() {
|
||||
assertTextArray("Empty string",
|
||||
"@string/empty_string");
|
||||
"!label/empty_string");
|
||||
}
|
||||
|
||||
public void testParseCsvResourceSingle() {
|
||||
assertTextArray("Single char",
|
||||
"@string/single_char", "a");
|
||||
"!label/single_char", "a");
|
||||
assertTextArray("Space",
|
||||
"@string/space", " ");
|
||||
"!label/space", " ");
|
||||
assertTextArray("Single label",
|
||||
"@string/single_label", "abc");
|
||||
"!label/single_label", "abc");
|
||||
assertTextArray("Spaces",
|
||||
"@string/spaces", " ");
|
||||
"!label/spaces", " ");
|
||||
assertTextArray("Spaces in label",
|
||||
"@string/spaces_in_label", "a b c");
|
||||
"!label/spaces_in_label", "a b c");
|
||||
assertTextArray("Spaces at beginning of label",
|
||||
"@string/spaces_at_beginning_of_label", " abc");
|
||||
"!label/spaces_at_beginning_of_label", " abc");
|
||||
assertTextArray("Spaces at end of label",
|
||||
"@string/spaces_at_end_of_label", "abc ");
|
||||
"!label/spaces_at_end_of_label", "abc ");
|
||||
assertTextArray("label surrounded by spaces",
|
||||
"@string/label_surrounded_by_spaces", " abc ");
|
||||
"!label/label_surrounded_by_spaces", " abc ");
|
||||
|
||||
assertTextArray("Escape and single char",
|
||||
"\\\\@string/single_char", "\\\\a");
|
||||
"\\\\!label/single_char", "\\\\a");
|
||||
}
|
||||
|
||||
public void testParseCsvResourceSingleEscaped() {
|
||||
assertTextArray("Escaped char",
|
||||
"@string/escaped_char", "\\a");
|
||||
"!label/escaped_char", "\\a");
|
||||
assertTextArray("Escaped comma",
|
||||
"@string/escaped_comma", "\\,");
|
||||
"!label/escaped_comma", "\\,");
|
||||
assertTextArray("Escaped comma escape",
|
||||
"@string/escaped_comma_escape", "a\\,\\");
|
||||
"!label/escaped_comma_escape", "a\\,\\");
|
||||
assertTextArray("Escaped escape",
|
||||
"@string/escaped_escape", "\\\\");
|
||||
"!label/escaped_escape", "\\\\");
|
||||
assertTextArray("Escaped label",
|
||||
"@string/escaped_label", "a\\bc");
|
||||
"!label/escaped_label", "a\\bc");
|
||||
assertTextArray("Escaped label at beginning",
|
||||
"@string/escaped_label_at_beginning", "\\abc");
|
||||
"!label/escaped_label_at_beginning", "\\abc");
|
||||
assertTextArray("Escaped label at end",
|
||||
"@string/escaped_label_at_end", "abc\\");
|
||||
"!label/escaped_label_at_end", "abc\\");
|
||||
assertTextArray("Escaped label with comma",
|
||||
"@string/escaped_label_with_comma", "a\\,c");
|
||||
"!label/escaped_label_with_comma", "a\\,c");
|
||||
assertTextArray("Escaped label with comma at beginning",
|
||||
"@string/escaped_label_with_comma_at_beginning", "\\,bc");
|
||||
"!label/escaped_label_with_comma_at_beginning", "\\,bc");
|
||||
assertTextArray("Escaped label with comma at end",
|
||||
"@string/escaped_label_with_comma_at_end", "ab\\,");
|
||||
"!label/escaped_label_with_comma_at_end", "ab\\,");
|
||||
assertTextArray("Escaped label with successive",
|
||||
"@string/escaped_label_with_successive", "\\,\\\\bc");
|
||||
"!label/escaped_label_with_successive", "\\,\\\\bc");
|
||||
assertTextArray("Escaped label with escape",
|
||||
"@string/escaped_label_with_escape", "a\\\\c");
|
||||
"!label/escaped_label_with_escape", "a\\\\c");
|
||||
}
|
||||
|
||||
public void testParseCsvResourceMulti() {
|
||||
assertTextArray("Multiple chars",
|
||||
"@string/multiple_chars", "a", "b", "c");
|
||||
"!label/multiple_chars", "a", "b", "c");
|
||||
assertTextArray("Multiple chars surrounded by spaces",
|
||||
"@string/multiple_chars_surrounded_by_spaces",
|
||||
"!label/multiple_chars_surrounded_by_spaces",
|
||||
" a ", " b ", " c ");
|
||||
assertTextArray("Multiple labels",
|
||||
"@string/multiple_labels", "abc", "def", "ghi");
|
||||
"!label/multiple_labels", "abc", "def", "ghi");
|
||||
assertTextArray("Multiple labels surrounded by spaces",
|
||||
"@string/multiple_labels_surrounded_by_spaces", " abc ", " def ", " ghi ");
|
||||
"!label/multiple_labels_surrounded_by_spaces", " abc ", " def ", " ghi ");
|
||||
}
|
||||
|
||||
public void testParseCsvResourcetMultiEscaped() {
|
||||
assertTextArray("Multiple chars with comma",
|
||||
"@string/multiple_chars_with_comma",
|
||||
"!label/multiple_chars_with_comma",
|
||||
"a", "\\,", "c");
|
||||
assertTextArray("Multiple chars with comma surrounded by spaces",
|
||||
"@string/multiple_chars_with_comma_surrounded_by_spaces",
|
||||
"!label/multiple_chars_with_comma_surrounded_by_spaces",
|
||||
" a ", " \\, ", " c ");
|
||||
assertTextArray("Multiple labels with escape",
|
||||
"@string/multiple_labels_with_escape",
|
||||
"!label/multiple_labels_with_escape",
|
||||
"\\abc", "d\\ef", "gh\\i");
|
||||
assertTextArray("Multiple labels with escape surrounded by spaces",
|
||||
"@string/multiple_labels_with_escape_surrounded_by_spaces",
|
||||
"!label/multiple_labels_with_escape_surrounded_by_spaces",
|
||||
" \\abc ", " d\\ef ", " gh\\i ");
|
||||
assertTextArray("Multiple labels with comma and escape",
|
||||
"@string/multiple_labels_with_comma_and_escape",
|
||||
"!label/multiple_labels_with_comma_and_escape",
|
||||
"ab\\\\", "d\\\\\\,", "g\\,i");
|
||||
assertTextArray("Multiple labels with comma and escape surrounded by spaces",
|
||||
"@string/multiple_labels_with_comma_and_escape_surrounded_by_spaces",
|
||||
"!label/multiple_labels_with_comma_and_escape_surrounded_by_spaces",
|
||||
" ab\\\\ ", " d\\\\\\, ", " g\\,i ");
|
||||
}
|
||||
|
||||
public void testParseMultipleResources() {
|
||||
assertTextArray("Literals and resources",
|
||||
"1,@string/multiple_chars,z", "1", "a", "b", "c", "z");
|
||||
"1,!label/multiple_chars,z", "1", "a", "b", "c", "z");
|
||||
assertTextArray("Literals and resources and escape at end",
|
||||
"\\1,@string/multiple_chars,z\\", "\\1", "a", "b", "c", "z\\");
|
||||
"\\1,!label/multiple_chars,z\\", "\\1", "a", "b", "c", "z\\");
|
||||
assertTextArray("Multiple single resource chars and labels",
|
||||
"@string/single_char,@string/single_label,@string/escaped_comma",
|
||||
"!label/single_char,!label/single_label,!label/escaped_comma",
|
||||
"a", "abc", "\\,");
|
||||
assertTextArray("Multiple single resource chars and labels 2",
|
||||
"@string/single_char,@string/single_label,@string/escaped_comma_escape",
|
||||
"!label/single_char,!label/single_label,!label/escaped_comma_escape",
|
||||
"a", "abc", "a\\,\\");
|
||||
assertTextArray("Multiple multiple resource chars and labels",
|
||||
"@string/multiple_chars,@string/multiple_labels,@string/multiple_chars_with_comma",
|
||||
"!label/multiple_chars,!label/multiple_labels,!label/multiple_chars_with_comma",
|
||||
"a", "b", "c", "abc", "def", "ghi", "a", "\\,", "c");
|
||||
assertTextArray("Concatenated resources",
|
||||
"@string/multiple_chars@string/multiple_labels@string/multiple_chars_with_comma",
|
||||
"!label/multiple_chars!label/multiple_labels!label/multiple_chars_with_comma",
|
||||
"a", "b", "cabc", "def", "ghia", "\\,", "c");
|
||||
assertTextArray("Concatenated resource and literal",
|
||||
"abc@string/multiple_labels",
|
||||
"abc!label/multiple_labels",
|
||||
"abcabc", "def", "ghi");
|
||||
}
|
||||
|
||||
public void testParseIndirectReference() {
|
||||
assertTextArray("Indirect",
|
||||
"@string/indirect_string", "a", "b", "c");
|
||||
"!label/indirect_string", "a", "b", "c");
|
||||
assertTextArray("Indirect with literal",
|
||||
"1,@string/indirect_string_with_literal,2", "1", "x", "a", "b", "c", "y", "2");
|
||||
"1,!label/indirect_string_with_literal,2", "1", "x", "a", "b", "c", "y", "2");
|
||||
}
|
||||
|
||||
public void testParseInfiniteIndirectReference() {
|
||||
assertError("Infinite indirection",
|
||||
"1,@string/infinite_indirection,2", "1", "infinite", "<infinite>", "loop", "2");
|
||||
"1,!label/infinite_indirection,2", "1", "infinite", "<infinite>", "loop", "2");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -97,10 +97,10 @@ public class KeySpecParserTests extends AndroidTestCase {
|
|||
"a", null, ICON_UNDEFINED, 'a');
|
||||
assertParser("Single escaped surrogate", "\\" + PAIR2,
|
||||
PAIR2, null, ICON_UNDEFINED, CODE2);
|
||||
assertParser("Single at", "@",
|
||||
"@", null, ICON_UNDEFINED, '@');
|
||||
assertParser("Single escaped at", "\\@",
|
||||
"@", null, ICON_UNDEFINED, '@');
|
||||
assertParser("Single bang", "!",
|
||||
"!", null, ICON_UNDEFINED, '!');
|
||||
assertParser("Single escaped bang", "\\!",
|
||||
"!", null, ICON_UNDEFINED, '!');
|
||||
assertParser("Single output text letter", "a|a",
|
||||
"a", null, ICON_UNDEFINED, 'a');
|
||||
assertParser("Single surrogate pair outputText", "G Clef|" + PAIR1,
|
||||
|
@ -120,14 +120,14 @@ public class KeySpecParserTests extends AndroidTestCase {
|
|||
"a", "a,b", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT);
|
||||
assertParser("Single letter with escaped comma outputText", "a|a\\,b",
|
||||
"a", "a,b", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT);
|
||||
assertParser("Single letter with outputText starts with at", "a|@bc",
|
||||
"a", "@bc", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT);
|
||||
assertParser("Single letter with surrogate outputText starts with at", "a|@" + SURROGATE2,
|
||||
"a", "@" + SURROGATE2, ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT);
|
||||
assertParser("Single letter with outputText contains at", "a|a@c",
|
||||
"a", "a@c", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT);
|
||||
assertParser("Single letter with escaped at outputText", "a|\\@bc",
|
||||
"a", "@bc", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT);
|
||||
assertParser("Single letter with outputText starts with bang", "a|!bc",
|
||||
"a", "!bc", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT);
|
||||
assertParser("Single letter with surrogate outputText starts with bang", "a|!" + SURROGATE2,
|
||||
"a", "!" + SURROGATE2, ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT);
|
||||
assertParser("Single letter with outputText contains bang", "a|a!c",
|
||||
"a", "a!c", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT);
|
||||
assertParser("Single letter with escaped bang outputText", "a|\\!bc",
|
||||
"a", "!bc", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT);
|
||||
assertParser("Single escaped escape with single outputText", "\\\\|\\\\",
|
||||
"\\", null, ICON_UNDEFINED, '\\');
|
||||
assertParser("Single escaped bar with single outputText", "\\||\\|",
|
||||
|
@ -152,14 +152,14 @@ public class KeySpecParserTests extends AndroidTestCase {
|
|||
"a,c", "a,c", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT);
|
||||
assertParser("Label with escaped comma", "a\\,c",
|
||||
"a,c", "a,c", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT);
|
||||
assertParser("Label starts with at", "@bc",
|
||||
"@bc", "@bc", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT);
|
||||
assertParser("Surrogate label starts with at", "@" + SURROGATE1,
|
||||
"@" + SURROGATE1, "@" + SURROGATE1, ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT);
|
||||
assertParser("Label contains at", "a@c",
|
||||
"a@c", "a@c", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT);
|
||||
assertParser("Label with escaped at", "\\@bc",
|
||||
"@bc", "@bc", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT);
|
||||
assertParser("Label starts with bang", "!bc",
|
||||
"!bc", "!bc", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT);
|
||||
assertParser("Surrogate label starts with bang", "!" + SURROGATE1,
|
||||
"!" + SURROGATE1, "!" + SURROGATE1, ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT);
|
||||
assertParser("Label contains bang", "a!c",
|
||||
"a!c", "a!c", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT);
|
||||
assertParser("Label with escaped bang", "\\!bc",
|
||||
"!bc", "!bc", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT);
|
||||
assertParser("Label with escaped letter", "\\abc",
|
||||
"abc", "abc", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT);
|
||||
assertParser("Label with outputText", "abc|def",
|
||||
|
@ -174,22 +174,22 @@ public class KeySpecParserTests extends AndroidTestCase {
|
|||
"abc", "d|f", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT);
|
||||
assertParser("Escaped escape label with outputText", "a\\\\|def",
|
||||
"a\\", "def", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT);
|
||||
assertParser("Label starts with at and outputText", "@bc|def",
|
||||
"@bc", "def", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT);
|
||||
assertParser("Label contains at label and outputText", "a@c|def",
|
||||
"a@c", "def", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT);
|
||||
assertParser("Escaped at label with outputText", "\\@bc|def",
|
||||
"@bc", "def", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT);
|
||||
assertParser("Label starts with bang and outputText", "!bc|def",
|
||||
"!bc", "def", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT);
|
||||
assertParser("Label contains bang label and outputText", "a!c|def",
|
||||
"a!c", "def", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT);
|
||||
assertParser("Escaped bang label with outputText", "\\!bc|def",
|
||||
"!bc", "def", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT);
|
||||
assertParser("Label with comma outputText", "abc|a,b",
|
||||
"abc", "a,b", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT);
|
||||
assertParser("Label with escaped comma outputText", "abc|a\\,b",
|
||||
"abc", "a,b", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT);
|
||||
assertParser("Label with outputText starts with at", "abc|@bc",
|
||||
"abc", "@bc", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT);
|
||||
assertParser("Label with outputText contains at", "abc|a@c",
|
||||
"abc", "a@c", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT);
|
||||
assertParser("Label with escaped at outputText", "abc|\\@bc",
|
||||
"abc", "@bc", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT);
|
||||
assertParser("Label with outputText starts with bang", "abc|!bc",
|
||||
"abc", "!bc", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT);
|
||||
assertParser("Label with outputText contains bang", "abc|a!c",
|
||||
"abc", "a!c", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT);
|
||||
assertParser("Label with escaped bang outputText", "abc|\\!bc",
|
||||
"abc", "!bc", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT);
|
||||
assertParser("Label with escaped bar outputText", "abc|d\\|f",
|
||||
"abc", "d|f", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT);
|
||||
assertParser("Escaped bar label with escaped bar outputText", "a\\|c|d\\|f",
|
||||
|
@ -203,18 +203,18 @@ public class KeySpecParserTests extends AndroidTestCase {
|
|||
public void testIconAndCode() {
|
||||
assertParser("Icon with outputText", ICON_SETTINGS + "|abc",
|
||||
null, "abc", mSettingsIconId, Keyboard.CODE_OUTPUT_TEXT);
|
||||
assertParser("Icon with outputText starts with at", ICON_SETTINGS + "|@bc",
|
||||
null, "@bc", mSettingsIconId, Keyboard.CODE_OUTPUT_TEXT);
|
||||
assertParser("Icon with outputText contains at", ICON_SETTINGS + "|a@c",
|
||||
null, "a@c", mSettingsIconId, Keyboard.CODE_OUTPUT_TEXT);
|
||||
assertParser("Icon with escaped at outputText", ICON_SETTINGS + "|\\@bc",
|
||||
null, "@bc", mSettingsIconId, Keyboard.CODE_OUTPUT_TEXT);
|
||||
assertParser("Label starts with at and code", "@bc|" + CODE_SETTINGS,
|
||||
"@bc", null, ICON_UNDEFINED, mCodeSettings);
|
||||
assertParser("Label contains at and code", "a@c|" + CODE_SETTINGS,
|
||||
"a@c", null, ICON_UNDEFINED, mCodeSettings);
|
||||
assertParser("Escaped at label with code", "\\@bc|" + CODE_SETTINGS,
|
||||
"@bc", null, ICON_UNDEFINED, mCodeSettings);
|
||||
assertParser("Icon with outputText starts with bang", ICON_SETTINGS + "|!bc",
|
||||
null, "!bc", mSettingsIconId, Keyboard.CODE_OUTPUT_TEXT);
|
||||
assertParser("Icon with outputText contains bang", ICON_SETTINGS + "|a!c",
|
||||
null, "a!c", mSettingsIconId, Keyboard.CODE_OUTPUT_TEXT);
|
||||
assertParser("Icon with escaped bang outputText", ICON_SETTINGS + "|\\!bc",
|
||||
null, "!bc", mSettingsIconId, Keyboard.CODE_OUTPUT_TEXT);
|
||||
assertParser("Label starts with bang and code", "!bc|" + CODE_SETTINGS,
|
||||
"!bc", null, ICON_UNDEFINED, mCodeSettings);
|
||||
assertParser("Label contains bang and code", "a!c|" + CODE_SETTINGS,
|
||||
"a!c", null, ICON_UNDEFINED, mCodeSettings);
|
||||
assertParser("Escaped bang label with code", "\\!bc|" + CODE_SETTINGS,
|
||||
"!bc", null, ICON_UNDEFINED, mCodeSettings);
|
||||
assertParser("Icon with code", ICON_SETTINGS + "|" + CODE_SETTINGS,
|
||||
null, null, mSettingsIconId, mCodeSettings);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
#
|
||||
# Copyright (C) 2012 The Android Open Source Project
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_SRC_FILES += $(call all-java-files-under,src)
|
||||
LOCAL_JAR_MANIFEST := etc/manifest.txt
|
||||
LOCAL_JAVA_RESOURCE_DIRS := res
|
||||
LOCAL_MODULE_TAGS := eng
|
||||
LOCAL_MODULE := makelabel
|
||||
|
||||
include $(BUILD_HOST_JAVA_LIBRARY)
|
||||
include $(LOCAL_PATH)/etc/Android.mk
|
|
@ -0,0 +1,21 @@
|
|||
# Copyright (C) 2012 The Android Open Source Project
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_MODULE_TAGS := eng
|
||||
|
||||
LOCAL_PREBUILT_EXECUTABLES := makelabel
|
||||
include $(BUILD_HOST_PREBUILT)
|
|
@ -0,0 +1,63 @@
|
|||
#!/bin/sh
|
||||
# Copyright 2012, The Android Open Source Project
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# Set up prog to be the path of this script, including following symlinks,
|
||||
# and set up progdir to be the fully-qualified pathname of its directory.
|
||||
prog="$0"
|
||||
while [ -h "${prog}" ]; do
|
||||
newProg=`/bin/ls -ld "${prog}"`
|
||||
newProg=`expr "${newProg}" : ".* -> \(.*\)$"`
|
||||
if expr "x${newProg}" : 'x/' >/dev/null; then
|
||||
prog="${newProg}"
|
||||
else
|
||||
progdir=`dirname "${prog}"`
|
||||
prog="${progdir}/${newProg}"
|
||||
fi
|
||||
done
|
||||
oldwd=`pwd`
|
||||
progdir=`dirname "${prog}"`
|
||||
cd "${progdir}"
|
||||
progdir=`pwd`
|
||||
prog="${progdir}"/`basename "${prog}"`
|
||||
cd "${oldwd}"
|
||||
|
||||
jarfile=makelabel.jar
|
||||
frameworkdir="$progdir"
|
||||
if [ ! -r "$frameworkdir/$jarfile" ]
|
||||
then
|
||||
frameworkdir=`dirname "$progdir"`/tools/lib
|
||||
libdir=`dirname "$progdir"`/tools/lib
|
||||
fi
|
||||
if [ ! -r "$frameworkdir/$jarfile" ]
|
||||
then
|
||||
frameworkdir=`dirname "$progdir"`/framework
|
||||
libdir=`dirname "$progdir"`/lib
|
||||
fi
|
||||
if [ ! -r "$frameworkdir/$jarfile" ]
|
||||
then
|
||||
echo `basename "$prog"`": can't find $jarfile"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "$OSTYPE" = "cygwin" ] ; then
|
||||
jarpath=`cygpath -w "$frameworkdir/$jarfile"`
|
||||
progdir=`cygpath -w "$progdir"`
|
||||
else
|
||||
jarpath="$frameworkdir/$jarfile"
|
||||
fi
|
||||
|
||||
# need to use "java.ext.dirs" because "-jar" causes classpath to be ignored
|
||||
# might need more memory, e.g. -Xmx128M
|
||||
exec java -ea -jar "$jarpath" "$@"
|
|
@ -0,0 +1 @@
|
|||
Main-Class: com.android.inputmethod.latin.makelabel.LabelMaker
|
|
@ -0,0 +1,117 @@
|
|||
/*
|
||||
* Copyright (C) 2012 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||
* use this file except in compliance with the License. You may obtain a copy of
|
||||
* the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations under
|
||||
* the License.
|
||||
*/
|
||||
|
||||
package com.android.inputmethod.keyboard.internal;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
|
||||
import com.android.inputmethod.latin.R;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
/**
|
||||
* !!!!! DO NOT EDIT THIS FILE !!!!!
|
||||
* This file is generated by tools/makelabel.
|
||||
*/
|
||||
public final class KeyboardLabelsSet {
|
||||
// Language to labels map.
|
||||
private static final HashMap<String, String[]> sLocaleToLabelsMap =
|
||||
new HashMap<String, String[]>();
|
||||
private static final HashMap<String, Integer> sNameToIdMap = new HashMap<String, Integer>();
|
||||
|
||||
private String[] mLabels;
|
||||
// Resource name to label map.
|
||||
private HashMap<String, String> mResourceNameToLabelsMap = new HashMap<String, String>();
|
||||
|
||||
public void setLanguage(final String language) {
|
||||
mLabels = sLocaleToLabelsMap.get(language);
|
||||
if (mLabels == null) {
|
||||
mLabels = LANGUAGE_DEFAULT;
|
||||
}
|
||||
}
|
||||
|
||||
public void loadStringResources(Context context) {
|
||||
loadStringResourcesInternal(context, RESOURCE_NAMES, R.string.english_ime_name);
|
||||
}
|
||||
|
||||
/* package for test */
|
||||
void loadStringResourcesInternal(Context context, final String[] resourceNames,
|
||||
int referenceId) {
|
||||
final Resources res = context.getResources();
|
||||
final String packageName = res.getResourcePackageName(referenceId);
|
||||
for (final String resName : resourceNames) {
|
||||
final int resId = res.getIdentifier(resName, "string", packageName);
|
||||
mResourceNameToLabelsMap.put(resName, res.getString(resId));
|
||||
}
|
||||
}
|
||||
|
||||
public String getLabel(final String name) {
|
||||
if (mResourceNameToLabelsMap.containsKey(name)) {
|
||||
return mResourceNameToLabelsMap.get(name);
|
||||
}
|
||||
final Integer id = sNameToIdMap.get(name);
|
||||
if (id == null) throw new RuntimeException("Unknown label: " + name);
|
||||
final String label = (id < mLabels.length) ? mLabels[id] : null;
|
||||
return (label == null) ? LANGUAGE_DEFAULT[id] : label;
|
||||
}
|
||||
|
||||
private static final String[] RESOURCE_NAMES = {
|
||||
// These labels' name should be aligned with the @string/<name> in values/strings.xml.
|
||||
// Labels for action.
|
||||
"label_go_key",
|
||||
// "label_search_key",
|
||||
"label_send_key",
|
||||
"label_next_key",
|
||||
"label_done_key",
|
||||
"label_previous_key",
|
||||
// Other labels.
|
||||
"label_to_alpha_key",
|
||||
"label_to_symbol_key",
|
||||
"label_to_symbol_with_microphone_key",
|
||||
"label_pause_key",
|
||||
"label_wait_key",
|
||||
};
|
||||
|
||||
private static final String[] NAMES = {
|
||||
/* @NAMES@ */
|
||||
};
|
||||
|
||||
private static final String EMPTY = "";
|
||||
|
||||
/* Default labels */
|
||||
private static final String[] LANGUAGE_DEFAULT = {
|
||||
/* @DEFAULT_LABELS@ */
|
||||
};
|
||||
|
||||
/* @LABELS@ */
|
||||
private static final Object[] LANGUAGES_AND_LABELS = {
|
||||
/* @LANGUAGES_AND_LABELS@ */
|
||||
};
|
||||
|
||||
static {
|
||||
int id = 0;
|
||||
for (final String name : NAMES) {
|
||||
sNameToIdMap.put(name, id++);
|
||||
}
|
||||
|
||||
for (int i = 0; i < LANGUAGES_AND_LABELS.length; i += 2) {
|
||||
final String language = (String)LANGUAGES_AND_LABELS[i];
|
||||
final String[] labels = (String[])LANGUAGES_AND_LABELS[i + 1];
|
||||
sLocaleToLabelsMap.put(language, labels);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -59,6 +59,13 @@
|
|||
<string name="keylabel_for_south_slavic_row3_8"></string>
|
||||
<string name="more_keys_for_cyrillic_ie"></string>
|
||||
<string name="more_keys_for_cyrillic_i"></string>
|
||||
<string name="more_keys_for_single_quote">!fixedColumnOrder!4,‘,’,‚,‛</string>
|
||||
<!-- TODO: Neither DroidSans nor Roboto have the glyph for U+201F DOUBLE HIGH-REVERSED-9 QUOTATION MARK. -->
|
||||
<!-- <string name="more_keys_for_double_quote">!fixedColumnOrder!6,“,”,„,‟,«,»</string> -->
|
||||
<string name="more_keys_for_double_quote">!fixedColumnOrder!4,“,”,«,»</string>
|
||||
<!-- TODO: Neither DroidSans nor Roboto have the glyph for U+201F DOUBLE HIGH-REVERSED-9 QUOTATION MARK. -->
|
||||
<!-- <string name="more_keys_for_tablet_double_quote">!fixedColumnOrder!6,“,”,„,‟,«,»,‘,’,‚,‛</string> -->
|
||||
<string name="more_keys_for_tablet_double_quote">!fixedColumnOrder!4,“,”,«,»,‘,’,‚,‛</string>
|
||||
<!-- U+00A2: "¢" CENT SIGN
|
||||
U+00A3: "£" POUND SIGN
|
||||
U+20AC: "€" EURO SIGN
|
||||
|
@ -177,11 +184,20 @@
|
|||
U+201F: "‟" DOUBLE HIGH-REVERSED-9 QUOTATION MARK -->
|
||||
<string name="more_keys_for_less_than">!fixedColumnOrder!3,‹,≤,«</string>
|
||||
<string name="more_keys_for_greater_than">!fixedColumnOrder!3,›,≥,»</string>
|
||||
<string name="more_keys_for_single_quote">!fixedColumnOrder!4,‘,’,‚,‛</string>
|
||||
<!-- TODO: Neither DroidSans nor Roboto have the glyph for U+201F DOUBLE HIGH-REVERSED-9 QUOTATION MARK. -->
|
||||
<!-- <string name="more_keys_for_double_quote">!fixedColumnOrder!6,“,”,„,‟,«,»</string> -->
|
||||
<string name="more_keys_for_double_quote">!fixedColumnOrder!4,“,”,«,»</string>
|
||||
<!-- TODO: Neither DroidSans nor Roboto have the glyph for U+201F DOUBLE HIGH-REVERSED-9 QUOTATION MARK. -->
|
||||
<!-- <string name="more_keys_for_tablet_double_quote">!fixedColumnOrder!6,“,”,„,‟,«,»,‘,’,‚,‛</string> -->
|
||||
<string name="more_keys_for_tablet_double_quote">!fixedColumnOrder!4,“,”,«,»,‘,’,‚,‛</string>
|
||||
<!-- Label for "switch to more symbol" modifier key. Must be short to fit on key! -->
|
||||
<string name="label_to_more_symbol_key">= \\ <</string>
|
||||
<!-- Label for "switch to more symbol" modifier key on tablets. Must be short to fit on key! -->
|
||||
<string name="label_to_more_symbol_for_tablet_key">~ \\ {</string>
|
||||
<!-- Label for "Tab" key. Must be short to fit on key! -->
|
||||
<string name="label_tab_key">Tab</string>
|
||||
<!-- Label for "switch to phone numeric" key. Must be short to fit on key! -->
|
||||
<string name="label_to_phone_numeric_key">123</string>
|
||||
<!-- Label for "switch to phone symbols" key. Must be short to fit on key! -->
|
||||
<!-- U+FF0A: "*" FULLWIDTH ASTERISK
|
||||
U+FF03: "#" FULLWIDTH NUMBER SIGN -->
|
||||
<string name="label_to_phone_symbols_key">*#</string>
|
||||
<!-- Key label for "ante meridiem" -->
|
||||
<string name="label_time_am">"AM"</string>
|
||||
<!-- Key label for "post meridiem" -->
|
||||
<string name="label_time_pm">"PM"</string>
|
||||
</resources>
|
|
@ -0,0 +1,89 @@
|
|||
/*
|
||||
* Copyright (C) 2012 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.inputmethod.latin.makelabel;
|
||||
|
||||
import java.io.PrintStream;
|
||||
|
||||
public class ArrayInitializerFormatter {
|
||||
private final PrintStream mOut;
|
||||
private final int mMaxWidth;
|
||||
private final String mIndent;
|
||||
|
||||
private int mCurrentIndex = 0;
|
||||
private String mFixedElement;
|
||||
private final StringBuilder mBuffer = new StringBuilder();
|
||||
private int mBufferedLen;
|
||||
private int mBufferedIndex = Integer.MIN_VALUE;
|
||||
|
||||
public ArrayInitializerFormatter(PrintStream out, int width, String indent) {
|
||||
mOut = out;
|
||||
mMaxWidth = width - indent.length();
|
||||
mIndent = indent;
|
||||
}
|
||||
|
||||
public void flush() {
|
||||
if (mBuffer.length() == 0) {
|
||||
return;
|
||||
}
|
||||
final int lastIndex = mCurrentIndex - 1;
|
||||
if (mBufferedIndex == lastIndex) {
|
||||
mOut.format("%s/* %d */ %s\n", mIndent, mBufferedIndex, mBuffer);
|
||||
} else if (mBufferedIndex == lastIndex - 1) {
|
||||
final String[] elements = mBuffer.toString().split(" ");
|
||||
mOut.format("%s/* %d */ %s\n"
|
||||
+ "%s/* %d */ %s\n",
|
||||
mIndent, mBufferedIndex, elements[0],
|
||||
mIndent, lastIndex, elements[1]);
|
||||
} else {
|
||||
mOut.format("%s/* %d~ */\n"
|
||||
+ "%s%s\n"
|
||||
+ "%s/* ~%d */\n", mIndent, mBufferedIndex,
|
||||
mIndent, mBuffer,
|
||||
mIndent, lastIndex);
|
||||
}
|
||||
mBuffer.setLength(0);
|
||||
mBufferedLen = 0;
|
||||
}
|
||||
|
||||
public void outCommentLines(String lines) {
|
||||
flush();
|
||||
mOut.print(lines);
|
||||
mFixedElement = null;
|
||||
}
|
||||
|
||||
public void outElement(String element) {
|
||||
if (!element.equals(mFixedElement)) {
|
||||
flush();
|
||||
mBufferedIndex = mCurrentIndex;
|
||||
}
|
||||
final int nextLen = mBufferedLen + " ".length() + element.length();
|
||||
if (mBufferedLen != 0 && nextLen < mMaxWidth) {
|
||||
mBuffer.append(' ');
|
||||
mBuffer.append(element);
|
||||
mBufferedLen = nextLen;
|
||||
} else {
|
||||
if (mBufferedLen != 0) {
|
||||
mBuffer.append('\n');
|
||||
mBuffer.append(mIndent);
|
||||
}
|
||||
mBuffer.append(element);
|
||||
mBufferedLen = element.length();
|
||||
}
|
||||
mCurrentIndex++;
|
||||
mFixedElement = element;
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue