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: I7515c7919c535e30f9c80a37bdc831d0f682cd43
main
Tadashi G. Takaoka 2012-04-05 14:59:55 +09:00
parent 7be6ce0fd7
commit 2be51f4fd0
105 changed files with 3800 additions and 411 deletions

View File

@ -45,24 +45,6 @@
<!-- <string name="layout_switch_back_symbols">\"\'&#x2018;&#x2019;&#x201A;&#x201B;&#x201C;&#x201D;&#x201E;&#x201F;&#x00AB;&#x00BB;</string> --> <!-- <string name="layout_switch_back_symbols">\"\'&#x2018;&#x2019;&#x201A;&#x201B;&#x201C;&#x201D;&#x201E;&#x201F;&#x00AB;&#x00BB;</string> -->
<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">= \\ &lt;</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">&#xFF0A;&#xFF03;</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 --> <!-- Always show the suggestion strip -->
<string name="prefs_suggestion_visibility_show_value">0</string> <string name="prefs_suggestion_visibility_show_value">0</string>
<!-- Show the suggestion strip only on portrait mode --> <!-- Show the suggestion strip only on portrait mode -->

View File

@ -29,7 +29,7 @@
<Key <Key
latin:keyStyle="shortcutKeyStyle" latin:keyStyle="shortcutKeyStyle"
latin:keyLabelFlags="hasPopupHint|preserveCase" latin:keyLabelFlags="hasPopupHint|preserveCase"
latin:moreKeys="@string/settings_as_more_key" latin:moreKeys="!label/settings_as_more_key"
latin:keyWidth="fillBoth" /> latin:keyWidth="fillBoth" />
</case> </case>
<case <case

View File

@ -92,7 +92,7 @@
latin:keyLabel=":-)" latin:keyLabel=":-)"
latin:keyOutputText=":-) " latin:keyOutputText=":-) "
latin:keyLabelFlags="hasPopupHint|preserveCase" latin:keyLabelFlags="hasPopupHint|preserveCase"
latin:moreKeys="@string/more_keys_for_smiley" /> latin:moreKeys="!label/more_keys_for_smiley" />
<key-style <key-style
latin:styleName="shortcutKeyStyle" latin:styleName="shortcutKeyStyle"
latin:code="!code/key_shortcut" latin:code="!code/key_shortcut"
@ -131,35 +131,35 @@
<key-style <key-style
latin:styleName="toSymbolKeyStyle" latin:styleName="toSymbolKeyStyle"
latin:code="!code/key_switch_alpha_symbol" 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:keyLabelFlags="preserveCase"
latin:keyActionFlags="noKeyPreview" latin:keyActionFlags="noKeyPreview"
latin:backgroundType="functional" /> latin:backgroundType="functional" />
<key-style <key-style
latin:styleName="toAlphaKeyStyle" latin:styleName="toAlphaKeyStyle"
latin:code="!code/key_switch_alpha_symbol" 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:keyLabelFlags="preserveCase"
latin:keyActionFlags="noKeyPreview" latin:keyActionFlags="noKeyPreview"
latin:backgroundType="functional" /> latin:backgroundType="functional" />
<key-style <key-style
latin:styleName="toMoreSymbolKeyStyle" latin:styleName="toMoreSymbolKeyStyle"
latin:code="!code/key_shift" 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:keyLabelFlags="preserveCase"
latin:keyActionFlags="noKeyPreview" latin:keyActionFlags="noKeyPreview"
latin:backgroundType="functional" /> latin:backgroundType="functional" />
<key-style <key-style
latin:styleName="backFromMoreSymbolKeyStyle" latin:styleName="backFromMoreSymbolKeyStyle"
latin:code="!code/key_shift" latin:code="!code/key_shift"
latin:keyLabel="@string/label_to_symbol_key" latin:keyLabel="!label/label_to_symbol_key"
latin:keyLabelFlags="preserveCase" latin:keyLabelFlags="preserveCase"
latin:keyActionFlags="noKeyPreview" latin:keyActionFlags="noKeyPreview"
latin:backgroundType="functional" /> latin:backgroundType="functional" />
<key-style <key-style
latin:styleName="comKeyStyle" latin:styleName="comKeyStyle"
latin:keyLabel="@string/keylabel_for_popular_domain" latin:keyLabel="!label/keylabel_for_popular_domain"
latin:keyLabelFlags="fontNormal|hasPopupHint|preserveCase" latin:keyLabelFlags="fontNormal|hasPopupHint|preserveCase"
latin:keyOutputText="@string/keylabel_for_popular_domain" latin:keyOutputText="!label/keylabel_for_popular_domain"
latin:moreKeys="@string/more_keys_for_popular_domain" /> latin:moreKeys="!label/more_keys_for_popular_domain" />
</merge> </merge>

View File

@ -39,9 +39,9 @@
</case> </case>
<default> <default>
<Key <Key
latin:keyLabel="@string/keylabel_for_apostrophe" latin:keyLabel="!label/keylabel_for_apostrophe"
latin:keyHintLabel="@string/keyhintlabel_for_apostrophe" latin:keyHintLabel="!label/keyhintlabel_for_apostrophe"
latin:moreKeys="@string/more_keys_for_apostrophe" latin:moreKeys="!label/more_keys_for_apostrophe"
latin:keyStyle="hasShiftedLetterHintStyle" /> latin:keyStyle="hasShiftedLetterHintStyle" />
</default> </default>
</switch> </switch>
@ -54,9 +54,9 @@
</case> </case>
<default> <default>
<Key <Key
latin:keyLabel="@string/keylabel_for_dash" latin:keyLabel="!label/keylabel_for_dash"
latin:keyHintLabel="@string/keyhintlabel_for_dash" latin:keyHintLabel="!label/keyhintlabel_for_dash"
latin:moreKeys="@string/more_keys_for_dash" latin:moreKeys="!label/more_keys_for_dash"
latin:keyStyle="hasShiftedLetterHintStyle" /> latin:keyStyle="hasShiftedLetterHintStyle" />
</default> </default>
</switch> </switch>

View File

@ -32,14 +32,14 @@
</case> </case>
<default> <default>
<Key <Key
latin:keyLabel="@string/keylabel_for_tablet_comma" latin:keyLabel="!label/keylabel_for_tablet_comma"
latin:keyHintLabel="@string/keyhintlabel_for_tablet_comma" latin:keyHintLabel="!label/keyhintlabel_for_tablet_comma"
latin:moreKeys="@string/more_keys_for_tablet_comma" latin:moreKeys="!label/more_keys_for_tablet_comma"
latin:keyStyle="hasShiftedLetterHintStyle" /> latin:keyStyle="hasShiftedLetterHintStyle" />
<Key <Key
latin:keyLabel="." latin:keyLabel="."
latin:keyHintLabel="@string/keyhintlabel_for_tablet_period" latin:keyHintLabel="!label/keyhintlabel_for_tablet_period"
latin:moreKeys="@string/more_keys_for_tablet_period" latin:moreKeys="!label/more_keys_for_tablet_period"
latin:keyStyle="hasShiftedLetterHintStyle" /> latin:keyStyle="hasShiftedLetterHintStyle" />
</default> </default>
</switch> </switch>

View File

@ -26,13 +26,13 @@
<Key <Key
latin:keyStyle="currencyKeyStyle" /> latin:keyStyle="currencyKeyStyle" />
<Key <Key
latin:keyLabel="@string/keylabel_for_symbols_percent" latin:keyLabel="!label/keylabel_for_symbols_percent"
latin:moreKeys="@string/more_keys_for_symbols_percent" /> latin:moreKeys="!label/more_keys_for_symbols_percent" />
<Key <Key
latin:keyLabel="&amp;" /> latin:keyLabel="&amp;" />
<Key <Key
latin:keyLabel="*" latin:keyLabel="*"
latin:moreKeys="@string/more_keys_for_star" /> latin:moreKeys="!label/more_keys_for_star" />
<!-- U+2013: "" EN DASH <!-- U+2013: "" EN DASH
U+2014: "—" EM DASH --> U+2014: "—" EM DASH -->
<Key <Key
@ -40,7 +40,7 @@
latin:moreKeys="_,&#x2013;,&#x2014;" /> latin:moreKeys="_,&#x2013;,&#x2014;" />
<Key <Key
latin:keyLabel="+" latin:keyLabel="+"
latin:moreKeys="@string/more_keys_for_plus" /> latin:moreKeys="!label/more_keys_for_plus" />
<include <include
latin:keyboardLayout="@xml/keys_parentheses" /> latin:keyboardLayout="@xml/keys_parentheses" />
</merge> </merge>

View File

@ -41,11 +41,11 @@
</default> </default>
</switch> </switch>
<Key <Key
latin:keyLabel="@string/keylabel_for_symbols_semicolon" latin:keyLabel="!label/keylabel_for_symbols_semicolon"
latin:moreKeys="@string/more_keys_for_symbols_semicolon" /> latin:moreKeys="!label/more_keys_for_symbols_semicolon" />
<Key <Key
latin:keyLabel="@string/keylabel_for_comma" latin:keyLabel="!label/keylabel_for_comma"
latin:moreKeys="@string/more_keys_for_comma" /> latin:moreKeys="!label/more_keys_for_comma" />
<Key <Key
latin:keyLabel="." /> latin:keyLabel="." />
<!-- U+00A1: "¡" INVERTED EXCLAMATION MARK --> <!-- U+00A1: "¡" INVERTED EXCLAMATION MARK -->
@ -53,6 +53,6 @@
latin:keyLabel="!" latin:keyLabel="!"
latin:moreKeys="&#x00A1;" /> latin:moreKeys="&#x00A1;" />
<Key <Key
latin:keyLabel="@string/keylabel_for_symbols_question" latin:keyLabel="!label/keylabel_for_symbols_question"
latin:moreKeys="@string/more_keys_for_symbols_question" /> latin:moreKeys="!label/more_keys_for_symbols_question" />
</merge> </merge>

View File

@ -30,7 +30,7 @@
<!-- U+2022: "•" BULLET --> <!-- U+2022: "•" BULLET -->
<Key <Key
latin:keyLabel="&#x2022;" latin:keyLabel="&#x2022;"
latin:moreKeys="@string/more_keys_for_bullet" /> latin:moreKeys="!label/more_keys_for_bullet" />
<!-- U+221A: "√" SQUARE ROOT --> <!-- U+221A: "√" SQUARE ROOT -->
<Key <Key
latin:keyLabel="&#x221A;" /> latin:keyLabel="&#x221A;" />

View File

@ -70,7 +70,7 @@
<Key <Key
latin:keyLabel="," latin:keyLabel=","
latin:keyLabelFlags="hasPopupHint" latin:keyLabelFlags="hasPopupHint"
latin:moreKeys="@string/more_keys_for_am_pm" latin:moreKeys="!label/more_keys_for_am_pm"
latin:keyStyle="numKeyStyle" latin:keyStyle="numKeyStyle"
latin:keyWidth="9.25%p" /> latin:keyWidth="9.25%p" />
</case> </case>

View File

@ -37,7 +37,7 @@
latin:keyWidth="39.750%p" /> latin:keyWidth="39.750%p" />
<Key <Key
latin:keyLabel="&quot;" latin:keyLabel="&quot;"
latin:moreKeys="@string/more_keys_for_tablet_double_quote" /> latin:moreKeys="!label/more_keys_for_tablet_double_quote" />
<Key <Key
latin:keyLabel="_" /> latin:keyLabel="_" />
<Spacer <Spacer

View File

