diff options
Diffstat (limited to 'java')
137 files changed, 971 insertions, 609 deletions
diff --git a/java/proguard.flags b/java/proguard.flags index caf1ea183..5ce0c273c 100644 --- a/java/proguard.flags +++ b/java/proguard.flags @@ -35,6 +35,6 @@ *; } --keep class com.android.inputmethod.keyboard.MiniKeyboard$Builder$MiniKeyboardParams { +-keep class com.android.inputmethod.keyboard.MoreKeysKeyboard$Builder$MoreKeysKeyboardParams { <init>(...); } diff --git a/java/res/anim/mini_keyboard_fadein.xml b/java/res/anim/more_keys_keyboard_fadein.xml index f80e8b8de..c781f36ad 100644 --- a/java/res/anim/mini_keyboard_fadein.xml +++ b/java/res/anim/more_keys_keyboard_fadein.xml @@ -25,5 +25,5 @@ <alpha android:fromAlpha="0.5" android:toAlpha="1.0" - android:duration="@integer/config_mini_keyboard_fadein_anim_time" /> + android:duration="@integer/config_more_keys_keyboard_fadein_anim_time" /> </set> diff --git a/java/res/anim/mini_keyboard_fadeout.xml b/java/res/anim/more_keys_keyboard_fadeout.xml index 535b100ae..32fae6bd8 100644 --- a/java/res/anim/mini_keyboard_fadeout.xml +++ b/java/res/anim/more_keys_keyboard_fadeout.xml @@ -25,5 +25,5 @@ <alpha android:fromAlpha="1.0" android:toAlpha="0.0" - android:duration="@integer/config_mini_keyboard_fadeout_anim_time" /> + android:duration="@integer/config_more_keys_keyboard_fadeout_anim_time" /> </set> diff --git a/java/res/layout/mini_keyboard.xml b/java/res/layout/more_keys_keyboard.xml index 6964ec5d6..89161c6b4 100644 --- a/java/res/layout/mini_keyboard.xml +++ b/java/res/layout/more_keys_keyboard.xml @@ -22,11 +22,11 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="horizontal" - style="?attr/miniKeyboardPanelStyle" + style="?attr/moreKeysKeyboardPanelStyle" > - <com.android.inputmethod.keyboard.MiniKeyboardView + <com.android.inputmethod.keyboard.MoreKeysKeyboardView xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin" - android:id="@+id/mini_keyboard_view" + android:id="@+id/more_keys_keyboard_view" android:layout_alignParentBottom="true" android:layout_width="wrap_content" android:layout_height="wrap_content" diff --git a/java/res/layout/more_suggestions.xml b/java/res/layout/more_suggestions.xml index 1e59b8931..34f54f974 100644 --- a/java/res/layout/more_suggestions.xml +++ b/java/res/layout/more_suggestions.xml @@ -22,7 +22,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="horizontal" - style="?attr/miniKeyboardPanelStyle" + style="?attr/moreKeysKeyboardPanelStyle" > <com.android.inputmethod.latin.suggestions.MoreSuggestionsView xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin" diff --git a/java/res/values-af/strings.xml b/java/res/values-af/strings.xml index 081f604f5..0ca0e9005 100644 --- a/java/res/values-af/strings.xml +++ b/java/res/values-af/strings.xml @@ -65,6 +65,8 @@ <string name="added_word" msgid="8993883354622484372">"<xliff:g id="WORD">%s</xliff:g> : Gestoor"</string> <string name="label_go_key" msgid="1635148082137219148">"Gaan"</string> <string name="label_next_key" msgid="362972844525672568">"Volgende"</string> + <!-- no translation found for label_previous_key (1211868118071386787) --> + <skip /> <string name="label_done_key" msgid="2441578748772529288">"Klaar"</string> <string name="label_send_key" msgid="2815056534433717444">"Stuur"</string> <string name="label_to_alpha_key" msgid="4793983863798817523">"ABC"</string> diff --git a/java/res/values-am/strings.xml b/java/res/values-am/strings.xml index b45e1c365..ea64daeff 100644 --- a/java/res/values-am/strings.xml +++ b/java/res/values-am/strings.xml @@ -65,6 +65,8 @@ <string name="added_word" msgid="8993883354622484372">"<xliff:g id="WORD">%s</xliff:g> : ተቀምጧል"</string> <string name="label_go_key" msgid="1635148082137219148">"ሂድ"</string> <string name="label_next_key" msgid="362972844525672568">"በመቀጠል"</string> + <!-- no translation found for label_previous_key (1211868118071386787) --> + <skip /> <string name="label_done_key" msgid="2441578748772529288">"ተከናውኗል"</string> <string name="label_send_key" msgid="2815056534433717444">" ይላኩ"</string> <string name="label_to_alpha_key" msgid="4793983863798817523">"ABC"</string> diff --git a/java/res/values-ar/donottranslate-more-keys.xml b/java/res/values-ar/donottranslate-more-keys.xml index 9a7a0267a..df093b3c9 100644 --- a/java/res/values-ar/donottranslate-more-keys.xml +++ b/java/res/values-ar/donottranslate-more-keys.xml @@ -38,7 +38,7 @@ <!-- In order to make Tatweel easily distinguishable from other punctuations, we use consecutive Tatweels only for its displayed label. --> <!-- TODO: Will introduce "grouping marks" to the more characters specification. --> <string name="more_keys_for_punctuation">"\u060c,\u061b,\u061f,!,:,-,/,\',\",\u0640\u0640\u0640|\u0640,\u064e,\u0650,\u064b,\u064d,\u0670,\u0656,\u0655,\u0654,\u0653,\u0652,\u0651,\u064c,\u064f"</string> - <integer name="mini_keyboard_column_for_punctuation">9</integer> + <integer name="more_keys_keyboard_column_for_punctuation">9</integer> <string name="keyhintlabel_for_punctuation">\u064b</string> <string name="keylabel_for_symbols_1">"١"</string> <string name="keylabel_for_symbols_2">"٢"</string> @@ -104,14 +104,14 @@ <string name="more_keys_for_star">★,\u066d</string> <!-- The all letters need to be mirrored are found at http://www.unicode.org/Public/6.1.0/ucd/BidiMirroring.txt --> - <string name="output_text_for_left_parenthesis">)</string> - <string name="output_text_for_right_parenthesis">(</string> + <integer name="keycode_for_left_parenthesis">0x0029</integer> + <integer name="keycode_for_right_parenthesis">0x0028</integer> <!-- \ufd3e: ORNATE LEFT PARENTHESIS \ufd3f: ORNATE RIGHT PARENTHESIS --> <string name="more_keys_for_left_parenthesis">[|],{|},<|>,\ufd3e|\ufd3f</string> <string name="more_keys_for_right_parenthesis">]|[,}|{,>|<,\ufd3f|\ufd3e</string> - <string name="output_text_for_less_than">></string> - <string name="output_text_for_greater_than"><</string> + <integer name="keycode_for_less_than">0x003e</integer> + <integer name="keycode_for_greater_than">0x003c</integer> <!-- \u2264: LESS-THAN OR EQUAL TO \u2265: GREATER-THAN EQUAL TO \u00ab: LEFT-POINTING DOUBLE ANGLE QUOTATION MARK @@ -129,10 +129,10 @@ \u201f: DOUBLE HIGH-REVERSED-9 QUOTATION MARK --> <string name="more_keys_for_less_than">\u2264|\u2265,\u00ab|\u00bb,\u2039|\u203a</string> <string name="more_keys_for_greater_than">\u2265|\u2264,\u00bb|\u00ab,\u203a|\u2039</string> - <string name="output_text_for_left_square_bracket">]</string> - <string name="output_text_for_right_square_bracket">[</string> - <string name="output_text_for_left_curly_bracket">}</string> - <string name="output_text_for_right_curly_bracket">{</string> + <integer name="keycode_for_left_square_bracket">0x005d</integer> + <integer name="keycode_for_right_square_bracket">0x005b</integer> + <integer name="keycode_for_left_curly_bracket">0x007d</integer> + <integer name="keycode_for_right_curly_bracket">0x007b</integer> <!-- Note: Neither DroidSans nor Roboto have a glyph for DOUBLE HIGH-REVERSED-9 QUOTATION MARK. --> <!-- <string name="more_keys_for_double_quote">\u201c,\u201d,\u201e,\u201f,\u00ab,\u00bb</string> --> <!-- The 4-more keys will be displayed in order of "3,1,2,4". --> diff --git a/java/res/values-ar/strings.xml b/java/res/values-ar/strings.xml index 80d4b0deb..c4aa441d8 100644 --- a/java/res/values-ar/strings.xml +++ b/java/res/values-ar/strings.xml @@ -65,6 +65,8 @@ <string name="added_word" msgid="8993883354622484372">"<xliff:g id="WORD">%s</xliff:g> : تم الحفظ"</string> <string name="label_go_key" msgid="1635148082137219148">"تنفيذ"</string> <string name="label_next_key" msgid="362972844525672568">"التالي"</string> + <!-- no translation found for label_previous_key (1211868118071386787) --> + <skip /> <string name="label_done_key" msgid="2441578748772529288">"تم"</string> <string name="label_send_key" msgid="2815056534433717444">"إرسال"</string> <string name="label_to_alpha_key" msgid="4793983863798817523">"أ ب ج"</string> diff --git a/java/res/values-be/strings.xml b/java/res/values-be/strings.xml index 668212897..c0094741c 100644 --- a/java/res/values-be/strings.xml +++ b/java/res/values-be/strings.xml @@ -65,6 +65,8 @@ <string name="added_word" msgid="8993883354622484372">"<xliff:g id="WORD">%s</xliff:g> : Захаваныя"</string> <string name="label_go_key" msgid="1635148082137219148">"Пачаць"</string> <string name="label_next_key" msgid="362972844525672568">"Далей"</string> + <!-- no translation found for label_previous_key (1211868118071386787) --> + <skip /> <string name="label_done_key" msgid="2441578748772529288">"Гатова"</string> <string name="label_send_key" msgid="2815056534433717444">"Адправіць"</string> <string name="label_to_alpha_key" msgid="4793983863798817523">"ABC"</string> diff --git a/java/res/values-bg/strings.xml b/java/res/values-bg/strings.xml index 5a3b60f33..900a7fd88 100644 --- a/java/res/values-bg/strings.xml +++ b/java/res/values-bg/strings.xml @@ -65,6 +65,8 @@ <string name="added_word" msgid="8993883354622484372">"<xliff:g id="WORD">%s</xliff:g> : Запазено"</string> <string name="label_go_key" msgid="1635148082137219148">"Старт"</string> <string name="label_next_key" msgid="362972844525672568">"Напред"</string> + <!-- no translation found for label_previous_key (1211868118071386787) --> + <skip /> <string name="label_done_key" msgid="2441578748772529288">"Готово"</string> <string name="label_send_key" msgid="2815056534433717444">"Изпращане"</string> <string name="label_to_alpha_key" msgid="4793983863798817523">"АБВ"</string> diff --git a/java/res/values-ca/strings.xml b/java/res/values-ca/strings.xml index 149867fd0..0fae132a6 100644 --- a/java/res/values-ca/strings.xml +++ b/java/res/values-ca/strings.xml @@ -65,6 +65,8 @@ <string name="added_word" msgid="8993883354622484372">"<xliff:g id="WORD">%s</xliff:g>: desada"</string> <string name="label_go_key" msgid="1635148082137219148">"Vés"</string> <string name="label_next_key" msgid="362972844525672568">"Següent"</string> + <!-- no translation found for label_previous_key (1211868118071386787) --> + <skip /> <string name="label_done_key" msgid="2441578748772529288">"Fet"</string> <string name="label_send_key" msgid="2815056534433717444">"Envia"</string> <string name="label_to_alpha_key" msgid="4793983863798817523">"ABC"</string> diff --git a/java/res/values-cs/strings.xml b/java/res/values-cs/strings.xml index 6b7842cd3..7c4c31ac4 100644 --- a/java/res/values-cs/strings.xml +++ b/java/res/values-cs/strings.xml @@ -65,6 +65,8 @@ <string name="added_word" msgid="8993883354622484372">"<xliff:g id="WORD">%s</xliff:g>: Uloženo"</string> <string name="label_go_key" msgid="1635148082137219148">"Přejít"</string> <string name="label_next_key" msgid="362972844525672568">"Další"</string> + <!-- no translation found for label_previous_key (1211868118071386787) --> + <skip /> <string name="label_done_key" msgid="2441578748772529288">"Hotovo"</string> <string name="label_send_key" msgid="2815056534433717444">"Odeslat"</string> <string name="label_to_alpha_key" msgid="4793983863798817523">"ABC"</string> diff --git a/java/res/values-da/strings.xml b/java/res/values-da/strings.xml index a046d6182..bc871e7b7 100644 --- a/java/res/values-da/strings.xml +++ b/java/res/values-da/strings.xml @@ -65,6 +65,7 @@ <string name="added_word" msgid="8993883354622484372">"<xliff:g id="WORD">%s</xliff:g>: Gemt"</string> <string name="label_go_key" msgid="1635148082137219148">"Gå"</string> <string name="label_next_key" msgid="362972844525672568">"Næste"</string> + <string name="label_previous_key" msgid="1211868118071386787">"Forr."</string> <string name="label_done_key" msgid="2441578748772529288">"Udfør"</string> <string name="label_send_key" msgid="2815056534433717444">"Send"</string> <string name="label_to_alpha_key" msgid="4793983863798817523">"ABC"</string> diff --git a/java/res/values-de/strings.xml b/java/res/values-de/strings.xml index eb0a3fba6..da5823a76 100644 --- a/java/res/values-de/strings.xml +++ b/java/res/values-de/strings.xml @@ -65,6 +65,8 @@ <string name="added_word" msgid="8993883354622484372">"<xliff:g id="WORD">%s</xliff:g>: gespeichert"</string> <string name="label_go_key" msgid="1635148082137219148">"Los"</string> <string name="label_next_key" msgid="362972844525672568">"Weiter"</string> + <!-- no translation found for label_previous_key (1211868118071386787) --> + <skip /> <string name="label_done_key" msgid="2441578748772529288">"Fertig"</string> <string name="label_send_key" msgid="2815056534433717444">"Senden"</string> <string name="label_to_alpha_key" msgid="4793983863798817523">"ABC"</string> diff --git a/java/res/values-el/strings.xml b/java/res/values-el/strings.xml index 9ca1c4eca..d126edb56 100644 --- a/java/res/values-el/strings.xml +++ b/java/res/values-el/strings.xml @@ -65,6 +65,8 @@ <string name="added_word" msgid="8993883354622484372">"<xliff:g id="WORD">%s</xliff:g> : Αποθηκεύτηκε"</string> <string name="label_go_key" msgid="1635148082137219148">"Μετ."</string> <string name="label_next_key" msgid="362972844525672568">"Επόμενο"</string> + <!-- no translation found for label_previous_key (1211868118071386787) --> + <skip /> <string name="label_done_key" msgid="2441578748772529288">"Τέλος"</string> <string name="label_send_key" msgid="2815056534433717444">"Αποστολή"</string> <string name="label_to_alpha_key" msgid="4793983863798817523">"ΑΒΓ"</string> diff --git a/java/res/values-en-rGB/strings.xml b/java/res/values-en-rGB/strings.xml index 9e0f1502f..bce6a51a5 100644 --- a/java/res/values-en-rGB/strings.xml +++ b/java/res/values-en-rGB/strings.xml @@ -65,6 +65,7 @@ <string name="added_word" msgid="8993883354622484372">"<xliff:g id="WORD">%s</xliff:g> : Saved"</string> <string name="label_go_key" msgid="1635148082137219148">"Go"</string> <string name="label_next_key" msgid="362972844525672568">"Next"</string> + <string name="label_previous_key" msgid="1211868118071386787">"Prev"</string> <string name="label_done_key" msgid="2441578748772529288">"Done"</string> <string name="label_send_key" msgid="2815056534433717444">"Send"</string> <string name="label_to_alpha_key" msgid="4793983863798817523">"ABC"</string> diff --git a/java/res/values-es-rUS/strings.xml b/java/res/values-es-rUS/strings.xml index f4c2b4599..29df462fb 100644 --- a/java/res/values-es-rUS/strings.xml +++ b/java/res/values-es-rUS/strings.xml @@ -65,6 +65,8 @@ <string name="added_word" msgid="8993883354622484372">"<xliff:g id="WORD">%s</xliff:g>: guardada"</string> <string name="label_go_key" msgid="1635148082137219148">"Ir"</string> <string name="label_next_key" msgid="362972844525672568">"Siguiente"</string> + <!-- no translation found for label_previous_key (1211868118071386787) --> + <skip /> <string name="label_done_key" msgid="2441578748772529288">"Hecho"</string> <string name="label_send_key" msgid="2815056534433717444">"Enviar"</string> <string name="label_to_alpha_key" msgid="4793983863798817523">"ABC"</string> diff --git a/java/res/values-es/strings.xml b/java/res/values-es/strings.xml index 675a42619..4e47069f6 100644 --- a/java/res/values-es/strings.xml +++ b/java/res/values-es/strings.xml @@ -65,6 +65,7 @@ <string name="added_word" msgid="8993883354622484372">"<xliff:g id="WORD">%s</xliff:g>: guardada"</string> <string name="label_go_key" msgid="1635148082137219148">"Ir"</string> <string name="label_next_key" msgid="362972844525672568">"Sig."</string> + <string name="label_previous_key" msgid="1211868118071386787">"Anterior"</string> <string name="label_done_key" msgid="2441578748772529288">"Ok"</string> <string name="label_send_key" msgid="2815056534433717444">"Enviar"</string> <string name="label_to_alpha_key" msgid="4793983863798817523">"ABC"</string> diff --git a/java/res/values-et/strings.xml b/java/res/values-et/strings.xml index 84f4b7f2a..a65bd4a95 100644 --- a/java/res/values-et/strings.xml +++ b/java/res/values-et/strings.xml @@ -65,6 +65,8 @@ <string name="added_word" msgid="8993883354622484372">"<xliff:g id="WORD">%s</xliff:g> : salvestatud"</string> <string name="label_go_key" msgid="1635148082137219148">"Mine"</string> <string name="label_next_key" msgid="362972844525672568">"Edasi"</string> + <!-- no translation found for label_previous_key (1211868118071386787) --> + <skip /> <string name="label_done_key" msgid="2441578748772529288">"Valmis"</string> <string name="label_send_key" msgid="2815056534433717444">"Saada"</string> <string name="label_to_alpha_key" msgid="4793983863798817523">"ABC"</string> diff --git a/java/res/values-fa/strings.xml b/java/res/values-fa/strings.xml index 05f3a7a6e..9b757505a 100644 --- a/java/res/values-fa/strings.xml +++ b/java/res/values-fa/strings.xml @@ -65,6 +65,8 @@ <string name="added_word" msgid="8993883354622484372">"<xliff:g id="WORD">%s</xliff:g> : ذخیره شد"</string> <string name="label_go_key" msgid="1635148082137219148">"برو"</string> <string name="label_next_key" msgid="362972844525672568">"بعدی"</string> + <!-- no translation found for label_previous_key (1211868118071386787) --> + <skip /> <string name="label_done_key" msgid="2441578748772529288">"انجام شد"</string> <string name="label_send_key" msgid="2815056534433717444">"ارسال"</string> <string name="label_to_alpha_key" msgid="4793983863798817523">"ABC"</string> diff --git a/java/res/values-fi/strings.xml b/java/res/values-fi/strings.xml index f77604d93..c4da3cbf7 100644 --- a/java/res/values-fi/strings.xml +++ b/java/res/values-fi/strings.xml @@ -65,6 +65,8 @@ <string name="added_word" msgid="8993883354622484372">"<xliff:g id="WORD">%s</xliff:g> : Tallennettu"</string> <string name="label_go_key" msgid="1635148082137219148">"Siirry"</string> <string name="label_next_key" msgid="362972844525672568">"Seur."</string> + <!-- no translation found for label_previous_key (1211868118071386787) --> + <skip /> <string name="label_done_key" msgid="2441578748772529288">"Valmis"</string> <string name="label_send_key" msgid="2815056534433717444">"Lähetä"</string> <string name="label_to_alpha_key" msgid="4793983863798817523">"ABC"</string> @@ -105,7 +107,7 @@ <string name="voice_server_error" msgid="7807129913977261644">"Palvelinvirhe"</string> <string name="voice_speech_timeout" msgid="8461817525075498795">"Puhetta ei kuulu"</string> <string name="voice_no_match" msgid="4285117547030179174">"Ei vastineita"</string> - <string name="voice_not_installed" msgid="5552450909753842415">"Äänihakua ei asennettu"</string> + <string name="voice_not_installed" msgid="5552450909753842415">"Puhehakua ei asennettu"</string> <string name="voice_swipe_hint" msgid="6943546180310682021"><b>"Vihje:"</b>" liu\'uta sormea näppäimistöllä ja puhu"</string> <string name="voice_punctuation_hint" msgid="1611389463237317754"><b>"Vihje:"</b>" kokeile seuraavalla kerralla puhua välimerkit, kuten \"period\" (piste), \"comma\" (pilkku) tai \"question mark\" (kysymysmerkki)."</string> <string name="cancel" msgid="6830980399865683324">"Peruuta"</string> diff --git a/java/res/values-fr/strings.xml b/java/res/values-fr/strings.xml index 4eaac4005..e9536ec35 100644 --- a/java/res/values-fr/strings.xml +++ b/java/res/values-fr/strings.xml @@ -65,6 +65,8 @@ <string name="added_word" msgid="8993883354622484372">"<xliff:g id="WORD">%s</xliff:g> : enregistré"</string> <string name="label_go_key" msgid="1635148082137219148">"OK"</string> <string name="label_next_key" msgid="362972844525672568">"Suiv."</string> + <!-- no translation found for label_previous_key (1211868118071386787) --> + <skip /> <string name="label_done_key" msgid="2441578748772529288">"OK"</string> <string name="label_send_key" msgid="2815056534433717444">"Envoi"</string> <string name="label_to_alpha_key" msgid="4793983863798817523">"ABC"</string> diff --git a/java/res/values-hi/strings.xml b/java/res/values-hi/strings.xml index 229bb8a24..6b17d6751 100644 --- a/java/res/values-hi/strings.xml +++ b/java/res/values-hi/strings.xml @@ -65,6 +65,8 @@ <string name="added_word" msgid="8993883354622484372">"<xliff:g id="WORD">%s</xliff:g>: सहेजा गया"</string> <string name="label_go_key" msgid="1635148082137219148">"जाएं"</string> <string name="label_next_key" msgid="362972844525672568">"अगला"</string> + <!-- no translation found for label_previous_key (1211868118071386787) --> + <skip /> <string name="label_done_key" msgid="2441578748772529288">"पूर्ण"</string> <string name="label_send_key" msgid="2815056534433717444">"भेजें"</string> <string name="label_to_alpha_key" msgid="4793983863798817523">"ABC"</string> diff --git a/java/res/values-hr/strings.xml b/java/res/values-hr/strings.xml index 8fa730f8a..1d35c613e 100644 --- a/java/res/values-hr/strings.xml +++ b/java/res/values-hr/strings.xml @@ -65,6 +65,8 @@ <string name="added_word" msgid="8993883354622484372">"<xliff:g id="WORD">%s</xliff:g> : Spremljeno"</string> <string name="label_go_key" msgid="1635148082137219148">"Idi"</string> <string name="label_next_key" msgid="362972844525672568">"Dalje"</string> + <!-- no translation found for label_previous_key (1211868118071386787) --> + <skip /> <string name="label_done_key" msgid="2441578748772529288">"Gotovo"</string> <string name="label_send_key" msgid="2815056534433717444">"Pošalji"</string> <string name="label_to_alpha_key" msgid="4793983863798817523">"ABC"</string> diff --git a/java/res/values-hu/strings.xml b/java/res/values-hu/strings.xml index f397e0be9..de2e812d7 100644 --- a/java/res/values-hu/strings.xml +++ b/java/res/values-hu/strings.xml @@ -65,6 +65,8 @@ <string name="added_word" msgid="8993883354622484372">"<xliff:g id="WORD">%s</xliff:g> : mentve"</string> <string name="label_go_key" msgid="1635148082137219148">"Ugrás"</string> <string name="label_next_key" msgid="362972844525672568">"Tovább"</string> + <!-- no translation found for label_previous_key (1211868118071386787) --> + <skip /> <string name="label_done_key" msgid="2441578748772529288">"Kész"</string> <string name="label_send_key" msgid="2815056534433717444">"Küldés"</string> <string name="label_to_alpha_key" msgid="4793983863798817523">"ABC"</string> diff --git a/java/res/values-in/strings.xml b/java/res/values-in/strings.xml index 6096cc17b..92b485622 100644 --- a/java/res/values-in/strings.xml +++ b/java/res/values-in/strings.xml @@ -65,6 +65,8 @@ <string name="added_word" msgid="8993883354622484372">"<xliff:g id="WORD">%s</xliff:g> : Telah disimpan"</string> <string name="label_go_key" msgid="1635148082137219148">"Buka"</string> <string name="label_next_key" msgid="362972844525672568">"Berikutnya"</string> + <!-- no translation found for label_previous_key (1211868118071386787) --> + <skip /> <string name="label_done_key" msgid="2441578748772529288">"Selesai"</string> <string name="label_send_key" msgid="2815056534433717444">"Kirimkan"</string> <string name="label_to_alpha_key" msgid="4793983863798817523">"ABC"</string> diff --git a/java/res/values-it/strings.xml b/java/res/values-it/strings.xml index 6c34bee40..38e622c2c 100644 --- a/java/res/values-it/strings.xml +++ b/java/res/values-it/strings.xml @@ -65,6 +65,8 @@ <string name="added_word" msgid="8993883354622484372">"<xliff:g id="WORD">%s</xliff:g> : parola salvata"</string> <string name="label_go_key" msgid="1635148082137219148">"Vai"</string> <string name="label_next_key" msgid="362972844525672568">"Avanti"</string> + <!-- no translation found for label_previous_key (1211868118071386787) --> + <skip /> <string name="label_done_key" msgid="2441578748772529288">"Fine"</string> <string name="label_send_key" msgid="2815056534433717444">"Invia"</string> <string name="label_to_alpha_key" msgid="4793983863798817523">"ABC"</string> diff --git a/java/res/values-iw/donottranslate-more-keys.xml b/java/res/values-iw/donottranslate-more-keys.xml index 6fc336002..f44ff2123 100644 --- a/java/res/values-iw/donottranslate-more-keys.xml +++ b/java/res/values-iw/donottranslate-more-keys.xml @@ -22,12 +22,12 @@ <string name="more_keys_for_plus">±,﬩</string> <!-- The all letters need to be mirrored are found at http://www.unicode.org/Public/6.1.0/ucd/BidiMirroring.txt --> - <string name="output_text_for_left_parenthesis">)</string> - <string name="output_text_for_right_parenthesis">(</string> + <integer name="keycode_for_left_parenthesis">0x0029</integer> + <integer name="keycode_for_right_parenthesis">0x0028</integer> <string name="more_keys_for_left_parenthesis">[|],{|},<|></string> <string name="more_keys_for_right_parenthesis">]|[,}|{,>|<</string> - <string name="output_text_for_less_than">></string> - <string name="output_text_for_greater_than"><</string> + <integer name="keycode_for_less_than">0x003e</integer> + <integer name="keycode_for_greater_than">0x003c</integer> <!-- \u2264: LESS-THAN OR EQUAL TO \u2265: GREATER-THAN EQUAL TO \u00ab: LEFT-POINTING DOUBLE ANGLE QUOTATION MARK @@ -45,10 +45,10 @@ \u201f: DOUBLE HIGH-REVERSED-9 QUOTATION MARK --> <string name="more_keys_for_less_than">\u2264|\u2265,\u00ab|\u00bb,\u2039|\u203a</string> <string name="more_keys_for_greater_than">\u2265|\u2264,\u00bb|\u00ab,\u203a|\u2039</string> - <string name="output_text_for_left_square_bracket">]</string> - <string name="output_text_for_right_square_bracket">[</string> - <string name="output_text_for_left_curly_bracket">}</string> - <string name="output_text_for_right_curly_bracket">{</string> + <integer name="keycode_for_left_square_bracket">0x005d</integer> + <integer name="keycode_for_right_square_bracket">0x005b</integer> + <integer name="keycode_for_left_curly_bracket">0x007d</integer> + <integer name="keycode_for_right_curly_bracket">0x007b</integer> <!-- Note: Neither DroidSans nor Roboto have a glyph for DOUBLE HIGH-REVERSED-9 QUOTATION MARK. --> <!-- <string name="more_keys_for_double_quote">\u201c,\u201d,\u201e,\u201f,\u00ab,\u00bb</string> --> <!-- The 4-more keys will be displayed in order of "3,1,2,4". --> diff --git a/java/res/values-iw/strings.xml b/java/res/values-iw/strings.xml index dea0b41a9..9aeaffd89 100644 --- a/java/res/values-iw/strings.xml +++ b/java/res/values-iw/strings.xml @@ -65,6 +65,8 @@ <string name="added_word" msgid="8993883354622484372">"<xliff:g id="WORD">%s</xliff:g> : נשמרה"</string> <string name="label_go_key" msgid="1635148082137219148">"בצע"</string> <string name="label_next_key" msgid="362972844525672568">"הבא"</string> + <!-- no translation found for label_previous_key (1211868118071386787) --> + <skip /> <string name="label_done_key" msgid="2441578748772529288">"סיום"</string> <string name="label_send_key" msgid="2815056534433717444">"שלח"</string> <string name="label_to_alpha_key" msgid="4793983863798817523">"אבג"</string> diff --git a/java/res/values-ja/strings.xml b/java/res/values-ja/strings.xml index d6f967a4e..f684e2131 100644 --- a/java/res/values-ja/strings.xml +++ b/java/res/values-ja/strings.xml @@ -65,6 +65,8 @@ <string name="added_word" msgid="8993883354622484372">"<xliff:g id="WORD">%s</xliff:g>:保存しました"</string> <string name="label_go_key" msgid="1635148082137219148">"実行"</string> <string name="label_next_key" msgid="362972844525672568">"次へ"</string> + <!-- no translation found for label_previous_key (1211868118071386787) --> + <skip /> <string name="label_done_key" msgid="2441578748772529288">"完了"</string> <string name="label_send_key" msgid="2815056534433717444">"送信"</string> <string name="label_to_alpha_key" msgid="4793983863798817523">"ABC"</string> diff --git a/java/res/values-ko/strings.xml b/java/res/values-ko/strings.xml index 7382a0cd4..56705953c 100644 --- a/java/res/values-ko/strings.xml +++ b/java/res/values-ko/strings.xml @@ -65,6 +65,8 @@ <string name="added_word" msgid="8993883354622484372">"<xliff:g id="WORD">%s</xliff:g>: 저장됨"</string> <string name="label_go_key" msgid="1635148082137219148">"이동"</string> <string name="label_next_key" msgid="362972844525672568">"다음"</string> + <!-- no translation found for label_previous_key (1211868118071386787) --> + <skip /> <string name="label_done_key" msgid="2441578748772529288">"완료"</string> <string name="label_send_key" msgid="2815056534433717444">"전송"</string> <string name="label_to_alpha_key" msgid="4793983863798817523">"ABC"</string> diff --git a/java/res/values-land/dimens.xml b/java/res/values-land/dimens.xml index dcbfe463e..f9cce839a 100644 --- a/java/res/values-land/dimens.xml +++ b/java/res/values-land/dimens.xml @@ -66,7 +66,7 @@ <dimen name="key_preview_backing_height">72dip</dimen> <!-- Amount of allowance for selecting keys in a mini popup keyboard by sliding finger. --> <!-- popup_key_height x 1.2 --> - <dimen name="mini_keyboard_slide_allowance">0.336in</dimen> + <dimen name="more_keys_keyboard_slide_allowance">0.336in</dimen> <!-- popup_key_height x -1.0 --> - <dimen name="mini_keyboard_vertical_correction">-0.280in</dimen> + <dimen name="more_keys_keyboard_vertical_correction">-0.280in</dimen> </resources> diff --git a/java/res/values-lt/strings.xml b/java/res/values-lt/strings.xml index 646548d79..93b52b530 100644 --- a/java/res/values-lt/strings.xml +++ b/java/res/values-lt/strings.xml @@ -65,6 +65,8 @@ <string name="added_word" msgid="8993883354622484372">"<xliff:g id="WORD">%s</xliff:g>: išsaugota"</string> <string name="label_go_key" msgid="1635148082137219148">"Pradėti"</string> <string name="label_next_key" msgid="362972844525672568">"Kitas"</string> + <!-- no translation found for label_previous_key (1211868118071386787) --> + <skip /> <string name="label_done_key" msgid="2441578748772529288">"Atlikta"</string> <string name="label_send_key" msgid="2815056534433717444">"Siųsti"</string> <string name="label_to_alpha_key" msgid="4793983863798817523">"ABC"</string> diff --git a/java/res/values-lv/strings.xml b/java/res/values-lv/strings.xml index b3406c3b1..6fc1d996e 100644 --- a/java/res/values-lv/strings.xml +++ b/java/res/values-lv/strings.xml @@ -65,6 +65,8 @@ <string name="added_word" msgid="8993883354622484372">"<xliff:g id="WORD">%s</xliff:g>: saglabāts"</string> <string name="label_go_key" msgid="1635148082137219148">"Sākt"</string> <string name="label_next_key" msgid="362972844525672568">"Tālāk"</string> + <!-- no translation found for label_previous_key (1211868118071386787) --> + <skip /> <string name="label_done_key" msgid="2441578748772529288">"Gatavs"</string> <string name="label_send_key" msgid="2815056534433717444">"Sūtīt"</string> <string name="label_to_alpha_key" msgid="4793983863798817523">"ABC"</string> diff --git a/java/res/values-ms/strings.xml b/java/res/values-ms/strings.xml index 2a9f516d7..e75cc80e3 100644 --- a/java/res/values-ms/strings.xml +++ b/java/res/values-ms/strings.xml @@ -65,6 +65,8 @@ <string name="added_word" msgid="8993883354622484372">"<xliff:g id="WORD">%s</xliff:g> : Disimpan"</string> <string name="label_go_key" msgid="1635148082137219148">"Pergi"</string> <string name="label_next_key" msgid="362972844525672568">"Seterusnya"</string> + <!-- no translation found for label_previous_key (1211868118071386787) --> + <skip /> <string name="label_done_key" msgid="2441578748772529288">"Selesai"</string> <string name="label_send_key" msgid="2815056534433717444">"Hantar"</string> <string name="label_to_alpha_key" msgid="4793983863798817523">"ABC"</string> diff --git a/java/res/values-nb/strings.xml b/java/res/values-nb/strings.xml index 413c7ae5d..1141e3314 100644 --- a/java/res/values-nb/strings.xml +++ b/java/res/values-nb/strings.xml @@ -65,6 +65,7 @@ <string name="added_word" msgid="8993883354622484372">"<xliff:g id="WORD">%s</xliff:g>: Lagret"</string> <string name="label_go_key" msgid="1635148082137219148">"Gå"</string> <string name="label_next_key" msgid="362972844525672568">"Neste"</string> + <string name="label_previous_key" msgid="1211868118071386787">"Tidl."</string> <string name="label_done_key" msgid="2441578748772529288">"Utfør"</string> <string name="label_send_key" msgid="2815056534433717444">"Send"</string> <string name="label_to_alpha_key" msgid="4793983863798817523">"ABC"</string> diff --git a/java/res/values-nl/strings.xml b/java/res/values-nl/strings.xml index ba6dd407f..6da587a73 100644 --- a/java/res/values-nl/strings.xml +++ b/java/res/values-nl/strings.xml @@ -65,6 +65,8 @@ <string name="added_word" msgid="8993883354622484372">"<xliff:g id="WORD">%s</xliff:g>: opgeslagen"</string> <string name="label_go_key" msgid="1635148082137219148">"Start"</string> <string name="label_next_key" msgid="362972844525672568">"Verder"</string> + <!-- no translation found for label_previous_key (1211868118071386787) --> + <skip /> <string name="label_done_key" msgid="2441578748772529288">"Gereed"</string> <string name="label_send_key" msgid="2815056534433717444">"Zenden"</string> <string name="label_to_alpha_key" msgid="4793983863798817523">"ABC"</string> diff --git a/java/res/values-pl/strings.xml b/java/res/values-pl/strings.xml index 3ad383116..cda725bc3 100644 --- a/java/res/values-pl/strings.xml +++ b/java/res/values-pl/strings.xml @@ -65,6 +65,8 @@ <string name="added_word" msgid="8993883354622484372">"<xliff:g id="WORD">%s</xliff:g> : Zapisano"</string> <string name="label_go_key" msgid="1635148082137219148">"OK"</string> <string name="label_next_key" msgid="362972844525672568">"Dalej"</string> + <!-- no translation found for label_previous_key (1211868118071386787) --> + <skip /> <string name="label_done_key" msgid="2441578748772529288">"OK"</string> <string name="label_send_key" msgid="2815056534433717444">"Wyślij"</string> <string name="label_to_alpha_key" msgid="4793983863798817523">"ABC"</string> diff --git a/java/res/values-pt-rPT/strings.xml b/java/res/values-pt-rPT/strings.xml index ae7443a0b..52a497f5f 100644 --- a/java/res/values-pt-rPT/strings.xml +++ b/java/res/values-pt-rPT/strings.xml @@ -65,6 +65,8 @@ <string name="added_word" msgid="8993883354622484372">"<xliff:g id="WORD">%s</xliff:g>: guardada"</string> <string name="label_go_key" msgid="1635148082137219148">"OK"</string> <string name="label_next_key" msgid="362972844525672568">"Avançar"</string> + <!-- no translation found for label_previous_key (1211868118071386787) --> + <skip /> <string name="label_done_key" msgid="2441578748772529288">"Feito"</string> <string name="label_send_key" msgid="2815056534433717444">"Enviar"</string> <string name="label_to_alpha_key" msgid="4793983863798817523">"ABC"</string> diff --git a/java/res/values-pt/strings.xml b/java/res/values-pt/strings.xml index 16003f6de..8d1218910 100644 --- a/java/res/values-pt/strings.xml +++ b/java/res/values-pt/strings.xml @@ -65,6 +65,8 @@ <string name="added_word" msgid="8993883354622484372">"<xliff:g id="WORD">%s</xliff:g> : Salvo"</string> <string name="label_go_key" msgid="1635148082137219148">"Ir"</string> <string name="label_next_key" msgid="362972844525672568">"Avançar"</string> + <!-- no translation found for label_previous_key (1211868118071386787) --> + <skip /> <string name="label_done_key" msgid="2441578748772529288">"Feito"</string> <string name="label_send_key" msgid="2815056534433717444">"Enviar"</string> <string name="label_to_alpha_key" msgid="4793983863798817523">"ABC"</string> diff --git a/java/res/values-rm/strings.xml b/java/res/values-rm/strings.xml index 57173af4e..7138da469 100644 --- a/java/res/values-rm/strings.xml +++ b/java/res/values-rm/strings.xml @@ -100,6 +100,8 @@ <string name="added_word" msgid="8993883354622484372">"<xliff:g id="WORD">%s</xliff:g> : Memorisà"</string> <string name="label_go_key" msgid="1635148082137219148">"Dai"</string> <string name="label_next_key" msgid="362972844525672568">"Vinavant"</string> + <!-- no translation found for label_previous_key (1211868118071386787) --> + <skip /> <string name="label_done_key" msgid="2441578748772529288">"Finì"</string> <string name="label_send_key" msgid="2815056534433717444">"Trametter"</string> <!-- no translation found for label_to_alpha_key (4793983863798817523) --> diff --git a/java/res/values-ro/strings.xml b/java/res/values-ro/strings.xml index 3971dc83f..b967eacec 100644 --- a/java/res/values-ro/strings.xml +++ b/java/res/values-ro/strings.xml @@ -65,6 +65,8 @@ <string name="added_word" msgid="8993883354622484372">"<xliff:g id="WORD">%s</xliff:g>: salvat"</string> <string name="label_go_key" msgid="1635148082137219148">"OK"</string> <string name="label_next_key" msgid="362972844525672568">"Înainte"</string> + <!-- no translation found for label_previous_key (1211868118071386787) --> + <skip /> <string name="label_done_key" msgid="2441578748772529288">"Terminat"</string> <string name="label_send_key" msgid="2815056534433717444">"Trimiteţi"</string> <string name="label_to_alpha_key" msgid="4793983863798817523">"ABC"</string> diff --git a/java/res/values-ru/strings.xml b/java/res/values-ru/strings.xml index 62f84d47d..13607fffa 100644 --- a/java/res/values-ru/strings.xml +++ b/java/res/values-ru/strings.xml @@ -65,6 +65,8 @@ <string name="added_word" msgid="8993883354622484372">"<xliff:g id="WORD">%s</xliff:g>: сохранено"</string> <string name="label_go_key" msgid="1635148082137219148">"Поиск"</string> <string name="label_next_key" msgid="362972844525672568">"Далее"</string> + <!-- no translation found for label_previous_key (1211868118071386787) --> + <skip /> <string name="label_done_key" msgid="2441578748772529288">"Готово"</string> <string name="label_send_key" msgid="2815056534433717444">"Отправить"</string> <string name="label_to_alpha_key" msgid="4793983863798817523">"АБВ"</string> diff --git a/java/res/values-sk/strings.xml b/java/res/values-sk/strings.xml index 188c3b64c..c9a5f00b0 100644 --- a/java/res/values-sk/strings.xml +++ b/java/res/values-sk/strings.xml @@ -65,6 +65,8 @@ <string name="added_word" msgid="8993883354622484372">"<xliff:g id="WORD">%s</xliff:g> : Uložené"</string> <string name="label_go_key" msgid="1635148082137219148">"Hľadať"</string> <string name="label_next_key" msgid="362972844525672568">"Ďalej"</string> + <!-- no translation found for label_previous_key (1211868118071386787) --> + <skip /> <string name="label_done_key" msgid="2441578748772529288">"Hotovo"</string> <string name="label_send_key" msgid="2815056534433717444">"Odoslať"</string> <string name="label_to_alpha_key" msgid="4793983863798817523">"ABC"</string> diff --git a/java/res/values-sl/strings.xml b/java/res/values-sl/strings.xml index cea30bb63..c1e8a6ff4 100644 --- a/java/res/values-sl/strings.xml +++ b/java/res/values-sl/strings.xml @@ -65,6 +65,8 @@ <string name="added_word" msgid="8993883354622484372">"<xliff:g id="WORD">%s</xliff:g>: shranjeno"</string> <string name="label_go_key" msgid="1635148082137219148">"Pojdi"</string> <string name="label_next_key" msgid="362972844525672568">"Naprej"</string> + <!-- no translation found for label_previous_key (1211868118071386787) --> + <skip /> <string name="label_done_key" msgid="2441578748772529288">"Dokončano"</string> <string name="label_send_key" msgid="2815056534433717444">"Pošlji"</string> <string name="label_to_alpha_key" msgid="4793983863798817523">"ABC"</string> diff --git a/java/res/values-sr/strings.xml b/java/res/values-sr/strings.xml index b66bf054a..20279a852 100644 --- a/java/res/values-sr/strings.xml +++ b/java/res/values-sr/strings.xml @@ -65,6 +65,8 @@ <string name="added_word" msgid="8993883354622484372">"<xliff:g id="WORD">%s</xliff:g> : Сачувано"</string> <string name="label_go_key" msgid="1635148082137219148">"Иди"</string> <string name="label_next_key" msgid="362972844525672568">"Следеће"</string> + <!-- no translation found for label_previous_key (1211868118071386787) --> + <skip /> <string name="label_done_key" msgid="2441578748772529288">"Готово"</string> <string name="label_send_key" msgid="2815056534433717444">"Пошаљи"</string> <string name="label_to_alpha_key" msgid="4793983863798817523">"ABC"</string> diff --git a/java/res/values-sv/strings.xml b/java/res/values-sv/strings.xml index 06f706a84..eb2007382 100644 --- a/java/res/values-sv/strings.xml +++ b/java/res/values-sv/strings.xml @@ -65,6 +65,8 @@ <string name="added_word" msgid="8993883354622484372">"<xliff:g id="WORD">%s</xliff:g>: sparat"</string> <string name="label_go_key" msgid="1635148082137219148">"Kör"</string> <string name="label_next_key" msgid="362972844525672568">"Nästa"</string> + <!-- no translation found for label_previous_key (1211868118071386787) --> + <skip /> <string name="label_done_key" msgid="2441578748772529288">"Färdig"</string> <string name="label_send_key" msgid="2815056534433717444">"Skicka"</string> <string name="label_to_alpha_key" msgid="4793983863798817523">"ABC"</string> diff --git a/java/res/values-sw/strings.xml b/java/res/values-sw/strings.xml index c50c9102c..983754014 100644 --- a/java/res/values-sw/strings.xml +++ b/java/res/values-sw/strings.xml @@ -65,6 +65,8 @@ <string name="added_word" msgid="8993883354622484372">"<xliff:g id="WORD">%s</xliff:g> : Imehifadhiwa"</string> <string name="label_go_key" msgid="1635148082137219148">"Nenda"</string> <string name="label_next_key" msgid="362972844525672568">"Ifuatayo"</string> + <!-- no translation found for label_previous_key (1211868118071386787) --> + <skip /> <string name="label_done_key" msgid="2441578748772529288">"Kwisha"</string> <string name="label_send_key" msgid="2815056534433717444">"Tuma"</string> <string name="label_to_alpha_key" msgid="4793983863798817523">"ABC"</string> diff --git a/java/res/values-sw600dp/config.xml b/java/res/values-sw600dp/config.xml index 40c674190..ecc5b7136 100644 --- a/java/res/values-sw600dp/config.xml +++ b/java/res/values-sw600dp/config.xml @@ -39,6 +39,7 @@ Configuration for LatinKeyboardView --> <bool name="config_sliding_key_input_enabled">false</bool> - <!-- Showing mini keyboard, just above the touched point if true, aligned to the key if false --> - <bool name="config_show_mini_keyboard_at_touched_point">true</bool> + <!-- Showing more keys keyboard, just above the touched point if true, aligned to the key if + false --> + <bool name="config_show_more_keys_keyboard_at_touched_point">true</bool> </resources> diff --git a/java/res/values-sw600dp/dimens.xml b/java/res/values-sw600dp/dimens.xml index e393be579..e04609f2a 100644 --- a/java/res/values-sw600dp/dimens.xml +++ b/java/res/values-sw600dp/dimens.xml @@ -40,12 +40,12 @@ <fraction name="keyboard_bottom_padding_ics">0.0%p</fraction> - <dimen name="mini_keyboard_key_horizontal_padding">6dip</dimen> + <dimen name="more_keys_keyboard_key_horizontal_padding">6dip</dimen> <!-- Amount of allowance for selecting keys in a mini popup keyboard by sliding finger. --> <!-- popup_key_height x 1.2 --> - <dimen name="mini_keyboard_slide_allowance">15.6mm</dimen> + <dimen name="more_keys_keyboard_slide_allowance">15.6mm</dimen> <!-- popup_key_height x -1.0 --> - <dimen name="mini_keyboard_vertical_correction">-13.0mm</dimen> + <dimen name="more_keys_keyboard_vertical_correction">-13.0mm</dimen> <!-- left or right padding of label alignment --> <dimen name="key_label_horizontal_padding">6dip</dimen> diff --git a/java/res/values-sw768dp/config.xml b/java/res/values-sw768dp/config.xml index 98d722aba..c1f9179ee 100644 --- a/java/res/values-sw768dp/config.xml +++ b/java/res/values-sw768dp/config.xml @@ -37,8 +37,9 @@ Configuration for LatinKeyboardView --> <bool name="config_sliding_key_input_enabled">false</bool> - <!-- Showing mini keyboard, just above the touched point if true, aligned to the key if false --> - <bool name="config_show_mini_keyboard_at_touched_point">true</bool> + <!-- Showing more keys keyboard, just above the touched point if true, aligned to the key if + false --> + <bool name="config_show_more_keys_keyboard_at_touched_point">true</bool> <!-- Screen metrics for logging. 0 = "mdpi phone screen" 1 = "hdpi phone screen" diff --git a/java/res/values-sw768dp/dimens.xml b/java/res/values-sw768dp/dimens.xml index dbbd844f0..f33a657af 100644 --- a/java/res/values-sw768dp/dimens.xml +++ b/java/res/values-sw768dp/dimens.xml @@ -43,12 +43,12 @@ <dimen name="popup_key_height">10.0mm</dimen> - <dimen name="mini_keyboard_key_horizontal_padding">12dip</dimen> + <dimen name="more_keys_keyboard_key_horizontal_padding">12dip</dimen> <!-- Amount of allowance for selecting keys in a mini popup keyboard by sliding finger. --> <!-- popup_key_height x 1.2 --> - <dimen name="mini_keyboard_slide_allowance">15.6mm</dimen> + <dimen name="more_keys_keyboard_slide_allowance">15.6mm</dimen> <!-- popup_key_height x -1.0 --> - <dimen name="mini_keyboard_vertical_correction">-13.0mm</dimen> + <dimen name="more_keys_keyboard_vertical_correction">-13.0mm</dimen> <!-- left or right padding of label alignment --> <dimen name="key_label_horizontal_padding">6dip</dimen> diff --git a/java/res/values-th/strings.xml b/java/res/values-th/strings.xml index 64d6c3fc9..700361a7b 100644 --- a/java/res/values-th/strings.xml +++ b/java/res/values-th/strings.xml @@ -65,6 +65,8 @@ <string name="added_word" msgid="8993883354622484372">"<xliff:g id="WORD">%s</xliff:g> : บันทึกแล้ว"</string> <string name="label_go_key" msgid="1635148082137219148">"ไป"</string> <string name="label_next_key" msgid="362972844525672568">"ถัดไป"</string> + <!-- no translation found for label_previous_key (1211868118071386787) --> + <skip /> <string name="label_done_key" msgid="2441578748772529288">"เสร็จสิ้น"</string> <string name="label_send_key" msgid="2815056534433717444">"ส่ง"</string> <string name="label_to_alpha_key" msgid="4793983863798817523">"ABC"</string> diff --git a/java/res/values-tl/strings.xml b/java/res/values-tl/strings.xml index 7f8f056fe..812d200ef 100644 --- a/java/res/values-tl/strings.xml +++ b/java/res/values-tl/strings.xml @@ -65,6 +65,8 @@ <string name="added_word" msgid="8993883354622484372">"<xliff:g id="WORD">%s</xliff:g> : Na-save"</string> <string name="label_go_key" msgid="1635148082137219148">"Punta"</string> <string name="label_next_key" msgid="362972844525672568">"Susunod"</string> + <!-- no translation found for label_previous_key (1211868118071386787) --> + <skip /> <string name="label_done_key" msgid="2441578748772529288">"Tapos na"</string> <string name="label_send_key" msgid="2815056534433717444">"Ipadala"</string> <string name="label_to_alpha_key" msgid="4793983863798817523">"ABC"</string> diff --git a/java/res/values-tr/strings.xml b/java/res/values-tr/strings.xml index 1295fb68b..d67def9e3 100644 --- a/java/res/values-tr/strings.xml +++ b/java/res/values-tr/strings.xml @@ -65,6 +65,8 @@ <string name="added_word" msgid="8993883354622484372">"<xliff:g id="WORD">%s</xliff:g> : Kaydedildi"</string> <string name="label_go_key" msgid="1635148082137219148">"Git"</string> <string name="label_next_key" msgid="362972844525672568">"İleri"</string> + <!-- no translation found for label_previous_key (1211868118071386787) --> + <skip /> <string name="label_done_key" msgid="2441578748772529288">"Bitti"</string> <string name="label_send_key" msgid="2815056534433717444">"Gönder"</string> <string name="label_to_alpha_key" msgid="4793983863798817523">"ABC"</string> diff --git a/java/res/values-uk/strings.xml b/java/res/values-uk/strings.xml index 471680025..71ae6d152 100644 --- a/java/res/values-uk/strings.xml +++ b/java/res/values-uk/strings.xml @@ -65,6 +65,8 @@ <string name="added_word" msgid="8993883354622484372">"<xliff:g id="WORD">%s</xliff:g> : збережено"</string> <string name="label_go_key" msgid="1635148082137219148">"Іти"</string> <string name="label_next_key" msgid="362972844525672568">"Далі"</string> + <!-- no translation found for label_previous_key (1211868118071386787) --> + <skip /> <string name="label_done_key" msgid="2441578748772529288">"Готово"</string> <string name="label_send_key" msgid="2815056534433717444">"Надісл."</string> <string name="label_to_alpha_key" msgid="4793983863798817523">"Алфавіт"</string> diff --git a/java/res/values-vi/strings.xml b/java/res/values-vi/strings.xml index 343a12ac6..7d6a85400 100644 --- a/java/res/values-vi/strings.xml +++ b/java/res/values-vi/strings.xml @@ -65,6 +65,8 @@ <string name="added_word" msgid="8993883354622484372">"<xliff:g id="WORD">%s</xliff:g> : Đã lưu"</string> <string name="label_go_key" msgid="1635148082137219148">"Tìm"</string> <string name="label_next_key" msgid="362972844525672568">"Tiếp theo"</string> + <!-- no translation found for label_previous_key (1211868118071386787) --> + <skip /> <string name="label_done_key" msgid="2441578748772529288">"Xong"</string> <string name="label_send_key" msgid="2815056534433717444">"Gửi"</string> <string name="label_to_alpha_key" msgid="4793983863798817523">"ABC"</string> diff --git a/java/res/values-zh-rCN/strings.xml b/java/res/values-zh-rCN/strings.xml index a2a092822..65729265f 100644 --- a/java/res/values-zh-rCN/strings.xml +++ b/java/res/values-zh-rCN/strings.xml @@ -65,6 +65,8 @@ <string name="added_word" msgid="8993883354622484372">"<xliff:g id="WORD">%s</xliff:g>:已保存"</string> <string name="label_go_key" msgid="1635148082137219148">"开始"</string> <string name="label_next_key" msgid="362972844525672568">"下一步"</string> + <!-- no translation found for label_previous_key (1211868118071386787) --> + <skip /> <string name="label_done_key" msgid="2441578748772529288">"完成"</string> <string name="label_send_key" msgid="2815056534433717444">"发送"</string> <string name="label_to_alpha_key" msgid="4793983863798817523">"ABC"</string> diff --git a/java/res/values-zh-rTW/strings.xml b/java/res/values-zh-rTW/strings.xml index f3935896e..5ac3a38c8 100644 --- a/java/res/values-zh-rTW/strings.xml +++ b/java/res/values-zh-rTW/strings.xml @@ -65,6 +65,8 @@ <string name="added_word" msgid="8993883354622484372">"<xliff:g id="WORD">%s</xliff:g>:已儲存"</string> <string name="label_go_key" msgid="1635148082137219148">"開始"</string> <string name="label_next_key" msgid="362972844525672568">"繼續"</string> + <!-- no translation found for label_previous_key (1211868118071386787) --> + <skip /> <string name="label_done_key" msgid="2441578748772529288">"完成"</string> <string name="label_send_key" msgid="2815056534433717444">"傳送"</string> <string name="label_to_alpha_key" msgid="4793983863798817523">"ABC"</string> diff --git a/java/res/values-zu/strings.xml b/java/res/values-zu/strings.xml index d1dbeac0a..012bf7fc9 100644 --- a/java/res/values-zu/strings.xml +++ b/java/res/values-zu/strings.xml @@ -65,6 +65,8 @@ <string name="added_word" msgid="8993883354622484372">"<xliff:g id="WORD">%s</xliff:g> : Kulondoloziwe"</string> <string name="label_go_key" msgid="1635148082137219148">"Iya"</string> <string name="label_next_key" msgid="362972844525672568">"Okulandelayo"</string> + <!-- no translation found for label_previous_key (1211868118071386787) --> + <skip /> <string name="label_done_key" msgid="2441578748772529288">"Kwenziwe"</string> <string name="label_send_key" msgid="2815056534433717444">"Thumela"</string> <string name="label_to_alpha_key" msgid="4793983863798817523">"ABC"</string> diff --git a/java/res/values/attrs.xml b/java/res/values/attrs.xml index 410a94208..2dea8fbb4 100644 --- a/java/res/values/attrs.xml +++ b/java/res/values/attrs.xml @@ -25,11 +25,11 @@ <attr name="keyboardViewStyle" format="reference" /> <!-- LatinKeyboardView style --> <attr name="latinKeyboardViewStyle" format="reference" /> - <!-- MiniKeyboard style --> - <attr name="miniKeyboardStyle" format="reference" /> - <!-- MiniKeyboardView style --> - <attr name="miniKeyboardViewStyle" format="reference" /> - <attr name="miniKeyboardPanelStyle" format="reference" /> + <!-- MoreKeysKeyboard style --> + <attr name="moreKeysKeyboardStyle" format="reference" /> + <!-- MoreKeysKeyboardView style --> + <attr name="moreKeysKeyboardViewStyle" format="reference" /> + <attr name="moreKeysKeyboardPanelStyle" format="reference" /> <!-- Suggestions strip style --> <attr name="suggestionsStripBackgroundStyle" format="reference" /> <attr name="suggestionsViewStyle" format="reference" /> @@ -152,8 +152,8 @@ <attr name="longPressSpaceKeyTimeout" format="integer" /> <!-- Ignore special key timeout while typing in millisecond. --> <attr name="ignoreSpecialKeyTimeout" format="integer" /> - <!-- Mini-keyboard will shown at touched point. --> - <attr name="showMiniKeyboardAtTouchedPoint" format="boolean" /> + <!-- More keys keyboard will shown at touched point. --> + <attr name="showMoreKeysKeyboardAtTouchedPoint" format="boolean" /> </declare-styleable> <declare-styleable name="SuggestionsView"> @@ -278,10 +278,13 @@ <!-- If true, use keyShiftedLetterHintActivatedColor for the shifted letter hint and keyTextInactivatedColor for the primary key top label. --> <flag name="shiftedLetterActivated" value="0x10000" /> + <!-- If true, use EditorInfo.actionLabel for the key label. --> + <flag name="fromCustomActionLabel" value="0x20000" /> </attr> <!-- The icon to display on the key instead of the label. --> <attr name="keyIcon" format="enum"> <!-- This should be aligned with the KeyboardIconsSet.ICON_* --> + <enum name="iconUndefined" value="0" /> <enum name="iconShiftKey" value="1" /> <enum name="iconDeleteKey" value="2" /> <enum name="iconSettingsKey" value="3" /> @@ -365,6 +368,7 @@ <attr name="clobberSettingsKey" format="boolean" /> <attr name="shortcutKeyEnabled" format="boolean" /> <attr name="hasShortcutKey" format="boolean" /> + <attr name="isMultiLine" format="boolean" /> <attr name="imeAction" format="enum"> <!-- This should be aligned with EditorInfo.IME_ACTION_* --> <enum name="actionUnspecified" value="0" /> @@ -375,6 +379,8 @@ <enum name="actionNext" value="5" /> <enum name="actionDone" value="6" /> <enum name="actionPrevious" value="7" /> + <!-- This should be aligned with KeyboardId.IME_ACTION_* --> + <enum name="actionCustomLabel" value="0x100" /> </attr> <attr name="localeCode" format="string" /> <attr name="languageCode" format="string" /> diff --git a/java/res/values/config.xml b/java/res/values/config.xml index c3f8edf8a..cb13ba30b 100644 --- a/java/res/values/config.xml +++ b/java/res/values/config.xml @@ -44,8 +44,8 @@ <integer name="config_delay_update_shift_state">100</integer> <integer name="config_duration_of_fadeout_language_on_spacebar">50</integer> <integer name="config_final_fadeout_percentage_of_language_on_spacebar">50</integer> - <integer name="config_mini_keyboard_fadein_anim_time">0</integer> - <integer name="config_mini_keyboard_fadeout_anim_time">100</integer> + <integer name="config_more_keys_keyboard_fadein_anim_time">0</integer> + <integer name="config_more_keys_keyboard_fadeout_anim_time">100</integer> <integer name="config_keyboard_grid_width">32</integer> <integer name="config_keyboard_grid_height">16</integer> <integer name="config_double_spaces_turn_into_period_timeout">1100</integer> @@ -69,10 +69,12 @@ <!-- Long pressing shift will invoke caps-lock if > 0, never invoke caps-lock if == 0 --> <integer name="config_long_press_shift_key_timeout">1200</integer> <!-- Long pressing space will invoke IME switcher if > 0, never invoke IME switcher if == 0 --> - <integer name="config_long_press_space_key_timeout">@integer/config_long_press_key_timeout</integer> + <integer name="config_long_press_space_key_timeout"> + @integer/config_long_press_key_timeout</integer> <integer name="config_ignore_special_key_timeout">700</integer> - <!-- Showing mini keyboard, just above the touched point if true, aligned to the key if false --> - <bool name="config_show_mini_keyboard_at_touched_point">false</bool> + <!-- Showing more keys keyboard, just above the touched point if true, aligned to the key if + false --> + <bool name="config_show_more_keys_keyboard_at_touched_point">false</bool> <!-- Configuration for auto correction --> @@ -88,9 +90,11 @@ will be subject to auto-correction. --> <item>0</item> </string-array> - <!-- Threshold of the normalized score of the best suggestion for the spell checker to declare a word to be "recommended" --> + <!-- Threshold of the normalized score of the best suggestion for the spell checker to declare + a word to be "recommended" --> <string name="spellchecker_recommended_threshold_value" translatable="false">0.11</string> - <!-- Threshold of the normalized score of any dictionary lookup to be offered as a suggestion by the spell checker --> + <!-- Threshold of the normalized score of any dictionary lookup to be offered as a suggestion + by the spell checker --> <string name="spellchecker_suggestion_threshold_value" translatable="false">0.03</string> <!-- Screen metrics for logging. 0 = "mdpi phone screen" diff --git a/java/res/values/dimens.xml b/java/res/values/dimens.xml index 95c4e5b8b..41a297902 100644 --- a/java/res/values/dimens.xml +++ b/java/res/values/dimens.xml @@ -26,8 +26,8 @@ <dimen name="popup_key_height">0.330in</dimen> - <dimen name="mini_keyboard_horizontal_edges_padding">16dip</dimen> - <dimen name="mini_keyboard_key_horizontal_padding">8dip</dimen> + <dimen name="more_keys_keyboard_horizontal_edges_padding">16dip</dimen> + <dimen name="more_keys_keyboard_key_horizontal_padding">8dip</dimen> <fraction name="keyboard_top_padding">1.556%p</fraction> <fraction name="keyboard_bottom_padding">4.669%p</fraction> @@ -48,13 +48,13 @@ <fraction name="keyboard_bottom_padding_ics">4.669%p</fraction> <fraction name="key_bottom_gap_ics">6.127%p</fraction> <fraction name="key_horizontal_gap_ics">1.739%p</fraction> - <dimen name="mini_keyboard_horizontal_edges_padding_ics">4dip</dimen> + <dimen name="more_keys_keyboard_horizontal_edges_padding_ics">4dip</dimen> <!-- Amount of allowance for selecting keys in a mini popup keyboard by sliding finger. --> <!-- popup_key_height x 1.2 --> - <dimen name="mini_keyboard_slide_allowance">0.396in</dimen> + <dimen name="more_keys_keyboard_slide_allowance">0.396in</dimen> <!-- popup_key_height x -1.0 --> - <dimen name="mini_keyboard_vertical_correction">-0.330in</dimen> + <dimen name="more_keys_keyboard_vertical_correction">-0.330in</dimen> <!-- We use "inch", not "dip" because this value tries dealing with physical distance related to user's finger. --> <dimen name="keyboard_vertical_correction">0.0in</dimen> diff --git a/java/res/values/donottranslate-more-keys.xml b/java/res/values/donottranslate-more-keys.xml index d7b1ff5e7..57a6d6bda 100644 --- a/java/res/values/donottranslate-more-keys.xml +++ b/java/res/values/donottranslate-more-keys.xml @@ -56,7 +56,7 @@ <string name="more_keys_for_currency_general">¢,$,€,£,¥,₱</string> <string name="more_keys_for_smiley">":-)|:-) ,:-(|:-( ,;-)|;-) ,:-P|:-P ,=-O|=-O ,:-*|:-* ,:O|:O ,B-)|B-) ,:-$|:-$ ,:-!|:-! ,:-[|:-[ ,O:-)|O:-) ,:-\\\\|:-\\\\ ,:\'(|:\'( ,:-D|:-D "</string> <string name="more_keys_for_punctuation">"\\,,\?,!,:,-,\',\",(,),/,;,+,&,\@"</string> - <integer name="mini_keyboard_column_for_punctuation">7</integer> + <integer name="more_keys_keyboard_column_for_punctuation">7</integer> <string name="keyhintlabel_for_punctuation"></string> <string name="keylabel_for_popular_domain">".com"</string> <!-- popular web domains for the locale - most popular, displayed on the keyboard --> @@ -114,12 +114,12 @@ <string name="more_keys_for_plus">±</string> <!-- The all letters need to be mirrored are found at http://www.unicode.org/Public/6.1.0/ucd/BidiMirroring.txt --> - <string name="output_text_for_left_parenthesis">(</string> - <string name="output_text_for_right_parenthesis">)</string> + <integer name="keycode_for_left_parenthesis">0x0028</integer> + <integer name="keycode_for_right_parenthesis">0x0029</integer> <string name="more_keys_for_left_parenthesis">[,{,<</string> <string name="more_keys_for_right_parenthesis">],},></string> - <string name="output_text_for_less_than"><</string> - <string name="output_text_for_greater_than">></string> + <integer name="keycode_for_less_than">0x003c</integer> + <integer name="keycode_for_greater_than">0x003e</integer> <!-- \u2264: LESS-THAN OR EQUAL TO \u2265: GREATER-THAN EQUAL TO \u00ab: LEFT-POINTING DOUBLE ANGLE QUOTATION MARK @@ -137,10 +137,10 @@ \u201f: DOUBLE HIGH-REVERSED-9 QUOTATION MARK --> <string name="more_keys_for_less_than">\u2264,\u00ab,\u2039</string> <string name="more_keys_for_greater_than">\u2265,\u00bb,\u203a</string> - <string name="output_text_for_left_square_bracket">[</string> - <string name="output_text_for_right_square_bracket">]</string> - <string name="output_text_for_left_curly_bracket">{</string> - <string name="output_text_for_right_curly_bracket">}</string> + <integer name="keycode_for_left_square_bracket">0x005b</integer> + <integer name="keycode_for_right_square_bracket">0x005d</integer> + <integer name="keycode_for_left_curly_bracket">0x007b</integer> + <integer name="keycode_for_right_curly_bracket">0x007d</integer> <!-- The 4-more keys will be displayed in order of "3,1,2,4". --> <string name="more_keys_for_single_quote">\u2019,\u201a,\u2018,\u201b</string> <!-- Note: Neither DroidSans nor Roboto have a glyph for DOUBLE HIGH-REVERSED-9 QUOTATION MARK. --> diff --git a/java/res/values/keycodes.xml b/java/res/values/keycodes.xml index 2a91a3d6d..c85c02263 100644 --- a/java/res/values/keycodes.xml +++ b/java/res/values/keycodes.xml @@ -21,13 +21,14 @@ <resources> <!-- These code should be aligned with Keyboard.CODE_*. --> <integer name="key_tab">9</integer> - <integer name="key_return">10</integer> + <integer name="key_enter">10</integer> <integer name="key_space">32</integer> <integer name="key_shift">-1</integer> <integer name="key_switch_alpha_symbol">-2</integer> - <integer name="key_output_text">-4</integer> - <integer name="key_delete">-5</integer> - <integer name="key_settings">-6</integer> - <integer name="key_shortcut">-7</integer> + <integer name="key_output_text">-3</integer> + <integer name="key_delete">-4</integer> + <integer name="key_settings">-5</integer> + <integer name="key_shortcut">-6</integer> + <integer name="key_action_enter">-7</integer> <integer name="key_unspecified">-9</integer> </resources> diff --git a/java/res/values/strings.xml b/java/res/values/strings.xml index 95e50efb0..1e8b7db96 100644 --- a/java/res/values/strings.xml +++ b/java/res/values/strings.xml @@ -128,6 +128,8 @@ <string name="label_go_key">Go</string> <!-- Label for soft enter key when it performs NEXT action. Must be short to fit on key! [CHAR LIMIT=5] --> <string name="label_next_key">Next</string> + <!-- Label for soft enter key when it performs PREVIOUS action. Must be short to fit on key! [CHAR LIMIT=5] --> + <string name="label_previous_key">Prev</string> <!-- Label for soft enter key when it performs DONE action. Must be short to fit on key! [CHAR LIMIT=5] --> <string name="label_done_key">Done</string> <!-- Label for soft enter key when it performs SEND action. Must be short to fit on key! [CHAR LIMIT=5] --> diff --git a/java/res/values/styles.xml b/java/res/values/styles.xml index f69078288..b9e8b26a3 100644 --- a/java/res/values/styles.xml +++ b/java/res/values/styles.xml @@ -23,7 +23,7 @@ <item name="keyboardHeight">@dimen/keyboardHeight</item> <item name="maxKeyboardHeight">@fraction/maxKeyboardHeight</item> <item name="minKeyboardHeight">@fraction/minKeyboardHeight</item> - <item name="moreKeysTemplate">@xml/kbd_mini_keyboard_template</item> + <item name="moreKeysTemplate">@xml/kbd_more_keys_keyboard_template</item> <item name="keyboardTopPadding">@fraction/keyboard_top_padding</item> <item name="keyboardBottomPadding">@fraction/keyboard_bottom_padding</item> <item name="keyboardHorizontalEdgesPadding">@fraction/keyboard_horizontal_edges_padding</item> @@ -60,7 +60,7 @@ <item name="keyPreviewHeight">@dimen/key_preview_height</item> <item name="keyPreviewTextRatio">@fraction/key_preview_text_ratio</item> <item name="keyPreviewLingerTimeout">@integer/config_key_preview_linger_timeout</item> - <item name="moreKeysLayout">@layout/mini_keyboard</item> + <item name="moreKeysLayout">@layout/more_keys_keyboard</item> <item name="verticalCorrection">@dimen/keyboard_vertical_correction</item> <item name="shadowColor">#BB000000</item> <item name="shadowRadius">2.75</item> @@ -76,7 +76,7 @@ <item name="longPressShiftKeyTimeout">@integer/config_long_press_shift_key_timeout</item> <item name="longPressSpaceKeyTimeout">@integer/config_long_press_space_key_timeout</item> <item name="ignoreSpecialKeyTimeout">@integer/config_ignore_special_key_timeout</item> - <item name="showMiniKeyboardAtTouchedPoint">@bool/config_show_mini_keyboard_at_touched_point</item> + <item name="showMoreKeysKeyboardAtTouchedPoint">@bool/config_show_more_keys_keyboard_at_touched_point</item> </style> <style name="LatinKeyboardView" @@ -88,7 +88,7 @@ <item name="spacebarTextShadowColor">#80000000</item> </style> <style - name="MiniKeyboard" + name="MoreKeysKeyboard" parent="Keyboard" > <item name="keyboardTopPadding">0dip</item> @@ -96,16 +96,16 @@ <item name="horizontalGap">0dip</item> </style> <style - name="MiniKeyboardView" + name="MoreKeysKeyboardView" parent="KeyboardView" > <item name="keyBackground">@drawable/btn_keyboard_key_popup</item> - <item name="verticalCorrection">@dimen/mini_keyboard_vertical_correction</item> + <item name="verticalCorrection">@dimen/more_keys_keyboard_vertical_correction</item> </style> - <style name="MiniKeyboardPanelStyle"> + <style name="MoreKeysKeyboardPanelStyle"> <item name="android:background">@drawable/keyboard_popup_panel_background</item> - <item name="android:paddingLeft">@dimen/mini_keyboard_horizontal_edges_padding</item> - <item name="android:paddingRight">@dimen/mini_keyboard_horizontal_edges_padding</item> + <item name="android:paddingLeft">@dimen/more_keys_keyboard_horizontal_edges_padding</item> + <item name="android:paddingRight">@dimen/more_keys_keyboard_horizontal_edges_padding</item> </style> <style name="SuggestionsStripBackgroundStyle"> <item name="android:background">@drawable/keyboard_suggest_strip</item> @@ -127,7 +127,7 @@ </style> <style name="MoreSuggestionsViewStyle" - parent="MiniKeyboardView" + parent="MoreKeysKeyboardView" > </style> <style name="SuggestionBackgroundStyle"> @@ -196,7 +196,7 @@ <item name="spacebarTextShadowColor">#D0FFFFFF</item> </style> <style - name="MiniKeyboard.Stone" + name="MoreKeysKeyboard.Stone" parent="Keyboard.Stone" > <item name="keyboardTopPadding">0dip</item> @@ -204,8 +204,8 @@ <item name="horizontalGap">0dip</item> </style> <style - name="MiniKeyboardView.Stone" - parent="MiniKeyboardView" + name="MoreKeysKeyboardView.Stone" + parent="MoreKeysKeyboardView" > <item name="keyBackground">@drawable/btn_keyboard_key_stone</item> <item name="keyTextColor">#FF000000</item> @@ -263,7 +263,7 @@ <item name="spacebarTextShadowColor">#80000000</item> </style> <style - name="MiniKeyboard.Gingerbread" + name="MoreKeysKeyboard.Gingerbread" parent="Keyboard.Gingerbread" > <item name="keyboardTopPadding">0dip</item> @@ -271,8 +271,8 @@ <item name="horizontalGap">0dip</item> </style> <style - name="MiniKeyboardView.Gingerbread" - parent="MiniKeyboardView" + name="MoreKeysKeyboardView.Gingerbread" + parent="MoreKeysKeyboardView" > <item name="android:background">@null</item> </style> @@ -322,7 +322,7 @@ <item name="spacebarTextShadowColor">#80000000</item> </style> <style - name="MiniKeyboard.IceCreamSandwich" + name="MoreKeysKeyboard.IceCreamSandwich" parent="Keyboard.IceCreamSandwich" > <item name="keyboardTopPadding">0dip</item> @@ -330,16 +330,16 @@ <item name="horizontalGap">0dip</item> </style> <style - name="MiniKeyboardView.IceCreamSandwich" - parent="MiniKeyboardView" + name="MoreKeysKeyboardView.IceCreamSandwich" + parent="MoreKeysKeyboardView" > <item name="android:background">@null</item> <item name="keyBackground">@drawable/btn_keyboard_key_popup_ics</item> </style> - <style name="MiniKeyboardPanelStyle.IceCreamSandwich"> + <style name="MoreKeysKeyboardPanelStyle.IceCreamSandwich"> <item name="android:background">@drawable/keyboard_popup_panel_background_holo</item> - <item name="android:paddingLeft">@dimen/mini_keyboard_horizontal_edges_padding_ics</item> - <item name="android:paddingRight">@dimen/mini_keyboard_horizontal_edges_padding_ics</item> + <item name="android:paddingLeft">@dimen/more_keys_keyboard_horizontal_edges_padding_ics</item> + <item name="android:paddingRight">@dimen/more_keys_keyboard_horizontal_edges_padding_ics</item> </style> <style name="SuggestionsStripBackgroundStyle.IceCreamSandwich"> <item name="android:background">@drawable/keyboard_suggest_strip_holo</item> @@ -365,7 +365,7 @@ </style> <style name="MoreSuggestionsViewStyle.IceCreamSandwich" - parent="MiniKeyboardView.IceCreamSandwich" + parent="MoreKeysKeyboardView.IceCreamSandwich" > </style> <style name="SuggestionBackgroundStyle.IceCreamSandwich"> @@ -373,11 +373,11 @@ </style> <style name="SuggestionPreviewBackgroundStyle.IceCreamSandwich" - parent="MiniKeyboardPanelStyle.IceCreamSandwich" + parent="MoreKeysKeyboardPanelStyle.IceCreamSandwich" > </style> - <style name="MiniKeyboardAnimation"> - <item name="android:windowEnterAnimation">@anim/mini_keyboard_fadein</item> - <item name="android:windowExitAnimation">@anim/mini_keyboard_fadeout</item> + <style name="MoreKeysKeyboardAnimation"> + <item name="android:windowEnterAnimation">@anim/more_keys_keyboard_fadein</item> + <item name="android:windowExitAnimation">@anim/more_keys_keyboard_fadeout</item> </style> </resources> diff --git a/java/res/values/themes-basic-highcontrast.xml b/java/res/values/themes-basic-highcontrast.xml index 0062b2837..19df42ce1 100644 --- a/java/res/values/themes-basic-highcontrast.xml +++ b/java/res/values/themes-basic-highcontrast.xml @@ -19,9 +19,9 @@ <item name="keyboardStyle">@style/Keyboard.HighContrast</item> <item name="keyboardViewStyle">@style/KeyboardView.HighContrast</item> <item name="latinKeyboardViewStyle">@style/LatinKeyboardView.HighContrast</item> - <item name="miniKeyboardStyle">@style/MiniKeyboard</item> - <item name="miniKeyboardViewStyle">@style/MiniKeyboardView</item> - <item name="miniKeyboardPanelStyle">@style/MiniKeyboardPanelStyle</item> + <item name="moreKeysKeyboardStyle">@style/MoreKeysKeyboard</item> + <item name="moreKeysKeyboardViewStyle">@style/MoreKeysKeyboardView</item> + <item name="moreKeysKeyboardPanelStyle">@style/MoreKeysKeyboardPanelStyle</item> <item name="suggestionsStripBackgroundStyle">@style/SuggestionsStripBackgroundStyle</item> <item name="suggestionsViewStyle">@style/SuggestionsViewStyle</item> <item name="moreSuggestionsViewStyle">@style/MoreSuggestionsViewStyle</item> diff --git a/java/res/values/themes-basic.xml b/java/res/values/themes-basic.xml index 0786e08fc..5d477206d 100644 --- a/java/res/values/themes-basic.xml +++ b/java/res/values/themes-basic.xml @@ -19,9 +19,9 @@ <item name="keyboardStyle">@style/Keyboard</item> <item name="keyboardViewStyle">@style/KeyboardView</item> <item name="latinKeyboardViewStyle">@style/LatinKeyboardView</item> - <item name="miniKeyboardStyle">@style/MiniKeyboard</item> - <item name="miniKeyboardViewStyle">@style/MiniKeyboardView</item> - <item name="miniKeyboardPanelStyle">@style/MiniKeyboardPanelStyle</item> + <item name="moreKeysKeyboardStyle">@style/MoreKeysKeyboard</item> + <item name="moreKeysKeyboardViewStyle">@style/MoreKeysKeyboardView</item> + <item name="moreKeysKeyboardPanelStyle">@style/MoreKeysKeyboardPanelStyle</item> <item name="suggestionsStripBackgroundStyle">@style/SuggestionsStripBackgroundStyle</item> <item name="suggestionsViewStyle">@style/SuggestionsViewStyle</item> <item name="moreSuggestionsViewStyle">@style/MoreSuggestionsViewStyle</item> diff --git a/java/res/values/themes-gingerbread.xml b/java/res/values/themes-gingerbread.xml index 44338d821..a13979818 100644 --- a/java/res/values/themes-gingerbread.xml +++ b/java/res/values/themes-gingerbread.xml @@ -19,9 +19,9 @@ <item name="keyboardStyle">@style/Keyboard.Gingerbread</item> <item name="keyboardViewStyle">@style/KeyboardView.Gingerbread</item> <item name="latinKeyboardViewStyle">@style/LatinKeyboardView.Gingerbread</item> - <item name="miniKeyboardStyle">@style/MiniKeyboard.Gingerbread</item> - <item name="miniKeyboardViewStyle">@style/MiniKeyboardView.Gingerbread</item> - <item name="miniKeyboardPanelStyle">@style/MiniKeyboardPanelStyle</item> + <item name="moreKeysKeyboardStyle">@style/MoreKeysKeyboard.Gingerbread</item> + <item name="moreKeysKeyboardViewStyle">@style/MoreKeysKeyboardView.Gingerbread</item> + <item name="moreKeysKeyboardPanelStyle">@style/MoreKeysKeyboardPanelStyle</item> <item name="suggestionsStripBackgroundStyle">@style/SuggestionsStripBackgroundStyle</item> <item name="suggestionsViewStyle">@style/SuggestionsViewStyle</item> <item name="moreSuggestionsViewStyle">@style/MoreSuggestionsViewStyle</item> diff --git a/java/res/values/themes-ics.xml b/java/res/values/themes-ics.xml index dbc8f32e3..e6fd4f451 100644 --- a/java/res/values/themes-ics.xml +++ b/java/res/values/themes-ics.xml @@ -19,9 +19,9 @@ <item name="keyboardStyle">@style/Keyboard.IceCreamSandwich</item> <item name="keyboardViewStyle">@style/KeyboardView.IceCreamSandwich</item> <item name="latinKeyboardViewStyle">@style/LatinKeyboardView.IceCreamSandwich</item> - <item name="miniKeyboardStyle">@style/MiniKeyboard.IceCreamSandwich</item> - <item name="miniKeyboardViewStyle">@style/MiniKeyboardView.IceCreamSandwich</item> - <item name="miniKeyboardPanelStyle">@style/MiniKeyboardPanelStyle.IceCreamSandwich</item> + <item name="moreKeysKeyboardStyle">@style/MoreKeysKeyboard.IceCreamSandwich</item> + <item name="moreKeysKeyboardViewStyle">@style/MoreKeysKeyboardView.IceCreamSandwich</item> + <item name="moreKeysKeyboardPanelStyle">@style/MoreKeysKeyboardPanelStyle.IceCreamSandwich</item> <item name="suggestionsStripBackgroundStyle">@style/SuggestionsStripBackgroundStyle.IceCreamSandwich</item> <item name="suggestionsViewStyle">@style/SuggestionsViewStyle.IceCreamSandwich</item> <item name="moreSuggestionsViewStyle">@style/MoreSuggestionsViewStyle.IceCreamSandwich</item> diff --git a/java/res/values/themes-stone-bold.xml b/java/res/values/themes-stone-bold.xml index 60f130d59..47de99e47 100644 --- a/java/res/values/themes-stone-bold.xml +++ b/java/res/values/themes-stone-bold.xml @@ -19,9 +19,9 @@ <item name="keyboardStyle">@style/Keyboard.Stone.Bold</item> <item name="keyboardViewStyle">@style/KeyboardView.Stone.Bold</item> <item name="latinKeyboardViewStyle">@style/LatinKeyboardView.Stone.Bold</item> - <item name="miniKeyboardStyle">@style/MiniKeyboard.Stone</item> - <item name="miniKeyboardViewStyle">@style/MiniKeyboardView.Stone</item> - <item name="miniKeyboardPanelStyle">@style/MiniKeyboardPanelStyle</item> + <item name="moreKeysKeyboardStyle">@style/MoreKeysKeyboard.Stone</item> + <item name="moreKeysKeyboardViewStyle">@style/MoreKeysKeyboardView.Stone</item> + <item name="moreKeysKeyboardPanelStyle">@style/MoreKeysKeyboardPanelStyle</item> <item name="suggestionsStripBackgroundStyle">@style/SuggestionsStripBackgroundStyle</item> <item name="suggestionsViewStyle">@style/SuggestionsViewStyle</item> <item name="moreSuggestionsViewStyle">@style/MoreSuggestionsViewStyle</item> diff --git a/java/res/values/themes-stone.xml b/java/res/values/themes-stone.xml index 9aaca3a6c..a0b39e3e6 100644 --- a/java/res/values/themes-stone.xml +++ b/java/res/values/themes-stone.xml @@ -19,9 +19,9 @@ <item name="keyboardStyle">@style/Keyboard.Stone</item> <item name="keyboardViewStyle">@style/KeyboardView.Stone</item> <item name="latinKeyboardViewStyle">@style/LatinKeyboardView.Stone</item> - <item name="miniKeyboardStyle">@style/MiniKeyboard.Stone</item> - <item name="miniKeyboardViewStyle">@style/MiniKeyboardView.Stone</item> - <item name="miniKeyboardPanelStyle">@style/MiniKeyboardPanelStyle</item> + <item name="moreKeysKeyboardStyle">@style/MoreKeysKeyboard.Stone</item> + <item name="moreKeysKeyboardViewStyle">@style/MoreKeysKeyboardView.Stone</item> + <item name="moreKeysKeyboardPanelStyle">@style/MoreKeysKeyboardPanelStyle</item> <item name="suggestionsStripBackgroundStyle">@style/SuggestionsStripBackgroundStyle</item> <item name="suggestionsViewStyle">@style/SuggestionsViewStyle</item> <item name="moreSuggestionsViewStyle">@style/MoreSuggestionsViewStyle</item> diff --git a/java/res/xml-sw600dp-land/kbd_mini_keyboard_template.xml b/java/res/xml-sw600dp-land/kbd_more_keys_keyboard_template.xml index 8272e02f0..4d8b446a2 100644 --- a/java/res/xml-sw600dp-land/kbd_mini_keyboard_template.xml +++ b/java/res/xml-sw600dp-land/kbd_more_keys_keyboard_template.xml @@ -21,6 +21,6 @@ <Keyboard xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin" latin:keyWidth="5%p" latin:rowHeight="@dimen/popup_key_height" - style="?attr/miniKeyboardStyle" + style="?attr/moreKeysKeyboardStyle" > </Keyboard> diff --git a/java/res/xml-sw600dp/kbd_mini_keyboard_template.xml b/java/res/xml-sw600dp/kbd_more_keys_keyboard_template.xml index 0d5795f6a..d90a5884e 100644 --- a/java/res/xml-sw600dp/kbd_mini_keyboard_template.xml +++ b/java/res/xml-sw600dp/kbd_more_keys_keyboard_template.xml @@ -21,6 +21,6 @@ <Keyboard xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin" latin:keyWidth="8%p" latin:rowHeight="@dimen/popup_key_height" - style="?attr/miniKeyboardStyle" + style="?attr/moreKeysKeyboardStyle" > </Keyboard> diff --git a/java/res/xml-sw600dp/key_styles_common.xml b/java/res/xml-sw600dp/key_styles_common.xml index b55414786..e524aa381 100644 --- a/java/res/xml-sw600dp/key_styles_common.xml +++ b/java/res/xml-sw600dp/key_styles_common.xml @@ -89,12 +89,8 @@ latin:keyIcon="iconDeleteKey" latin:keyActionFlags="isRepeatable|noKeyPreview" latin:backgroundType="functional" /> - <key-style - latin:styleName="returnKeyStyle" - latin:code="@integer/key_return" - latin:keyIcon="iconReturnKey" - latin:keyActionFlags="noKeyPreview" - latin:backgroundType="functional" /> + <include + latin:keyboardLayout="@xml/key_styles_enter_tablet" /> <key-style latin:styleName="spaceKeyStyle" latin:code="@integer/key_space" @@ -115,6 +111,7 @@ latin:code="@integer/key_shortcut" latin:keyIcon="iconShortcutKey" latin:keyIconDisabled="iconDisabledShortcutKey" + latin:keyLabelFlags="preserveCase" latin:keyActionFlags="noKeyPreview|altCodeWhileTyping" latin:parentStyle="f2PopupStyle" /> <key-style diff --git a/java/res/xml-sw600dp/row_qwerty2.xml b/java/res/xml-sw600dp/row_qwerty2.xml index 52a948f20..cabb9cb4a 100644 --- a/java/res/xml-sw600dp/row_qwerty2.xml +++ b/java/res/xml-sw600dp/row_qwerty2.xml @@ -50,7 +50,7 @@ latin:keyLabel="l" latin:moreKeys="@string/more_keys_for_l" /> <Key - latin:keyStyle="returnKeyStyle" + latin:keyStyle="enterKeyStyle" latin:keyXPos="-14.6%p" latin:keyWidth="fillBoth" /> </Row> diff --git a/java/res/xml-sw600dp/rows_arabic.xml b/java/res/xml-sw600dp/rows_arabic.xml index 8d4901be3..1f03968ee 100644 --- a/java/res/xml-sw600dp/rows_arabic.xml +++ b/java/res/xml-sw600dp/rows_arabic.xml @@ -138,7 +138,7 @@ <Key latin:keyLabel="ط" /> <Key - latin:keyStyle="returnKeyStyle" + latin:keyStyle="enterKeyStyle" latin:keyXPos="-14.6%p" latin:keyWidth="fillBoth" /> </Row> diff --git a/java/res/xml-sw600dp/rows_azerty.xml b/java/res/xml-sw600dp/rows_azerty.xml index aabe6b0e8..5c799623d 100644 --- a/java/res/xml-sw600dp/rows_azerty.xml +++ b/java/res/xml-sw600dp/rows_azerty.xml @@ -90,7 +90,7 @@ <Key latin:keyLabel="m" /> <Key - latin:keyStyle="returnKeyStyle" + latin:keyStyle="enterKeyStyle" latin:keyXPos="-14.6%p" latin:keyWidth="fillBoth" /> </Row> diff --git a/java/res/xml-sw600dp/rows_bulgarian.xml b/java/res/xml-sw600dp/rows_bulgarian.xml index b464158f0..7a23ce9ff 100644 --- a/java/res/xml-sw600dp/rows_bulgarian.xml +++ b/java/res/xml-sw600dp/rows_bulgarian.xml @@ -80,7 +80,7 @@ <Key latin:keyLabel="ь" /> <Key - latin:keyStyle="returnKeyStyle" + latin:keyStyle="enterKeyStyle" latin:keyWidth="fillBoth" /> </Row> <Row diff --git a/java/res/xml-sw600dp/rows_hebrew.xml b/java/res/xml-sw600dp/rows_hebrew.xml index 71fb46376..812e2d6e0 100644 --- a/java/res/xml-sw600dp/rows_hebrew.xml +++ b/java/res/xml-sw600dp/rows_hebrew.xml @@ -106,7 +106,7 @@ latin:keyLabel="ץ" latin:moreKeys="ץ׳" /> <Key - latin:keyStyle="returnKeyStyle" + latin:keyStyle="enterKeyStyle" latin:keyXPos="-10.400%p" latin:keyWidth="fillBoth" /> </Row> diff --git a/java/res/xml-sw600dp/rows_number_normal.xml b/java/res/xml-sw600dp/rows_number_normal.xml index f7eb9505a..3141bbdc7 100644 --- a/java/res/xml-sw600dp/rows_number_normal.xml +++ b/java/res/xml-sw600dp/rows_number_normal.xml @@ -78,7 +78,7 @@ latin:keyLabel="6" latin:keyStyle="numKeyStyle" /> <Key - latin:keyStyle="returnKeyStyle" + latin:keyStyle="enterKeyStyle" latin:keyXPos="-11.00%p" latin:keyWidth="fillRight" /> </Row> diff --git a/java/res/xml-sw600dp/rows_number_password.xml b/java/res/xml-sw600dp/rows_number_password.xml index c3f21e106..0a71f74d7 100644 --- a/java/res/xml-sw600dp/rows_number_password.xml +++ b/java/res/xml-sw600dp/rows_number_password.xml @@ -47,7 +47,7 @@ <Key latin:keyStyle="num6KeyStyle" /> <Key - latin:keyStyle="returnKeyStyle" + latin:keyStyle="enterKeyStyle" latin:keyXPos="-11.00%p" latin:keyWidth="fillRight" /> </Row> diff --git a/java/res/xml-sw600dp/rows_phone.xml b/java/res/xml-sw600dp/rows_phone.xml index fe8511988..d61b4b2ad 100644 --- a/java/res/xml-sw600dp/rows_phone.xml +++ b/java/res/xml-sw600dp/rows_phone.xml @@ -75,7 +75,7 @@ <Key latin:keyStyle="num6KeyStyle" /> <Key - latin:keyStyle="returnKeyStyle" + latin:keyStyle="enterKeyStyle" latin:keyXPos="-11.00%p" latin:keyWidth="fillRight" /> </Row> diff --git a/java/res/xml-sw600dp/rows_scandinavian.xml b/java/res/xml-sw600dp/rows_scandinavian.xml index 5ecb7d242..912c40658 100644 --- a/java/res/xml-sw600dp/rows_scandinavian.xml +++ b/java/res/xml-sw600dp/rows_scandinavian.xml @@ -95,7 +95,7 @@ latin:keyLabel="@string/keylabel_for_scandinavia_row2_11" latin:moreKeys="@string/more_keys_for_scandinavia_row2_11" /> <Key - latin:keyStyle="returnKeyStyle" + latin:keyStyle="enterKeyStyle" latin:keyXPos="-14.6%p" latin:keyWidth="fillBoth" /> </Row> diff --git a/java/res/xml-sw600dp/rows_serbian.xml b/java/res/xml-sw600dp/rows_serbian.xml index c21fd4cb7..ea4bb1466 100644 --- a/java/res/xml-sw600dp/rows_serbian.xml +++ b/java/res/xml-sw600dp/rows_serbian.xml @@ -80,7 +80,7 @@ <Key latin:keyLabel="ћ" /> <Key - latin:keyStyle="returnKeyStyle" + latin:keyStyle="enterKeyStyle" latin:keyXPos="-14.6%p" latin:keyWidth="fillBoth" /> </Row> diff --git a/java/res/xml-sw600dp/rows_slavic.xml b/java/res/xml-sw600dp/rows_slavic.xml index 889a438b5..020ea16a2 100644 --- a/java/res/xml-sw600dp/rows_slavic.xml +++ b/java/res/xml-sw600dp/rows_slavic.xml @@ -87,7 +87,7 @@ <Key latin:keyLabel="э" /> <Key - latin:keyStyle="returnKeyStyle" + latin:keyStyle="enterKeyStyle" latin:keyXPos="-14.6%p" latin:keyWidth="fillBoth" /> </Row> diff --git a/java/res/xml-sw600dp/rows_spanish.xml b/java/res/xml-sw600dp/rows_spanish.xml index b516bebfb..2ab94e8c5 100644 --- a/java/res/xml-sw600dp/rows_spanish.xml +++ b/java/res/xml-sw600dp/rows_spanish.xml @@ -56,7 +56,7 @@ <Key latin:keyLabel="ñ" /> <Key - latin:keyStyle="returnKeyStyle" + latin:keyStyle="enterKeyStyle" latin:keyXPos="-14.6%p" latin:keyWidth="fillBoth" /> </Row> diff --git a/java/res/xml-sw600dp/rows_symbols.xml b/java/res/xml-sw600dp/rows_symbols.xml index c2dfe2f82..ce6e539a5 100644 --- a/java/res/xml-sw600dp/rows_symbols.xml +++ b/java/res/xml-sw600dp/rows_symbols.xml @@ -98,7 +98,7 @@ <include latin:keyboardLayout="@xml/keys_parentheses" /> <Key - latin:keyStyle="returnKeyStyle" + latin:keyStyle="enterKeyStyle" latin:keyXPos="-14.6%p" latin:keyWidth="fillBoth" /> </Row> diff --git a/java/res/xml-sw600dp/rows_symbols_shift.xml b/java/res/xml-sw600dp/rows_symbols_shift.xml index 6a640c06b..a10d1740c 100644 --- a/java/res/xml-sw600dp/rows_symbols_shift.xml +++ b/java/res/xml-sw600dp/rows_symbols_shift.xml @@ -80,7 +80,7 @@ <include latin:keyboardLayout="@xml/keys_curly_brackets" /> <Key - latin:keyStyle="returnKeyStyle" + latin:keyStyle="enterKeyStyle" latin:keyXPos="-14.6%p" latin:keyWidth="fillBoth" /> </Row> diff --git a/java/res/xml-sw768dp-land/kbd_mini_keyboard_template.xml b/java/res/xml-sw768dp-land/kbd_more_keys_keyboard_template.xml index 85e864a6c..f593fa944 100644 --- a/java/res/xml-sw768dp-land/kbd_mini_keyboard_template.xml +++ b/java/res/xml-sw768dp-land/kbd_more_keys_keyboard_template.xml @@ -21,6 +21,6 @@ <Keyboard xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin" latin:keyWidth="3.5%p" latin:rowHeight="@dimen/popup_key_height" - style="?attr/miniKeyboardStyle" + style="?attr/moreKeysKeyboardStyle" > </Keyboard> diff --git a/java/res/xml-sw768dp/kbd_mini_keyboard_template.xml b/java/res/xml-sw768dp/kbd_more_keys_keyboard_template.xml index 409c60556..f89a0a673 100644 --- a/java/res/xml-sw768dp/kbd_mini_keyboard_template.xml +++ b/java/res/xml-sw768dp/kbd_more_keys_keyboard_template.xml @@ -21,6 +21,6 @@ <Keyboard xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin" latin:keyWidth="5.0%p" latin:rowHeight="@dimen/popup_key_height" - style="?attr/miniKeyboardStyle" + style="?attr/moreKeysKeyboardStyle" > </Keyboard> diff --git a/java/res/xml-sw768dp/key_styles_common.xml b/java/res/xml-sw768dp/key_styles_common.xml index 0d2ac5d12..07bdd7b18 100644 --- a/java/res/xml-sw768dp/key_styles_common.xml +++ b/java/res/xml-sw768dp/key_styles_common.xml @@ -71,12 +71,8 @@ latin:keyIcon="iconDeleteKey" latin:keyActionFlags="isRepeatable|noKeyPreview" latin:backgroundType="functional" /> - <key-style - latin:styleName="returnKeyStyle" - latin:code="@integer/key_return" - latin:keyIcon="iconReturnKey" - latin:keyActionFlags="noKeyPreview" - latin:backgroundType="functional" /> + <include + latin:keyboardLayout="@xml/key_styles_enter_tablet" /> <key-style latin:styleName="spaceKeyStyle" latin:code="@integer/key_space" @@ -97,6 +93,7 @@ latin:code="@integer/key_shortcut" latin:keyIcon="iconShortcutKey" latin:keyIconDisabled="iconDisabledShortcutKey" + latin:keyLabelFlags="preserveCase" latin:keyActionFlags="noKeyPreview|altCodeWhileTyping" latin:backgroundType="functional" /> <key-style diff --git a/java/res/xml-sw768dp/row_qwerty2.xml b/java/res/xml-sw768dp/row_qwerty2.xml index 1129ecdba..d348041fd 100644 --- a/java/res/xml-sw768dp/row_qwerty2.xml +++ b/java/res/xml-sw768dp/row_qwerty2.xml @@ -53,7 +53,7 @@ latin:keyLabel="l" latin:moreKeys="@string/more_keys_for_l" /> <Key - latin:keyStyle="returnKeyStyle" + latin:keyStyle="enterKeyStyle" latin:keyXPos="-15.704%p" latin:keyWidth="fillBoth" /> </Row> diff --git a/java/res/xml-sw768dp/rows_arabic.xml b/java/res/xml-sw768dp/rows_arabic.xml index 0e4aee4eb..baced66c3 100644 --- a/java/res/xml-sw768dp/rows_arabic.xml +++ b/java/res/xml-sw768dp/rows_arabic.xml @@ -144,7 +144,7 @@ <Key latin:keyLabel="ط" /> <Key - latin:keyStyle="returnKeyStyle" + latin:keyStyle="enterKeyStyle" latin:keyXPos="-9.375%p" latin:keyWidth="fillBoth" /> </Row> diff --git a/java/res/xml-sw768dp/rows_azerty.xml b/java/res/xml-sw768dp/rows_azerty.xml index b9ef89822..6023e984b 100644 --- a/java/res/xml-sw768dp/rows_azerty.xml +++ b/java/res/xml-sw768dp/rows_azerty.xml @@ -97,7 +97,7 @@ <Key latin:keyLabel="m" /> <Key - latin:keyStyle="returnKeyStyle" + latin:keyStyle="enterKeyStyle" latin:keyXPos="-15.704%p" latin:keyWidth="fillBoth" /> </Row> diff --git a/java/res/xml-sw768dp/rows_bulgarian.xml b/java/res/xml-sw768dp/rows_bulgarian.xml index 57f39b420..d67a0d1fa 100644 --- a/java/res/xml-sw768dp/rows_bulgarian.xml +++ b/java/res/xml-sw768dp/rows_bulgarian.xml @@ -86,7 +86,7 @@ <Key latin:keyLabel="ь" /> <Key - latin:keyStyle="returnKeyStyle" + latin:keyStyle="enterKeyStyle" latin:keyWidth="fillBoth" /> </Row> <Row diff --git a/java/res/xml-sw768dp/rows_hebrew.xml b/java/res/xml-sw768dp/rows_hebrew.xml index 755afc86d..61c5eae90 100644 --- a/java/res/xml-sw768dp/rows_hebrew.xml +++ b/java/res/xml-sw768dp/rows_hebrew.xml @@ -111,7 +111,7 @@ latin:keyLabel="ץ" latin:moreKeys="ץ׳" /> <Key - latin:keyStyle="returnKeyStyle" + latin:keyStyle="enterKeyStyle" latin:keyXPos="-10.400%p" latin:keyWidth="fillBoth" /> </Row> diff --git a/java/res/xml-sw768dp/rows_number_normal.xml b/java/res/xml-sw768dp/rows_number_normal.xml index 0e80e8043..cf947abd2 100644 --- a/java/res/xml-sw768dp/rows_number_normal.xml +++ b/java/res/xml-sw768dp/rows_number_normal.xml @@ -80,7 +80,7 @@ latin:keyLabel="6" latin:keyStyle="numKeyStyle" /> <Key - latin:keyStyle="returnKeyStyle" + latin:keyStyle="enterKeyStyle" latin:keyXPos="-11.172%p" latin:keyWidth="fillRight" /> </Row> diff --git a/java/res/xml-sw768dp/rows_number_password.xml b/java/res/xml-sw768dp/rows_number_password.xml index 77fb9caac..8acfac6ff 100644 --- a/java/res/xml-sw768dp/rows_number_password.xml +++ b/java/res/xml-sw768dp/rows_number_password.xml @@ -49,7 +49,7 @@ <Key latin:keyStyle="num6KeyStyle" /> <Key - latin:keyStyle="returnKeyStyle" + latin:keyStyle="enterKeyStyle" latin:keyXPos="-11.172%p" latin:keyWidth="fillRight" /> </Row> diff --git a/java/res/xml-sw768dp/rows_phone.xml b/java/res/xml-sw768dp/rows_phone.xml index 789c02c42..0404bb1fb 100644 --- a/java/res/xml-sw768dp/rows_phone.xml +++ b/java/res/xml-sw768dp/rows_phone.xml @@ -78,7 +78,7 @@ <Key latin:keyStyle="num6KeyStyle" /> <Key - latin:keyStyle="returnKeyStyle" + latin:keyStyle="enterKeyStyle" latin:keyXPos="-11.172%p" latin:keyWidth="fillRight" /> </Row> diff --git a/java/res/xml-sw768dp/rows_scandinavian.xml b/java/res/xml-sw768dp/rows_scandinavian.xml index 9e5ad148f..437316699 100644 --- a/java/res/xml-sw768dp/rows_scandinavian.xml +++ b/java/res/xml-sw768dp/rows_scandinavian.xml @@ -102,7 +102,7 @@ latin:keyLabel="@string/keylabel_for_scandinavia_row2_11" latin:moreKeys="@string/more_keys_for_scandinavia_row2_11" /> <Key - latin:keyStyle="returnKeyStyle" + latin:keyStyle="enterKeyStyle" latin:keyXPos="-9.375%p" latin:keyWidth="fillBoth" /> </Row> diff --git a/java/res/xml-sw768dp/rows_serbian.xml b/java/res/xml-sw768dp/rows_serbian.xml index 2e9e1405d..665975583 100644 --- a/java/res/xml-sw768dp/rows_serbian.xml +++ b/java/res/xml-sw768dp/rows_serbian.xml @@ -114,7 +114,7 @@ <include latin:keyboardLayout="@xml/keys_comma_period" /> <Key - latin:keyStyle="returnKeyStyle" + latin:keyStyle="enterKeyStyle" latin:keyXPos="-13.750%p" latin:keyWidth="fillRight" /> </Row> diff --git a/java/res/xml-sw768dp/rows_slavic.xml b/java/res/xml-sw768dp/rows_slavic.xml index 86b4498ff..58d5a75fc 100644 --- a/java/res/xml-sw768dp/rows_slavic.xml +++ b/java/res/xml-sw768dp/rows_slavic.xml @@ -92,7 +92,7 @@ <Key latin:keyLabel="э" /> <Key - latin:keyStyle="returnKeyStyle" + latin:keyStyle="enterKeyStyle" latin:keyXPos="-9.375%p" latin:keyWidth="fillBoth" /> </Row> diff --git a/java/res/xml-sw768dp/rows_spanish.xml b/java/res/xml-sw768dp/rows_spanish.xml index f626a451f..864c435a2 100644 --- a/java/res/xml-sw768dp/rows_spanish.xml +++ b/java/res/xml-sw768dp/rows_spanish.xml @@ -59,7 +59,7 @@ <Key latin:keyLabel="ñ" /> <Key - latin:keyStyle="returnKeyStyle" + latin:keyStyle="enterKeyStyle" latin:keyXPos="-15.704%p" latin:keyWidth="fillBoth" /> </Row> diff --git a/java/res/xml-sw768dp/rows_symbols.xml b/java/res/xml-sw768dp/rows_symbols.xml index 2ba935724..c199ae404 100644 --- a/java/res/xml-sw768dp/rows_symbols.xml +++ b/java/res/xml-sw768dp/rows_symbols.xml @@ -105,7 +105,7 @@ <include latin:keyboardLayout="@xml/keys_parentheses" /> <Key - latin:keyStyle="returnKeyStyle" + latin:keyStyle="enterKeyStyle" latin:keyXPos="-15.704%p" latin:keyWidth="fillBoth" /> </Row> diff --git a/java/res/xml-sw768dp/rows_symbols_shift.xml b/java/res/xml-sw768dp/rows_symbols_shift.xml index aba9c236d..e88f78633 100644 --- a/java/res/xml-sw768dp/rows_symbols_shift.xml +++ b/java/res/xml-sw768dp/rows_symbols_shift.xml @@ -87,7 +87,7 @@ <include latin:keyboardLayout="@xml/keys_curly_brackets" /> <Key - latin:keyStyle="returnKeyStyle" + latin:keyStyle="enterKeyStyle" latin:keyXPos="-15.704%p" latin:keyWidth="fillBoth" /> </Row> diff --git a/java/res/xml/kbd_mini_keyboard_template.xml b/java/res/xml/kbd_more_keys_keyboard_template.xml index ad6cf51fe..8e977c5ad 100644 --- a/java/res/xml/kbd_mini_keyboard_template.xml +++ b/java/res/xml/kbd_more_keys_keyboard_template.xml @@ -21,6 +21,6 @@ <Keyboard xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin" latin:keyWidth="10%p" latin:rowHeight="@dimen/popup_key_height" - style="?attr/miniKeyboardStyle" + style="?attr/moreKeysKeyboardStyle" > </Keyboard> diff --git a/java/res/xml/key_styles_common.xml b/java/res/xml/key_styles_common.xml index ab9bc4672..0e31bcb31 100644 --- a/java/res/xml/key_styles_common.xml +++ b/java/res/xml/key_styles_common.xml @@ -98,99 +98,8 @@ latin:keyIcon="iconDeleteKey" latin:keyActionFlags="isRepeatable|noKeyPreview" latin:backgroundType="functional" /> - <!-- Return key style --> - <key-style - latin:styleName="defaultReturnKeyStyle" - latin:code="@integer/key_return" - latin:keyIcon="iconReturnKey" - latin:keyActionFlags="noKeyPreview" - latin:backgroundType="functional" /> - <switch> - <case - latin:mode="im" - > - <!-- Smiley key. --> - <switch> - <case - latin:keyboardSetElement="alphabetManualShifted|alphabetShiftLockShifted" - > - <key-style - latin:styleName="returnKeyStyle" - latin:parentStyle="defaultReturnKeyStyle" /> - </case> - <default> - <key-style - latin:styleName="returnKeyStyle" - latin:keyLabel=":-)" - latin:keyOutputText=":-) " - latin:keyLabelFlags="hasPopupHint|preserveCase" - latin:moreKeys="@string/more_keys_for_smiley" - latin:maxMoreKeysColumn="5" - latin:backgroundType="functional" /> - </default> - </switch> - </case> - <case - latin:imeAction="actionGo" - > - <key-style - latin:styleName="returnKeyStyle" - latin:code="@integer/key_return" - latin:keyLabel="@string/label_go_key" - latin:keyLabelFlags="autoXScale|preserveCase" - latin:keyActionFlags="noKeyPreview" - latin:backgroundType="action" /> - </case> - <case - latin:imeAction="actionNext" - > - <key-style - latin:styleName="returnKeyStyle" - latin:code="@integer/key_return" - latin:keyLabel="@string/label_next_key" - latin:keyLabelFlags="autoXScale|preserveCase" - latin:keyActionFlags="noKeyPreview" - latin:backgroundType="action" /> - </case> - <case - latin:imeAction="actionDone" - > - <key-style - latin:styleName="returnKeyStyle" - latin:code="@integer/key_return" - latin:keyLabel="@string/label_done_key" - latin:keyLabelFlags="autoXScale|preserveCase" - latin:keyActionFlags="noKeyPreview" - latin:backgroundType="action" /> - </case> - <case - latin:imeAction="actionSend" - > - <key-style - latin:styleName="returnKeyStyle" - latin:code="@integer/key_return" - latin:keyLabel="@string/label_send_key" - latin:keyLabelFlags="autoXScale|preserveCase" - latin:keyActionFlags="noKeyPreview" - latin:backgroundType="action" /> - </case> - <case - latin:imeAction="actionSearch" - > - <key-style - latin:styleName="returnKeyStyle" - latin:code="@integer/key_return" - latin:keyIcon="iconSearchKey" - latin:keyLabelFlags="autoXScale" - latin:keyActionFlags="noKeyPreview" - latin:backgroundType="action" /> - </case> - <default> - <key-style - latin:styleName="returnKeyStyle" - latin:parentStyle="defaultReturnKeyStyle" /> - </default> - </switch> + <include + latin:keyboardLayout="@xml/key_styles_enter_phone" /> <key-style latin:styleName="spaceKeyStyle" latin:code="@integer/key_space" @@ -201,6 +110,7 @@ latin:code="@integer/key_shortcut" latin:keyIcon="iconShortcutKey" latin:keyIconDisabled="iconDisabledShortcutKey" + latin:keyLabelFlags="preserveCase" latin:keyActionFlags="noKeyPreview|altCodeWhileTyping" latin:altCode="@integer/key_space" latin:parentStyle="f1PopupStyle" /> @@ -278,6 +188,6 @@ latin:keyHintLabel="@string/keyhintlabel_for_punctuation" latin:keyLabelFlags="hasPopupHint|preserveCase" latin:moreKeys="@string/more_keys_for_punctuation" - latin:maxMoreKeysColumn="@integer/mini_keyboard_column_for_punctuation" + latin:maxMoreKeysColumn="@integer/more_keys_keyboard_column_for_punctuation" latin:backgroundType="functional" /> </merge> diff --git a/java/res/xml/key_styles_enter_phone.xml b/java/res/xml/key_styles_enter_phone.xml new file mode 100644 index 000000000..6af81fb7b --- /dev/null +++ b/java/res/xml/key_styles_enter_phone.xml @@ -0,0 +1,124 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/* +** +** 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. +*/ +--> + +<merge + xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin" +> + <!-- Enter key style --> + <key-style + latin:styleName="defaultEnterKeyStyle" + latin:code="@integer/key_enter" + latin:keyIcon="iconReturnKey" + latin:keyLabelFlags="autoXScale|preserveCase" + latin:keyActionFlags="noKeyPreview" + latin:backgroundType="functional" /> + <key-style + latin:styleName="defaultActionKeyStyle" + latin:code="@integer/key_action_enter" + latin:keyIcon="iconUndefined" + latin:backgroundType="action" + latin:parentStyle="defaultEnterKeyStyle" /> + <switch> + <!-- Shift + Enter in textMultiLine field. --> + <case + latin:isMultiLine="true" + latin:keyboardSetElement="alphabetManualShifted|alphabetShiftLockShifted" + > + <key-style + latin:styleName="enterKeyStyle" + latin:parentStyle="defaultEnterKeyStyle" /> + </case> + <!-- Smiley in textShortMessage field. --> + <case + latin:mode="im" + > + <key-style + latin:styleName="enterKeyStyle" + latin:keyLabel=":-)" + latin:keyOutputText=":-) " + latin:keyLabelFlags="hasPopupHint" + latin:moreKeys="@string/more_keys_for_smiley" + latin:maxMoreKeysColumn="5" + latin:backgroundType="functional" /> + </case> + <case + latin:imeAction="actionGo" + > + <key-style + latin:styleName="enterKeyStyle" + latin:keyLabel="@string/label_go_key" + latin:parentStyle="defaultActionKeyStyle" /> + </case> + <case + latin:imeAction="actionNext" + > + <key-style + latin:styleName="enterKeyStyle" + latin:keyLabel="@string/label_next_key" + latin:parentStyle="defaultActionKeyStyle" /> + </case> + <case + latin:imeAction="actionPrevious" + > + <key-style + latin:styleName="enterKeyStyle" + latin:keyLabel="@string/label_previous_key" + latin:parentStyle="defaultActionKeyStyle" /> + </case> + <case + latin:imeAction="actionDone" + > + <key-style + latin:styleName="enterKeyStyle" + latin:keyLabel="@string/label_done_key" + latin:parentStyle="defaultActionKeyStyle" /> + </case> + <case + latin:imeAction="actionSend" + > + <key-style + latin:styleName="enterKeyStyle" + latin:keyLabel="@string/label_send_key" + latin:parentStyle="defaultActionKeyStyle" /> + </case> + <case + latin:imeAction="actionSearch" + > + <key-style + latin:styleName="enterKeyStyle" + latin:keyIcon="iconSearchKey" + latin:parentStyle="defaultActionKeyStyle" /> + </case> + <case + latin:imeAction="actionCustomLabel" + > + <key-style + latin:styleName="enterKeyStyle" + latin:keyLabelFlags="fromCustomActionLabel" + latin:parentStyle="defaultActionKeyStyle" /> + </case> + <!-- imeAction is either actionNone or actionUnspecified. --> + <default> + <key-style + latin:styleName="enterKeyStyle" + latin:parentStyle="defaultEnterKeyStyle" /> + </default> + </switch> +</merge> diff --git a/java/res/xml/key_styles_enter_tablet.xml b/java/res/xml/key_styles_enter_tablet.xml new file mode 100644 index 000000000..702089181 --- /dev/null +++ b/java/res/xml/key_styles_enter_tablet.xml @@ -0,0 +1,111 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/* +** +** 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. +*/ +--> + +<merge + xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin" +> + <!-- Enter key style --> + <key-style + latin:styleName="defaultEnterKeyStyle" + latin:code="@integer/key_enter" + latin:keyIcon="iconReturnKey" + latin:keyLabelFlags="autoXScale|preserveCase" + latin:keyActionFlags="noKeyPreview" + latin:backgroundType="functional" /> + <key-style + latin:styleName="defaultActionKeyStyle" + latin:code="@integer/key_action_enter" + latin:keyIcon="iconUndefined" + latin:backgroundType="action" + latin:parentStyle="defaultEnterKeyStyle" /> + <switch> + <!-- Shift + Enter in textMultiLine field. --> + <case + latin:isMultiLine="true" + latin:keyboardSetElement="alphabetManualShifted|alphabetShiftLockShifted" + > + <key-style + latin:styleName="enterKeyStyle" + latin:parentStyle="defaultEnterKeyStyle" /> + </case> + <case + latin:imeAction="actionGo" + > + <key-style + latin:styleName="enterKeyStyle" + latin:keyLabel="@string/label_go_key" + latin:parentStyle="defaultActionKeyStyle" /> + </case> + <case + latin:imeAction="actionNext" + > + <key-style + latin:styleName="enterKeyStyle" + latin:keyLabel="@string/label_next_key" + latin:parentStyle="defaultActionKeyStyle" /> + </case> + <case + latin:imeAction="actionPrevious" + > + <key-style + latin:styleName="enterKeyStyle" + latin:keyLabel="@string/label_previous_key" + latin:parentStyle="defaultActionKeyStyle" /> + </case> + <case + latin:imeAction="actionDone" + > + <key-style + latin:styleName="enterKeyStyle" + latin:keyLabel="@string/label_done_key" + latin:parentStyle="defaultActionKeyStyle" /> + </case> + <case + latin:imeAction="actionSend" + > + <key-style + latin:styleName="enterKeyStyle" + latin:keyLabel="@string/label_send_key" + latin:parentStyle="defaultActionKeyStyle" /> + </case> + <case + latin:imeAction="actionSearch" + > + <key-style + latin:styleName="enterKeyStyle" + latin:keyIcon="iconSearchKey" + latin:parentStyle="defaultActionKeyStyle" /> + </case> + <case + latin:imeAction="actionCustomLabel" + > + <key-style + latin:styleName="enterKeyStyle" + latin:keyLabelFlags="fromCustomActionLabel" + latin:parentStyle="defaultActionKeyStyle" /> + </case> + <!-- imeAction is either actionNone or actionUnspecified. --> + <default> + <key-style + latin:styleName="enterKeyStyle" + latin:parentStyle="defaultEnterKeyStyle" /> + </default> + </switch> +</merge> diff --git a/java/res/xml/keys_curly_brackets.xml b/java/res/xml/keys_curly_brackets.xml index b43fbb1fe..d21a09281 100644 --- a/java/res/xml/keys_curly_brackets.xml +++ b/java/res/xml/keys_curly_brackets.xml @@ -23,8 +23,8 @@ > <Key latin:keyLabel="{" - latin:keyOutputText="@string/output_text_for_left_curly_bracket" /> + latin:code="@integer/keycode_for_left_curly_bracket" /> <Key latin:keyLabel="}" - latin:keyOutputText="@string/output_text_for_right_curly_bracket" /> + latin:code="@integer/keycode_for_right_curly_bracket" /> </merge> diff --git a/java/res/xml/keys_less_greater.xml b/java/res/xml/keys_less_greater.xml index 8e90199fe..8961d9ce6 100644 --- a/java/res/xml/keys_less_greater.xml +++ b/java/res/xml/keys_less_greater.xml @@ -23,10 +23,10 @@ > <Key latin:keyLabel="<" - latin:keyOutputText="@string/output_text_for_less_than" + latin:code="@integer/keycode_for_less_than" latin:moreKeys="@string/more_keys_for_less_than" /> <Key latin:keyLabel=">" - latin:keyOutputText="@string/output_text_for_greater_than" + latin:code="@integer/keycode_for_greater_than" latin:moreKeys="@string/more_keys_for_greater_than" /> </merge> diff --git a/java/res/xml/keys_parentheses.xml b/java/res/xml/keys_parentheses.xml index bacb26d2f..6853bf167 100644 --- a/java/res/xml/keys_parentheses.xml +++ b/java/res/xml/keys_parentheses.xml @@ -23,10 +23,10 @@ > <Key latin:keyLabel="(" - latin:keyOutputText="@string/output_text_for_left_parenthesis" + latin:code="@integer/keycode_for_left_parenthesis" latin:moreKeys="@string/more_keys_for_left_parenthesis" /> <Key latin:keyLabel=")" - latin:keyOutputText="@string/output_text_for_right_parenthesis" + latin:code="@integer/keycode_for_right_parenthesis" latin:moreKeys="@string/more_keys_for_right_parenthesis" /> </merge> diff --git a/java/res/xml/keys_square_brackets.xml b/java/res/xml/keys_square_brackets.xml index 3525f4d5a..44387c3bf 100644 --- a/java/res/xml/keys_square_brackets.xml +++ b/java/res/xml/keys_square_brackets.xml @@ -23,8 +23,8 @@ > <Key latin:keyLabel="[" - latin:keyOutputText="@string/output_text_for_left_square_bracket" /> + latin:code="@integer/keycode_for_left_square_bracket" /> <Key latin:keyLabel="]" - latin:keyOutputText="@string/output_text_for_right_square_bracket" /> + latin:code="@integer/keycode_for_right_square_bracket" /> </merge> diff --git a/java/res/xml/row_qwerty4.xml b/java/res/xml/row_qwerty4.xml index 65500a653..8c20a72dc 100644 --- a/java/res/xml/row_qwerty4.xml +++ b/java/res/xml/row_qwerty4.xml @@ -40,7 +40,7 @@ <Key latin:keyStyle="punctuationKeyStyle" /> <Key - latin:keyStyle="returnKeyStyle" + latin:keyStyle="enterKeyStyle" latin:keyWidth="fillRight" /> </case> <!-- hasSettingsKey="true" or navigateAction="true" --> @@ -59,7 +59,7 @@ latin:keyStyle="punctuationKeyStyle" latin:keyWidth="9.2%p" /> <Key - latin:keyStyle="returnKeyStyle" + latin:keyStyle="enterKeyStyle" latin:keyWidth="fillRight" /> </default> </switch> diff --git a/java/res/xml/row_symbols4.xml b/java/res/xml/row_symbols4.xml index 8b094dd7e..be0c94ffa 100644 --- a/java/res/xml/row_symbols4.xml +++ b/java/res/xml/row_symbols4.xml @@ -40,7 +40,7 @@ <Key latin:keyStyle="punctuationKeyStyle" /> <Key - latin:keyStyle="returnKeyStyle" + latin:keyStyle="enterKeyStyle" latin:keyWidth="fillRight" /> </case> <!-- hasSettingsKey="true" or navigateAction="true" --> @@ -59,7 +59,7 @@ latin:keyStyle="punctuationKeyStyle" latin:keyWidth="9.2%p" /> <Key - latin:keyStyle="returnKeyStyle" + latin:keyStyle="enterKeyStyle" latin:keyWidth="fillRight" /> </default> </switch> diff --git a/java/res/xml/row_symbols_shift4.xml b/java/res/xml/row_symbols_shift4.xml index 4e13ac704..dd13b7175 100644 --- a/java/res/xml/row_symbols_shift4.xml +++ b/java/res/xml/row_symbols_shift4.xml @@ -45,7 +45,7 @@ latin:keyLabel="…" latin:backgroundType="functional" /> <Key - latin:keyStyle="returnKeyStyle" + latin:keyStyle="enterKeyStyle" latin:keyWidth="fillRight" /> </case> <!-- hasSettingsKey="true" or navigateAction="true" --> @@ -70,7 +70,7 @@ latin:keyWidth="9.2%p" latin:backgroundType="functional" /> <Key - latin:keyStyle="returnKeyStyle" + latin:keyStyle="enterKeyStyle" latin:keyWidth="fillRight" /> </default> </switch> diff --git a/java/res/xml/rows_number_normal.xml b/java/res/xml/rows_number_normal.xml index 054b564b0..b581fb5cd 100644 --- a/java/res/xml/rows_number_normal.xml +++ b/java/res/xml/rows_number_normal.xml @@ -75,7 +75,7 @@ latin:keyLabel="." latin:keyStyle="numKeyStyle" /> <Key - latin:keyStyle="returnKeyStyle" + latin:keyStyle="enterKeyStyle" latin:keyWidth="fillRight" /> </Row> </merge> diff --git a/java/res/xml/rows_number_password.xml b/java/res/xml/rows_number_password.xml index ebc13c6a0..e4272ed3f 100644 --- a/java/res/xml/rows_number_password.xml +++ b/java/res/xml/rows_number_password.xml @@ -56,7 +56,7 @@ latin:keyStyle="num0KeyStyle" /> <Spacer /> <Key - latin:keyStyle="returnKeyStyle" + latin:keyStyle="enterKeyStyle" latin:keyWidth="fillRight" /> </Row> </merge> diff --git a/java/res/xml/rows_phone.xml b/java/res/xml/rows_phone.xml index 18e4c9d3e..60296d061 100644 --- a/java/res/xml/rows_phone.xml +++ b/java/res/xml/rows_phone.xml @@ -68,7 +68,7 @@ <Key latin:keyStyle="numSpaceKeyStyle" /> <Key - latin:keyStyle="returnKeyStyle" + latin:keyStyle="enterKeyStyle" latin:keyWidth="fillRight" /> </Row> </merge> diff --git a/java/res/xml/rows_phone_symbols.xml b/java/res/xml/rows_phone_symbols.xml index dfa134946..7841c56e5 100644 --- a/java/res/xml/rows_phone_symbols.xml +++ b/java/res/xml/rows_phone_symbols.xml @@ -78,7 +78,7 @@ <Key latin:keyStyle="numSpaceKeyStyle" /> <Key - latin:keyStyle="returnKeyStyle" + latin:keyStyle="enterKeyStyle" latin:keyWidth="fillRight" /> </Row> </merge> diff --git a/java/src/com/android/inputmethod/compat/EditorInfoCompatUtils.java b/java/src/com/android/inputmethod/compat/EditorInfoCompatUtils.java index e1db36088..3247997f6 100644 --- a/java/src/com/android/inputmethod/compat/EditorInfoCompatUtils.java +++ b/java/src/com/android/inputmethod/compat/EditorInfoCompatUtils.java @@ -67,42 +67,34 @@ public class EditorInfoCompatUtils { ic.performEditorAction(OBJ_IME_ACTION_PREVIOUS); } - public static String imeOptionsName(int imeOptions) { - if (imeOptions == -1) - return null; + public static String imeActionName(int imeOptions) { final int actionId = imeOptions & EditorInfo.IME_MASK_ACTION; - final String action; switch (actionId) { - case EditorInfo.IME_ACTION_UNSPECIFIED: - action = "actionUnspecified"; - break; - case EditorInfo.IME_ACTION_NONE: - action = "actionNone"; - break; - case EditorInfo.IME_ACTION_GO: - action = "actionGo"; - break; - case EditorInfo.IME_ACTION_SEARCH: - action = "actionSearch"; - break; - case EditorInfo.IME_ACTION_SEND: - action = "actionSend"; - break; - case EditorInfo.IME_ACTION_NEXT: - action = "actionNext"; - break; - case EditorInfo.IME_ACTION_DONE: - action = "actionDone"; - break; - default: { - if (OBJ_IME_ACTION_PREVIOUS != null && actionId == OBJ_IME_ACTION_PREVIOUS) { - action = "actionPrevious"; - } else { - action = "actionUnknown(" + actionId + ")"; - } - break; + case EditorInfo.IME_ACTION_UNSPECIFIED: + return "actionUnspecified"; + case EditorInfo.IME_ACTION_NONE: + return "actionNone"; + case EditorInfo.IME_ACTION_GO: + return "actionGo"; + case EditorInfo.IME_ACTION_SEARCH: + return "actionSearch"; + case EditorInfo.IME_ACTION_SEND: + return "actionSend"; + case EditorInfo.IME_ACTION_NEXT: + return "actionNext"; + case EditorInfo.IME_ACTION_DONE: + return "actionDone"; + default: + if (OBJ_IME_ACTION_PREVIOUS != null && actionId == OBJ_IME_ACTION_PREVIOUS) { + return "actionPrevious"; + } else { + return "actionUnknown(" + actionId + ")"; } } + } + + public static String imeOptionsName(int imeOptions) { + final String action = imeActionName(imeOptions); final StringBuilder flags = new StringBuilder(); if ((imeOptions & EditorInfo.IME_FLAG_NO_ENTER_ACTION) != 0) { flags.append("flagNoEnterAction|"); @@ -116,6 +108,6 @@ public class EditorInfoCompatUtils { if (hasFlagForceAscii(imeOptions)) { flags.append("flagForceAscii|"); } - return flags + action; + return (action != null) ? flags + action : flags.toString(); } } diff --git a/java/src/com/android/inputmethod/keyboard/Key.java b/java/src/com/android/inputmethod/keyboard/Key.java index 686392da8..b90d45d3b 100644 --- a/java/src/com/android/inputmethod/keyboard/Key.java +++ b/java/src/com/android/inputmethod/keyboard/Key.java @@ -72,6 +72,7 @@ public class Key { private static final int LABEL_FLAGS_AUTO_X_SCALE = 0x4000; private static final int LABEL_FLAGS_PRESERVE_CASE = 0x8000; private static final int LABEL_FLAGS_SHIFTED_LETTER_ACTIVATED = 0x10000; + private static final int LABEL_FLAGS_FROM_CUSTOM_ACTION_LABEL = 0x20000; /** Icon to display instead of a label. Icon takes precedence over a label */ private final int mIconId; @@ -228,9 +229,9 @@ public class Key { mDisabledIconId = style.getInt(keyAttr, R.styleable.Keyboard_Key_keyIconDisabled, KeyboardIconsSet.ICON_UNDEFINED); - mLabelFlags = style.getFlag(keyAttr, R.styleable.Keyboard_Key_keyLabelFlags, 0); + mLabelFlags = style.getFlag(keyAttr, R.styleable.Keyboard_Key_keyLabelFlags); final boolean preserveCase = (mLabelFlags & LABEL_FLAGS_PRESERVE_CASE) != 0; - int actionFlags = style.getFlag(keyAttr, R.styleable.Keyboard_Key_keyActionFlags, 0); + int actionFlags = style.getFlag(keyAttr, R.styleable.Keyboard_Key_keyActionFlags); final String[] additionalMoreKeys = style.getStringArray( keyAttr, R.styleable.Keyboard_Key_additionalMoreKeys); final String[] moreKeys = KeySpecParser.insertAddtionalMoreKeys(style.getStringArray( @@ -245,10 +246,14 @@ public class Key { mActionFlags = actionFlags; mMoreKeys = moreKeys; mMaxMoreKeysColumn = style.getInt(keyAttr, - R.styleable.Keyboard_Key_maxMoreKeysColumn, params.mMaxMiniKeyboardColumn); + R.styleable.Keyboard_Key_maxMoreKeysColumn, params.mMaxMoreKeysKeyboardColumn); - mLabel = adjustCaseOfStringForKeyboardId(style.getString( - keyAttr, R.styleable.Keyboard_Key_keyLabel), preserveCase, params.mId); + if ((mLabelFlags & LABEL_FLAGS_FROM_CUSTOM_ACTION_LABEL) != 0) { + mLabel = params.mId.mCustomActionLabel; + } else { + mLabel = adjustCaseOfStringForKeyboardId(style.getString( + keyAttr, R.styleable.Keyboard_Key_keyLabel), preserveCase, params.mId); + } mHintLabel = adjustCaseOfStringForKeyboardId(style.getString( keyAttr, R.styleable.Keyboard_Key_keyHintLabel), preserveCase, params.mId); String outputText = adjustCaseOfStringForKeyboardId(style.getString( @@ -274,7 +279,12 @@ public class Key { mCode = Keyboard.CODE_OUTPUT_TEXT; } } else if (code == Keyboard.CODE_UNSPECIFIED && outputText != null) { - mCode = Keyboard.CODE_OUTPUT_TEXT; + if (Utils.codePointCount(outputText) == 1) { + mCode = outputText.codePointAt(0); + outputText = null; + } else { + mCode = Keyboard.CODE_OUTPUT_TEXT; + } } else { mCode = adjustCaseOfCodeForKeyboardId(code, preserveCase, params.mId); } diff --git a/java/src/com/android/inputmethod/keyboard/Keyboard.java b/java/src/com/android/inputmethod/keyboard/Keyboard.java index 10e0a5b01..28f71f443 100644 --- a/java/src/com/android/inputmethod/keyboard/Keyboard.java +++ b/java/src/com/android/inputmethod/keyboard/Keyboard.java @@ -28,7 +28,6 @@ import android.util.TypedValue; import android.util.Xml; import android.view.InflateException; -import com.android.inputmethod.compat.EditorInfoCompatUtils; import com.android.inputmethod.keyboard.internal.KeyStyles; import com.android.inputmethod.keyboard.internal.KeyboardIconsSet; import com.android.inputmethod.latin.LatinImeLogger; @@ -95,10 +94,11 @@ public class Keyboard { */ public static final int CODE_SHIFT = -1; public static final int CODE_SWITCH_ALPHA_SYMBOL = -2; - public static final int CODE_OUTPUT_TEXT = -4; - public static final int CODE_DELETE = -5; - public static final int CODE_SETTINGS = -6; - public static final int CODE_SHORTCUT = -7; + public static final int CODE_OUTPUT_TEXT = -3; + public static final int CODE_DELETE = -4; + public static final int CODE_SETTINGS = -5; + public static final int CODE_SHORTCUT = -6; + public static final int CODE_ACTION_ENTER = -7; // Code value representing the code is not specified. public static final int CODE_UNSPECIFIED = -9; @@ -121,8 +121,8 @@ public class Keyboard { /** More keys keyboard template */ public final int mMoreKeysTemplate; - /** Maximum column for mini keyboard */ - public final int mMaxMiniKeyboardColumn; + /** Maximum column for more keys keyboard */ + public final int mMaxMoreKeysKeyboardColumn; /** List of keys and icons in this keyboard */ public final Set<Key> mKeys; @@ -143,7 +143,7 @@ public class Keyboard { mMostCommonKeyHeight = params.mMostCommonKeyHeight; mMostCommonKeyWidth = params.mMostCommonKeyWidth; mMoreKeysTemplate = params.mMoreKeysTemplate; - mMaxMiniKeyboardColumn = params.mMaxMiniKeyboardColumn; + mMaxMoreKeysKeyboardColumn = params.mMaxMoreKeysKeyboardColumn; mTopPadding = params.mTopPadding; mVerticalGap = params.mVerticalGap; @@ -226,7 +226,7 @@ public class Keyboard { public int mVerticalGap; public int mMoreKeysTemplate; - public int mMaxMiniKeyboardColumn; + public int mMaxMoreKeysKeyboardColumn; public int GRID_WIDTH; public int GRID_HEIGHT; @@ -380,6 +380,7 @@ public class Keyboard { case CODE_DELETE: return "delete"; case CODE_SETTINGS: return "settings"; case CODE_SHORTCUT: return "shortcut"; + case CODE_ACTION_ENTER: return "actionEnter"; case CODE_UNSPECIFIED: return "unspec"; case CODE_TAB: return "tab"; case CODE_ENTER: return "enter"; @@ -475,7 +476,7 @@ public class Keyboard { */ public static class Builder<KP extends Params> { - private static final String TAG = Builder.class.getSimpleName(); + private static final String BUILDER_TAG = "Keyboard.Builder"; private static final boolean DEBUG = false; // Keyboard XML Tags @@ -643,7 +644,7 @@ public class Keyboard { a.recycle(); if (resourceId == 0) { if (LatinImeLogger.sDBG) - Log.e(TAG, "touchPositionCorrectionData is not defined"); + Log.e(BUILDER_TAG, "touchPositionCorrectionData is not defined"); return; } @@ -680,10 +681,10 @@ public class Keyboard { try { parseKeyboard(parser); } catch (XmlPullParserException e) { - Log.w(TAG, "keyboard XML parse error: " + e); + Log.w(BUILDER_TAG, "keyboard XML parse error: " + e); throw new IllegalArgumentException(e); } catch (IOException e) { - Log.w(TAG, "keyboard XML parse error: " + e); + Log.w(BUILDER_TAG, "keyboard XML parse error: " + e); throw new RuntimeException(e); } finally { parser.close(); @@ -699,9 +700,29 @@ public class Keyboard { return new Keyboard(mParams); } + private int mIndent; + private static final String SPACES = " "; + + private static String spaces(int count) { + return (count < SPACES.length()) ? SPACES.substring(0, count) : SPACES; + } + + private void startTag(String format, Object ... args) { + Log.d(BUILDER_TAG, String.format(spaces(++mIndent * 2) + format, args)); + } + + private void endTag(String format, Object ... args) { + Log.d(BUILDER_TAG, String.format(spaces(mIndent-- * 2) + format, args)); + } + + private void startEndTag(String format, Object ... args) { + Log.d(BUILDER_TAG, String.format(spaces(++mIndent * 2) + format, args)); + mIndent--; + } + private void parseKeyboard(XmlPullParser parser) throws XmlPullParserException, IOException { - if (DEBUG) Log.d(TAG, String.format("<%s> %s", TAG_KEYBOARD, mParams.mId)); + if (DEBUG) startTag("<%s> %s", TAG_KEYBOARD, mParams.mId); int event; while ((event = parser.next()) != XmlPullParser.END_DOCUMENT) { if (event == XmlPullParser.START_TAG) { @@ -770,7 +791,7 @@ public class Keyboard { params.mMoreKeysTemplate = keyboardAttr.getResourceId( R.styleable.Keyboard_moreKeysTemplate, 0); - params.mMaxMiniKeyboardColumn = keyAttr.getInt( + params.mMaxMoreKeysKeyboardColumn = keyAttr.getInt( R.styleable.Keyboard_Key_maxMoreKeysColumn, 5); params.mIconsSet.loadIcons(keyboardAttr); @@ -788,9 +809,10 @@ public class Keyboard { final String tag = parser.getName(); if (TAG_ROW.equals(tag)) { Row row = parseRowAttributes(parser); - if (DEBUG) Log.d(TAG, String.format("<%s>", TAG_ROW)); - if (!skip) + if (DEBUG) startTag("<%s>%s", TAG_ROW, skip ? " skipped" : ""); + if (!skip) { startRow(row); + } parseRowContent(parser, row, skip); } else if (TAG_INCLUDE.equals(tag)) { parseIncludeKeyboardContent(parser, skip); @@ -803,15 +825,13 @@ public class Keyboard { } } else if (event == XmlPullParser.END_TAG) { final String tag = parser.getName(); + if (DEBUG) endTag("</%s>", tag); if (TAG_KEYBOARD.equals(tag)) { endKeyboard(); break; } else if (TAG_CASE.equals(tag) || TAG_DEFAULT.equals(tag) || TAG_MERGE.equals(tag)) { - if (DEBUG) Log.d(TAG, String.format("</%s>", tag)); break; - } else if (TAG_KEY_STYLE.equals(tag)) { - continue; } else { throw new XmlParseUtils.IllegalEndTag(parser, TAG_ROW); } @@ -854,17 +874,15 @@ public class Keyboard { } } else if (event == XmlPullParser.END_TAG) { final String tag = parser.getName(); + if (DEBUG) endTag("</%s>", tag); if (TAG_ROW.equals(tag)) { - if (DEBUG) Log.d(TAG, String.format("</%s>", TAG_ROW)); - if (!skip) + if (!skip) { endRow(row); + } break; } else if (TAG_CASE.equals(tag) || TAG_DEFAULT.equals(tag) || TAG_MERGE.equals(tag)) { - if (DEBUG) Log.d(TAG, String.format("</%s>", tag)); break; - } else if (TAG_KEY_STYLE.equals(tag)) { - continue; } else { throw new XmlParseUtils.IllegalEndTag(parser, TAG_KEY); } @@ -876,11 +894,14 @@ public class Keyboard { throws XmlPullParserException, IOException { if (skip) { XmlParseUtils.checkEndTag(TAG_KEY, parser); + if (DEBUG) startEndTag("<%s /> skipped", TAG_KEY); } else { final Key key = new Key(mResources, mParams, row, parser, mKeyStyles); - if (DEBUG) Log.d(TAG, String.format("<%s%s keyLabel=%s code=%d moreKeys=%s />", - TAG_KEY, (key.isEnabled() ? "" : " disabled"), key.mLabel, key.mCode, - Arrays.toString(key.mMoreKeys))); + if (DEBUG) { + startEndTag("<%s%s %s moreKeys=%s />", TAG_KEY, + (key.isEnabled() ? "" : " disabled"), key, + Arrays.toString(key.mMoreKeys)); + } XmlParseUtils.checkEndTag(TAG_KEY, parser); endKey(key); } @@ -890,10 +911,11 @@ public class Keyboard { throws XmlPullParserException, IOException { if (skip) { XmlParseUtils.checkEndTag(TAG_SPACER, parser); + if (DEBUG) startEndTag("<%s /> skipped", TAG_SPACER); } else { final Key.Spacer spacer = new Key.Spacer( mResources, mParams, row, parser, mKeyStyles); - if (DEBUG) Log.d(TAG, String.format("<%s />", TAG_SPACER)); + if (DEBUG) startEndTag("<%s />", TAG_SPACER); XmlParseUtils.checkEndTag(TAG_SPACER, parser); endKey(spacer); } @@ -913,6 +935,7 @@ public class Keyboard { throws XmlPullParserException, IOException { if (skip) { XmlParseUtils.checkEndTag(TAG_INCLUDE, parser); + if (DEBUG) startEndTag("</%s> skipped", TAG_INCLUDE); } else { final AttributeSet attr = Xml.asAttributeSet(parser); final TypedArray keyboardAttr = mResources.obtainAttributes(attr, @@ -944,8 +967,10 @@ public class Keyboard { } XmlParseUtils.checkEndTag(TAG_INCLUDE, parser); - if (DEBUG) Log.d(TAG, String.format("<%s keyboardLayout=%s />", - TAG_INCLUDE, mResources.getResourceEntryName(keyboardLayout))); + if (DEBUG) { + startEndTag("<%s keyboardLayout=%s />",TAG_INCLUDE, + mResources.getResourceEntryName(keyboardLayout)); + } final XmlResourceParser parserForInclude = mResources.getXml(keyboardLayout); try { parseMerge(parserForInclude, row, skip); @@ -961,6 +986,7 @@ public class Keyboard { private void parseMerge(XmlPullParser parser, Row row, boolean skip) throws XmlPullParserException, IOException { + if (DEBUG) startTag("<%s>", TAG_MERGE); int event; while ((event = parser.next()) != XmlPullParser.END_DOCUMENT) { if (event == XmlPullParser.START_TAG) { @@ -992,7 +1018,7 @@ public class Keyboard { private void parseSwitchInternal(XmlPullParser parser, Row row, boolean skip) throws XmlPullParserException, IOException { - if (DEBUG) Log.d(TAG, String.format("<%s> %s", TAG_SWITCH, mParams.mId)); + if (DEBUG) startTag("<%s> %s", TAG_SWITCH, mParams.mId); boolean selected = false; int event; while ((event = parser.next()) != XmlPullParser.END_DOCUMENT) { @@ -1008,7 +1034,7 @@ public class Keyboard { } else if (event == XmlPullParser.END_TAG) { final String tag = parser.getName(); if (TAG_SWITCH.equals(tag)) { - if (DEBUG) Log.d(TAG, String.format("</%s>", TAG_SWITCH)); + if (DEBUG) endTag("</%s>", TAG_SWITCH); break; } else { throw new XmlParseUtils.IllegalEndTag(parser, TAG_KEY); @@ -1057,10 +1083,8 @@ public class Keyboard { R.styleable.Keyboard_Case_shortcutKeyEnabled, id.mShortcutKeyEnabled); final boolean hasShortcutKeyMatched = matchBoolean(a, R.styleable.Keyboard_Case_hasShortcutKey, id.mHasShortcutKey); - // As noted at {@link KeyboardId} class, we are interested only in enum value - // masked by {@link android.view.inputmethod.EditorInfo#IME_MASK_ACTION} and - // {@link android.view.inputmethod.EditorInfo#IME_FLAG_NO_ENTER_ACTION}. So matching - // this attribute with id.mImeOptions as integer value is enough for our purpose. + final boolean isMultiLineMatched = matchBoolean(a, + R.styleable.Keyboard_Case_isMultiLine, id.isMultiLine()); final boolean imeActionMatched = matchInteger(a, R.styleable.Keyboard_Case_imeAction, id.imeAction()); final boolean localeCodeMatched = matchString(a, @@ -1072,30 +1096,42 @@ public class Keyboard { final boolean selected = keyboardSetElementMatched && modeMatched && navigateActionMatched && passwordInputMatched && hasSettingsKeyMatched && f2KeyModeMatched && clobberSettingsKeyMatched - && shortcutKeyEnabledMatched && hasShortcutKeyMatched && imeActionMatched - && localeCodeMatched && languageCodeMatched && countryCodeMatched; - - if (DEBUG) Log.d(TAG, String.format("<%s%s%s%s%s%s%s%s%s%s%s%s%s%s> %s", TAG_CASE, - textAttr(a.getString(R.styleable.Keyboard_Case_keyboardSetElement), - "keyboardSetElement"), - textAttr(a.getString(R.styleable.Keyboard_Case_mode), "mode"), - booleanAttr(a, R.styleable.Keyboard_Case_navigateAction, "navigateAction"), - booleanAttr(a, R.styleable.Keyboard_Case_passwordInput, "passwordInput"), - booleanAttr(a, R.styleable.Keyboard_Case_hasSettingsKey, "hasSettingsKey"), - textAttr(KeyboardId.f2KeyModeName( - a.getInt(R.styleable.Keyboard_Case_f2KeyMode, -1)), "f2KeyMode"), - booleanAttr(a, R.styleable.Keyboard_Case_clobberSettingsKey, - "clobberSettingsKey"), - booleanAttr(a, R.styleable.Keyboard_Case_shortcutKeyEnabled, - "shortcutKeyEnabled"), - booleanAttr(a, R.styleable.Keyboard_Case_hasShortcutKey, "hasShortcutKey"), - textAttr(EditorInfoCompatUtils.imeOptionsName( - a.getInt(R.styleable.Keyboard_Case_imeAction, -1)), "imeAction"), - textAttr(a.getString(R.styleable.Keyboard_Case_localeCode), "localeCode"), - textAttr(a.getString(R.styleable.Keyboard_Case_languageCode), - "languageCode"), - textAttr(a.getString(R.styleable.Keyboard_Case_countryCode), "countryCode"), - Boolean.toString(selected))); + && shortcutKeyEnabledMatched && hasShortcutKeyMatched && isMultiLineMatched + && imeActionMatched && localeCodeMatched && languageCodeMatched + && countryCodeMatched; + + if (DEBUG) { + startTag("<%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s>%s", TAG_CASE, + textAttr(a.getString(R.styleable.Keyboard_Case_keyboardSetElement), + "keyboardSetElement"), + textAttr(a.getString(R.styleable.Keyboard_Case_mode), "mode"), + booleanAttr(a, R.styleable.Keyboard_Case_navigateAction, + "navigateAction"), + booleanAttr(a, R.styleable.Keyboard_Case_passwordInput, + "passwordInput"), + booleanAttr(a, R.styleable.Keyboard_Case_hasSettingsKey, + "hasSettingsKey"), + textAttr(KeyboardId.f2KeyModeName( + a.getInt(R.styleable.Keyboard_Case_f2KeyMode, -1)), + "f2KeyMode"), + booleanAttr(a, R.styleable.Keyboard_Case_clobberSettingsKey, + "clobberSettingsKey"), + booleanAttr(a, R.styleable.Keyboard_Case_shortcutKeyEnabled, + "shortcutKeyEnabled"), + booleanAttr(a, R.styleable.Keyboard_Case_hasShortcutKey, + "hasShortcutKey"), + booleanAttr(a, R.styleable.Keyboard_Case_isMultiLine, + "isMultiLine"), + textAttr(a.getString(R.styleable.Keyboard_Case_imeAction), + "imeAction"), + textAttr(a.getString(R.styleable.Keyboard_Case_localeCode), + "localeCode"), + textAttr(a.getString(R.styleable.Keyboard_Case_languageCode), + "languageCode"), + textAttr(a.getString(R.styleable.Keyboard_Case_countryCode), + "countryCode"), + selected ? "" : " skipped"); + } return selected; } finally { @@ -1148,7 +1184,7 @@ public class Keyboard { private boolean parseDefault(XmlPullParser parser, Row row, boolean skip) throws XmlPullParserException, IOException { - if (DEBUG) Log.d(TAG, String.format("<%s>", TAG_DEFAULT)); + if (DEBUG) startTag("<%s>", TAG_DEFAULT); if (row == null) { parseKeyboardContent(parser, skip); } else { @@ -1158,7 +1194,7 @@ public class Keyboard { } private void parseKeyStyle(XmlPullParser parser, boolean skip) - throws XmlPullParserException { + throws XmlPullParserException, IOException { TypedArray keyStyleAttr = mResources.obtainAttributes(Xml.asAttributeSet(parser), R.styleable.Keyboard_KeyStyle); TypedArray keyAttrs = mResources.obtainAttributes(Xml.asAttributeSet(parser), @@ -1167,12 +1203,18 @@ public class Keyboard { if (!keyStyleAttr.hasValue(R.styleable.Keyboard_KeyStyle_styleName)) throw new XmlParseUtils.ParseException("<" + TAG_KEY_STYLE + "/> needs styleName attribute", parser); + if (DEBUG) { + startEndTag("<%s styleName=%s />%s", TAG_KEY_STYLE, + keyStyleAttr.getString(R.styleable.Keyboard_KeyStyle_styleName), + skip ? " skipped" : ""); + } if (!skip) mKeyStyles.parseKeyStyleAttributes(keyStyleAttr, keyAttrs, parser); } finally { keyStyleAttr.recycle(); keyAttrs.recycle(); } + XmlParseUtils.checkEndTag(TAG_KEY_STYLE, parser); } private void startKeyboard() { diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardId.java b/java/src/com/android/inputmethod/keyboard/KeyboardId.java index 0837e17da..3ab24933c 100644 --- a/java/src/com/android/inputmethod/keyboard/KeyboardId.java +++ b/java/src/com/android/inputmethod/keyboard/KeyboardId.java @@ -16,6 +16,7 @@ package com.android.inputmethod.keyboard; +import android.text.InputType; import android.text.TextUtils; import android.view.inputmethod.EditorInfo; @@ -25,10 +26,8 @@ import com.android.inputmethod.compat.InputTypeCompatUtils; import java.util.Arrays; import java.util.Locale; -// TODO: Move to com.android.inputmethod.keyboard.internal package. /** - * Represents the parameters necessary to construct a new LatinKeyboard, - * which also serve as a unique identifier for each keyboard type. + * Unique identifier for each keyboard type. */ public class KeyboardId { public static final int MODE_TEXT = 0; @@ -54,34 +53,37 @@ public class KeyboardId { private static final int F2KEY_MODE_SHORTCUT_IME = 2; private static final int F2KEY_MODE_SHORTCUT_IME_OR_SETTINGS = 3; + private static final int IME_ACTION_CUSTOM_LABEL = EditorInfo.IME_MASK_ACTION + 1; + public final Locale mLocale; public final int mOrientation; public final int mWidth; public final int mMode; public final int mElementId; - private final int mInputType; - private final int mImeOptions; + private final EditorInfo mEditorInfo; private final boolean mSettingsKeyEnabled; public final boolean mClobberSettingsKey; public final boolean mShortcutKeyEnabled; public final boolean mHasShortcutKey; + public final String mCustomActionLabel; private final int mHashCode; public KeyboardId(int elementId, Locale locale, int orientation, int width, int mode, - int inputType, int imeOptions, boolean settingsKeyEnabled, boolean clobberSettingsKey, + EditorInfo editorInfo, boolean settingsKeyEnabled, boolean clobberSettingsKey, boolean shortcutKeyEnabled, boolean hasShortcutKey) { this.mLocale = locale; this.mOrientation = orientation; this.mWidth = width; this.mMode = mode; this.mElementId = elementId; - this.mInputType = inputType; - this.mImeOptions = imeOptions; + this.mEditorInfo = editorInfo; this.mSettingsKeyEnabled = settingsKeyEnabled; this.mClobberSettingsKey = clobberSettingsKey; this.mShortcutKeyEnabled = shortcutKeyEnabled; this.mHasShortcutKey = hasShortcutKey; + this.mCustomActionLabel = (editorInfo.actionLabel != null) + ? editorInfo.actionLabel.toString() : null; this.mHashCode = hashCode(this); } @@ -98,7 +100,9 @@ public class KeyboardId { id.mClobberSettingsKey, id.mShortcutKeyEnabled, id.mHasShortcutKey, + id.isMultiLine(), id.imeAction(), + id.mCustomActionLabel, id.mLocale }); } @@ -116,7 +120,9 @@ public class KeyboardId { && other.mClobberSettingsKey == this.mClobberSettingsKey && other.mShortcutKeyEnabled == this.mShortcutKeyEnabled && other.mHasShortcutKey == this.mHasShortcutKey + && other.isMultiLine() == this.isMultiLine() && other.imeAction() == this.imeAction() + && TextUtils.equals(other.mCustomActionLabel, this.mCustomActionLabel) && other.mLocale.equals(this.mLocale); } @@ -124,20 +130,17 @@ public class KeyboardId { return mElementId < ELEMENT_SYMBOLS; } - // This should be aligned with {@link KeyboardShiftState#isShiftLocked}. public boolean isAlphabetShiftLockedKeyboard() { return mElementId == ELEMENT_ALPHABET_SHIFT_LOCKED || mElementId == ELEMENT_ALPHABET_SHIFT_LOCK_SHIFTED; } - // This should be aligned with {@link KeyboardShiftState#isShiftedOrShiftLocked}. public boolean isAlphabetShiftedOrShiftLockedKeyboard() { return isAlphabetKeyboard() && mElementId != ELEMENT_ALPHABET; } - // This should be aligned with {@link KeyboardShiftState#isManualShifted}. public boolean isAlphabetManualShiftedKeyboard() { - return mElementId != ELEMENT_ALPHABET_MANUAL_SHIFTED; + return mElementId == ELEMENT_ALPHABET_MANUAL_SHIFTED; } public boolean isSymbolsKeyboard() { @@ -154,22 +157,30 @@ public class KeyboardId { public boolean navigateAction() { // Note: Turn off checking navigation flag to show TAB key for now. - boolean navigateAction = InputTypeCompatUtils.isWebInputType(mInputType); + boolean navigateAction = InputTypeCompatUtils.isWebInputType(mEditorInfo.inputType); // || EditorInfoCompatUtils.hasFlagNavigateNext(mImeOptions) // || EditorInfoCompatUtils.hasFlagNavigatePrevious(mImeOptions); return navigateAction; } public boolean passwordInput() { - return InputTypeCompatUtils.isPasswordInputType(mInputType) - || InputTypeCompatUtils.isVisiblePasswordInputType(mInputType); + final int inputType = mEditorInfo.inputType; + return InputTypeCompatUtils.isPasswordInputType(inputType) + || InputTypeCompatUtils.isVisiblePasswordInputType(inputType); + } + + public boolean isMultiLine() { + return (mEditorInfo.inputType & InputType.TYPE_TEXT_FLAG_MULTI_LINE) != 0; } public int imeAction() { - // We are interested only in {@link EditorInfo#IME_MASK_ACTION} enum value and - // {@link EditorInfo#IME_FLAG_NO_ENTER_ACTION}. - return mImeOptions & ( - EditorInfo.IME_MASK_ACTION | EditorInfo.IME_FLAG_NO_ENTER_ACTION); + if ((mEditorInfo.imeOptions & EditorInfo.IME_FLAG_NO_ENTER_ACTION) != 0) { + return EditorInfo.IME_ACTION_NONE; + } else if (mEditorInfo.actionLabel != null) { + return IME_ACTION_CUSTOM_LABEL; + } else { + return mEditorInfo.imeOptions & EditorInfo.IME_MASK_ACTION; + } } public boolean hasSettingsKey() { @@ -208,7 +219,7 @@ public class KeyboardId { mLocale, (mOrientation == 1 ? "port" : "land"), mWidth, modeName(mMode), - EditorInfoCompatUtils.imeOptionsName(imeAction()), + imeAction(), f2KeyModeName(f2KeyMode()), (mClobberSettingsKey ? " clobberSettingsKey" : ""), (navigateAction() ? " navigateAction" : ""), @@ -255,6 +266,11 @@ public class KeyboardId { } } + public static String actionName(int actionId) { + return (actionId == IME_ACTION_CUSTOM_LABEL) ? "actionCustomLabel" + : EditorInfoCompatUtils.imeActionName(actionId); + } + public static String f2KeyModeName(int f2KeyMode) { switch (f2KeyMode) { case F2KEY_MODE_NONE: return "none"; diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardSet.java b/java/src/com/android/inputmethod/keyboard/KeyboardSet.java index 82eaa1d17..f27170a89 100644 --- a/java/src/com/android/inputmethod/keyboard/KeyboardSet.java +++ b/java/src/com/android/inputmethod/keyboard/KeyboardSet.java @@ -62,6 +62,8 @@ public class KeyboardSet { new HashMap<KeyboardId, SoftReference<Keyboard>>(); private static final KeysCache sKeysCache = new KeysCache(); + private static final EditorInfo EMPTY_EDITOR_INFO = new EditorInfo(); + public static class KeyboardSetException extends RuntimeException { public final KeyboardId mKeyboardId; public KeyboardSetException(Throwable cause, KeyboardId keyboardId) { @@ -94,8 +96,7 @@ public class KeyboardSet { static class Params { int mMode; - int mInputType; - int mImeOptions; + EditorInfo mEditorInfo; boolean mTouchPositionCorrectionEnabled; boolean mSettingsKeyEnabled; boolean mVoiceKeyEnabled; @@ -192,9 +193,8 @@ public class KeyboardSet { final boolean hasShortcutKey = params.mVoiceKeyEnabled && (isSymbols != params.mVoiceKeyOnMain); return new KeyboardId(keyboardSetElementId, params.mLocale, params.mOrientation, - params.mWidth, params.mMode, params.mInputType, params.mImeOptions, - params.mSettingsKeyEnabled, params.mNoSettingsKey, params.mVoiceKeyEnabled, - hasShortcutKey); + params.mWidth, params.mMode, params.mEditorInfo, params.mSettingsKeyEnabled, + params.mNoSettingsKey, params.mVoiceKeyEnabled, hasShortcutKey); } public static class Builder { @@ -213,10 +213,7 @@ public class KeyboardSet { final Params params = mParams; params.mMode = Utils.getKeyboardMode(editorInfo); - if (editorInfo != null) { - params.mInputType = editorInfo.inputType; - params.mImeOptions = editorInfo.imeOptions; - } + params.mEditorInfo = (editorInfo != null) ? editorInfo : EMPTY_EDITOR_INFO; params.mNoSettingsKey = Utils.inPrivateImeOptions( mPackageName, LatinIME.IME_OPTION_NO_SETTINGS_KEY, mEditorInfo); } @@ -232,7 +229,8 @@ public class KeyboardSet { boolean touchPositionCorrectionEnabled) { final boolean deprecatedForceAscii = Utils.inPrivateImeOptions( mPackageName, LatinIME.IME_OPTION_FORCE_ASCII, mEditorInfo); - final boolean forceAscii = EditorInfoCompatUtils.hasFlagForceAscii(mParams.mImeOptions) + final boolean forceAscii = EditorInfoCompatUtils.hasFlagForceAscii( + mParams.mEditorInfo.imeOptions) || deprecatedForceAscii; mParams.mLocale = (forceAscii && !asciiCapable) ? Locale.US : inputLocale; mParams.mTouchPositionCorrectionEnabled = touchPositionCorrectionEnabled; diff --git a/java/src/com/android/inputmethod/keyboard/LatinKeyboardView.java b/java/src/com/android/inputmethod/keyboard/LatinKeyboardView.java index 870c7cb25..88a41579d 100644 --- a/java/src/com/android/inputmethod/keyboard/LatinKeyboardView.java +++ b/java/src/com/android/inputmethod/keyboard/LatinKeyboardView.java @@ -92,13 +92,13 @@ public class LatinKeyboardView extends KeyboardView implements PointerTracker.Ke private final Drawable mAutoCorrectionSpacebarLedIcon; private static final int SPACE_LED_LENGTH_PERCENT = 80; - // Mini keyboard + // More keys keyboard private PopupWindow mMoreKeysWindow; private MoreKeysPanel mMoreKeysPanel; private int mMoreKeysPanelPointerTrackerId; private final WeakHashMap<Key, MoreKeysPanel> mMoreKeysPanelCache = new WeakHashMap<Key, MoreKeysPanel>(); - private final boolean mConfigShowMiniKeyboardAtTouchedPoint; + private final boolean mConfigShowMoreKeysKeyboardAtTouchedPoint; private final PointerTrackerParams mPointerTrackerParams; private final boolean mIsSpacebarTriggeringPopupByLongPress; @@ -137,7 +137,7 @@ public class LatinKeyboardView extends KeyboardView implements PointerTracker.Ke break; case MSG_LONGPRESS_KEY: if (tracker != null) { - keyboardView.openMiniKeyboardIfRequired(tracker.getKey(), tracker); + keyboardView.openMoreKeysKeyboardIfRequired(tracker.getKey(), tracker); } else { KeyboardSwitcher.getInstance().onLongPressTimeout(msg.arg1); } @@ -338,8 +338,8 @@ public class LatinKeyboardView extends KeyboardView implements PointerTracker.Ke R.styleable.LatinKeyboardView_keyHysteresisDistance, 0); mKeyDetector = new KeyDetector(keyHysteresisDistance); mKeyTimerHandler = new KeyTimerHandler(this, keyTimerParams); - mConfigShowMiniKeyboardAtTouchedPoint = a.getBoolean( - R.styleable.LatinKeyboardView_showMiniKeyboardAtTouchedPoint, false); + mConfigShowMoreKeysKeyboardAtTouchedPoint = a.getBoolean( + R.styleable.LatinKeyboardView_showMoreKeysKeyboardAtTouchedPoint, false); a.recycle(); PointerTracker.setParameters(mPointerTrackerParams); @@ -435,7 +435,7 @@ public class LatinKeyboardView extends KeyboardView implements PointerTracker.Ke super.cancelAllMessages(); } - private boolean openMiniKeyboardIfRequired(Key parentKey, PointerTracker tracker) { + private boolean openMoreKeysKeyboardIfRequired(Key parentKey, PointerTracker tracker) { // Check if we have a popup layout specified first. if (mMoreKeysLayout == 0) { return false; @@ -458,19 +458,19 @@ public class LatinKeyboardView extends KeyboardView implements PointerTracker.Ke if (container == null) throw new NullPointerException(); - final MiniKeyboardView miniKeyboardView = - (MiniKeyboardView)container.findViewById(R.id.mini_keyboard_view); + final MoreKeysKeyboardView moreKeysKeyboardView = + (MoreKeysKeyboardView)container.findViewById(R.id.more_keys_keyboard_view); final Keyboard parentKeyboard = getKeyboard(); - final Keyboard miniKeyboard = new MiniKeyboard.Builder( + final Keyboard moreKeysKeyboard = new MoreKeysKeyboard.Builder( this, parentKeyboard.mMoreKeysTemplate, parentKey, parentKeyboard).build(); - miniKeyboardView.setKeyboard(miniKeyboard); + moreKeysKeyboardView.setKeyboard(moreKeysKeyboard); container.measure(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); - return miniKeyboardView; + return moreKeysKeyboardView; } /** - * Called when a key is long pressed. By default this will open mini keyboard associated + * Called when a key is long pressed. By default this will open more keys keyboard associated * with this key. * @param parentKey the key that was long pressed * @param tracker the pointer tracker which pressed the parent key @@ -524,13 +524,13 @@ public class LatinKeyboardView extends KeyboardView implements PointerTracker.Ke if (mMoreKeysWindow == null) { mMoreKeysWindow = new PopupWindow(getContext()); mMoreKeysWindow.setBackgroundDrawable(null); - mMoreKeysWindow.setAnimationStyle(R.style.MiniKeyboardAnimation); + mMoreKeysWindow.setAnimationStyle(R.style.MoreKeysKeyboardAnimation); } mMoreKeysPanel = moreKeysPanel; mMoreKeysPanelPointerTrackerId = tracker.mPointerId; final Keyboard keyboard = getKeyboard(); - final int pointX = (mConfigShowMiniKeyboardAtTouchedPoint) ? tracker.getLastX() + final int pointX = (mConfigShowMoreKeysKeyboardAtTouchedPoint) ? tracker.getLastX() : parentKey.mX + parentKey.mWidth / 2; final int pointY = parentKey.mY - keyboard.mVerticalGap; moreKeysPanel.showMoreKeysPanel( diff --git a/java/src/com/android/inputmethod/keyboard/MiniKeyboard.java b/java/src/com/android/inputmethod/keyboard/MoreKeysKeyboard.java index 4648da1c1..83155f719 100644 --- a/java/src/com/android/inputmethod/keyboard/MiniKeyboard.java +++ b/java/src/com/android/inputmethod/keyboard/MoreKeysKeyboard.java @@ -21,10 +21,10 @@ import android.graphics.Paint; import com.android.inputmethod.keyboard.internal.KeySpecParser; import com.android.inputmethod.latin.R; -public class MiniKeyboard extends Keyboard { +public class MoreKeysKeyboard extends Keyboard { private final int mDefaultKeyCoordX; - private MiniKeyboard(Builder.MiniKeyboardParams params) { + private MoreKeysKeyboard(Builder.MoreKeysKeyboardParams params) { super(params); mDefaultKeyCoordX = params.getDefaultKeyCoordX() + params.mDefaultKeyWidth / 2; } @@ -33,21 +33,21 @@ public class MiniKeyboard extends Keyboard { return mDefaultKeyCoordX; } - public static class Builder extends Keyboard.Builder<Builder.MiniKeyboardParams> { + public static class Builder extends Keyboard.Builder<Builder.MoreKeysKeyboardParams> { private final String[] mMoreKeys; - public static class MiniKeyboardParams extends Keyboard.Params { + public static class MoreKeysKeyboardParams extends Keyboard.Params { /* package */int mTopRowAdjustment; public int mNumRows; public int mNumColumns; public int mLeftKeys; public int mRightKeys; // includes default key. - public MiniKeyboardParams() { + public MoreKeysKeyboardParams() { super(); } - /* package for test */MiniKeyboardParams(int numKeys, int maxColumns, int keyWidth, + /* package for test */MoreKeysKeyboardParams(int numKeys, int maxColumns, int keyWidth, int rowHeight, int coordXInParent, int parentKeyboardWidth) { super(); setParameters(numKeys, maxColumns, keyWidth, rowHeight, coordXInParent, @@ -55,21 +55,21 @@ public class MiniKeyboard extends Keyboard { } /** - * Set keyboard parameters of mini keyboard. + * Set keyboard parameters of more keys keyboard. * - * @param numKeys number of keys in this mini keyboard. - * @param maxColumns number of maximum columns of this mini keyboard. - * @param keyWidth mini keyboard key width in pixel, including horizontal gap. - * @param rowHeight mini keyboard row height in pixel, including vertical gap. - * @param coordXInParent coordinate x of the popup key in parent keyboard. + * @param numKeys number of keys in this more keys keyboard. + * @param maxColumns number of maximum columns of this more keys keyboard. + * @param keyWidth more keys keyboard key width in pixel, including horizontal gap. + * @param rowHeight more keys keyboard row height in pixel, including vertical gap. + * @param coordXInParent coordinate x of the key preview in parent keyboard. * @param parentKeyboardWidth parent keyboard width in pixel. */ public void setParameters(int numKeys, int maxColumns, int keyWidth, int rowHeight, int coordXInParent, int parentKeyboardWidth) { if (parentKeyboardWidth / keyWidth < maxColumns) { throw new IllegalArgumentException( - "Keyboard is too small to hold mini keyboard: " + parentKeyboardWidth - + " " + keyWidth + " " + maxColumns); + "Keyboard is too small to hold more keys keyboard: " + + parentKeyboardWidth + " " + keyWidth + " " + maxColumns); } mDefaultKeyWidth = keyWidth; mDefaultRowHeight = rowHeight; @@ -95,14 +95,14 @@ public class MiniKeyboard extends Keyboard { leftKeys = numLeftKeys; rightKeys = numRightKeys; } - // Shift right if the left edge of mini keyboard is on the edge of parent keyboard - // unless the parent key is on the left edge. + // Shift right if the left edge of more keys keyboard is on the edge of parent + // keyboard unless the parent key is on the left edge. if (leftKeys * keyWidth >= coordXInParent && leftKeys > 0) { leftKeys--; rightKeys++; } - // Shift left if the right edge of mini keyboard is on the edge of parent keyboard - // unless the parent key is on the right edge. + // Shift left if the right edge of more keys keyboard is on the edge of parent + // keyboard unless the parent key is on the right edge. if (rightKeys * keyWidth + coordXInParent >= parentKeyboardWidth && rightKeys > 1) { leftKeys++; rightKeys--; @@ -204,10 +204,10 @@ public class MiniKeyboard extends Keyboard { } public Builder(KeyboardView view, int xmlId, Key parentKey, Keyboard parentKeyboard) { - super(view.getContext(), new MiniKeyboardParams()); + super(view.getContext(), new MoreKeysKeyboardParams()); load(xmlId, parentKeyboard.mId); - // TODO: Mini keyboard's vertical gap is currently calculated heuristically. + // TODO: More keys keyboard's vertical gap is currently calculated heuristically. // Should revise the algorithm. mParams.mVerticalGap = parentKeyboard.mVerticalGap / 2; mMoreKeys = parentKey.mMoreKeys; @@ -215,8 +215,9 @@ public class MiniKeyboard extends Keyboard { final int previewWidth = view.mKeyPreviewDrawParams.mPreviewBackgroundWidth; final int previewHeight = view.mKeyPreviewDrawParams.mPreviewBackgroundHeight; final int width, height; - // Use pre-computed width and height if these values are available and mini keyboard - // has only one key to mitigate visual flicker between key preview and mini keyboard. + // Use pre-computed width and height if these values are available and more keys + // keyboard has only one key to mitigate visual flicker between key preview and more + // keys keyboard. if (view.isKeyPreviewPopupEnabled() && mMoreKeys.length == 1 && previewWidth > 0 && previewHeight > 0) { width = previewWidth; @@ -231,7 +232,7 @@ public class MiniKeyboard extends Keyboard { private static int getMaxKeyWidth(KeyboardView view, String[] moreKeys, int minKeyWidth) { final int padding = (int) view.getContext().getResources() - .getDimension(R.dimen.mini_keyboard_key_horizontal_padding); + .getDimension(R.dimen.more_keys_keyboard_key_horizontal_padding); Paint paint = null; int maxWidth = minKeyWidth; for (String moreKeySpec : moreKeys) { @@ -252,8 +253,8 @@ public class MiniKeyboard extends Keyboard { } @Override - public MiniKeyboard build() { - final MiniKeyboardParams params = mParams; + public MoreKeysKeyboard build() { + final MoreKeysKeyboardParams params = mParams; for (int n = 0; n < mMoreKeys.length; n++) { final String moreKeySpec = mMoreKeys[n]; final int row = n / params.mNumColumns; @@ -262,7 +263,7 @@ public class MiniKeyboard extends Keyboard { params.markAsEdgeKey(key, row); params.onAddKey(key); } - return new MiniKeyboard(params); + return new MoreKeysKeyboard(params); } } } diff --git a/java/src/com/android/inputmethod/keyboard/MiniKeyboardView.java b/java/src/com/android/inputmethod/keyboard/MoreKeysKeyboardView.java index 72d5b6889..b030dd95a 100644 --- a/java/src/com/android/inputmethod/keyboard/MiniKeyboardView.java +++ b/java/src/com/android/inputmethod/keyboard/MoreKeysKeyboardView.java @@ -28,10 +28,10 @@ import com.android.inputmethod.keyboard.PointerTracker.TimerProxy; import com.android.inputmethod.latin.R; /** - * A view that renders a virtual {@link MiniKeyboard}. It handles rendering of keys and detecting - * key presses and touch movements. + * A view that renders a virtual {@link MoreKeysKeyboard}. It handles rendering of keys and + * detecting key presses and touch movements. */ -public class MiniKeyboardView extends KeyboardView implements MoreKeysPanel { +public class MoreKeysKeyboardView extends KeyboardView implements MoreKeysPanel { private final int[] mCoordinates = new int[2]; private final KeyDetector mKeyDetector; @@ -43,7 +43,7 @@ public class MiniKeyboardView extends KeyboardView implements MoreKeysPanel { private static final TimerProxy EMPTY_TIMER_PROXY = new TimerProxy.Adapter(); - private final KeyboardActionListener mMiniKeyboardListener = + private final KeyboardActionListener mMoreKeysKeyboardListener = new KeyboardActionListener.Adapter() { @Override public void onCodeInput(int primaryCode, int[] keyCodes, int x, int y) { @@ -71,16 +71,16 @@ public class MiniKeyboardView extends KeyboardView implements MoreKeysPanel { } }; - public MiniKeyboardView(Context context, AttributeSet attrs) { - this(context, attrs, R.attr.miniKeyboardViewStyle); + public MoreKeysKeyboardView(Context context, AttributeSet attrs) { + this(context, attrs, R.attr.moreKeysKeyboardViewStyle); } - public MiniKeyboardView(Context context, AttributeSet attrs, int defStyle) { + public MoreKeysKeyboardView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); final Resources res = context.getResources(); mKeyDetector = new MoreKeysDetector( - res.getDimension(R.dimen.mini_keyboard_slide_allowance)); + res.getDimension(R.dimen.more_keys_keyboard_slide_allowance)); setKeyPreviewPopupEnabled(false, 0); } @@ -110,7 +110,7 @@ public class MiniKeyboardView extends KeyboardView implements MoreKeysPanel { @Override public KeyboardActionListener getKeyboardActionListener() { - return mMiniKeyboardListener; + return mMoreKeysKeyboardListener; } @Override @@ -125,7 +125,7 @@ public class MiniKeyboardView extends KeyboardView implements MoreKeysPanel { @Override public void setKeyPreviewPopupEnabled(boolean previewEnabled, int delay) { - // Mini keyboard needs no pop-up key preview displayed, so we pass always false with a + // More keys keyboard needs no pop-up key preview displayed, so we pass always false with a // delay of 0. The delay does not matter actually since the popup is not shown anyway. super.setKeyPreviewPopupEnabled(false, 0); } @@ -136,13 +136,13 @@ public class MiniKeyboardView extends KeyboardView implements MoreKeysPanel { mController = controller; mListener = listener; final View container = (View)getParent(); - final MiniKeyboard miniKeyboard = (MiniKeyboard)getKeyboard(); + final MoreKeysKeyboard moreKeysKeyboard = (MoreKeysKeyboard)getKeyboard(); parentView.getLocationInWindow(mCoordinates); - final int miniKeyboardLeft = pointX - miniKeyboard.getDefaultCoordX() + final int moreKeysKeyboardLeft = pointX - moreKeysKeyboard.getDefaultCoordX() + parentView.getPaddingLeft(); - final int x = wrapUp(Math.max(0, Math.min(miniKeyboardLeft, - parentView.getWidth() - miniKeyboard.mOccupiedWidth)) + final int x = wrapUp(Math.max(0, Math.min(moreKeysKeyboardLeft, + parentView.getWidth() - moreKeysKeyboard.mOccupiedWidth)) - container.getPaddingLeft() + mCoordinates[0], container.getMeasuredWidth(), 0, parentView.getWidth()); final int y = pointY diff --git a/java/src/com/android/inputmethod/keyboard/ProximityInfo.java b/java/src/com/android/inputmethod/keyboard/ProximityInfo.java index 2d1a0083d..41e7ef435 100644 --- a/java/src/com/android/inputmethod/keyboard/ProximityInfo.java +++ b/java/src/com/android/inputmethod/keyboard/ProximityInfo.java @@ -59,7 +59,7 @@ public class ProximityInfo { mKeyHeight = keyHeight; mGridNeighbors = new Key[mGridSize][]; if (minWidth == 0 || height == 0) { - // No proximity required. Keyboard might be mini keyboard. + // No proximity required. Keyboard might be more keys keyboard. return; } computeNearestNeighbors(keyWidth, keys, touchPositionCorrection, additionalProximityChars); diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeySpecParser.java b/java/src/com/android/inputmethod/keyboard/internal/KeySpecParser.java index e3c5da456..1626a140b 100644 --- a/java/src/com/android/inputmethod/keyboard/internal/KeySpecParser.java +++ b/java/src/com/android/inputmethod/keyboard/internal/KeySpecParser.java @@ -133,18 +133,28 @@ public class KeySpecParser { return label; } + private static String getOutputTextInternal(String moreKeySpec) { + final int end = indexOfLabelEnd(moreKeySpec, 0); + if (end <= 0) { + return null; + } + if (indexOfLabelEnd(moreKeySpec, end + 1) >= 0) { + throw new KeySpecParserError("Multiple " + LABEL_END + ": " + moreKeySpec); + } + return parseEscape(moreKeySpec.substring(end + /* LABEL_END */1)); + } + public static String getOutputText(String moreKeySpec) { if (hasCode(moreKeySpec)) { return null; } - final int end = indexOfLabelEnd(moreKeySpec, 0); - if (end > 0) { - if (indexOfLabelEnd(moreKeySpec, end + 1) >= 0) { - throw new KeySpecParserError("Multiple " + LABEL_END + ": " - + moreKeySpec); + final String outputText = getOutputTextInternal(moreKeySpec); + if (outputText != null) { + if (Utils.codePointCount(outputText) == 1) { + // If output text is one code point, it should be treated as a code. + // See {@link #getCode(Resources, String)}. + return null; } - final String outputText = parseEscape( - moreKeySpec.substring(end + /* LABEL_END */1)); if (!TextUtils.isEmpty(outputText)) { return outputText; } @@ -170,7 +180,13 @@ public class KeySpecParser { final int code = res.getInteger(resId); return code; } - if (indexOfLabelEnd(moreKeySpec, 0) > 0) { + final String outputText = getOutputTextInternal(moreKeySpec); + if (outputText != null) { + // If output text is one code point, it should be treated as a code. + // See {@link #getOutputText(String)}. + if (Utils.codePointCount(outputText) == 1) { + return outputText.codePointAt(0); + } return Keyboard.CODE_OUTPUT_TEXT; } final String label = getLabel(moreKeySpec); diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeyStyles.java b/java/src/com/android/inputmethod/keyboard/internal/KeyStyles.java index 6ec56ca9f..12a9c51f2 100644 --- a/java/src/com/android/inputmethod/keyboard/internal/KeyStyles.java +++ b/java/src/com/android/inputmethod/keyboard/internal/KeyStyles.java @@ -40,17 +40,13 @@ public class KeyStyles { public String[] getStringArray(TypedArray a, int index); public String getString(TypedArray a, int index); public int getInt(TypedArray a, int index, int defaultValue); - public int getFlag(TypedArray a, int index, int defaultValue); + public int getFlag(TypedArray a, int index); } - private static class EmptyKeyStyle implements KeyStyle { - EmptyKeyStyle() { - // Nothing to do. - } - + static class EmptyKeyStyle implements KeyStyle { @Override public String[] getStringArray(TypedArray a, int index) { - return parseStringArray(a, index); + return KeyStyles.parseStringArray(a, index); } @Override @@ -64,50 +60,47 @@ public class KeyStyles { } @Override - public int getFlag(TypedArray a, int index, int defaultValue) { - return a.getInt(index, defaultValue); - } - - protected static String[] parseStringArray(TypedArray a, int index) { - if (!a.hasValue(index)) - return null; - return KeySpecParser.parseCsvString( - a.getString(index), a.getResources(), R.string.english_ime_name); + public int getFlag(TypedArray a, int index) { + return a.getInt(index, 0); } } - private static class DeclaredKeyStyle extends EmptyKeyStyle { - private final HashMap<Integer, Object> mAttributes = new HashMap<Integer, Object>(); + static class DeclaredKeyStyle implements KeyStyle { + private final HashMap<Integer, Object> mStyleAttributes = new HashMap<Integer, Object>(); @Override public String[] getStringArray(TypedArray a, int index) { - return a.hasValue(index) - ? super.getStringArray(a, index) : (String[])mAttributes.get(index); + if (a.hasValue(index)) { + return parseStringArray(a, index); + } + return (String[])mStyleAttributes.get(index); } @Override public String getString(TypedArray a, int index) { - return a.hasValue(index) - ? super.getString(a, index) : (String)mAttributes.get(index); + if (a.hasValue(index)) { + return a.getString(index); + } + return (String)mStyleAttributes.get(index); } @Override public int getInt(TypedArray a, int index, int defaultValue) { - final Integer value = (Integer)mAttributes.get(index); - return super.getInt(a, index, (value != null) ? value : defaultValue); + if (a.hasValue(index)) { + return a.getInt(index, defaultValue); + } + final Integer styleValue = (Integer)mStyleAttributes.get(index); + return styleValue != null ? styleValue : defaultValue; } @Override - public int getFlag(TypedArray a, int index, int defaultValue) { - final Integer value = (Integer)mAttributes.get(index); - return super.getFlag(a, index, defaultValue) | (value != null ? value : 0); - } - - DeclaredKeyStyle() { - super(); + public int getFlag(TypedArray a, int index) { + final int value = a.getInt(index, 0); + final Integer styleValue = (Integer)mStyleAttributes.get(index); + return (styleValue != null ? styleValue : 0) | value; } - void parseKeyStyleAttributes(TypedArray keyAttr) { + void readKeyAttributes(TypedArray keyAttr) { // TODO: Currently not all Key attributes can be declared as style. readInt(keyAttr, R.styleable.Keyboard_Key_code); readInt(keyAttr, R.styleable.Keyboard_Key_altCode); @@ -126,52 +119,68 @@ public class KeyStyles { } private void readString(TypedArray a, int index) { - if (a.hasValue(index)) - mAttributes.put(index, a.getString(index)); + if (a.hasValue(index)) { + mStyleAttributes.put(index, a.getString(index)); + } } private void readInt(TypedArray a, int index) { - if (a.hasValue(index)) - mAttributes.put(index, a.getInt(index, 0)); + if (a.hasValue(index)) { + mStyleAttributes.put(index, a.getInt(index, 0)); + } } private void readFlag(TypedArray a, int index) { - final Integer value = (Integer)mAttributes.get(index); - if (a.hasValue(index)) - mAttributes.put(index, a.getInt(index, 0) | (value != null ? value : 0)); + final Integer value = (Integer)mStyleAttributes.get(index); + if (a.hasValue(index)) { + mStyleAttributes.put(index, a.getInt(index, 0) | (value != null ? value : 0)); + } } private void readStringArray(TypedArray a, int index) { final String[] value = parseStringArray(a, index); - if (value != null) - mAttributes.put(index, value); + if (value != null) { + mStyleAttributes.put(index, value); + } + } + + void addParentStyleAttributes(DeclaredKeyStyle parentStyle) { + mStyleAttributes.putAll(parentStyle.mStyleAttributes); } + } - void addParent(DeclaredKeyStyle parentStyle) { - mAttributes.putAll(parentStyle.mAttributes); + static String[] parseStringArray(TypedArray a, int index) { + if (a.hasValue(index)) { + return KeySpecParser.parseCsvString( + a.getString(index), a.getResources(), R.string.english_ime_name); } + return null; } public void parseKeyStyleAttributes(TypedArray keyStyleAttr, TypedArray keyAttrs, XmlPullParser parser) throws XmlPullParserException { final String styleName = keyStyleAttr.getString(R.styleable.Keyboard_KeyStyle_styleName); - if (DEBUG) Log.d(TAG, String.format("<%s styleName=%s />", - Keyboard.Builder.TAG_KEY_STYLE, styleName)); - if (mStyles.containsKey(styleName)) + if (DEBUG) { + Log.d(TAG, String.format("<%s styleName=%s />", + Keyboard.Builder.TAG_KEY_STYLE, styleName)); + } + if (mStyles.containsKey(styleName)) { throw new XmlParseUtils.ParseException( "duplicate key style declared: " + styleName, parser); + } final DeclaredKeyStyle style = new DeclaredKeyStyle(); if (keyStyleAttr.hasValue(R.styleable.Keyboard_KeyStyle_parentStyle)) { final String parentStyle = keyStyleAttr.getString( R.styleable.Keyboard_KeyStyle_parentStyle); final DeclaredKeyStyle parent = mStyles.get(parentStyle); - if (parent == null) + if (parent == null) { throw new XmlParseUtils.ParseException( "Unknown parentStyle " + parentStyle, parser); - style.addParent(parent); + } + style.addParentStyleAttributes(parent); } - style.parseKeyStyleAttributes(keyAttrs); + style.readKeyAttributes(keyAttrs); mStyles.put(styleName, style); } diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index 8aaa0692f..1cb79e707 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -187,7 +187,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar private View mKeyPreviewBackingView; private View mSuggestionsContainer; private SuggestionsView mSuggestionsView; - private Suggest mSuggest; + /* package for tests */ Suggest mSuggest; private CompletionInfo[] mApplicationSpecifiedCompletions; private InputMethodManagerCompatWrapper mImm; @@ -1225,12 +1225,41 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar return mOptionsDialog != null && mOptionsDialog.isShowing(); } - private void insertPunctuationFromSuggestionStrip(final InputConnection ic, final int code) { + private void insertPunctuationFromSuggestionStrip(final int code) { onCodeInput(code, new int[] { code }, KeyboardActionListener.SUGGESTION_STRIP_COORDINATE, KeyboardActionListener.SUGGESTION_STRIP_COORDINATE); } + private static int getEditorActionId(EditorInfo editorInfo) { + if (editorInfo == null) return 0; + return (editorInfo.actionLabel != null) + ? editorInfo.actionId + : (editorInfo.imeOptions & EditorInfo.IME_MASK_ACTION); + } + + private void performeEditorAction(int actionId) { + final InputConnection ic = getCurrentInputConnection(); + if (ic != null) { + ic.performEditorAction(actionId); + } + } + + private void sendKeyCodePoint(int code) { + // TODO: Remove this special handling of digit letters. + // For backward compatibility. See {@link InputMethodService#sendKeyChar(char)}. + if (code >= '0' && code <= '9') { + super.sendKeyChar((char)code); + return; + } + + final InputConnection ic = getCurrentInputConnection(); + if (ic != null) { + final String text = new String(new int[] { code }, 0, 1); + ic.commitText(text, text.length()); + } + } + // Implementation of {@link KeyboardActionListener}. @Override public void onCodeInput(int primaryCode, int[] keyCodes, int x, int y) { @@ -1271,6 +1300,9 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar case Keyboard.CODE_SHORTCUT: mSubtypeSwitcher.switchToShortcutIME(); break; + case Keyboard.CODE_ACTION_ENTER: + performeEditorAction(getEditorActionId(getCurrentInputEditorInfo())); + break; case Keyboard.CODE_TAB: handleTab(); // There are two cases for tab. Either we send a "next" event, that may change the @@ -1308,7 +1340,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar commitTyped(ic); text = specificTldProcessingOnTextInput(ic, text); if (SPACE_STATE_PHANTOM == mSpaceState) { - sendKeyChar((char)Keyboard.CODE_SPACE); + sendKeyCodePoint(Keyboard.CODE_SPACE); } ic.commitText(text, 1); ic.endBatchEdit(); @@ -1327,10 +1359,12 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar // Not a tld: do nothing. return text; } + // We have a TLD (or something that looks like this): make sure we don't add + // a space even if currently in phantom mode. + mSpaceState = SPACE_STATE_NONE; final CharSequence lastOne = ic.getTextBeforeCursor(1, 0); if (lastOne != null && lastOne.length() == 1 && lastOne.charAt(0) == Keyboard.CODE_PERIOD) { - mSpaceState = SPACE_STATE_NONE; return text.subSequence(1, text.length()); } else { return text; @@ -1399,7 +1433,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar } if (SPACE_STATE_DOUBLE == spaceState) { - if (revertDoubleSpace(ic)) { + if (revertDoubleSpaceWhileInBatchEdit(ic)) { // No need to reset mSpaceState, it has already be done (that's why we // receive it as a parameter) return; @@ -1453,10 +1487,12 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar } } + // TODO: Implement next and previous actions using other key code than tab's code. private void handleTab() { final int imeOptions = getCurrentInputEditorInfo().imeOptions; if (!EditorInfoCompatUtils.hasFlagNavigateNext(imeOptions) && !EditorInfoCompatUtils.hasFlagNavigatePrevious(imeOptions)) { + // TODO: This should be {@link #sendKeyCodePoint(int)}. sendDownUpKeyEvents(KeyEvent.KEYCODE_TAB); return; } @@ -1475,6 +1511,28 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar } } + // ic may be null + private boolean maybeStripSpaceWhileInBatchEdit(final InputConnection ic, final int code, + final int spaceState, final boolean isFromSuggestionStrip) { + if (Keyboard.CODE_ENTER == code && SPACE_STATE_SWAP_PUNCTUATION == spaceState) { + removeTrailingSpaceWhileInBatchEdit(ic); + return false; + } else if ((SPACE_STATE_WEAK == spaceState + || SPACE_STATE_SWAP_PUNCTUATION == spaceState) + && isFromSuggestionStrip) { + if (mSettingsValues.isMagicSpaceSwapper(code)) { + return true; + } else { + if (mSettingsValues.isMagicSpaceStripper(code)) { + removeTrailingSpaceWhileInBatchEdit(ic); + } + return false; + } + } else { + return false; + } + } + private void handleCharacter(final int primaryCode, final int[] keyCodes, final int x, final int y, final int spaceState) { mVoiceProxy.handleCharacter(); @@ -1489,7 +1547,6 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar private void handleCharacterWhileInBatchEdit(final int primaryCode, final int[] keyCodes, final int x, final int y, final int spaceState, final InputConnection ic) { boolean isComposingWord = mWordComposer.isComposingWord(); - int code = primaryCode; if (SPACE_STATE_PHANTOM == spaceState && !mSettingsValues.isSymbolExcludedFromWordSeparators(primaryCode)) { @@ -1497,17 +1554,18 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar // Sanity check throw new RuntimeException("Should not be composing here"); } - sendKeyChar((char)Keyboard.CODE_SPACE); + sendKeyCodePoint(Keyboard.CODE_SPACE); } - if ((isAlphabet(code) || mSettingsValues.isSymbolExcludedFromWordSeparators(code)) + if ((isAlphabet(primaryCode) + || mSettingsValues.isSymbolExcludedFromWordSeparators(primaryCode)) && isSuggestionsRequested() && !isCursorTouchingWord()) { if (!isComposingWord) { // Reset entirely the composing state anyway, then start composing a new word unless // the character is a single quote. The idea here is, single quote is not a // separator and it should be treated as a normal character, except in the first // position where it should not start composing a word. - isComposingWord = (Keyboard.CODE_SINGLE_QUOTE != code); + isComposingWord = (Keyboard.CODE_SINGLE_QUOTE != primaryCode); // Here we don't need to reset the last composed word. It will be reset // when we commit this one, if we ever do; if on the other hand we backspace // it entirely and resume suggestions on the previous word, we'd like to still @@ -1518,7 +1576,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar } } if (isComposingWord) { - mWordComposer.add(code, keyCodes, x, y); + mWordComposer.add(primaryCode, keyCodes, x, y); if (ic != null) { // If it's the first letter, make note of auto-caps state if (mWordComposer.size() == 1) { @@ -1529,14 +1587,17 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar } mHandler.postUpdateSuggestions(); } else { - sendKeyChar((char)code); - } + final boolean swapWeakSpace = maybeStripSpaceWhileInBatchEdit(ic, primaryCode, + spaceState, KeyboardActionListener.SUGGESTION_STRIP_COORDINATE == x); - if (mSettingsValues.isWordSeparator(code)) { - Utils.Stats.onSeparator((char)code, x, y); - } else { - Utils.Stats.onNonSeparator((char)code, x, y); + sendKeyCodePoint(primaryCode); + + if (swapWeakSpace) { + swapSwapperAndSpaceWhileInBatchEdit(ic); + mSpaceState = SPACE_STATE_WEAK; + } } + Utils.Stats.onNonSeparator((char)primaryCode, x, y); } // Returns true if we did an autocorrection, false otherwise. @@ -1572,29 +1633,10 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar } } - final boolean swapWeakSpace; - if (Keyboard.CODE_ENTER == primaryCode && SPACE_STATE_SWAP_PUNCTUATION == spaceState) { - removeTrailingSpaceWhileInBatchEdit(ic); - swapWeakSpace = false; - } else if ((SPACE_STATE_WEAK == spaceState || SPACE_STATE_SWAP_PUNCTUATION == spaceState) - && KeyboardActionListener.SUGGESTION_STRIP_COORDINATE == x) { - if (mSettingsValues.isMagicSpaceSwapper(primaryCode)) { - swapWeakSpace = true; - } else { - swapWeakSpace = false; - if (mSettingsValues.isMagicSpaceStripper(primaryCode)) { - removeTrailingSpaceWhileInBatchEdit(ic); - } - } - } else { - swapWeakSpace = false; - } + final boolean swapWeakSpace = maybeStripSpaceWhileInBatchEdit(ic, primaryCode, spaceState, + KeyboardActionListener.SUGGESTION_STRIP_COORDINATE == x); - // TODO: rethink interactions of sendKeyChar, commitText("\n") and actions. sendKeyChar - // with a CODE_ENTER parameter will have the default InputMethodService implementation - // possibly redirect on the keyboard action. That may be the right thing to do, but - // on Shift+Enter, it's generally not, so we may want to do the redirection right here. - sendKeyChar((char)primaryCode); + sendKeyCodePoint(primaryCode); if (Keyboard.CODE_SPACE == primaryCode) { if (isSuggestionsRequested()) { @@ -1613,7 +1655,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar } else { if (swapWeakSpace) { swapSwapperAndSpaceWhileInBatchEdit(ic); - mSpaceState = SPACE_STATE_WEAK; + mSpaceState = SPACE_STATE_SWAP_PUNCTUATION; } else if (SPACE_STATE_PHANTOM == spaceState) { // If we are in phantom space state, and the user presses a separator, we want to // stay in phantom space state so that the next keypress has a chance to add the @@ -1869,52 +1911,40 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar } @Override - public void pickSuggestionManually(int index, CharSequence suggestion) { + public void pickSuggestionManually(final int index, final CharSequence suggestion) { mComposingStateManager.onFinishComposingText(); - SuggestedWords suggestions = mSuggestionsView.getSuggestions(); + final SuggestedWords suggestions = mSuggestionsView.getSuggestions(); mVoiceProxy.flushAndLogAllTextModificationCounters(index, suggestion, mSettingsValues.mWordSeparators); - final InputConnection ic = getCurrentInputConnection(); - if (ic != null) { - ic.beginBatchEdit(); - } if (mInputAttributes.mApplicationSpecifiedCompletionOn && mApplicationSpecifiedCompletions != null && index >= 0 && index < mApplicationSpecifiedCompletions.length) { - if (ic != null) { - final CompletionInfo completionInfo = mApplicationSpecifiedCompletions[index]; - ic.commitCompletion(completionInfo); - } if (mSuggestionsView != null) { mSuggestionsView.clear(); } mKeyboardSwitcher.updateShiftState(); + final InputConnection ic = getCurrentInputConnection(); if (ic != null) { + ic.beginBatchEdit(); + final CompletionInfo completionInfo = mApplicationSpecifiedCompletions[index]; + ic.commitCompletion(completionInfo); ic.endBatchEdit(); } return; } - // If this is a punctuation, apply it through the normal key press - if (suggestion.length() == 1 && (mSettingsValues.isWordSeparator(suggestion.charAt(0)) - || mSettingsValues.isSuggestedPunctuation(suggestion.charAt(0)))) { + // If this is a punctuation picked from the suggestion strip, pass it to onCodeInput + if (suggestion.length() == 1 && isShowingPunctuationList()) { // Word separators are suggested before the user inputs something. // So, LatinImeLogger logs "" as a user's input. LatinImeLogger.logOnManualSuggestion( "", suggestion.toString(), index, suggestions.mWords); - final CharSequence outputText = mSettingsValues.mSuggestPuncOutputTextList - .getWord(index); - final int primaryCode = outputText.charAt(0); - // Find out whether the previous character is a space. If it is, as a special case - // for punctuation entered through the suggestion strip, it should be swapped - // if it was a magic or a weak space. This is meant to help in case the user - // pressed space on purpose of displaying the suggestion strip punctuation. - insertPunctuationFromSuggestionStrip(ic, primaryCode); - // TODO: the following endBatchEdit seems useless, check - if (ic != null) { - ic.endBatchEdit(); - } + // Rely on onCodeInput to do the complicated swapping/stripping logic consistently. + final int primaryCode = suggestion.charAt(0); + onCodeInput(primaryCode, new int[] { primaryCode }, + KeyboardActionListener.SUGGESTION_STRIP_COORDINATE, + KeyboardActionListener.SUGGESTION_STRIP_COORDINATE); return; } // We need to log before we commit, because the word composer will store away the user @@ -1967,9 +1997,6 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar mHandler.postUpdateSuggestions(); } } - if (ic != null) { - ic.endBatchEdit(); - } } /** @@ -2081,21 +2108,20 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar CharSequence toLeft = ic.getTextBeforeCursor(1, 0); CharSequence toRight = ic.getTextAfterCursor(1, 0); if (!TextUtils.isEmpty(toLeft) - && !mSettingsValues.isWordSeparator(toLeft.charAt(0)) - && !mSettingsValues.isSuggestedPunctuation(toLeft.charAt(0))) { + && !mSettingsValues.isWordSeparator(toLeft.charAt(0))) { return true; } if (!TextUtils.isEmpty(toRight) - && !mSettingsValues.isWordSeparator(toRight.charAt(0)) - && !mSettingsValues.isSuggestedPunctuation(toRight.charAt(0))) { + && !mSettingsValues.isWordSeparator(toRight.charAt(0))) { return true; } return false; } // "ic" must not be null - private static boolean sameAsTextBeforeCursor(final InputConnection ic, CharSequence text) { - CharSequence beforeText = ic.getTextBeforeCursor(text.length(), 0); + private static boolean sameAsTextBeforeCursor(final InputConnection ic, + final CharSequence text) { + final CharSequence beforeText = ic.getTextBeforeCursor(text.length(), 0); return TextUtils.equals(text, beforeText); } @@ -2212,13 +2238,14 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar } } ic.deleteSurroundingText(restartLength, 0); + mComposingStateManager.onStartComposingText(); ic.setComposingText(mWordComposer.getTypedWord(), 1); mHandler.cancelUpdateBigramPredictions(); mHandler.postUpdateSuggestions(); } // "ic" must not be null - private boolean revertDoubleSpace(final InputConnection ic) { + private boolean revertDoubleSpaceWhileInBatchEdit(final InputConnection ic) { mHandler.cancelDoubleSpacesTimer(); // Here we test whether we indeed have a period and a space before us. This should not // be needed, but it's there just in case something went wrong. @@ -2231,10 +2258,8 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar + "\". \" just before the cursor."); return false; } - ic.beginBatchEdit(); ic.deleteSurroundingText(2, 0); ic.commitText(" ", 1); - ic.endBatchEdit(); return true; } diff --git a/java/src/com/android/inputmethod/latin/SettingsValues.java b/java/src/com/android/inputmethod/latin/SettingsValues.java index 589cb6f86..6b652313c 100644 --- a/java/src/com/android/inputmethod/latin/SettingsValues.java +++ b/java/src/com/android/inputmethod/latin/SettingsValues.java @@ -222,10 +222,6 @@ public class SettingsValues { res.getBoolean(R.bool.config_default_vibration_enabled)); } - public boolean isSuggestedPunctuation(int code) { - return mSuggestPuncs.contains(String.valueOf((char)code)); - } - public boolean isWordSeparator(int code) { return mWordSeparators.contains(String.valueOf((char)code)); } diff --git a/java/src/com/android/inputmethod/latin/WordComposer.java b/java/src/com/android/inputmethod/latin/WordComposer.java index f418968b5..a1a329a8d 100644 --- a/java/src/com/android/inputmethod/latin/WordComposer.java +++ b/java/src/com/android/inputmethod/latin/WordComposer.java @@ -90,11 +90,11 @@ public class WordComposer { * @return the number of keystrokes */ public final int size() { - return mTypedWord.length(); + return mCodes.size(); } public final boolean isComposingWord() { - return size() > 0; + return mCodes.size() > 0; } /** @@ -125,8 +125,8 @@ public class WordComposer { * @param codes the array of unicode values */ public void add(int primaryCode, int[] codes, int x, int y) { - final int newIndex = size(); - mTypedWord.append((char) primaryCode); + final int newIndex = mCodes.size(); + mTypedWord.appendCodePoint(primaryCode); correctPrimaryJuxtapos(primaryCode, codes); mCodes.add(codes); if (newIndex < BinaryDictionary.MAX_WORD_LENGTH) { @@ -171,8 +171,8 @@ public class WordComposer { final KeyDetector keyDetector) { reset(); final int length = word.length(); - for (int i = 0; i < length; ++i) { - int codePoint = word.charAt(i); + for (int i = 0; i < length; i = Character.offsetByCodePoints(word, i, 1)) { + int codePoint = Character.codePointAt(word, i); addKeyInfo(codePoint, keyboard, keyDetector); } } @@ -207,16 +207,25 @@ public class WordComposer { * Delete the last keystroke as a result of hitting backspace. */ public void deleteLast() { - final int size = size(); + final int size = mCodes.size(); if (size > 0) { - final int lastPos = size - 1; - char lastChar = mTypedWord.charAt(lastPos); - mCodes.remove(lastPos); - // TODO: This crashes and catches fire if the code point doesn't fit a char - mTypedWord.deleteCharAt(lastPos); + mCodes.remove(size - 1); + // Note: mTypedWord.length() and mCodes.length differ when there are surrogate pairs + final int stringBuilderLength = mTypedWord.length(); + if (stringBuilderLength < size) { + throw new RuntimeException( + "In WordComposer: mCodes and mTypedWords have non-matching lengths"); + } + final int lastChar = mTypedWord.codePointBefore(stringBuilderLength); + if (Character.isSupplementaryCodePoint(lastChar)) { + mTypedWord.delete(stringBuilderLength - 2, stringBuilderLength); + } else { + mTypedWord.deleteCharAt(stringBuilderLength - 1); + } if (Character.isUpperCase(lastChar)) mCapsCount--; } - if (size() == 0) { + // We may have deleted the last one. + if (0 == mCodes.size()) { mIsFirstCharCapitalized = false; } if (mTrailingSingleQuotesCount > 0) { |