diff options
Diffstat (limited to 'java')
140 files changed, 3379 insertions, 616 deletions
diff --git a/java/proguard.flags b/java/proguard.flags index a5a667987..e33706c47 100644 --- a/java/proguard.flags +++ b/java/proguard.flags @@ -35,10 +35,22 @@ *; } +-keep class com.android.inputmethod.keyboard.LatinKeyboardView { + # Keep getter/setter methods for ObjectAnimator + int getLanguageOnSpacebarAnimAlpha(); + void setLanguageOnSpacebarAnimAlpha(int); + int getAltCodeKeyWhileTypingAnimAlhpa(); + void setAltCodeKeyWhileTypingAnimAlpha(int); +} + -keep class com.android.inputmethod.keyboard.MoreKeysKeyboard$Builder$MoreKeysKeyboardParams { <init>(...); } +-keep class com.android.inputmethod.latin.ResearchLogger { + void setLogFileManager(...); +} + # The support library contains references to newer platform versions. # Don't warn about those in case this app is linking against an older # platform version. We know about them, and they are safe. diff --git a/java/res/anim/alt_code_key_while_typing_fadein.xml b/java/res/anim/alt_code_key_while_typing_fadein.xml index 3f5fd5d48..f8caca313 100644 --- a/java/res/anim/alt_code_key_while_typing_fadein.xml +++ b/java/res/anim/alt_code_key_while_typing_fadein.xml @@ -18,8 +18,9 @@ */ --> -<animator +<objectAnimator xmlns:android="http://schemas.android.com/apk/res/android" + android:propertyName="altCodeKeyWhileTypingAnimAlpha" android:valueType="intType" android:duration="100" android:valueFrom="128" diff --git a/java/res/anim/alt_code_key_while_typing_fadeout.xml b/java/res/anim/alt_code_key_while_typing_fadeout.xml index ed4a6f298..bad1e7465 100644 --- a/java/res/anim/alt_code_key_while_typing_fadeout.xml +++ b/java/res/anim/alt_code_key_while_typing_fadeout.xml @@ -18,8 +18,9 @@ */ --> -<animator +<objectAnimator xmlns:android="http://schemas.android.com/apk/res/android" + android:propertyName="altCodeKeyWhileTypingAnimAlpha" android:valueType="intType" android:duration="70" android:valueFrom="255" diff --git a/java/res/anim/language_on_spacebar_fadeout.xml b/java/res/anim/language_on_spacebar_fadeout.xml index f66e1627b..531f440cc 100644 --- a/java/res/anim/language_on_spacebar_fadeout.xml +++ b/java/res/anim/language_on_spacebar_fadeout.xml @@ -18,10 +18,11 @@ */ --> -<animator +<objectAnimator xmlns:android="http://schemas.android.com/apk/res/android" + android:propertyName="languageOnSpacebarAnimAlpha" android:valueType="intType" android:startOffset="1200" android:duration="200" android:valueFrom="255" - android:valueTo="128" /> + android:valueTo="@integer/config_language_on_spacebar_final_alpha" /> diff --git a/java/res/drawable-hdpi/sym_keyboard_zwj_holo.png b/java/res/drawable-hdpi/sym_keyboard_zwj_holo.png Binary files differnew file mode 100644 index 000000000..5fa30ceb8 --- /dev/null +++ b/java/res/drawable-hdpi/sym_keyboard_zwj_holo.png diff --git a/java/res/drawable-hdpi/sym_keyboard_zwnj_holo.png b/java/res/drawable-hdpi/sym_keyboard_zwnj_holo.png Binary files differnew file mode 100644 index 000000000..91367f3d2 --- /dev/null +++ b/java/res/drawable-hdpi/sym_keyboard_zwnj_holo.png diff --git a/java/res/drawable-mdpi/sym_keyboard_zwj_holo.png b/java/res/drawable-mdpi/sym_keyboard_zwj_holo.png Binary files differnew file mode 100644 index 000000000..70370d83d --- /dev/null +++ b/java/res/drawable-mdpi/sym_keyboard_zwj_holo.png diff --git a/java/res/drawable-mdpi/sym_keyboard_zwnj_holo.png b/java/res/drawable-mdpi/sym_keyboard_zwnj_holo.png Binary files differnew file mode 100644 index 000000000..a69eade17 --- /dev/null +++ b/java/res/drawable-mdpi/sym_keyboard_zwnj_holo.png diff --git a/java/res/drawable-xhdpi/sym_keyboard_zwj_holo.png b/java/res/drawable-xhdpi/sym_keyboard_zwj_holo.png Binary files differnew file mode 100644 index 000000000..26694274e --- /dev/null +++ b/java/res/drawable-xhdpi/sym_keyboard_zwj_holo.png diff --git a/java/res/drawable-xhdpi/sym_keyboard_zwnj_holo.png b/java/res/drawable-xhdpi/sym_keyboard_zwnj_holo.png Binary files differnew file mode 100644 index 000000000..75a22b65f --- /dev/null +++ b/java/res/drawable-xhdpi/sym_keyboard_zwnj_holo.png diff --git a/java/res/values-be/strings.xml b/java/res/values-be/strings.xml index ac4433feb..fb72634b0 100644 --- a/java/res/values-be/strings.xml +++ b/java/res/values-be/strings.xml @@ -37,12 +37,9 @@ <string name="misc_category" msgid="6894192814868233453">"Іншыя параметры"</string> <string name="advanced_settings" msgid="362895144495591463">"Адмысловыя налады"</string> <string name="advanced_settings_summary" msgid="4487980456152830271">"Функцыi для спецыялістаў"</string> - <!-- no translation found for include_other_imes_in_language_switch_list (4533689960308565519) --> - <skip /> - <!-- no translation found for include_other_imes_in_language_switch_list_summary (840637129103317635) --> - <skip /> - <!-- no translation found for suppress_language_switch_key (8003788410354806368) --> - <skip /> + <string name="include_other_imes_in_language_switch_list" msgid="4533689960308565519">"Перакл. да інш. спос. ув."</string> + <string name="include_other_imes_in_language_switch_list_summary" msgid="840637129103317635">"Кнопка пераключэння мовы звязана i з iншымi спосабамi ўводу"</string> + <string name="suppress_language_switch_key" msgid="8003788410354806368">"Забаранiць кнопку пераключэння мовы"</string> <string name="key_preview_popup_dismiss_delay" msgid="6213164897443068248">"Затрым. скр. падк. клав."</string> <string name="key_preview_popup_dismiss_no_delay" msgid="2096123151571458064">"Няма затрымкі"</string> <string name="key_preview_popup_dismiss_default_delay" msgid="2166964333903906734">"Па змаўчанні"</string> diff --git a/java/res/values-bg/strings.xml b/java/res/values-bg/strings.xml index f3b9347a4..c92b95c21 100644 --- a/java/res/values-bg/strings.xml +++ b/java/res/values-bg/strings.xml @@ -37,12 +37,9 @@ <string name="misc_category" msgid="6894192814868233453">"Други опции"</string> <string name="advanced_settings" msgid="362895144495591463">"Разширени настройки"</string> <string name="advanced_settings_summary" msgid="4487980456152830271">"Опции за експерти"</string> - <!-- no translation found for include_other_imes_in_language_switch_list (4533689960308565519) --> - <skip /> - <!-- no translation found for include_other_imes_in_language_switch_list_summary (840637129103317635) --> - <skip /> - <!-- no translation found for suppress_language_switch_key (8003788410354806368) --> - <skip /> + <string name="include_other_imes_in_language_switch_list" msgid="4533689960308565519">"Други методи за въвеждане"</string> + <string name="include_other_imes_in_language_switch_list_summary" msgid="840637129103317635">"Клавишът за превкл. на езика обхваща и други методи за въвеждане"</string> + <string name="suppress_language_switch_key" msgid="8003788410354806368">"Потискане"</string> <string name="key_preview_popup_dismiss_delay" msgid="6213164897443068248">"Отхвърляне на подсказката"</string> <string name="key_preview_popup_dismiss_no_delay" msgid="2096123151571458064">"Без задържане"</string> <string name="key_preview_popup_dismiss_default_delay" msgid="2166964333903906734">"По подразбиране"</string> diff --git a/java/res/values-ca/strings.xml b/java/res/values-ca/strings.xml index 619dc38af..9d69eb2e7 100644 --- a/java/res/values-ca/strings.xml +++ b/java/res/values-ca/strings.xml @@ -37,12 +37,9 @@ <string name="misc_category" msgid="6894192814868233453">"Altres opcions"</string> <string name="advanced_settings" msgid="362895144495591463">"Configuració avançada"</string> <string name="advanced_settings_summary" msgid="4487980456152830271">"Opcions per a experts"</string> - <!-- no translation found for include_other_imes_in_language_switch_list (4533689960308565519) --> - <skip /> - <!-- no translation found for include_other_imes_in_language_switch_list_summary (840637129103317635) --> - <skip /> - <!-- no translation found for suppress_language_switch_key (8003788410354806368) --> - <skip /> + <string name="include_other_imes_in_language_switch_list" msgid="4533689960308565519">"Canvia de mètode entrada"</string> + <string name="include_other_imes_in_language_switch_list_summary" msgid="840637129103317635">"La tecla de canvi d\'idioma també cobreix altres mètodes d\'entrada"</string> + <string name="suppress_language_switch_key" msgid="8003788410354806368">"Suprimeix la tecla d\'idioma"</string> <string name="key_preview_popup_dismiss_delay" msgid="6213164897443068248">"Retard d\'om. em. de tecla"</string> <string name="key_preview_popup_dismiss_no_delay" msgid="2096123151571458064">"Sense retard"</string> <string name="key_preview_popup_dismiss_default_delay" msgid="2166964333903906734">"Predeterminat"</string> diff --git a/java/res/values-cs/strings.xml b/java/res/values-cs/strings.xml index 6305f6e64..d5989d791 100644 --- a/java/res/values-cs/strings.xml +++ b/java/res/values-cs/strings.xml @@ -37,12 +37,9 @@ <string name="misc_category" msgid="6894192814868233453">"Další možnosti"</string> <string name="advanced_settings" msgid="362895144495591463">"Pokročilá nastavení"</string> <string name="advanced_settings_summary" msgid="4487980456152830271">"Možnosti pro odborníky"</string> - <!-- no translation found for include_other_imes_in_language_switch_list (4533689960308565519) --> - <skip /> - <!-- no translation found for include_other_imes_in_language_switch_list_summary (840637129103317635) --> - <skip /> - <!-- no translation found for suppress_language_switch_key (8003788410354806368) --> - <skip /> + <string name="include_other_imes_in_language_switch_list" msgid="4533689960308565519">"Přep. na jiné metody zad."</string> + <string name="include_other_imes_in_language_switch_list_summary" msgid="840637129103317635">"Klávesa pro přepínání jazyka ovládá i další metody zadávání"</string> + <string name="suppress_language_switch_key" msgid="8003788410354806368">"Zakázat kl. přep. jazyka"</string> <string name="key_preview_popup_dismiss_delay" msgid="6213164897443068248">"Prodleva vysk. okna kláv."</string> <string name="key_preview_popup_dismiss_no_delay" msgid="2096123151571458064">"Bez prodlevy"</string> <string name="key_preview_popup_dismiss_default_delay" msgid="2166964333903906734">"Výchozí"</string> diff --git a/java/res/values-da/strings.xml b/java/res/values-da/strings.xml index df5dfa58b..97dec329b 100644 --- a/java/res/values-da/strings.xml +++ b/java/res/values-da/strings.xml @@ -37,12 +37,9 @@ <string name="misc_category" msgid="6894192814868233453">"Andre valgmuligheder"</string> <string name="advanced_settings" msgid="362895144495591463">"Avancerede indstillinger"</string> <string name="advanced_settings_summary" msgid="4487980456152830271">"Muligheder for eksperter"</string> - <!-- no translation found for include_other_imes_in_language_switch_list (4533689960308565519) --> - <skip /> - <!-- no translation found for include_other_imes_in_language_switch_list_summary (840637129103317635) --> - <skip /> - <!-- no translation found for suppress_language_switch_key (8003788410354806368) --> - <skip /> + <string name="include_other_imes_in_language_switch_list" msgid="4533689960308565519">"Skift inputmetode"</string> + <string name="include_other_imes_in_language_switch_list_summary" msgid="840637129103317635">"Tasten til sprogskift gælder også for andre inputmetoder"</string> + <string name="suppress_language_switch_key" msgid="8003788410354806368">"Ignorer sprogskifttast"</string> <string name="key_preview_popup_dismiss_delay" msgid="6213164897443068248">"Forsink. afvis. af taste-pop op"</string> <string name="key_preview_popup_dismiss_no_delay" msgid="2096123151571458064">"Ingen forsink."</string> <string name="key_preview_popup_dismiss_default_delay" msgid="2166964333903906734">"Standard"</string> diff --git a/java/res/values-de/config.xml b/java/res/values-de/donottranslate-config.xml index 272ff326f..272ff326f 100644 --- a/java/res/values-de/config.xml +++ b/java/res/values-de/donottranslate-config.xml diff --git a/java/res/values-de/strings.xml b/java/res/values-de/strings.xml index a2584bc2f..75ef10655 100644 --- a/java/res/values-de/strings.xml +++ b/java/res/values-de/strings.xml @@ -37,12 +37,9 @@ <string name="misc_category" msgid="6894192814868233453">"Sonstige Optionen"</string> <string name="advanced_settings" msgid="362895144495591463">"Erweiterte Einstellungen"</string> <string name="advanced_settings_summary" msgid="4487980456152830271">"Optionen für Experten"</string> - <!-- no translation found for include_other_imes_in_language_switch_list (4533689960308565519) --> - <skip /> - <!-- no translation found for include_other_imes_in_language_switch_list_summary (840637129103317635) --> - <skip /> - <!-- no translation found for suppress_language_switch_key (8003788410354806368) --> - <skip /> + <string name="include_other_imes_in_language_switch_list" msgid="4533689960308565519">"Eingabemethoden wechseln"</string> + <string name="include_other_imes_in_language_switch_list_summary" msgid="840637129103317635">"Sprachwechseltaste umfasst auch andere Eingabemethoden."</string> + <string name="suppress_language_switch_key" msgid="8003788410354806368">"Sprachwechsel unterdrücken"</string> <string name="key_preview_popup_dismiss_delay" msgid="6213164897443068248">"Tasten-Pop-up"</string> <string name="key_preview_popup_dismiss_no_delay" msgid="2096123151571458064">"Keine Verzögerung"</string> <string name="key_preview_popup_dismiss_default_delay" msgid="2166964333903906734">"Standard"</string> diff --git a/java/res/values-el/strings.xml b/java/res/values-el/strings.xml index 1d6fc10f4..fb2bff331 100644 --- a/java/res/values-el/strings.xml +++ b/java/res/values-el/strings.xml @@ -37,12 +37,9 @@ <string name="misc_category" msgid="6894192814868233453">"Άλλες επιλογές"</string> <string name="advanced_settings" msgid="362895144495591463">"Σύνθετες ρυθμίσεις"</string> <string name="advanced_settings_summary" msgid="4487980456152830271">"Επιλογές για έμπειρους χρήστες"</string> - <!-- no translation found for include_other_imes_in_language_switch_list (4533689960308565519) --> - <skip /> - <!-- no translation found for include_other_imes_in_language_switch_list_summary (840637129103317635) --> - <skip /> - <!-- no translation found for suppress_language_switch_key (8003788410354806368) --> - <skip /> + <string name="include_other_imes_in_language_switch_list" msgid="4533689960308565519">"Άλλη μέθοδος εισόδου"</string> + <string name="include_other_imes_in_language_switch_list_summary" msgid="840637129103317635">"Το κλειδί αλλαγής γλώσσας καλύπτει και άλλες μεθόδους εισόδου"</string> + <string name="suppress_language_switch_key" msgid="8003788410354806368">"Κατάργ.κλειδ.αλλαγ.γλωσσ."</string> <string name="key_preview_popup_dismiss_delay" msgid="6213164897443068248">"Χρόνος εξαφ. αναδ. παραθ."</string> <string name="key_preview_popup_dismiss_no_delay" msgid="2096123151571458064">"Χωρίς καθυστέρ."</string> <string name="key_preview_popup_dismiss_default_delay" msgid="2166964333903906734">"Προεπιλογή"</string> diff --git a/java/res/values-et/strings.xml b/java/res/values-et/strings.xml index c8e98a1d8..010891ce6 100644 --- a/java/res/values-et/strings.xml +++ b/java/res/values-et/strings.xml @@ -37,12 +37,9 @@ <string name="misc_category" msgid="6894192814868233453">"Muud valikud"</string> <string name="advanced_settings" msgid="362895144495591463">"Täpsemad seaded"</string> <string name="advanced_settings_summary" msgid="4487980456152830271">"Valikud ekspertidele"</string> - <!-- no translation found for include_other_imes_in_language_switch_list (4533689960308565519) --> - <skip /> - <!-- no translation found for include_other_imes_in_language_switch_list_summary (840637129103317635) --> - <skip /> - <!-- no translation found for suppress_language_switch_key (8003788410354806368) --> - <skip /> + <string name="include_other_imes_in_language_switch_list" msgid="4533689960308565519">"Vaheta sisestusmeetodit"</string> + <string name="include_other_imes_in_language_switch_list_summary" msgid="840637129103317635">"Keelevahetuse võti hõlmab ka muid sisestusmeetodeid"</string> + <string name="suppress_language_switch_key" msgid="8003788410354806368">"Keela keelevahetuse võti"</string> <string name="key_preview_popup_dismiss_delay" msgid="6213164897443068248">"Hüpiku loobumisviivitus"</string> <string name="key_preview_popup_dismiss_no_delay" msgid="2096123151571458064">"Viivituseta"</string> <string name="key_preview_popup_dismiss_default_delay" msgid="2166964333903906734">"Vaikeseade"</string> diff --git a/java/res/values-fa/donottranslate-more-keys.xml b/java/res/values-fa/donottranslate-more-keys.xml index 3e13c795a..1fb1846d9 100644 --- a/java/res/values-fa/donottranslate-more-keys.xml +++ b/java/res/values-fa/donottranslate-more-keys.xml @@ -38,26 +38,26 @@ <!-- In order to make Tatweel easily distinguishable from other punctuations, we use consecutive Tatweels only for its displayed label. --> <string name="more_keys_for_punctuation">"!fixedColumnOrder!8,\",\',-,:,!,؟,،,؛,ِ,َ,ٍ,ً,ٖ,ٰ,ٕ,ٔ,ُ,ٌ,ّ,ْ,ٓ,ـــ|ـ,/"</string> <string name="keyhintlabel_for_punctuation">ً</string> - <!-- U+0661: "١" ARABIC-INDIC DIGIT ONE --> - <string name="keylabel_for_symbols_1">١</string> - <!-- U+0662: "٢" ARABIC-INDIC DIGIT TWO --> - <string name="keylabel_for_symbols_2">٢</string> - <!-- U+0663: "٣" ARABIC-INDIC DIGIT THREE --> - <string name="keylabel_for_symbols_3">٣</string> - <!-- U+0664: "٤" ARABIC-INDIC DIGIT FOUR --> - <string name="keylabel_for_symbols_4">٤</string> - <!-- U+0665: "٥" ARABIC-INDIC DIGIT FIVE --> - <string name="keylabel_for_symbols_5">٥</string> - <!-- U+0666: "٦" ARABIC-INDIC DIGIT SIX --> - <string name="keylabel_for_symbols_6">٦</string> - <!-- U+0667: "٧" ARABIC-INDIC DIGIT SEVEN --> - <string name="keylabel_for_symbols_7">٧</string> - <!-- U+0668: "٨" ARABIC-INDIC DIGIT EIGHT --> - <string name="keylabel_for_symbols_8">٨</string> - <!-- U+0669: "٩" ARABIC-INDIC DIGIT NINE --> - <string name="keylabel_for_symbols_9">٩</string> - <!-- U+0660: "٠" ARABIC-INDIC DIGIT ZERO --> - <string name="keylabel_for_symbols_0">٠</string> + <!-- U+06F1: "۱" EXTENDED ARABIC-INDIC DIGIT ONE --> + <string name="keylabel_for_symbols_1">۱</string> + <!-- U+06F2: "۲" EXTENDED ARABIC-INDIC DIGIT TWO --> + <string name="keylabel_for_symbols_2">۲</string> + <!-- U+06F3: "۳" EXTENDED ARABIC-INDIC DIGIT THREE --> + <string name="keylabel_for_symbols_3">۳</string> + <!-- U+06F4: "۴" EXTENDED ARABIC-INDIC DIGIT FOUR --> + <string name="keylabel_for_symbols_4">۴</string> + <!-- U+06F5: "۵" EXTENDED ARABIC-INDIC DIGIT FIVE --> + <string name="keylabel_for_symbols_5">۵</string> + <!-- U+06F6: "۶" EXTENDED ARABIC-INDIC DIGIT SIX --> + <string name="keylabel_for_symbols_6">۶</string> + <!-- U+06F7: "۷" EXTENDED ARABIC-INDIC DIGIT SEVEN --> + <string name="keylabel_for_symbols_7">۷</string> + <!-- U+06F8: "۸" EXTENDED ARABIC-INDIC DIGIT EIGHT --> + <string name="keylabel_for_symbols_8">۸</string> + <!-- U+06F9: "۹" EXTENDED ARABIC-INDIC DIGIT NINE --> + <string name="keylabel_for_symbols_9">۹</string> + <!-- U+06F0: "۰" EXTENDED ARABIC-INDIC DIGIT ZERO --> + <string name="keylabel_for_symbols_0">۰</string> <string name="additional_more_keys_for_symbols_1">1</string> <string name="additional_more_keys_for_symbols_2">2</string> <string name="additional_more_keys_for_symbols_3">3</string> @@ -84,9 +84,11 @@ <!-- U+060C: "،" ARABIC COMMA U+061B: "؛" ARABIC SEMICOLON U+061F: "؟" ARABIC QUESTION MARK --> - <string name="keylabel_for_apostrophe">،</string> - <string name="keylabel_for_dash">"."</string> - <string name="keyhintlabel_for_apostrophe">؟</string> + <string name="keylabel_for_tablet_comma">"،"</string> + <string name="keyhintlabel_for_tablet_comma">"!"</string> + <string name="more_keys_for_tablet_comma">"!,\\,"</string> + <string name="keyhintlabel_for_tablet_period">"؟"</string> + <string name="more_keys_for_tablet_period">"؟,\?"</string> <string name="keyhintlabel_for_dash">ً</string> <string name="more_keys_for_apostrophe">"؟,؛,!,:,-,/,\',\""</string> <!-- U+0651: "ّ" ARABIC SHADDA @@ -104,7 +106,7 @@ U+0654: "ٔ" ARABIC HAMZA ABOVE U+0655: "ٕ" ARABIC HAMZA BELOW --> <!-- In order to make Tatweel easily distinguishable from other punctuations, we use consecutive Tatweels only for its displayed label. --> - <string name="more_keys_for_dash">"ّ,ْ,ٌ,ٓ,ُ,ِ,َ,ً,ـــ|ـ,ٍ,ٔ,ٖ,ٕ,ٰ"</string> + <string name="more_keys_for_dash">"ّ,ْ,ٌ,ٓ,ُ,ِ,َ,ً,ـــ|ـ,ٍ,ٔ,ٖ,ٕ,_,ٰ"</string> <!-- U+266A: "♪" EIGHTH NOTE --> <string name="more_keys_for_bullet">♪</string> <!-- U+2605: "★" BLACK STAR diff --git a/java/res/values-fi/strings.xml b/java/res/values-fi/strings.xml index ecb7a4d02..012f628ac 100644 --- a/java/res/values-fi/strings.xml +++ b/java/res/values-fi/strings.xml @@ -37,12 +37,9 @@ <string name="misc_category" msgid="6894192814868233453">"Muut vaihtoehdot"</string> <string name="advanced_settings" msgid="362895144495591463">"Lisäasetukset"</string> <string name="advanced_settings_summary" msgid="4487980456152830271">"Valinnat asiantuntijoille"</string> - <!-- no translation found for include_other_imes_in_language_switch_list (4533689960308565519) --> - <skip /> - <!-- no translation found for include_other_imes_in_language_switch_list_summary (840637129103317635) --> - <skip /> - <!-- no translation found for suppress_language_switch_key (8003788410354806368) --> - <skip /> + <string name="include_other_imes_in_language_switch_list" msgid="4533689960308565519">"Käytä toista syöttötapaa"</string> + <string name="include_other_imes_in_language_switch_list_summary" msgid="840637129103317635">"Kielenvaihtonäppäin kattaa myös muut syöttötavat"</string> + <string name="suppress_language_switch_key" msgid="8003788410354806368">"Piilota kielenvaihtonäpp."</string> <string name="key_preview_popup_dismiss_delay" msgid="6213164897443068248">"Näppäimen hylkäysviive"</string> <string name="key_preview_popup_dismiss_no_delay" msgid="2096123151571458064">"Ei viivettä"</string> <string name="key_preview_popup_dismiss_default_delay" msgid="2166964333903906734">"Oletus"</string> diff --git a/java/res/values-fr/donottranslate-config.xml b/java/res/values-fr/donottranslate-config.xml new file mode 100644 index 000000000..1f446d584 --- /dev/null +++ b/java/res/values-fr/donottranslate-config.xml @@ -0,0 +1,23 @@ +<?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. +*/ +--> + +<resources> + <bool name="config_require_ligatures_processing">true</bool> +</resources> diff --git a/java/res/values-fr/strings.xml b/java/res/values-fr/strings.xml index 3a5f6a1b3..1998be550 100644 --- a/java/res/values-fr/strings.xml +++ b/java/res/values-fr/strings.xml @@ -37,12 +37,9 @@ <string name="misc_category" msgid="6894192814868233453">"Autres options"</string> <string name="advanced_settings" msgid="362895144495591463">"Paramètres avancés"</string> <string name="advanced_settings_summary" msgid="4487980456152830271">"Options destinées aux experts"</string> - <!-- no translation found for include_other_imes_in_language_switch_list (4533689960308565519) --> - <skip /> - <!-- no translation found for include_other_imes_in_language_switch_list_summary (840637129103317635) --> - <skip /> - <!-- no translation found for suppress_language_switch_key (8003788410354806368) --> - <skip /> + <string name="include_other_imes_in_language_switch_list" msgid="4533689960308565519">"Autres modes de saisie"</string> + <string name="include_other_imes_in_language_switch_list_summary" msgid="840637129103317635">"La touche de sélection de langue couvre d\'autres modes de saisie."</string> + <string name="suppress_language_switch_key" msgid="8003788410354806368">"Suppr. touche sélect. langue"</string> <string name="key_preview_popup_dismiss_delay" msgid="6213164897443068248">"Masquer touche agrandie"</string> <string name="key_preview_popup_dismiss_no_delay" msgid="2096123151571458064">"Sans délai"</string> <string name="key_preview_popup_dismiss_default_delay" msgid="2166964333903906734">"Par défaut"</string> diff --git a/java/res/values-hi/strings.xml b/java/res/values-hi/strings.xml index c20e50ff0..5c5ec884b 100644 --- a/java/res/values-hi/strings.xml +++ b/java/res/values-hi/strings.xml @@ -37,12 +37,9 @@ <string name="misc_category" msgid="6894192814868233453">"अन्य विकल्प"</string> <string name="advanced_settings" msgid="362895144495591463">"उन्नत सेटिंग"</string> <string name="advanced_settings_summary" msgid="4487980456152830271">"विशेषज्ञों के लिए विकल्प"</string> - <!-- no translation found for include_other_imes_in_language_switch_list (4533689960308565519) --> - <skip /> - <!-- no translation found for include_other_imes_in_language_switch_list_summary (840637129103317635) --> - <skip /> - <!-- no translation found for suppress_language_switch_key (8003788410354806368) --> - <skip /> + <string name="include_other_imes_in_language_switch_list" msgid="4533689960308565519">"अन्य इनपुट पद्धतियों पर जाएं"</string> + <string name="include_other_imes_in_language_switch_list_summary" msgid="840637129103317635">"भाषा स्विच कुंजी में अन्य इनपुट पद्धतियां भी शामिल हैं"</string> + <string name="suppress_language_switch_key" msgid="8003788410354806368">"भाषा स्विच कुंजी रोकें"</string> <string name="key_preview_popup_dismiss_delay" msgid="6213164897443068248">"कुंजी पॉपअप खारिज़ विलंब"</string> <string name="key_preview_popup_dismiss_no_delay" msgid="2096123151571458064">"कोई विलंब नहीं"</string> <string name="key_preview_popup_dismiss_default_delay" msgid="2166964333903906734">"डिफ़ॉल्ट"</string> diff --git a/java/res/values-hr/strings.xml b/java/res/values-hr/strings.xml index ef491f43a..2c227061d 100644 --- a/java/res/values-hr/strings.xml +++ b/java/res/values-hr/strings.xml @@ -37,12 +37,9 @@ <string name="misc_category" msgid="6894192814868233453">"Ostale opcije"</string> <string name="advanced_settings" msgid="362895144495591463">"Napredne postavke"</string> <string name="advanced_settings_summary" msgid="4487980456152830271">"Opcije za stručnjake"</string> - <!-- no translation found for include_other_imes_in_language_switch_list (4533689960308565519) --> - <skip /> - <!-- no translation found for include_other_imes_in_language_switch_list_summary (840637129103317635) --> - <skip /> - <!-- no translation found for suppress_language_switch_key (8003788410354806368) --> - <skip /> + <string name="include_other_imes_in_language_switch_list" msgid="4533689960308565519">"Prebaci na druge unose"</string> + <string name="include_other_imes_in_language_switch_list_summary" msgid="840637129103317635">"Tipka za prebacivanje jezika pokriva i druge načine unosa"</string> + <string name="suppress_language_switch_key" msgid="8003788410354806368">"Spriječi tipku za jezike"</string> <string name="key_preview_popup_dismiss_delay" msgid="6213164897443068248">"Odgoda prikaza tipki"</string> <string name="key_preview_popup_dismiss_no_delay" msgid="2096123151571458064">"Bez odgode"</string> <string name="key_preview_popup_dismiss_default_delay" msgid="2166964333903906734">"Zadano"</string> diff --git a/java/res/values-hu/strings.xml b/java/res/values-hu/strings.xml index 4ac6bf3c2..e4b63634a 100644 --- a/java/res/values-hu/strings.xml +++ b/java/res/values-hu/strings.xml @@ -37,12 +37,9 @@ <string name="misc_category" msgid="6894192814868233453">"Egyéb beállítások"</string> <string name="advanced_settings" msgid="362895144495591463">"Speciális beállítások"</string> <string name="advanced_settings_summary" msgid="4487980456152830271">"Beállítások gyakorlott felhasználóknak"</string> - <!-- no translation found for include_other_imes_in_language_switch_list (4533689960308565519) --> - <skip /> - <!-- no translation found for include_other_imes_in_language_switch_list_summary (840637129103317635) --> - <skip /> - <!-- no translation found for suppress_language_switch_key (8003788410354806368) --> - <skip /> + <string name="include_other_imes_in_language_switch_list" msgid="4533689960308565519">"Váltás más beviteli módra"</string> + <string name="include_other_imes_in_language_switch_list_summary" msgid="840637129103317635">"A nyelvkapcsoló gomb egyéb beviteli módokat is tartalmaz"</string> + <string name="suppress_language_switch_key" msgid="8003788410354806368">"A nyelvkapcsoló elrejtése"</string> <string name="key_preview_popup_dismiss_delay" msgid="6213164897443068248">"Gombeltüntetés késése"</string> <string name="key_preview_popup_dismiss_no_delay" msgid="2096123151571458064">"Nincs késés"</string> <string name="key_preview_popup_dismiss_default_delay" msgid="2166964333903906734">"Alapbeállítás"</string> diff --git a/java/res/values-in/strings.xml b/java/res/values-in/strings.xml index f10d613f2..519730815 100644 --- a/java/res/values-in/strings.xml +++ b/java/res/values-in/strings.xml @@ -37,12 +37,9 @@ <string name="misc_category" msgid="6894192814868233453">"Opsi lain"</string> <string name="advanced_settings" msgid="362895144495591463">"Setelan lanjutan"</string> <string name="advanced_settings_summary" msgid="4487980456152830271">"Opsi untuk ahli"</string> - <!-- no translation found for include_other_imes_in_language_switch_list (4533689960308565519) --> - <skip /> - <!-- no translation found for include_other_imes_in_language_switch_list_summary (840637129103317635) --> - <skip /> - <!-- no translation found for suppress_language_switch_key (8003788410354806368) --> - <skip /> + <string name="include_other_imes_in_language_switch_list" msgid="4533689960308565519">"Alihkn k mtode msukn lain"</string> + <string name="include_other_imes_in_language_switch_list_summary" msgid="840637129103317635">"Tombol beralih bahasa juga mencakup metode masukan lain"</string> + <string name="suppress_language_switch_key" msgid="8003788410354806368">"Redam tombol alih bahasa"</string> <string name="key_preview_popup_dismiss_delay" msgid="6213164897443068248">"Tundaan singkir munculan kunci"</string> <string name="key_preview_popup_dismiss_no_delay" msgid="2096123151571458064">"Tanpa penundaan"</string> <string name="key_preview_popup_dismiss_default_delay" msgid="2166964333903906734">"Default"</string> diff --git a/java/res/values-ja/strings.xml b/java/res/values-ja/strings.xml index 052c4c8db..42b54fb50 100644 --- a/java/res/values-ja/strings.xml +++ b/java/res/values-ja/strings.xml @@ -37,12 +37,9 @@ <string name="misc_category" msgid="6894192814868233453">"他のオプション"</string> <string name="advanced_settings" msgid="362895144495591463">"詳細設定"</string> <string name="advanced_settings_summary" msgid="4487980456152830271">"上級者向けオプション"</string> - <!-- no translation found for include_other_imes_in_language_switch_list (4533689960308565519) --> - <skip /> - <!-- no translation found for include_other_imes_in_language_switch_list_summary (840637129103317635) --> - <skip /> - <!-- no translation found for suppress_language_switch_key (8003788410354806368) --> - <skip /> + <string name="include_other_imes_in_language_switch_list" msgid="4533689960308565519">"他の入力方法に切り替え"</string> + <string name="include_other_imes_in_language_switch_list_summary" msgid="840637129103317635">"言語切り替えキーは他の入力方法にも対応しています"</string> + <string name="suppress_language_switch_key" msgid="8003788410354806368">"言語切り替えキーを非表示"</string> <string name="key_preview_popup_dismiss_delay" msgid="6213164897443068248">"キーのポップアップ時間"</string> <string name="key_preview_popup_dismiss_no_delay" msgid="2096123151571458064">"すぐに消去"</string> <string name="key_preview_popup_dismiss_default_delay" msgid="2166964333903906734">"デフォルト"</string> diff --git a/java/res/values-ko/strings.xml b/java/res/values-ko/strings.xml index 8ec334d24..8543f2e85 100644 --- a/java/res/values-ko/strings.xml +++ b/java/res/values-ko/strings.xml @@ -37,12 +37,9 @@ <string name="misc_category" msgid="6894192814868233453">"기타 옵션"</string> <string name="advanced_settings" msgid="362895144495591463">"고급 설정"</string> <string name="advanced_settings_summary" msgid="4487980456152830271">"전문가용 옵션"</string> - <!-- no translation found for include_other_imes_in_language_switch_list (4533689960308565519) --> - <skip /> - <!-- no translation found for include_other_imes_in_language_switch_list_summary (840637129103317635) --> - <skip /> - <!-- no translation found for suppress_language_switch_key (8003788410354806368) --> - <skip /> + <string name="include_other_imes_in_language_switch_list" msgid="4533689960308565519">"다른 입력 방법으로 전환"</string> + <string name="include_other_imes_in_language_switch_list_summary" msgid="840637129103317635">"언어 전환 키가 제공하는 기타 입력 방법"</string> + <string name="suppress_language_switch_key" msgid="8003788410354806368">"언어 전환 키 제거"</string> <string name="key_preview_popup_dismiss_delay" msgid="6213164897443068248">"키 팝업 해제 지연"</string> <string name="key_preview_popup_dismiss_no_delay" msgid="2096123151571458064">"지연 없음"</string> <string name="key_preview_popup_dismiss_default_delay" msgid="2166964333903906734">"기본값"</string> diff --git a/java/res/values-land/dimens.xml b/java/res/values-land/dimens.xml index 6cdcf891c..1157b2733 100644 --- a/java/res/values-land/dimens.xml +++ b/java/res/values-land/dimens.xml @@ -19,19 +19,18 @@ --> <resources> - <!-- keyboardHeight = key_height*4 + key_bottom_gap*3, key_height=0.260in --> - <dimen name="keyboardHeight">1.100in</dimen> + <!-- Preferable keyboard height in absolute scale: 1.100in --> + <!-- This keyboardHeight value should match with keyboard-heights.xml --> + <dimen name="keyboardHeight">176.0dp</dimen> <fraction name="minKeyboardHeight">45%p</fraction> <!-- key_height + key_bottom_gap = popup_key_height --> -<!-- <dimen name="key_height">0.260in</dimen>--> - <dimen name="popup_key_height">0.280in</dimen> + <dimen name="popup_key_height">44.8dp</dimen> <fraction name="keyboard_top_padding">1.818%p</fraction> <fraction name="keyboard_bottom_padding">0.0%p</fraction> <fraction name="key_bottom_gap">4.330%p</fraction> <fraction name="key_horizontal_gap">0.405%p</fraction> - <dimen name="keyboardHeight_stone">0.984in</dimen> <fraction name="key_bottom_gap_stone">5.010%p</fraction> <fraction name="key_horizontal_gap_stone">1.159%p</fraction> @@ -54,11 +53,11 @@ <fraction name="key_uppercase_letter_ratio">40%</fraction> <fraction name="key_preview_text_ratio">90%</fraction> <fraction name="spacebar_text_ratio">40.000%</fraction> - <dimen name="key_preview_offset">0.08in</dimen> + <dimen name="key_preview_offset">12.8dp</dimen> - <dimen name="key_preview_offset_ics">0.01in</dimen> + <dimen name="key_preview_offset_ics">1.6dp</dimen> <!-- popup_key_height x -0.5 --> - <dimen name="more_keys_keyboard_vertical_correction_ics">-0.140in</dimen> + <dimen name="more_keys_keyboard_vertical_correction_ics">-22.4dp</dimen> <dimen name="suggestions_strip_height">36dp</dimen> <dimen name="more_suggestions_row_height">36dp</dimen> @@ -66,7 +65,7 @@ <fraction name="min_more_suggestions_width">60%</fraction> <!-- Amount of allowance for selecting keys in a mini popup keyboard by sliding finger. --> <!-- popup_key_height x 1.2 --> - <dimen name="more_keys_keyboard_slide_allowance">0.336in</dimen> + <dimen name="more_keys_keyboard_slide_allowance">53.76dp</dimen> <!-- popup_key_height x -1.0 --> - <dimen name="more_keys_keyboard_vertical_correction">-0.280in</dimen> + <dimen name="more_keys_keyboard_vertical_correction">-44.8dp</dimen> </resources> diff --git a/java/res/values-land/keyboard-heights.xml b/java/res/values-land/keyboard-heights.xml new file mode 100644 index 000000000..12c3e3951 --- /dev/null +++ b/java/res/values-land/keyboard-heights.xml @@ -0,0 +1,34 @@ +<?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. +*/ +--> + +<!-- Preferable keyboard height in absolute scale: 1.100in --> +<resources> + <!-- Build.HARDWARE,keyboard_height_in_dp --> + <string-array name="keyboard_heights" translatable="false"> + <!-- Droid --> + <item>sholes,194.3333</item> + <!-- Nexus One --> + <item>mahimahi,186.2667</item> + <!-- Nexus S --> + <item>herring,171.9385</item> + <!-- Galaxy Nexus --> + <item>tuna,173.4207</item> + </string-array> +</resources> diff --git a/java/res/values-lt/strings.xml b/java/res/values-lt/strings.xml index 09b017a12..a0192b859 100644 --- a/java/res/values-lt/strings.xml +++ b/java/res/values-lt/strings.xml @@ -37,12 +37,9 @@ <string name="misc_category" msgid="6894192814868233453">"Kitos parinktys"</string> <string name="advanced_settings" msgid="362895144495591463">"Išplėstiniai nustatymai"</string> <string name="advanced_settings_summary" msgid="4487980456152830271">"Parinktys ekspertams"</string> - <!-- no translation found for include_other_imes_in_language_switch_list (4533689960308565519) --> - <skip /> - <!-- no translation found for include_other_imes_in_language_switch_list_summary (840637129103317635) --> - <skip /> - <!-- no translation found for suppress_language_switch_key (8003788410354806368) --> - <skip /> + <string name="include_other_imes_in_language_switch_list" msgid="4533689960308565519">"Perj. į kt. įvesties būd."</string> + <string name="include_other_imes_in_language_switch_list_summary" msgid="840637129103317635">"Kalbos perjungimo klavišu taip pat perjungiami įvesties būdai"</string> + <string name="suppress_language_switch_key" msgid="8003788410354806368">"Nerodyti klb. keit. klav."</string> <string name="key_preview_popup_dismiss_delay" msgid="6213164897443068248">"Pagr. išš. l. atsis. d."</string> <string name="key_preview_popup_dismiss_no_delay" msgid="2096123151571458064">"Be delsos"</string> <string name="key_preview_popup_dismiss_default_delay" msgid="2166964333903906734">"Numatytasis"</string> diff --git a/java/res/values-lv/strings.xml b/java/res/values-lv/strings.xml index d358a8485..2ba1293ad 100644 --- a/java/res/values-lv/strings.xml +++ b/java/res/values-lv/strings.xml @@ -37,12 +37,9 @@ <string name="misc_category" msgid="6894192814868233453">"Citas opcijas"</string> <string name="advanced_settings" msgid="362895144495591463">"Papildu iestatījumi"</string> <string name="advanced_settings_summary" msgid="4487980456152830271">"Opcijas ekspertiem"</string> - <!-- no translation found for include_other_imes_in_language_switch_list (4533689960308565519) --> - <skip /> - <!-- no translation found for include_other_imes_in_language_switch_list_summary (840637129103317635) --> - <skip /> - <!-- no translation found for suppress_language_switch_key (8003788410354806368) --> - <skip /> + <string name="include_other_imes_in_language_switch_list" msgid="4533689960308565519">"Pārsl. uz citām iev. met."</string> + <string name="include_other_imes_in_language_switch_list_summary" msgid="840637129103317635">"Valodas pārslēgš. taustiņu var lietot arī citām ievades metodēm."</string> + <string name="suppress_language_switch_key" msgid="8003788410354806368">"Atsp. val. pārsl. taust."</string> <string name="key_preview_popup_dismiss_delay" msgid="6213164897443068248">"Taust. uzn. loga noraid. aizk."</string> <string name="key_preview_popup_dismiss_no_delay" msgid="2096123151571458064">"Bez aizkaves"</string> <string name="key_preview_popup_dismiss_default_delay" msgid="2166964333903906734">"Noklusējums"</string> diff --git a/java/res/values-nb/strings.xml b/java/res/values-nb/strings.xml index 8114cd50c..183312806 100644 --- a/java/res/values-nb/strings.xml +++ b/java/res/values-nb/strings.xml @@ -37,12 +37,9 @@ <string name="misc_category" msgid="6894192814868233453">"Andre alternativer"</string> <string name="advanced_settings" msgid="362895144495591463">"Avanserte innstillinger"</string> <string name="advanced_settings_summary" msgid="4487980456152830271">"Alternativer for eksperter"</string> - <!-- no translation found for include_other_imes_in_language_switch_list (4533689960308565519) --> - <skip /> - <!-- no translation found for include_other_imes_in_language_switch_list_summary (840637129103317635) --> - <skip /> - <!-- no translation found for suppress_language_switch_key (8003788410354806368) --> - <skip /> + <string name="include_other_imes_in_language_switch_list" msgid="4533689960308565519">"Bytt inndatametode"</string> + <string name="include_other_imes_in_language_switch_list_summary" msgid="840637129103317635">"Nøkkelen for språkbytte dekker også andre inndatametoder"</string> + <string name="suppress_language_switch_key" msgid="8003788410354806368">"Skjul språkbyttenøkkelen"</string> <string name="key_preview_popup_dismiss_delay" msgid="6213164897443068248">"Tregt tastevindu"</string> <string name="key_preview_popup_dismiss_no_delay" msgid="2096123151571458064">"U/ forsinkelse"</string> <string name="key_preview_popup_dismiss_default_delay" msgid="2166964333903906734">"Standard"</string> diff --git a/java/res/values-nl/strings.xml b/java/res/values-nl/strings.xml index 56d423a29..2bbf5da12 100644 --- a/java/res/values-nl/strings.xml +++ b/java/res/values-nl/strings.xml @@ -37,12 +37,9 @@ <string name="misc_category" msgid="6894192814868233453">"Andere opties"</string> <string name="advanced_settings" msgid="362895144495591463">"Geavanceerde instellingen"</string> <string name="advanced_settings_summary" msgid="4487980456152830271">"Opties voor experts"</string> - <!-- no translation found for include_other_imes_in_language_switch_list (4533689960308565519) --> - <skip /> - <!-- no translation found for include_other_imes_in_language_switch_list_summary (840637129103317635) --> - <skip /> - <!-- no translation found for suppress_language_switch_key (8003788410354806368) --> - <skip /> + <string name="include_other_imes_in_language_switch_list" msgid="4533689960308565519">"Invoermeth. overschakelen"</string> + <string name="include_other_imes_in_language_switch_list_summary" msgid="840637129103317635">"Schakelknop voor taal ook van toepassing op andere invoermethoden"</string> + <string name="suppress_language_switch_key" msgid="8003788410354806368">"Taal onderdr. schakelen"</string> <string name="key_preview_popup_dismiss_delay" msgid="6213164897443068248">"Afwijz.vertr. toetspop-up"</string> <string name="key_preview_popup_dismiss_no_delay" msgid="2096123151571458064">"Geen vertraging"</string> <string name="key_preview_popup_dismiss_default_delay" msgid="2166964333903906734">"Standaard"</string> diff --git a/java/res/values-pl/strings.xml b/java/res/values-pl/strings.xml index ec9e01441..2c91bb5ba 100644 --- a/java/res/values-pl/strings.xml +++ b/java/res/values-pl/strings.xml @@ -37,12 +37,9 @@ <string name="misc_category" msgid="6894192814868233453">"Inne opcje"</string> <string name="advanced_settings" msgid="362895144495591463">"Ustawienia zaawansowane"</string> <string name="advanced_settings_summary" msgid="4487980456152830271">"Opcje dla ekspertów"</string> - <!-- no translation found for include_other_imes_in_language_switch_list (4533689960308565519) --> - <skip /> - <!-- no translation found for include_other_imes_in_language_switch_list_summary (840637129103317635) --> - <skip /> - <!-- no translation found for suppress_language_switch_key (8003788410354806368) --> - <skip /> + <string name="include_other_imes_in_language_switch_list" msgid="4533689960308565519">"Włącz inne metody wprowadzania"</string> + <string name="include_other_imes_in_language_switch_list_summary" msgid="840637129103317635">"Klawisz zmiany języka obejmuje też inne metody wprowadzania"</string> + <string name="suppress_language_switch_key" msgid="8003788410354806368">"Wyłącz klawisz zmiany języka"</string> <string name="key_preview_popup_dismiss_delay" msgid="6213164897443068248">"Opóźnienie znikania klawiszy"</string> <string name="key_preview_popup_dismiss_no_delay" msgid="2096123151571458064">"Bez opóźnienia"</string> <string name="key_preview_popup_dismiss_default_delay" msgid="2166964333903906734">"Wartość domyślna"</string> diff --git a/java/res/values-pt-rPT/strings.xml b/java/res/values-pt-rPT/strings.xml index 4e0cf4c5c..6d59c6eaf 100644 --- a/java/res/values-pt-rPT/strings.xml +++ b/java/res/values-pt-rPT/strings.xml @@ -37,12 +37,9 @@ <string name="misc_category" msgid="6894192814868233453">"Outras opções"</string> <string name="advanced_settings" msgid="362895144495591463">"Definições avançadas"</string> <string name="advanced_settings_summary" msgid="4487980456152830271">"Opções para especialistas"</string> - <!-- no translation found for include_other_imes_in_language_switch_list (4533689960308565519) --> - <skip /> - <!-- no translation found for include_other_imes_in_language_switch_list_summary (840637129103317635) --> - <skip /> - <!-- no translation found for suppress_language_switch_key (8003788410354806368) --> - <skip /> + <string name="include_other_imes_in_language_switch_list" msgid="4533689960308565519">"Mudar p/ outros mét. ent."</string> + <string name="include_other_imes_in_language_switch_list_summary" msgid="840637129103317635">"A tecla de mudança de idioma abrange outros métodos de entrada"</string> + <string name="suppress_language_switch_key" msgid="8003788410354806368">"Suprimir tecla mud idioma"</string> <string name="key_preview_popup_dismiss_delay" msgid="6213164897443068248">"Atraso p/ ignorar pop-up"</string> <string name="key_preview_popup_dismiss_no_delay" msgid="2096123151571458064">"Sem atraso"</string> <string name="key_preview_popup_dismiss_default_delay" msgid="2166964333903906734">"Predefinido"</string> diff --git a/java/res/values-pt/strings.xml b/java/res/values-pt/strings.xml index b3af6f051..e89db807f 100644 --- a/java/res/values-pt/strings.xml +++ b/java/res/values-pt/strings.xml @@ -37,12 +37,9 @@ <string name="misc_category" msgid="6894192814868233453">"Outras opções"</string> <string name="advanced_settings" msgid="362895144495591463">"Configurações avançadas"</string> <string name="advanced_settings_summary" msgid="4487980456152830271">"Opções para especialistas"</string> - <!-- no translation found for include_other_imes_in_language_switch_list (4533689960308565519) --> - <skip /> - <!-- no translation found for include_other_imes_in_language_switch_list_summary (840637129103317635) --> - <skip /> - <!-- no translation found for suppress_language_switch_key (8003788410354806368) --> - <skip /> + <string name="include_other_imes_in_language_switch_list" msgid="4533689960308565519">"Outros métodos de entrada"</string> + <string name="include_other_imes_in_language_switch_list_summary" msgid="840637129103317635">"A tecla para mudar o idioma também cobre outro métodos de entrada"</string> + <string name="suppress_language_switch_key" msgid="8003788410354806368">"Ocult. tecla mudar idioma"</string> <string name="key_preview_popup_dismiss_delay" msgid="6213164897443068248">"Dispens. atraso chave princ."</string> <string name="key_preview_popup_dismiss_no_delay" msgid="2096123151571458064">"Sem atraso"</string> <string name="key_preview_popup_dismiss_default_delay" msgid="2166964333903906734">"Padrão"</string> diff --git a/java/res/values-ro/strings.xml b/java/res/values-ro/strings.xml index 2445075f9..bd62d62c9 100644 --- a/java/res/values-ro/strings.xml +++ b/java/res/values-ro/strings.xml @@ -37,12 +37,9 @@ <string name="misc_category" msgid="6894192814868233453">"Alte opţiuni"</string> <string name="advanced_settings" msgid="362895144495591463">"Setări avansate"</string> <string name="advanced_settings_summary" msgid="4487980456152830271">"Opţiuni pentru experţi"</string> - <!-- no translation found for include_other_imes_in_language_switch_list (4533689960308565519) --> - <skip /> - <!-- no translation found for include_other_imes_in_language_switch_list_summary (840637129103317635) --> - <skip /> - <!-- no translation found for suppress_language_switch_key (8003788410354806368) --> - <skip /> + <string name="include_other_imes_in_language_switch_list" msgid="4533689960308565519">"Comut. alte metode de introd."</string> + <string name="include_other_imes_in_language_switch_list_summary" msgid="840637129103317635">"Tasta de comutare între limbi include şi alte metode de introd."</string> + <string name="suppress_language_switch_key" msgid="8003788410354806368">"Suprim. tasta comut. limbi"</string> <string name="key_preview_popup_dismiss_delay" msgid="6213164897443068248">"Înt. înch. pop-up esenţ."</string> <string name="key_preview_popup_dismiss_no_delay" msgid="2096123151571458064">"Fără întârziere"</string> <string name="key_preview_popup_dismiss_default_delay" msgid="2166964333903906734">"Prestabilit"</string> diff --git a/java/res/values-ru/strings.xml b/java/res/values-ru/strings.xml index 0d3d21de0..ef759b129 100644 --- a/java/res/values-ru/strings.xml +++ b/java/res/values-ru/strings.xml @@ -37,12 +37,9 @@ <string name="misc_category" msgid="6894192814868233453">"Другие варианты"</string> <string name="advanced_settings" msgid="362895144495591463">"Расширенные настройки"</string> <string name="advanced_settings_summary" msgid="4487980456152830271">"Для опытных пользователей"</string> - <!-- no translation found for include_other_imes_in_language_switch_list (4533689960308565519) --> - <skip /> - <!-- no translation found for include_other_imes_in_language_switch_list_summary (840637129103317635) --> - <skip /> - <!-- no translation found for suppress_language_switch_key (8003788410354806368) --> - <skip /> + <string name="include_other_imes_in_language_switch_list" msgid="4533689960308565519">"Другой способ ввода"</string> + <string name="include_other_imes_in_language_switch_list_summary" msgid="840637129103317635">"Клавиша переключения языков также служит для смены способа ввода"</string> + <string name="suppress_language_switch_key" msgid="8003788410354806368">"Блок. кл. перекл. языков"</string> <string name="key_preview_popup_dismiss_delay" msgid="6213164897443068248">"Задержка закрытия"</string> <string name="key_preview_popup_dismiss_no_delay" msgid="2096123151571458064">"Без задержки"</string> <string name="key_preview_popup_dismiss_default_delay" msgid="2166964333903906734">"По умолчанию"</string> diff --git a/java/res/values-sk/strings.xml b/java/res/values-sk/strings.xml index 91896d01c..3b06d5a84 100644 --- a/java/res/values-sk/strings.xml +++ b/java/res/values-sk/strings.xml @@ -37,12 +37,9 @@ <string name="misc_category" msgid="6894192814868233453">"Ďalšie možnosti"</string> <string name="advanced_settings" msgid="362895144495591463">"Rozšírené nastavenia"</string> <string name="advanced_settings_summary" msgid="4487980456152830271">"Možnosti pre odborníkov"</string> - <!-- no translation found for include_other_imes_in_language_switch_list (4533689960308565519) --> - <skip /> - <!-- no translation found for include_other_imes_in_language_switch_list_summary (840637129103317635) --> - <skip /> - <!-- no translation found for suppress_language_switch_key (8003788410354806368) --> - <skip /> + <string name="include_other_imes_in_language_switch_list" msgid="4533689960308565519">"Prepnúť na iné metódy vstupu"</string> + <string name="include_other_imes_in_language_switch_list_summary" msgid="840637129103317635">"Kláves na prepnutie jazyka pokrýva aj ďalšie metódy vstupu"</string> + <string name="suppress_language_switch_key" msgid="8003788410354806368">"Blok. kláves na prep. jazyka"</string> <string name="key_preview_popup_dismiss_delay" msgid="6213164897443068248">"Onesk. zrušenia kľúč. kon. okna"</string> <string name="key_preview_popup_dismiss_no_delay" msgid="2096123151571458064">"Bez oneskorenia"</string> <string name="key_preview_popup_dismiss_default_delay" msgid="2166964333903906734">"Predvolená"</string> diff --git a/java/res/values-sl/strings.xml b/java/res/values-sl/strings.xml index 88d29a9e6..984fd9cba 100644 --- a/java/res/values-sl/strings.xml +++ b/java/res/values-sl/strings.xml @@ -37,12 +37,9 @@ <string name="misc_category" msgid="6894192814868233453">"Druge možnosti"</string> <string name="advanced_settings" msgid="362895144495591463">"Dodatne nastavitve"</string> <string name="advanced_settings_summary" msgid="4487980456152830271">"Možnosti za strokovnjake"</string> - <!-- no translation found for include_other_imes_in_language_switch_list (4533689960308565519) --> - <skip /> - <!-- no translation found for include_other_imes_in_language_switch_list_summary (840637129103317635) --> - <skip /> - <!-- no translation found for suppress_language_switch_key (8003788410354806368) --> - <skip /> + <string name="include_other_imes_in_language_switch_list" msgid="4533689960308565519">"Prekl. na drug nač. vnosa"</string> + <string name="include_other_imes_in_language_switch_list_summary" msgid="840637129103317635">"Tipka za preklop jezika, ki vključuje tudi druge načine vnosa"</string> + <string name="suppress_language_switch_key" msgid="8003788410354806368">"Onemogoči preklop jezika"</string> <string name="key_preview_popup_dismiss_delay" msgid="6213164897443068248">"Trajanje povečanja tipke"</string> <string name="key_preview_popup_dismiss_no_delay" msgid="2096123151571458064">"Brez zakasnitve"</string> <string name="key_preview_popup_dismiss_default_delay" msgid="2166964333903906734">"Privzeto"</string> diff --git a/java/res/values-sr/strings.xml b/java/res/values-sr/strings.xml index 463165b6f..745ed1e33 100644 --- a/java/res/values-sr/strings.xml +++ b/java/res/values-sr/strings.xml @@ -37,12 +37,9 @@ <string name="misc_category" msgid="6894192814868233453">"Друге опције"</string> <string name="advanced_settings" msgid="362895144495591463">"Напредна подешавања"</string> <string name="advanced_settings_summary" msgid="4487980456152830271">"Опције за стручњаке"</string> - <!-- no translation found for include_other_imes_in_language_switch_list (4533689960308565519) --> - <skip /> - <!-- no translation found for include_other_imes_in_language_switch_list_summary (840637129103317635) --> - <skip /> - <!-- no translation found for suppress_language_switch_key (8003788410354806368) --> - <skip /> + <string name="include_other_imes_in_language_switch_list" msgid="4533689960308565519">"Пребаци на друге методе уноса"</string> + <string name="include_other_imes_in_language_switch_list_summary" msgid="840637129103317635">"Тастер за пребацивање језика обухвата и друге методе уноса"</string> + <string name="suppress_language_switch_key" msgid="8003788410354806368">"Искључи тастер за језике"</string> <string name="key_preview_popup_dismiss_delay" msgid="6213164897443068248">"Одложи одбац. иск. прозора тастера"</string> <string name="key_preview_popup_dismiss_no_delay" msgid="2096123151571458064">"Без одлагања"</string> <string name="key_preview_popup_dismiss_default_delay" msgid="2166964333903906734">"Подразумевано"</string> diff --git a/java/res/values-sv/strings.xml b/java/res/values-sv/strings.xml index 992604a41..9cac393e7 100644 --- a/java/res/values-sv/strings.xml +++ b/java/res/values-sv/strings.xml @@ -37,12 +37,9 @@ <string name="misc_category" msgid="6894192814868233453">"Andra alternativ"</string> <string name="advanced_settings" msgid="362895144495591463">"Avancerade inställningar"</string> <string name="advanced_settings_summary" msgid="4487980456152830271">"Alternativ för experter"</string> - <!-- no translation found for include_other_imes_in_language_switch_list (4533689960308565519) --> - <skip /> - <!-- no translation found for include_other_imes_in_language_switch_list_summary (840637129103317635) --> - <skip /> - <!-- no translation found for suppress_language_switch_key (8003788410354806368) --> - <skip /> + <string name="include_other_imes_in_language_switch_list" msgid="4533689960308565519">"Byt till annan inmatning"</string> + <string name="include_other_imes_in_language_switch_list_summary" msgid="840637129103317635">"Språkbytesknappen omfattar även andra inmatningsmetoder"</string> + <string name="suppress_language_switch_key" msgid="8003788410354806368">"Stäng av språkbytesknapp"</string> <string name="key_preview_popup_dismiss_delay" msgid="6213164897443068248">"Ta bort popup-fördröjning"</string> <string name="key_preview_popup_dismiss_no_delay" msgid="2096123151571458064">"Fördröj inte"</string> <string name="key_preview_popup_dismiss_default_delay" msgid="2166964333903906734">"Standard"</string> diff --git a/java/res/values-sw/strings.xml b/java/res/values-sw/strings.xml index 12185cacb..4a7a1ff85 100644 --- a/java/res/values-sw/strings.xml +++ b/java/res/values-sw/strings.xml @@ -37,12 +37,9 @@ <string name="misc_category" msgid="6894192814868233453">"Chaguo zingine"</string> <string name="advanced_settings" msgid="362895144495591463">"Mipangilio mahiri"</string> <string name="advanced_settings_summary" msgid="4487980456152830271">"Chaguo za wataalamu"</string> - <!-- no translation found for include_other_imes_in_language_switch_list (4533689960308565519) --> - <skip /> - <!-- no translation found for include_other_imes_in_language_switch_list_summary (840637129103317635) --> - <skip /> - <!-- no translation found for suppress_language_switch_key (8003788410354806368) --> - <skip /> + <string name="include_other_imes_in_language_switch_list" msgid="4533689960308565519">"Badilisha kwa mbinu zingine za ingizo"</string> + <string name="include_other_imes_in_language_switch_list_summary" msgid="840637129103317635">"Ufunguo wa kubadilisha lugha unashughulikia mbinu zingine za ingizo pia"</string> + <string name="suppress_language_switch_key" msgid="8003788410354806368">"Zuia ufunguo wa kubadili lugha"</string> <string name="key_preview_popup_dismiss_delay" msgid="6213164897443068248">"Kuchelewesha kutupa kitufe ibukizi"</string> <string name="key_preview_popup_dismiss_no_delay" msgid="2096123151571458064">"Hakuna kuchelewa"</string> <string name="key_preview_popup_dismiss_default_delay" msgid="2166964333903906734">"Chaguo-msingi"</string> diff --git a/java/res/values-sw600dp-land/dimens.xml b/java/res/values-sw600dp-land/dimens.xml index 5dce47ee3..8a59c9b54 100644 --- a/java/res/values-sw600dp-land/dimens.xml +++ b/java/res/values-sw600dp-land/dimens.xml @@ -19,8 +19,9 @@ --> <resources> - <!-- keyboardHeight = key_height*4 + key_bottom_gap*3 --> - <dimen name="keyboardHeight">45.0mm</dimen> + <!-- Preferable keyboard height in absolute scale: 45.0mm --> + <!-- This keyboardHeight value should match with keyboard-heights.xml --> + <dimen name="keyboardHeight">283.5dp</dimen> <fraction name="minKeyboardHeight">45%p</fraction> <fraction name="keyboard_top_padding">2.444%p</fraction> @@ -28,16 +29,16 @@ <fraction name="key_bottom_gap">4.911%p</fraction> <fraction name="key_horizontal_gap">1.284%p</fraction> - <dimen name="keyboardHeight_stone">45.0mm</dimen> <fraction name="key_bottom_gap_stone">4.355%p</fraction> <fraction name="key_horizontal_gap_stone">1.505%p</fraction> <fraction name="key_bottom_gap_gb">5.200%p</fraction> <fraction name="key_horizontal_gap_gb">1.447%p</fraction> + <fraction name="key_bottom_gap_ics">4.0%p</fraction> <fraction name="keyboard_bottom_padding_ics">0.0%p</fraction> - <dimen name="popup_key_height">13.0mm</dimen> + <dimen name="popup_key_height">81.9dp</dimen> <!-- left or right padding of label alignment --> <dimen name="key_label_horizontal_padding">18dp</dimen> @@ -50,7 +51,7 @@ <fraction name="key_uppercase_letter_ratio">29%</fraction> <fraction name="spacebar_text_ratio">33.33%</fraction> - <dimen name="suggestions_strip_padding">40.0mm</dimen> + <dimen name="suggestions_strip_padding">252.0dp</dimen> <integer name="max_more_suggestions_row">5</integer> <fraction name="min_more_suggestions_width">50%</fraction> </resources> diff --git a/java/res/values-sw600dp-land/keyboard-heights.xml b/java/res/values-sw600dp-land/keyboard-heights.xml new file mode 100644 index 000000000..93f9824d1 --- /dev/null +++ b/java/res/values-sw600dp-land/keyboard-heights.xml @@ -0,0 +1,28 @@ +<?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. +*/ +--> + +<!-- Preferable keyboard height in absolute scale: 45.0mm --> +<resources> + <!-- Build.HARDWARE,keyboard_height_in_dp --> + <string-array name="keyboard_heights" translatable="false"> + <!-- Xoom --> + <item>stingray,265.4378</item> + </string-array> +</resources> diff --git a/java/res/values-sw600dp/dimens.xml b/java/res/values-sw600dp/dimens.xml index 0f256a302..f03ce2943 100644 --- a/java/res/values-sw600dp/dimens.xml +++ b/java/res/values-sw600dp/dimens.xml @@ -19,33 +19,34 @@ --> <resources> - <!-- keyboardHeight = key_height*4 + key_bottom_gap*3 --> - <dimen name="keyboardHeight">48.0mm</dimen> + <!-- Preferable keyboard height in absolute scale: 48.0mm --> + <!-- This keyboardHeight value should match with keyboard-heights.xml --> + <dimen name="keyboardHeight">302.4dp</dimen> <fraction name="maxKeyboardHeight">50%p</fraction> <fraction name="minKeyboardHeight">-35.0%p</fraction> - <dimen name="popup_key_height">10.0mm</dimen> + <dimen name="popup_key_height">63.0dp</dimen> <fraction name="keyboard_top_padding">2.291%p</fraction> <fraction name="keyboard_bottom_padding">0.0%p</fraction> <fraction name="key_bottom_gap">3.750%p</fraction> <fraction name="key_horizontal_gap">1.857%p</fraction> - <dimen name="keyboardHeight_stone">48.0mm</dimen> <fraction name="key_bottom_gap_stone">3.75%p</fraction> <fraction name="key_horizontal_gap_stone">1.602%p</fraction> <fraction name="key_bottom_gap_gb">4.625%p</fraction> <fraction name="key_horizontal_gap_gb">2.113%p</fraction> + <fraction name="key_bottom_gap_ics">4.0%p</fraction> <fraction name="keyboard_bottom_padding_ics">0.0%p</fraction> <dimen name="more_keys_keyboard_key_horizontal_padding">6dp</dimen> <!-- Amount of allowance for selecting keys in a mini popup keyboard by sliding finger. --> <!-- popup_key_height x 1.2 --> - <dimen name="more_keys_keyboard_slide_allowance">15.6mm</dimen> + <dimen name="more_keys_keyboard_slide_allowance">98.3dp</dimen> <!-- popup_key_height x -1.0 --> - <dimen name="more_keys_keyboard_vertical_correction">-13.0mm</dimen> + <dimen name="more_keys_keyboard_vertical_correction">-81.9dp</dimen> <!-- left or right padding of label alignment --> <dimen name="key_label_horizontal_padding">6dp</dimen> @@ -60,19 +61,19 @@ <fraction name="key_uppercase_letter_ratio">26%</fraction> <fraction name="key_preview_text_ratio">50%</fraction> <fraction name="spacebar_text_ratio">32.14%</fraction> - <dimen name="key_preview_height">15.0mm</dimen> - <dimen name="key_preview_offset">0.1in</dimen> + <dimen name="key_preview_height">94.5dp</dimen> + <dimen name="key_preview_offset">16.0dp</dimen> - <dimen name="key_preview_offset_ics">0.05in</dimen> + <dimen name="key_preview_offset_ics">8.0dp</dimen> <!-- popup_key_height x -0.5 --> - <dimen name="more_keys_keyboard_vertical_correction_ics">-5mm</dimen> + <dimen name="more_keys_keyboard_vertical_correction_ics">-31.5dp</dimen> <dimen name="suggestions_strip_height">44dp</dimen> <dimen name="more_suggestions_row_height">44dp</dimen> <integer name="max_more_suggestions_row">6</integer> <fraction name="min_more_suggestions_width">90%</fraction> - <dimen name="suggestions_strip_padding">15.0mm</dimen> - <dimen name="suggestion_min_width">0.3in</dimen> + <dimen name="suggestions_strip_padding">94.5dp</dimen> + <dimen name="suggestion_min_width">48.0dp</dimen> <dimen name="suggestion_padding">12dp</dimen> <dimen name="suggestion_text_size">22dp</dimen> <dimen name="more_suggestions_hint_text_size">33dp</dimen> diff --git a/java/res/values-sw600dp/keyboard-heights.xml b/java/res/values-sw600dp/keyboard-heights.xml new file mode 100644 index 000000000..77e52be2f --- /dev/null +++ b/java/res/values-sw600dp/keyboard-heights.xml @@ -0,0 +1,28 @@ +<?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. +*/ +--> + +<!-- Preferable keyboard height in absolute scale: 48.0mm --> +<resources> + <!-- Build.HARDWARE,keyboard_height_in_dp --> + <string-array name="keyboard_heights" translatable="false"> + <!-- Xoom --> + <item>stingray,283.1337</item> + </string-array> +</resources> diff --git a/java/res/values-sw768dp-land/dimens.xml b/java/res/values-sw768dp-land/dimens.xml index 535c62308..b95c858dc 100644 --- a/java/res/values-sw768dp-land/dimens.xml +++ b/java/res/values-sw768dp-land/dimens.xml @@ -19,8 +19,9 @@ --> <resources> - <!-- keyboardHeight = key_height*4 + key_bottom_gap*3, key_height=14.5mm --> - <dimen name="keyboardHeight">58.0mm</dimen> + <!-- Preferable keyboard height in absolute scale: 58.0mm --> + <!-- This keyboardHeight value should match with keyboard-heights.xml --> + <dimen name="keyboardHeight">365.4dp</dimen> <fraction name="minKeyboardHeight">45%p</fraction> <fraction name="keyboard_top_padding">1.896%p</fraction> @@ -29,7 +30,6 @@ <fraction name="key_bottom_gap">4.103%p</fraction> <fraction name="key_horizontal_gap">1.034%p</fraction> - <dimen name="keyboardHeight_stone">58.0mm</dimen> <fraction name="key_bottom_gap_stone">3.379%p</fraction> <fraction name="key_horizontal_gap_stone">1.062%p</fraction> @@ -41,7 +41,7 @@ <fraction name="key_bottom_gap_ics">3.690%p</fraction> <fraction name="key_horizontal_gap_ics">1.030%p</fraction> - <dimen name="popup_key_height">13.0mm</dimen> + <dimen name="popup_key_height">81.9dp</dimen> <!-- left or right padding of label alignment --> <dimen name="key_label_horizontal_padding">18dp</dimen> @@ -53,10 +53,10 @@ <fraction name="key_hint_label_ratio">28%</fraction> <fraction name="key_uppercase_letter_ratio">24%</fraction> <fraction name="spacebar_text_ratio">24.00%</fraction> - <dimen name="key_preview_height">17.0mm</dimen> + <dimen name="key_preview_height">107.1dp</dimen> - <dimen name="key_preview_offset_ics">0.05in</dimen> + <dimen name="key_preview_offset_ics">8.0dp</dimen> - <dimen name="suggestions_strip_padding">40.0mm</dimen> + <dimen name="suggestions_strip_padding">252.0dp</dimen> <fraction name="min_more_suggestions_width">50%</fraction> </resources> diff --git a/java/res/values-sw768dp-land/keyboard-heights.xml b/java/res/values-sw768dp-land/keyboard-heights.xml new file mode 100644 index 000000000..692c5a0fb --- /dev/null +++ b/java/res/values-sw768dp-land/keyboard-heights.xml @@ -0,0 +1,28 @@ +<?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. +*/ +--> + +<!-- Preferable keyboard height in absolute scale: 58.0mm --> +<resources> + <!-- Build.HARDWARE,keyboard_height_in_dp --> + <string-array name="keyboard_heights" translatable="false"> + <!-- Xoom --> + <item>stingray,342.1198</item> + </string-array> +</resources> diff --git a/java/res/values-sw768dp/dimens.xml b/java/res/values-sw768dp/dimens.xml index 7aefa26af..0a362fd68 100644 --- a/java/res/values-sw768dp/dimens.xml +++ b/java/res/values-sw768dp/dimens.xml @@ -19,8 +19,9 @@ --> <resources> - <!-- keyboardHeight = key_height*4 + key_bottom_gap*3, key_height=12mm --> - <dimen name="keyboardHeight">48.0mm</dimen> + <!-- Preferable keyboard height in absolute scale: 48.0mm --> + <!-- This keyboardHeight value should match with keyboard-heights.xml --> + <dimen name="keyboardHeight">302.4dp</dimen> <fraction name="maxKeyboardHeight">50%p</fraction> <fraction name="minKeyboardHeight">-35.0%p</fraction> @@ -30,7 +31,6 @@ <fraction name="key_bottom_gap">4.270%p</fraction> <fraction name="key_horizontal_gap">1.551%p</fraction> - <dimen name="keyboardHeight_stone">48.0mm</dimen> <fraction name="key_bottom_gap_stone">3.75%p</fraction> <fraction name="key_horizontal_gap_stone">1.059%p</fraction> @@ -41,14 +41,14 @@ <fraction name="key_bottom_gap_ics">3.312%p</fraction> <fraction name="key_horizontal_gap_ics">1.066%p</fraction> - <dimen name="popup_key_height">10.0mm</dimen> + <dimen name="popup_key_height">63.0dp</dimen> <dimen name="more_keys_keyboard_key_horizontal_padding">12dp</dimen> <!-- Amount of allowance for selecting keys in a mini popup keyboard by sliding finger. --> <!-- popup_key_height x 1.2 --> - <dimen name="more_keys_keyboard_slide_allowance">15.6mm</dimen> + <dimen name="more_keys_keyboard_slide_allowance">98.3dp</dimen> <!-- popup_key_height x -1.0 --> - <dimen name="more_keys_keyboard_vertical_correction">-13.0mm</dimen> + <dimen name="more_keys_keyboard_vertical_correction">-81.9dp</dimen> <!-- left or right padding of label alignment --> <dimen name="key_label_horizontal_padding">6dp</dimen> @@ -63,18 +63,18 @@ <fraction name="key_uppercase_letter_ratio">26%</fraction> <fraction name="key_preview_text_ratio">50%</fraction> <fraction name="spacebar_text_ratio">29.03%</fraction> - <dimen name="key_preview_height">15.0mm</dimen> - <dimen name="key_preview_offset">0.1in</dimen> + <dimen name="key_preview_height">94.5dp</dimen> + <dimen name="key_preview_offset">16.0dp</dimen> - <dimen name="key_preview_offset_ics">0.05in</dimen> + <dimen name="key_preview_offset_ics">8.0dp</dimen> <!-- popup_key_height x -0.5 --> - <dimen name="more_keys_keyboard_vertical_correction_ics">-5mm</dimen> + <dimen name="more_keys_keyboard_vertical_correction_ics">-31.5dp</dimen> <dimen name="suggestions_strip_height">44dp</dimen> <dimen name="more_suggestions_row_height">44dp</dimen> <integer name="max_more_suggestions_row">6</integer> <fraction name="min_more_suggestions_width">90%</fraction> - <dimen name="suggestions_strip_padding">15.0mm</dimen> + <dimen name="suggestions_strip_padding">94.5dp</dimen> <dimen name="suggestion_min_width">46dp</dimen> <dimen name="suggestion_padding">8dp</dimen> <dimen name="suggestion_text_size">22dp</dimen> diff --git a/java/res/values-sw768dp/keyboard-heights.xml b/java/res/values-sw768dp/keyboard-heights.xml new file mode 100644 index 000000000..77e52be2f --- /dev/null +++ b/java/res/values-sw768dp/keyboard-heights.xml @@ -0,0 +1,28 @@ +<?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. +*/ +--> + +<!-- Preferable keyboard height in absolute scale: 48.0mm --> +<resources> + <!-- Build.HARDWARE,keyboard_height_in_dp --> + <string-array name="keyboard_heights" translatable="false"> + <!-- Xoom --> + <item>stingray,283.1337</item> + </string-array> +</resources> diff --git a/java/res/values-th/strings.xml b/java/res/values-th/strings.xml index f291fcce7..d255f44cf 100644 --- a/java/res/values-th/strings.xml +++ b/java/res/values-th/strings.xml @@ -37,12 +37,9 @@ <string name="misc_category" msgid="6894192814868233453">"ตัวเลือกอื่นๆ"</string> <string name="advanced_settings" msgid="362895144495591463">"การตั้งค่าขั้นสูง"</string> <string name="advanced_settings_summary" msgid="4487980456152830271">"ตัวเลือกสำหรับผู้เชี่ยวชาญ"</string> - <!-- no translation found for include_other_imes_in_language_switch_list (4533689960308565519) --> - <skip /> - <!-- no translation found for include_other_imes_in_language_switch_list_summary (840637129103317635) --> - <skip /> - <!-- no translation found for suppress_language_switch_key (8003788410354806368) --> - <skip /> + <string name="include_other_imes_in_language_switch_list" msgid="4533689960308565519">"ใช้วิธีการป้อนข้อมูลอื่น"</string> + <string name="include_other_imes_in_language_switch_list_summary" msgid="840637129103317635">"แป้นสลับภาษาครอบคลุมวิธีการป้อนข้อมูลอื่นๆ ด้วย"</string> + <string name="suppress_language_switch_key" msgid="8003788410354806368">"ยกเลิกแป้นสลับภาษา"</string> <string name="key_preview_popup_dismiss_delay" msgid="6213164897443068248">"หน่วงเวลาก่อนปิดป๊อปอัพหลัก"</string> <string name="key_preview_popup_dismiss_no_delay" msgid="2096123151571458064">"ไม่มีการหน่วงเวลา"</string> <string name="key_preview_popup_dismiss_default_delay" msgid="2166964333903906734">"ค่าเริ่มต้น"</string> diff --git a/java/res/values-tl/strings.xml b/java/res/values-tl/strings.xml index 53ae616f1..336a0831e 100644 --- a/java/res/values-tl/strings.xml +++ b/java/res/values-tl/strings.xml @@ -37,12 +37,9 @@ <string name="misc_category" msgid="6894192814868233453">"Iba pang mga pagpipilian"</string> <string name="advanced_settings" msgid="362895144495591463">"Mga advanced na setting"</string> <string name="advanced_settings_summary" msgid="4487980456152830271">"Mga pagpipilian para sa mga dalubhasa"</string> - <!-- no translation found for include_other_imes_in_language_switch_list (4533689960308565519) --> - <skip /> - <!-- no translation found for include_other_imes_in_language_switch_list_summary (840637129103317635) --> - <skip /> - <!-- no translation found for suppress_language_switch_key (8003788410354806368) --> - <skip /> + <string name="include_other_imes_in_language_switch_list" msgid="4533689960308565519">"Lipat iba paraan ng input"</string> + <string name="include_other_imes_in_language_switch_list_summary" msgid="840637129103317635">"Saklaw din ng key ng pagpalit ng wika ang ibang paraan ng input"</string> + <string name="suppress_language_switch_key" msgid="8003788410354806368">"Pigilan key pagpalit wika"</string> <string name="key_preview_popup_dismiss_delay" msgid="6213164897443068248">"Balewala antala key popup"</string> <string name="key_preview_popup_dismiss_no_delay" msgid="2096123151571458064">"Walang antala"</string> <string name="key_preview_popup_dismiss_default_delay" msgid="2166964333903906734">"Default"</string> diff --git a/java/res/values-tr/strings.xml b/java/res/values-tr/strings.xml index 01acfbf60..8689adcbe 100644 --- a/java/res/values-tr/strings.xml +++ b/java/res/values-tr/strings.xml @@ -37,12 +37,9 @@ <string name="misc_category" msgid="6894192814868233453">"Diğer seçenekler"</string> <string name="advanced_settings" msgid="362895144495591463">"Gelişmiş ayarlar"</string> <string name="advanced_settings_summary" msgid="4487980456152830271">"Uzmanlar için seçenekler"</string> - <!-- no translation found for include_other_imes_in_language_switch_list (4533689960308565519) --> - <skip /> - <!-- no translation found for include_other_imes_in_language_switch_list_summary (840637129103317635) --> - <skip /> - <!-- no translation found for suppress_language_switch_key (8003788410354806368) --> - <skip /> + <string name="include_other_imes_in_language_switch_list" msgid="4533689960308565519">"Diğ. giriş yöntem. geç"</string> + <string name="include_other_imes_in_language_switch_list_summary" msgid="840637129103317635">"Dil geçiş tuşu diğer giriş yöntemlerini de kapsar"</string> + <string name="suppress_language_switch_key" msgid="8003788410354806368">"Dil geçiş tuşunu gösterme"</string> <string name="key_preview_popup_dismiss_delay" msgid="6213164897443068248">"Tuş popup içn kaptm ertlm"</string> <string name="key_preview_popup_dismiss_no_delay" msgid="2096123151571458064">"Gecikme yok"</string> <string name="key_preview_popup_dismiss_default_delay" msgid="2166964333903906734">"Varsayılan"</string> diff --git a/java/res/values-uk/strings.xml b/java/res/values-uk/strings.xml index ea970fe04..f449becec 100644 --- a/java/res/values-uk/strings.xml +++ b/java/res/values-uk/strings.xml @@ -37,12 +37,9 @@ <string name="misc_category" msgid="6894192814868233453">"Інші опції"</string> <string name="advanced_settings" msgid="362895144495591463">"Розширені налаштування"</string> <string name="advanced_settings_summary" msgid="4487980456152830271">"Налаштування для досвідчених користувачів"</string> - <!-- no translation found for include_other_imes_in_language_switch_list (4533689960308565519) --> - <skip /> - <!-- no translation found for include_other_imes_in_language_switch_list_summary (840637129103317635) --> - <skip /> - <!-- no translation found for suppress_language_switch_key (8003788410354806368) --> - <skip /> + <string name="include_other_imes_in_language_switch_list" msgid="4533689960308565519">"Інші методи введення"</string> + <string name="include_other_imes_in_language_switch_list_summary" msgid="840637129103317635">"Клавіша зміни мови дозволяє змінювати методи введення"</string> + <string name="suppress_language_switch_key" msgid="8003788410354806368">"Заблок.клавішу зміни мови"</string> <string name="key_preview_popup_dismiss_delay" msgid="6213164897443068248">"Затримка клавіши закриття"</string> <string name="key_preview_popup_dismiss_no_delay" msgid="2096123151571458064">"Без затримки"</string> <string name="key_preview_popup_dismiss_default_delay" msgid="2166964333903906734">"За умовчанням"</string> diff --git a/java/res/values-vi/strings.xml b/java/res/values-vi/strings.xml index 25d1f289f..01179845f 100644 --- a/java/res/values-vi/strings.xml +++ b/java/res/values-vi/strings.xml @@ -37,12 +37,9 @@ <string name="misc_category" msgid="6894192814868233453">"Tùy chọn khác"</string> <string name="advanced_settings" msgid="362895144495591463">"Cài đặt nâng cao"</string> <string name="advanced_settings_summary" msgid="4487980456152830271">"Tùy chọn dành cho chuyên gia"</string> - <!-- no translation found for include_other_imes_in_language_switch_list (4533689960308565519) --> - <skip /> - <!-- no translation found for include_other_imes_in_language_switch_list_summary (840637129103317635) --> - <skip /> - <!-- no translation found for suppress_language_switch_key (8003788410354806368) --> - <skip /> + <string name="include_other_imes_in_language_switch_list" msgid="4533689960308565519">"Phương thức nhập khác"</string> + <string name="include_other_imes_in_language_switch_list_summary" msgid="840637129103317635">"Khóa chuyển ngôn ngữ bao gồm cả các phương thức nhập liệu khác"</string> + <string name="suppress_language_switch_key" msgid="8003788410354806368">"Bỏ khóa chuyển ngôn ngữ"</string> <string name="key_preview_popup_dismiss_delay" msgid="6213164897443068248">"Loại bỏ hiển thị phím trễ"</string> <string name="key_preview_popup_dismiss_no_delay" msgid="2096123151571458064">"Không có tgian trễ"</string> <string name="key_preview_popup_dismiss_default_delay" msgid="2166964333903906734">"Mặc định"</string> diff --git a/java/res/values-zh-rCN/strings.xml b/java/res/values-zh-rCN/strings.xml index ef42b7f7f..0e94806a7 100644 --- a/java/res/values-zh-rCN/strings.xml +++ b/java/res/values-zh-rCN/strings.xml @@ -37,12 +37,9 @@ <string name="misc_category" msgid="6894192814868233453">"其他选项"</string> <string name="advanced_settings" msgid="362895144495591463">"高级设置"</string> <string name="advanced_settings_summary" msgid="4487980456152830271">"高级选项"</string> - <!-- no translation found for include_other_imes_in_language_switch_list (4533689960308565519) --> - <skip /> - <!-- no translation found for include_other_imes_in_language_switch_list_summary (840637129103317635) --> - <skip /> - <!-- no translation found for suppress_language_switch_key (8003788410354806368) --> - <skip /> + <string name="include_other_imes_in_language_switch_list" msgid="4533689960308565519">"切换到其他输入法"</string> + <string name="include_other_imes_in_language_switch_list_summary" msgid="840637129103317635">"语言切换键也可用于切换其他输入法"</string> + <string name="suppress_language_switch_key" msgid="8003788410354806368">"隐藏语言切换键"</string> <string name="key_preview_popup_dismiss_delay" msgid="6213164897443068248">"关闭弹出键时的延迟"</string> <string name="key_preview_popup_dismiss_no_delay" msgid="2096123151571458064">"无延迟"</string> <string name="key_preview_popup_dismiss_default_delay" msgid="2166964333903906734">"默认"</string> diff --git a/java/res/values-zh-rTW/strings.xml b/java/res/values-zh-rTW/strings.xml index a2c2f0250..ac8da4325 100644 --- a/java/res/values-zh-rTW/strings.xml +++ b/java/res/values-zh-rTW/strings.xml @@ -37,12 +37,9 @@ <string name="misc_category" msgid="6894192814868233453">"其他選項"</string> <string name="advanced_settings" msgid="362895144495591463">"進階設定"</string> <string name="advanced_settings_summary" msgid="4487980456152830271">"進階選項"</string> - <!-- no translation found for include_other_imes_in_language_switch_list (4533689960308565519) --> - <skip /> - <!-- no translation found for include_other_imes_in_language_switch_list_summary (840637129103317635) --> - <skip /> - <!-- no translation found for suppress_language_switch_key (8003788410354806368) --> - <skip /> + <string name="include_other_imes_in_language_switch_list" msgid="4533689960308565519">"切換至其他輸入法"</string> + <string name="include_other_imes_in_language_switch_list_summary" msgid="840637129103317635">"使語言切換鍵包含其他輸入法"</string> + <string name="suppress_language_switch_key" msgid="8003788410354806368">"隱藏語言切換鍵"</string> <string name="key_preview_popup_dismiss_delay" msgid="6213164897443068248">"關閉彈出式鍵盤的延遲時間"</string> <string name="key_preview_popup_dismiss_no_delay" msgid="2096123151571458064">"不延遲"</string> <string name="key_preview_popup_dismiss_default_delay" msgid="2166964333903906734">"預設"</string> diff --git a/java/res/values-zu/strings.xml b/java/res/values-zu/strings.xml index 3646a85ed..799a262b6 100644 --- a/java/res/values-zu/strings.xml +++ b/java/res/values-zu/strings.xml @@ -38,7 +38,7 @@ <string name="advanced_settings" msgid="362895144495591463">"Izilungiselelo ezithuthukisiwe"</string> <string name="advanced_settings_summary" msgid="4487980456152830271">"Izinketho zezingcwenti"</string> <string name="include_other_imes_in_language_switch_list" msgid="4533689960308565519">"Shintshela kwezinye izindlela zokungena"</string> - <string name="include_other_imes_in_language_switch_list_summary" msgid="840637129103317635">"Ukhiye wokushintsha ilimi ubandakanya ezinye izindlela zokungenayo"</string> + <string name="include_other_imes_in_language_switch_list_summary" msgid="840637129103317635">"Ukhiye wokushintsha ulimi ubandakanya ezinye izindlela zokungenayo"</string> <string name="suppress_language_switch_key" msgid="8003788410354806368">"Ukhiye wokushintshela wokuvimbela ulimi"</string> <string name="key_preview_popup_dismiss_delay" msgid="6213164897443068248">"Ukuvela kokhiye cashisa ukulibazisa"</string> <string name="key_preview_popup_dismiss_no_delay" msgid="2096123151571458064">"Cha ukulibazisa"</string> diff --git a/java/res/values/attrs.xml b/java/res/values/attrs.xml index e619ad0a8..550f5acf7 100644 --- a/java/res/values/attrs.xml +++ b/java/res/values/attrs.xml @@ -133,6 +133,7 @@ <attr name="spacebarTextColor" format="color" /> <attr name="spacebarTextShadowColor" format="color" /> <!-- Fadeout animator for spacebar language label. --> + <attr name="languageOnSpacebarFinalAlpha" format="integer" /> <attr name="languageOnSpacebarFadeoutAnimator" format="reference" /> <!-- Fadeout and fadein animator for altCodeWhileTyping keys. --> <attr name="altCodeKeyWhileTypingFadeoutAnimator" format="reference" /> @@ -201,9 +202,10 @@ <!-- Default height of a row (key height + vertical gap), in pixels or percentage of keyboard height. --> <attr name="rowHeight" format="dimension|fraction" /> - <!-- Default horizontal gap between keys. --> + <!-- Default horizontal gap between keys, in pixels or percentage of keyboard width. --> <attr name="horizontalGap" format="dimension|fraction" /> - <!-- Default vertical gap between rows of keys. --> + <!-- Default vertical gap between rows of keys, in pixels or percentage of keyboard + height. --> <attr name="verticalGap" format="dimension|fraction" /> <!-- More keys keyboard layout template --> <attr name="moreKeysTemplate" format="reference" /> @@ -222,6 +224,8 @@ <attr name="iconDisabledShortcutKey" format="reference" /> <attr name="iconPreviewTabKey" format="reference" /> <attr name="iconLanguageSwitchKey" format="reference" /> + <attr name="iconZwnjKey" format="reference" /> + <attr name="iconZwjKey" format="reference" /> </declare-styleable> <declare-styleable name="Keyboard_Key"> @@ -307,6 +311,8 @@ <enum name="iconSpaceKeyForNumberLayout" value="10" /> <enum name="iconShiftKeyShifted" value="11" /> <enum name="iconLanguageSwitchKey" value="14" /> + <enum name="iconZwnjKey" value="15" /> + <enum name="iconZwjKey" value="16" /> </attr> <!-- The icon for disabled key --> <attr name="keyIconDisabled" format="enum"> diff --git a/java/res/values/config.xml b/java/res/values/config.xml index c51800fb0..f0b12e92b 100644 --- a/java/res/values/config.xml +++ b/java/res/values/config.xml @@ -38,6 +38,7 @@ <integer name="config_delay_update_suggestions">100</integer> <integer name="config_delay_update_old_suggestions">300</integer> <integer name="config_delay_update_shift_state">100</integer> + <integer name="config_language_on_spacebar_final_alpha">128</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> @@ -53,9 +54,9 @@ <!-- Configuration for LatinKeyboardView --> - <dimen name="config_key_hysteresis_distance">0.05in</dimen> + <dimen name="config_key_hysteresis_distance">8.0dp</dimen> <integer name="config_touch_noise_threshold_time">40</integer> - <dimen name="config_touch_noise_threshold_distance">2.0mm</dimen> + <dimen name="config_touch_noise_threshold_distance">12.6dp</dimen> <bool name="config_sliding_key_input_enabled">true</bool> <integer name="config_key_repeat_start_timeout">400</integer> <integer name="config_key_repeat_interval">50</integer> @@ -98,5 +99,4 @@ 4 = ? --> <integer name="log_screen_metrics">0</integer> - <bool name="config_require_umlaut_processing">false</bool> </resources> diff --git a/java/res/values/dimens.xml b/java/res/values/dimens.xml index 5f74fa746..1889758b9 100644 --- a/java/res/values/dimens.xml +++ b/java/res/values/dimens.xml @@ -19,12 +19,13 @@ --> <resources> - <!-- keyboardHeight = row_height*4 + key_bottom_gap*3 --> - <dimen name="keyboardHeight">1.285in</dimen> + <!-- Preferable keyboard height in absolute scale: 1.285in --> + <!-- This keyboardHeight value should match with keyboard-heights.xml --> + <dimen name="keyboardHeight">205.6dp</dimen> <fraction name="maxKeyboardHeight">50%p</fraction> <fraction name="minKeyboardHeight">-61.8%p</fraction> - <dimen name="popup_key_height">0.330in</dimen> + <dimen name="popup_key_height">52.8dp</dimen> <dimen name="more_keys_keyboard_horizontal_edges_padding">16dp</dimen> <dimen name="more_keys_keyboard_key_horizontal_padding">8dp</dimen> @@ -35,7 +36,6 @@ <fraction name="key_bottom_gap">6.250%p</fraction> <fraction name="key_horizontal_gap">1.352%p</fraction> - <dimen name="keyboardHeight_stone">1.317in</dimen> <fraction name="keyboard_top_padding_stone">1.556%p</fraction> <fraction name="keyboard_bottom_padding_stone">0.778%p</fraction> <fraction name="key_bottom_gap_stone">7.506%p</fraction> @@ -52,12 +52,10 @@ <!-- Amount of allowance for selecting keys in a mini popup keyboard by sliding finger. --> <!-- popup_key_height x 1.2 --> - <dimen name="more_keys_keyboard_slide_allowance">0.396in</dimen> + <dimen name="more_keys_keyboard_slide_allowance">63.36dp</dimen> <!-- popup_key_height x -1.0 --> - <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> + <dimen name="more_keys_keyboard_vertical_correction">-52.8dp</dimen> + <dimen name="keyboard_vertical_correction">0.0dp</dimen> <fraction name="key_letter_ratio">55%</fraction> <fraction name="key_large_letter_ratio">65%</fraction> @@ -68,23 +66,23 @@ <fraction name="key_preview_text_ratio">82%</fraction> <fraction name="spacebar_text_ratio">33.735%</fraction> <dimen name="key_preview_height">80dp</dimen> - <dimen name="key_preview_offset">0.1in</dimen> + <dimen name="key_preview_offset">16.0dp</dimen> <dimen name="key_label_horizontal_padding">4dp</dimen> <dimen name="key_hint_letter_padding">1dp</dimen> <dimen name="key_popup_hint_letter_padding">2dp</dimen> <dimen name="key_uppercase_letter_padding">2dp</dimen> - <dimen name="key_preview_offset_ics">0.05in</dimen> + <dimen name="key_preview_offset_ics">8.0dp</dimen> <!-- popup_key_height x -0.5 --> - <dimen name="more_keys_keyboard_vertical_correction_ics">-0.165in</dimen> + <dimen name="more_keys_keyboard_vertical_correction_ics">-26.4dp</dimen> <dimen name="suggestions_strip_height">40dp</dimen> <dimen name="more_suggestions_key_horizontal_padding">12dp</dimen> <dimen name="more_suggestions_row_height">40dp</dimen> <dimen name="more_suggestions_bottom_gap">6dp</dimen> - <dimen name="more_suggestions_modal_tolerance">0.2in</dimen> - <dimen name="more_suggestions_slide_allowance">0.1in</dimen> + <dimen name="more_suggestions_modal_tolerance">32.0dp</dimen> + <dimen name="more_suggestions_slide_allowance">16.0dp</dimen> <integer name="max_more_suggestions_row">6</integer> <fraction name="min_more_suggestions_width">90%</fraction> <fraction name="more_suggestions_info_ratio">18%</fraction> diff --git a/java/res/values/donottranslate-config.xml b/java/res/values/donottranslate-config.xml new file mode 100644 index 000000000..ba1cecb6c --- /dev/null +++ b/java/res/values/donottranslate-config.xml @@ -0,0 +1,24 @@ +<?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. +*/ +--> + +<resources> + <bool name="config_require_umlaut_processing">false</bool> + <bool name="config_require_ligatures_processing">false</bool> +</resources> diff --git a/java/res/values/donottranslate-more-keys.xml b/java/res/values/donottranslate-more-keys.xml index 6577acdb9..79e12f86a 100644 --- a/java/res/values/donottranslate-more-keys.xml +++ b/java/res/values/donottranslate-more-keys.xml @@ -139,6 +139,11 @@ <string name="more_keys_for_symbols_semicolon"></string> <!-- U+2030: "‰" PER MILLE SIGN --> <string name="more_keys_for_symbols_percent">‰</string> + <string name="keylabel_for_tablet_comma">,</string> + <string name="keyhintlabel_for_tablet_comma">!</string> + <string name="more_keys_for_tablet_comma">!</string> + <string name="keyhintlabel_for_tablet_period">\?</string> + <string name="more_keys_for_tablet_period">\?</string> <string name="keylabel_for_apostrophe">\'</string> <string name="keylabel_for_dash">-</string> <string name="keyhintlabel_for_apostrophe">\"</string> diff --git a/java/res/values/keyboard-heights.xml b/java/res/values/keyboard-heights.xml new file mode 100644 index 000000000..7d5b58372 --- /dev/null +++ b/java/res/values/keyboard-heights.xml @@ -0,0 +1,34 @@ +<?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. +*/ +--> + +<!-- Preferable keyboard height in absolute scale: 1.285in --> +<resources> + <!-- Build.HARDWARE,keyboard_height_in_dp --> + <string-array name="keyboard_heights" translatable="false"> + <!-- Droid --> + <item>sholes,227.0167</item> + <!-- Nexus One --> + <item>mahimahi,217.5932</item> + <!-- Nexus S --> + <item>herring,200.8554</item> + <!-- Galaxy Nexus --> + <item>tuna,202.5869</item> + </string-array> +</resources> diff --git a/java/res/values/keyboard-icons-black.xml b/java/res/values/keyboard-icons-black.xml index 44fc2b9c1..1ff597a49 100644 --- a/java/res/values/keyboard-icons-black.xml +++ b/java/res/values/keyboard-icons-black.xml @@ -36,5 +36,8 @@ <item name="iconPreviewTabKey">@drawable/sym_keyboard_feedback_tab</item> <!-- TODO: Needs dedicated black theme globe icon --> <item name="iconLanguageSwitchKey">@drawable/sym_keyboard_language_switch</item> + <!-- TODO: Needs dedicated black theme ZWNJ and ZWJ icons --> + <item name="iconZwnjKey">@drawable/sym_keyboard_zwnj_holo</item> + <item name="iconZwjKey">@drawable/sym_keyboard_zwj_holo</item> </style> </resources> diff --git a/java/res/values/keyboard-icons-ics.xml b/java/res/values/keyboard-icons-ics.xml index 5fba0253d..0774d57ac 100644 --- a/java/res/values/keyboard-icons-ics.xml +++ b/java/res/values/keyboard-icons-ics.xml @@ -34,5 +34,7 @@ <item name="iconDisabledShortcutKey">@drawable/sym_keyboard_voice_off_holo</item> <item name="iconPreviewTabKey">@drawable/sym_keyboard_feedback_tab</item> <item name="iconLanguageSwitchKey">@drawable/sym_keyboard_language_switch</item> + <item name="iconZwnjKey">@drawable/sym_keyboard_zwnj_holo</item> + <item name="iconZwjKey">@drawable/sym_keyboard_zwj_holo</item> </style> </resources> diff --git a/java/res/values/keyboard-icons-white.xml b/java/res/values/keyboard-icons-white.xml index 837b1a37a..5798786f8 100644 --- a/java/res/values/keyboard-icons-white.xml +++ b/java/res/values/keyboard-icons-white.xml @@ -32,5 +32,8 @@ <item name="iconDisabledShortcutKey">@drawable/sym_keyboard_voice_off_holo</item> <item name="iconPreviewTabKey">@drawable/sym_keyboard_feedback_tab</item> <item name="iconLanguageSwitchKey">@drawable/sym_keyboard_language_switch</item> + <!-- TODO: Needs dedicated black theme ZWNJ and ZWJ icons --> + <item name="iconZwnjKey">@drawable/sym_keyboard_zwnj_holo</item> + <item name="iconZwjKey">@drawable/sym_keyboard_zwj_holo</item> </style> </resources> diff --git a/java/res/values/styles.xml b/java/res/values/styles.xml index 5628f271c..b08ff3b90 100644 --- a/java/res/values/styles.xml +++ b/java/res/values/styles.xml @@ -78,6 +78,7 @@ <item name="longPressSpaceKeyTimeout">@integer/config_long_press_space_key_timeout</item> <item name="ignoreAltCodeKeyTimeout">@integer/config_ignore_alt_code_key_timeout</item> <item name="showMoreKeysKeyboardAtTouchedPoint">@bool/config_show_more_keys_keyboard_at_touched_point</item> + <item name="languageOnSpacebarFinalAlpha">@integer/config_language_on_spacebar_final_alpha</item> <item name="languageOnSpacebarFadeoutAnimator">@anim/language_on_spacebar_fadeout</item> <item name="altCodeKeyWhileTypingFadeoutAnimator">@anim/alt_code_key_while_typing_fadeout</item> <item name="altCodeKeyWhileTypingFadeinAnimator">@anim/alt_code_key_while_typing_fadein</item> @@ -172,7 +173,6 @@ > <!-- This should be aligned with KeyboardSwitcher.KEYBOARD_THEMES[] --> <item name="themeId">6</item> - <item name="keyboardHeight">@dimen/keyboardHeight_stone</item> <item name="keyboardTopPadding">@fraction/keyboard_top_padding_stone</item> <item name="keyboardBottomPadding">@fraction/keyboard_bottom_padding_stone</item> <item name="horizontalGap">@fraction/key_horizontal_gap_stone</item> diff --git a/java/res/xml-fa/keyboard_set.xml b/java/res/xml-fa/keyboard_set.xml index 9bd105093..cb62b0dae 100644 --- a/java/res/xml-fa/keyboard_set.xml +++ b/java/res/xml-fa/keyboard_set.xml @@ -23,7 +23,7 @@ latin:keyboardLocale="fa" > <Element latin:elementName="alphabet" - latin:elementKeyboard="@xml/kbd_arabic" /> + latin:elementKeyboard="@xml/kbd_farsi" /> <Element latin:elementName="symbols" latin:elementKeyboard="@xml/kbd_symbols" /> diff --git a/java/res/xml-sw600dp-land/kbd_thai.xml b/java/res/xml-sw600dp-land/kbd_thai.xml new file mode 100644 index 000000000..ac36ea5ff --- /dev/null +++ b/java/res/xml-sw600dp-land/kbd_thai.xml @@ -0,0 +1,28 @@ +<?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. +*/ +--> + +<Keyboard + xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin" + latin:rowHeight="20%p" + latin:verticalGap="3.20%p" +> + <include + latin:keyboardLayout="@xml/rows_thai" /> +</Keyboard> diff --git a/java/res/xml-sw600dp/kbd_thai.xml b/java/res/xml-sw600dp/kbd_thai.xml new file mode 100644 index 000000000..ac36ea5ff --- /dev/null +++ b/java/res/xml-sw600dp/kbd_thai.xml @@ -0,0 +1,28 @@ +<?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. +*/ +--> + +<Keyboard + xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin" + latin:rowHeight="20%p" + latin:verticalGap="3.20%p" +> + <include + latin:keyboardLayout="@xml/rows_thai" /> +</Keyboard> diff --git a/java/res/xml-sw600dp/key_styles_common.xml b/java/res/xml-sw600dp/key_styles_common.xml index a263acd9b..77c0efd22 100644 --- a/java/res/xml-sw600dp/key_styles_common.xml +++ b/java/res/xml-sw600dp/key_styles_common.xml @@ -78,11 +78,15 @@ latin:styleName="spaceKeyStyle" latin:code="@integer/key_space" latin:keyActionFlags="noKeyPreview" /> + <!-- U+200C: ZERO WIDTH NON-JOINER + U+200D: ZERO WIDTH JOINER --> <key-style latin:styleName="zwnjKeyStyle" - latin:keyLabel="‌" - latin:moreKeys="‍" - latin:keyLabelFlags="hasPopupHint" /> + latin:code="0x200C" + latin:keyIcon="iconZwnjKey" + latin:moreKeys="\@icon/zwjKey|‍" + latin:keyLabelFlags="hasPopupHint" + latin:keyActionFlags="noKeyPreview" /> <key-style latin:styleName="smileyKeyStyle" latin:keyLabel=":-)" diff --git a/java/res/xml/keys_comma_period.xml b/java/res/xml-sw600dp/keys_comma_period.xml index 6db02b61d..f5f307be6 100644 --- a/java/res/xml/keys_comma_period.xml +++ b/java/res/xml-sw600dp/keys_comma_period.xml @@ -32,14 +32,14 @@ </case> <default> <Key - latin:keyLabel="," - latin:keyHintLabel="!" - latin:moreKeys="!" + latin:keyLabel="@string/keylabel_for_tablet_comma" + latin:keyHintLabel="@string/keyhintlabel_for_tablet_comma" + latin:moreKeys="@string/more_keys_for_tablet_comma" latin:keyStyle="hasShiftedLetterHintStyle" /> <Key latin:keyLabel="." - latin:keyHintLabel="\?" - latin:moreKeys="\?" + latin:keyHintLabel="@string/keyhintlabel_for_tablet_period" + latin:moreKeys="@string/more_keys_for_tablet_period" latin:keyStyle="hasShiftedLetterHintStyle" /> </default> </switch> diff --git a/java/res/xml-sw600dp/rowkeys_farsi1.xml b/java/res/xml-sw600dp/rowkeys_farsi1.xml new file mode 100644 index 000000000..ab260a460 --- /dev/null +++ b/java/res/xml-sw600dp/rowkeys_farsi1.xml @@ -0,0 +1,66 @@ +<?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" +> + <!-- U+0636: "ض" ARABIC LETTER DAD --> + <Key + latin:keyLabel="ض" /> + <!-- U+0635: "ص" ARABIC LETTER SAD --> + <Key + latin:keyLabel="ص" /> + <!-- U+062B: "ث" ARABIC LETTER THEH --> + <Key + latin:keyLabel="ث" /> + <!-- U+0642: "ق" ARABIC LETTER QAF --> + <Key + latin:keyLabel="ق" /> + <!-- U+0641: "ف" ARABIC LETTER FEH --> + <Key + latin:keyLabel="ف" /> + <!-- U+063A: "غ" ARABIC LETTER GHAIN --> + <Key + latin:keyLabel="غ" /> + <!-- U+0639: "ع" ARABIC LETTER AIN --> + <Key + latin:keyLabel="ع" /> + <!-- U+0647: "ه" ARABIC LETTER HEH + U+FEEB: "ﻫ" ARABIC LETTER HEH INITIAL FORM + U+0647/U+200D: ARABIC LETTER HEH + ZERO WIDTH JOINER + U+06C0: "ۀ" ARABIC LETTER HEH WITH YEH ABOVE + U+0629: "ة" ARABIC LETTER TEH MARBUTA --> + <!-- TODO: DroidSansArabic lacks the glyph of U+06C0 ARABIC LETTER HEH WITH YEH ABOVE --> + <Key + latin:keyLabel="ه" + latin:moreKeys="ﻫ|ه‍,ۀ,ة,%" /> + <!-- U+062E: "خ" ARABIC LETTER KHAH --> + <Key + latin:keyLabel="خ" /> + <!-- U+062D: "ح" ARABIC LETTER HAH --> + <Key + latin:keyLabel="ح" /> + <!-- U+062C: "ج" ARABIC LETTER JEEM --> + <Key + latin:keyLabel="ج" /> + <!-- U+0686: "چ" ARABIC LETTER TCHEH --> + <Key + latin:keyLabel="چ" /> +</merge> diff --git a/java/res/xml-sw600dp/rowkeys_farsi2.xml b/java/res/xml-sw600dp/rowkeys_farsi2.xml new file mode 100644 index 000000000..98e0f2186 --- /dev/null +++ b/java/res/xml-sw600dp/rowkeys_farsi2.xml @@ -0,0 +1,70 @@ +<?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" +> + <!-- U+0634: "ش" ARABIC LETTER SHEEN --> + <Key + latin:keyLabel="ش" /> + <!-- U+0633: "س" ARABIC LETTER SEEN --> + <Key + latin:keyLabel="س" /> + <!-- U+06CC: "ی" ARABIC LETTER FARSI YEH + U+0626: "ئ" ARABIC LETTER YEH WITH HAMZA ABOVE + U+064A: "ي" ARABIC LETTER YEH --> + <Key + latin:keyLabel="ی" + latin:moreKeys="ئ,ي" /> + <!-- U+0628: "ب" ARABIC LETTER BEH --> + <Key + latin:keyLabel="ب" /> + <!-- U+0644: "ل" ARABIC LETTER LAM --> + <Key + latin:keyLabel="ل" /> + <!-- U+0627: "ا" ARABIC LETTER ALEF + U+0621: "ء" ARABIC LETTER HAMZA + U+0622: "آ" ARABIC LETTER ALEF WITH MADDA ABOVE + U+0672: "ٲ" ARABIC LETTER ALEF WITH WAVY HAMZA ABOVE + U+0671: "ٱ" ARABIC LETTER ALEF WASLA + U+0673: "ٳ" ARABIC LETTER ALEF WITH WAVY HAMZA BELOW--> + <!-- TODO: DroidSansArabic lacks the glyph of U+0672 ARABIC LETTER ALEF WITH WAVY HAMZA ABOVE --> + <!-- TODO: DroidSansArabic lacks the glyph of U+0673 ARABIC LETTER ALEF WITH WAVY HAMZA BELOW --> + <Key + latin:keyLabel="ا" + latin:moreKeys="ء,آ,ٲ,ٱ,ٳ" /> + <!-- U+062A: "ت" ARABIC LETTER TEH --> + <Key + latin:keyLabel="ت" /> + <!-- U+0646: "ن" ARABIC LETTER NOON --> + <Key + latin:keyLabel="ن" /> + <!-- U+0645: "م" ARABIC LETTER MEEM --> + <Key + latin:keyLabel="م" /> + <!-- U+06A9: "ک" ARABIC LETTER KEHEH + U+0643: "ك" ARABIC LETTER KAF --> + <Key + latin:keyLabel="ک" + latin:moreKeys="ك" /> + <!-- U+06AF: "گ" ARABIC LETTER GAF --> + <Key + latin:keyLabel="گ" /> +</merge> diff --git a/java/res/xml-sw600dp/rowkeys_farsi3.xml b/java/res/xml-sw600dp/rowkeys_farsi3.xml new file mode 100644 index 000000000..c80c14a55 --- /dev/null +++ b/java/res/xml-sw600dp/rowkeys_farsi3.xml @@ -0,0 +1,53 @@ +<?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" +> + <!-- U+0638: "ظ" ARABIC LETTER ZAH --> + <Key + latin:keyLabel="ظ" /> + <!-- U+0637: "ط" ARABIC LETTER TAH --> + <Key + latin:keyLabel="ط" /> + <!-- U+0632: "ز" ARABIC LETTER ZAIN + U+0698: "ژ" ARABIC LETTER JEH --> + <Key + latin:keyLabel="ز" + latin:moreKeys="ژ" /> + <!-- U+0631: "ر" ARABIC LETTER REH --> + <Key + latin:keyLabel="ر" /> + <!-- U+0630: "ذ" ARABIC LETTER THAL --> + <Key + latin:keyLabel="ذ" /> + <!-- U+062F: "د" ARABIC LETTER DAL --> + <Key + latin:keyLabel="د" /> + <!-- U+067E: "پ" ARABIC LETTER PEH --> + <Key + latin:keyLabel="پ" /> + <!-- U+0648: "و" ARABIC LETTER WAW + U+0676: "ٶ" ARABIC LETTER HIGH HAMZA WAW --> + <!-- TODO: DroidSansArabic lacks the glyph of U+0676 ARABIC LETTER HIGH HAMZA WAW --> + <Key + latin:keyLabel="و" + latin:moreKeys="ٶ" /> +</merge> diff --git a/java/res/xml-sw600dp/rowkeys_thai1.xml b/java/res/xml-sw600dp/rowkeys_thai1.xml new file mode 100644 index 000000000..e49cb2b47 --- /dev/null +++ b/java/res/xml-sw600dp/rowkeys_thai1.xml @@ -0,0 +1,97 @@ +<?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" +> + <switch> + <case + latin:keyboardSetElement="alphabetManualShifted|alphabetShiftLocked|alphabetShiftLockShifted" + > + <!-- U+0E51: "๑" THAI DIGIT ONE --> + <Key + latin:keyLabel="๑" /> + <!-- U+0E52: "๒" THAI DIGIT TWO --> + <Key + latin:keyLabel="๒" /> + <!-- U+0E53: "๓" THAI DIGIT THREE --> + <Key + latin:keyLabel="๓" /> + <!-- U+0E54: "๔" THAI DIGIT FOUR --> + <Key + latin:keyLabel="๔" /> + <!-- U+0E39: " ู" THAI CHARACTER SARA UU --> + <Key + latin:keyLabel="ู" /> + <!-- U+0E3F: "฿" THAI CURRENCY SYMBOL BAHT --> + <Key + latin:keyLabel="฿" /> + <!-- U+0E55: "๕" THAI DIGIT FIVE --> + <Key + latin:keyLabel="๕" /> + <!-- U+0E56: "๖" THAI DIGIT SIX --> + <Key + latin:keyLabel="๖" /> + <!-- U+0E57: "๗" THAI DIGIT SEVEN --> + <Key + latin:keyLabel="๗" /> + <!-- U+0E58: "๘" THAI DIGIT EIGHT --> + <Key + latin:keyLabel="๘" /> + <!-- U+0E59: "๙" THAI DIGIT NINE --> + <Key + latin:keyLabel="๙" /> + </case> + <default> + <!-- U+0E45: "ๅ" THAI CHARACTER LAKKHANGYAO --> + <Key + latin:keyLabel="ๅ" /> + <Key + latin:keyLabel="/" /> + <!-- U+0E20: "ภ" THAI CHARACTER PHO SAMPHAO --> + <Key + latin:keyLabel="ภ" /> + <!-- U+0E16: "ถ" THAI CHARACTER THO THUNG --> + <Key + latin:keyLabel="ถ" /> + <!-- U+0E38: " ุ" THAI CHARACTER SARA U --> + <Key + latin:keyLabel="ุ" /> + <!-- U+0E36: " ึ" THAI CHARACTER SARA UE --> + <Key + latin:keyLabel="ึ" /> + <!-- U+0E04: "ค" THAI CHARACTER KHO KHWAI --> + <Key + latin:keyLabel="ค" /> + <!-- U+0E15: "ต" THAI CHARACTER TO TAO --> + <Key + latin:keyLabel="ต" /> + <!-- U+0E08: "จ" THAI CHARACTER CHO CHAN --> + <Key + latin:keyLabel="จ" /> + <!-- U+0E02: "ข" THAI CHARACTER KHO KHAI --> + <Key + latin:keyLabel="ข" /> + <!-- U+0E0A: "ช" THAI CHARACTER CHO CHANG --> + <Key + latin:keyLabel="ช" /> + </default> + </switch> +</merge> diff --git a/java/res/xml-sw600dp/rowkeys_thai2.xml b/java/res/xml-sw600dp/rowkeys_thai2.xml new file mode 100644 index 000000000..0edae1c73 --- /dev/null +++ b/java/res/xml-sw600dp/rowkeys_thai2.xml @@ -0,0 +1,108 @@ +<?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" +> + <switch> + <case + latin:keyboardSetElement="alphabetManualShifted|alphabetShiftLocked|alphabetShiftLockShifted" + > + <!-- U+0E50: "๐" THAI DIGIT ZERO --> + <Key + latin:keyLabel="๐" /> + <Key + latin:keyLabel=""" /> + <!-- U+0E0E: "ฎ" THAI CHARACTER DO CHADA --> + <Key + latin:keyLabel="ฎ" /> + <!-- U+0E11: "ฑ" THAI CHARACTER THO NANGMONTHO --> + <Key + latin:keyLabel="ฑ" /> + <!-- U+0E18: "ธ" THAI CHARACTER THO THONG --> + <Key + latin:keyLabel="ธ" /> + <!-- U+0E4D: "กํ" THAI CHARACTER THANTHAKHAT --> + <Key + latin:keyLabel="ํ" /> + <!-- U+0E4A: "ก๊" THAI CHARACTER MAI TRI --> + <Key + latin:keyLabel="๊" /> + <!-- U+0E13: "ณ" THAI CHARACTER NO NEN --> + <Key + latin:keyLabel="ณ" /> + <!-- U+0E2F: "ฯ" THAI CHARACTER PAIYANNOI --> + <Key + latin:keyLabel="ฯ" /> + <!-- U+0E0D: "ญ" THAI CHARACTER YO YING --> + <Key + latin:keyLabel="ญ" /> + <!-- U+0E10: "ฐ" THAI CHARACTER THO THAN --> + <Key + latin:keyLabel="ฐ" /> + <Key + latin:keyLabel="," /> + <!-- U+0E05: "ฅ" THAI CHARACTER KHO KHON --> + <Key + latin:keyLabel="ฅ" /> + </case> + <default> + <!-- U+0E46: "ๆ" THAI CHARACTER MAIYAMOK --> + <Key + latin:keyLabel="ๆ" /> + <!-- U+0E44: "ไ" THAI CHARACTER SARA AI MAIMALAI --> + <Key + latin:keyLabel="ไ" /> + <!-- U+0E33: "ำ" THAI CHARACTER SARA AM --> + <Key + latin:keyLabel="ำ" /> + <!-- U+0E1E: "พ" THAI CHARACTER PHO PHAN --> + <Key + latin:keyLabel="พ" /> + <!-- U+0E30: "ะ" THAI CHARACTER SARA A --> + <Key + latin:keyLabel="ะ" /> + <!-- U+0E31: "กั" THAI CHARACTER MAI HAN-AKAT --> + <Key + latin:keyLabel="ั" /> + <!-- U+0E35: "กี" HAI CHARACTER SARA II --> + <Key + latin:keyLabel="ี" /> + <!-- U+0E23: "ร" THAI CHARACTER RO RUA --> + <Key + latin:keyLabel="ร" /> + <!-- U+0E19: "น" THAI CHARACTER NO NU --> + <Key + latin:keyLabel="น" /> + <!-- U+0E22: "ย" THAI CHARACTER YO YAK --> + <Key + latin:keyLabel="ย" /> + <!-- U+0E1A: "บ" THAI CHARACTER BO BAIMAI --> + <Key + latin:keyLabel="บ" /> + <!-- U+0E25: "ล" THAI CHARACTER LO LING --> + <Key + latin:keyLabel="ล" /> + <!-- U+0E03: "ฃ" THAI CHARACTER KHO KHUAT --> + <Key + latin:keyLabel="ฃ" /> + </default> + </switch> +</merge> diff --git a/java/res/xml-sw600dp/rowkeys_thai3.xml b/java/res/xml-sw600dp/rowkeys_thai3.xml new file mode 100644 index 000000000..abd67631c --- /dev/null +++ b/java/res/xml-sw600dp/rowkeys_thai3.xml @@ -0,0 +1,97 @@ +<?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" +> + <switch> + <case + latin:keyboardSetElement="alphabetManualShifted|alphabetShiftLocked|alphabetShiftLockShifted" + > + <!-- U+0E24: "ฤ" THAI CHARACTER RU --> + <Key + latin:keyLabel="ฤ" /> + <!-- U+0E06: "ฆ" THAI CHARACTER KHO RAKHANG --> + <Key + latin:keyLabel="ฆ" /> + <!-- U+0E0F: "ฏ" THAI CHARACTER TO PATAK --> + <Key + latin:keyLabel="ฏ" /> + <!-- U+0E42: "โ" THAI CHARACTER SARA O --> + <Key + latin:keyLabel="โ" /> + <!-- U+0E0C: "ฌ" THAI CHARACTER CHO CHOE --> + <Key + latin:keyLabel="ฌ" /> + <!-- U+0E47: " ็" THAI CHARACTER MAITAIKHU --> + <Key + latin:keyLabel="็" /> + <!-- U+0E4B: " ๋" THAI CHARACTER MAI CHATTAWA --> + <Key + latin:keyLabel="๋" /> + <!-- U+0E29: "ษ" THAI CHARACTER SO RUSI --> + <Key + latin:keyLabel="ษ" /> + <!-- U+0E28: "ศ" THAI CHARACTER SO SALA --> + <Key + latin:keyLabel="ศ" /> + <!-- U+0E0B: "ซ" THAI CHARACTER SO SO --> + <Key + latin:keyLabel="ซ" /> + <Key + latin:keyLabel="." /> + </case> + <default> + <!-- U+0E1F: "ฟ" THAI CHARACTER FO FAN --> + <Key + latin:keyLabel="ฟ" /> + <!-- U+0E2B: "ห" THAI CHARACTER HO HIP --> + <Key + latin:keyLabel="ห" /> + <!-- U+0E01: "ก" THAI CHARACTER KO KAI --> + <Key + latin:keyLabel="ก" /> + <!-- U+0E14: "ด" THAI CHARACTER DO DEK --> + <Key + latin:keyLabel="ด" /> + <!-- U+0E40: "เ" THAI CHARACTER SARA E --> + <Key + latin:keyLabel="เ" /> + <!-- U+0E49: " ้" THAI CHARACTER MAI THO --> + <Key + latin:keyLabel="้" /> + <!-- U+0E48: " ฺ" THAI CHARACTER MAI EK --> + <Key + latin:keyLabel="่" /> + <!-- U+0E32: "า" THAI CHARACTER SARA AA --> + <Key + latin:keyLabel="า" /> + <!-- U+0E2A: "ส" THAI CHARACTER SO SUA --> + <Key + latin:keyLabel="ส" /> + <!-- U+0E27: "ว" THAI CHARACTER WO WAEN --> + <Key + latin:keyLabel="ว" /> + <!-- U+0E07: "ง" THAI CHARACTER NGO NGU --> + <Key + latin:keyLabel="ง" /> + </default> + </switch> +</merge> diff --git a/java/res/xml-sw600dp/rowkeys_thai4.xml b/java/res/xml-sw600dp/rowkeys_thai4.xml new file mode 100644 index 000000000..cec34a63b --- /dev/null +++ b/java/res/xml-sw600dp/rowkeys_thai4.xml @@ -0,0 +1,89 @@ +<?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" +> + <switch> + <case + latin:keyboardSetElement="alphabetManualShifted|alphabetShiftLocked|alphabetShiftLockShifted" + > + <Key + latin:keyLabel="(" /> + <Key + latin:keyLabel=")" /> + <!-- U+0E09: "ฉ" THAI CHARACTER CHO CHING --> + <Key + latin:keyLabel="ฉ" /> + <!-- U+0E2E: "ฮ" THAI CHARACTER HO NOKHUK --> + <Key + latin:keyLabel="ฮ" /> + <!-- U+0E3A: " ฺ" THAI CHARACTER PHINTHU --> + <Key + latin:keyLabel="ฺ" /> + <!-- U+0E4C: " ์" THAI CHARACTER THANTHAKHAT --> + <Key + latin:keyLabel="์" /> + <Key + latin:keyLabel="\?" /> + <!-- U+0E12: "ฒ" THAI CHARACTER THO PHUTHAO --> + <Key + latin:keyLabel="ฒ" /> + <!-- U+0E2C: "ฬ" THAI CHARACTER LO CHULA --> + <Key + latin:keyLabel="ฬ" /> + <!-- U+0E26: "ฦ" THAI CHARACTER LU --> + <Key + latin:keyLabel="ฦ" /> + </case> + <default> + <!-- U+0E1C: "ผ" THAI CHARACTER PHO PHUNG --> + <Key + latin:keyLabel="ผ" /> + <!-- U+0E1B: "ป" THAI CHARACTER PO PLA --> + <Key + latin:keyLabel="ป" /> + <!-- U+0E41: "แ" THAI CHARACTER SARA AE --> + <Key + latin:keyLabel="แ" /> + <!-- U+0E2D: "อ" THAI CHARACTER O ANG --> + <Key + latin:keyLabel="อ" /> + <!-- U+0E34: " ิ" THAI CHARACTER SARA I --> + <Key + latin:keyLabel="ิ" /> + <!-- U+0E37: " ื" THAI CHARACTER SARA UEE --> + <Key + latin:keyLabel="ื" /> + <!-- U+0E17: "ท" THAI CHARACTER THO THAHAN --> + <Key + latin:keyLabel="ท" /> + <!-- U+0E21: "ม" THAI CHARACTER MO MA --> + <Key + latin:keyLabel="ม" /> + <!-- U+0E43: "ใ" THAI CHARACTER SARA AI MAIMUAN --> + <Key + latin:keyLabel="ใ" /> + <!-- U+0E1D: "ฝ" THAI CHARACTER FO FA --> + <Key + latin:keyLabel="ฝ" /> + </default> + </switch> +</merge> diff --git a/java/res/xml-sw600dp/rows_farsi.xml b/java/res/xml-sw600dp/rows_farsi.xml new file mode 100644 index 000000000..75800420a --- /dev/null +++ b/java/res/xml-sw600dp/rows_farsi.xml @@ -0,0 +1,62 @@ +<?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" +> + <include + latin:keyboardLayout="@xml/key_styles_common" /> + <Row + latin:keyWidth="7.6%p" + > + <include + latin:keyboardLayout="@xml/rowkeys_farsi1" /> + <Key + latin:keyStyle="deleteKeyStyle" + latin:keyWidth="fillBoth" /> + </Row> + <Row + latin:keyWidth="7.6%p" + > + <include + latin:keyboardLayout="@xml/rowkeys_farsi2" + latin:keyXPos="4.5%p" /> + <Key + latin:keyStyle="enterKeyStyle" + latin:keyWidth="fillBoth" /> + </Row> + <Row + latin:keyWidth="7.6%p" + > + <Key + latin:keyStyle="shiftKeyStyle" + latin:keyWidth="10.0%p" /> + <include + latin:keyboardLayout="@xml/rowkeys_farsi3" /> + <include + latin:keyboardLayout="@xml/keys_comma_period" /> + <include + latin:keyboardLayout="@xml/key_smiley" + latin:keyXPos="-9.0%p" + latin:keyWidth="fillRight" /> + </Row> + <include + latin:keyboardLayout="@xml/row_qwerty4" /> +</merge> diff --git a/java/res/xml-sw600dp/rows_thai.xml b/java/res/xml-sw600dp/rows_thai.xml new file mode 100644 index 000000000..d4eaa10bb --- /dev/null +++ b/java/res/xml-sw600dp/rows_thai.xml @@ -0,0 +1,67 @@ +<?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" +> + <include + latin:keyboardLayout="@xml/key_styles_common" /> + <Row + latin:keyWidth="7.800%p" + > + <include + latin:keyboardLayout="@xml/rowkeys_thai1" + latin:keyXPos="4.0%p" /> + <Key + latin:keyStyle="deleteKeyStyle" + latin:keyWidth="fillRight" /> + </Row> + <Row + latin:keyWidth="7.692%p" + > + <include + latin:keyboardLayout="@xml/rowkeys_thai2" /> + </Row> + <Row + latin:keyWidth="7.692%p" + > + <include + latin:keyboardLayout="@xml/rowkeys_thai3" + latin:keyXPos="4.5%p" /> + <Key + latin:keyStyle="enterKeyStyle" + latin:keyWidth="fillBoth" /> + </Row> + <Row + latin:keyWidth="7.692%p" + > + <Key + latin:keyStyle="shiftKeyStyle" + latin:keyWidth="10.0%p" /> + <include + latin:keyboardLayout="@xml/rowkeys_thai4" /> + <include + latin:keyboardLayout="@xml/key_smiley" + latin:keyXPos="-9.0%p" + latin:keyWidth="fillRight" /> + </Row> + <include + latin:keyboardLayout="@xml/row_qwerty4" /> +</merge> diff --git a/java/res/xml-sw768dp-land/kbd_thai.xml b/java/res/xml-sw768dp-land/kbd_thai.xml new file mode 100644 index 000000000..4bfc9cb48 --- /dev/null +++ b/java/res/xml-sw768dp-land/kbd_thai.xml @@ -0,0 +1,28 @@ +<?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. +*/ +--> + +<Keyboard + xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin" + latin:rowHeight="20%p" + latin:verticalGap="2.65%p" +> + <include + latin:keyboardLayout="@xml/rows_thai" /> +</Keyboard> diff --git a/java/res/xml-sw768dp-land/kbd_thai_symbols.xml b/java/res/xml-sw768dp-land/kbd_thai_symbols.xml new file mode 100644 index 000000000..a3feeaae3 --- /dev/null +++ b/java/res/xml-sw768dp-land/kbd_thai_symbols.xml @@ -0,0 +1,28 @@ +<?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. +*/ +--> + +<Keyboard + xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin" + latin:rowHeight="20%p" + latin:verticalGap="2.65%p" +> + <include + latin:keyboardLayout="@xml/rows_thai_symbols" /> +</Keyboard> diff --git a/java/res/xml-sw768dp-land/kbd_thai_symbols_shift.xml b/java/res/xml-sw768dp-land/kbd_thai_symbols_shift.xml new file mode 100644 index 000000000..8b4a8ea5b --- /dev/null +++ b/java/res/xml-sw768dp-land/kbd_thai_symbols_shift.xml @@ -0,0 +1,28 @@ +<?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. +*/ +--> + +<Keyboard + xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin" + latin:rowHeight="20%p" + latin:verticalGap="2.65%p" +> + <include + latin:keyboardLayout="@xml/rows_thai_symbols_shift" /> +</Keyboard> diff --git a/java/res/xml-sw768dp/kbd_thai.xml b/java/res/xml-sw768dp/kbd_thai.xml new file mode 100644 index 000000000..dd0ac36a6 --- /dev/null +++ b/java/res/xml-sw768dp/kbd_thai.xml @@ -0,0 +1,28 @@ +<?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. +*/ +--> + +<Keyboard + xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin" + latin:rowHeight="20%p" + latin:verticalGap="2.95%p" +> + <include + latin:keyboardLayout="@xml/rows_thai" /> +</Keyboard> diff --git a/java/res/xml-sw768dp/kbd_thai_symbols.xml b/java/res/xml-sw768dp/kbd_thai_symbols.xml new file mode 100644 index 000000000..91cf8084f --- /dev/null +++ b/java/res/xml-sw768dp/kbd_thai_symbols.xml @@ -0,0 +1,28 @@ +<?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. +*/ +--> + +<Keyboard + xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin" + latin:rowHeight="20%p" + latin:verticalGap="2.95%p" +> + <include + latin:keyboardLayout="@xml/rows_thai_symbols" /> +</Keyboard> diff --git a/java/res/xml-sw768dp/kbd_thai_symbols_shift.xml b/java/res/xml-sw768dp/kbd_thai_symbols_shift.xml new file mode 100644 index 000000000..85745ac3d --- /dev/null +++ b/java/res/xml-sw768dp/kbd_thai_symbols_shift.xml @@ -0,0 +1,28 @@ +<?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. +*/ +--> + +<Keyboard + xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin" + latin:rowHeight="20%p" + latin:verticalGap="2.95%p" +> + <include + latin:keyboardLayout="@xml/rows_thai_symbols_shift" /> +</Keyboard> diff --git a/java/res/xml-sw768dp/key_styles_common.xml b/java/res/xml-sw768dp/key_styles_common.xml index fade151ed..f4a1a4ea5 100644 --- a/java/res/xml-sw768dp/key_styles_common.xml +++ b/java/res/xml-sw768dp/key_styles_common.xml @@ -77,11 +77,15 @@ latin:styleName="spaceKeyStyle" latin:code="@integer/key_space" latin:keyActionFlags="noKeyPreview" /> + <!-- U+200C: ZERO WIDTH NON-JOINER + U+200D: ZERO WIDTH JOINER --> <key-style latin:styleName="zwnjKeyStyle" - latin:keyLabel="‌" - latin:moreKeys="‍" - latin:keyLabelFlags="hasPopupHint" /> + latin:code="0x200C" + latin:keyIcon="iconZwnjKey" + latin:moreKeys="\@icon/zwjKey|‍" + latin:keyLabelFlags="hasPopupHint" + latin:keyActionFlags="noKeyPreview" /> <key-style latin:styleName="smileyKeyStyle" latin:keyLabel=":-)" diff --git a/java/res/xml-sw768dp/row_qwerty4.xml b/java/res/xml-sw768dp/row_qwerty4.xml index 0aa04f8f7..90da21ba3 100644 --- a/java/res/xml-sw768dp/row_qwerty4.xml +++ b/java/res/xml-sw768dp/row_qwerty4.xml @@ -87,11 +87,7 @@ <!-- U+200C: "" ZERO WIDTH NON-JOINER U+200D: "" ZERO WIDTH JOINER --> <Key - latin:keyLabel="‌" - latin:moreKeys="‍" - latin:keyLabelFlags="hasPopupHint" - latin:altCode="@integer/key_space" - latin:keyActionFlags="altCodeWhileTyping" /> + latin:keyStyle="zwnjKeyStyle" /> </case> <default> <Key diff --git a/java/res/xml-sw768dp/rowkeys_thai_digits.xml b/java/res/xml-sw768dp/rowkeys_thai_digits.xml new file mode 100644 index 000000000..512283096 --- /dev/null +++ b/java/res/xml-sw768dp/rowkeys_thai_digits.xml @@ -0,0 +1,54 @@ +<?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" +> + <!-- U+0E51: "๑" THAI DIGIT ONE --> + <Key + latin:keyLabel="๑" /> + <!-- U+0E52: "๒" THAI DIGIT TWO --> + <Key + latin:keyLabel="๒" /> + <!-- U+0E53: "๓" THAI DIGIT THREE --> + <Key + latin:keyLabel="๓" /> + <!-- U+0E54: "๔" THAI DIGIT FOUR --> + <Key + latin:keyLabel="๔" /> + <!-- U+0E55: "๕" THAI DIGIT FIVE --> + <Key + latin:keyLabel="๕" /> + <!-- U+0E56: "๖" THAI DIGIT SIX --> + <Key + latin:keyLabel="๖" /> + <!-- U+0E57: "๗" THAI DIGIT SEVEN --> + <Key + latin:keyLabel="๗" /> + <!-- U+0E58: "๘" THAI DIGIT EIGHT --> + <Key + latin:keyLabel="๘" /> + <!-- U+0E59: "๙" THAI DIGIT NINE --> + <Key + latin:keyLabel="๙" /> + <!-- U+0E50: "๐" THAI DIGIT ZERO --> + <Key + latin:keyLabel="๐" /> +</merge> diff --git a/java/res/xml-sw768dp/rows_farsi.xml b/java/res/xml-sw768dp/rows_farsi.xml new file mode 100644 index 000000000..b969ff21c --- /dev/null +++ b/java/res/xml-sw768dp/rows_farsi.xml @@ -0,0 +1,69 @@ +<?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" +> + <include + latin:keyboardLayout="@xml/key_styles_common" /> + <Row + latin:keyWidth="7.125%p" + > + <Key + latin:keyStyle="tabKeyStyle" + latin:keyLabelFlags="alignLeft" /> + <include + latin:keyboardLayout="@xml/rowkeys_farsi1" /> + <Key + latin:keyStyle="deleteKeyStyle" + latin:keyWidth="fillBoth" /> + </Row> + <Row + latin:keyWidth="7.125%p" + > + <Key + latin:keyStyle="toSymbolKeyStyle" + latin:keyLabelFlags="alignLeft" + latin:keyWidth="11.172%p"/> + <include + latin:keyboardLayout="@xml/rowkeys_farsi2" /> + <Key + latin:keyStyle="enterKeyStyle" + latin:keyXPos="-9.375%p" + latin:keyWidth="fillBoth" /> + </Row> + <Row + latin:keyWidth="7.375%p" + > + <Key + latin:keyStyle="shiftKeyStyle" + latin:keyWidth="13.829%p"/> + <include + latin:keyboardLayout="@xml/rowkeys_farsi3" /> + <include + latin:keyboardLayout="@xml/keys_comma_period" /> + <Key + latin:keyStyle="shiftKeyStyle" + latin:keyXPos="-13.750%p" + latin:keyWidth="fillBoth" /> + </Row> + <include + latin:keyboardLayout="@xml/row_qwerty4" /> +</merge> diff --git a/java/res/xml-sw768dp/rows_thai.xml b/java/res/xml-sw768dp/rows_thai.xml new file mode 100644 index 000000000..cc77f8bc5 --- /dev/null +++ b/java/res/xml-sw768dp/rows_thai.xml @@ -0,0 +1,72 @@ +<?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" +> + <include + latin:keyboardLayout="@xml/key_styles_common" /> + <Row + latin:keyWidth="7.079%p" + > + <include + latin:keyboardLayout="@xml/rowkeys_thai1" + latin:keyXPos="11.508%p"/> + <Key + latin:keyStyle="deleteKeyStyle" + latin:keyWidth="fillBoth"/> + </Row> + <Row + latin:keyWidth="7.079%p" + > + <Key + latin:keyStyle="tabKeyStyle" + latin:keyLabelFlags="alignLeft" + latin:keyWidth="7.969%p" /> + <include + latin:keyboardLayout="@xml/rowkeys_thai2" /> + </Row> + <Row + latin:keyWidth="7.125%p" + > + <Key + latin:keyStyle="toSymbolKeyStyle" + latin:keyLabelFlags="alignLeft" + latin:keyWidth="11.172%p"/> + <include + latin:keyboardLayout="@xml/rowkeys_thai3" /> + <Key + latin:keyStyle="enterKeyStyle" + latin:keyWidth="fillBoth" /> + </Row> + <Row + latin:keyWidth="7.181%p" + > + <Key + latin:keyStyle="shiftKeyStyle" + latin:keyWidth="13.829%p"/> + <include + latin:keyboardLayout="@xml/rowkeys_thai4" /> + <include + latin:keyboardLayout="@xml/keys_comma_period" /> + </Row> + <include + latin:keyboardLayout="@xml/row_qwerty4" /> +</merge> diff --git a/java/res/xml-sw768dp/rows_thai_symbols.xml b/java/res/xml-sw768dp/rows_thai_symbols.xml new file mode 100644 index 000000000..4a251b770 --- /dev/null +++ b/java/res/xml-sw768dp/rows_thai_symbols.xml @@ -0,0 +1,78 @@ +<?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" +> + <include + latin:keyboardLayout="@xml/key_styles_common" /> + <include + latin:keyboardLayout="@xml/key_styles_currency" /> + <Row + latin:keyWidth="8.282%p" + > + <include + latin:keyboardLayout="@xml/rowkeys_thai_digits" + latin:keyXPos="7.969%p" /> + <Key + latin:keyStyle="deleteKeyStyle" + latin:keyXPos="-9.219%p" + latin:keyWidth="fillRight" /> + </Row> + <Row + latin:keyWidth="8.282%p" + > + <Key + latin:keyStyle="tabKeyStyle" + latin:keyLabelFlags="alignLeft" + latin:keyWidth="7.969%p" /> + <include + latin:keyboardLayout="@xml/rowkeys_symbols1" /> + </Row> + <Row + latin:keyWidth="8.125%p" + > + <Key + latin:keyStyle="toAlphaKeyStyle" + latin:keyLabelFlags="alignLeft" + latin:keyWidth="11.172%p" /> + <include + latin:keyboardLayout="@xml/rowkeys_symbols2" /> + <Key + latin:keyStyle="enterKeyStyle" + latin:keyXPos="-15.704%p" + latin:keyWidth="fillBoth" /> + </Row> + <Row + latin:keyWidth="8.047%p" + > + <Key + latin:keyStyle="toMoreSymbolKeyStyle" + latin:keyWidth="13.829%p" /> + <include + latin:keyboardLayout="@xml/rowkeys_symbols3" /> + <Key + latin:keyStyle="toMoreSymbolKeyStyle" + latin:keyXPos="-13.750%p" + latin:keyWidth="fillBoth" /> + </Row> + <include + latin:keyboardLayout="@xml/rows_symbols4" /> +</merge> diff --git a/java/res/xml-sw768dp/rows_thai_symbols_shift.xml b/java/res/xml-sw768dp/rows_thai_symbols_shift.xml new file mode 100644 index 000000000..21002c6c8 --- /dev/null +++ b/java/res/xml-sw768dp/rows_thai_symbols_shift.xml @@ -0,0 +1,78 @@ +<?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" +> + <include + latin:keyboardLayout="@xml/key_styles_common" /> + <include + latin:keyboardLayout="@xml/key_styles_currency" /> + <Row + latin:keyWidth="8.282%p" + > + <include + latin:keyboardLayout="@xml/rowkeys_thai_digits" + latin:keyXPos="7.969%p" /> + <Key + latin:keyStyle="deleteKeyStyle" + latin:keyXPos="-9.219%p" + latin:keyWidth="fillBoth" /> + </Row> + <Row + latin:keyWidth="8.282%p" + > + <Key + latin:keyStyle="tabKeyStyle" + latin:keyLabelFlags="alignLeft" + latin:keyWidth="7.969%p" /> + <include + latin:keyboardLayout="@xml/rowkeys_symbols_shift1" /> + </Row> + <Row + latin:keyWidth="8.125%p" + > + <Key + latin:keyStyle="toAlphaKeyStyle" + latin:keyLabelFlags="alignLeft" + latin:keyWidth="11.172%p" /> + <include + latin:keyboardLayout="@xml/rowkeys_symbols_shift2" /> + <Key + latin:keyStyle="enterKeyStyle" + latin:keyXPos="-15.704%p" + latin:keyWidth="fillBoth" /> + </Row> + <Row + latin:keyWidth="8.047%p" + > + <Key + latin:keyStyle="backFromMoreSymbolKeyStyle" + latin:keyWidth="13.829%p" /> + <include + latin:keyboardLayout="@xml/rowkeys_symbols_shift3" /> + <Key + latin:keyStyle="backFromMoreSymbolKeyStyle" + latin:keyXPos="-13.750%p" + latin:keyWidth="fillBoth" /> + </Row> + <include + latin:keyboardLayout="@xml/rows_symbols_shift4" /> +</merge> diff --git a/java/res/xml-th/keyboard_set.xml b/java/res/xml-th/keyboard_set.xml new file mode 100644 index 000000000..99d75fe80 --- /dev/null +++ b/java/res/xml-th/keyboard_set.xml @@ -0,0 +1,42 @@ +<?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. +*/ +--> + +<KeyboardSet + xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin" + latin:keyboardLocale="th"> + <Element + latin:elementName="alphabet" + latin:elementKeyboard="@xml/kbd_thai" /> + <Element + latin:elementName="symbols" + latin:elementKeyboard="@xml/kbd_thai_symbols" /> + <Element + latin:elementName="symbolsShifted" + latin:elementKeyboard="@xml/kbd_thai_symbols_shift" /> + <Element + latin:elementName="phone" + latin:elementKeyboard="@xml/kbd_phone" /> + <Element + latin:elementName="phoneSymbols" + latin:elementKeyboard="@xml/kbd_phone_symbols" /> + <Element + latin:elementName="number" + latin:elementKeyboard="@xml/kbd_number" /> +</KeyboardSet> diff --git a/java/res/xml/kbd_farsi.xml b/java/res/xml/kbd_farsi.xml new file mode 100644 index 000000000..1af4e61ca --- /dev/null +++ b/java/res/xml/kbd_farsi.xml @@ -0,0 +1,26 @@ +<?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. +*/ +--> + +<Keyboard + xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin" +> + <include + latin:keyboardLayout="@xml/rows_farsi" /> +</Keyboard> diff --git a/java/res/xml/kbd_thai.xml b/java/res/xml/kbd_thai.xml new file mode 100644 index 000000000..058ca16a3 --- /dev/null +++ b/java/res/xml/kbd_thai.xml @@ -0,0 +1,26 @@ +<?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. +*/ +--> + +<Keyboard + xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin" +> + <include + latin:keyboardLayout="@xml/rows_thai" /> +</Keyboard> diff --git a/java/res/xml/kbd_thai_symbols.xml b/java/res/xml/kbd_thai_symbols.xml new file mode 100644 index 000000000..7e075df48 --- /dev/null +++ b/java/res/xml/kbd_thai_symbols.xml @@ -0,0 +1,26 @@ +<?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. +*/ +--> + +<Keyboard + xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin" +> + <include + latin:keyboardLayout="@xml/rows_symbols" /> +</Keyboard> diff --git a/java/res/xml/kbd_thai_symbols_shift.xml b/java/res/xml/kbd_thai_symbols_shift.xml new file mode 100644 index 000000000..25db3c84d --- /dev/null +++ b/java/res/xml/kbd_thai_symbols_shift.xml @@ -0,0 +1,26 @@ +<?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. +*/ +--> + +<Keyboard + xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin" +> + <include + latin:keyboardLayout="@xml/rows_symbols_shift" /> +</Keyboard> diff --git a/java/res/xml/key_styles_common.xml b/java/res/xml/key_styles_common.xml index 087b8952f..66d8d4d9d 100644 --- a/java/res/xml/key_styles_common.xml +++ b/java/res/xml/key_styles_common.xml @@ -107,11 +107,15 @@ latin:code="@integer/key_space" latin:keyActionFlags="noKeyPreview|enableLongPress" latin:backgroundType="functional" /> + <!-- U+200C: ZERO WIDTH NON-JOINER + U+200D: ZERO WIDTH JOINER --> <key-style latin:styleName="zwnjKeyStyle" - latin:keyLabel="‌" - latin:moreKeys="‍" + latin:code="0x200C" + latin:keyIcon="iconZwnjKey" + latin:moreKeys="\@icon/zwjKey|‍" latin:keyLabelFlags="hasPopupHint" + latin:keyActionFlags="noKeyPreview" latin:backgroundType="functional" /> <key-style latin:styleName="shortcutKeyStyle" @@ -129,8 +133,6 @@ latin:keyActionFlags="noKeyPreview|altCodeWhileTyping|enableLongPress" latin:altCode="@integer/key_space" latin:backgroundType="functional" /> - <!-- U+200C: "" ZERO WIDTH NON-JOINER - U+200D: "" ZERO WIDTH JOINER --> <key-style latin:styleName="tabKeyStyle" latin:code="@integer/key_tab" diff --git a/java/res/xml/key_styles_currency.xml b/java/res/xml/key_styles_currency.xml index 3e4afdfb5..bd1d959e4 100644 --- a/java/res/xml/key_styles_currency.xml +++ b/java/res/xml/key_styles_currency.xml @@ -79,9 +79,39 @@ <case latin:languageCode="iw" > + <!-- U+20AA: "₪" NEW SHEQEL SIGN + U+00A3: "£" POUND SIGN + U+20AC: "€" EURO SIGN + U+00A2: "¢" CENT SIGN --> <key-style latin:styleName="currencyKeyStyle" - latin:keyLabel="₪" + latin:keyLabel="₪" + latin:moreKeys="@string/more_keys_for_currency_general" /> + <key-style + latin:styleName="moreCurrency1KeyStyle" + latin:keyLabel="£" /> + <key-style + latin:styleName="moreCurrency2KeyStyle" + latin:keyLabel="€" /> + <key-style + latin:styleName="moreCurrency3KeyStyle" + latin:keyLabel="$" + latin:moreKeys="¢" /> + <key-style + latin:styleName="moreCurrency4KeyStyle" + latin:keyLabel="¢" /> + </case> + <case + latin:languageCode="fa" + > + <!-- U+FDFC: "﷼" RIAL SIGN + U+00A3: "£" POUND SIGN + U+20AC: "€" EURO SIGN + U+00A2: "¢" CENT SIGN --> + <!-- TODO: DroidSansArabic lacks the glyph of U+FCDC: RIAL SIGN --> + <key-style + latin:styleName="currencyKeyStyle" + latin:keyLabel="﷼" latin:moreKeys="@string/more_keys_for_currency_general" /> <key-style latin:styleName="moreCurrency1KeyStyle" @@ -101,23 +131,27 @@ <case latin:countryCode="GB" > + <!-- U+00A3: "£" POUND SIGN + U+20AC: "€" EURO SIGN + U+00A5: "¥" YEN SIGN + U+00A2: "¢" CENT SIGN --> <key-style latin:styleName="currencyKeyStyle" - latin:keyLabel="£" + latin:keyLabel="£" latin:moreKeys="@string/more_keys_for_currency_pound" /> <key-style latin:styleName="moreCurrency1KeyStyle" - latin:keyLabel="€" /> + latin:keyLabel="€" /> <key-style latin:styleName="moreCurrency2KeyStyle" - latin:keyLabel="¥" /> + latin:keyLabel="¥" /> <key-style latin:styleName="moreCurrency3KeyStyle" latin:keyLabel="$" - latin:moreKeys="¢" /> + latin:moreKeys="¢" /> <key-style latin:styleName="moreCurrency4KeyStyle" - latin:keyLabel="¢" /> + latin:keyLabel="¢" /> </case> <default> <include diff --git a/java/res/xml/key_styles_currency_dollar.xml b/java/res/xml/key_styles_currency_dollar.xml index d5dca2afa..8dd849879 100644 --- a/java/res/xml/key_styles_currency_dollar.xml +++ b/java/res/xml/key_styles_currency_dollar.xml @@ -19,20 +19,24 @@ --> <merge xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"> + <!-- U+00A3: "£" POUND SIGN + U+00A2: "¢" CENT SIGN + U+20AC: "€" EURO SIGN + U+00A5: "¥" YEN SIGN --> <key-style latin:styleName="currencyKeyStyle" latin:keyLabel="$" latin:moreKeys="@string/more_keys_for_currency_dollar" /> <key-style latin:styleName="moreCurrency1KeyStyle" - latin:keyLabel="£" /> + latin:keyLabel="£" /> <key-style latin:styleName="moreCurrency2KeyStyle" - latin:keyLabel="¢" /> + latin:keyLabel="¢" /> <key-style latin:styleName="moreCurrency3KeyStyle" - latin:keyLabel="€" /> + latin:keyLabel="€" /> <key-style latin:styleName="moreCurrency4KeyStyle" - latin:keyLabel="¥" /> + latin:keyLabel="¥" /> </merge> diff --git a/java/res/xml/key_styles_currency_euro.xml b/java/res/xml/key_styles_currency_euro.xml index 6edddf074..0573e0991 100644 --- a/java/res/xml/key_styles_currency_euro.xml +++ b/java/res/xml/key_styles_currency_euro.xml @@ -19,21 +19,25 @@ --> <merge xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"> + <!-- U+20AC: "€" EURO SIGN + U+00A3: "£" POUND SIGN + U+00A5: "¥" YEN SIGN + U+00A2: "¢" CENT SIGN --> <key-style latin:styleName="currencyKeyStyle" - latin:keyLabel="€" + latin:keyLabel="€" latin:moreKeys="@string/more_keys_for_currency_euro" /> <key-style latin:styleName="moreCurrency1KeyStyle" - latin:keyLabel="£" /> + latin:keyLabel="£" /> <key-style latin:styleName="moreCurrency2KeyStyle" - latin:keyLabel="¥" /> + latin:keyLabel="¥" /> <key-style latin:styleName="moreCurrency3KeyStyle" latin:keyLabel="$" - latin:moreKeys="¢" /> + latin:moreKeys="¢" /> <key-style latin:styleName="moreCurrency4KeyStyle" - latin:keyLabel="¢" /> + latin:keyLabel="¢" /> </merge> diff --git a/java/res/xml/method.xml b/java/res/xml/method.xml index 077574f34..544f3fd64 100644 --- a/java/res/xml/method.xml +++ b/java/res/xml/method.xml @@ -58,6 +58,7 @@ sl: Slovenian/qwerty sr: Serbian/south_slavic sv: Swedish/nordic + th: Thai/thai tr: Turkish/qwerty uk: Ukrainian/east_slavic vi: Vietnamese/qwerty @@ -299,6 +300,12 @@ /> <subtype android:icon="@drawable/ic_subtype_keyboard" android:label="@string/subtype_generic" + android:imeSubtypeLocale="th" + android:imeSubtypeMode="keyboard" + android:imeSubtypeExtraValue="" + /> + <subtype android:icon="@drawable/ic_subtype_keyboard" + android:label="@string/subtype_generic" android:imeSubtypeLocale="uk" android:imeSubtypeMode="keyboard" android:imeSubtypeExtraValue="SupportTouchPositionCorrection" diff --git a/java/res/xml/rowkeys_farsi1.xml b/java/res/xml/rowkeys_farsi1.xml new file mode 100644 index 000000000..15cb80182 --- /dev/null +++ b/java/res/xml/rowkeys_farsi1.xml @@ -0,0 +1,90 @@ +<?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" +> + <!-- U+0635: "ص" ARABIC LETTER SAD + U+06F1: "۱" EXTENDED ARABIC-INDIC DIGIT ONE --> + <Key + latin:keyLabel="ص" + latin:keyHintLabel="1" + latin:additionalMoreKeys="1,۱" /> + <!-- U+0642: "ق" ARABIC LETTER QAF + U+06F2: "۲" EXTENDED ARABIC-INDIC DIGIT TWO --> + <Key + latin:keyLabel="ق" + latin:keyHintLabel="2" + latin:additionalMoreKeys="2,۲" /> + <!-- U+0641: "ف" ARABIC LETTER FEH + U+06F3: "۳" EXTENDED ARABIC-INDIC DIGIT THREE --> + <Key + latin:keyLabel="ف" + latin:keyHintLabel="3" + latin:additionalMoreKeys="3,۳" /> + <!-- U+063A: "غ" ARABIC LETTER GHAIN + U+06F4: "۴" EXTENDED ARABIC-INDIC DIGIT FOUR --> + <Key + latin:keyLabel="غ" + latin:keyHintLabel="4" + latin:additionalMoreKeys="4,۴" /> + <!-- U+0639: "ع" ARABIC LETTER AIN + U+06F5: "۵" EXTENDED ARABIC-INDIC DIGIT FIVE --> + <Key + latin:keyLabel="ع" + latin:keyHintLabel="5" + latin:additionalMoreKeys="5,۵" /> + <!-- U+0647: "ه" ARABIC LETTER HEH + U+FEEB: "ﻫ" ARABIC LETTER HEH INITIAL FORM + U+0647/U+200D: ARABIC LETTER HEH + ZERO WIDTH JOINER + U+06C0: "ۀ" ARABIC LETTER HEH WITH YEH ABOVE + U+0629: "ة" ARABIC LETTER TEH MARBUTA + U+06F6: "۶" EXTENDED ARABIC-INDIC DIGIT SIX --> + <!-- TODO: DroidSansArabic lacks the glyph of U+06C0 ARABIC LETTER HEH WITH YEH ABOVE --> + <Key + latin:keyLabel="ه" + latin:moreKeys="ﻫ|ه‍,ۀ,ة,%" + latin:keyHintLabel="6" + latin:additionalMoreKeys="6,۶" /> + <!-- U+062E: "خ" ARABIC LETTER KHAH + U+06F7: "۷" EXTENDED ARABIC-INDIC DIGIT SEVEN --> + <Key + latin:keyLabel="خ" + latin:keyHintLabel="7" + latin:additionalMoreKeys="7,۷" /> + <!-- U+062D: "ح" ARABIC LETTER HAH + U+06F8: "۸" EXTENDED ARABIC-INDIC DIGIT EIGHT --> + <Key + latin:keyLabel="ح" + latin:keyHintLabel="8" + latin:additionalMoreKeys="8,۸" /> + <!-- U+062C: "ج" ARABIC LETTER JEEM + U+06F9: "۹" EXTENDED ARABIC-INDIC DIGIT NINE --> + <Key + latin:keyLabel="ج" + latin:keyHintLabel="9" + latin:additionalMoreKeys="9,۹" /> + <!-- U+0686: "چ" ARABIC LETTER TCHEH + U+06F0: "۰" EXTENDED ARABIC-INDIC DIGIT ZERO --> + <Key + latin:keyLabel="چ" + latin:keyHintLabel="0" + latin:additionalMoreKeys="0,۰" /> +</merge> diff --git a/java/res/xml/rowkeys_farsi2.xml b/java/res/xml/rowkeys_farsi2.xml new file mode 100644 index 000000000..77279c60f --- /dev/null +++ b/java/res/xml/rowkeys_farsi2.xml @@ -0,0 +1,71 @@ +<?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" +> + <!-- U+0634: "ش" ARABIC LETTER SHEEN --> + <Key + latin:keyLabel="ش" /> + <!-- U+0633: "س" ARABIC LETTER SEEN + U+0636: "ض" ARABIC LETTER DAD --> + <Key + latin:keyLabel="س" + latin:moreKeys="ض" /> + <!-- U+06CC: "ی" ARABIC LETTER FARSI YEH + U+0626: "ئ" ARABIC LETTER YEH WITH HAMZA ABOVE + U+064A: "ي" ARABIC LETTER YEH --> + <Key + latin:keyLabel="ی" + latin:moreKeys="ئ,ي" /> + <!-- U+0628: "ب" ARABIC LETTER BEH --> + <Key + latin:keyLabel="ب" /> + <!-- U+0644: "ل" ARABIC LETTER LAM --> + <Key + latin:keyLabel="ل" /> + <!-- U+0627: "ا" ARABIC LETTER ALEF + U+0621: "ء" ARABIC LETTER HAMZA + U+0622: "آ" ARABIC LETTER ALEF WITH MADDA ABOVE + U+0672: "ٲ" ARABIC LETTER ALEF WITH WAVY HAMZA ABOVE + U+0671: "ٱ" ARABIC LETTER ALEF WASLA + U+0673: "ٳ" ARABIC LETTER ALEF WITH WAVY HAMZA BELOW--> + <!-- TODO: DroidSansArabic lacks the glyph of U+0672 ARABIC LETTER ALEF WITH WAVY HAMZA ABOVE --> + <!-- TODO: DroidSansArabic lacks the glyph of U+0673 ARABIC LETTER ALEF WITH WAVY HAMZA BELOW --> + <Key + latin:keyLabel="ا" + latin:moreKeys="ء,آ,ٲ,ٱ,ٳ" /> + <!-- U+062A: "ت" ARABIC LETTER TEH + U+062B: "ﺙ" ARABIC LETTER THEH --> + <Key + latin:keyLabel="ت" + latin:moreKeys="ث" /> + <!-- U+0646: "ن" ARABIC LETTER NOON --> + <Key + latin:keyLabel="ن" /> + <!-- U+0645: "م" ARABIC LETTER MEEM --> + <Key + latin:keyLabel="م" /> + <!-- U+06A9: "ک" ARABIC LETTER KEHEH + U+0643: "ك" ARABIC LETTER KAF --> + <Key + latin:keyLabel="ک" + latin:moreKeys="ك" /> +</merge> diff --git a/java/res/xml/rowkeys_farsi3.xml b/java/res/xml/rowkeys_farsi3.xml new file mode 100644 index 000000000..8db56e340 --- /dev/null +++ b/java/res/xml/rowkeys_farsi3.xml @@ -0,0 +1,55 @@ +<?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" +> + <!-- U+0637: "ط" ARABIC LETTER TAH + U+0638: "ظ" ARABIC LETTER ZAH --> + <Key + latin:keyLabel="ط" + latin:moreKeys="ظ" /> + <!-- U+0698: "ژ" ARABIC LETTER JEH --> + <Key + latin:keyLabel="ژ" /> + <!-- U+0632: "ز" ARABIC LETTER ZAIN --> + <Key + latin:keyLabel="ز" /> + <!-- U+0631: "ر" ARABIC LETTER REH --> + <Key + latin:keyLabel="ر" /> + <!-- U+062F: "د" ARABIC LETTER DAL + U+0630: "ذ" ARABIC LETTER THAL --> + <Key + latin:keyLabel="د" + latin:moreKeys="ذ" /> + <!-- U+067E: "پ" ARABIC LETTER PEH --> + <Key + latin:keyLabel="پ" /> + <!-- U+0648: "و" ARABIC LETTER WAW + U+0676: "ٶ" ARABIC LETTER HIGH HAMZA WAW --> + <!-- TODO: DroidSansArabic lacks the glyph of U+0676 ARABIC LETTER HIGH HAMZA WAW --> + <Key + latin:keyLabel="و" + latin:moreKeys="ٶ" /> + <!-- U+06AF: "گ" ARABIC LETTER GAF --> + <Key + latin:keyLabel="گ" /> +</merge> diff --git a/java/res/xml/rowkeys_georgian1.xml b/java/res/xml/rowkeys_georgian1.xml index b644cdfdd..6b24c29fe 100644 --- a/java/res/xml/rowkeys_georgian1.xml +++ b/java/res/xml/rowkeys_georgian1.xml @@ -23,7 +23,7 @@ > <switch> <case - latin:keyboardSetElement="alphabetManualShifted|alphabetShiftLockShifted" + latin:keyboardSetElement="alphabetManualShifted|alphabetShiftLocked|alphabetShiftLockShifted" > <Key latin:keyLabel="Q" diff --git a/java/res/xml/rowkeys_georgian2.xml b/java/res/xml/rowkeys_georgian2.xml index ddd375afa..f50e3d64b 100644 --- a/java/res/xml/rowkeys_georgian2.xml +++ b/java/res/xml/rowkeys_georgian2.xml @@ -23,7 +23,7 @@ > <switch> <case - latin:keyboardSetElement="alphabetManualShifted|alphabetShiftLockShifted" + latin:keyboardSetElement="alphabetManualShifted|alphabetShiftLocked|alphabetShiftLockShifted" > <Key latin:keyLabel="A" diff --git a/java/res/xml/rowkeys_georgian3.xml b/java/res/xml/rowkeys_georgian3.xml index ae8443a31..f908673af 100644 --- a/java/res/xml/rowkeys_georgian3.xml +++ b/java/res/xml/rowkeys_georgian3.xml @@ -23,7 +23,7 @@ > <switch> <case - latin:keyboardSetElement="alphabetManualShifted|alphabetShiftLockShifted" + latin:keyboardSetElement="alphabetManualShifted|alphabetShiftLocked|alphabetShiftLockShifted" > <!-- U+10EB: "ძ" GEORGIAN LETTER JIL --> <Key diff --git a/java/res/xml/rowkeys_hindi1.xml b/java/res/xml/rowkeys_hindi1.xml index 4f7a4148c..fe54d9ea9 100644 --- a/java/res/xml/rowkeys_hindi1.xml +++ b/java/res/xml/rowkeys_hindi1.xml @@ -23,7 +23,7 @@ > <switch> <case - latin:keyboardSetElement="alphabetManualShifted|alphabetShiftLockShifted" + latin:keyboardSetElement="alphabetManualShifted|alphabetShiftLocked|alphabetShiftLockShifted" > <!-- U+0914: "औ" DEVANAGARI LETTER AU U+0912/U+0902: "ऒं" DEVANAGARI LETTER SHORT O//DEVANAGARI SIGN ANUSVARA diff --git a/java/res/xml/rowkeys_hindi2.xml b/java/res/xml/rowkeys_hindi2.xml index 1bf6fd4df..95f488102 100644 --- a/java/res/xml/rowkeys_hindi2.xml +++ b/java/res/xml/rowkeys_hindi2.xml @@ -23,7 +23,7 @@ > <switch> <case - latin:keyboardSetElement="alphabetManualShifted|alphabetShiftLockShifted" + latin:keyboardSetElement="alphabetManualShifted|alphabetShiftLocked|alphabetShiftLockShifted" > <!-- U+0913: "ओ" DEVANAGARI LETTER O U+0913/U+0902: "ओं" DEVANAGARI LETTER O/DEVANAGARI SIGN ANUSVARA diff --git a/java/res/xml/rowkeys_hindi3.xml b/java/res/xml/rowkeys_hindi3.xml index e6b430f1b..7d43d57c7 100644 --- a/java/res/xml/rowkeys_hindi3.xml +++ b/java/res/xml/rowkeys_hindi3.xml @@ -23,7 +23,7 @@ > <switch> <case - latin:keyboardSetElement="alphabetManualShifted|alphabetShiftLockShifted" + latin:keyboardSetElement="alphabetManualShifted|alphabetShiftLocked|alphabetShiftLockShifted" > <!-- U+0911: "ऑ" DEVANAGARI LETTER CANDRA O --> <Key diff --git a/java/res/xml/rowkeys_thai1.xml b/java/res/xml/rowkeys_thai1.xml new file mode 100644 index 000000000..54ec327b0 --- /dev/null +++ b/java/res/xml/rowkeys_thai1.xml @@ -0,0 +1,144 @@ +<?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" +> + <switch> + <case + latin:keyboardSetElement="alphabetManualShifted|alphabetShiftLocked|alphabetShiftLockShifted" + > + <!-- U+0E0E: "ฎ" THAI CHARACTER DO CHADA --> + <Key + latin:keyLabel="ฎ" + latin:keyHintLabel="1" + latin:additionalMoreKeys="1" /> + <!-- U+0E11: "ฑ" THAI CHARACTER THO NANGMONTHO --> + <Key + latin:keyLabel="ฑ" + latin:keyHintLabel="2" + latin:additionalMoreKeys="2" /> + <!-- U+0E18: "ธ" THAI CHARACTER THO THONG --> + <Key + latin:keyLabel="ธ" + latin:keyHintLabel="3" + latin:additionalMoreKeys="3" /> + <!-- U+0E13: "ณ" THAI CHARACTER NO NEN --> + <Key + latin:keyLabel="ณ" + latin:keyHintLabel="4" + latin:additionalMoreKeys="4" /> + <!-- U+0E0D: "ญ" THAI CHARACTER YO YING --> + <Key + latin:keyLabel="ญ" + latin:keyHintLabel="5" + latin:additionalMoreKeys="5" /> + <!-- U+0E10: "ฐ" THAI CHARACTER THO THAN --> + <Key + latin:keyLabel="ฐ" + latin:keyHintLabel="6" + latin:additionalMoreKeys="6" /> + <!-- U+0E03: "ฃ" THAI CHARACTER KHO KHUAT --> + <Key + latin:keyLabel="ฃ" + latin:keyHintLabel="7" + latin:additionalMoreKeys="7" /> + <!-- U+0E05: "ฅ" THAI CHARACTER KHO KHON --> + <Key + latin:keyLabel="ฅ" + latin:keyHintLabel="8" + latin:additionalMoreKeys="8" /> + <!-- U+0E51: "๑" THAI DIGIT ONE + U+0E52: "๒" THAI DIGIT TWO + U+0E53: "๓" THAI DIGIT THREE + U+0E54: "๔" THAI DIGIT FOUR + U+0E55: "๕" THAI DIGIT FIVE --> + <Key + latin:keyLabel="๑" + latin:moreKeys="๒,๓,๔,๕,%" + latin:keyHintLabel="9" + latin:additionalMoreKeys="9" /> + <!-- U+0E56: "๖" THAI DIGIT SIX + U+0E57: "๗" THAI DIGIT SEVEN + U+0E58: "๘" THAI DIGIT EIGHT + U+0E59: "๙" THAI DIGIT NINE + U+0E50: "๐" THAI DIGIT ZERO --> + <Key + latin:keyLabel="๖" + latin:moreKeys="๗,๘,๙,๐,%" + latin:keyHintLabel="0" + latin:additionalMoreKeys="0" /> + </case> + <default> + <!-- U+0E20: "ภ" THAI CHARACTER PHO SAMPHAO --> + <Key + latin:keyLabel="ภ" + latin:keyHintLabel="1" + latin:additionalMoreKeys="1,๑" /> + <!-- U+0E16: "ถ" THAI CHARACTER THO THUNG --> + <Key + latin:keyLabel="ถ" + latin:keyHintLabel="2" + latin:additionalMoreKeys="2,๒" /> + <!-- U+0E04: "ค" THAI CHARACTER KHO KHWAI --> + <Key + latin:keyLabel="ค" + latin:keyHintLabel="3" + latin:additionalMoreKeys="3,๓" /> + <!-- U+0E15: "ต" THAI CHARACTER TO TAO --> + <Key + latin:keyLabel="ต" + latin:keyHintLabel="4" + latin:additionalMoreKeys="4,๔" /> + <!-- U+0E08: "จ" THAI CHARACTER CHO CHAN --> + <Key + latin:keyLabel="จ" + latin:keyHintLabel="5" + latin:additionalMoreKeys="5,๕" /> + <!-- U+0E02: "ข" THAI CHARACTER KHO KHAI --> + <Key + latin:keyLabel="ข" + latin:keyHintLabel="6" + latin:additionalMoreKeys="6,๖" /> + <!-- U+0E0A: "ช" THAI CHARACTER CHO CHANG --> + <Key + latin:keyLabel="ช" + latin:keyHintLabel="7" + latin:additionalMoreKeys="7,๗" /> + <!-- U+0E23: "ร" THAI CHARACTER RO RUA + U+0E25: "ล" THAI CHARACTER LO LING --> + <Key + latin:keyLabel="ร" + latin:moreKeys="ล" + latin:keyHintLabel="8" + latin:additionalMoreKeys="8,๘" /> + <!-- U+0E19: "น" THAI CHARACTER NO NU --> + <Key + latin:keyLabel="น" + latin:keyHintLabel="9" + latin:additionalMoreKeys="9,๙" /> + <!-- U+0E22: "ย" THAI CHARACTER YO YAK --> + <Key + latin:keyLabel="ย" + latin:keyHintLabel="0" + latin:additionalMoreKeys="0,๐" /> + </default> + </switch> +</merge> diff --git a/java/res/xml/rowkeys_thai2.xml b/java/res/xml/rowkeys_thai2.xml new file mode 100644 index 000000000..02ea6c5f8 --- /dev/null +++ b/java/res/xml/rowkeys_thai2.xml @@ -0,0 +1,107 @@ +<?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" +> + <switch> + <case + latin:keyboardSetElement="alphabetManualShifted|alphabetShiftLocked|alphabetShiftLockShifted" + > + <!-- U+0E24: "ฤ" THAI CHARACTER RU --> + <Key + latin:keyLabel="ฤ" /> + <!-- U+0E06: "ฆ" THAI CHARACTER KHO RAKHANG --> + <Key + latin:keyLabel="ฆ" /> + <!-- U+0E0F: "ฏ" THAI CHARACTER TO PATAK --> + <Key + latin:keyLabel="ฏ" /> + <!-- U+0E0C: "ฌ" THAI CHARACTER CHO CHOE --> + <Key + latin:keyLabel="ฌ" /> + <!-- U+0E29: "ษ" THAI CHARACTER SO RUSI --> + <Key + latin:keyLabel="ษ" /> + <!-- U+0E28: "ศ" THAI CHARACTER SO SALA --> + <Key + latin:keyLabel="ศ" /> + <!-- U+0E0B: "ซ" THAI CHARACTER SO SO --> + <Key + latin:keyLabel="ซ" /> + <!-- U+0E3F: "฿" THAI CURRENCY SYMBOL BAHT + U+0E45: "ๅ" THAI CHARACTER LAKKHANGYAO --> + <Key + latin:keyLabel="฿" + latin:moreKeys="ๅ" /> + <!-- U+0E46: "ๆ" THAI CHARACTER MAIYAMOK + U+0E2F: "ฯ" THAI CHARACTER PAIYANNOI --> + <Key + latin:keyLabel="ๆ" + latin:moreKeys="ฯ" /> + </case> + <default> + <!-- U+0E1F: "ฟ" THAI CHARACTER FO FAN + U+0E1E: "พ" THAI CHARACTER PHO PHAN --> + <Key + latin:keyLabel="ฟ" + latin:moreKeys="พ" /> + <!-- U+0E2B: "ห" THAI CHARACTER HO HIP --> + <Key + latin:keyLabel="ห" /> + <!-- U+0E01: "ก" THAI CHARACTER KO KAI --> + <Key + latin:keyLabel="ก" /> + <!-- U+0E14: "ด" THAI CHARACTER DO DEK --> + <Key + latin:keyLabel="ด" /> + <!-- U+0E2A: "ส" THAI CHARACTER SO SUA --> + <Key + latin:keyLabel="ส" /> + <!-- U+0E27: "ว" THAI CHARACTER WO WAEN --> + <Key + latin:keyLabel="ว" /> + <!-- U+0E07: "ง" THAI CHARACTER NGO NGU --> + <Key + latin:keyLabel="ง" /> + <!-- U+0E30: "ะ" THAI CHARACTER SARA A + U+0E32: "า" THAI CHARACTER SARA AA + U+0E33: " ำ" THAI CHARACTER SARA AM + U+0E40: "เ" THAI CHARACTER SARA E + U+0E41: "แ" THAI CHARACTER SARA AE + U+0E43: "ใ" THAI CHARACTER SARA AI MAIMUAN + U+0E44: "ไ" THAI CHARACTER SARA AI MAIMALAI + U+0E42: "โ" THAI CHARACTER SARA O --> + <Key + latin:keyLabel="ะ" + latin:moreKeys="า,ำ,เ,แ,ใ,ไ,โ" /> + <!-- U+0E31: " ั" THAI CHARACTER MAI HAN-AKAT + U+0E34: " ิ" THAI CHARACTER SARA I + U+0E35: " ี" THAI CHARACTER SARA II + U+0E36: " ึ" THAI CHARACTER SARA UE + U+0E37: " ื" THAI CHARACTER SARA UEE + U+0E38: " ุ" THAI CHARACTER SARA U + U+0E39: " ู" THAI CHARACTER SARA UU --> + <Key + latin:keyLabel="ั" + latin:moreKeys="ิ,ี,ึ,ื,ุ,ู" /> + </default> + </switch> +</merge> diff --git a/java/res/xml/rowkeys_thai3.xml b/java/res/xml/rowkeys_thai3.xml new file mode 100644 index 000000000..72c0deffe --- /dev/null +++ b/java/res/xml/rowkeys_thai3.xml @@ -0,0 +1,83 @@ +<?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" +> + <switch> + <case + latin:keyboardSetElement="alphabetManualShifted|alphabetShiftLocked|alphabetShiftLockShifted" + > + <!-- U+0E09: "ฉ" THAI CHARACTER CHO CHING --> + <Key + latin:keyLabel="ฉ" /> + <!-- U+0E2E: "ฮ" THAI CHARACTER HO NOKHUK --> + <Key + latin:keyLabel="ฮ" /> + <!-- U+0E12: "ฒ" THAI CHARACTER THO PHUTHAO --> + <Key + latin:keyLabel="ฒ" /> + <!-- U+0E2C: "ฬ" THAI CHARACTER LO CHULA --> + <Key + latin:keyLabel="ฬ" /> + <!-- U+0E26: "ฦ" THAI CHARACTER LU --> + <Key + latin:keyLabel="ฦ" /> + <!-- U+0E4C: " ์" THAI CHARACTER THANTHAKHAT + U+0E4D: " ํ" THAI CHARACTER NIKHAHIT + U+0E3A: " ฺ" THAI CHARACTER PHINTHU --> + <Key + latin:keyLabel="์" + latin:moreKeys="ํ,ฺ" /> + <!-- U+0E47: " ็" THAI CHARACTER MAITAIKHU --> + <Key + latin:keyLabel="็" /> + </case> + <default> + <!-- U+0E1C: "ผ" THAI CHARACTER PHO PHUNG --> + <Key + latin:keyLabel="ผ" /> + <!-- U+0E1B: "ป" THAI CHARACTER PO PLA + U+0E1A: "บ" THAI CHARACTER BO BAIMAI --> + <Key + latin:keyLabel="ป" + latin:moreKeys="บ" /> + <!-- U+0E2D: "อ" THAI CHARACTER O ANG --> + <Key + latin:keyLabel="อ" /> + <!-- U+0E17: "ท" THAI CHARACTER THO THAHAN --> + <Key + latin:keyLabel="ท" /> + <!-- U+0E21: "ม" THAI CHARACTER MO MA --> + <Key + latin:keyLabel="ม" /> + <!-- U+0E1D: "ฝ" THAI CHARACTER FO FA --> + <Key + latin:keyLabel="ฝ" /> + <!-- U+0E48: " ่" THAI CHARACTER MAI EK + U+0E49: " ้" THAI CHARACTER MAI THO + U+0E4A: " ๊" THAI CHARACTER MAI TRI + U+0E4B: " ๋" THAI CHARACTER MAI CHATTAWA --> + <Key + latin:keyLabel="่" + latin:moreKeys="้,๊,๋" /> + </default> + </switch> +</merge> diff --git a/java/res/xml/rows_farsi.xml b/java/res/xml/rows_farsi.xml new file mode 100644 index 000000000..cc0c526b3 --- /dev/null +++ b/java/res/xml/rows_farsi.xml @@ -0,0 +1,51 @@ +<?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" +> + <include + latin:keyboardLayout="@xml/key_styles_common" /> + <Row + latin:keyWidth="10%p" + > + <include + latin:keyboardLayout="@xml/rowkeys_farsi1" /> + </Row> + <Row + latin:keyWidth="10%p" + > + <include + latin:keyboardLayout="@xml/rowkeys_farsi2" /> + </Row> + <Row + latin:keyWidth="10%p" + > + <include + latin:keyboardLayout="@xml/rowkeys_farsi3" + latin:keyXPos="5.0%p" /> + <Key + latin:keyStyle="deleteKeyStyle" + latin:keyWidth="fillRight" + latin:visualInsetsLeft="1%p" /> + </Row> + <include + latin:keyboardLayout="@xml/row_qwerty4" /> +</merge> diff --git a/java/res/xml/rows_thai.xml b/java/res/xml/rows_thai.xml new file mode 100644 index 000000000..6b80df640 --- /dev/null +++ b/java/res/xml/rows_thai.xml @@ -0,0 +1,55 @@ +<?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" +> + <include + latin:keyboardLayout="@xml/key_styles_common" /> + <Row + latin:keyWidth="10%p" + > + <include + latin:keyboardLayout="@xml/rowkeys_thai1" /> + </Row> + <Row + latin:keyWidth="10%p" + > + <include + latin:keyboardLayout="@xml/rowkeys_thai2" + latin:keyXPos="5%p" /> + </Row> + <Row + latin:keyWidth="10%p" + > + <Key + latin:keyStyle="shiftKeyStyle" + latin:keyWidth="15%p" + latin:visualInsetsRight="1%p" /> + <include + latin:keyboardLayout="@xml/rowkeys_thai3" /> + <Key + latin:keyStyle="deleteKeyStyle" + latin:keyWidth="fillRight" + latin:visualInsetsLeft="1%p" /> + </Row> + <include + latin:keyboardLayout="@xml/row_qwerty4" /> +</merge> diff --git a/java/src/com/android/inputmethod/keyboard/Key.java b/java/src/com/android/inputmethod/keyboard/Key.java index b09a27540..0a2b010b6 100644 --- a/java/src/com/android/inputmethod/keyboard/Key.java +++ b/java/src/com/android/inputmethod/keyboard/Key.java @@ -180,7 +180,7 @@ public class Key { mY = y; mHitBox.set(x, y, x + width + 1, y + height); - mHashCode = hashCode(this); + mHashCode = computeHashCode(this); } /** @@ -334,7 +334,7 @@ public class Key { mAltCode = adjustCaseOfCodeForKeyboardId(style.getInt(keyAttr, R.styleable.Keyboard_Key_altCode, Keyboard.CODE_UNSPECIFIED), preserveCase, params.mId); - mHashCode = hashCode(this); + mHashCode = computeHashCode(this); keyAttr.recycle(); @@ -366,7 +366,7 @@ public class Key { } } - private static int hashCode(Key key) { + private static int computeHashCode(Key key) { return Arrays.hashCode(new Object[] { key.mX, key.mY, diff --git a/java/src/com/android/inputmethod/keyboard/Keyboard.java b/java/src/com/android/inputmethod/keyboard/Keyboard.java index 2b1cc43cd..962379016 100644 --- a/java/src/com/android/inputmethod/keyboard/Keyboard.java +++ b/java/src/com/android/inputmethod/keyboard/Keyboard.java @@ -31,6 +31,7 @@ import com.android.inputmethod.keyboard.internal.KeyStyles; import com.android.inputmethod.keyboard.internal.KeyboardIconsSet; import com.android.inputmethod.latin.LatinImeLogger; import com.android.inputmethod.latin.R; +import com.android.inputmethod.latin.Utils; import com.android.inputmethod.latin.XmlParseUtils; import org.xmlpull.v1.XmlPullParser; @@ -393,7 +394,7 @@ public class Keyboard { * >Row row_attributes*< * >!-- Row Content --< * >Key key_attributes* /< - * >Spacer horizontalGap="0.2in" /< + * >Spacer horizontalGap="32.0dp" /< * >include keyboardLayout="@xml/other_keys"< * ... * >/Row< @@ -715,22 +716,30 @@ public class Keyboard { R.styleable.Keyboard_Key); try { final int displayHeight = mDisplayMetrics.heightPixels; - final int keyboardHeight = (int)keyboardAttr.getDimension( - R.styleable.Keyboard_keyboardHeight, displayHeight / 2); - final int maxKeyboardHeight = (int)getDimensionOrFraction(keyboardAttr, + final String keyboardHeightString = Utils.getDeviceOverrideValue( + mResources, R.array.keyboard_heights, null); + final float keyboardHeight; + if (keyboardHeightString != null) { + keyboardHeight = Float.parseFloat(keyboardHeightString) + * mDisplayMetrics.density; + } else { + keyboardHeight = keyboardAttr.getDimension( + R.styleable.Keyboard_keyboardHeight, displayHeight / 2); + } + final float maxKeyboardHeight = getDimensionOrFraction(keyboardAttr, R.styleable.Keyboard_maxKeyboardHeight, displayHeight, displayHeight / 2); - int minKeyboardHeight = (int)getDimensionOrFraction(keyboardAttr, + float minKeyboardHeight = getDimensionOrFraction(keyboardAttr, R.styleable.Keyboard_minKeyboardHeight, displayHeight, displayHeight / 2); if (minKeyboardHeight < 0) { // Specified fraction was negative, so it should be calculated against display // width. - minKeyboardHeight = -(int)getDimensionOrFraction(keyboardAttr, + minKeyboardHeight = -getDimensionOrFraction(keyboardAttr, R.styleable.Keyboard_minKeyboardHeight, displayWidth, displayWidth / 2); } final Params params = mParams; // Keyboard height will not exceed maxKeyboardHeight and will not be less than // minKeyboardHeight. - params.mOccupiedHeight = Math.max( + params.mOccupiedHeight = (int)Math.max( Math.min(keyboardHeight, maxKeyboardHeight), minKeyboardHeight); params.mOccupiedWidth = params.mId.mWidth; params.mTopPadding = (int)getDimensionOrFraction(keyboardAttr, diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardId.java b/java/src/com/android/inputmethod/keyboard/KeyboardId.java index 6703b9301..3b2b11e4e 100644 --- a/java/src/com/android/inputmethod/keyboard/KeyboardId.java +++ b/java/src/com/android/inputmethod/keyboard/KeyboardId.java @@ -70,23 +70,23 @@ public class KeyboardId { public KeyboardId(int elementId, Locale locale, int orientation, int width, int mode, EditorInfo editorInfo, boolean clobberSettingsKey, boolean shortcutKeyEnabled, boolean hasShortcutKey, boolean languageSwitchKeyEnabled) { - this.mLocale = locale; - this.mOrientation = orientation; - this.mWidth = width; - this.mMode = mode; - this.mElementId = elementId; - this.mEditorInfo = editorInfo; - this.mClobberSettingsKey = clobberSettingsKey; - this.mShortcutKeyEnabled = shortcutKeyEnabled; - this.mHasShortcutKey = hasShortcutKey; - this.mLanguageSwitchKeyEnabled = languageSwitchKeyEnabled; - this.mCustomActionLabel = (editorInfo.actionLabel != null) + mLocale = locale; + mOrientation = orientation; + mWidth = width; + mMode = mode; + mElementId = elementId; + mEditorInfo = editorInfo; + mClobberSettingsKey = clobberSettingsKey; + mShortcutKeyEnabled = shortcutKeyEnabled; + mHasShortcutKey = hasShortcutKey; + mLanguageSwitchKeyEnabled = languageSwitchKeyEnabled; + mCustomActionLabel = (editorInfo.actionLabel != null) ? editorInfo.actionLabel.toString() : null; - this.mHashCode = hashCode(this); + mHashCode = computeHashCode(this); } - private static int hashCode(KeyboardId id) { + private static int computeHashCode(KeyboardId id) { return Arrays.hashCode(new Object[] { id.mOrientation, id.mElementId, @@ -109,21 +109,21 @@ public class KeyboardId { private boolean equals(KeyboardId other) { if (other == this) return true; - return other.mOrientation == this.mOrientation - && other.mElementId == this.mElementId - && other.mMode == this.mMode - && other.mWidth == this.mWidth - && other.passwordInput() == this.passwordInput() - && other.mClobberSettingsKey == this.mClobberSettingsKey - && other.mShortcutKeyEnabled == this.mShortcutKeyEnabled - && other.mHasShortcutKey == this.mHasShortcutKey - && other.mLanguageSwitchKeyEnabled == this.mLanguageSwitchKeyEnabled - && other.isMultiLine() == this.isMultiLine() - && other.imeAction() == this.imeAction() - && TextUtils.equals(other.mCustomActionLabel, this.mCustomActionLabel) - && other.navigateNext() == this.navigateNext() - && other.navigatePrevious() == this.navigatePrevious() - && other.mLocale.equals(this.mLocale); + return other.mOrientation == mOrientation + && other.mElementId == mElementId + && other.mMode == mMode + && other.mWidth == mWidth + && other.passwordInput() == passwordInput() + && other.mClobberSettingsKey == mClobberSettingsKey + && other.mShortcutKeyEnabled == mShortcutKeyEnabled + && other.mHasShortcutKey == mHasShortcutKey + && other.mLanguageSwitchKeyEnabled == mLanguageSwitchKeyEnabled + && other.isMultiLine() == isMultiLine() + && other.imeAction() == imeAction() + && TextUtils.equals(other.mCustomActionLabel, mCustomActionLabel) + && other.navigateNext() == navigateNext() + && other.navigatePrevious() == navigatePrevious() + && other.mLocale.equals(mLocale); } public boolean isAlphabetKeyboard() { diff --git a/java/src/com/android/inputmethod/keyboard/LatinKeyboardView.java b/java/src/com/android/inputmethod/keyboard/LatinKeyboardView.java index da7d01af4..3f6c37477 100644 --- a/java/src/com/android/inputmethod/keyboard/LatinKeyboardView.java +++ b/java/src/com/android/inputmethod/keyboard/LatinKeyboardView.java @@ -16,11 +16,8 @@ package com.android.inputmethod.keyboard; -import android.animation.Animator; import android.animation.AnimatorInflater; -import android.animation.AnimatorListenerAdapter; -import android.animation.ValueAnimator; -import android.animation.ValueAnimator.AnimatorUpdateListener; +import android.animation.ObjectAnimator; import android.content.Context; import android.content.pm.PackageManager; import android.content.res.TypedArray; @@ -49,12 +46,12 @@ import com.android.inputmethod.keyboard.internal.KeySpecParser; import com.android.inputmethod.latin.LatinIME; import com.android.inputmethod.latin.LatinImeLogger; import com.android.inputmethod.latin.R; +import com.android.inputmethod.latin.ResearchLogger; import com.android.inputmethod.latin.StaticInnerHandlerWrapper; import com.android.inputmethod.latin.StringUtils; import com.android.inputmethod.latin.SubtypeUtils; import com.android.inputmethod.latin.Utils; import com.android.inputmethod.latin.Utils.UsabilityStudyLogUtils; -import com.android.inputmethod.latin.Utils.UsabilityStudyLogUtils.LogGroup; import java.util.Locale; import java.util.WeakHashMap; @@ -80,12 +77,12 @@ public class LatinKeyboardView extends KeyboardView implements PointerTracker.Ke private Key mSpaceKey; private Drawable mSpaceIcon; // Stuff to draw language name on spacebar. - private ValueAnimator mLanguageOnSpacebarFadeoutAnimator; - private int mFinalAlphaOfLanguageOnSpacebar; + private final int mLanguageOnSpacebarFinalAlpha; + private ObjectAnimator mLanguageOnSpacebarFadeoutAnimator; private static final int ALPHA_OPAQUE = 255; private boolean mNeedsToDisplayLanguage; private Locale mSpacebarLocale; - private int mSpacebarTextAlpha = ALPHA_OPAQUE; + private int mLanguageOnSpacebarAnimAlpha = ALPHA_OPAQUE; private final float mSpacebarTextRatio; private float mSpacebarTextSize; private final int mSpacebarTextColor; @@ -100,8 +97,8 @@ public class LatinKeyboardView extends KeyboardView implements PointerTracker.Ke private static final int SPACE_LED_LENGTH_PERCENT = 80; // Stuff to draw altCodeWhileTyping keys. - private ValueAnimator mAltCodeKeyWhileTypingFadeoutAnimator; - private ValueAnimator mAltCodeKeyWhileTypingFadeinAnimator; + private ObjectAnimator mAltCodeKeyWhileTypingFadeoutAnimator; + private ObjectAnimator mAltCodeKeyWhileTypingFadeinAnimator; private int mAltCodeKeyWhileTypingAnimAlpha = ALPHA_OPAQUE; // More keys keyboard @@ -231,8 +228,8 @@ public class LatinKeyboardView extends KeyboardView implements PointerTracker.Ke removeMessages(MSG_LONGPRESS_KEY); } - private static void cancelAndStartAnimators(ValueAnimator animatorToCancel, - ValueAnimator animatorToStart) { + public static void cancelAndStartAnimators(ObjectAnimator animatorToCancel, + ObjectAnimator animatorToStart) { if (animatorToCancel != null && animatorToCancel.isStarted()) { animatorToCancel.cancel(); } @@ -366,6 +363,8 @@ public class LatinKeyboardView extends KeyboardView implements PointerTracker.Ke mSpacebarTextColor = a.getColor(R.styleable.LatinKeyboardView_spacebarTextColor, 0); mSpacebarTextShadowColor = a.getColor( R.styleable.LatinKeyboardView_spacebarTextShadowColor, 0); + mLanguageOnSpacebarFinalAlpha = a.getInt( + R.styleable.LatinKeyboardView_languageOnSpacebarFinalAlpha, ALPHA_OPAQUE); final int languageOnSpacebarFadeoutAnimatorResId = a.getResourceId( R.styleable.LatinKeyboardView_languageOnSpacebarFadeoutAnimator, 0); final int altCodeKeyWhileTypingFadeoutAnimatorResId = a.getResourceId( @@ -387,55 +386,41 @@ public class LatinKeyboardView extends KeyboardView implements PointerTracker.Ke PointerTracker.setParameters(mPointerTrackerParams); - final ValueAnimator animator = loadValueAnimator(languageOnSpacebarFadeoutAnimatorResId); + mLanguageOnSpacebarFadeoutAnimator = loadObjectAnimator( + languageOnSpacebarFadeoutAnimatorResId, this); + mAltCodeKeyWhileTypingFadeoutAnimator = loadObjectAnimator( + altCodeKeyWhileTypingFadeoutAnimatorResId, this); + mAltCodeKeyWhileTypingFadeinAnimator = loadObjectAnimator( + altCodeKeyWhileTypingFadeinAnimatorResId, this); + } + + private ObjectAnimator loadObjectAnimator(int resId, Object target) { + if (resId == 0) return null; + final ObjectAnimator animator = (ObjectAnimator)AnimatorInflater.loadAnimator( + getContext(), resId); if (animator != null) { - animator.addUpdateListener(new AnimatorUpdateListener() { - @Override - public void onAnimationUpdate(ValueAnimator animation) { - mSpacebarTextAlpha = (Integer)animation.getAnimatedValue(); - invalidateKey(mSpaceKey); - } - }); - animator.addListener(new AnimatorListenerAdapter() { - @Override - public void onAnimationEnd(Animator a) { - final ValueAnimator valueAnimator = (ValueAnimator)a; - mFinalAlphaOfLanguageOnSpacebar = (Integer)valueAnimator.getAnimatedValue(); - } - }); - // In order to get the final value of animator. - animator.end(); - } - mLanguageOnSpacebarFadeoutAnimator = animator; - - final ValueAnimator fadeout = loadValueAnimator(altCodeKeyWhileTypingFadeoutAnimatorResId); - if (fadeout != null) { - fadeout.addUpdateListener(new AnimatorUpdateListener() { - @Override - public void onAnimationUpdate(ValueAnimator animation) { - mAltCodeKeyWhileTypingAnimAlpha = (Integer)animation.getAnimatedValue(); - updateAltCodeKeyWhileTyping(); - } - }); + animator.setTarget(target); } - mAltCodeKeyWhileTypingFadeoutAnimator = fadeout; + return animator; + } - final ValueAnimator fadein = loadValueAnimator(altCodeKeyWhileTypingFadeinAnimatorResId); - if (fadein != null) { - fadein.addUpdateListener(new AnimatorUpdateListener() { - @Override - public void onAnimationUpdate(ValueAnimator animation) { - mAltCodeKeyWhileTypingAnimAlpha = (Integer)animation.getAnimatedValue(); - updateAltCodeKeyWhileTyping(); - } - }); - } - mAltCodeKeyWhileTypingFadeinAnimator = fadein; + // Getter/setter methods for {@link ObjectAnimator}. + public int getLanguageOnSpacebarAnimAlpha() { + return mLanguageOnSpacebarAnimAlpha; } - private ValueAnimator loadValueAnimator(int resId) { - if (resId == 0) return null; - return (ValueAnimator)AnimatorInflater.loadAnimator(getContext(), resId); + public void setLanguageOnSpacebarAnimAlpha(int alpha) { + mLanguageOnSpacebarAnimAlpha = alpha; + invalidateKey(mSpaceKey); + } + + public int getAltCodeKeyWhileTypingAnimAlpha() { + return mAltCodeKeyWhileTypingAnimAlpha; + } + + public void setAltCodeKeyWhileTypingAnimAlpha(int alpha) { + mAltCodeKeyWhileTypingAnimAlpha = alpha; + updateAltCodeKeyWhileTyping(); } public void setKeyboardActionListener(KeyboardActionListener listener) { @@ -702,9 +687,22 @@ public class LatinKeyboardView extends KeyboardView implements PointerTracker.Ke break; } if (!TextUtils.isEmpty(eventTag)) { - UsabilityStudyLogUtils.getInstance().write(LogGroup.MOTION_EVENT, + final float size = me.getSize(index); + final float pressure = me.getPressure(index); + UsabilityStudyLogUtils.getInstance().write( eventTag + eventTime + "," + id + "," + x + "," + y + "," - + me.getSize(index) + "," + me.getPressure(index)); + + size + "," + pressure); + } + } + if (ResearchLogger.sIsLogging) { + // TODO: remove redundant calculations of size and pressure by + // removing UsabilityStudyLog code once the ResearchLogger is mature enough + final float size = me.getSize(index); + final float pressure = me.getPressure(index); + if (action != MotionEvent.ACTION_MOVE) { + // Skip ACTION_MOVE events as they are logged below + ResearchLogger.getInstance().logMotionEvent(action, eventTime, id, x, + y, size, pressure); } } @@ -752,8 +750,9 @@ public class LatinKeyboardView extends KeyboardView implements PointerTracker.Ke if (action == MotionEvent.ACTION_MOVE) { for (int i = 0; i < pointerCount; i++) { + final int pointerId = me.getPointerId(i); final PointerTracker tracker = PointerTracker.getPointerTracker( - me.getPointerId(i), this); + pointerId, this); final int px, py; if (mMoreKeysPanel != null && tracker.mPointerId == mMoreKeysPanelPointerTrackerId) { @@ -765,10 +764,18 @@ public class LatinKeyboardView extends KeyboardView implements PointerTracker.Ke } tracker.onMoveEvent(px, py, eventTime); if (ENABLE_USABILITY_STUDY_LOG) { - UsabilityStudyLogUtils.getInstance().write( - LogGroup.MOTION_EVENT, - "[Move]" + eventTime + "," + me.getPointerId(i) + "," + px + "," + py - + "," + me.getSize(i) + "," + me.getPressure(i)); + final float pointerSize = me.getSize(i); + final float pointerPressure = me.getPressure(i); + UsabilityStudyLogUtils.getInstance().write("[Move]" + eventTime + "," + + pointerId + "," + px + "," + py + "," + + pointerSize + "," + pointerPressure); + } + if (ResearchLogger.sIsLogging) { + // TODO: earlier comment about redundant calculations applies here too + final float pointerSize = me.getSize(i); + final float pointerPressure = me.getPressure(i); + ResearchLogger.getInstance().logMotionEvent(action, eventTime, pointerId, + px, py, pointerSize, pointerPressure); } } } else { @@ -861,19 +868,21 @@ public class LatinKeyboardView extends KeyboardView implements PointerTracker.Ke public void startDisplayLanguageOnSpacebar(boolean subtypeChanged, boolean needsToDisplayLanguage) { - final ValueAnimator animator = mLanguageOnSpacebarFadeoutAnimator; - if (animator != null) { - animator.cancel(); - } + final ObjectAnimator animator = mLanguageOnSpacebarFadeoutAnimator; mNeedsToDisplayLanguage = needsToDisplayLanguage; if (animator == null) { mNeedsToDisplayLanguage = false; } else { if (subtypeChanged && needsToDisplayLanguage) { - mSpacebarTextAlpha = ALPHA_OPAQUE; + setLanguageOnSpacebarAnimAlpha(ALPHA_OPAQUE); + if (animator.isStarted()) { + animator.cancel(); + } animator.start(); } else { - mSpacebarTextAlpha = mFinalAlphaOfLanguageOnSpacebar; + if (!animator.isStarted()) { + mLanguageOnSpacebarAnimAlpha = mLanguageOnSpacebarFinalAlpha; + } } } invalidateKey(mSpaceKey); @@ -967,10 +976,10 @@ public class LatinKeyboardView extends KeyboardView implements PointerTracker.Ke final float textHeight = -paint.ascent() + descent; final float baseline = height / 2 + textHeight / 2; paint.setColor(mSpacebarTextShadowColor); - paint.setAlpha(mSpacebarTextAlpha); + paint.setAlpha(mLanguageOnSpacebarAnimAlpha); canvas.drawText(language, width / 2, baseline - descent - 1, paint); paint.setColor(mSpacebarTextColor); - paint.setAlpha(mSpacebarTextAlpha); + paint.setAlpha(mLanguageOnSpacebarAnimAlpha); canvas.drawText(language, width / 2, baseline - descent, paint); } diff --git a/java/src/com/android/inputmethod/keyboard/ProximityInfo.java b/java/src/com/android/inputmethod/keyboard/ProximityInfo.java index 442413c0c..5c1808613 100644 --- a/java/src/com/android/inputmethod/keyboard/ProximityInfo.java +++ b/java/src/com/android/inputmethod/keyboard/ProximityInfo.java @@ -79,8 +79,12 @@ public class ProximityInfo { final ProximityInfo spellCheckerProximityInfo = createDummyProximityInfo(); spellCheckerProximityInfo.mNativeProximityInfo = spellCheckerProximityInfo.setProximityInfoNative("", - SpellCheckerProximityInfo.ROW_SIZE, 480, 300, 11, 3, (480 / 10), proximity, - 0, null, null, null, null, null, null, null, null); + SpellCheckerProximityInfo.ROW_SIZE, + SpellCheckerProximityInfo.PROXIMITY_GRID_WIDTH, + SpellCheckerProximityInfo.PROXIMITY_GRID_HEIGHT, + SpellCheckerProximityInfo.PROXIMITY_GRID_WIDTH, + SpellCheckerProximityInfo.PROXIMITY_GRID_HEIGHT, + 1, proximity, 0, null, null, null, null, null, null, null, null); return spellCheckerProximityInfo; } diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeyboardIconsSet.java b/java/src/com/android/inputmethod/keyboard/internal/KeyboardIconsSet.java index 9b9c86179..ded89b1b8 100644 --- a/java/src/com/android/inputmethod/keyboard/internal/KeyboardIconsSet.java +++ b/java/src/com/android/inputmethod/keyboard/internal/KeyboardIconsSet.java @@ -30,7 +30,7 @@ public class KeyboardIconsSet { // The value should be aligned with the enum value of Key.keyIcon. public static final int ICON_UNDEFINED = 0; - private static final int NUM_ICONS = 14; + private static final int NUM_ICONS = 16; private final Drawable[] mIcons = new Drawable[NUM_ICONS + 1]; @@ -58,6 +58,8 @@ public class KeyboardIconsSet { addIconIdMap(12, "disabledShortcurKey", R.styleable.Keyboard_iconDisabledShortcutKey); addIconIdMap(13, "previewTabKey", R.styleable.Keyboard_iconPreviewTabKey); addIconIdMap(14, "languageSwitchKey", R.styleable.Keyboard_iconLanguageSwitchKey); + addIconIdMap(15, "zwnjKey", R.styleable.Keyboard_iconZwnjKey); + addIconIdMap(16, "zwjKey", R.styleable.Keyboard_iconZwjKey); } private static void addIconIdMap(int iconId, String name, int attrId) { diff --git a/java/src/com/android/inputmethod/latin/BinaryDictionary.java b/java/src/com/android/inputmethod/latin/BinaryDictionary.java index dfc8c8e9d..a9df1ce12 100644 --- a/java/src/com/android/inputmethod/latin/BinaryDictionary.java +++ b/java/src/com/android/inputmethod/latin/BinaryDictionary.java @@ -55,6 +55,8 @@ public class BinaryDictionary extends Dictionary { public static final Flag FLAG_REQUIRES_GERMAN_UMLAUT_PROCESSING = new Flag(R.bool.config_require_umlaut_processing, 0x1); + public static final Flag FLAG_REQUIRES_FRENCH_LIGATURES_PROCESSING = + new Flag(R.bool.config_require_ligatures_processing, 0x4); // FULL_EDIT_DISTANCE is a flag that forces the dictionary to use full words // when computing edit distance, instead of the default behavior of stopping @@ -77,6 +79,7 @@ public class BinaryDictionary extends Dictionary { // actual value will be read from the configuration/extra value at run time for // the configuration at dictionary creation time. FLAG_REQUIRES_GERMAN_UMLAUT_PROCESSING, + FLAG_REQUIRES_FRENCH_LIGATURES_PROCESSING, }; private int mFlags = 0; @@ -202,9 +205,11 @@ public class BinaryDictionary extends Dictionary { Arrays.fill(mInputCodes, WordComposer.NOT_A_CODE); for (int i = 0; i < codesSize; i++) { - int[] alternatives = codes.getCodesAt(i); - System.arraycopy(alternatives, 0, mInputCodes, i * MAX_PROXIMITY_CHARS_SIZE, - Math.min(alternatives.length, MAX_PROXIMITY_CHARS_SIZE)); + final int[] alternatives = codes.getCodesAt(i); + if (alternatives == null || alternatives.length < 1) { + continue; + } + mInputCodes[i] = alternatives[0]; } Arrays.fill(outputChars, (char) 0); Arrays.fill(scores, 0); diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index e67f0ea05..7272006a2 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -68,6 +68,7 @@ import com.android.inputmethod.keyboard.KeyboardId; import com.android.inputmethod.keyboard.KeyboardSwitcher; import com.android.inputmethod.keyboard.KeyboardView; import com.android.inputmethod.keyboard.LatinKeyboardView; +import com.android.inputmethod.latin.Utils.UsabilityStudyLogUtils; import com.android.inputmethod.latin.suggestions.SuggestionsView; import java.io.FileDescriptor; @@ -196,7 +197,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar private InputMethodManagerCompatWrapper mImm; private Resources mResources; private SharedPreferences mPrefs; - private final KeyboardSwitcher mKeyboardSwitcher; + /* package for tests */ final KeyboardSwitcher mKeyboardSwitcher; private final SubtypeSwitcher mSubtypeSwitcher; private VoiceProxy mVoiceProxy; private boolean mShouldSwitchToLastSubtype = true; @@ -438,6 +439,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this); mPrefs = prefs; LatinImeLogger.init(this, prefs); + ResearchLogger.init(this, prefs); LanguageSwitcherProxy.init(this, prefs); InputMethodManagerCompatWrapper.init(this); SubtypeSwitcher.init(this); @@ -502,7 +504,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar private void initSuggest() { final String localeStr = mSubtypeSwitcher.getInputLocaleStr(); - final Locale keyboardLocale = LocaleUtils.constructLocaleFromString(localeStr); + final Locale keyboardLocale = mSubtypeSwitcher.getInputLocale(); final Resources res = mResources; final Locale savedLocale = LocaleUtils.setSystemLocale(res, keyboardLocale); @@ -527,7 +529,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar resetContactsDictionary(oldContactsDictionary); mUserHistoryDictionary - = new UserHistoryDictionary(this, this, localeStr, Suggest.DIC_USER_HISTORY); + = new UserHistoryDictionary(this, localeStr, Suggest.DIC_USER_HISTORY); mSuggest.setUserHistoryDictionary(mUserHistoryDictionary); LocaleUtils.setSystemLocale(res, savedLocale); @@ -566,8 +568,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar } /* package private */ void resetSuggestMainDict() { - final String localeStr = mSubtypeSwitcher.getInputLocaleStr(); - final Locale keyboardLocale = LocaleUtils.constructLocaleFromString(localeStr); + final Locale keyboardLocale = mSubtypeSwitcher.getInputLocale(); int mainDicResId = DictionaryFactory.getMainDictionaryResourceId(mResources); mSuggest.resetMainDict(this, mainDicResId, keyboardLocale); } @@ -1006,10 +1007,6 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar final int touchHeight = inputView.getHeight() + extraHeight // Extend touchable region below the keyboard. + EXTENDED_TOUCHABLE_REGION_HEIGHT; - if (DEBUG) { - Log.d(TAG, "Touchable region: y=" + touchY + " width=" + touchWidth - + " height=" + touchHeight); - } setTouchableRegionCompat(outInsets, 0, touchY, touchWidth, touchHeight); } outInsets.contentTopInsets = touchY; @@ -1266,6 +1263,11 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar mDeleteCount = 0; } mLastKeyTime = when; + + if (ResearchLogger.sIsLogging) { + ResearchLogger.getInstance().logKeyEvent(primaryCode, x, y); + } + final KeyboardSwitcher switcher = mKeyboardSwitcher; // The space state depends only on the last character pressed and its own previous // state. Here, we revert the space state to neutral if the key is actually modifying @@ -1989,7 +1991,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar } private void addToUserHistoryDictionary(final CharSequence suggestion) { - if (suggestion == null || suggestion.length() < 1) return; + if (TextUtils.isEmpty(suggestion)) return; // Only auto-add to dictionary if auto-correct is ON. Otherwise we'll be // adding words in situations where the user or application really didn't @@ -2007,8 +2009,14 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar } else { prevWord = null; } + final String secondWord; + if (mWordComposer.isAutoCapitalized() && !mWordComposer.isMostlyCaps()) { + secondWord = suggestion.toString().toLowerCase(mSubtypeSwitcher.getInputLocale()); + } else { + secondWord = suggestion.toString(); + } mUserHistoryDictionary.addToUserHistory(null == prevWord ? null : prevWord.toString(), - suggestion.toString()); + secondWord); } } @@ -2249,10 +2257,6 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar mFeedbackManager.vibrate(mKeyboardSwitcher.getKeyboardView()); } - public boolean isAutoCapitalized() { - return mWordComposer.isAutoCapitalized(); - } - private void updateCorrectionMode() { // TODO: cleanup messy flags final boolean shouldAutoCorrect = mSettingsValues.mAutoCorrectEnabled diff --git a/java/src/com/android/inputmethod/latin/ResearchLogger.java b/java/src/com/android/inputmethod/latin/ResearchLogger.java new file mode 100644 index 000000000..3b110bd78 --- /dev/null +++ b/java/src/com/android/inputmethod/latin/ResearchLogger.java @@ -0,0 +1,304 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package com.android.inputmethod.latin; + +import android.content.SharedPreferences; +import android.inputmethodservice.InputMethodService; +import android.os.Handler; +import android.os.HandlerThread; +import android.os.Process; +import android.os.SystemClock; +import android.text.TextUtils; +import android.util.Log; +import android.view.MotionEvent; + +import com.android.inputmethod.keyboard.Keyboard; + +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.PrintWriter; +import java.text.SimpleDateFormat; +import java.util.Date; + +/** + * Logs the use of the LatinIME keyboard. + * + * This class logs operations on the IME keyboard, including what the user has typed. + * Data is stored locally in a file in app-specific storage. + * + * This functionality is off by default. + */ +public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChangeListener { + private static final String TAG = ResearchLogger.class.getSimpleName(); + private static final String PREF_USABILITY_STUDY_MODE = "usability_study_mode"; + + private static final ResearchLogger sInstance = new ResearchLogger(new LogFileManager()); + public static boolean sIsLogging = false; + /* package */ final Handler mLoggingHandler; + private InputMethodService mIms; + private final Date mDate; + private final SimpleDateFormat mDateFormat; + + /** + * Isolates management of files. This variable should never be null, but can be changed + * to support testing. + */ + private LogFileManager mLogFileManager; + + /** + * Manages the file(s) that stores the logs. + * + * Handles creation, deletion, and provides Readers, Writers, and InputStreams to access + * the logs. + */ + public static class LogFileManager { + private static final String DEFAULT_FILENAME = "log.txt"; + private static final String DEFAULT_LOG_DIRECTORY = "researchLogger"; + + private static final long LOGFILE_PURGE_INTERVAL = 1000 * 60 * 60 * 24; + + private InputMethodService mIms; + private File mFile; + private PrintWriter mPrintWriter; + + /* package */ LogFileManager() { + } + + public void init(InputMethodService ims) { + mIms = ims; + } + + public synchronized void createLogFile() { + try { + createLogFile(DEFAULT_LOG_DIRECTORY, DEFAULT_FILENAME); + } catch (FileNotFoundException e) { + Log.w(TAG, e); + } + } + + public synchronized void createLogFile(String dir, String filename) + throws FileNotFoundException { + if (mIms == null) { + Log.w(TAG, "InputMethodService is not configured. Logging is off."); + return; + } + File filesDir = mIms.getFilesDir(); + if (filesDir == null || !filesDir.exists()) { + Log.w(TAG, "Storage directory does not exist. Logging is off."); + return; + } + File directory = new File(filesDir, dir); + if (!directory.exists()) { + boolean wasCreated = directory.mkdirs(); + if (!wasCreated) { + Log.w(TAG, "Log directory cannot be created. Logging is off."); + return; + } + } + + close(); + mFile = new File(directory, filename); + boolean append = true; + if (mFile.exists() && mFile.lastModified() + LOGFILE_PURGE_INTERVAL < + System.currentTimeMillis()) { + append = false; + } + mPrintWriter = new PrintWriter(new FileOutputStream(mFile, append), true); + } + + public synchronized boolean append(String s) { + if (mPrintWriter == null) { + Log.w(TAG, "PrintWriter is null"); + return false; + } else { + mPrintWriter.print(s); + return !mPrintWriter.checkError(); + } + } + + public synchronized void reset() { + if (mPrintWriter != null) { + mPrintWriter.close(); + mPrintWriter = null; + } + if (mFile != null && mFile.exists()) { + mFile.delete(); + mFile = null; + } + } + + public synchronized void close() { + if (mPrintWriter != null) { + mPrintWriter.close(); + mPrintWriter = null; + mFile = null; + } + } + } + + private ResearchLogger(LogFileManager logFileManager) { + mDate = new Date(); + mDateFormat = new SimpleDateFormat("yyyyMMdd-HHmmss.SSSZ"); + + HandlerThread handlerThread = new HandlerThread("ResearchLogger logging task", + Process.THREAD_PRIORITY_BACKGROUND); + handlerThread.start(); + mLoggingHandler = new Handler(handlerThread.getLooper()); + mLogFileManager = logFileManager; + } + + public static ResearchLogger getInstance() { + return sInstance; + } + + public static void init(InputMethodService ims, SharedPreferences prefs) { + sInstance.initInternal(ims, prefs); + } + + public void initInternal(InputMethodService ims, SharedPreferences prefs) { + mIms = ims; + if (mLogFileManager != null) { + mLogFileManager.init(ims); + mLogFileManager.createLogFile(); + } + if (prefs != null) { + sIsLogging = prefs.getBoolean(PREF_USABILITY_STUDY_MODE, false); + } + prefs.registerOnSharedPreferenceChangeListener(this); + } + + /** + * Change to a different logFileManager. + * + * @throws IllegalArgumentException if logFileManager is null + */ + void setLogFileManager(LogFileManager manager) { + if (manager == null) { + throw new IllegalArgumentException("warning: trying to set null logFileManager"); + } else { + mLogFileManager = manager; + } + } + + /** + * Represents a category of logging events that share the same subfield structure. + */ + private static enum LogGroup { + MOTION_EVENT("m"), + KEY("k"), + CORRECTION("c"), + STATE_CHANGE("s"); + + private final String mLogString; + + private LogGroup(String logString) { + mLogString = logString; + } + } + + public void logMotionEvent(final int action, final long eventTime, final int id, + final int x, final int y, final float size, final float pressure) { + final String eventTag; + switch (action) { + case MotionEvent.ACTION_CANCEL: eventTag = "[Cancel]"; break; + case MotionEvent.ACTION_UP: eventTag = "[Up]"; break; + case MotionEvent.ACTION_DOWN: eventTag = "[Down]"; break; + case MotionEvent.ACTION_POINTER_UP: eventTag = "[PointerUp]"; break; + case MotionEvent.ACTION_POINTER_DOWN: eventTag = "[PointerDown]"; break; + case MotionEvent.ACTION_MOVE: eventTag = "[Move]"; break; + case MotionEvent.ACTION_OUTSIDE: eventTag = "[Outside]"; break; + default: eventTag = "[Action" + action + "]"; break; + } + if (!TextUtils.isEmpty(eventTag)) { + StringBuilder sb = new StringBuilder(); + sb.append(eventTag); + sb.append('\t'); sb.append(eventTime); + sb.append('\t'); sb.append(id); + sb.append('\t'); sb.append(x); + sb.append('\t'); sb.append(y); + sb.append('\t'); sb.append(size); + sb.append('\t'); sb.append(pressure); + write(LogGroup.MOTION_EVENT, sb.toString()); + } + } + + public void logKeyEvent(int code, int x, int y) { + final StringBuilder sb = new StringBuilder(); + sb.append(Keyboard.printableCode(code)); + sb.append('\t'); sb.append(x); + sb.append('\t'); sb.append(y); + write(LogGroup.KEY, sb.toString()); + } + + public void logCorrection(String subgroup, String before, String after, int position) { + final StringBuilder sb = new StringBuilder(); + sb.append(subgroup); + sb.append('\t'); sb.append(before); + sb.append('\t'); sb.append(after); + sb.append('\t'); sb.append(position); + write(LogGroup.CORRECTION, sb.toString()); + } + + public void logStateChange(String subgroup, String details) { + write(LogGroup.STATE_CHANGE, subgroup + "\t" + details); + } + + private void write(final LogGroup logGroup, final String log) { + mLoggingHandler.post(new Runnable() { + @Override + public void run() { + final long currentTime = System.currentTimeMillis(); + mDate.setTime(currentTime); + final long upTime = SystemClock.uptimeMillis(); + + final String printString = String.format("%s\t%d\t%s\t%s\n", + mDateFormat.format(mDate), upTime, logGroup.mLogString, log); + if (LatinImeLogger.sDBG) { + Log.d(TAG, "Write: " + '[' + logGroup.mLogString + ']' + log); + } + if (mLogFileManager.append(printString)) { + // success + } else { + if (LatinImeLogger.sDBG) { + Log.w(TAG, "Unable to write to log."); + } + } + } + }); + } + + public void clearAll() { + mLoggingHandler.post(new Runnable() { + @Override + public void run() { + if (LatinImeLogger.sDBG) { + Log.d(TAG, "Delete log file."); + } + mLogFileManager.reset(); + } + }); + } + + @Override + public void onSharedPreferenceChanged(SharedPreferences prefs, String key) { + if (key == null || prefs == null) { + return; + } + sIsLogging = prefs.getBoolean(PREF_USABILITY_STUDY_MODE, false); + } +} diff --git a/java/src/com/android/inputmethod/latin/SubtypeSwitcher.java b/java/src/com/android/inputmethod/latin/SubtypeSwitcher.java index ffbbf9bb8..3524c72f6 100644 --- a/java/src/com/android/inputmethod/latin/SubtypeSwitcher.java +++ b/java/src/com/android/inputmethod/latin/SubtypeSwitcher.java @@ -47,13 +47,13 @@ public class SubtypeSwitcher { private static final String TAG = SubtypeSwitcher.class.getSimpleName(); public static final String KEYBOARD_MODE = "keyboard"; - private static final char LOCALE_SEPARATER = '_'; + private static final char LOCALE_SEPARATOR = '_'; private static final String VOICE_MODE = "voice"; private static final String SUBTYPE_EXTRAVALUE_REQUIRE_NETWORK_CONNECTIVITY = "requireNetworkConnectivity"; private final TextUtils.SimpleStringSplitter mLocaleSplitter = - new TextUtils.SimpleStringSplitter(LOCALE_SEPARATER); + new TextUtils.SimpleStringSplitter(LOCALE_SEPARATOR); private static final SubtypeSwitcher sInstance = new SubtypeSwitcher(); private /* final */ LatinIME mService; diff --git a/java/src/com/android/inputmethod/latin/UserHistoryDictionary.java b/java/src/com/android/inputmethod/latin/UserHistoryDictionary.java index 4e798460c..db2cdf967 100644 --- a/java/src/com/android/inputmethod/latin/UserHistoryDictionary.java +++ b/java/src/com/android/inputmethod/latin/UserHistoryDictionary.java @@ -75,8 +75,6 @@ public class UserHistoryDictionary extends ExpandableDictionary { private static final String FREQ_COLUMN_PAIR_ID = "pair_id"; private static final String FREQ_COLUMN_FREQUENCY = "freq"; - private final LatinIME mIme; - /** Locale for which this auto dictionary is storing words */ private String mLocale; @@ -139,9 +137,8 @@ public class UserHistoryDictionary extends ExpandableDictionary { sDeleteHistoryBigrams = deleteHistoryBigram; } - public UserHistoryDictionary(Context context, LatinIME ime, String locale, int dicTypeId) { + public UserHistoryDictionary(final Context context, final String locale, final int dicTypeId) { super(context, dicTypeId); - mIme = ime; mLocale = locale; if (sOpenHelper == null) { sOpenHelper = new DatabaseHelper(getContext()); @@ -179,10 +176,6 @@ public class UserHistoryDictionary extends ExpandableDictionary { * The second word may not be null (a NullPointerException would be thrown). */ public int addToUserHistory(final String word1, String word2) { - // remove caps if second word is autocapitalized - if (mIme != null && mIme.isAutoCapitalized()) { - word2 = Character.toLowerCase(word2.charAt(0)) + word2.substring(1); - } super.addWord(word2, FREQUENCY_FOR_TYPED); // Do not insert a word as a bigram of itself if (word2.equals(word1)) { diff --git a/java/src/com/android/inputmethod/latin/Utils.java b/java/src/com/android/inputmethod/latin/Utils.java index e2ce08323..be64c2fd8 100644 --- a/java/src/com/android/inputmethod/latin/Utils.java +++ b/java/src/com/android/inputmethod/latin/Utils.java @@ -31,7 +31,9 @@ import android.os.Process; import android.text.TextUtils; import android.text.format.DateUtils; import android.util.Log; +import android.view.MotionEvent; +import com.android.inputmethod.keyboard.Keyboard; import com.android.inputmethod.latin.SuggestedWords.SuggestedWordInfo; import java.io.BufferedReader; @@ -138,9 +140,6 @@ public class Utils { // TODO: accept code points public void push(char c, int x, int y) { if (!mEnabled) return; - if (mUsabilityStudy) { - UsabilityStudyLogUtils.getInstance().writeChar(c, x, y); - } mCharBuf[mEnd] = c; mXBuf[mEnd] = x; mYBuf[mEnd] = y; @@ -221,6 +220,7 @@ public class Utils { } public static class UsabilityStudyLogUtils { + // TODO: remove code duplication with ResearchLog class private static final String USABILITY_TAG = UsabilityStudyLogUtils.class.getSimpleName(); private static final String FILENAME = "log.txt"; private static final UsabilityStudyLogUtils sInstance = @@ -263,25 +263,8 @@ public class Utils { } } - /** - * Represents a category of logging events that share the same subfield structure. - */ - public static enum LogGroup { - MOTION_EVENT("m"), - KEY("k"), - CORRECTION("c"), - STATE_CHANGE("s"); - - private final String mLogString; - - private LogGroup(String logString) { - mLogString = logString; - } - } - public static void writeBackSpace(int x, int y) { - UsabilityStudyLogUtils.getInstance().write( - LogGroup.KEY, "<backspace>\t" + x + "\t" + y); + UsabilityStudyLogUtils.getInstance().write("<backspace>\t" + x + "\t" + y); } public void writeChar(char c, int x, int y) { @@ -297,12 +280,11 @@ public class Utils { inputChar = "<space>"; break; } - UsabilityStudyLogUtils.getInstance().write(LogGroup.KEY, - inputChar + "\t" + x + "\t" + y); + UsabilityStudyLogUtils.getInstance().write(inputChar + "\t" + x + "\t" + y); LatinImeLogger.onPrintAllUsabilityStudyLogs(); } - public void write(final LogGroup logGroup, final String log) { + public void write(final String log) { mLoggingHandler.post(new Runnable() { @Override public void run() { @@ -310,8 +292,8 @@ public class Utils { final long currentTime = System.currentTimeMillis(); mDate.setTime(currentTime); - final String printString = String.format("%s\t%d\t%s\t%s\n", - mDateFormat.format(mDate), currentTime, logGroup.mLogString, log); + final String printString = String.format("%s\t%d\t%s\n", + mDateFormat.format(mDate), currentTime, log); if (LatinImeLogger.sDBG) { Log.d(USABILITY_TAG, "Write: " + log); } diff --git a/java/src/com/android/inputmethod/latin/WordComposer.java b/java/src/com/android/inputmethod/latin/WordComposer.java index 9f23f174f..cabf68099 100644 --- a/java/src/com/android/inputmethod/latin/WordComposer.java +++ b/java/src/com/android/inputmethod/latin/WordComposer.java @@ -20,8 +20,6 @@ import com.android.inputmethod.keyboard.Key; import com.android.inputmethod.keyboard.KeyDetector; import com.android.inputmethod.keyboard.Keyboard; import com.android.inputmethod.keyboard.KeyboardActionListener; -import com.android.inputmethod.latin.spellcheck.AndroidSpellCheckerService; -import com.android.inputmethod.latin.spellcheck.SpellCheckerProximityInfo; import java.util.ArrayList; import java.util.Arrays; @@ -127,12 +125,8 @@ public class WordComposer { final int[] codes; final int keyX; final int keyY; - if (x == KeyboardActionListener.SPELL_CHECKER_COORDINATE - || y == KeyboardActionListener.SPELL_CHECKER_COORDINATE) { - // only used for tests in InputLogicTests - addKeyForSpellChecker(primaryCode, AndroidSpellCheckerService.SCRIPT_LATIN); - return; - } else if (x == KeyboardActionListener.SUGGESTION_STRIP_COORDINATE + if (null == keyDetector + || x == KeyboardActionListener.SUGGESTION_STRIP_COORDINATE || y == KeyboardActionListener.SUGGESTION_STRIP_COORDINATE || x == KeyboardActionListener.NOT_A_TOUCH_COORDINATE || y == KeyboardActionListener.NOT_A_TOUCH_COORDINATE) { @@ -149,27 +143,6 @@ public class WordComposer { add(primaryCode, codes, keyX, keyY); } - // TODO: remove this function - public void addKeyForSpellChecker(int primaryCode, int script) { - final int[] proximities; - final int proximityIndex = - SpellCheckerProximityInfo.getIndexOfCodeForScript(primaryCode, script); - if (-1 == proximityIndex) { - proximities = new int[] { primaryCode }; - } else { - // TODO: an initial examination seems to reveal this is actually used - // read-only. It should be possible to compute the arrays statically once - // and skip doing a copy each time here. - proximities = Arrays.copyOfRange( - SpellCheckerProximityInfo.getProximityForScript(script), - proximityIndex, - proximityIndex + SpellCheckerProximityInfo.ROW_SIZE); - } - add(primaryCode, proximities, - KeyboardActionListener.NOT_A_TOUCH_COORDINATE, - KeyboardActionListener.NOT_A_TOUCH_COORDINATE); - } - /** * Add a new keystroke, with codes[0] containing the pressed key's unicode and the rest of * the array containing unicode for adjacent keys, sorted by reducing probability/proximity. @@ -197,8 +170,7 @@ public class WordComposer { /** * Internal method to retrieve reasonable proximity info for a character. */ - private void addKeyInfo(final int codePoint, final Keyboard keyboard, - final KeyDetector keyDetector) { + private void addKeyInfo(final int codePoint, final Keyboard keyboard) { for (final Key key : keyboard.mKeys) { if (key.mCode == codePoint) { final int x = key.mX + key.mWidth / 2; @@ -216,27 +188,16 @@ public class WordComposer { * Set the currently composing word to the one passed as an argument. * This will register NOT_A_COORDINATE for X and Ys, and use the passed keyboard for proximity. */ - private void setComposingWord(final CharSequence word, final Keyboard keyboard, - final KeyDetector keyDetector) { + public void setComposingWord(final CharSequence word, final Keyboard keyboard) { reset(); final int length = word.length(); for (int i = 0; i < length; i = Character.offsetByCodePoints(word, i, 1)) { int codePoint = Character.codePointAt(word, i); - addKeyInfo(codePoint, keyboard, keyDetector); + addKeyInfo(codePoint, keyboard); } } /** - * Shortcut for the above method, this will create a new KeyDetector for the passed keyboard. - */ - public void setComposingWord(final CharSequence word, final Keyboard keyboard) { - final KeyDetector keyDetector = new KeyDetector(0); - keyDetector.setKeyboard(keyboard, 0, 0); - keyDetector.setProximityCorrectionEnabled(true); - setComposingWord(word, keyboard, keyDetector); - } - - /** * Delete the last keystroke as a result of hitting backspace. */ public void deleteLast() { diff --git a/java/src/com/android/inputmethod/latin/define/ProductionFlag.java b/java/src/com/android/inputmethod/latin/define/ProductionFlag.java new file mode 100644 index 000000000..cfb1d09cc --- /dev/null +++ b/java/src/com/android/inputmethod/latin/define/ProductionFlag.java @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package com.android.inputmethod.latin.define; + +public class ProductionFlag { + public static final boolean IS_EXPERIMENTAL = false; +} diff --git a/java/src/com/android/inputmethod/latin/makedict/FusionDictionary.java b/java/src/com/android/inputmethod/latin/makedict/FusionDictionary.java index d19672181..64fcd7f1a 100644 --- a/java/src/com/android/inputmethod/latin/makedict/FusionDictionary.java +++ b/java/src/com/android/inputmethod/latin/makedict/FusionDictionary.java @@ -21,7 +21,6 @@ import java.util.Arrays; import java.util.Collections; import java.util.Iterator; import java.util.LinkedList; -import java.util.List; /** * A dictionary that can fusion heads and tails of words for more compression. @@ -60,11 +59,24 @@ public class FusionDictionary implements Iterable<Word> { */ public static class WeightedString { final String mWord; - final int mFrequency; + int mFrequency; public WeightedString(String word, int frequency) { mWord = word; mFrequency = frequency; } + + @Override + public int hashCode() { + return Arrays.hashCode(new Object[] { mWord, mFrequency }); + } + + @Override + public boolean equals(Object o) { + if (o == this) return true; + if (!(o instanceof WeightedString)) return false; + WeightedString w = (WeightedString)o; + return mWord.equals(w.mWord) && mFrequency == w.mFrequency; + } } /** @@ -82,10 +94,10 @@ public class FusionDictionary implements Iterable<Word> { public static class CharGroup { public static final int NOT_A_TERMINAL = -1; final int mChars[]; - final ArrayList<WeightedString> mShortcutTargets; - final ArrayList<WeightedString> mBigrams; - final int mFrequency; // NOT_A_TERMINAL == mFrequency indicates this is not a terminal. - final boolean mIsShortcutOnly; // Only valid if this is a terminal. + ArrayList<WeightedString> mShortcutTargets; + ArrayList<WeightedString> mBigrams; + int mFrequency; // NOT_A_TERMINAL == mFrequency indicates this is not a terminal. + boolean mIsShortcutOnly; // Only valid if this is a terminal. Node mChildren; // The two following members to help with binary generation int mCachedSize; @@ -134,6 +146,102 @@ public class FusionDictionary implements Iterable<Word> { assert(mChars.length > 0); return 1 < mChars.length; } + + /** + * Adds a word to the bigram list. Updates the frequency if the word already + * exists. + */ + public void addBigram(final String word, final int frequency) { + if (mBigrams == null) { + mBigrams = new ArrayList<WeightedString>(); + } + WeightedString bigram = getBigram(word); + if (bigram != null) { + bigram.mFrequency = frequency; + } else { + bigram = new WeightedString(word, frequency); + mBigrams.add(bigram); + } + } + + /** + * Gets the shortcut target for the given word. Returns null if the word is not in the + * shortcut list. + */ + public WeightedString getShortcut(final String word) { + if (mShortcutTargets != null) { + final int size = mShortcutTargets.size(); + for (int i = 0; i < size; ++i) { + WeightedString shortcut = mShortcutTargets.get(i); + if (shortcut.mWord.equals(word)) { + return shortcut; + } + } + } + return null; + } + + /** + * Gets the bigram for the given word. + * Returns null if the word is not in the bigrams list. + */ + public WeightedString getBigram(final String word) { + if (mBigrams != null) { + final int size = mBigrams.size(); + for (int i = 0; i < size; ++i) { + WeightedString bigram = mBigrams.get(i); + if (bigram.mWord.equals(word)) { + return bigram; + } + } + } + return null; + } + + /** + * Updates the CharGroup with the given properties. Adds the shortcut and bigram lists to + * the existing ones if any. Note: unigram, bigram, and shortcut frequencies are only + * updated if they are higher than the existing ones. + */ + public void update(int frequency, ArrayList<WeightedString> shortcutTargets, + ArrayList<WeightedString> bigrams, boolean isShortcutOnly) { + if (frequency > mFrequency) { + mFrequency = frequency; + } + if (shortcutTargets != null) { + if (mShortcutTargets == null) { + mShortcutTargets = shortcutTargets; + } else { + final int size = shortcutTargets.size(); + for (int i = 0; i < size; ++i) { + final WeightedString shortcut = shortcutTargets.get(i); + final WeightedString existingShortcut = getShortcut(shortcut.mWord); + if (existingShortcut == null) { + mShortcutTargets.add(shortcut); + } else if (existingShortcut.mFrequency < shortcut.mFrequency) { + existingShortcut.mFrequency = shortcut.mFrequency; + } + } + } + } + if (bigrams != null) { + if (mBigrams == null) { + mBigrams = bigrams; + } else { + final int size = bigrams.size(); + for (int i = 0; i < size; ++i) { + final WeightedString bigram = bigrams.get(i); + final WeightedString existingBigram = getBigram(bigram.mWord); + if (existingBigram == null) { + mBigrams.add(bigram); + } else if (existingBigram.mFrequency < bigram.mFrequency) { + existingBigram.mFrequency = bigram.mFrequency; + } + } + } + } + mIsShortcutOnly = isShortcutOnly; + } } /** @@ -247,6 +355,27 @@ public class FusionDictionary implements Iterable<Word> { } /** + * Helper method to add a new bigram to the dictionary. + * + * @param word1 the previous word of the context + * @param word2 the next word of the context + * @param frequency the bigram frequency + */ + public void setBigram(final String word1, final String word2, final int frequency) { + CharGroup charGroup = findWordInTree(mRoot, word1); + if (charGroup != null) { + final CharGroup charGroup2 = findWordInTree(mRoot, word2); + if (charGroup2 == null) { + // TODO: refactor with the identical code in addNeutralWords + add(getCodePoints(word2), 0, null, null, false /* isShortcutOnly */); + } + charGroup.addBigram(word2, frequency); + } else { + throw new RuntimeException("First word of bigram not found"); + } + } + + /** * Add a word to this dictionary. * * The shortcuts and bigrams, if any, have to be in the dictionary already. If they aren't, @@ -294,17 +423,9 @@ public class FusionDictionary implements Iterable<Word> { if (differentCharIndex == currentGroup.mChars.length) { if (charIndex + differentCharIndex >= word.length) { // The new word is a prefix of an existing word, but the node on which it - // should end already exists as is. - if (currentGroup.mFrequency > 0) { - throw new RuntimeException("Such a word already exists in the dictionary : " - + new String(word, 0, word.length)); - } else { - final CharGroup newNode = new CharGroup(currentGroup.mChars, - shortcutTargets, bigrams, frequency, currentGroup.mChildren, - isShortcutOnly); - currentNode.mData.set(nodeIndex, newNode); - checkStack(currentNode); - } + // should end already exists as is. Since the old CharNode was not a terminal, + // make it one by filling in its frequency and other attributes + currentGroup.update(frequency, shortcutTargets, bigrams, isShortcutOnly); } else { // The new word matches the full old word and extends past it. // We only have to create a new node and add it to the end of this. @@ -316,19 +437,9 @@ public class FusionDictionary implements Iterable<Word> { } } else { if (0 == differentCharIndex) { - // Exact same word. Check the frequency is 0 or NOT_A_TERMINAL, and update. - if (0 != frequency) { - if (0 < currentGroup.mFrequency) { - throw new RuntimeException("This word already exists with frequency " - + currentGroup.mFrequency + " : " - + new String(word, 0, word.length)); - } - final CharGroup newGroup = new CharGroup(word, - currentGroup.mShortcutTargets, currentGroup.mBigrams, - frequency, currentGroup.mChildren, - currentGroup.mIsShortcutOnly && isShortcutOnly); - currentNode.mData.set(nodeIndex, newGroup); - } + // Exact same word. Update the frequency if higher. This will also add the + // new bigrams to the existing bigram list if it already exists. + currentGroup.update(frequency, shortcutTargets, bigrams, isShortcutOnly); } else { // Partial prefix match only. We have to replace the current node with a node // containing the current prefix and create two new ones for the tails. @@ -400,16 +511,11 @@ public class FusionDictionary implements Iterable<Word> { * is ignored. * This comparator imposes orderings that are inconsistent with equals. */ - static private class CharGroupComparator implements java.util.Comparator { - public int compare(Object o1, Object o2) { - final CharGroup c1 = (CharGroup)o1; - final CharGroup c2 = (CharGroup)o2; + static private class CharGroupComparator implements java.util.Comparator<CharGroup> { + public int compare(CharGroup c1, CharGroup c2) { if (c1.mChars[0] == c2.mChars[0]) return 0; return c1.mChars[0] < c2.mChars[0] ? -1 : 1; } - public boolean equals(Object o) { - return o instanceof CharGroupComparator; - } } final static private CharGroupComparator CHARGROUP_COMPARATOR = new CharGroupComparator(); @@ -417,7 +523,7 @@ public class FusionDictionary implements Iterable<Word> { * Finds the insertion index of a character within a node. */ private static int findInsertionIndex(final Node node, int character) { - final List data = node.mData; + final ArrayList<CharGroup> data = node.mData; final CharGroup reference = new CharGroup(new int[] { character }, null, null, 0, false /* isShortcutOnly */); int result = Collections.binarySearch(data, reference, CHARGROUP_COMPARATOR); diff --git a/java/src/com/android/inputmethod/latin/makedict/Word.java b/java/src/com/android/inputmethod/latin/makedict/Word.java index c2c01e1f8..4e0ab1049 100644 --- a/java/src/com/android/inputmethod/latin/makedict/Word.java +++ b/java/src/com/android/inputmethod/latin/makedict/Word.java @@ -19,6 +19,7 @@ package com.android.inputmethod.latin.makedict; import com.android.inputmethod.latin.makedict.FusionDictionary.WeightedString; import java.util.ArrayList; +import java.util.Arrays; /** * Utility class for a word with a frequency. @@ -32,6 +33,8 @@ public class Word implements Comparable<Word> { final ArrayList<WeightedString> mShortcutTargets; final ArrayList<WeightedString> mBigrams; + private int mHashCode = 0; + public Word(final String word, final int frequency, final ArrayList<WeightedString> shortcutTargets, final ArrayList<WeightedString> bigrams, final boolean isShortcutOnly) { @@ -42,6 +45,16 @@ public class Word implements Comparable<Word> { mIsShortcutOnly = isShortcutOnly; } + private static int computeHashCode(Word word) { + return Arrays.hashCode(new Object[] { + word.mWord, + word.mFrequency, + word.mIsShortcutOnly, + word.mShortcutTargets.hashCode(), + word.mBigrams.hashCode() + }); + } + /** * Three-way comparison. * @@ -63,10 +76,20 @@ public class Word implements Comparable<Word> { */ @Override public boolean equals(Object o) { + if (o == this) return true; if (!(o instanceof Word)) return false; Word w = (Word)o; return mFrequency == w.mFrequency && mWord.equals(w.mWord) + && mIsShortcutOnly == w.mIsShortcutOnly && mShortcutTargets.equals(w.mShortcutTargets) && mBigrams.equals(w.mBigrams); } + + @Override + public int hashCode() { + if (mHashCode == 0) { + mHashCode = computeHashCode(this); + } + return mHashCode; + } } diff --git a/java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerService.java b/java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerService.java index 35a5c0f52..5a173857e 100644 --- a/java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerService.java +++ b/java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerService.java @@ -353,6 +353,11 @@ public class AndroidSpellCheckerService extends SpellCheckerService @Override public boolean onUnbind(final Intent intent) { + closeAllDictionaries(); + return false; + } + + private void closeAllDictionaries() { final Map<String, DictionaryPool> oldPools = mDictionaryPools; mDictionaryPools = Collections.synchronizedMap(new TreeMap<String, DictionaryPool>()); final Map<String, Dictionary> oldUserDictionaries = mUserDictionaries; @@ -378,7 +383,6 @@ public class AndroidSpellCheckerService extends SpellCheckerService dictToClose.close(); } } - return false; } private DictionaryPool getDictionaryPool(final String locale) { @@ -570,7 +574,16 @@ public class AndroidSpellCheckerService extends SpellCheckerService final WordComposer composer = new WordComposer(); final int length = text.length(); for (int i = 0; i < length; i = text.offsetByCodePoints(i, 1)) { - composer.addKeyForSpellChecker(text.codePointAt(i), mScript); + final int codePoint = text.codePointAt(i); + // The getXYForCodePointAndScript method returns (Y << 16) + X + final int xy = SpellCheckerProximityInfo.getXYForCodePointAndScript( + codePoint, mScript); + if (SpellCheckerProximityInfo.NOT_A_COORDINATE_PAIR == xy) { + composer.add(codePoint, WordComposer.NOT_A_COORDINATE, + WordComposer.NOT_A_COORDINATE, null); + } else { + composer.add(codePoint, xy & 0xFFFF, xy >> 16, null); + } } final int capitalizeType = getCapitalizationType(text); diff --git a/java/src/com/android/inputmethod/latin/spellcheck/SpellCheckerProximityInfo.java b/java/src/com/android/inputmethod/latin/spellcheck/SpellCheckerProximityInfo.java index db3544987..0103e8423 100644 --- a/java/src/com/android/inputmethod/latin/spellcheck/SpellCheckerProximityInfo.java +++ b/java/src/com/android/inputmethod/latin/spellcheck/SpellCheckerProximityInfo.java @@ -30,17 +30,25 @@ public class SpellCheckerProximityInfo { // as the size of the passed array afterwards so they can't be different. final public static int ROW_SIZE = ProximityInfo.MAX_PROXIMITY_CHARS_SIZE; + // The number of keys in a row of the grid used by the spell checker. + final public static int PROXIMITY_GRID_WIDTH = 11; + // The number of rows in the grid used by the spell checker. + final public static int PROXIMITY_GRID_HEIGHT = 3; + + final private static int NOT_AN_INDEX = -1; + final public static int NOT_A_COORDINATE_PAIR = -1; + // Helper methods final protected static void buildProximityIndices(final int[] proximity, final TreeMap<Integer, Integer> indices) { for (int i = 0; i < proximity.length; i += ROW_SIZE) { - if (NUL != proximity[i]) indices.put(proximity[i], i); + if (NUL != proximity[i]) indices.put(proximity[i], i / ROW_SIZE); } } final protected static int computeIndex(final int characterCode, final TreeMap<Integer, Integer> indices) { final Integer result = indices.get(characterCode); - if (null == result) return -1; + if (null == result) return NOT_AN_INDEX; return result; } @@ -64,6 +72,9 @@ public class SpellCheckerProximityInfo { // to English, many spelling errors consist of the last vowel of the word being wrong // because in English vowels tend to merge with each other in pronunciation. final static int[] PROXIMITY = { + // Proximity for row 1. This must have exactly ROW_SIZE entries for each letter, + // and exactly PROXIMITY_GRID_WIDTH letters for a row. Pad with NUL's. + // The number of rows must be exactly PROXIMITY_GRID_HEIGHT. 'q', 'w', 's', 'a', 'z', NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, 'w', 'q', 'a', 's', 'd', 'e', 'x', NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, 'e', 'w', 's', 'd', 'f', 'r', 'a', 'i', 'o', 'u', NUL, NUL, NUL, NUL, NUL, NUL, @@ -76,9 +87,10 @@ public class SpellCheckerProximityInfo { 'p', 'o', 'l', NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, + // Proximity for row 2. See comment above about size. 'a', 'z', 'x', 's', 'w', 'q', 'e', 'i', 'o', 'u', NUL, NUL, NUL, NUL, NUL, NUL, 's', 'q', 'a', 'z', 'x', 'c', 'd', 'e', 'w', NUL, NUL, NUL, NUL, NUL, NUL, NUL, - 'd', 'w', 's', 'x', 'c', 'v', 'f', 'r', 'e', 'w', NUL, NUL, NUL, NUL, NUL, NUL, + 'd', 'w', 's', 'x', 'c', 'v', 'f', 'r', 'e', NUL, NUL, NUL, NUL, NUL, NUL, NUL, 'f', 'e', 'd', 'c', 'v', 'b', 'g', 't', 'r', NUL, NUL, NUL, NUL, NUL, NUL, NUL, 'g', 'r', 'f', 'v', 'b', 'n', 'h', 'y', 't', NUL, NUL, NUL, NUL, NUL, NUL, NUL, 'h', 't', 'g', 'b', 'n', 'm', 'j', 'u', 'y', NUL, NUL, NUL, NUL, NUL, NUL, NUL, @@ -88,6 +100,7 @@ public class SpellCheckerProximityInfo { NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, + // Proximity for row 3. See comment above about size. 'z', 'a', 's', 'd', 'x', 't', 'g', 'h', 'j', 'u', 'q', 'e', NUL, NUL, NUL, NUL, 'x', 'z', 'a', 's', 'd', 'c', NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, 'c', 'x', 's', 'd', 'f', 'v', NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, @@ -109,9 +122,12 @@ public class SpellCheckerProximityInfo { private static class Cyrillic { final private static TreeMap<Integer, Integer> INDICES = new TreeMap<Integer, Integer>(); + // TODO: The following table is solely based on the keyboard layout. Consult with Russian + // speakers on commonly misspelled words/letters. final static int[] PROXIMITY = { - // TODO: This table is solely based on the keyboard layout. Consult with Russian - // speakers on commonly misspelled words/letters. + // Proximity for row 1. This must have exactly ROW_SIZE entries for each letter, + // and exactly PROXIMITY_GRID_WIDTH letters for a row. Pad with NUL's. + // The number of rows must be exactly PROXIMITY_GRID_HEIGHT. 'й', 'ц', 'ф', 'ы', NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, 'ц', 'й', 'ф', 'ы', 'в', 'у', NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, 'у', 'ц', 'ы', 'в', 'а', 'к', NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, @@ -124,6 +140,7 @@ public class SpellCheckerProximityInfo { 'з', 'щ', 'д', 'ж', 'э', 'х', NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, 'х', 'з', 'ж', 'э', NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, + // Proximity for row 2. See comment above about size. 'ф', 'й', 'ц', 'ы', 'я', NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, 'ы', 'й', 'ц', 'у', 'ф', 'в', 'я', 'ч', NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, 'в', 'ц', 'у', 'к', 'ы', 'а', 'я', 'ч', 'с', NUL, NUL, NUL, NUL, NUL, NUL, NUL, @@ -136,6 +153,7 @@ public class SpellCheckerProximityInfo { 'ж', 'щ', 'з', 'х', 'д', 'э', 'б', 'ю', NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, 'э', 'з', 'х', 'ю', NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, + // Proximity for row 3. See comment above about size. 'я', 'ф', 'ы', 'в', 'ч', NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, 'ч', 'ы', 'в', 'а', 'я', 'с', NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, 'с', 'в', 'а', 'п', 'ч', 'м', NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, NUL, @@ -166,14 +184,31 @@ public class SpellCheckerProximityInfo { throw new RuntimeException("Wrong script supplied: " + script); } } - public static int getIndexOfCodeForScript(final int characterCode, final int script) { + + private static int getIndexOfCodeForScript(final int codePoint, final int script) { switch (script) { case AndroidSpellCheckerService.SCRIPT_LATIN: - return Latin.getIndexOf(characterCode); + return Latin.getIndexOf(codePoint); case AndroidSpellCheckerService.SCRIPT_CYRILLIC: - return Cyrillic.getIndexOf(characterCode); + return Cyrillic.getIndexOf(codePoint); default: throw new RuntimeException("Wrong script supplied: " + script); } } + + // Returns (Y << 16) + X to avoid creating a temporary object. This is okay because + // X and Y are limited to PROXIMITY_GRID_WIDTH resp. PROXIMITY_GRID_HEIGHT which is very + // inferior to 1 << 16 + // As an exception, this returns NOT_A_COORDINATE_PAIR if the key is not on the grid + public static int getXYForCodePointAndScript(final int codePoint, final int script) { + final int index = getIndexOfCodeForScript(codePoint, script); + if (NOT_AN_INDEX == index) return NOT_A_COORDINATE_PAIR; + final int y = index / PROXIMITY_GRID_WIDTH; + final int x = index % PROXIMITY_GRID_WIDTH; + if (y > PROXIMITY_GRID_HEIGHT) { + // Safety check, should be entirely useless + throw new RuntimeException("Wrong y coordinate in spell checker proximity"); + } + return (y << 16) + x; + } } |