Remove multi-tap feature

Change-Id: Ife44b3f9d420d77d2cfb51044a8356f02ed63e8b
This commit is contained in:
Tadashi G. Takaoka 2010-12-20 20:30:26 +09:00
parent 8aa3f5a3ad
commit c4f71668d7
26 changed files with 267 additions and 413 deletions

View file

@ -12,4 +12,5 @@
void setDatabaseMax(int); void setDatabaseMax(int);
void setDatabaseDelete(int); void setDatabaseDelete(int);
void waitUntilUpdateDBDone(); void waitUntilUpdateDBDone();
void waitForDictionaryLoading();
} }

View file

@ -94,8 +94,8 @@
</declare-styleable> </declare-styleable>
<declare-styleable name="Keyboard_Key"> <declare-styleable name="Keyboard_Key">
<!-- The unicode value or comma-separated values that this key outputs. --> <!-- The unicode value that this key outputs. -->
<attr name="codes" format="integer|string" /> <attr name="code" format="integer" />
<!-- The characters to display in the popup keyboard. --> <!-- The characters to display in the popup keyboard. -->
<attr name="popupCharacters" format="string" /> <attr name="popupCharacters" format="string" />
<!-- Maximum column of popup keyboard --> <!-- Maximum column of popup keyboard -->

View file

@ -41,7 +41,6 @@
<integer name="config_keyboard_grid_height">16</integer> <integer name="config_keyboard_grid_height">16</integer>
<integer name="config_long_press_key_timeout">400</integer> <integer name="config_long_press_key_timeout">400</integer>
<integer name="config_long_press_shift_key_timeout">1200</integer> <integer name="config_long_press_shift_key_timeout">1200</integer>
<integer name="config_multi_tap_key_timeout">800</integer>
<string name="config_text_size_of_language_on_spacebar">small</string> <string name="config_text_size_of_language_on_spacebar">small</string>
<integer name="config_max_popup_keyboard_column">9</integer> <integer name="config_max_popup_keyboard_column">9</integer>
<!-- Whether or not auto-correction should be enabled by default --> <!-- Whether or not auto-correction should be enabled by default -->

View file

@ -31,7 +31,7 @@
latin:isModifier="true" /> latin:isModifier="true" />
<key-style <key-style
latin:styleName="shiftKeyStyle" latin:styleName="shiftKeyStyle"
latin:codes="@integer/key_shift" latin:code="@integer/key_shift"
latin:keyIcon="@drawable/sym_keyboard_shift_holo" latin:keyIcon="@drawable/sym_keyboard_shift_holo"
latin:shiftedIcon="@drawable/sym_keyboard_shift_locked_holo" latin:shiftedIcon="@drawable/sym_keyboard_shift_locked_holo"
latin:iconPreview="@drawable/sym_keyboard_feedback_shift" latin:iconPreview="@drawable/sym_keyboard_feedback_shift"
@ -39,25 +39,25 @@
latin:isSticky="true" /> latin:isSticky="true" />
<key-style <key-style
latin:styleName="deleteKeyStyle" latin:styleName="deleteKeyStyle"
latin:codes="@integer/key_delete" latin:code="@integer/key_delete"
latin:keyIcon="@drawable/sym_keyboard_delete_holo" latin:keyIcon="@drawable/sym_keyboard_delete_holo"
latin:iconPreview="@drawable/sym_keyboard_feedback_delete" latin:iconPreview="@drawable/sym_keyboard_feedback_delete"
latin:parentStyle="functionalKeyStyle" latin:parentStyle="functionalKeyStyle"
latin:isRepeatable="true" /> latin:isRepeatable="true" />
<key-style <key-style
latin:styleName="returnKeyStyle" latin:styleName="returnKeyStyle"
latin:codes="@integer/key_return" latin:code="@integer/key_return"
latin:keyIcon="@drawable/sym_keyboard_return_holo" latin:keyIcon="@drawable/sym_keyboard_return_holo"
latin:iconPreview="@drawable/sym_keyboard_feedback_return" latin:iconPreview="@drawable/sym_keyboard_feedback_return"
latin:parentStyle="functionalKeyStyle" /> latin:parentStyle="functionalKeyStyle" />
<key-style <key-style
latin:styleName="spaceKeyStyle" latin:styleName="spaceKeyStyle"
latin:codes="@integer/key_space" latin:code="@integer/key_space"
latin:keyIcon="@drawable/sym_keyboard_space_holo" latin:keyIcon="@drawable/sym_keyboard_space_holo"
latin:iconPreview="@drawable/sym_keyboard_feedback_space" /> latin:iconPreview="@drawable/sym_keyboard_feedback_space" />
<key-style <key-style
latin:styleName="nonSpecialBackgroundSpaceKeyStyle" latin:styleName="nonSpecialBackgroundSpaceKeyStyle"
latin:codes="@integer/key_space" latin:code="@integer/key_space"
latin:keyIcon="@drawable/sym_keyboard_space_holo" latin:keyIcon="@drawable/sym_keyboard_space_holo"
latin:iconPreview="@drawable/sym_keyboard_feedback_space" /> latin:iconPreview="@drawable/sym_keyboard_feedback_space" />
<key-style <key-style
@ -69,7 +69,7 @@
latin:maxPopupKeyboardColumn="5" /> latin:maxPopupKeyboardColumn="5" />
<key-style <key-style
latin:styleName="micKeyStyle" latin:styleName="micKeyStyle"
latin:codes="@integer/key_voice" latin:code="@integer/key_voice"
latin:keyIcon="@drawable/sym_keyboard_mic" latin:keyIcon="@drawable/sym_keyboard_mic"
latin:iconPreview="@drawable/sym_keyboard_feedback_mic" latin:iconPreview="@drawable/sym_keyboard_feedback_mic"
latin:parentStyle="functionalKeyStyle" /> latin:parentStyle="functionalKeyStyle" />
@ -81,7 +81,7 @@
latin:styleName="functionalKeyStyle" /> latin:styleName="functionalKeyStyle" />
<key-style <key-style
latin:styleName="shiftKeyStyle" latin:styleName="shiftKeyStyle"
latin:codes="@integer/key_shift" latin:code="@integer/key_shift"
latin:keyIcon="@drawable/sym_bkeyboard_shift" latin:keyIcon="@drawable/sym_bkeyboard_shift"
latin:shiftedIcon="@drawable/sym_bkeyboard_shift_locked" latin:shiftedIcon="@drawable/sym_bkeyboard_shift_locked"
latin:iconPreview="@drawable/sym_keyboard_feedback_shift" latin:iconPreview="@drawable/sym_keyboard_feedback_shift"
@ -89,25 +89,25 @@
latin:isSticky="true" /> latin:isSticky="true" />
<key-style <key-style
latin:styleName="deleteKeyStyle" latin:styleName="deleteKeyStyle"
latin:codes="@integer/key_delete" latin:code="@integer/key_delete"
latin:keyIcon="@drawable/sym_bkeyboard_delete" latin:keyIcon="@drawable/sym_bkeyboard_delete"
latin:iconPreview="@drawable/sym_keyboard_feedback_delete" latin:iconPreview="@drawable/sym_keyboard_feedback_delete"
latin:parentStyle="functionalKeyStyle" latin:parentStyle="functionalKeyStyle"
latin:isRepeatable="true" /> latin:isRepeatable="true" />
<key-style <key-style
latin:styleName="returnKeyStyle" latin:styleName="returnKeyStyle"
latin:codes="@integer/key_return" latin:code="@integer/key_return"
latin:keyIcon="@drawable/sym_bkeyboard_return" latin:keyIcon="@drawable/sym_bkeyboard_return"
latin:iconPreview="@drawable/sym_keyboard_feedback_return" latin:iconPreview="@drawable/sym_keyboard_feedback_return"
latin:parentStyle="functionalKeyStyle" /> latin:parentStyle="functionalKeyStyle" />
<key-style <key-style
latin:styleName="spaceKeyStyle" latin:styleName="spaceKeyStyle"
latin:codes="@integer/key_space" latin:code="@integer/key_space"
latin:keyIcon="@drawable/sym_bkeyboard_space" latin:keyIcon="@drawable/sym_bkeyboard_space"
latin:iconPreview="@drawable/sym_keyboard_feedback_space" /> latin:iconPreview="@drawable/sym_keyboard_feedback_space" />
<key-style <key-style
latin:styleName="nonSpecialBackgroundSpaceKeyStyle" latin:styleName="nonSpecialBackgroundSpaceKeyStyle"
latin:codes="@integer/key_space" latin:code="@integer/key_space"
latin:keyIcon="@drawable/sym_bkeyboard_space" latin:keyIcon="@drawable/sym_bkeyboard_space"
latin:iconPreview="@drawable/sym_keyboard_feedback_space" /> latin:iconPreview="@drawable/sym_keyboard_feedback_space" />
<key-style <key-style
@ -119,7 +119,7 @@
latin:maxPopupKeyboardColumn="5" /> latin:maxPopupKeyboardColumn="5" />
<key-style <key-style
latin:styleName="micKeyStyle" latin:styleName="micKeyStyle"
latin:codes="@integer/key_voice" latin:code="@integer/key_voice"
latin:keyIcon="@drawable/sym_bkeyboard_mic" latin:keyIcon="@drawable/sym_bkeyboard_mic"
latin:iconPreview="@drawable/sym_keyboard_feedback_mic" latin:iconPreview="@drawable/sym_keyboard_feedback_mic"
latin:parentStyle="functionalKeyStyle" /> latin:parentStyle="functionalKeyStyle" />
@ -127,25 +127,25 @@
</switch> </switch>
<key-style <key-style
latin:styleName="tabKeyStyle" latin:styleName="tabKeyStyle"
latin:codes="@integer/key_tab" latin:code="@integer/key_tab"
latin:keyLabel="@string/label_tab_key" latin:keyLabel="@string/label_tab_key"
latin:keyLabelOption="fontNormal" latin:keyLabelOption="fontNormal"
latin:parentStyle="functionalKeyStyle" /> latin:parentStyle="functionalKeyStyle" />
<key-style <key-style
latin:styleName="toSymbolKeyStyle" latin:styleName="toSymbolKeyStyle"
latin:codes="@integer/key_switch_alpha_symbol" latin:code="@integer/key_switch_alpha_symbol"
latin:keyLabel="@string/label_to_symbol_key" latin:keyLabel="@string/label_to_symbol_key"
latin:keyLabelOption="fontNormal" latin:keyLabelOption="fontNormal"
latin:parentStyle="functionalKeyStyle" /> latin:parentStyle="functionalKeyStyle" />
<key-style <key-style
latin:styleName="toAlphaKeyStyle" latin:styleName="toAlphaKeyStyle"
latin:codes="@integer/key_switch_alpha_symbol" latin:code="@integer/key_switch_alpha_symbol"
latin:keyLabel="@string/label_to_alpha_key" latin:keyLabel="@string/label_to_alpha_key"
latin:keyLabelOption="fontNormal" latin:keyLabelOption="fontNormal"
latin:parentStyle="functionalKeyStyle" /> latin:parentStyle="functionalKeyStyle" />
<key-style <key-style
latin:styleName="moreKeyStyle" latin:styleName="moreKeyStyle"
latin:codes="@integer/key_shift" latin:code="@integer/key_shift"
latin:keyLabel="@string/label_more_key" latin:keyLabel="@string/label_more_key"
latin:keyLabelOption="fontNormal" latin:keyLabelOption="fontNormal"
latin:parentStyle="functionalKeyStyle" latin:parentStyle="functionalKeyStyle"

View file