@ -91,7 +91,7 @@
latin:keyLabel=":-)" latin:keyLabel=":-)"
latin:keyOutputText=":-) " latin:keyOutputText=":-) "
latin:keyLabelFlags="hasPopupHint|preserveCase" latin:keyLabelFlags="hasPopupHint|preserveCase"
latin:moreKeys="@string/more_keys_for_smiley" /> latin:moreKeys="!label/more_keys_for_smiley" />
<key-style <key-style
latin:styleName="shortcutKeyStyle" latin:styleName="shortcutKeyStyle"
latin:code="!code/key_shortcut" latin:code="!code/key_shortcut"
@ -114,7 +114,7 @@
<key-style <key-style
latin:styleName="tabKeyStyle" latin:styleName="tabKeyStyle"
latin:code="!code/key_action_previous" latin:code="!code/key_action_previous"
latin:keyLabel="@string/label_tab_key" latin:keyLabel="!label/label_tab_key"
latin:keyLabelFlags="fontNormal|preserveCase" latin:keyLabelFlags="fontNormal|preserveCase"
latin:backgroundType="functional" /> latin:backgroundType="functional" />
</case> </case>
@ -122,7 +122,7 @@
<key-style <key-style
latin:styleName="tabKeyStyle" latin:styleName="tabKeyStyle"
latin:code="!code/key_tab" latin:code="!code/key_tab"
latin:keyLabel="@string/label_tab_key" latin:keyLabel="!label/label_tab_key"
latin:keyLabelFlags="fontNormal|preserveCase" latin:keyLabelFlags="fontNormal|preserveCase"
latin:backgroundType="functional" /> latin:backgroundType="functional" />
</default> </default>
@ -130,35 +130,35 @@
<key-style <key-style
latin:styleName="toSymbolKeyStyle" latin:styleName="toSymbolKeyStyle"
latin:code="!code/key_switch_alpha_symbol" 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:keyLabelFlags="fontNormal|preserveCase"
latin:keyActionFlags="noKeyPreview" latin:keyActionFlags="noKeyPreview"
latin:backgroundType="functional" /> latin:backgroundType="functional" />
<key-style <key-style
latin:styleName="toAlphaKeyStyle" latin:styleName="toAlphaKeyStyle"
latin:code="!code/key_switch_alpha_symbol" 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:keyLabelFlags="fontNormal|preserveCase"
latin:keyActionFlags="noKeyPreview" latin:keyActionFlags="noKeyPreview"
latin:backgroundType="functional" /> latin:backgroundType="functional" />
<key-style <key-style
latin:styleName="toMoreSymbolKeyStyle" latin:styleName="toMoreSymbolKeyStyle"
latin:code="!code/key_shift" 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:keyLabelFlags="fontNormal|preserveCase"
latin:keyActionFlags="noKeyPreview" latin:keyActionFlags="noKeyPreview"
latin:backgroundType="functional" /> latin:backgroundType="functional" />
<key-style <key-style
latin:styleName="backFromMoreSymbolKeyStyle" latin:styleName="backFromMoreSymbolKeyStyle"
latin:code="!code/key_shift" latin:code="!code/key_shift"
latin:keyLabel="@string/label_to_symbol_key" latin:keyLabel="!label/label_to_symbol_key"
latin:keyLabelFlags="fontNormal|preserveCase" latin:keyLabelFlags="fontNormal|preserveCase"
latin:keyActionFlags="noKeyPreview" latin:keyActionFlags="noKeyPreview"
latin:backgroundType="functional" /> latin:backgroundType="functional" />
<key-style <key-style
latin:styleName="comKeyStyle" latin:styleName="comKeyStyle"
latin:keyLabel="@string/keylabel_for_popular_domain" latin:keyLabel="!label/keylabel_for_popular_domain"
latin:keyLabelFlags="fontNormal|hasPopupHint|preserveCase" latin:keyLabelFlags="fontNormal|hasPopupHint|preserveCase"
latin:keyOutputText="@string/keylabel_for_popular_domain" latin:keyOutputText="!label/keylabel_for_popular_domain"
latin:moreKeys="@string/more_keys_for_popular_domain" /> latin:moreKeys="!label/more_keys_for_popular_domain" />
</merge> </merge>

View File

@ -39,9 +39,9 @@
</case> </case>
<default> <default>
<Key <Key
latin:keyLabel="@string/keylabel_for_apostrophe" latin:keyLabel="!label/keylabel_for_apostrophe"
latin:keyHintLabel="@string/keyhintlabel_for_apostrophe" latin:keyHintLabel="!label/keyhintlabel_for_apostrophe"
latin:moreKeys="@string/more_keys_for_apostrophe" latin:moreKeys="!label/more_keys_for_apostrophe"
latin:keyStyle="hasShiftedLetterHintStyle" /> latin:keyStyle="hasShiftedLetterHintStyle" />
</default> </default>
</switch> </switch>
@ -54,9 +54,9 @@
</case> </case>
<default> <default>
<Key <Key
latin:keyLabel="@string/keylabel_for_dash" latin:keyLabel="!label/keylabel_for_dash"
latin:keyHintLabel="@string/keyhintlabel_for_dash" latin:keyHintLabel="!label/keyhintlabel_for_dash"
latin:moreKeys="@string/more_keys_for_dash" latin:moreKeys="!label/more_keys_for_dash"
latin:keyStyle="hasShiftedLetterHintStyle" /> latin:keyStyle="hasShiftedLetterHintStyle" />
</default> </default>
</switch> </switch>

View File

@ -72,7 +72,7 @@
<Key <Key
latin:keyLabel="," latin:keyLabel=","
latin:keyLabelFlags="hasPopupHint" latin:keyLabelFlags="hasPopupHint"
latin:moreKeys="@string/more_keys_for_am_pm" latin:moreKeys="!label/more_keys_for_am_pm"
latin:keyStyle="numKeyStyle" latin:keyStyle="numKeyStyle"
latin:keyWidth="8.047%p" /> latin:keyWidth="8.047%p" />
</case> </case>

View File

@ -37,7 +37,7 @@
latin:keyWidth="37.500%p" /> latin:keyWidth="37.500%p" />
<Key <Key
latin:keyLabel="&quot;" latin:keyLabel="&quot;"
latin:moreKeys="@string/more_keys_for_tablet_double_quote" /> latin:moreKeys="!label/more_keys_for_tablet_double_quote" />
<Key <Key
latin:keyLabel="_" /> latin:keyLabel="_" />
<switch> <switch>

View File

@ -31,7 +31,7 @@
<default> <default>
<Key <Key
latin:keyLabel="\'" latin:keyLabel="\'"
latin:moreKeys="\@string/more_keys_for_single_quote" /> latin:moreKeys="!label/more_keys_for_single_quote" />
</default> </default>
</switch> </switch>
</merge> </merge>

View File

@ -35,7 +35,7 @@
<key-style <key-style
latin:styleName="f1MoreKeysStyle" latin:styleName="f1MoreKeysStyle"
latin:keyLabelFlags="hasPopupHint|preserveCase" latin:keyLabelFlags="hasPopupHint|preserveCase"
latin:moreKeys="@string/settings_as_more_key" latin:moreKeys="!label/settings_as_more_key"
latin:backgroundType="functional" /> latin:backgroundType="functional" />
</default> </default>
</switch> </switch>
@ -98,7 +98,7 @@
latin:keyLabel=":-)" latin:keyLabel=":-)"
latin:keyOutputText=":-) " latin:keyOutputText=":-) "
latin:keyLabelFlags="hasPopupHint" latin:keyLabelFlags="hasPopupHint"
latin:moreKeys="@string/more_keys_for_smiley" latin:moreKeys="!label/more_keys_for_smiley"
latin:backgroundType="functional" /> latin:backgroundType="functional" />
</case> </case>
</switch> </switch>
@ -158,7 +158,7 @@
latin:styleName="toSymbolKeyStyle" latin:styleName="toSymbolKeyStyle"
latin:code="!code/key_switch_alpha_symbol" latin:code="!code/key_switch_alpha_symbol"
latin:keyIcon="iconShortcutForLabel" 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:keyLabelFlags="withIconRight|preserveCase"
latin:keyActionFlags="noKeyPreview" latin:keyActionFlags="noKeyPreview"
latin:backgroundType="functional" /> latin:backgroundType="functional" />
@ -167,7 +167,7 @@
<key-style <key-style
latin:styleName="toSymbolKeyStyle" latin:styleName="toSymbolKeyStyle"
latin:code="!code/key_switch_alpha_symbol" 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:keyLabelFlags="preserveCase"
latin:keyActionFlags="noKeyPreview" latin:keyActionFlags="noKeyPreview"
latin:backgroundType="functional" /> latin:backgroundType="functional" />
@ -176,29 +176,29 @@
<key-style <key-style
latin:styleName="toAlphaKeyStyle" latin:styleName="toAlphaKeyStyle"
latin:code="!code/key_switch_alpha_symbol" 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:keyLabelFlags="preserveCase"
latin:keyActionFlags="noKeyPreview" latin:keyActionFlags="noKeyPreview"
latin:backgroundType="functional" /> latin:backgroundType="functional" />
<key-style <key-style
latin:styleName="toMoreSymbolKeyStyle" latin:styleName="toMoreSymbolKeyStyle"
latin:code="!code/key_shift" 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:keyLabelFlags="preserveCase"
latin:keyActionFlags="noKeyPreview" latin:keyActionFlags="noKeyPreview"
latin:backgroundType="functional" /> latin:backgroundType="functional" />
<key-style <key-style
latin:styleName="backFromMoreSymbolKeyStyle" latin:styleName="backFromMoreSymbolKeyStyle"
latin:code="!code/key_shift" latin:code="!code/key_shift"
latin:keyLabel="@string/label_to_symbol_key" latin:keyLabel="!label/label_to_symbol_key"
latin:keyLabelFlags="preserveCase" latin:keyLabelFlags="preserveCase"
latin:keyActionFlags="noKeyPreview" latin:keyActionFlags="noKeyPreview"
latin:backgroundType="functional" /> latin:backgroundType="functional" />
<key-style <key-style
latin:styleName="punctuationKeyStyle" latin:styleName="punctuationKeyStyle"
latin:keyLabel="." latin:keyLabel="."
latin:keyHintLabel="@string/keyhintlabel_for_punctuation" latin:keyHintLabel="!label/keyhintlabel_for_punctuation"
latin:keyLabelFlags="hasPopupHint|preserveCase" latin:keyLabelFlags="hasPopupHint|preserveCase"
latin:moreKeys="@string/more_keys_for_punctuation" latin:moreKeys="!label/more_keys_for_punctuation"
latin:backgroundType="functional" /> latin:backgroundType="functional" />
</merge> </merge>

View File

@ -86,7 +86,7 @@
<key-style <key-style
latin:styleName="currencyKeyStyle" latin:styleName="currencyKeyStyle"
latin:keyLabel="&#x20AA;" latin:keyLabel="&#x20AA;"
latin:moreKeys="@string/more_keys_for_currency_general" /> latin:moreKeys="!label/more_keys_for_currency_general" />
<key-style <key-style
latin:styleName="moreCurrency1KeyStyle" latin:styleName="moreCurrency1KeyStyle"
latin:keyLabel="&#x00A3;" /> latin:keyLabel="&#x00A3;" />
@ -112,7 +112,7 @@
<key-style <key-style
latin:styleName="currencyKeyStyle" latin:styleName="currencyKeyStyle"
latin:keyLabel="&#xFDFC;" latin:keyLabel="&#xFDFC;"
latin:moreKeys="@string/more_keys_for_currency_general" /> latin:moreKeys="!label/more_keys_for_currency_general" />
<key-style <key-style
latin:styleName="moreCurrency1KeyStyle" latin:styleName="moreCurrency1KeyStyle"
latin:keyLabel="£" /> latin:keyLabel="£" />
@ -138,7 +138,7 @@
<key-style <key-style
latin:styleName="currencyKeyStyle" latin:styleName="currencyKeyStyle"
latin:keyLabel="&#x00A3;" latin:keyLabel="&#x00A3;"
latin:moreKeys="@string/more_keys_for_currency_pound" /> latin:moreKeys="!label/more_keys_for_currency_pound" />
<key-style <key-style
latin:styleName="moreCurrency1KeyStyle" latin:styleName="moreCurrency1KeyStyle"
latin:keyLabel="&#x20AC;" /> latin:keyLabel="&#x20AC;" />

View File

@ -26,7 +26,7 @@
<key-style <key-style
latin:styleName="currencyKeyStyle" latin:styleName="currencyKeyStyle"
latin:keyLabel="$" latin:keyLabel="$"
latin:moreKeys="@string/more_keys_for_currency_dollar" /> latin:moreKeys="!label/more_keys_for_currency_dollar" />
<key-style <key-style
latin:styleName="moreCurrency1KeyStyle" latin:styleName="moreCurrency1KeyStyle"
latin:keyLabel="&#x00A3;" /> latin:keyLabel="&#x00A3;" />

View File

@ -26,7 +26,7 @@
<key-style <key-style
latin:styleName="currencyKeyStyle" latin:styleName="currencyKeyStyle"
latin:keyLabel="&#x20AC;" latin:keyLabel="&#x20AC;"
latin:moreKeys="@string/more_keys_for_currency_euro" /> latin:moreKeys="!abel/more_keys_for_currency_euro" />
<key-style <key-style
latin:styleName="moreCurrency1KeyStyle" latin:styleName="moreCurrency1KeyStyle"
latin:keyLabel="&#x00A3;" /> latin:keyLabel="&#x00A3;" />

View File

@ -30,7 +30,7 @@
<key-style <key-style
latin:styleName="navigateMoreKeysStyle" latin:styleName="navigateMoreKeysStyle"
latin:keyLabelFlags="hasPopupHint|preserveCase" latin:keyLabelFlags="hasPopupHint|preserveCase"
latin:moreKeys="@string/action_previous_as_more_key" /> latin:moreKeys="!label/action_previous_as_more_key" />
</case> </case>
<case <case
latin:imeAction="actionNext" latin:imeAction="actionNext"
@ -46,7 +46,7 @@
<key-style <key-style
latin:styleName="navigateMoreKeysStyle" latin:styleName="navigateMoreKeysStyle"
latin:keyLabelFlags="hasPopupHint|preserveCase" latin:keyLabelFlags="hasPopupHint|preserveCase"
latin:moreKeys="@string/action_next_as_more_key" /> latin:moreKeys="!label/action_next_as_more_key" />
</case> </case>
<case <case
latin:imeAction="actionPrevious" latin:imeAction="actionPrevious"
@ -63,7 +63,7 @@
<key-style <key-style
latin:styleName="navigateMoreKeysStyle" latin:styleName="navigateMoreKeysStyle"
latin:keyLabelFlags="hasPopupHint|preserveCase" 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>
<case <case
latin:navigateNext="true" latin:navigateNext="true"
@ -72,7 +72,7 @@
<key-style <key-style
latin:styleName="navigateMoreKeysStyle" latin:styleName="navigateMoreKeysStyle"
latin:keyLabelFlags="hasPopupHint|preserveCase" latin:keyLabelFlags="hasPopupHint|preserveCase"
latin:moreKeys="@string/action_next_as_more_key" /> latin:moreKeys="!label/action_next_as_more_key" />
</case> </case>
<case <case
latin:navigateNext="false" latin:navigateNext="false"
@ -81,7 +81,7 @@
<key-style <key-style
latin:styleName="navigateMoreKeysStyle" latin:styleName="navigateMoreKeysStyle"
latin:keyLabelFlags="hasPopupHint|preserveCase" latin:keyLabelFlags="hasPopupHint|preserveCase"
latin:moreKeys="@string/action_previous_as_more_key" /> latin:moreKeys="!label/action_previous_as_more_key" />
</case> </case>
<!-- naviagteNext="false" and navigatePrevious="false" --> <!-- naviagteNext="false" and navigatePrevious="false" -->
<default> <default>
@ -119,7 +119,7 @@
> >
<key-style <key-style
latin:styleName="enterKeyStyle" latin:styleName="enterKeyStyle"
latin:keyLabel="@string/label_go_key" latin:keyLabel="!label/label_go_key"
latin:parentStyle="defaultActionKeyStyle" /> latin:parentStyle="defaultActionKeyStyle" />
</case> </case>
<case <case
@ -127,7 +127,7 @@
> >
<key-style <key-style
latin:styleName="enterKeyStyle" latin:styleName="enterKeyStyle"
latin:keyLabel="@string/label_next_key" latin:keyLabel="!label/label_next_key"
latin:parentStyle="defaultActionKeyStyle" /> latin:parentStyle="defaultActionKeyStyle" />
</case> </case>
<case <case
@ -135,7 +135,7 @@
> >
<key-style <key-style
latin:styleName="enterKeyStyle" latin:styleName="enterKeyStyle"
latin:keyLabel="@string/label_previous_key" latin:keyLabel="!label/label_previous_key"
latin:parentStyle="defaultActionKeyStyle" /> latin:parentStyle="defaultActionKeyStyle" />
</case> </case>
<case <case
@ -143,7 +143,7 @@
> >
<key-style <key-style
latin:styleName="enterKeyStyle" latin:styleName="enterKeyStyle"
latin:keyLabel="@string/label_done_key" latin:keyLabel="!label/label_done_key"
latin:parentStyle="defaultActionKeyStyle" /> latin:parentStyle="defaultActionKeyStyle" />
</case> </case>
<case <case
@ -151,7 +151,7 @@
> >
<key-style <key-style
latin:styleName="enterKeyStyle" latin:styleName="enterKeyStyle"
latin:keyLabel="@string/label_send_key" latin:keyLabel="!label/label_send_key"
latin:parentStyle="defaultActionKeyStyle" /> latin:parentStyle="defaultActionKeyStyle" />
</case> </case>
<case <case

View File

@ -100,25 +100,25 @@
<key-style <key-style
latin:styleName="numPhoneToSymbolKeyStyle" latin:styleName="numPhoneToSymbolKeyStyle"
latin:code="!code/key_switch_alpha_symbol" 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" /> latin:parentStyle="numModeKeyStyle" />
<key-style <key-style
latin:styleName="numPhoneToNumericKeyStyle" latin:styleName="numPhoneToNumericKeyStyle"
latin:code="!code/key_switch_alpha_symbol" 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" /> latin:parentStyle="numModeKeyStyle" />
<!-- U+002C: "," COMMA --> <!-- U+002C: "," COMMA -->
<key-style <key-style
latin:styleName="numPauseKeyStyle" latin:styleName="numPauseKeyStyle"
latin:code="0x002C" latin:code="0x002C"
latin:keyLabel="@string/label_pause_key" latin:keyLabel="!label/label_pause_key"
latin:keyLabelFlags="followKeyHintLabelRatio|autoXScale" latin:keyLabelFlags="followKeyHintLabelRatio|autoXScale"
latin:parentStyle="numKeyBaseStyle" /> latin:parentStyle="numKeyBaseStyle" />
<!-- U+003B: ";" SEMICOLON --> <!-- U+003B: ";" SEMICOLON -->
<key-style <key-style
latin:styleName="numWaitKeyStyle" latin:styleName="numWaitKeyStyle"
latin:code="0x003B" latin:code="0x003B"
latin:keyLabel="@string/label_wait_key" latin:keyLabel="!label/label_wait_key"
latin:keyLabelFlags="followKeyHintLabelRatio|autoXScale" latin:keyLabelFlags="followKeyHintLabelRatio|autoXScale"
latin:parentStyle="numKeyBaseStyle" /> latin:parentStyle="numKeyBaseStyle" />
<key-style <key-style

View File

@ -24,9 +24,9 @@
<Key <Key
latin:keyLabel="&lt;" latin:keyLabel="&lt;"
latin:code="!code/key_less_than" latin:code="!code/key_less_than"
latin:moreKeys="@string/more_keys_for_less_than" /> latin:moreKeys="!label/more_keys_for_less_than" />
<Key <Key
latin:keyLabel="&gt;" latin:keyLabel="&gt;"
latin:code="!code/key_greater_than" latin:code="!code/key_greater_than"
latin:moreKeys="@string/more_keys_for_greater_than" /> latin:moreKeys="!label/more_keys_for_greater_than" />
</merge> </merge>

View File

@ -24,9 +24,9 @@
<Key <Key
latin:keyLabel="(" latin:keyLabel="("
latin:code="!code/key_left_parenthesis" latin:code="!code/key_left_parenthesis"
latin:moreKeys="@string/more_keys_for_left_parenthesis" /> latin:moreKeys="!label/more_keys_for_left_parenthesis" />
<Key <Key
latin:keyLabel=")" latin:keyLabel=")"
latin:code="!code/key_right_parenthesis" latin:code="!code/key_right_parenthesis"
latin:moreKeys="@string/more_keys_for_right_parenthesis" /> latin:moreKeys="!label/more_keys_for_right_parenthesis" />
</merge> </merge>

View File

@ -51,9 +51,9 @@
<!-- latin:hasShortcutKey="false" --> <!-- latin:hasShortcutKey="false" -->
<default> <default>
<Key <Key
latin:keyLabel="@string/keylabel_for_comma" latin:keyLabel="!label/keylabel_for_comma"
latin:keyLabelFlags="hasPopupHint" latin:keyLabelFlags="hasPopupHint"
latin:additionalMoreKeys="@string/more_keys_for_comma" latin:additionalMoreKeys="!label/more_keys_for_comma"
latin:keyStyle="f1MoreKeysStyle" /> latin:keyStyle="f1MoreKeysStyle" />
</default> </default>
</switch> </switch>

View File

@ -25,47 +25,47 @@
latin:keyLabel="a" latin:keyLabel="a"
latin:keyHintLabel="1" latin:keyHintLabel="1"
latin:additionalMoreKeys="1" latin:additionalMoreKeys="1"
latin:moreKeys="@string/more_keys_for_a" /> latin:moreKeys="!label/more_keys_for_a" />
<Key <Key
latin:keyLabel="z" latin:keyLabel="z"
latin:keyHintLabel="2" latin:keyHintLabel="2"
latin:additionalMoreKeys="2" latin:additionalMoreKeys="2"
latin:moreKeys="@string/more_keys_for_z" /> latin:moreKeys="!label/more_keys_for_z" />
<Key <Key
latin:keyLabel="e" latin:keyLabel="e"
latin:keyHintLabel="3" latin:keyHintLabel="3"
latin:additionalMoreKeys="3" latin:additionalMoreKeys="3"
latin:moreKeys="@string/more_keys_for_e" /> latin:moreKeys="!label/more_keys_for_e" />
<Key <Key
latin:keyLabel="r" latin:keyLabel="r"
latin:keyHintLabel="4" latin:keyHintLabel="4"
latin:additionalMoreKeys="4" latin:additionalMoreKeys="4"
latin:moreKeys="@string/more_keys_for_r" /> latin:moreKeys="!label/more_keys_for_r" />
<Key <Key
latin:keyLabel="t" latin:keyLabel="t"
latin:keyHintLabel="5" latin:keyHintLabel="5"
latin:additionalMoreKeys="5" latin:additionalMoreKeys="5"
latin:moreKeys="@string/more_keys_for_t" /> latin:moreKeys="!label/more_keys_for_t" />
<Key <Key
latin:keyLabel="y" latin:keyLabel="y"
latin:keyHintLabel="6" latin:keyHintLabel="6"
latin:additionalMoreKeys="6" latin:additionalMoreKeys="6"
latin:moreKeys="@string/more_keys_for_y" /> latin:moreKeys="!label/more_keys_for_y" />
<Key <Key
latin:keyLabel="u" latin:keyLabel="u"
latin:keyHintLabel="7" latin:keyHintLabel="7"
latin:additionalMoreKeys="7" latin:additionalMoreKeys="7"
latin:moreKeys="@string/more_keys_for_u" /> latin:moreKeys="!label/more_keys_for_u" />
<Key <Key
latin:keyLabel="i" latin:keyLabel="i"
latin:keyHintLabel="8" latin:keyHintLabel="8"
latin:additionalMoreKeys="8" latin:additionalMoreKeys="8"
latin:moreKeys="@string/more_keys_for_i" /> latin:moreKeys="!label/more_keys_for_i" />
<Key <Key
latin:keyLabel="o" latin:keyLabel="o"
latin:keyHintLabel="9" latin:keyHintLabel="9"
latin:additionalMoreKeys="9" latin:additionalMoreKeys="9"
latin:moreKeys="@string/more_keys_for_o" /> latin:moreKeys="!label/more_keys_for_o" />
<Key <Key
latin:keyLabel="p" latin:keyLabel="p"
latin:keyHintLabel="0" latin:keyHintLabel="0"

View File

@ -25,27 +25,27 @@
latin:keyLabel="q" /> latin:keyLabel="q" />
<Key <Key
latin:keyLabel="s" latin:keyLabel="s"
latin:moreKeys="@string/more_keys_for_s" /> latin:moreKeys="!label/more_keys_for_s" />
<Key <Key
latin:keyLabel="d" latin:keyLabel="d"
latin:moreKeys="@string/more_keys_for_d" /> latin:moreKeys="!label/more_keys_for_d" />
<Key <Key
latin:keyLabel="f" /> latin:keyLabel="f" />
<Key <Key
latin:keyLabel="g" latin:keyLabel="g"
latin:moreKeys="@string/more_keys_for_g" /> latin:moreKeys="!label/more_keys_for_g" />
<Key <Key
latin:keyLabel="h" latin:keyLabel="h"
latin:moreKeys="@string/more_keys_for_h" /> latin:moreKeys="!label/more_keys_for_h" />
<Key <Key
latin:keyLabel="j" latin:keyLabel="j"
latin:moreKeys="@string/more_keys_for_j" /> latin:moreKeys="!label/more_keys_for_j" />
<Key <Key
latin:keyLabel="k" latin:keyLabel="k"
latin:moreKeys="@string/more_keys_for_k" /> latin:moreKeys="!label/more_keys_for_k" />
<Key <Key
latin:keyLabel="l" latin:keyLabel="l"
latin:moreKeys="@string/more_keys_for_l" /> latin:moreKeys="!label/more_keys_for_l" />
<Key <Key
latin:keyLabel="m" /> latin:keyLabel="m" />
</merge> </merge>

View File

@ -23,20 +23,20 @@
> >
<Key <Key
latin:keyLabel="w" latin:keyLabel="w"
latin:moreKeys="@string/more_keys_for_w" /> latin:moreKeys="!label/more_keys_for_w" />
<Key <Key
latin:keyLabel="x" /> latin:keyLabel="x" />
<Key <Key
latin:keyLabel="c" latin:keyLabel="c"
latin:moreKeys="@string/more_keys_for_c" /> latin:moreKeys="!label/more_keys_for_c" />
<Key <Key
latin:keyLabel="v" latin:keyLabel="v"
latin:moreKeys="@string/more_keys_for_v" /> latin:moreKeys="!label/more_keys_for_v" />
<Key <Key
latin:keyLabel="b" /> latin:keyLabel="b" />
<Key <Key
latin:keyLabel="n" latin:keyLabel="n"
latin:moreKeys="@string/more_keys_for_n" /> latin:moreKeys="!label/more_keys_for_n" />
<include <include
latin:keyboardLayout="@xml/key_azerty_quote" /> latin:keyboardLayout="@xml/key_azerty_quote" />
</merge> </merge>

View File