@ -27,60 +27,60 @@
> >
<key-style <key-style
latin:styleName="num0KeyStyle" latin:styleName="num0KeyStyle"
latin:codes="48" latin:code="48"
latin:keyIcon="@drawable/sym_keyboard_num0_holo" /> latin:keyIcon="@drawable/sym_keyboard_num0_holo" />
<key-style <key-style
latin:styleName="num1KeyStyle" latin:styleName="num1KeyStyle"
latin:codes="49" latin:code="49"
latin:keyIcon="@drawable/sym_keyboard_num1_holo" /> latin:keyIcon="@drawable/sym_keyboard_num1_holo" />
<key-style <key-style
latin:styleName="num2KeyStyle" latin:styleName="num2KeyStyle"
latin:codes="50" latin:code="50"
latin:keyIcon="@drawable/sym_keyboard_num2_holo" /> latin:keyIcon="@drawable/sym_keyboard_num2_holo" />
<key-style <key-style
latin:styleName="num3KeyStyle" latin:styleName="num3KeyStyle"
latin:codes="51" latin:code="51"
latin:keyIcon="@drawable/sym_keyboard_num3_holo" /> latin:keyIcon="@drawable/sym_keyboard_num3_holo" />
<key-style <key-style
latin:styleName="num4KeyStyle" latin:styleName="num4KeyStyle"
latin:codes="52" latin:code="52"
latin:keyIcon="@drawable/sym_keyboard_num4_holo" /> latin:keyIcon="@drawable/sym_keyboard_num4_holo" />
<key-style <key-style
latin:styleName="num5KeyStyle" latin:styleName="num5KeyStyle"
latin:codes="53" latin:code="53"
latin:keyIcon="@drawable/sym_keyboard_num5_holo" /> latin:keyIcon="@drawable/sym_keyboard_num5_holo" />
<key-style <key-style
latin:styleName="num6KeyStyle" latin:styleName="num6KeyStyle"
latin:codes="54" latin:code="54"
latin:keyIcon="@drawable/sym_keyboard_num6_holo" /> latin:keyIcon="@drawable/sym_keyboard_num6_holo" />
<key-style <key-style
latin:styleName="num7KeyStyle" latin:styleName="num7KeyStyle"
latin:codes="55" latin:code="55"
latin:keyIcon="@drawable/sym_keyboard_num7_holo" /> latin:keyIcon="@drawable/sym_keyboard_num7_holo" />
<key-style <key-style
latin:styleName="num8KeyStyle" latin:styleName="num8KeyStyle"
latin:codes="56" latin:code="56"
latin:keyIcon="@drawable/sym_keyboard_num8_holo" /> latin:keyIcon="@drawable/sym_keyboard_num8_holo" />
<key-style <key-style
latin:styleName="num9KeyStyle" latin:styleName="num9KeyStyle"
latin:codes="57" latin:code="57"
latin:keyIcon="@drawable/sym_keyboard_num9_holo" /> latin:keyIcon="@drawable/sym_keyboard_num9_holo" />
<key-style <key-style
latin:styleName="numStarKeyStyle" latin:styleName="numStarKeyStyle"
latin:codes="42" latin:code="42"
latin:keyIcon="@drawable/sym_keyboard_numbstar_holo" /> latin:keyIcon="@drawable/sym_keyboard_numbstar_holo" />
<key-style <key-style
latin:styleName="numPoundKeyStyle" latin:styleName="numPoundKeyStyle"
latin:codes="35" latin:code="35"
latin:keyIcon="@drawable/sym_keyboard_numbpound_holo" /> latin:keyIcon="@drawable/sym_keyboard_numbpound_holo" />
<key-style <key-style
latin:styleName="numAltKeyStyle" latin:styleName="numAltKeyStyle"
latin:codes="@integer/key_switch_alpha_symbol" latin:code="@integer/key_switch_alpha_symbol"
latin:keyIcon="@drawable/sym_keyboard_numalt" latin:keyIcon="@drawable/sym_keyboard_numalt"
latin:iconPreview="@drawable/sym_keyboard_feedback_numalt" /> latin:iconPreview="@drawable/sym_keyboard_feedback_numalt" />
<key-style <key-style
latin:styleName="numSpaceKeyStyle" latin:styleName="numSpaceKeyStyle"
latin:codes="@integer/key_space" latin:code="@integer/key_space"
latin:keyIcon="@drawable/sym_keyboard_space_holo" latin:keyIcon="@drawable/sym_keyboard_space_holo"
latin:iconPreview="@drawable/sym_keyboard_feedback_space" /> latin:iconPreview="@drawable/sym_keyboard_feedback_space" />
</case> </case>
@ -89,60 +89,60 @@
> >
<key-style <key-style
latin:styleName="num0KeyStyle" latin:styleName="num0KeyStyle"
latin:codes="48" latin:code="48"
latin:keyIcon="@drawable/sym_bkeyboard_num0" /> latin:keyIcon="@drawable/sym_bkeyboard_num0" />
<key-style <key-style
latin:styleName="num1KeyStyle" latin:styleName="num1KeyStyle"
latin:codes="49" latin:code="49"
latin:keyIcon="@drawable/sym_bkeyboard_num1" /> latin:keyIcon="@drawable/sym_bkeyboard_num1" />
<key-style <key-style
latin:styleName="num2KeyStyle" latin:styleName="num2KeyStyle"
latin:codes="50" latin:code="50"
latin:keyIcon="@drawable/sym_bkeyboard_num2" /> latin:keyIcon="@drawable/sym_bkeyboard_num2" />
<key-style <key-style
latin:styleName="num3KeyStyle" latin:styleName="num3KeyStyle"
latin:codes="51" latin:code="51"
latin:keyIcon="@drawable/sym_bkeyboard_num3" /> latin:keyIcon="@drawable/sym_bkeyboard_num3" />
<key-style <key-style
latin:styleName="num4KeyStyle" latin:styleName="num4KeyStyle"
latin:codes="52" latin:code="52"
latin:keyIcon="@drawable/sym_bkeyboard_num4" /> latin:keyIcon="@drawable/sym_bkeyboard_num4" />
<key-style <key-style
latin:styleName="num5KeyStyle" latin:styleName="num5KeyStyle"
latin:codes="53" latin:code="53"
latin:keyIcon="@drawable/sym_bkeyboard_num5" /> latin:keyIcon="@drawable/sym_bkeyboard_num5" />
<key-style <key-style
latin:styleName="num6KeyStyle" latin:styleName="num6KeyStyle"
latin:codes="54" latin:code="54"
latin:keyIcon="@drawable/sym_bkeyboard_num6" /> latin:keyIcon="@drawable/sym_bkeyboard_num6" />
<key-style <key-style
latin:styleName="num7KeyStyle" latin:styleName="num7KeyStyle"
latin:codes="55" latin:code="55"
latin:keyIcon="@drawable/sym_bkeyboard_num7" /> latin:keyIcon="@drawable/sym_bkeyboard_num7" />
<key-style <key-style
latin:styleName="num8KeyStyle" latin:styleName="num8KeyStyle"
latin:codes="56" latin:code="56"
latin:keyIcon="@drawable/sym_bkeyboard_num8" /> latin:keyIcon="@drawable/sym_bkeyboard_num8" />
<key-style <key-style
latin:styleName="num9KeyStyle" latin:styleName="num9KeyStyle"
latin:codes="57" latin:code="57"
latin:keyIcon="@drawable/sym_bkeyboard_num9" /> latin:keyIcon="@drawable/sym_bkeyboard_num9" />
<key-style <key-style
latin:styleName="numStarKeyStyle" latin:styleName="numStarKeyStyle"
latin:codes="42" latin:code="42"
latin:keyIcon="@drawable/sym_bkeyboard_numstar" /> latin:keyIcon="@drawable/sym_bkeyboard_numstar" />
<key-style <key-style
latin:styleName="numPoundKeyStyle" latin:styleName="numPoundKeyStyle"
latin:codes="35" latin:code="35"
latin:keyIcon="@drawable/sym_bkeyboard_numpound" /> latin:keyIcon="@drawable/sym_bkeyboard_numpound" />
<key-style <key-style
latin:styleName="numAltKeyStyle" latin:styleName="numAltKeyStyle"
latin:codes="@integer/key_switch_alpha_symbol" latin:code="@integer/key_switch_alpha_symbol"
latin:keyIcon="@drawable/sym_bkeyboard_numalt" latin:keyIcon="@drawable/sym_bkeyboard_numalt"
latin:iconPreview="@drawable/sym_keyboard_feedback_numalt" /> latin:iconPreview="@drawable/sym_keyboard_feedback_numalt" />
<key-style <key-style
latin:styleName="numSpaceKeyStyle" latin:styleName="numSpaceKeyStyle"
latin:codes="@integer/key_space" latin:code="@integer/key_space"
latin:keyIcon="@drawable/sym_bkeyboard_space" latin:keyIcon="@drawable/sym_bkeyboard_space"
latin:iconPreview="@drawable/sym_keyboard_feedback_space" /> latin:iconPreview="@drawable/sym_keyboard_feedback_space" />
</case> </case>

View file

@ -44,11 +44,11 @@
<Spacer <Spacer
latin:horizontalGap="8.470%p" /> latin:horizontalGap="8.470%p" />
<Key <Key
latin:codes="45" latin:code="45"
latin:keyLabel=" - " latin:keyLabel=" - "
latin:keyWidth="8.042%p" /> latin:keyWidth="8.042%p" />
<Key <Key
latin:codes="43" latin:code="43"
latin:keyLabel=" + " latin:keyLabel=" + "
latin:keyWidth="8.042%p" /> latin:keyWidth="8.042%p" />
<Spacer <Spacer
@ -75,11 +75,11 @@
<Spacer <Spacer
latin:horizontalGap="8.470%p" /> latin:horizontalGap="8.470%p" />
<Key <Key
latin:codes="44" latin:code="44"
latin:keyLabel=" , " latin:keyLabel=" , "
latin:keyWidth="8.042%p" /> latin:keyWidth="8.042%p" />
<Key <Key
latin:codes="46" latin:code="46"
latin:keyLabel=" . " latin:keyLabel=" . "
latin:keyWidth="8.042%p" /> latin:keyWidth="8.042%p" />
<Spacer <Spacer
@ -105,11 +105,11 @@
<Spacer <Spacer
latin:horizontalGap="20.427%p" /> latin:horizontalGap="20.427%p" />
<Key <Key
latin:codes="40" latin:code="40"
latin:keyLabel=" ( " latin:keyLabel=" ( "
latin:keyWidth="8.042%p" /> latin:keyWidth="8.042%p" />
<Key <Key
latin:codes="41" latin:code="41"
latin:keyLabel=" ) " latin:keyLabel=" ) "
latin:keyWidth="8.042%p" /> latin:keyWidth="8.042%p" />
<Spacer <Spacer

View file

@ -42,15 +42,15 @@
<Spacer <Spacer
latin:horizontalGap="4.458%p" /> latin:horizontalGap="4.458%p" />
<Key <Key
latin:codes="45" latin:code="45"
latin:keyLabel=" - " latin:keyLabel=" - "
latin:keyWidth="8.042%p" /> latin:keyWidth="8.042%p" />
<Key <Key
latin:codes="43" latin:code="43"
latin:keyLabel=" + " latin:keyLabel=" + "
latin:keyWidth="8.042%p" /> latin:keyWidth="8.042%p" />
<Key <Key
latin:codes="44" latin:code="44"
latin:keyLabel="@string/label_pause_key" latin:keyLabel="@string/label_pause_key"
latin:keyWidth="8.042%p" /> latin:keyWidth="8.042%p" />
<!-- To match one character label size with "Tab" and "Pause, I placed spaces around the <!-- To match one character label size with "Tab" and "Pause, I placed spaces around the
@ -77,15 +77,15 @@
<Spacer <Spacer
latin:horizontalGap="4.458%p" /> latin:horizontalGap="4.458%p" />
<Key <Key
latin:codes="44" latin:code="44"
latin:keyLabel=" , " latin:keyLabel=" , "
latin:keyWidth="8.042%p" /> latin:keyWidth="8.042%p" />
<Key <Key
latin:codes="46" latin:code="46"
latin:keyLabel=" . " latin:keyLabel=" . "
latin:keyWidth="8.042%p" /> latin:keyWidth="8.042%p" />
<Key <Key
latin:codes="59" latin:code="59"
latin:keyLabel="@string/label_wait_key" latin:keyLabel="@string/label_wait_key"
latin:keyWidth="8.042%p" /> latin:keyWidth="8.042%p" />
<!-- To match one character label size with "More" and "Wait", I placed spaces around the <!-- To match one character label size with "More" and "Wait", I placed spaces around the
@ -113,15 +113,15 @@
<Spacer <Spacer
latin:horizontalGap="16.406%p" /> latin:horizontalGap="16.406%p" />
<Key <Key
latin:codes="40" latin:code="40"
latin:keyLabel=" ( " latin:keyLabel=" ( "
latin:keyWidth="8.042%p" /> latin:keyWidth="8.042%p" />
<Key <Key
latin:codes="41" latin:code="41"
latin:keyLabel=" ) " latin:keyLabel=" ) "
latin:keyWidth="8.042%p" /> latin:keyWidth="8.042%p" />
<Key <Key
latin:codes="78" latin:code="78"
latin:keyLabel=" N " latin:keyLabel=" N "
latin:keyWidth="8.042%p" /> latin:keyWidth="8.042%p" />
<Spacer <Spacer

View file