@ -36,7 +36,7 @@
latin:keyLabel="&#x0443;" latin:keyLabel="&#x0443;"
latin:keyHintLabel="3" latin:keyHintLabel="3"
latin:additionalMoreKeys="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 --> <!-- U+043A: "к" CYRILLIC SMALL LETTER KA -->
<Key <Key
latin:keyLabel="&#x043A;" latin:keyLabel="&#x043A;"
@ -47,13 +47,13 @@
latin:keyLabel="&#x0435;" latin:keyLabel="&#x0435;"
latin:keyHintLabel="5" latin:keyHintLabel="5"
latin:additionalMoreKeys="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 --> <!-- U+043D: "н" CYRILLIC SMALL LETTER EN -->
<Key <Key
latin:keyLabel="&#x043D;" latin:keyLabel="&#x043D;"
latin:keyHintLabel="6" latin:keyHintLabel="6"
latin:additionalMoreKeys="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 --> <!-- U+0433: "г" CYRILLIC SMALL LETTER GHE -->
<Key <Key
latin:keyLabel="&#x0433;" latin:keyLabel="&#x0433;"
@ -65,7 +65,7 @@
latin:keyHintLabel="8" latin:keyHintLabel="8"
latin:additionalMoreKeys="8" /> latin:additionalMoreKeys="8" />
<Key <Key
latin:keyLabel="@string/keylabel_for_east_slavic_row1_9" latin:keyLabel="!label/keylabel_for_east_slavic_row1_9"
latin:keyHintLabel="9" latin:keyHintLabel="9"
latin:additionalMoreKeys="9" /> latin:additionalMoreKeys="9" />
<!-- U+0437: "з" CYRILLIC SMALL LETTER ZE --> <!-- U+0437: "з" CYRILLIC SMALL LETTER ZE -->
@ -76,5 +76,5 @@
<!-- U+0445: "х" CYRILLIC SMALL LETTER HA --> <!-- U+0445: "х" CYRILLIC SMALL LETTER HA -->
<Key <Key
latin:keyLabel="&#x0445;" latin:keyLabel="&#x0445;"
latin:moreKeys="@string/more_keys_for_cyrillic_ha" /> latin:moreKeys="!label/more_keys_for_cyrillic_ha" />
</merge> </merge>

View File

@ -25,8 +25,8 @@
<Key <Key
latin:keyLabel="&#x0444;" /> latin:keyLabel="&#x0444;" />
<Key <Key
latin:keyLabel="@string/keylabel_for_east_slavic_row2_1" latin:keyLabel="!label/keylabel_for_east_slavic_row2_1"
latin:moreKeys="@string/more_keys_for_east_slavic_row2_1" /> latin:moreKeys="!label/more_keys_for_east_slavic_row2_1" />
<!-- U+0432: "в" CYRILLIC SMALL LETTER VE --> <!-- U+0432: "в" CYRILLIC SMALL LETTER VE -->
<Key <Key
latin:keyLabel="&#x0432;" /> latin:keyLabel="&#x0432;" />
@ -42,7 +42,7 @@
<!-- U+043E: "о" CYRILLIC SMALL LETTER O --> <!-- U+043E: "о" CYRILLIC SMALL LETTER O -->
<Key <Key
latin:keyLabel="&#x043E;" latin:keyLabel="&#x043E;"
latin:moreKeys="@string/more_keys_for_cyrillic_o" /> latin:moreKeys="!label/more_keys_for_cyrillic_o" />
<!-- U+043B: "л" CYRILLIC SMALL LETTER EL --> <!-- U+043B: "л" CYRILLIC SMALL LETTER EL -->
<Key <Key
latin:keyLabel="&#x043B;" /> latin:keyLabel="&#x043B;" />

View File

@ -34,14 +34,14 @@
<Key <Key
latin:keyLabel="&#x043C;" /> latin:keyLabel="&#x043C;" />
<Key <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 --> <!-- U+0442: "т" CYRILLIC SMALL LETTER TE -->
<Key <Key
latin:keyLabel="&#x0442;" /> latin:keyLabel="&#x0442;" />
<!-- U+044C: "ь" CYRILLIC SMALL LETTER SOFT SIGN --> <!-- U+044C: "ь" CYRILLIC SMALL LETTER SOFT SIGN -->
<Key <Key
latin:keyLabel="&#x044C;" latin:keyLabel="&#x044C;"
latin:moreKeys="@string/more_keys_for_cyrillic_soft_sign" /> latin:moreKeys="!label/more_keys_for_cyrillic_soft_sign" />
<!-- U+0431: "б" CYRILLIC SMALL LETTER BE --> <!-- U+0431: "б" CYRILLIC SMALL LETTER BE -->
<Key <Key
latin:keyLabel="&#x0431;" /> latin:keyLabel="&#x0431;" />

View File

@ -24,5 +24,5 @@
<include <include
latin:keyboardLayout="@xml/rowkeys_qwerty1" /> latin:keyboardLayout="@xml/rowkeys_qwerty1" />
<Key <Key
latin:keyLabel="@string/keylabel_for_nordic_row1_11" /> latin:keyLabel="!label/keylabel_for_nordic_row1_11" />
</merge> </merge>

View File

@ -24,9 +24,9 @@
<include <include
latin:keyboardLayout="@xml/rowkeys_qwerty2" /> latin:keyboardLayout="@xml/rowkeys_qwerty2" />
<Key <Key
latin:keyLabel="@string/keylabel_for_nordic_row2_10" latin:keyLabel="!label/keylabel_for_nordic_row2_10"
latin:moreKeys="@string/more_keys_for_nordic_row2_10" /> latin:moreKeys="!label/more_keys_for_nordic_row2_10" />
<Key <Key
latin:keyLabel="@string/keylabel_for_nordic_row2_11" latin:keyLabel="!label/keylabel_for_nordic_row2_11"
latin:moreKeys="@string/more_keys_for_nordic_row2_11" /> latin:moreKeys="!label/more_keys_for_nordic_row2_11" />
</merge> </merge>

View File

@ -29,42 +29,42 @@
latin:keyLabel="w" latin:keyLabel="w"
latin:keyHintLabel="2" latin:keyHintLabel="2"
latin:additionalMoreKeys="2" latin:additionalMoreKeys="2"
latin:moreKeys="@string/more_keys_for_w" /> latin:moreKeys="!label/more_keys_for_w" />
<Key <Key
latin:keyLabel="e" latin:keyLabel="e"
latin:keyHintLabel="3" latin:keyHintLabel="3"
latin:additionalMoreKeys="3" latin:additionalMoreKeys="3"
latin:moreKeys="@string/more_keys_for_e" /> latin:moreKeys="!label/more_keys_for_e" />
<Key <Key
latin:keyLabel="r" latin:keyLabel="r"
latin:keyHintLabel="4" latin:keyHintLabel="4"
latin:additionalMoreKeys="4" latin:additionalMoreKeys="4"
latin:moreKeys="@string/more_keys_for_r" /> latin:moreKeys="!label/more_keys_for_r" />
<Key <Key
latin:keyLabel="t" latin:keyLabel="t"
latin:keyHintLabel="5" latin:keyHintLabel="5"
latin:additionalMoreKeys="5" latin:additionalMoreKeys="5"
latin:moreKeys="@string/more_keys_for_t" /> latin:moreKeys="!label/more_keys_for_t" />
<Key <Key
latin:keyLabel="y" latin:keyLabel="y"
latin:keyHintLabel="6" latin:keyHintLabel="6"
latin:additionalMoreKeys="6" latin:additionalMoreKeys="6"
latin:moreKeys="@string/more_keys_for_y" /> latin:moreKeys="!label/more_keys_for_y" />
<Key <Key
latin:keyLabel="u" latin:keyLabel="u"
latin:keyHintLabel="7" latin:keyHintLabel="7"
latin:additionalMoreKeys="7" latin:additionalMoreKeys="7"
latin:moreKeys="@string/more_keys_for_u" /> latin:moreKeys="!label/more_keys_for_u" />
<Key <Key
latin:keyLabel="i" latin:keyLabel="i"
latin:keyHintLabel="8" latin:keyHintLabel="8"
latin:additionalMoreKeys="8" latin:additionalMoreKeys="8"
latin:moreKeys="@string/more_keys_for_i" /> latin:moreKeys="!label/more_keys_for_i" />
<Key <Key
latin:keyLabel="o" latin:keyLabel="o"
latin:keyHintLabel="9" latin:keyHintLabel="9"
latin:additionalMoreKeys="9" latin:additionalMoreKeys="9"
latin:moreKeys="@string/more_keys_for_o" /> latin:moreKeys="!label/more_keys_for_o" />
<Key <Key
latin:keyLabel="p" latin:keyLabel="p"
latin:keyHintLabel="0" latin:keyHintLabel="0"

View File

@ -23,28 +23,28 @@
> >
<Key <Key
latin:keyLabel="a" latin:keyLabel="a"
latin:moreKeys="@string/more_keys_for_a" /> latin:moreKeys="!label/more_keys_for_a" />
<Key <Key
latin:keyLabel="s" latin:keyLabel="s"
latin:moreKeys="@string/more_keys_for_s" /> latin:moreKeys="!label/more_keys_for_s" />
<Key <Key
latin:keyLabel="d" latin:keyLabel="d"
latin:moreKeys="@string/more_keys_for_d" /> latin:moreKeys="!label/more_keys_for_d" />
<Key <Key
latin:keyLabel="f" /> latin:keyLabel="f" />
<Key <Key
latin:keyLabel="g" latin:keyLabel="g"
latin:moreKeys="@string/more_keys_for_g" /> latin:moreKeys="!label/more_keys_for_g" />
<Key <Key
latin:keyLabel="h" latin:keyLabel="h"
latin:moreKeys="@string/more_keys_for_h" /> latin:moreKeys="!label/more_keys_for_h" />
<Key <Key
latin:keyLabel="j" latin:keyLabel="j"
latin:moreKeys="@string/more_keys_for_j" /> latin:moreKeys="!label/more_keys_for_j" />
<Key <Key
latin:keyLabel="k" latin:keyLabel="k"
latin:moreKeys="@string/more_keys_for_k" /> latin:moreKeys="!label/more_keys_for_k" />
<Key <Key
latin:keyLabel="l" latin:keyLabel="l"
latin:moreKeys="@string/more_keys_for_l" /> latin:moreKeys="!label/more_keys_for_l" />
</merge> </merge>

View File

@ -23,20 +23,20 @@
> >
<Key <Key
latin:keyLabel="z" latin:keyLabel="z"
latin:moreKeys="@string/more_keys_for_z" /> latin:moreKeys="!label/more_keys_for_z" />
<Key <Key
latin:keyLabel="x" /> latin:keyLabel="x" />
<Key <Key
latin:keyLabel="c" latin:keyLabel="c"
latin:moreKeys="@string/more_keys_for_c" /> latin:moreKeys="!label/more_keys_for_c" />
<Key <Key
latin:keyLabel="v" latin:keyLabel="v"
latin:moreKeys="@string/more_keys_for_v" /> latin:moreKeys="!label/more_keys_for_v" />
<Key <Key
latin:keyLabel="b" /> latin:keyLabel="b" />
<Key <Key
latin:keyLabel="n" latin:keyLabel="n"
latin:moreKeys="@string/more_keys_for_n" /> latin:moreKeys="!label/more_keys_for_n" />
<Key <Key
latin:keyLabel="m" /> latin:keyLabel="m" />
</merge> </merge>

View File

@ -29,42 +29,42 @@
latin:keyLabel="w" latin:keyLabel="w"
latin:keyHintLabel="2" latin:keyHintLabel="2"
latin:additionalMoreKeys="2" latin:additionalMoreKeys="2"
latin:moreKeys="@string/more_keys_for_w" /> latin:moreKeys="!label/more_keys_for_w" />
<Key <Key
latin:keyLabel="e" latin:keyLabel="e"
latin:keyHintLabel="3" latin:keyHintLabel="3"
latin:additionalMoreKeys="3" latin:additionalMoreKeys="3"
latin:moreKeys="@string/more_keys_for_e" /> latin:moreKeys="!label/more_keys_for_e" />
<Key <Key
latin:keyLabel="r" latin:keyLabel="r"
latin:keyHintLabel="4" latin:keyHintLabel="4"
latin:additionalMoreKeys="4" latin:additionalMoreKeys="4"
latin:moreKeys="@string/more_keys_for_r" /> latin:moreKeys="!label/more_keys_for_r" />
<Key <Key
latin:keyLabel="t" latin:keyLabel="t"
latin:keyHintLabel="5" latin:keyHintLabel="5"
latin:additionalMoreKeys="5" latin:additionalMoreKeys="5"
latin:moreKeys="@string/more_keys_for_t" /> latin:moreKeys="!label/more_keys_for_t" />
<Key <Key
latin:keyLabel="z" latin:keyLabel="z"
latin:keyHintLabel="6" latin:keyHintLabel="6"
latin:additionalMoreKeys="6" latin:additionalMoreKeys="6"
latin:moreKeys="@string/more_keys_for_z" /> latin:moreKeys="!label/more_keys_for_z" />
<Key <Key
latin:keyLabel="u" latin:keyLabel="u"
latin:keyHintLabel="7" latin:keyHintLabel="7"
latin:additionalMoreKeys="7" latin:additionalMoreKeys="7"
latin:moreKeys="@string/more_keys_for_u" /> latin:moreKeys="!label/more_keys_for_u" />
<Key <Key
latin:keyLabel="i" latin:keyLabel="i"
latin:keyHintLabel="8" latin:keyHintLabel="8"
latin:additionalMoreKeys="8" latin:additionalMoreKeys="8"
latin:moreKeys="@string/more_keys_for_i" /> latin:moreKeys="!label/more_keys_for_i" />
<Key <Key
latin:keyLabel="o" latin:keyLabel="o"
latin:keyHintLabel="9" latin:keyHintLabel="9"
latin:additionalMoreKeys="9" latin:additionalMoreKeys="9"
latin:moreKeys="@string/more_keys_for_o" /> latin:moreKeys="!label/more_keys_for_o" />
<Key <Key
latin:keyLabel="p" latin:keyLabel="p"
latin:keyHintLabel="0" latin:keyHintLabel="0"

View File

@ -23,20 +23,20 @@
> >
<Key <Key
latin:keyLabel="y" latin:keyLabel="y"
latin:moreKeys="@string/more_keys_for_y" /> latin:moreKeys="!label/more_keys_for_y" />
<Key <Key
latin:keyLabel="x" /> latin:keyLabel="x" />
<Key <Key
latin:keyLabel="c" latin:keyLabel="c"
latin:moreKeys="@string/more_keys_for_c" /> latin:moreKeys="!label/more_keys_for_c" />
<Key <Key
latin:keyLabel="v" latin:keyLabel="v"
latin:moreKeys="@string/more_keys_for_v" /> latin:moreKeys="!label/more_keys_for_v" />
<Key <Key
latin:keyLabel="b" /> latin:keyLabel="b" />
<Key <Key
latin:keyLabel="n" latin:keyLabel="n"
latin:moreKeys="@string/more_keys_for_n" /> latin:moreKeys="!label/more_keys_for_n" />
<Key <Key
latin:keyLabel="m" /> latin:keyLabel="m" />
</merge> </merge>

View File

@ -36,7 +36,7 @@
latin:keyLabel="&#x0435;" latin:keyLabel="&#x0435;"
latin:keyHintLabel="3" latin:keyHintLabel="3"
latin:additionalMoreKeys="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 --> <!-- U+0440: "р" CYRILLIC SMALL LETTER ER -->
<Key <Key
latin:keyLabel="&#x0440;" latin:keyLabel="&#x0440;"
@ -48,7 +48,7 @@
latin:keyHintLabel="5" latin:keyHintLabel="5"
latin:additionalMoreKeys="5" /> latin:additionalMoreKeys="5" />
<Key <Key
latin:keyLabel="@string/keylabel_for_south_slavic_row1_6" latin:keyLabel="!label/keylabel_for_south_slavic_row1_6"
latin:keyHintLabel="6" latin:keyHintLabel="6"
latin:additionalMoreKeys="6" /> latin:additionalMoreKeys="6" />
<!-- U+0443: "у" CYRILLIC SMALL LETTER U --> <!-- U+0443: "у" CYRILLIC SMALL LETTER U -->
@ -61,7 +61,7 @@
latin:keyLabel="&#x0438;" latin:keyLabel="&#x0438;"
latin:keyHintLabel="8" latin:keyHintLabel="8"
latin:additionalMoreKeys="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 --> <!-- U+043E: "о" CYRILLIC SMALL LETTER O -->
<Key <Key
latin:keyLabel="&#x043E;" latin:keyLabel="&#x043E;"

View File

@ -52,5 +52,5 @@
<Key <Key
latin:keyLabel="&#x0447;" /> latin:keyLabel="&#x0447;" />
<Key <Key
latin:keyLabel="@string/keylabel_for_south_slavic_row2_11" /> latin:keyLabel="!label/keylabel_for_south_slavic_row2_11" />
</merge> </merge>

View File

@ -22,7 +22,7 @@
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin" xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
> >
<Key <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 --> <!-- U+045F: "џ" CYRILLIC SMALL LETTER DZHE -->
<Key <Key
latin:keyLabel="&#x045F;" /> latin:keyLabel="&#x045F;" />
@ -42,7 +42,7 @@
<Key <Key
latin:keyLabel="&#x043C;" /> latin:keyLabel="&#x043C;" />
<Key <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 --> <!-- U+0436: "ж" CYRILLIC SMALL LETTER ZHE -->
<Key <Key
latin:keyLabel="&#x0436;" /> latin:keyLabel="&#x0436;" />

View File

@ -22,43 +22,43 @@
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin" xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
> >
<Key <Key
latin:keyLabel="@string/keylabel_for_symbols_1" latin:keyLabel="!label/keylabel_for_symbols_1"
latin:additionalMoreKeys="@string/additional_more_keys_for_symbols_1" latin:additionalMoreKeys="!label/additional_more_keys_for_symbols_1"
latin:moreKeys="@string/more_keys_for_symbols_1" /> latin:moreKeys="!label/more_keys_for_symbols_1" />
<Key <Key
latin:keyLabel="@string/keylabel_for_symbols_2" latin:keyLabel="!label/keylabel_for_symbols_2"
latin:additionalMoreKeys="@string/additional_more_keys_for_symbols_2" latin:additionalMoreKeys="!label/additional_more_keys_for_symbols_2"
latin:moreKeys="@string/more_keys_for_symbols_2" /> latin:moreKeys="!label/more_keys_for_symbols_2" />
<Key <Key
latin:keyLabel="@string/keylabel_for_symbols_3" latin:keyLabel="!label/keylabel_for_symbols_3"
latin:additionalMoreKeys="@string/additional_more_keys_for_symbols_3" latin:additionalMoreKeys="!label/additional_more_keys_for_symbols_3"
latin:moreKeys="@string/more_keys_for_symbols_3" /> latin:moreKeys="!label/more_keys_for_symbols_3" />
<Key <Key
latin:keyLabel="@string/keylabel_for_symbols_4" latin:keyLabel="!label/keylabel_for_symbols_4"
latin:additionalMoreKeys="@string/additional_more_keys_for_symbols_4" latin:additionalMoreKeys="!label/additional_more_keys_for_symbols_4"
latin:moreKeys="@string/more_keys_for_symbols_4" /> latin:moreKeys="!label/more_keys_for_symbols_4" />
<Key <Key
latin:keyLabel="@string/keylabel_for_symbols_5" latin:keyLabel="!label/keylabel_for_symbols_5"
latin:additionalMoreKeys="@string/additional_more_keys_for_symbols_5" latin:additionalMoreKeys="!label/additional_more_keys_for_symbols_5"
latin:moreKeys="@string/more_keys_for_symbols_5" /> latin:moreKeys="!label/more_keys_for_symbols_5" />
<Key <Key
latin:keyLabel="@string/keylabel_for_symbols_6" latin:keyLabel="!label/keylabel_for_symbols_6"
latin:additionalMoreKeys="@string/additional_more_keys_for_symbols_6" latin:additionalMoreKeys="!label/additional_more_keys_for_symbols_6"
latin:moreKeys="@string/more_keys_for_symbols_6" /> latin:moreKeys="!label/more_keys_for_symbols_6" />
<Key <Key
latin:keyLabel="@string/keylabel_for_symbols_7" latin:keyLabel="!label/keylabel_for_symbols_7"
latin:additionalMoreKeys="@string/additional_more_keys_for_symbols_7" latin:additionalMoreKeys="!label/additional_more_keys_for_symbols_7"
latin:moreKeys="@string/more_keys_for_symbols_7" /> latin:moreKeys="!label/more_keys_for_symbols_7" />
<Key <Key
latin:keyLabel="@string/keylabel_for_symbols_8" latin:keyLabel="!label/keylabel_for_symbols_8"
latin:additionalMoreKeys="@string/additional_more_keys_for_symbols_8" latin:additionalMoreKeys="!label/additional_more_keys_for_symbols_8"
latin:moreKeys="@string/more_keys_for_symbols_8" /> latin:moreKeys="!label/more_keys_for_symbols_8" />
<Key <Key
latin:keyLabel="@string/keylabel_for_symbols_9" latin:keyLabel="!label/keylabel_for_symbols_9"
latin:additionalMoreKeys="@string/additional_more_keys_for_symbols_9" latin:additionalMoreKeys="!label/additional_more_keys_for_symbols_9"
latin:moreKeys="@string/more_keys_for_symbols_9" /> latin:moreKeys="!label/more_keys_for_symbols_9" />
<Key <Key
latin:keyLabel="@string/keylabel_for_symbols_0" latin:keyLabel="!label/keylabel_for_symbols_0"
latin:additionalMoreKeys="@string/additional_more_keys_for_symbols_0" latin:additionalMoreKeys="!label/additional_more_keys_for_symbols_0"
latin:moreKeys="@string/more_keys_for_symbols_0" /> latin:moreKeys="!label/more_keys_for_symbols_0" />
</merge> </merge>

View File

@ -28,21 +28,21 @@
<Key <Key
latin:keyStyle="currencyKeyStyle" /> latin:keyStyle="currencyKeyStyle" />
<Key <Key
latin:keyLabel="@string/keylabel_for_symbols_percent" latin:keyLabel="!label/keylabel_for_symbols_percent"
latin:moreKeys="@string/more_keys_for_symbols_percent" /> latin:moreKeys="!label/more_keys_for_symbols_percent" />
<Key <Key
latin:keyLabel="&amp;" /> latin:keyLabel="&amp;" />
<Key <Key
latin:keyLabel="*" latin:keyLabel="*"
latin:moreKeys="@string/more_keys_for_star" /> latin:moreKeys="!label/more_keys_for_star" />
<!-- U+2013: "" EN DASH <!-- U+2013: "" EN DASH
U+2014: "—" EM DASH --> U+2014: "—" EM DASH -->
<Key <Key
latin:keyLabel="-" latin:keyLabel="-"
latin:moreKeys="_,&#x2013;,&#x2014;" /> latin:moreKeys="_,&#x2013;,&#x2014;" />
<Key <Key
latin:keyLabel="+" latin:keyLabel="+"
latin:moreKeys="@string/more_keys_for_plus" /> latin:moreKeys="!label/more_keys_for_plus" />
<include <include
latin:keyboardLayout="@xml/keys_parentheses" /> latin:keyboardLayout="@xml/keys_parentheses" />
</merge> </merge>

View File

@ -31,20 +31,20 @@
latin:moreKeys="&#x00A1;" /> latin:moreKeys="&#x00A1;" />
<Key <Key
latin:keyLabel="&quot;" latin:keyLabel="&quot;"
latin:moreKeys="@string/more_keys_for_double_quote" /> latin:moreKeys="!label/more_keys_for_double_quote" />
<Key <Key
latin:keyLabel="\'" latin:keyLabel="\'"
latin:moreKeys="@string/more_keys_for_single_quote" /> latin:moreKeys="!label/more_keys_for_single_quote" />
<Key <Key
latin:keyLabel=":" /> latin:keyLabel=":" />
<Key <Key
latin:keyLabel="@string/keylabel_for_symbols_semicolon" latin:keyLabel="!label/keylabel_for_symbols_semicolon"
latin:moreKeys="@string/more_keys_for_symbols_semicolon" /> latin:moreKeys="!label/more_keys_for_symbols_semicolon" />
<Key <Key
latin:keyLabel="/" /> latin:keyLabel="/" />
<Key <Key
latin:keyLabel="@string/keylabel_for_symbols_question" latin:keyLabel="!label/keylabel_for_symbols_question"
latin:moreKeys="@string/more_keys_for_symbols_question" /> latin:moreKeys="!label/more_keys_for_symbols_question" />
<Key <Key
latin:keyStyle="deleteKeyStyle" latin:keyStyle="deleteKeyStyle"
latin:keyWidth="fillRight" latin:keyWidth="fillRight"

View File

@ -30,7 +30,7 @@
<!-- U+2022: "•" BULLET --> <!-- U+2022: "•" BULLET -->
<Key <Key
latin:keyLabel="&#x2022;" latin:keyLabel="&#x2022;"
latin:moreKeys="@string/more_keys_for_bullet" /> latin:moreKeys="!label/more_keys_for_bullet" />
<!-- U+221A: "√" SQUARE ROOT --> <!-- U+221A: "√" SQUARE ROOT -->
<Key <Key
latin:keyLabel="&#x221A;" /> latin:keyLabel="&#x221A;" />

View File

@ -61,7 +61,7 @@
<Key <Key
latin:keyLabel="." latin:keyLabel="."
latin:keyLabelFlags="hasPopupHint" latin:keyLabelFlags="hasPopupHint"
latin:moreKeys="@string/more_keys_for_am_pm" latin:moreKeys="!label/more_keys_for_am_pm"
latin:keyStyle="numFunctionalKeyStyle" latin:keyStyle="numFunctionalKeyStyle"
latin:keyWidth="fillRight" /> latin:keyWidth="fillRight" />
</case> </case>

View File

@ -37,9 +37,9 @@
<!-- latin:hasShortcutKey="false" --> <!-- latin:hasShortcutKey="false" -->
<default> <default>
<Key <Key
latin:keyLabel="@string/keylabel_for_comma" latin:keyLabel="!label/keylabel_for_comma"
latin:keyLabelFlags="hasPopupHint" latin:keyLabelFlags="hasPopupHint"
latin:additionalMoreKeys="@string/more_keys_for_comma" latin:additionalMoreKeys="!label/more_keys_for_comma"
latin:keyStyle="f1MoreKeysStyle" /> latin:keyStyle="f1MoreKeysStyle" />
</default> </default>
</switch> </switch>

View File