@ -31,7 +31,7 @@
latin:isModifier="true" /> latin:isModifier="true" />
<key-style <key-style
latin:styleName="shiftKeyStyle" latin:styleName="shiftKeyStyle"
latin:codes="@integer/key_shift" latin:code="@integer/key_shift"
latin:keyIcon="@drawable/sym_keyboard_shift" latin:keyIcon="@drawable/sym_keyboard_shift"
latin:shiftedIcon="@drawable/sym_keyboard_shift_locked" latin:shiftedIcon="@drawable/sym_keyboard_shift_locked"
latin:iconPreview="@drawable/sym_keyboard_feedback_shift" latin:iconPreview="@drawable/sym_keyboard_feedback_shift"
@ -39,7 +39,7 @@
latin:isSticky="true" /> latin:isSticky="true" />
<key-style <key-style
latin:styleName="deleteKeyStyle" latin:styleName="deleteKeyStyle"
latin:codes="@integer/key_delete" latin:code="@integer/key_delete"
latin:keyIcon="@drawable/sym_keyboard_delete" latin:keyIcon="@drawable/sym_keyboard_delete"
latin:iconPreview="@drawable/sym_keyboard_feedback_delete" latin:iconPreview="@drawable/sym_keyboard_feedback_delete"
latin:parentStyle="functionalKeyStyle" latin:parentStyle="functionalKeyStyle"
@ -54,7 +54,7 @@
> >
<key-style <key-style
latin:styleName="toSymbolKeyStyle" latin:styleName="toSymbolKeyStyle"
latin:codes="@integer/key_switch_alpha_symbol" latin:code="@integer/key_switch_alpha_symbol"
latin:keyIcon="@drawable/sym_keyboard_123_mic" latin:keyIcon="@drawable/sym_keyboard_123_mic"
latin:iconPreview="@drawable/sym_keyboard_feedback_123_mic" latin:iconPreview="@drawable/sym_keyboard_feedback_123_mic"
latin:parentStyle="functionalKeyStyle" /> latin:parentStyle="functionalKeyStyle" />
@ -62,32 +62,32 @@
<default> <default>
<key-style <key-style
latin:styleName="toSymbolKeyStyle" latin:styleName="toSymbolKeyStyle"
latin:codes="@integer/key_switch_alpha_symbol" latin:code="@integer/key_switch_alpha_symbol"
latin:keyLabel="@string/label_to_symbol_key" latin:keyLabel="@string/label_to_symbol_key"
latin:parentStyle="functionalKeyStyle" /> latin:parentStyle="functionalKeyStyle" />
</default> </default>
</switch> </switch>
<key-style <key-style
latin:styleName="settingsKeyStyle" latin:styleName="settingsKeyStyle"
latin:codes="@integer/key_settings" latin:code="@integer/key_settings"
latin:keyIcon="@drawable/sym_keyboard_settings" latin:keyIcon="@drawable/sym_keyboard_settings"
latin:iconPreview="@drawable/sym_keyboard_feedback_settings" latin:iconPreview="@drawable/sym_keyboard_feedback_settings"
latin:parentStyle="functionalKeyStyle" /> latin:parentStyle="functionalKeyStyle" />
<key-style <key-style
latin:styleName="spaceKeyStyle" latin:styleName="spaceKeyStyle"
latin:codes="@integer/key_space" latin:code="@integer/key_space"
latin:keyIcon="@drawable/sym_keyboard_space" latin:keyIcon="@drawable/sym_keyboard_space"
latin:iconPreview="@drawable/sym_keyboard_feedback_space" latin:iconPreview="@drawable/sym_keyboard_feedback_space"
latin:parentStyle="functionalKeyStyle" /> latin:parentStyle="functionalKeyStyle" />
<key-style <key-style
latin:styleName="tabKeyStyle" latin:styleName="tabKeyStyle"
latin:codes="@integer/key_tab" latin:code="@integer/key_tab"
latin:keyIcon="@drawable/sym_keyboard_tab" latin:keyIcon="@drawable/sym_keyboard_tab"
latin:iconPreview="@drawable/sym_keyboard_feedback_tab" latin:iconPreview="@drawable/sym_keyboard_feedback_tab"
latin:parentStyle="functionalKeyStyle" /> latin:parentStyle="functionalKeyStyle" />
<key-style <key-style
latin:styleName="micKeyStyle" latin:styleName="micKeyStyle"
latin:codes="@integer/key_voice" latin:code="@integer/key_voice"
latin:keyIcon="@drawable/sym_keyboard_mic" latin:keyIcon="@drawable/sym_keyboard_mic"
latin:iconPreview="@drawable/sym_keyboard_feedback_mic" latin:iconPreview="@drawable/sym_keyboard_feedback_mic"
latin:keyHintIcon="@drawable/hint_popup" latin:keyHintIcon="@drawable/hint_popup"
@ -97,7 +97,7 @@
which is laid out as normal letter key. --> which is laid out as normal letter key. -->
<key-style <key-style
latin:styleName="nonSpecialBackgroundTabKeyStyle" latin:styleName="nonSpecialBackgroundTabKeyStyle"
latin:codes="@integer/key_tab" latin:code="@integer/key_tab"
latin:keyIcon="@drawable/sym_keyboard_tab" latin:keyIcon="@drawable/sym_keyboard_tab"
latin:iconPreview="@drawable/sym_keyboard_feedback_tab" /> latin:iconPreview="@drawable/sym_keyboard_feedback_tab" />
</case> </case>
@ -108,7 +108,7 @@
latin:styleName="functionalKeyStyle" /> latin:styleName="functionalKeyStyle" />
<key-style <key-style
latin:styleName="shiftKeyStyle" latin:styleName="shiftKeyStyle"
latin:codes="@integer/key_shift" latin:code="@integer/key_shift"
latin:keyIcon="@drawable/sym_bkeyboard_shift" latin:keyIcon="@drawable/sym_bkeyboard_shift"
latin:shiftedIcon="@drawable/sym_bkeyboard_shift_locked" latin:shiftedIcon="@drawable/sym_bkeyboard_shift_locked"
latin:iconPreview="@drawable/sym_keyboard_feedback_shift" latin:iconPreview="@drawable/sym_keyboard_feedback_shift"
@ -116,7 +116,7 @@
latin:isSticky="true" /> latin:isSticky="true" />
<key-style <key-style
latin:styleName="deleteKeyStyle" latin:styleName="deleteKeyStyle"
latin:codes="@integer/key_delete" latin:code="@integer/key_delete"
latin:keyIcon="@drawable/sym_bkeyboard_delete" latin:keyIcon="@drawable/sym_bkeyboard_delete"
latin:iconPreview="@drawable/sym_keyboard_feedback_delete" latin:iconPreview="@drawable/sym_keyboard_feedback_delete"
latin:parentStyle="functionalKeyStyle" latin:parentStyle="functionalKeyStyle"
@ -131,7 +131,7 @@
> >
<key-style <key-style
latin:styleName="toSymbolKeyStyle" latin:styleName="toSymbolKeyStyle"
latin:codes="@integer/key_switch_alpha_symbol" latin:code="@integer/key_switch_alpha_symbol"
latin:keyIcon="@drawable/sym_bkeyboard_123_mic" latin:keyIcon="@drawable/sym_bkeyboard_123_mic"
latin:iconPreview="@drawable/sym_keyboard_feedback_123_mic" latin:iconPreview="@drawable/sym_keyboard_feedback_123_mic"
latin:parentStyle="functionalKeyStyle" /> latin:parentStyle="functionalKeyStyle" />
@ -139,32 +139,32 @@
<default> <default>
<key-style <key-style
latin:styleName="toSymbolKeyStyle" latin:styleName="toSymbolKeyStyle"
latin:codes="@integer/key_switch_alpha_symbol" latin:code="@integer/key_switch_alpha_symbol"
latin:keyLabel="@string/label_to_symbol_key" latin:keyLabel="@string/label_to_symbol_key"
latin:parentStyle="functionalKeyStyle" /> latin:parentStyle="functionalKeyStyle" />
</default> </default>
</switch> </switch>
<key-style <key-style
latin:styleName="settingsKeyStyle" latin:styleName="settingsKeyStyle"
latin:codes="@integer/key_settings" latin:code="@integer/key_settings"
latin:keyIcon="@drawable/sym_bkeyboard_settings" latin:keyIcon="@drawable/sym_bkeyboard_settings"
latin:iconPreview="@drawable/sym_keyboard_feedback_settings" latin:iconPreview="@drawable/sym_keyboard_feedback_settings"
latin:parentStyle="functionalKeyStyle" /> latin:parentStyle="functionalKeyStyle" />
<key-style <key-style
latin:styleName="spaceKeyStyle" latin:styleName="spaceKeyStyle"
latin:codes="@integer/key_space" latin:code="@integer/key_space"
latin:keyIcon="@drawable/sym_bkeyboard_space" latin:keyIcon="@drawable/sym_bkeyboard_space"
latin:iconPreview="@drawable/sym_keyboard_feedback_space" latin:iconPreview="@drawable/sym_keyboard_feedback_space"
latin:parentStyle="functionalKeyStyle" /> latin:parentStyle="functionalKeyStyle" />
<key-style <key-style
latin:styleName="tabKeyStyle" latin:styleName="tabKeyStyle"
latin:codes="@integer/key_tab" latin:code="@integer/key_tab"
latin:keyIcon="@drawable/sym_bkeyboard_tab" latin:keyIcon="@drawable/sym_bkeyboard_tab"
latin:iconPreview="@drawable/sym_keyboard_feedback_tab" latin:iconPreview="@drawable/sym_keyboard_feedback_tab"
latin:parentStyle="functionalKeyStyle" /> latin:parentStyle="functionalKeyStyle" />
<key-style <key-style
latin:styleName="micKeyStyle" latin:styleName="micKeyStyle"
latin:codes="@integer/key_voice" latin:code="@integer/key_voice"
latin:keyIcon="@drawable/sym_bkeyboard_mic" latin:keyIcon="@drawable/sym_bkeyboard_mic"
latin:iconPreview="@drawable/sym_keyboard_feedback_mic" latin:iconPreview="@drawable/sym_keyboard_feedback_mic"
latin:keyHintIcon="@drawable/hint_popup" latin:keyHintIcon="@drawable/hint_popup"
@ -174,7 +174,7 @@
which is laid out as normal letter key. --> which is laid out as normal letter key. -->
<key-style <key-style
latin:styleName="nonSpecialBackgroundTabKeyStyle" latin:styleName="nonSpecialBackgroundTabKeyStyle"
latin:codes="@integer/key_tab" latin:code="@integer/key_tab"
latin:keyIcon="@drawable/sym_bkeyboard_tab" latin:keyIcon="@drawable/sym_bkeyboard_tab"
latin:iconPreview="@drawable/sym_keyboard_feedback_tab" /> latin:iconPreview="@drawable/sym_keyboard_feedback_tab" />
</case> </case>
@ -186,7 +186,7 @@
> >
<key-style <key-style
latin:styleName="returnKeyStyle" latin:styleName="returnKeyStyle"
latin:codes="@integer/key_return" latin:code="@integer/key_return"
latin:keyLabel="@string/label_go_key" latin:keyLabel="@string/label_go_key"
latin:parentStyle="functionalKeyStyle" /> latin:parentStyle="functionalKeyStyle" />
</case> </case>
@ -195,7 +195,7 @@
> >
<key-style <key-style
latin:styleName="returnKeyStyle" latin:styleName="returnKeyStyle"
latin:codes="@integer/key_return" latin:code="@integer/key_return"
latin:keyLabel="@string/label_next_key" latin:keyLabel="@string/label_next_key"
latin:parentStyle="functionalKeyStyle" /> latin:parentStyle="functionalKeyStyle" />
</case> </case>
@ -204,7 +204,7 @@
> >
<key-style <key-style
latin:styleName="returnKeyStyle" latin:styleName="returnKeyStyle"
latin:codes="@integer/key_return" latin:code="@integer/key_return"
latin:keyLabel="@string/label_done_key" latin:keyLabel="@string/label_done_key"
latin:parentStyle="functionalKeyStyle" /> latin:parentStyle="functionalKeyStyle" />
</case> </case>
@ -213,7 +213,7 @@
> >
<key-style <key-style
latin:styleName="returnKeyStyle" latin:styleName="returnKeyStyle"
latin:codes="@integer/key_return" latin:code="@integer/key_return"
latin:keyLabel="@string/label_send_key" latin:keyLabel="@string/label_send_key"
latin:parentStyle="functionalKeyStyle" /> latin:parentStyle="functionalKeyStyle" />
</case> </case>
@ -226,7 +226,7 @@
> >
<key-style <key-style
latin:styleName="returnKeyStyle" latin:styleName="returnKeyStyle"
latin:codes="@integer/key_return" latin:code="@integer/key_return"
latin:keyIcon="@drawable/sym_keyboard_search" latin:keyIcon="@drawable/sym_keyboard_search"
latin:iconPreview="@drawable/sym_keyboard_feedback_search" latin:iconPreview="@drawable/sym_keyboard_feedback_search"
latin:parentStyle="functionalKeyStyle" /> latin:parentStyle="functionalKeyStyle" />
@ -236,7 +236,7 @@
> >
<key-style <key-style
latin:styleName="returnKeyStyle" latin:styleName="returnKeyStyle"
latin:codes="@integer/key_return" latin:code="@integer/key_return"
latin:keyIcon="@drawable/sym_bkeyboard_search" latin:keyIcon="@drawable/sym_bkeyboard_search"
latin:iconPreview="@drawable/sym_keyboard_feedback_search" latin:iconPreview="@drawable/sym_keyboard_feedback_search"
latin:parentStyle="functionalKeyStyle" /> latin:parentStyle="functionalKeyStyle" />
@ -250,7 +250,7 @@
> >
<key-style <key-style
latin:styleName="returnKeyStyle" latin:styleName="returnKeyStyle"
latin:codes="@integer/key_return" latin:code="@integer/key_return"
latin:keyIcon="@drawable/sym_keyboard_return" latin:keyIcon="@drawable/sym_keyboard_return"
latin:iconPreview="@drawable/sym_keyboard_feedback_return" latin:iconPreview="@drawable/sym_keyboard_feedback_return"
latin:parentStyle="functionalKeyStyle" /> latin:parentStyle="functionalKeyStyle" />
@ -260,7 +260,7 @@
> >
<key-style <key-style
latin:styleName="returnKeyStyle" latin:styleName="returnKeyStyle"
latin:codes="@integer/key_return" latin:code="@integer/key_return"
latin:keyIcon="@drawable/sym_bkeyboard_return" latin:keyIcon="@drawable/sym_bkeyboard_return"
latin:iconPreview="@drawable/sym_keyboard_feedback_return" latin:iconPreview="@drawable/sym_keyboard_feedback_return"
latin:parentStyle="functionalKeyStyle" /> latin:parentStyle="functionalKeyStyle" />
@ -270,12 +270,12 @@
</switch> </switch>
<key-style <key-style
latin:styleName="toAlphaKeyStyle" latin:styleName="toAlphaKeyStyle"
latin:codes="@integer/key_switch_alpha_symbol" latin:code="@integer/key_switch_alpha_symbol"
latin:keyLabel="@string/label_to_alpha_key" latin:keyLabel="@string/label_to_alpha_key"
latin:parentStyle="functionalKeyStyle" /> latin:parentStyle="functionalKeyStyle" />
<key-style <key-style
latin:styleName="altKeyStyle" latin:styleName="altKeyStyle"
latin:codes="@integer/key_shift" latin:code="@integer/key_shift"
latin:keyLabel="@string/label_alt_key" latin:keyLabel="@string/label_alt_key"
latin:parentStyle="functionalKeyStyle" latin:parentStyle="functionalKeyStyle"
latin:isSticky="true" /> latin:isSticky="true" />