@ -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 * @param row the row that this key belongs to. row's x-coordinate will be the right edge of
* this key. * this key.
* @param parser the XML parser containing the attributes for this key * @param parser the XML parser containing the attributes for this key
* @param keyStyles active key styles set
* @throws XmlPullParserException * @throws XmlPullParserException
*/ */
public Key(Resources res, Keyboard.Params params, Keyboard.Builder.Row row, 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 float horizontalGap = isSpacer() ? 0 : params.mHorizontalGap;
final int keyHeight = row.mRowHeight; final int keyHeight = row.mRowHeight;
mVerticalGap = params.mVerticalGap; mVerticalGap = params.mVerticalGap;
@ -210,7 +210,7 @@ public class Key {
throw new XmlParseUtils.ParseException( throw new XmlParseUtils.ParseException(
"Unknown key style: " + styleName, parser); "Unknown key style: " + styleName, parser);
} else { } else {
style = KeyStyles.getEmptyKeyStyle(); style = keyStyles.getEmptyKeyStyle();
} }
final float keyXPos = row.getKeyX(keyAttr); final float keyXPos = row.getKeyX(keyAttr);
@ -709,8 +709,8 @@ public class Key {
public static class Spacer extends Key { public static class Spacer extends Key {
public Spacer(Resources res, Keyboard.Params params, Keyboard.Builder.Row row, public Spacer(Resources res, Keyboard.Params params, Keyboard.Builder.Row row,
XmlPullParser parser, KeyStyles keyStyles) throws XmlPullParserException { XmlPullParser parser) throws XmlPullParserException {
super(res, params, row, parser, keyStyles); super(res, params, row, parser);
} }
/** /**

View File

@ -30,6 +30,7 @@ import android.view.InflateException;
import com.android.inputmethod.keyboard.internal.KeyStyles; import com.android.inputmethod.keyboard.internal.KeyStyles;
import com.android.inputmethod.keyboard.internal.KeyboardCodesSet; import com.android.inputmethod.keyboard.internal.KeyboardCodesSet;
import com.android.inputmethod.keyboard.internal.KeyboardIconsSet; 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.LatinImeLogger;
import com.android.inputmethod.latin.R; import com.android.inputmethod.latin.R;
import com.android.inputmethod.latin.Utils; import com.android.inputmethod.latin.Utils;
@ -240,6 +241,8 @@ public class Keyboard {
public final ArrayList<Key> mAltCodeKeysWhileTyping = new ArrayList<Key>(); public final ArrayList<Key> mAltCodeKeysWhileTyping = new ArrayList<Key>();
public final KeyboardIconsSet mIconsSet = new KeyboardIconsSet(); public final KeyboardIconsSet mIconsSet = new KeyboardIconsSet();
public final KeyboardCodesSet mCodesSet = new KeyboardCodesSet(); public final KeyboardCodesSet mCodesSet = new KeyboardCodesSet();
public final KeyboardLabelsSet mLabelsSet = new KeyboardLabelsSet();
public final KeyStyles mKeyStyles = new KeyStyles(mLabelsSet);
public KeyboardLayoutSet.KeysCache mKeysCache; public KeyboardLayoutSet.KeysCache mKeysCache;
@ -500,7 +503,6 @@ public class Keyboard {
private boolean mLeftEdge; private boolean mLeftEdge;
private boolean mTopEdge; private boolean mTopEdge;
private Key mRightEdgeKey = null; 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. * 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.mThemeId = keyboardAttr.getInt(R.styleable.Keyboard_themeId, 0);
params.mIconsSet.loadIcons(keyboardAttr); 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( final int resourceId = keyboardAttr.getResourceId(
R.styleable.Keyboard_touchPositionCorrectionData, 0); R.styleable.Keyboard_touchPositionCorrectionData, 0);
@ -887,7 +892,7 @@ public class Keyboard {
XmlParseUtils.checkEndTag(TAG_KEY, parser); XmlParseUtils.checkEndTag(TAG_KEY, parser);
if (DEBUG) startEndTag("<%s /> skipped", TAG_KEY); if (DEBUG) startEndTag("<%s /> skipped", TAG_KEY);
} else { } else {
final Key key = new Key(mResources, mParams, row, parser, mKeyStyles); final Key key = new Key(mResources, mParams, row, parser);
if (DEBUG) { if (DEBUG) {
startEndTag("<%s%s %s moreKeys=%s />", TAG_KEY, startEndTag("<%s%s %s moreKeys=%s />", TAG_KEY,
(key.isEnabled() ? "" : " disabled"), key, (key.isEnabled() ? "" : " disabled"), key,
@ -904,8 +909,7 @@ public class Keyboard {
XmlParseUtils.checkEndTag(TAG_SPACER, parser); XmlParseUtils.checkEndTag(TAG_SPACER, parser);
if (DEBUG) startEndTag("<%s /> skipped", TAG_SPACER); if (DEBUG) startEndTag("<%s /> skipped", TAG_SPACER);
} else { } else {
final Key.Spacer spacer = new Key.Spacer( final Key.Spacer spacer = new Key.Spacer(mResources, mParams, row, parser);
mResources, mParams, row, parser, mKeyStyles);
if (DEBUG) startEndTag("<%s />", TAG_SPACER); if (DEBUG) startEndTag("<%s />", TAG_SPACER);
XmlParseUtils.checkEndTag(TAG_SPACER, parser); XmlParseUtils.checkEndTag(TAG_SPACER, parser);
endKey(spacer); endKey(spacer);
@ -1210,7 +1214,7 @@ public class Keyboard {
skip ? " skipped" : ""); skip ? " skipped" : "");
} }
if (!skip) if (!skip)
mKeyStyles.parseKeyStyleAttributes(keyStyleAttr, keyAttrs, parser); mParams.mKeyStyles.parseKeyStyleAttributes(keyStyleAttr, keyAttrs, parser);
} finally { } finally {
keyStyleAttr.recycle(); keyStyleAttr.recycle();
keyAttrs.recycle(); keyAttrs.recycle();

View File

@ -65,9 +65,7 @@ public class KeyboardLayoutSet {
private static final String DEFAULT_KEYBOARD_LAYOUT_SET = "qwerty"; private static final String DEFAULT_KEYBOARD_LAYOUT_SET = "qwerty";
private static final char KEYBOARD_LAYOUT_SET_LOCALE_DELIMITER = ':'; 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 String KEYBOARD_LAYOUT_SET_RESOURCE_PREFIX = "keyboard_layout_set_";
private static final int DEFAULT_KEYBOARD_LAYOUT_SET_RESOURCE_ID =
R.xml.keyboard_layout_set_qwerty;
private final Context mContext; private final Context mContext;
private final Params mParams; private final Params mParams;
@ -319,9 +317,10 @@ public class KeyboardLayoutSet {
throw new RuntimeException("Screen geometry is not specified"); throw new RuntimeException("Screen geometry is not specified");
if (mParams.mLocale == null) if (mParams.mLocale == null)
throw new RuntimeException("KeyboardLayoutSet subtype is not specified"); 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 String keyboardLayoutSetName = mParams.mKeyboardLayoutSetName;
final int xmlId = KeySpecParser.getResourceId( final int xmlId = mResources.getIdentifier(keyboardLayoutSetName, "xml", packageName);
mResources, keyboardLayoutSetName, DEFAULT_KEYBOARD_LAYOUT_SET_RESOURCE_ID);
final RunInLocale<Void> job = new RunInLocale<Void>() { final RunInLocale<Void> job = new RunInLocale<Void>() {
@Override @Override
protected Void job(Resources res) { protected Void job(Resources res) {

View File

@ -16,7 +16,6 @@
package com.android.inputmethod.keyboard.internal; package com.android.inputmethod.keyboard.internal;
import android.content.res.Resources;
import android.text.TextUtils; import android.text.TextUtils;
import com.android.inputmethod.keyboard.Keyboard; import com.android.inputmethod.keyboard.Keyboard;
@ -27,18 +26,20 @@ import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
/** /**
* String parser of moreKeys attribute of Key. * The string parser of more keys specification.
* The string is comma separated texts each of which represents one "more key". * The specification 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 * The specification might have label or string resource reference in it. These references are
* comma. * 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: * Each "more key" specification is one of the following:
* - Label optionally followed by keyOutputText or code (keyLabel|keyOutputText). * - Label optionally followed by keyOutputText or code (keyLabel|keyOutputText).
* - Icon followed by keyOutputText or code (!icon/icon_name|!code/code_name) * - Icon followed by keyOutputText or code (!icon/icon_name|!code/code_name)
* - Icon should be a string representation of icon (!icon/icon_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". * - Code should be a code point presented by hexadecimal string prefixed with "0x", or a string
* Or a string representation of code (!code/code_name). * representation of code (!code/code_name).
* Special character, comma ',' backslash '\', and bar '|' can be escaped by '\' character. * 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. * See {@link KeyboardIconsSet} about icon_name.
*/ */
public class KeySpecParser { public class KeySpecParser {
@ -49,10 +50,8 @@ public class KeySpecParser {
// Constants for parsing. // Constants for parsing.
private static int COMMA = ','; private static int COMMA = ',';
private static final char ESCAPE_CHAR = '\\'; 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 char LABEL_END = '|';
private static final String PREFIX_LABEL = "!label/";
private static final String PREFIX_ICON = "!icon/"; private static final String PREFIX_ICON = "!icon/";
private static final String PREFIX_CODE = "!code/"; private static final String PREFIX_CODE = "!code/";
private static final String PREFIX_HEX = "0x"; private static final String PREFIX_HEX = "0x";
@ -341,17 +340,7 @@ public class KeySpecParser {
} }
} }
public static int getResourceId(Resources res, String name, int packageNameResId) { public static String resolveLabelReference(String rawText, KeyboardLabelsSet labelsSet) {
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) {
int level = 0; int level = 0;
String text = rawText; String text = rawText;
StringBuilder sb; StringBuilder sb;
@ -362,21 +351,20 @@ public class KeySpecParser {
} }
final int size = text.length(); final int size = text.length();
if (size < PREFIX_STRING.length()) { if (size < PREFIX_LABEL.length()) {
return text; return text;
} }
sb = null; sb = null;
for (int pos = 0; pos < size; pos++) { for (int pos = 0; pos < size; pos++) {
final char c = text.charAt(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) { if (sb == null) {
sb = new StringBuilder(text.substring(0, pos)); sb = new StringBuilder(text.substring(0, pos));
} }
final int end = searchResourceNameEnd(text, pos + PREFIX_STRING.length()); final int end = searchLabelNameEnd(text, pos + PREFIX_LABEL.length());
final String resName = text.substring(pos + 1, end); final String name = text.substring(pos + PREFIX_LABEL.length(), end);
final int resId = getResourceId(res, resName, packageNameResId); sb.append(labelsSet.getLabel(name));
sb.append(res.getString(resId));
pos = end - 1; pos = end - 1;
} else if (c == ESCAPE_CHAR) { } else if (c == ESCAPE_CHAR) {
if (sb != null) { if (sb != null) {
@ -397,7 +385,7 @@ public class KeySpecParser {
return text; return text;
} }
private static int searchResourceNameEnd(String text, int start) { private static int searchLabelNameEnd(String text, int start) {
final int size = text.length(); final int size = text.length();
for (int pos = start; pos < size; pos++) { for (int pos = start; pos < size; pos++) {
final char c = text.charAt(pos); final char c = text.charAt(pos);
@ -410,8 +398,8 @@ public class KeySpecParser {
return size; return size;
} }
public static String[] parseCsvString(String rawText, Resources res, int packageNameResId) { public static String[] parseCsvString(String rawText, KeyboardLabelsSet labelsSet) {
final String text = resolveStringResource(rawText, res, packageNameResId); final String text = resolveLabelReference(rawText, labelsSet);
final int size = text.length(); final int size = text.length();
if (size == 0) { if (size == 0) {
return null; return null;

View File

@ -34,24 +34,55 @@ public class KeyStyles {
private final HashMap<String, DeclaredKeyStyle> mStyles = private final HashMap<String, DeclaredKeyStyle> mStyles =
new HashMap<String, DeclaredKeyStyle>(); new HashMap<String, DeclaredKeyStyle>();
private static final KeyStyle EMPTY_KEY_STYLE = new EmptyKeyStyle();
public interface KeyStyle { private final KeyboardLabelsSet mLabelsSet;
public String[] getStringArray(TypedArray a, int index); private final KeyStyle mEmptyKeyStyle;
public String getString(TypedArray a, int index);
public int getInt(TypedArray a, int index, int defaultValue); public KeyStyles(KeyboardLabelsSet labelsSet) {
public int getFlag(TypedArray a, int index); 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 @Override
public String[] getStringArray(TypedArray a, int index) { public String[] getStringArray(TypedArray a, int index) {
return KeyStyles.parseStringArray(a, index); return parseStringArray(a, index);
} }
@Override @Override
public String getString(TypedArray a, int index) { public String getString(TypedArray a, int index) {
return a.getString(index); return parseString(a, index);
} }
@Override @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>(); private final HashMap<Integer, Object> mStyleAttributes = new HashMap<Integer, Object>();
public DeclaredKeyStyle(KeyboardLabelsSet labelsSet) {
super(labelsSet);
}
@Override @Override
public String[] getStringArray(TypedArray a, int index) { public String[] getStringArray(TypedArray a, int index) {
if (a.hasValue(index)) { if (a.hasValue(index)) {
@ -79,7 +114,7 @@ public class KeyStyles {
@Override @Override
public String getString(TypedArray a, int index) { public String getString(TypedArray a, int index) {
if (a.hasValue(index)) { if (a.hasValue(index)) {
return a.getString(index); return parseString(a, index);
} }
return (String)mStyleAttributes.get(index); return (String)mStyleAttributes.get(index);
} }
@ -120,7 +155,7 @@ public class KeyStyles {
private void readString(TypedArray a, int index) { private void readString(TypedArray a, int index) {
if (a.hasValue(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) { private void readFlag(TypedArray a, int index) {
final Integer value = (Integer)mStyleAttributes.get(index);
if (a.hasValue(index)) { if (a.hasValue(index)) {
final Integer value = (Integer)mStyleAttributes.get(index);
mStyleAttributes.put(index, a.getInt(index, 0) | (value != null ? value : 0)); mStyleAttributes.put(index, a.getInt(index, 0) | (value != null ? value : 0));
} }
} }
private void readStringArray(TypedArray a, int index) { private void readStringArray(TypedArray a, int index) {
final String[] value = parseStringArray(a, index); if (a.hasValue(index)) {
if (value != null) { mStyleAttributes.put(index, parseStringArray(a, index));
mStyleAttributes.put(index, value);
} }
} }
@ -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, public void parseKeyStyleAttributes(TypedArray keyStyleAttr, TypedArray keyAttrs,
XmlPullParser parser) throws XmlPullParserException { XmlPullParser parser) throws XmlPullParserException {
final String styleName = keyStyleAttr.getString(R.styleable.Keyboard_KeyStyle_styleName); 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)) { if (keyStyleAttr.hasValue(R.styleable.Keyboard_KeyStyle_parentStyle)) {
final String parentStyle = keyStyleAttr.getString( final String parentStyle = keyStyleAttr.getString(
R.styleable.Keyboard_KeyStyle_parentStyle); R.styleable.Keyboard_KeyStyle_parentStyle);
@ -188,7 +214,7 @@ public class KeyStyles {
return mStyles.get(styleName); return mStyles.get(styleName);
} }
public static KeyStyle getEmptyKeyStyle() { public KeyStyle getEmptyKeyStyle() {
return EMPTY_KEY_STYLE; return mEmptyKeyStyle;
} }
} }

File diff suppressed because it is too large Load Diff

View File

@ -97,7 +97,7 @@ public class SettingsValues {
} }
} }
final String[] suggestPuncsSpec = KeySpecParser.parseCsvString( 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); mSuggestPuncList = createSuggestPuncList(suggestPuncsSpec);
mSymbolsExcludedFromWordSeparators = mSymbolsExcludedFromWordSeparators =
res.getString(R.string.symbols_excluded_from_word_separators); res.getString(R.string.symbols_excluded_from_word_separators);

View File

@ -50,7 +50,7 @@
<string name="multiple_labels_with_escape_surrounded_by_spaces">" \\abc , d\\ef , gh\\i "</string> <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">"ab\\\\,d\\\\\\,,g\\,i"</string>
<string name="multiple_labels_with_comma_and_escape_surrounded_by_spaces">" 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">!label/multiple_chars</string>
<string name="indirect_string_with_literal">x,@string/multiple_chars,y</string> <string name="indirect_string_with_literal">x,!label/multiple_chars,y</string>
<string name="infinite_indirection">infinite,@string/infinite_indirection,loop</string> <string name="infinite_indirection">infinite,!label/infinite_indirection,loop</string>
</resources> </resources>

View File

@ -16,22 +16,37 @@
package com.android.inputmethod.keyboard.internal; package com.android.inputmethod.keyboard.internal;
import android.content.res.Resources;
import android.test.AndroidTestCase; import android.test.AndroidTestCase;
import android.text.TextUtils; 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.Arrays;
import java.util.Locale;
public class KeySpecParserCsvTests extends AndroidTestCase { public class KeySpecParserCsvTests extends AndroidTestCase {
private Resources mTestResources; private final KeyboardLabelsSet mLabelsSet = new KeyboardLabelsSet();
@Override @Override
protected void setUp() throws Exception { protected void setUp() throws Exception {
super.setUp(); 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) { 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) { private void assertTextArray(String message, String value, String ... expected) {
final String actual[] = KeySpecParser.parseCsvString(value, mTestResources, final String actual[] = KeySpecParser.parseCsvString(value, mLabelsSet);
R.string.empty_string);
if (expected.length == 0) { if (expected.length == 0) {
assertNull(message + ": expected=null actual=" + Arrays.toString(actual), assertNull(message + ": expected=null actual=" + Arrays.toString(actual),
actual); actual);
@ -104,10 +118,10 @@ public class KeySpecParserCsvTests extends AndroidTestCase {
"ab" + SURROGATE1 + "cd", "ab" + SURROGATE1 + "cd",
"ab" + SURROGATE1 + "cd"); "ab" + SURROGATE1 + "cd");
assertTextArray("Incomplete resource reference 1", "string", "string"); assertTextArray("Incomplete resource reference 1", "label", "label");
assertTextArray("Incomplete resource reference 2", "@string", "@string"); assertTextArray("Incomplete resource reference 2", "!label", "!label");
assertTextArray("Incomplete resource reference 3", "string/", "string/"); assertTextArray("Incomplete resource reference 3", "label/", "label/");
assertTextArray("Incomplete resource reference 4", "@" + SURROGATE2, "@" + SURROGATE2); assertTextArray("Incomplete resource reference 4", "!" + SURROGATE2, "!" + SURROGATE2);
} }
public void testParseCsvTextSingleEscaped() { public void testParseCsvTextSingleEscaped() {
@ -138,9 +152,9 @@ public class KeySpecParserCsvTests extends AndroidTestCase {
assertTextArray("Escaped surrogate with escape", assertTextArray("Escaped surrogate with escape",
PAIR1 + "\\\\" + PAIR2, PAIR1 + "\\\\" + PAIR2); PAIR1 + "\\\\" + PAIR2, PAIR1 + "\\\\" + PAIR2);
assertTextArray("Escaped @string", "\\@string", "\\@string"); assertTextArray("Escaped !label", "\\!label", "\\!label");
assertTextArray("Escaped @string/", "\\@string/", "\\@string/"); assertTextArray("Escaped !label/", "\\!label/", "\\!label/");
assertTextArray("Escaped @string/", "\\@string/empty_string", "\\@string/empty_string"); assertTextArray("Escaped !label/", "\\!label/empty_string", "\\!label/empty_string");
} }
public void testParseCsvTextMulti() { public void testParseCsvTextMulti() {
@ -171,133 +185,133 @@ public class KeySpecParserCsvTests extends AndroidTestCase {
assertTextArray("Multiple labels with comma and escape surrounded by spaces", assertTextArray("Multiple labels with comma and escape surrounded by spaces",
" ab\\\\ , d\\\\\\, , g\\,i ", " ab\\\\ ", " d\\\\\\, ", " g\\,i "); " ab\\\\ , d\\\\\\, , g\\,i ", " ab\\\\ ", " d\\\\\\, ", " g\\,i ");
assertTextArray("Multiple escaped @string", "\\@,\\@string/empty_string", assertTextArray("Multiple escaped !label", "\\!,\\!label/empty_string",
"\\@", "\\@string/empty_string"); "\\!", "\\!label/empty_string");
} }
public void testParseCsvResourceError() { public void testParseCsvResourceError() {
assertError("Incomplete resource name", "@string/", "@string/"); assertError("Incomplete resource name", "!label/", "!label/");
assertError("Non existing resource", "@string/non_existing"); assertError("Non existing resource", "!label/non_existing");
} }
public void testParseCsvResourceZero() { public void testParseCsvResourceZero() {
assertTextArray("Empty string", assertTextArray("Empty string",
"@string/empty_string"); "!label/empty_string");
} }
public void testParseCsvResourceSingle() { public void testParseCsvResourceSingle() {
assertTextArray("Single char", assertTextArray("Single char",
"@string/single_char", "a"); "!label/single_char", "a");
assertTextArray("Space", assertTextArray("Space",
"@string/space", " "); "!label/space", " ");
assertTextArray("Single label", assertTextArray("Single label",
"@string/single_label", "abc"); "!label/single_label", "abc");
assertTextArray("Spaces", assertTextArray("Spaces",
"@string/spaces", " "); "!label/spaces", " ");
assertTextArray("Spaces in label", assertTextArray("Spaces in label",
"@string/spaces_in_label", "a b c"); "!label/spaces_in_label", "a b c");
assertTextArray("Spaces at beginning of label", 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", 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", assertTextArray("label surrounded by spaces",
"@string/label_surrounded_by_spaces", " abc "); "!label/label_surrounded_by_spaces", " abc ");
assertTextArray("Escape and single char", assertTextArray("Escape and single char",
"\\\\@string/single_char", "\\\\a"); "\\\\!label/single_char", "\\\\a");
} }
public void testParseCsvResourceSingleEscaped() { public void testParseCsvResourceSingleEscaped() {
assertTextArray("Escaped char", assertTextArray("Escaped char",
"@string/escaped_char", "\\a"); "!label/escaped_char", "\\a");
assertTextArray("Escaped comma", assertTextArray("Escaped comma",
"@string/escaped_comma", "\\,"); "!label/escaped_comma", "\\,");
assertTextArray("Escaped comma escape", assertTextArray("Escaped comma escape",
"@string/escaped_comma_escape", "a\\,\\"); "!label/escaped_comma_escape", "a\\,\\");
assertTextArray("Escaped escape", assertTextArray("Escaped escape",
"@string/escaped_escape", "\\\\"); "!label/escaped_escape", "\\\\");
assertTextArray("Escaped label", assertTextArray("Escaped label",
"@string/escaped_label", "a\\bc"); "!label/escaped_label", "a\\bc");
assertTextArray("Escaped label at beginning", assertTextArray("Escaped label at beginning",
"@string/escaped_label_at_beginning", "\\abc"); "!label/escaped_label_at_beginning", "\\abc");
assertTextArray("Escaped label at end", assertTextArray("Escaped label at end",
"@string/escaped_label_at_end", "abc\\"); "!label/escaped_label_at_end", "abc\\");
assertTextArray("Escaped label with comma", 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", 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", 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", assertTextArray("Escaped label with successive",
"@string/escaped_label_with_successive", "\\,\\\\bc"); "!label/escaped_label_with_successive", "\\,\\\\bc");
assertTextArray("Escaped label with escape", assertTextArray("Escaped label with escape",
"@string/escaped_label_with_escape", "a\\\\c"); "!label/escaped_label_with_escape", "a\\\\c");
} }
public void testParseCsvResourceMulti() { public void testParseCsvResourceMulti() {
assertTextArray("Multiple chars", assertTextArray("Multiple chars",
"@string/multiple_chars", "a", "b", "c"); "!label/multiple_chars", "a", "b", "c");
assertTextArray("Multiple chars surrounded by spaces", assertTextArray("Multiple chars surrounded by spaces",
"@string/multiple_chars_surrounded_by_spaces", "!label/multiple_chars_surrounded_by_spaces",
" a ", " b ", " c "); " a ", " b ", " c ");
assertTextArray("Multiple labels", assertTextArray("Multiple labels",
"@string/multiple_labels", "abc", "def", "ghi"); "!label/multiple_labels", "abc", "def", "ghi");
assertTextArray("Multiple labels surrounded by spaces", 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() { public void testParseCsvResourcetMultiEscaped() {
assertTextArray("Multiple chars with comma", assertTextArray("Multiple chars with comma",
"@string/multiple_chars_with_comma", "!label/multiple_chars_with_comma",
"a", "\\,", "c"); "a", "\\,", "c");
assertTextArray("Multiple chars with comma surrounded by spaces", 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 "); " a ", " \\, ", " c ");
assertTextArray("Multiple labels with escape", assertTextArray("Multiple labels with escape",
"@string/multiple_labels_with_escape", "!label/multiple_labels_with_escape",
"\\abc", "d\\ef", "gh\\i"); "\\abc", "d\\ef", "gh\\i");
assertTextArray("Multiple labels with escape surrounded by spaces", 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 "); " \\abc ", " d\\ef ", " gh\\i ");
assertTextArray("Multiple labels with comma and escape", 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"); "ab\\\\", "d\\\\\\,", "g\\,i");
assertTextArray("Multiple labels with comma and escape surrounded by spaces", 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 "); " ab\\\\ ", " d\\\\\\, ", " g\\,i ");
} }
public void testParseMultipleResources() { public void testParseMultipleResources() {
assertTextArray("Literals and resources", 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", 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", 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", "\\,"); "a", "abc", "\\,");
assertTextArray("Multiple single resource chars and labels 2", 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\\,\\"); "a", "abc", "a\\,\\");
assertTextArray("Multiple multiple resource chars and labels", 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"); "a", "b", "c", "abc", "def", "ghi", "a", "\\,", "c");
assertTextArray("Concatenated resources", 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"); "a", "b", "cabc", "def", "ghia", "\\,", "c");
assertTextArray("Concatenated resource and literal", assertTextArray("Concatenated resource and literal",
"abc@string/multiple_labels", "abc!label/multiple_labels",
"abcabc", "def", "ghi"); "abcabc", "def", "ghi");
} }
public void testParseIndirectReference() { public void testParseIndirectReference() {
assertTextArray("Indirect", assertTextArray("Indirect",
"@string/indirect_string", "a", "b", "c"); "!label/indirect_string", "a", "b", "c");
assertTextArray("Indirect with literal", 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() { public void testParseInfiniteIndirectReference() {
assertError("Infinite indirection", assertError("Infinite indirection",
"1,@string/infinite_indirection,2", "1", "infinite", "<infinite>", "loop", "2"); "1,!label/infinite_indirection,2", "1", "infinite", "<infinite>", "loop", "2");
} }
} }

View File

@ -97,10 +97,10 @@ public class KeySpecParserTests extends AndroidTestCase {
"a", null, ICON_UNDEFINED, 'a'); "a", null, ICON_UNDEFINED, 'a');
assertParser("Single escaped surrogate", "\\" + PAIR2, assertParser("Single escaped surrogate", "\\" + PAIR2,
PAIR2, null, ICON_UNDEFINED, CODE2); PAIR2, null, ICON_UNDEFINED, CODE2);
assertParser("Single at", "@", assertParser("Single bang", "!",
"@", null, ICON_UNDEFINED, '@'); "!", null, ICON_UNDEFINED, '!');
assertParser("Single escaped at", "\\@", assertParser("Single escaped bang", "\\!",
"@", null, ICON_UNDEFINED, '@'); "!", null, ICON_UNDEFINED, '!');
assertParser("Single output text letter", "a|a", assertParser("Single output text letter", "a|a",
"a", null, ICON_UNDEFINED, 'a'); "a", null, ICON_UNDEFINED, 'a');
assertParser("Single surrogate pair outputText", "G Clef|" + PAIR1, 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); "a", "a,b", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT);
assertParser("Single letter with escaped comma outputText", "a|a\\,b", assertParser("Single letter with escaped comma outputText", "a|a\\,b",
"a", "a,b", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT); "a", "a,b", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT);
assertParser("Single letter with outputText starts with at", "a|@bc", assertParser("Single letter with outputText starts with bang", "a|!bc",
"a", "@bc", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT); "a", "!bc", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT);
assertParser("Single letter with surrogate outputText starts with at", "a|@" + SURROGATE2, assertParser("Single letter with surrogate outputText starts with bang", "a|!" + SURROGATE2,
"a", "@" + SURROGATE2, ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT); "a", "!" + SURROGATE2, ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT);
assertParser("Single letter with outputText contains at", "a|a@c", assertParser("Single letter with outputText contains bang", "a|a!c",
"a", "a@c", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT); "a", "a!c", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT);
assertParser("Single letter with escaped at outputText", "a|\\@bc", assertParser("Single letter with escaped bang outputText", "a|\\!bc",
"a", "@bc", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT); "a", "!bc", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT);
assertParser("Single escaped escape with single outputText", "\\\\|\\\\", assertParser("Single escaped escape with single outputText", "\\\\|\\\\",
"\\", null, ICON_UNDEFINED, '\\'); "\\", null, ICON_UNDEFINED, '\\');
assertParser("Single escaped bar with single outputText", "\\||\\|", 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); "a,c", "a,c", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT);
assertParser("Label with escaped comma", "a\\,c", assertParser("Label with escaped comma", "a\\,c",
"a,c", "a,c", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT); "a,c", "a,c", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT);
assertParser("Label starts with at", "@bc", assertParser("Label starts with bang", "!bc",
"@bc", "@bc", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT); "!bc", "!bc", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT);
assertParser("Surrogate label starts with at", "@" + SURROGATE1, assertParser("Surrogate label starts with bang", "!" + SURROGATE1,
"@" + SURROGATE1, "@" + SURROGATE1, ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT); "!" + SURROGATE1, "!" + SURROGATE1, ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT);
assertParser("Label contains at", "a@c", assertParser("Label contains bang", "a!c",
"a@c", "a@c", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT); "a!c", "a!c", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT);
assertParser("Label with escaped at", "\\@bc", assertParser("Label with escaped bang", "\\!bc",
"@bc", "@bc", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT); "!bc", "!bc", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT);
assertParser("Label with escaped letter", "\\abc", assertParser("Label with escaped letter", "\\abc",
"abc", "abc", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT); "abc", "abc", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT);
assertParser("Label with outputText", "abc|def", assertParser("Label with outputText", "abc|def",
@ -174,22 +174,22 @@ public class KeySpecParserTests extends AndroidTestCase {
"abc", "d|f", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT); "abc", "d|f", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT);
assertParser("Escaped escape label with outputText", "a\\\\|def", assertParser("Escaped escape label with outputText", "a\\\\|def",
"a\\", "def", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT); "a\\", "def", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT);
assertParser("Label starts with at and outputText", "@bc|def", assertParser("Label starts with bang and outputText", "!bc|def",
"@bc", "def", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT); "!bc", "def", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT);
assertParser("Label contains at label and outputText", "a@c|def", assertParser("Label contains bang label and outputText", "a!c|def",
"a@c", "def", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT); "a!c", "def", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT);
assertParser("Escaped at label with outputText", "\\@bc|def", assertParser("Escaped bang label with outputText", "\\!bc|def",
"@bc", "def", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT); "!bc", "def", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT);
assertParser("Label with comma outputText", "abc|a,b", assertParser("Label with comma outputText", "abc|a,b",
"abc", "a,b", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT); "abc", "a,b", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT);
assertParser("Label with escaped comma outputText", "abc|a\\,b", assertParser("Label with escaped comma outputText", "abc|a\\,b",
"abc", "a,b", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT); "abc", "a,b", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT);
assertParser("Label with outputText starts with at", "abc|@bc", assertParser("Label with outputText starts with bang", "abc|!bc",
"abc", "@bc", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT); "abc", "!bc", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT);
assertParser("Label with outputText contains at", "abc|a@c", assertParser("Label with outputText contains bang", "abc|a!c",
"abc", "a@c", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT); "abc", "a!c", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT);
assertParser("Label with escaped at outputText", "abc|\\@bc", assertParser("Label with escaped bang outputText", "abc|\\!bc",
"abc", "@bc", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT); "abc", "!bc", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT);
assertParser("Label with escaped bar outputText", "abc|d\\|f", assertParser("Label with escaped bar outputText", "abc|d\\|f",
"abc", "d|f", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT); "abc", "d|f", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT);
assertParser("Escaped bar label with escaped bar outputText", "a\\|c|d\\|f", assertParser("Escaped bar label with escaped bar outputText", "a\\|c|d\\|f",
@ -203,18 +203,18 @@ public class KeySpecParserTests extends AndroidTestCase {
public void testIconAndCode() { public void testIconAndCode() {
assertParser("Icon with outputText", ICON_SETTINGS + "|abc", assertParser("Icon with outputText", ICON_SETTINGS + "|abc",
null, "abc", mSettingsIconId, Keyboard.CODE_OUTPUT_TEXT); null, "abc", mSettingsIconId, Keyboard.CODE_OUTPUT_TEXT);
assertParser("Icon with outputText starts with at", ICON_SETTINGS + "|@bc", assertParser("Icon with outputText starts with bang", ICON_SETTINGS + "|!bc",
null, "@bc", mSettingsIconId, Keyboard.CODE_OUTPUT_TEXT); null, "!bc", mSettingsIconId, Keyboard.CODE_OUTPUT_TEXT);
assertParser("Icon with outputText contains at", ICON_SETTINGS + "|a@c", assertParser("Icon with outputText contains bang", ICON_SETTINGS + "|a!c",
null, "a@c", mSettingsIconId, Keyboard.CODE_OUTPUT_TEXT); null, "a!c", mSettingsIconId, Keyboard.CODE_OUTPUT_TEXT);
assertParser("Icon with escaped at outputText", ICON_SETTINGS + "|\\@bc", assertParser("Icon with escaped bang outputText", ICON_SETTINGS + "|\\!bc",
null, "@bc", mSettingsIconId, Keyboard.CODE_OUTPUT_TEXT); null, "!bc", mSettingsIconId, Keyboard.CODE_OUTPUT_TEXT);
assertParser("Label starts with at and code", "@bc|" + CODE_SETTINGS, assertParser("Label starts with bang and code", "!bc|" + CODE_SETTINGS,
"@bc", null, ICON_UNDEFINED, mCodeSettings); "!bc", null, ICON_UNDEFINED, mCodeSettings);
assertParser("Label contains at and code", "a@c|" + CODE_SETTINGS, assertParser("Label contains bang and code", "a!c|" + CODE_SETTINGS,
"a@c", null, ICON_UNDEFINED, mCodeSettings); "a!c", null, ICON_UNDEFINED, mCodeSettings);
assertParser("Escaped at label with code", "\\@bc|" + CODE_SETTINGS, assertParser("Escaped bang label with code", "\\!bc|" + CODE_SETTINGS,
"@bc", null, ICON_UNDEFINED, mCodeSettings); "!bc", null, ICON_UNDEFINED, mCodeSettings);
assertParser("Icon with code", ICON_SETTINGS + "|" + CODE_SETTINGS, assertParser("Icon with code", ICON_SETTINGS + "|" + CODE_SETTINGS,
null, null, mSettingsIconId, mCodeSettings); null, null, mSettingsIconId, mCodeSettings);
} }

View File

@ -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

View File

@ -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)

63
tools/makelabel/etc/makelabel Executable file
View File

@ -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" "$@"

View File

@ -0,0 +1 @@
Main-Class: com.android.inputmethod.latin.makelabel.LabelMaker

View File

@ -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);
}
}
}

View File

@ -59,6 +59,13 @@
<string name="keylabel_for_south_slavic_row3_8"></string> <string name="keylabel_for_south_slavic_row3_8"></string>
<string name="more_keys_for_cyrillic_ie"></string> <string name="more_keys_for_cyrillic_ie"></string>
<string name="more_keys_for_cyrillic_i"></string> <string name="more_keys_for_cyrillic_i"></string>
<string name="more_keys_for_single_quote">!fixedColumnOrder!4,&#x2018;,&#x2019;,&#x201A;,&#x201B;</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,&#x201C;,&#x201D;,&#x201E;,&#x201F;,&#x00AB;,&#x00BB;</string> -->
<string name="more_keys_for_double_quote">!fixedColumnOrder!4,&#x201C;,&#x201D;,&#x00AB;,&#x00BB;</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,&#x201C;,&#x201D;,&#x201E;,&#x201F;,&#x00AB;,&#x00BB;,&#x2018;,&#x2019;,&#x201A;,&#x201B;</string> -->
<string name="more_keys_for_tablet_double_quote">!fixedColumnOrder!4,&#x201C;,&#x201D;,&#x00AB;,&#x00BB;,&#x2018;,&#x2019;,&#x201A;,&#x201B;</string>
<!-- U+00A2: "¢" CENT SIGN <!-- U+00A2: "¢" CENT SIGN
U+00A3: "£" POUND SIGN U+00A3: "£" POUND SIGN
U+20AC: "€" EURO SIGN U+20AC: "€" EURO SIGN
@ -177,11 +184,20 @@
U+201F: "‟" DOUBLE HIGH-REVERSED-9 QUOTATION MARK --> U+201F: "‟" DOUBLE HIGH-REVERSED-9 QUOTATION MARK -->
<string name="more_keys_for_less_than">!fixedColumnOrder!3,&#x2039;,&#x2264;,&#x00AB;</string> <string name="more_keys_for_less_than">!fixedColumnOrder!3,&#x2039;,&#x2264;,&#x00AB;</string>
<string name="more_keys_for_greater_than">!fixedColumnOrder!3,&#x203A;,&#x2265;,&#x00BB;</string> <string name="more_keys_for_greater_than">!fixedColumnOrder!3,&#x203A;,&#x2265;,&#x00BB;</string>
<string name="more_keys_for_single_quote">!fixedColumnOrder!4,&#x2018;,&#x2019;,&#x201A;,&#x201B;</string> <!-- Label for "switch to more symbol" modifier key. Must be short to fit on key! -->
<!-- TODO: Neither DroidSans nor Roboto have the glyph for U+201F DOUBLE HIGH-REVERSED-9 QUOTATION MARK. --> <string name="label_to_more_symbol_key">= \\ &lt;</string>
<!-- <string name="more_keys_for_double_quote">!fixedColumnOrder!6,&#x201C;,&#x201D;,&#x201E;,&#x201F;,&#x00AB;,&#x00BB;</string> --> <!-- Label for "switch to more symbol" modifier key on tablets. Must be short to fit on key! -->
<string name="more_keys_for_double_quote">!fixedColumnOrder!4,&#x201C;,&#x201D;,&#x00AB;,&#x00BB;</string> <string name="label_to_more_symbol_for_tablet_key">~ \\ {</string>
<!-- TODO: Neither DroidSans nor Roboto have the glyph for U+201F DOUBLE HIGH-REVERSED-9 QUOTATION MARK. --> <!-- Label for "Tab" key. Must be short to fit on key! -->
<!-- <string name="more_keys_for_tablet_double_quote">!fixedColumnOrder!6,&#x201C;,&#x201D;,&#x201E;,&#x201F;,&#x00AB;,&#x00BB;,&#x2018;,&#x2019;,&#x201A;,&#x201B;</string> --> <string name="label_tab_key">Tab</string>
<string name="more_keys_for_tablet_double_quote">!fixedColumnOrder!4,&#x201C;,&#x201D;,&#x00AB;,&#x00BB;,&#x2018;,&#x2019;,&#x201A;,&#x201B;</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">&#xFF0A;&#xFF03;</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> </resources>

View File

@ -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