View file

@ -37,7 +37,7 @@
> >
<key-style <key-style
latin:styleName="numSpaceKeyStyle" latin:styleName="numSpaceKeyStyle"
latin:codes="@integer/key_space" latin:code="@integer/key_space"
latin:keyIcon="@drawable/sym_keyboard_space" latin:keyIcon="@drawable/sym_keyboard_space"
latin:iconPreview="@drawable/sym_keyboard_feedback_space" /> latin:iconPreview="@drawable/sym_keyboard_feedback_space" />
</case> </case>
@ -46,7 +46,7 @@
> >
<key-style <key-style
latin:styleName="numSpaceKeyStyle" latin:styleName="numSpaceKeyStyle"
latin:codes="@integer/key_space" latin:code="@integer/key_space"
latin:keyIcon="@drawable/sym_bkeyboard_space" latin:keyIcon="@drawable/sym_bkeyboard_space"
latin:iconPreview="@drawable/sym_keyboard_feedback_space" /> latin:iconPreview="@drawable/sym_keyboard_feedback_space" />
</case> </case>

View file

@ -27,60 +27,60 @@
> >
<key-style <key-style
latin:styleName="num0KeyStyle" latin:styleName="num0KeyStyle"
latin:codes="48" latin:code="48"
latin:keyIcon="@drawable/sym_keyboard_num0" /> latin:keyIcon="@drawable/sym_keyboard_num0" />
<key-style <key-style
latin:styleName="num1KeyStyle" latin:styleName="num1KeyStyle"
latin:codes="49" latin:code="49"
latin:keyIcon="@drawable/sym_keyboard_num1" /> latin:keyIcon="@drawable/sym_keyboard_num1" />
<key-style <key-style
latin:styleName="num2KeyStyle" latin:styleName="num2KeyStyle"
latin:codes="50" latin:code="50"
latin:keyIcon="@drawable/sym_keyboard_num2" /> latin:keyIcon="@drawable/sym_keyboard_num2" />
<key-style <key-style
latin:styleName="num3KeyStyle" latin:styleName="num3KeyStyle"
latin:codes="51" latin:code="51"
latin:keyIcon="@drawable/sym_keyboard_num3" /> latin:keyIcon="@drawable/sym_keyboard_num3" />
<key-style <key-style
latin:styleName="num4KeyStyle" latin:styleName="num4KeyStyle"
latin:codes="52" latin:code="52"
latin:keyIcon="@drawable/sym_keyboard_num4" /> latin:keyIcon="@drawable/sym_keyboard_num4" />
<key-style <key-style
latin:styleName="num5KeyStyle" latin:styleName="num5KeyStyle"
latin:codes="53" latin:code="53"
latin:keyIcon="@drawable/sym_keyboard_num5" /> latin:keyIcon="@drawable/sym_keyboard_num5" />
<key-style <key-style
latin:styleName="num6KeyStyle" latin:styleName="num6KeyStyle"
latin:codes="54" latin:code="54"
latin:keyIcon="@drawable/sym_keyboard_num6" /> latin:keyIcon="@drawable/sym_keyboard_num6" />
<key-style <key-style
latin:styleName="num7KeyStyle" latin:styleName="num7KeyStyle"
latin:codes="55" latin:code="55"
latin:keyIcon="@drawable/sym_keyboard_num7" /> latin:keyIcon="@drawable/sym_keyboard_num7" />
<key-style <key-style
latin:styleName="num8KeyStyle" latin:styleName="num8KeyStyle"
latin:codes="56" latin:code="56"
latin:keyIcon="@drawable/sym_keyboard_num8" /> latin:keyIcon="@drawable/sym_keyboard_num8" />
<key-style <key-style
latin:styleName="num9KeyStyle" latin:styleName="num9KeyStyle"
latin:codes="57" latin:code="57"
latin:keyIcon="@drawable/sym_keyboard_num9" /> latin:keyIcon="@drawable/sym_keyboard_num9" />
<key-style <key-style
latin:styleName="numStarKeyStyle" latin:styleName="numStarKeyStyle"
latin:codes="42" latin:code="42"
latin:keyIcon="@drawable/sym_keyboard_numstar" /> latin:keyIcon="@drawable/sym_keyboard_numstar" />
<key-style <key-style
latin:styleName="numPoundKeyStyle" latin:styleName="numPoundKeyStyle"
latin:codes="35" latin:code="35"
latin:keyIcon="@drawable/sym_keyboard_numpound" /> latin:keyIcon="@drawable/sym_keyboard_numpound" />
<key-style <key-style
latin:styleName="numAltKeyStyle" latin:styleName="numAltKeyStyle"
latin:codes="@integer/key_switch_alpha_symbol" latin:code="@integer/key_switch_alpha_symbol"
latin:keyIcon="@drawable/sym_keyboard_numalt" latin:keyIcon="@drawable/sym_keyboard_numalt"
latin:iconPreview="@drawable/sym_keyboard_feedback_numalt" /> latin:iconPreview="@drawable/sym_keyboard_feedback_numalt" />
<key-style <key-style
latin:styleName="numSpaceKeyStyle" latin:styleName="numSpaceKeyStyle"
latin:codes="@integer/key_space" latin:code="@integer/key_space"
latin:keyIcon="@drawable/sym_keyboard_space" latin:keyIcon="@drawable/sym_keyboard_space"
latin:iconPreview="@drawable/sym_keyboard_feedback_space" /> latin:iconPreview="@drawable/sym_keyboard_feedback_space" />
</case> </case>
@ -89,60 +89,60 @@
> >
<key-style <key-style
latin:styleName="num0KeyStyle" latin:styleName="num0KeyStyle"
latin:codes="48" latin:code="48"
latin:keyIcon="@drawable/sym_bkeyboard_num0" /> latin:keyIcon="@drawable/sym_bkeyboard_num0" />
<key-style <key-style
latin:styleName="num1KeyStyle" latin:styleName="num1KeyStyle"
latin:codes="49" latin:code="49"
latin:keyIcon="@drawable/sym_bkeyboard_num1" /> latin:keyIcon="@drawable/sym_bkeyboard_num1" />
<key-style <key-style
latin:styleName="num2KeyStyle" latin:styleName="num2KeyStyle"
latin:codes="50" latin:code="50"
latin:keyIcon="@drawable/sym_bkeyboard_num2" /> latin:keyIcon="@drawable/sym_bkeyboard_num2" />
<key-style <key-style
latin:styleName="num3KeyStyle" latin:styleName="num3KeyStyle"
latin:codes="51" latin:code="51"
latin:keyIcon="@drawable/sym_bkeyboard_num3" /> latin:keyIcon="@drawable/sym_bkeyboard_num3" />
<key-style <key-style
latin:styleName="num4KeyStyle" latin:styleName="num4KeyStyle"
latin:codes="52" latin:code="52"
latin:keyIcon="@drawable/sym_bkeyboard_num4" /> latin:keyIcon="@drawable/sym_bkeyboard_num4" />
<key-style <key-style
latin:styleName="num5KeyStyle" latin:styleName="num5KeyStyle"
latin:codes="53" latin:code="53"
latin:keyIcon="@drawable/sym_bkeyboard_num5" /> latin:keyIcon="@drawable/sym_bkeyboard_num5" />
<key-style <key-style
latin:styleName="num6KeyStyle" latin:styleName="num6KeyStyle"
latin:codes="54" latin:code="54"
latin:keyIcon="@drawable/sym_bkeyboard_num6" /> latin:keyIcon="@drawable/sym_bkeyboard_num6" />
<key-style <key-style
latin:styleName="num7KeyStyle" latin:styleName="num7KeyStyle"
latin:codes="55" latin:code="55"
latin:keyIcon="@drawable/sym_bkeyboard_num7" /> latin:keyIcon="@drawable/sym_bkeyboard_num7" />
<key-style <key-style
latin:styleName="num8KeyStyle" latin:styleName="num8KeyStyle"
latin:codes="56" latin:code="56"
latin:keyIcon="@drawable/sym_bkeyboard_num8" /> latin:keyIcon="@drawable/sym_bkeyboard_num8" />
<key-style <key-style
latin:styleName="num9KeyStyle" latin:styleName="num9KeyStyle"
latin:codes="57" latin:code="57"
latin:keyIcon="@drawable/sym_bkeyboard_num9" /> latin:keyIcon="@drawable/sym_bkeyboard_num9" />
<key-style <key-style
latin:styleName="numStarKeyStyle" latin:styleName="numStarKeyStyle"
latin:codes="42" latin:code="42"
latin:keyIcon="@drawable/sym_bkeyboard_numstar" /> latin:keyIcon="@drawable/sym_bkeyboard_numstar" />
<key-style <key-style
latin:styleName="numPoundKeyStyle" latin:styleName="numPoundKeyStyle"
latin:codes="35" latin:code="35"
latin:keyIcon="@drawable/sym_bkeyboard_numpound" /> latin:keyIcon="@drawable/sym_bkeyboard_numpound" />
<key-style <key-style
latin:styleName="numAltKeyStyle" latin:styleName="numAltKeyStyle"
latin:codes="@integer/key_switch_alpha_symbol" latin:code="@integer/key_switch_alpha_symbol"
latin:keyIcon="@drawable/sym_bkeyboard_numalt" latin:keyIcon="@drawable/sym_bkeyboard_numalt"
latin:iconPreview="@drawable/sym_keyboard_feedback_numalt" /> latin:iconPreview="@drawable/sym_keyboard_feedback_numalt" />
<key-style <key-style
latin:styleName="numSpaceKeyStyle" latin:styleName="numSpaceKeyStyle"
latin:codes="@integer/key_space" latin:code="@integer/key_space"
latin:keyIcon="@drawable/sym_bkeyboard_space" latin:keyIcon="@drawable/sym_bkeyboard_space"
latin:iconPreview="@drawable/sym_keyboard_feedback_space" /> latin:iconPreview="@drawable/sym_keyboard_feedback_space" />
</case> </case>

View file

@ -56,7 +56,7 @@
<!-- Pause is a comma. Check PhoneNumberUtils.java to see if this <!-- Pause is a comma. Check PhoneNumberUtils.java to see if this
has changed. --> has changed. -->
<Key <Key
latin:codes="44" latin:code="44"
latin:keyLabel="Pause" /> latin:keyLabel="Pause" />
<Key <Key
latin:keyLabel="," /> latin:keyLabel="," />
@ -72,7 +72,7 @@
latin:keyEdgeFlags="left" /> latin:keyEdgeFlags="left" />
<!-- Wait is a semicolon. --> <!-- Wait is a semicolon. -->
<Key <Key
latin:codes="59" latin:code="59"
latin:keyLabel="Wait" /> latin:keyLabel="Wait" />
<Key <Key
latin:keyStyle="numPoundKeyStyle" /> latin:keyStyle="numPoundKeyStyle" />
@ -85,7 +85,7 @@
latin:rowEdgeFlags="bottom" latin:rowEdgeFlags="bottom"
> >
<Key <Key
latin:codes="@integer/key_switch_alpha_symbol" latin:code="@integer/key_switch_alpha_symbol"
latin:keyLabel="@string/label_to_numeric_key" latin:keyLabel="@string/label_to_numeric_key"
latin:keyEdgeFlags="left" /> latin:keyEdgeFlags="left" />
<Key <Key

View file

@ -34,7 +34,7 @@
latin:hasVoiceKey="false" latin:hasVoiceKey="false"
> >
<Key <Key
latin:codes="@integer/key_switch_alpha_symbol" latin:code="@integer/key_switch_alpha_symbol"
latin:keyIcon="@drawable/sym_bkeyboard_123_mic" latin:keyIcon="@drawable/sym_bkeyboard_123_mic"
latin:iconPreview="@drawable/sym_keyboard_feedback_123_mic" latin:iconPreview="@drawable/sym_keyboard_feedback_123_mic"
latin:keyWidth="20%p" latin:keyWidth="20%p"
@ -43,7 +43,7 @@
</case> </case>
<default> <default>
<Key <Key
latin:codes="@integer/key_switch_alpha_symbol" latin:code="@integer/key_switch_alpha_symbol"
latin:keyLabel="@string/label_to_symbol_key" latin:keyLabel="@string/label_to_symbol_key"
latin:keyWidth="20%p" latin:keyWidth="20%p"
latin:isModifier="true" latin:isModifier="true"
@ -63,7 +63,7 @@
latin:hasVoiceKey="false" latin:hasVoiceKey="false"
> >
<Key <Key
latin:codes="@integer/key_switch_alpha_symbol" latin:code="@integer/key_switch_alpha_symbol"
latin:keyIcon="@drawable/sym_bkeyboard_123_mic" latin:keyIcon="@drawable/sym_bkeyboard_123_mic"
latin:iconPreview="@drawable/sym_keyboard_feedback_123_mic" latin:iconPreview="@drawable/sym_keyboard_feedback_123_mic"
latin:keyWidth="15%p" latin:keyWidth="15%p"
@ -72,7 +72,7 @@
</case> </case>
<default> <default>
<Key <Key
latin:codes="@integer/key_switch_alpha_symbol" latin:code="@integer/key_switch_alpha_symbol"
latin:keyLabel="@string/label_to_symbol_key" latin:keyLabel="@string/label_to_symbol_key"
latin:keyWidth="15%p" latin:keyWidth="15%p"
latin:isModifier="true" latin:isModifier="true"

View file

@ -32,10 +32,9 @@ import android.util.Xml;
*/ */
public class Key { public class Key {
/** /**
* All the key codes (unicode or custom code) that this key could generate, zero'th * The key code (unicode or custom code) that this key generates.
* being the most important.
*/ */
public final int[] mCodes; public final int mCode;
/** The unicode that this key generates in manual temporary upper case mode. */ /** The unicode that this key generates in manual temporary upper case mode. */
public final int mManualTemporaryUpperCaseCode; public final int mManualTemporaryUpperCaseCode;
@ -133,8 +132,6 @@ public class Key {
android.R.attr.state_pressed android.R.attr.state_pressed
}; };
private static final int[] DUMMY_CODES = { 0 };
/** /**
* Create an empty key with no attributes. * Create an empty key with no attributes.
* This constructor is being used only for key in mini popup keyboard. * This constructor is being used only for key in mini popup keyboard.
@ -157,7 +154,7 @@ public class Key {
final String popupSpecification = popupCharacter.toString(); final String popupSpecification = popupCharacter.toString();
mLabel = PopupCharactersParser.getLabel(popupSpecification); mLabel = PopupCharactersParser.getLabel(popupSpecification);
mOutputText = PopupCharactersParser.getOutputText(popupSpecification); mOutputText = PopupCharactersParser.getOutputText(popupSpecification);
mCodes = PopupCharactersParser.getCodes(res, popupSpecification); mCode = PopupCharactersParser.getCode(res, popupSpecification);
mIcon = PopupCharactersParser.getIcon(res, popupSpecification); mIcon = PopupCharactersParser.getIcon(res, popupSpecification);
// Horizontal gap is divided equally to both sides of the key. // Horizontal gap is divided equally to both sides of the key.
mX = x + mGap / 2; mX = x + mGap / 2;
@ -240,13 +237,14 @@ public class Key {
mOutputText = style.getText(keyAttr, R.styleable.Keyboard_Key_keyOutputText); mOutputText = style.getText(keyAttr, R.styleable.Keyboard_Key_keyOutputText);
// Choose the first letter of the label as primary code if not // Choose the first letter of the label as primary code if not
// specified. // specified.
final int[] codes = style.getIntArray(keyAttr, R.styleable.Keyboard_Key_codes); final int code = style.getInt(keyAttr, R.styleable.Keyboard_Key_code,
if (codes == null && !TextUtils.isEmpty(mLabel)) { Keyboard.CODE_UNSPECIFIED);
mCodes = new int[] { mLabel.charAt(0) }; if (code == Keyboard.CODE_UNSPECIFIED && !TextUtils.isEmpty(mLabel)) {
} else if (codes != null) { mCode = mLabel.charAt(0);
mCodes = codes; } else if (code != Keyboard.CODE_UNSPECIFIED) {
mCode = code;
} else { } else {
mCodes = DUMMY_CODES; mCode = Keyboard.CODE_DUMMY;
} }
final Drawable shiftedIcon = style.getDrawable(keyAttr, final Drawable shiftedIcon = style.getDrawable(keyAttr,

View file

@ -23,11 +23,9 @@ import android.content.res.TypedArray;
import android.content.res.XmlResourceParser; import android.content.res.XmlResourceParser;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.util.Log; import android.util.Log;
import android.util.TypedValue;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.StringTokenizer;
public class KeyStyles { public class KeyStyles {
private static final String TAG = "KeyStyles"; private static final String TAG = "KeyStyles";
@ -38,7 +36,6 @@ public class KeyStyles {
private static final KeyStyle EMPTY_KEY_STYLE = new EmptyKeyStyle(); private static final KeyStyle EMPTY_KEY_STYLE = new EmptyKeyStyle();
public interface KeyStyle { public interface KeyStyle {
public int[] getIntArray(TypedArray a, int index);
public CharSequence[] getTextArray(TypedArray a, int index); public CharSequence[] getTextArray(TypedArray a, int index);
public Drawable getDrawable(TypedArray a, int index); public Drawable getDrawable(TypedArray a, int index);
public CharSequence getText(TypedArray a, int index); public CharSequence getText(TypedArray a, int index);
@ -52,11 +49,6 @@ public class KeyStyles {
// Nothing to do. // Nothing to do.
} }
@Override
public int[] getIntArray(TypedArray a, int index) {
return parseIntArray(a, index);
}
@Override @Override
public CharSequence[] getTextArray(TypedArray a, int index) { public CharSequence[] getTextArray(TypedArray a, int index) {
return parseTextArray(a, index); return parseTextArray(a, index);
@ -136,49 +128,11 @@ public class KeyStyles {
return list.toArray(new CharSequence[list.size()]); return list.toArray(new CharSequence[list.size()]);
} }
} }
protected static int[] parseIntArray(TypedArray a, int index) {
if (!a.hasValue(index))
return null;
TypedValue v = new TypedValue();
a.getValue(index, v);
if (v.type == TypedValue.TYPE_INT_DEC || v.type == TypedValue.TYPE_INT_HEX) {
return new int[] { v.data };
} else if (v.type == TypedValue.TYPE_STRING) {
return parseCsvInt(v.string.toString());
} else {
return null;
}
}
/* package */ static int[] parseCsvInt(String value) {
int count = 0;
int lastIndex = 0;
if (value.length() > 0) {
count++;
while ((lastIndex = value.indexOf(",", lastIndex + 1)) > 0) {
count++;
}
}
int[] values = new int[count];
count = 0;
StringTokenizer st = new StringTokenizer(value, ",");
while (st.hasMoreTokens()) {
values[count++] = Integer.parseInt(st.nextToken());
}
return values;
}
} }
private static class DeclaredKeyStyle extends EmptyKeyStyle { private static class DeclaredKeyStyle extends EmptyKeyStyle {
private final HashMap<Integer, Object> mAttributes = new HashMap<Integer, Object>(); private final HashMap<Integer, Object> mAttributes = new HashMap<Integer, Object>();
@Override
public int[] getIntArray(TypedArray a, int index) {
return a.hasValue(index)
? super.getIntArray(a, index) : (int[])mAttributes.get(index);
}
@Override @Override
public CharSequence[] getTextArray(TypedArray a, int index) { public CharSequence[] getTextArray(TypedArray a, int index) {
return a.hasValue(index) return a.hasValue(index)
@ -221,7 +175,7 @@ public class KeyStyles {
private void parseKeyStyleAttributes(TypedArray keyAttr) { private void parseKeyStyleAttributes(TypedArray keyAttr) {
// TODO: Currently not all Key attributes can be declared as style. // TODO: Currently not all Key attributes can be declared as style.
readIntArray(keyAttr, R.styleable.Keyboard_Key_codes); readInt(keyAttr, R.styleable.Keyboard_Key_code);
readText(keyAttr, R.styleable.Keyboard_Key_keyLabel); readText(keyAttr, R.styleable.Keyboard_Key_keyLabel);
readFlag(keyAttr, R.styleable.Keyboard_Key_keyLabelOption); readFlag(keyAttr, R.styleable.Keyboard_Key_keyLabelOption);
readTextArray(keyAttr, R.styleable.Keyboard_Key_popupCharacters); readTextArray(keyAttr, R.styleable.Keyboard_Key_popupCharacters);
@ -262,12 +216,6 @@ public class KeyStyles {
mAttributes.put(index, a.getBoolean(index, false)); mAttributes.put(index, a.getBoolean(index, false));
} }
private void readIntArray(TypedArray a, int index) {
final int[] value = parseIntArray(a, index);
if (value != null)
mAttributes.put(index, value);
}
private void readTextArray(TypedArray a, int index) { private void readTextArray(TypedArray a, int index) {
final CharSequence[] value = parseTextArray(a, index); final CharSequence[] value = parseTextArray(a, index);
if (value != null) if (value != null)

View file

@ -65,12 +65,15 @@ public class Keyboard {
public static final int CODE_PERIOD = '.'; public static final int CODE_PERIOD = '.';
/** Special keys code. These should be aligned with values/keycodes.xml */ /** Special keys code. These should be aligned with values/keycodes.xml */
public static final int CODE_DUMMY = 0;
public static final int CODE_SHIFT = -1; public static final int CODE_SHIFT = -1;
public static final int CODE_SWITCH_ALPHA_SYMBOL = -2; public static final int CODE_SWITCH_ALPHA_SYMBOL = -2;
public static final int CODE_CANCEL = -3; public static final int CODE_CANCEL = -3;
public static final int CODE_DONE = -4; public static final int CODE_DONE = -4;
public static final int CODE_DELETE = -5; public static final int CODE_DELETE = -5;
public static final int CODE_ALT = -6; public static final int CODE_ALT = -6;
// Code value representing the code is not specified.
public static final int CODE_UNSPECIFIED = -99;
public static final int CODE_SETTINGS = -100; public static final int CODE_SETTINGS = -100;
public static final int CODE_SETTINGS_LONGPRESS = -101; public static final int CODE_SETTINGS_LONGPRESS = -101;
// TODO: remove this once LatinIME stops referring to this. // TODO: remove this once LatinIME stops referring to this.

View file

@ -279,14 +279,14 @@ public class KeyboardParser {
checkEndTag(TAG_KEY, parser); checkEndTag(TAG_KEY, parser);
} else { } else {
Key key = new Key(mResources, row, mCurrentX, mCurrentY, parser, mKeyStyles); Key key = new Key(mResources, row, mCurrentX, mCurrentY, parser, mKeyStyles);
if (DEBUG) Log.d(TAG, String.format("<%s keyLabel=%s codes=%s popupCharacters=%s />", if (DEBUG) Log.d(TAG, String.format("<%s keyLabel=%s code=%d popupCharacters=%s />",
TAG_KEY, key.mLabel, Arrays.toString(key.mCodes), TAG_KEY, key.mLabel, key.mCode,
Arrays.toString(key.mPopupCharacters))); Arrays.toString(key.mPopupCharacters)));
checkEndTag(TAG_KEY, parser); checkEndTag(TAG_KEY, parser);
keys.add(key); keys.add(key);
if (key.mCodes[0] == Keyboard.CODE_SHIFT) if (key.mCode == Keyboard.CODE_SHIFT)
mKeyboard.getShiftKeys().add(key); mKeyboard.getShiftKeys().add(key);
if (key.mCodes[0] == Keyboard.CODE_SPACE) if (key.mCode == Keyboard.CODE_SPACE)
mKeyboard.setSpaceKey(key); mKeyboard.setSpaceKey(key);
endKey(key); endKey(key);
} }

View file

@ -834,7 +834,7 @@ public class KeyboardView extends View implements PointerTracker.UIProxy {
// For characters, use large font. For labels like "Done", use small font. // For characters, use large font. For labels like "Done", use small font.
final int labelSize; final int labelSize;
final Typeface labelStyle; final Typeface labelStyle;
if (label.length() > 1 && key.mCodes.length < 2) { if (label.length() > 1) {
labelSize = mLabelTextSize; labelSize = mLabelTextSize;
if ((key.mLabelOption & KEY_LABEL_OPTION_FONT_NORMAL) != 0) { if ((key.mLabelOption & KEY_LABEL_OPTION_FONT_NORMAL) != 0) {
labelStyle = Typeface.DEFAULT; labelStyle = Typeface.DEFAULT;
@ -943,7 +943,7 @@ public class KeyboardView extends View implements PointerTracker.UIProxy {
// TODO Should take care of temporaryShiftLabel here. // TODO Should take care of temporaryShiftLabel here.
mPreviewText.setCompoundDrawables(null, null, null, null); mPreviewText.setCompoundDrawables(null, null, null, null);
mPreviewText.setText(adjustCase(tracker.getPreviewText(key))); mPreviewText.setText(adjustCase(tracker.getPreviewText(key)));
if (key.mLabel.length() > 1 && key.mCodes.length < 2) { if (key.mLabel.length() > 1) {
mPreviewText.setTextSize(TypedValue.COMPLEX_UNIT_PX, mKeyLetterSize); mPreviewText.setTextSize(TypedValue.COMPLEX_UNIT_PX, mKeyLetterSize);
mPreviewText.setTypeface(Typeface.DEFAULT_BOLD); mPreviewText.setTypeface(Typeface.DEFAULT_BOLD);
} else { } else {

View file

@ -294,7 +294,7 @@ public class LatinKeyboard extends Keyboard {
public boolean isInside(Key key, int pointX, int pointY) { public boolean isInside(Key key, int pointX, int pointY) {
int x = pointX; int x = pointX;
int y = pointY; int y = pointY;
final int code = key.mCodes[0]; final int code = key.mCode;
if (code == CODE_SHIFT || code == CODE_DELETE) { if (code == CODE_SHIFT || code == CODE_DELETE) {
y -= key.mHeight / 10; y -= key.mHeight / 10;
if (code == CODE_SHIFT) x += key.mWidth / 6; if (code == CODE_SHIFT) x += key.mWidth / 6;
@ -348,11 +348,11 @@ public class LatinKeyboard extends Keyboard {
mPrefLetterY = y; mPrefLetterY = y;
for (int i = 0; i < nearby.length; i++) { for (int i = 0; i < nearby.length; i++) {
Key k = nearbyKeys.get(nearby[i]); Key k = nearbyKeys.get(nearby[i]);
if (k != key && inPrefList(k.mCodes[0], pref)) { if (k != key && inPrefList(k.mCode, pref)) {
final int dist = distanceFrom(k, x, y); final int dist = distanceFrom(k, x, y);
if (dist < (int) (k.mWidth * OVERLAP_PERCENTAGE_LOW_PROB) && if (dist < (int) (k.mWidth * OVERLAP_PERCENTAGE_LOW_PROB) &&
(pref[k.mCodes[0]] > pref[mPrefLetter] * 3)) { (pref[k.mCode] > pref[mPrefLetter] * 3)) {
mPrefLetter = k.mCodes[0]; mPrefLetter = k.mCode;
mPrefDistance = dist; mPrefDistance = dist;
if (DEBUG_PREFERRED_LETTER) { if (DEBUG_PREFERRED_LETTER) {
Log.d(TAG, "CORRECTED ALTHOUGH PREFERRED !!!!!!"); Log.d(TAG, "CORRECTED ALTHOUGH PREFERRED !!!!!!");
@ -376,11 +376,11 @@ public class LatinKeyboard extends Keyboard {
for (int i = 0; i < nearby.length; i++) { for (int i = 0; i < nearby.length; i++) {
Key k = nearbyKeys.get(nearby[i]); Key k = nearbyKeys.get(nearby[i]);
if (inPrefList(k.mCodes[0], pref)) { if (inPrefList(k.mCode, pref)) {
final int dist = distanceFrom(k, x, y); final int dist = distanceFrom(k, x, y);
if (dist < (int) (k.mWidth * OVERLAP_PERCENTAGE_HIGH_PROB) if (dist < (int) (k.mWidth * OVERLAP_PERCENTAGE_HIGH_PROB)
&& dist < mPrefDistance) { && dist < mPrefDistance) {
mPrefLetter = k.mCodes[0]; mPrefLetter = k.mCode;
mPrefLetterX = x; mPrefLetterX = x;
mPrefLetterY = y; mPrefLetterY = y;
mPrefDistance = dist; mPrefDistance = dist;
@ -430,7 +430,7 @@ public class LatinKeyboard extends Keyboard {
List<Key> keys = getKeys(); List<Key> keys = getKeys();
int count = keys.size(); int count = keys.size();
for (int i = 0; i < count; i++) { for (int i = 0; i < count; i++) {
if (keys.get(i).mCodes[0] == code) return i; if (keys.get(i).mCode == code) return i;
} }
return -1; return -1;
} }

View file

@ -82,7 +82,7 @@ public class LatinKeyboardView extends KeyboardView {
@Override @Override
protected boolean onLongPress(Key key) { protected boolean onLongPress(Key key) {
int primaryCode = key.mCodes[0]; int primaryCode = key.mCode;
if (primaryCode == Keyboard.CODE_SETTINGS) { if (primaryCode == Keyboard.CODE_SETTINGS) {
return invokeOnKey(Keyboard.CODE_SETTINGS_LONGPRESS); return invokeOnKey(Keyboard.CODE_SETTINGS_LONGPRESS);
} else if (primaryCode == '0' && getLatinKeyboard().isPhoneKeyboard()) { } else if (primaryCode == '0' && getLatinKeyboard().isPhoneKeyboard()) {

View file

@ -52,7 +52,7 @@ public class MiniKeyboardKeyDetector extends KeyDetector {
} }
if (allKeys != null && closestKeyIndex != NOT_A_KEY) if (allKeys != null && closestKeyIndex != NOT_A_KEY)
allKeys[0] = keys[closestKeyIndex].mCodes[0]; allKeys[0] = keys[closestKeyIndex].mCode;
return closestKeyIndex; return closestKeyIndex;
} }
} }

View file

@ -43,7 +43,6 @@ public class PointerTracker {
private final int mDelayBeforeKeyRepeatStart; private final int mDelayBeforeKeyRepeatStart;
private final int mLongPressKeyTimeout; private final int mLongPressKeyTimeout;
private final int mLongPressShiftKeyTimeout; private final int mLongPressShiftKeyTimeout;
private final int mMultiTapKeyTimeout;
// Miscellaneous constants // Miscellaneous constants
private static final int NOT_A_KEY = KeyDetector.NOT_A_KEY; private static final int NOT_A_KEY = KeyDetector.NOT_A_KEY;
@ -75,13 +74,6 @@ public class PointerTracker {
// true if sliding key is allowed. // true if sliding key is allowed.
private boolean mIsAllowedSlidingKeyInput; private boolean mIsAllowedSlidingKeyInput;
// For multi-tap
private int mLastSentIndex;
private int mTapCount;
private long mLastTapTime;
private boolean mInMultiTap;
private final StringBuilder mPreviewLabel = new StringBuilder(1);
// pressed key // pressed key
private int mPreviousKey = NOT_A_KEY; private int mPreviousKey = NOT_A_KEY;
@ -116,8 +108,6 @@ public class PointerTracker {
mDelayBeforeKeyRepeatStart = res.getInteger(R.integer.config_delay_before_key_repeat_start); mDelayBeforeKeyRepeatStart = res.getInteger(R.integer.config_delay_before_key_repeat_start);
mLongPressKeyTimeout = res.getInteger(R.integer.config_long_press_key_timeout); mLongPressKeyTimeout = res.getInteger(R.integer.config_long_press_key_timeout);
mLongPressShiftKeyTimeout = res.getInteger(R.integer.config_long_press_shift_key_timeout); mLongPressShiftKeyTimeout = res.getInteger(R.integer.config_long_press_shift_key_timeout);
mMultiTapKeyTimeout = res.getInteger(R.integer.config_multi_tap_key_timeout);
resetMultiTap();
} }
public void setOnKeyboardActionListener(KeyboardActionListener listener) { public void setOnKeyboardActionListener(KeyboardActionListener listener) {
@ -184,7 +174,7 @@ public class PointerTracker {
private boolean isModifierInternal(int keyIndex) { private boolean isModifierInternal(int keyIndex) {
final Key key = getKey(keyIndex); final Key key = getKey(keyIndex);
return key == null ? false : isModifierCode(key.mCodes[0]); return key == null ? false : isModifierCode(key.mCode);
} }
public boolean isModifier() { public boolean isModifier() {
@ -197,12 +187,12 @@ public class PointerTracker {
public boolean isOnShiftKey(int x, int y) { public boolean isOnShiftKey(int x, int y) {
final Key key = getKey(mKeyDetector.getKeyIndexAndNearbyCodes(x, y, null)); final Key key = getKey(mKeyDetector.getKeyIndexAndNearbyCodes(x, y, null));
return key != null && key.mCodes[0] == Keyboard.CODE_SHIFT; return key != null && key.mCode == Keyboard.CODE_SHIFT;
} }
public boolean isSpaceKey(int keyIndex) { public boolean isSpaceKey(int keyIndex) {
Key key = getKey(keyIndex); Key key = getKey(keyIndex);
return key != null && key.mCodes[0] == Keyboard.CODE_SPACE; return key != null && key.mCode == Keyboard.CODE_SPACE;
} }
public void releaseKey() { public void releaseKey() {
@ -260,9 +250,8 @@ public class PointerTracker {
mKeyAlreadyProcessed = false; mKeyAlreadyProcessed = false;
mIsRepeatableKey = false; mIsRepeatableKey = false;
mIsInSlidingKeyInput = false; mIsInSlidingKeyInput = false;
checkMultiTap(eventTime, keyIndex);
if (isValidKeyIndex(keyIndex)) { if (isValidKeyIndex(keyIndex)) {
callListenerOnPress(mKeys[keyIndex].mCodes[0]); callListenerOnPress(mKeys[keyIndex].mCode);
// This onPress call may have changed keyboard layout and have updated mKeyIndex. // This onPress call may have changed keyboard layout and have updated mKeyIndex.
// If that's the case, mKeyIndex has been updated in setKeyboard(). // If that's the case, mKeyIndex has been updated in setKeyboard().
keyIndex = mKeyState.getKeyIndex(); keyIndex = mKeyState.getKeyIndex();
@ -290,7 +279,7 @@ public class PointerTracker {
if (oldKey == null) { if (oldKey == null) {
// The pointer has been slid in to the new key, but the finger was not on any keys. // The pointer has been slid in to the new key, but the finger was not on any keys.
// In this case, we must call onPress() to notify that the new key is being pressed. // In this case, we must call onPress() to notify that the new key is being pressed.
callListenerOnPress(getKey(keyIndex).mCodes[0]); callListenerOnPress(getKey(keyIndex).mCode);
keyState.onMoveToNewKey(keyIndex, x, y); keyState.onMoveToNewKey(keyIndex, x, y);
startLongPressTimer(keyIndex); startLongPressTimer(keyIndex);
} else if (!isMinorMoveBounce(x, y, keyIndex)) { } else if (!isMinorMoveBounce(x, y, keyIndex)) {
@ -298,11 +287,10 @@ public class PointerTracker {
// onRelease() first to notify that the previous key has been released, then call // onRelease() first to notify that the previous key has been released, then call
// onPress() to notify that the new key is being pressed. // onPress() to notify that the new key is being pressed.
mIsInSlidingKeyInput = true; mIsInSlidingKeyInput = true;
callListenerOnRelease(oldKey.mCodes[0]); callListenerOnRelease(oldKey.mCode);
mHandler.cancelLongPressTimers(); mHandler.cancelLongPressTimers();
if (mIsAllowedSlidingKeyInput) { if (mIsAllowedSlidingKeyInput) {
resetMultiTap(); callListenerOnPress(getKey(keyIndex).mCode);
callListenerOnPress(getKey(keyIndex).mCodes[0]);
keyState.onMoveToNewKey(keyIndex, x, y); keyState.onMoveToNewKey(keyIndex, x, y);
startLongPressTimer(keyIndex); startLongPressTimer(keyIndex);
} else { } else {
@ -316,10 +304,9 @@ public class PointerTracker {
// The pointer has been slid out from the previous key, we must call onRelease() to // The pointer has been slid out from the previous key, we must call onRelease() to
// notify that the previous key has been released. // notify that the previous key has been released.
mIsInSlidingKeyInput = true; mIsInSlidingKeyInput = true;
callListenerOnRelease(oldKey.mCodes[0]); callListenerOnRelease(oldKey.mCode);
mHandler.cancelLongPressTimers(); mHandler.cancelLongPressTimers();
if (mIsAllowedSlidingKeyInput) { if (mIsAllowedSlidingKeyInput) {
resetMultiTap();
keyState.onMoveToNewKey(keyIndex, x ,y); keyState.onMoveToNewKey(keyIndex, x ,y);
} else { } else {
setAlreadyProcessed(); setAlreadyProcessed();
@ -351,7 +338,7 @@ public class PointerTracker {
y = keyState.getKeyY(); y = keyState.getKeyY();
} }
if (!mIsRepeatableKey) { if (!mIsRepeatableKey) {
detectAndSendKey(keyIndex, x, y, eventTime); detectAndSendKey(keyIndex, x, y);
} }
if (isValidKeyIndex(keyIndex)) if (isValidKeyIndex(keyIndex))
@ -373,9 +360,7 @@ public class PointerTracker {
public void repeatKey(int keyIndex) { public void repeatKey(int keyIndex) {
Key key = getKey(keyIndex); Key key = getKey(keyIndex);
if (key != null) { if (key != null) {
// While key is repeating, because there is no need to handle multi-tap key, we can detectAndSendKey(keyIndex, key.mX, key.mY);
// pass -1 as eventTime argument.
detectAndSendKey(keyIndex, key.mX, key.mY, -1);
} }
} }
@ -427,7 +412,7 @@ public class PointerTracker {
private void startLongPressTimer(int keyIndex) { private void startLongPressTimer(int keyIndex) {
Key key = getKey(keyIndex); Key key = getKey(keyIndex);
if (key.mCodes[0] == Keyboard.CODE_SHIFT) { if (key.mCode == Keyboard.CODE_SHIFT) {
mHandler.startLongPressShiftTimer(mLongPressShiftKeyTimeout, keyIndex, this); mHandler.startLongPressShiftTimer(mLongPressShiftKeyTimeout, keyIndex, this);
} else if (mKeyboardSwitcher.isInMomentaryAutoModeSwitchState()) { } else if (mKeyboardSwitcher.isInMomentaryAutoModeSwitchState()) {
// We use longer timeout for sliding finger input started from the symbols mode key. // We use longer timeout for sliding finger input started from the symbols mode key.
@ -437,7 +422,7 @@ public class PointerTracker {
} }
} }
private void detectAndSendKey(int index, int x, int y, long eventTime) { private void detectAndSendKey(int index, int x, int y) {
final Key key = getKey(index); final Key key = getKey(index);
if (key == null) { if (key == null) {
callListenerOnCancelInput(); callListenerOnCancelInput();
@ -445,20 +430,11 @@ public class PointerTracker {
} }
if (key.mOutputText != null) { if (key.mOutputText != null) {
callListenerOnTextInput(key.mOutputText); callListenerOnTextInput(key.mOutputText);
callListenerOnRelease(key.mCodes[0]); callListenerOnRelease(key.mCode);
} else { } else {
int code = key.mCodes[0]; int code = key.mCode;
final int[] codes = mKeyDetector.newCodeArray(); final int[] codes = mKeyDetector.newCodeArray();
mKeyDetector.getKeyIndexAndNearbyCodes(x, y, codes); mKeyDetector.getKeyIndexAndNearbyCodes(x, y, codes);
// Multi-tap
if (mInMultiTap) {
if (mTapCount != -1) {
callListenerOnCodeInput(Keyboard.CODE_DELETE, KEY_DELETE, x, y);
} else {
mTapCount = 0;
}
code = key.mCodes[mTapCount];
}
// If keyboard is in manual temporary upper case state and key has manual temporary // If keyboard is in manual temporary upper case state and key has manual temporary
// shift code, alternate character code should be sent. // shift code, alternate character code should be sent.
@ -477,51 +453,10 @@ public class PointerTracker {
callListenerOnCodeInput(code, codes, x, y); callListenerOnCodeInput(code, codes, x, y);
callListenerOnRelease(code); callListenerOnRelease(code);
} }
mLastSentIndex = index;
mLastTapTime = eventTime;
} }
/**
* Handle multi-tap keys by producing the key label for the current multi-tap state.
*/
public CharSequence getPreviewText(Key key) { public CharSequence getPreviewText(Key key) {
if (mInMultiTap) { return key.mLabel;
// Multi-tap
mPreviewLabel.setLength(0);
mPreviewLabel.append((char) key.mCodes[mTapCount < 0 ? 0 : mTapCount]);
return mPreviewLabel;
} else {
return key.mLabel;
}
}
private void resetMultiTap() {
mLastSentIndex = NOT_A_KEY;
mTapCount = 0;
mLastTapTime = -1;
mInMultiTap = false;
}
private void checkMultiTap(long eventTime, int keyIndex) {
Key key = getKey(keyIndex);
if (key == null)
return;
final boolean isMultiTap =
(eventTime < mLastTapTime + mMultiTapKeyTimeout && keyIndex == mLastSentIndex);
if (key.mCodes.length > 1) {
mInMultiTap = true;
if (isMultiTap) {
mTapCount = (mTapCount + 1) % key.mCodes.length;
return;
} else {
mTapCount = -1;
return;
}
}
if (!isMultiTap) {
resetMultiTap();
}
} }
private long mPreviousEventTime; private long mPreviousEventTime;
@ -529,7 +464,7 @@ public class PointerTracker {
private void printTouchEvent(String title, int x, int y, long eventTime) { private void printTouchEvent(String title, int x, int y, long eventTime) {
final int keyIndex = mKeyDetector.getKeyIndexAndNearbyCodes(x, y, null); final int keyIndex = mKeyDetector.getKeyIndexAndNearbyCodes(x, y, null);
final Key key = getKey(keyIndex); final Key key = getKey(keyIndex);
final String code = (key == null) ? "----" : keyCodePrintable(key.mCodes[0]); final String code = (key == null) ? "----" : keyCodePrintable(key.mCode);
final long delta = eventTime - mPreviousEventTime; final long delta = eventTime - mPreviousEventTime;
Log.d(TAG, String.format("%s%s[%d] %4d %4d %5d %3d(%s)", title, Log.d(TAG, String.format("%s%s[%d] %4d %4d %5d %3d(%s)", title,
(mKeyAlreadyProcessed ? "-" : " "), mPointerId, x, y, delta, keyIndex, code)); (mKeyAlreadyProcessed ? "-" : " "), mPointerId, x, y, delta, keyIndex, code));

View file

@ -39,7 +39,6 @@ public class PopupCharactersParser {
private static final String PREFIX_AT = "@"; private static final String PREFIX_AT = "@";
private static final String PREFIX_ICON = PREFIX_AT + "drawable/"; private static final String PREFIX_ICON = PREFIX_AT + "drawable/";
private static final String PREFIX_CODE = PREFIX_AT + "integer/"; private static final String PREFIX_CODE = PREFIX_AT + "integer/";
private static final int[] DUMMY_CODES = { 0 };
private PopupCharactersParser() { private PopupCharactersParser() {
// Intentional empty constructor for utility class. // Intentional empty constructor for utility class.
@ -126,13 +125,13 @@ public class PopupCharactersParser {
final String label = getLabel(popupSpec); final String label = getLabel(popupSpec);
if (label == null) if (label == null)
throw new PopupCharactersParserError("Empty label: " + popupSpec); throw new PopupCharactersParserError("Empty label: " + popupSpec);
// Code is automatically generated for one letter label. See getCode(). // Code is automatically generated for one letter label. See {@link getCode()}.
if (label.length() == 1) if (label.length() == 1)
return null; return null;
return label; return label;
} }
public static int[] getCodes(Resources res, String popupSpec) { public static int getCode(Resources res, String popupSpec) {
if (hasCode(popupSpec)) { if (hasCode(popupSpec)) {
final int end = indexOfLabelEnd(popupSpec, 0); final int end = indexOfLabelEnd(popupSpec, 0);
if (indexOfLabelEnd(popupSpec, end + 1) >= 0) if (indexOfLabelEnd(popupSpec, end + 1) >= 0)
@ -140,15 +139,15 @@ public class PopupCharactersParser {
final int resId = getResourceId(res, final int resId = getResourceId(res,
popupSpec.substring(end + LABEL_END.length() + PREFIX_AT.length())); popupSpec.substring(end + LABEL_END.length() + PREFIX_AT.length()));
final int code = res.getInteger(resId); final int code = res.getInteger(resId);
return new int[] { code }; return code;
} }
if (indexOfLabelEnd(popupSpec, 0) > 0) if (indexOfLabelEnd(popupSpec, 0) > 0)
return DUMMY_CODES; return Keyboard.CODE_DUMMY;
final String label = getLabel(popupSpec); final String label = getLabel(popupSpec);
// Code is automatically generated for one letter label. // Code is automatically generated for one letter label.
if (label != null && label.length() == 1) if (label != null && label.length() == 1)
return new int[] { label.charAt(0) }; return label.charAt(0);
return DUMMY_CODES; return Keyboard.CODE_DUMMY;
} }
public static Drawable getIcon(Resources res, String popupSpec) { public static Drawable getIcon(Resources res, String popupSpec) {

View file

@ -46,17 +46,16 @@ public class ProximityKeyDetector extends KeyDetector {
final int dist = key.squaredDistanceToEdge(touchX, touchY); final int dist = key.squaredDistanceToEdge(touchX, touchY);
if (isInside || (mProximityCorrectOn && dist < mProximityThresholdSquare)) { if (isInside || (mProximityCorrectOn && dist < mProximityThresholdSquare)) {
if (allKeys == null) continue; if (allKeys == null) continue;
final int nCodes = key.mCodes.length;
// Find insertion point // Find insertion point
for (int j = 0; j < distances.length; j++) { for (int j = 0; j < distances.length; j++) {
if (distances[j] > dist) { if (distances[j] > dist) {
// Make space for nCodes codes final int nextPos = j + 1;
System.arraycopy(distances, j, distances, j + nCodes, System.arraycopy(distances, j, distances, nextPos,
distances.length - (j + nCodes)); distances.length - nextPos);
System.arraycopy(allKeys, j, allKeys, j + nCodes, System.arraycopy(allKeys, j, allKeys, nextPos,
allKeys.length - (j + nCodes)); allKeys.length - nextPos);
System.arraycopy(key.mCodes, 0, allKeys, j, nCodes); distances[j] = dist;
Arrays.fill(distances, j, j + nCodes, dist); allKeys[j] = key.mCode;
break; break;
} }
} }

View file

@ -263,9 +263,9 @@ public class TextEntryState {
} }
public static void keyPressedAt(Key key, int x, int y) { public static void keyPressedAt(Key key, int x, int y) {
if (LOGGING && sKeyLocationFile != null && key.mCodes[0] >= 32) { if (LOGGING && sKeyLocationFile != null && key.mCode >= 32) {
String out = String out =
"KEY: " + (char) key.mCodes[0] "KEY: " + (char) key.mCode
+ " X: " + x + " X: " + x
+ " Y: " + y + " Y: " + y
+ " MX: " + (key.mX + key.mWidth / 2) + " MX: " + (key.mX + key.mWidth / 2)

View file

@ -22,23 +22,6 @@ import android.test.AndroidTestCase;
import android.text.TextUtils; import android.text.TextUtils;
public class KeyStylesTests extends AndroidTestCase { public class KeyStylesTests extends AndroidTestCase {
private static void assertNumberFormatException(String message, String value) {
try {
EmptyKeyStyle.parseCsvInt(value);
fail(message);
} catch (NumberFormatException nfe) {
// success.
}
}
private static void assertIntArray(String message, String value, Integer ... expected) {
final int actual[] = EmptyKeyStyle.parseCsvInt(value);
assertSame(message + ": result length", expected.length, actual.length);
for (int i = 0; i < actual.length; i++) {
assertEquals(message + ": result at " + i + ":", (int)expected[i], actual[i]);
}
}
private static String format(String message, Object expected, Object actual) { private static String format(String message, Object expected, Object actual) {
return message + " expected:<" + expected + "> but was:<" + actual + ">"; return message + " expected:<" + expected + "> but was:<" + actual + ">";
} }
@ -57,19 +40,6 @@ public class KeyStylesTests extends AndroidTestCase {
} }
} }
public void testParseCsvInt() {
assertIntArray("Empty string", "");
assertNumberFormatException("Spaces", " ");
assertNumberFormatException("Non-decimal number", "abc");
assertIntArray("Single number", "123", 123);
assertIntArray("Negative number", "-123", -123);
assertNumberFormatException("Hexadecimal number", "1b2b");
assertIntArray("Multiple numbers", "123,456", 123, 456);
assertNumberFormatException("Non-decimal numbers", "123,abc");
assertNumberFormatException("Escaped comma", "123\\,456");
assertNumberFormatException("Escaped escape", "123\\\\,456");
}
public void testParseCsvTextZero() { public void testParseCsvTextZero() {
assertTextArray("Empty string", ""); assertTextArray("Empty string", "");
} }

View file

@ -32,8 +32,6 @@ public class PopupCharactersParserTests extends AndroidTestCase {
private int mCodeSettings; private int mCodeSettings;
private Drawable mIconSettings; private Drawable mIconSettings;
private static final Integer[] DUMMY_CODES = { 0 };
@Override @Override
protected void setUp() { protected void setUp() {
Resources res = getContext().getResources(); Resources res = getContext().getResources();
@ -47,7 +45,7 @@ public class PopupCharactersParserTests extends AndroidTestCase {
} }
private void assertParser(String message, String popupSpec, String expectedLabel, private void assertParser(String message, String popupSpec, String expectedLabel,
String expectedOutputText, Drawable expectedIcon, Integer ... expectedCodes) { String expectedOutputText, Drawable expectedIcon, int expectedCode) {
String actualLabel = PopupCharactersParser.getLabel(popupSpec); String actualLabel = PopupCharactersParser.getLabel(popupSpec);
assertEquals(message + ": label:", expectedLabel, actualLabel); assertEquals(message + ": label:", expectedLabel, actualLabel);
@ -62,28 +60,15 @@ public class PopupCharactersParserTests extends AndroidTestCase {
assertNotNull(message + ": icon non-null:", actualIcon); assertNotNull(message + ": icon non-null:", actualIcon);
} }
int[] actualCodes = PopupCharactersParser.getCodes(mRes, popupSpec); int actualCode = PopupCharactersParser.getCode(mRes, popupSpec);
if (expectedCodes == null) { assertEquals(message + ": codes value:", expectedCode, actualCode);
assertNull(message + ": codes null:", actualCodes);
return;
}
assertSame(message + ": codes length:", expectedCodes.length, actualCodes.length);
for (int i = 0; i < actualCodes.length; i++) {
assertEquals(message + ": codes value at " + i + ":", (int)expectedCodes[i],
actualCodes[i]);
}
} }
private void assertParserError(String message, String popupSpec, String expectedLabel, private void assertParserError(String message, String popupSpec, String expectedLabel,
String expectedOutputText, Drawable expectedIcon, Integer ... expectedCodes) { String expectedOutputText, Drawable expectedIcon, int expectedCode) {
try { try {
if (expectedCodes.length > 0) { assertParser(message, popupSpec, expectedLabel, expectedOutputText, expectedIcon,
assertParser(message, popupSpec, expectedLabel, expectedOutputText, expectedIcon, expectedCode);
expectedCodes);
} else {
assertParser(message, popupSpec, expectedLabel, expectedOutputText, expectedIcon,
DUMMY_CODES);
}
fail(message); fail(message);
} catch (PopupCharactersParser.PopupCharactersParserError pcpe) { } catch (PopupCharactersParser.PopupCharactersParserError pcpe) {
// success. // success.
@ -91,71 +76,83 @@ public class PopupCharactersParserTests extends AndroidTestCase {
} }
public void testSingleLetter() { public void testSingleLetter() {
assertParser("Single letter", "a", "a", null, null, (int)'a'); assertParser("Single letter", "a", "a", null, null, 'a');
assertParser("Single escaped bar", "\\|", "|", null, null, (int)'|'); assertParser("Single escaped bar", "\\|", "|", null, null, '|');
assertParser("Single escaped escape", "\\\\", "\\", null, null, (int)'\\'); assertParser("Single escaped escape", "\\\\", "\\", null, null, '\\');
assertParser("Single comma", ",", ",", null, null, (int)','); assertParser("Single comma", ",", ",", null, null, ',');
assertParser("Single escaped comma", "\\,", ",", null, null, (int)','); assertParser("Single escaped comma", "\\,", ",", null, null, ',');
assertParser("Single escaped letter", "\\a", "a", null, null, (int)'a'); assertParser("Single escaped letter", "\\a", "a", null, null, 'a');
assertParser("Single at", "@", "@", null, null, (int)'@'); assertParser("Single at", "@", "@", null, null, '@');
assertParser("Single escaped at", "\\@", "@", null, null, (int)'@'); assertParser("Single escaped at", "\\@", "@", null, null, '@');
assertParser("Single letter with outputText", "a|abc", "a", "abc", null, DUMMY_CODES); assertParser("Single letter with outputText", "a|abc", "a", "abc", null,
Keyboard.CODE_DUMMY);
assertParser("Single letter with escaped outputText", "a|a\\|c", "a", "a|c", null, assertParser("Single letter with escaped outputText", "a|a\\|c", "a", "a|c", null,
DUMMY_CODES); Keyboard.CODE_DUMMY);
assertParser("Single letter with comma outputText", "a|a,b", "a", "a,b", null, DUMMY_CODES); assertParser("Single letter with comma outputText", "a|a,b", "a", "a,b", null,
Keyboard.CODE_DUMMY);
assertParser("Single letter with escaped comma outputText", "a|a\\,b", "a", "a,b", null, assertParser("Single letter with escaped comma outputText", "a|a\\,b", "a", "a,b", null,
DUMMY_CODES); Keyboard.CODE_DUMMY);
assertParser("Single letter with outputText starts with at", "a|@bc", "a", "@bc", null, assertParser("Single letter with outputText starts with at", "a|@bc", "a", "@bc", null,
DUMMY_CODES); Keyboard.CODE_DUMMY);
assertParser("Single letter with outputText contains at", "a|a@c", "a", "a@c", null, assertParser("Single letter with outputText contains at", "a|a@c", "a", "a@c", null,
DUMMY_CODES); Keyboard.CODE_DUMMY);
assertParser("Single letter with escaped at outputText", "a|\\@bc", "a", "@bc", null, assertParser("Single letter with escaped at outputText", "a|\\@bc", "a", "@bc", null,
DUMMY_CODES); Keyboard.CODE_DUMMY);
assertParser("Single escaped escape with outputText", "\\\\|\\\\", "\\", "\\", null, assertParser("Single escaped escape with outputText", "\\\\|\\\\", "\\", "\\", null,
DUMMY_CODES); Keyboard.CODE_DUMMY);
assertParser("Single escaped bar with outputText", "\\||\\|", "|", "|", null, DUMMY_CODES); assertParser("Single escaped bar with outputText", "\\||\\|", "|", "|", null,
Keyboard.CODE_DUMMY);
assertParser("Single letter with code", "a|" + CODE_SETTINGS, "a", null, null, assertParser("Single letter with code", "a|" + CODE_SETTINGS, "a", null, null,
mCodeSettings); mCodeSettings);
} }
public void testLabel() { public void testLabel() {
assertParser("Simple label", "abc", "abc", "abc", null, DUMMY_CODES); assertParser("Simple label", "abc", "abc", "abc", null, Keyboard.CODE_DUMMY);
assertParser("Label with escaped bar", "a\\|c", "a|c", "a|c", null, DUMMY_CODES); assertParser("Label with escaped bar", "a\\|c", "a|c", "a|c", null,
assertParser("Label with escaped escape", "a\\\\c", "a\\c", "a\\c", null, DUMMY_CODES); Keyboard.CODE_DUMMY);
assertParser("Label with comma", "a,c", "a,c", "a,c", null, DUMMY_CODES); assertParser("Label with escaped escape", "a\\\\c", "a\\c", "a\\c", null,
assertParser("Label with escaped comma", "a\\,c", "a,c", "a,c", null, DUMMY_CODES); Keyboard.CODE_DUMMY);
assertParser("Label starts with at", "@bc", "@bc", "@bc", null, DUMMY_CODES); assertParser("Label with comma", "a,c", "a,c", "a,c", null, Keyboard.CODE_DUMMY);
assertParser("Label contains at", "a@c", "a@c", "a@c", null, DUMMY_CODES); assertParser("Label with escaped comma", "a\\,c", "a,c", "a,c", null,
assertParser("Label with escaped at", "\\@bc", "@bc", "@bc", null, DUMMY_CODES); Keyboard.CODE_DUMMY);
assertParser("Label with escaped letter", "\\abc", "abc", "abc", null, DUMMY_CODES); assertParser("Label starts with at", "@bc", "@bc", "@bc", null, Keyboard.CODE_DUMMY);
assertParser("Label with outputText", "abc|def", "abc", "def", null, DUMMY_CODES); assertParser("Label contains at", "a@c", "a@c", "a@c", null, Keyboard.CODE_DUMMY);
assertParser("Label with comma and outputText", "a,c|def", "a,c", "def", null, DUMMY_CODES); assertParser("Label with escaped at", "\\@bc", "@bc", "@bc", null,
Keyboard.CODE_DUMMY);
assertParser("Label with escaped letter", "\\abc", "abc", "abc", null,
Keyboard.CODE_DUMMY);
assertParser("Label with outputText", "abc|def", "abc", "def", null,
Keyboard.CODE_DUMMY);
assertParser("Label with comma and outputText", "a,c|def", "a,c", "def", null,
Keyboard.CODE_DUMMY);
assertParser("Escaped comma label with outputText", "a\\,c|def", "a,c", "def", null, assertParser("Escaped comma label with outputText", "a\\,c|def", "a,c", "def", null,
DUMMY_CODES); Keyboard.CODE_DUMMY);
assertParser("Escaped label with outputText", "a\\|c|def", "a|c", "def", null, DUMMY_CODES); assertParser("Escaped label with outputText", "a\\|c|def", "a|c", "def", null,
Keyboard.CODE_DUMMY);
assertParser("Label with escaped bar outputText", "abc|d\\|f", "abc", "d|f", null, assertParser("Label with escaped bar outputText", "abc|d\\|f", "abc", "d|f", null,
DUMMY_CODES); Keyboard.CODE_DUMMY);
assertParser("Escaped escape label with outputText", "a\\\\|def", "a\\", "def", null, assertParser("Escaped escape label with outputText", "a\\\\|def", "a\\", "def", null,
DUMMY_CODES); Keyboard.CODE_DUMMY);
assertParser("Label starts with at and outputText", "@bc|def", "@bc", "def", null, assertParser("Label starts with at and outputText", "@bc|def", "@bc", "def", null,
DUMMY_CODES); Keyboard.CODE_DUMMY);
assertParser("Label contains at label and outputText", "a@c|def", "a@c", "def", null, assertParser("Label contains at label and outputText", "a@c|def", "a@c", "def", null,
DUMMY_CODES); Keyboard.CODE_DUMMY);
assertParser("Escaped at label with outputText", "\\@bc|def", "@bc", "def", null, assertParser("Escaped at label with outputText", "\\@bc|def", "@bc", "def", null,
DUMMY_CODES); Keyboard.CODE_DUMMY);
assertParser("Label with comma outputText", "abc|a,b", "abc", "a,b", null, DUMMY_CODES); assertParser("Label with comma outputText", "abc|a,b", "abc", "a,b", null,
Keyboard.CODE_DUMMY);
assertParser("Label with escaped comma outputText", "abc|a\\,b", "abc", "a,b", null, assertParser("Label with escaped comma outputText", "abc|a\\,b", "abc", "a,b", null,
DUMMY_CODES); Keyboard.CODE_DUMMY);
assertParser("Label with outputText starts with at", "abc|@bc", "abc", "@bc", null, assertParser("Label with outputText starts with at", "abc|@bc", "abc", "@bc", null,
DUMMY_CODES); Keyboard.CODE_DUMMY);
assertParser("Label with outputText contains at", "abc|a@c", "abc", "a@c", null, assertParser("Label with outputText contains at", "abc|a@c", "abc", "a@c", null,
DUMMY_CODES); Keyboard.CODE_DUMMY);
assertParser("Label with escaped at outputText", "abc|\\@bc", "abc", "@bc", null, assertParser("Label with escaped at outputText", "abc|\\@bc", "abc", "@bc", null,
DUMMY_CODES); Keyboard.CODE_DUMMY);
assertParser("Label with escaped bar outputText", "abc|d\\|f", "abc", "d|f", assertParser("Label with escaped bar outputText", "abc|d\\|f", "abc", "d|f",
null, DUMMY_CODES); null, Keyboard.CODE_DUMMY);
assertParser("Escaped bar label with escaped bar outputText", "a\\|c|d\\|f", "a|c", "d|f", assertParser("Escaped bar label with escaped bar outputText", "a\\|c|d\\|f", "a|c", "d|f",
null, DUMMY_CODES); null, Keyboard.CODE_DUMMY);
assertParser("Label with code", "abc|" + CODE_SETTINGS, "abc", null, null, mCodeSettings); assertParser("Label with code", "abc|" + CODE_SETTINGS, "abc", null, null, mCodeSettings);
assertParser("Escaped label with code", "a\\|c|" + CODE_SETTINGS, "a|c", null, null, assertParser("Escaped label with code", "a\\|c|" + CODE_SETTINGS, "a|c", null, null,
mCodeSettings); mCodeSettings);
@ -163,13 +160,13 @@ public class PopupCharactersParserTests extends AndroidTestCase {
public void testIconAndCode() { public void testIconAndCode() {
assertParser("Icon with outputText", ICON_SETTINGS + "|abc", null, "abc", mIconSettings, assertParser("Icon with outputText", ICON_SETTINGS + "|abc", null, "abc", mIconSettings,
DUMMY_CODES); Keyboard.CODE_DUMMY);
assertParser("Icon with outputText starts with at", ICON_SETTINGS + "|@bc", null, "@bc", assertParser("Icon with outputText starts with at", ICON_SETTINGS + "|@bc", null, "@bc",
mIconSettings, DUMMY_CODES); mIconSettings, Keyboard.CODE_DUMMY);
assertParser("Icon with outputText contains at", ICON_SETTINGS + "|a@c", null, "a@c", assertParser("Icon with outputText contains at", ICON_SETTINGS + "|a@c", null, "a@c",
mIconSettings, DUMMY_CODES); mIconSettings, Keyboard.CODE_DUMMY);
assertParser("Icon with escaped at outputText", ICON_SETTINGS + "|\\@bc", null, "@bc", assertParser("Icon with escaped at outputText", ICON_SETTINGS + "|\\@bc", null, "@bc",
mIconSettings, DUMMY_CODES); mIconSettings, Keyboard.CODE_DUMMY);
assertParser("Label starts with at and code", "@bc|" + CODE_SETTINGS, "@bc", null, null, assertParser("Label starts with at and code", "@bc|" + CODE_SETTINGS, "@bc", null, null,
mCodeSettings); mCodeSettings);
assertParser("Label contains at and code", "a@c|" + CODE_SETTINGS, "a@c", null, null, assertParser("Label contains at and code", "a@c|" + CODE_SETTINGS, "a@c", null, null,
@ -181,23 +178,28 @@ public class PopupCharactersParserTests extends AndroidTestCase {
} }
public void testFormatError() { public void testFormatError() {
assertParserError("Empty spec", "", null, null, null); assertParserError("Empty spec", "", null, null, null, Keyboard.CODE_UNSPECIFIED);
assertParserError("Empty label with outputText", "|a", null, "a", null); assertParserError("Empty label with outputText", "|a", null, "a", null,
Keyboard.CODE_DUMMY);
assertParserError("Empty label with code", "|" + CODE_SETTINGS, null, null, null, assertParserError("Empty label with code", "|" + CODE_SETTINGS, null, null, null,
mCodeSettings); mCodeSettings);
assertParserError("Empty outputText with label", "a|", "a", null, null); assertParserError("Empty outputText with label", "a|", "a", null, null,
Keyboard.CODE_UNSPECIFIED);
assertParserError("Empty outputText with icon", ICON_SETTINGS + "|", null, null, assertParserError("Empty outputText with icon", ICON_SETTINGS + "|", null, null,
mIconSettings); mIconSettings, Keyboard.CODE_UNSPECIFIED);
assertParserError("Empty icon and code", "|", null, null, null); assertParserError("Empty icon and code", "|", null, null, null, Keyboard.CODE_UNSPECIFIED);
assertParserError("Icon without code", ICON_SETTINGS, null, null, mIconSettings); assertParserError("Icon without code", ICON_SETTINGS, null, null, mIconSettings,
assertParserError("Non existing icon", ICON_NON_EXISTING + "|abc", null, "abc", null); Keyboard.CODE_DUMMY);
assertParserError("Non existing code", "abc|" + CODE_NON_EXISTING, "abc", null, null); assertParserError("Non existing icon", ICON_NON_EXISTING + "|abc", null, "abc", null,
assertParserError("Third bar at end", "a|b|", "a", null, null); Keyboard.CODE_DUMMY);
assertParserError("Multiple bar", "a|b|c", "a", null, null); assertParserError("Non existing code", "abc|" + CODE_NON_EXISTING, "abc", null, null,
Keyboard.CODE_UNSPECIFIED);
assertParserError("Third bar at end", "a|b|", "a", null, null, Keyboard.CODE_UNSPECIFIED);
assertParserError("Multiple bar", "a|b|c", "a", null, null, Keyboard.CODE_UNSPECIFIED);
assertParserError("Multiple bar with label and code", "a|" + CODE_SETTINGS + "|c", "a", assertParserError("Multiple bar with label and code", "a|" + CODE_SETTINGS + "|c", "a",
null, null, mCodeSettings); null, null, mCodeSettings);
assertParserError("Multiple bar with icon and outputText", ICON_SETTINGS + "|b|c", null, assertParserError("Multiple bar with icon and outputText", ICON_SETTINGS + "|b|c", null,
null, mIconSettings); null, mIconSettings, Keyboard.CODE_UNSPECIFIED);
assertParserError("Multiple bar with icon and code", assertParserError("Multiple bar with icon and code",
ICON_SETTINGS + "|" + CODE_SETTINGS + "|c", null, null, mIconSettings, ICON_SETTINGS + "|" + CODE_SETTINGS + "|c", null, null, mIconSettings,
mCodeSettings); mCodeSettings);