diff options
Diffstat (limited to 'java')
43 files changed, 229 insertions, 136 deletions
diff --git a/java/AndroidManifest.xml b/java/AndroidManifest.xml index a7e64bfaa..6f4e602ce 100644 --- a/java/AndroidManifest.xml +++ b/java/AndroidManifest.xml @@ -57,6 +57,7 @@ </service> <activity android:name=".setup.SetupActivity" + android:theme="@style/platformActivityTheme" android:label="@string/english_ime_name" android:icon="@drawable/ic_launcher_keyboard" android:launchMode="singleTask" @@ -68,6 +69,7 @@ </activity> <activity android:name=".setup.SetupWizardActivity" + android:theme="@style/platformActivityTheme" android:label="@string/english_ime_name" android:clearTaskOnLaunch="true"> <intent-filter> @@ -84,6 +86,7 @@ </receiver> <activity android:name=".settings.SettingsActivity" + android:theme="@style/platformActivityTheme" android:label="@string/english_ime_settings" android:uiOptions="splitActionBarWhenNarrow"> <intent-filter> @@ -92,6 +95,7 @@ </activity> <activity android:name=".spellcheck.SpellCheckerSettingsActivity" + android:theme="@style/platformActivityTheme" android:label="@string/android_spell_checker_settings"> <intent-filter> <action android:name="android.intent.action.MAIN" /> @@ -99,6 +103,7 @@ </activity> <activity android:name=".settings.DebugSettingsActivity" + android:theme="@style/platformActivityTheme" android:label="@string/english_ime_debug_settings"> <intent-filter> <action android:name="android.intent.action.MAIN" /> @@ -145,8 +150,8 @@ </receiver> <activity android:name="com.android.inputmethod.dictionarypack.DictionarySettingsActivity" + android:theme="@style/platformActivityTheme" android:label="@string/dictionary_settings_title" - android:theme="@android:style/Theme.Holo" android:uiOptions="splitActionBarWhenNarrow"> <intent-filter> <action android:name="android.intent.action.MAIN"/> @@ -154,8 +159,8 @@ </activity> <activity android:name="com.android.inputmethod.dictionarypack.DownloadOverMeteredDialog" - android:label="@string/dictionary_install_over_metered_network_prompt" - android:theme="@android:style/Theme.Holo"> + android:theme="@style/platformActivityTheme" + android:label="@string/dictionary_install_over_metered_network_prompt"> <intent-filter> <action android:name="android.intent.action.MAIN"/> </intent-filter> diff --git a/java/proguard.flags b/java/proguard.flags index c08a968bc..f7b7f2898 100644 --- a/java/proguard.flags +++ b/java/proguard.flags @@ -14,3 +14,10 @@ -keepclassmembers class * { native <methods>; } + +# Keep classes that are used as a parameter type of methods that are also marked as keep +# to preserve changing those methods' signature. +-keep class com.android.inputmethod.latin.utils.LanguageModelParam +-keep class com.android.inputmethod.latin.AssetFileAddress +-keep class com.android.inputmethod.latin.makedict.ProbabilityInfo +-keep class com.android.inputmethod.latin.Dictionary diff --git a/java/res/values-af/strings.xml b/java/res/values-af/strings.xml index 9c9f02245..720b92ec9 100644 --- a/java/res/values-af/strings.xml +++ b/java/res/values-af/strings.xml @@ -93,8 +93,7 @@ <string name="spoken_description_tab" msgid="2667716002663482248">"Oortjie"</string> <string name="spoken_description_space" msgid="2582521050049860859">"Spasie"</string> <string name="spoken_description_mic" msgid="615536748882611950">"Steminvoering"</string> - <!-- no translation found for spoken_description_emoji (6934027701390427635) --> - <skip /> + <string name="spoken_description_emoji" msgid="6934027701390427635">"Emosiekone"</string> <string name="spoken_description_return" msgid="8178083177238315647">"Enter"</string> <string name="spoken_description_search" msgid="1247236163755920808">"Soek"</string> <string name="spoken_description_dot" msgid="40711082435231673">"Punt"</string> diff --git a/java/res/values-am/strings.xml b/java/res/values-am/strings.xml index 3f9b03fd7..dae334e40 100644 --- a/java/res/values-am/strings.xml +++ b/java/res/values-am/strings.xml @@ -93,8 +93,7 @@ <string name="spoken_description_tab" msgid="2667716002663482248">"ትር"</string> <string name="spoken_description_space" msgid="2582521050049860859">"ባዶ ቦታ"</string> <string name="spoken_description_mic" msgid="615536748882611950">"የድምፅ ግቤ ት"</string> - <!-- no translation found for spoken_description_emoji (6934027701390427635) --> - <skip /> + <string name="spoken_description_emoji" msgid="6934027701390427635">"ኢሞጂ"</string> <string name="spoken_description_return" msgid="8178083177238315647">"ተመለስ"</string> <string name="spoken_description_search" msgid="1247236163755920808">"ፍለጋ"</string> <string name="spoken_description_dot" msgid="40711082435231673">"ነጥብ"</string> diff --git a/java/res/values-az-rAZ/strings.xml b/java/res/values-az-rAZ/strings.xml index 99765a9ff..283f01fa9 100644 --- a/java/res/values-az-rAZ/strings.xml +++ b/java/res/values-az-rAZ/strings.xml @@ -93,8 +93,7 @@ <string name="spoken_description_tab" msgid="2667716002663482248">"Tab"</string> <string name="spoken_description_space" msgid="2582521050049860859">"Boşluq"</string> <string name="spoken_description_mic" msgid="615536748882611950">"Səs daxiletməsi"</string> - <!-- no translation found for spoken_description_emoji (6934027701390427635) --> - <skip /> + <string name="spoken_description_emoji" msgid="6934027701390427635">"Emoji"</string> <string name="spoken_description_return" msgid="8178083177238315647">"Qayıt"</string> <string name="spoken_description_search" msgid="1247236163755920808">"Axtar"</string> <string name="spoken_description_dot" msgid="40711082435231673">"Nöqtə"</string> diff --git a/java/res/values-bg/strings.xml b/java/res/values-bg/strings.xml index 03e8b8cea..88a02959c 100644 --- a/java/res/values-bg/strings.xml +++ b/java/res/values-bg/strings.xml @@ -93,8 +93,7 @@ <string name="spoken_description_tab" msgid="2667716002663482248">"Tab"</string> <string name="spoken_description_space" msgid="2582521050049860859">"Интервал"</string> <string name="spoken_description_mic" msgid="615536748882611950">"Гласово въвеждане"</string> - <!-- no translation found for spoken_description_emoji (6934027701390427635) --> - <skip /> + <string name="spoken_description_emoji" msgid="6934027701390427635">"Емотикони"</string> <string name="spoken_description_return" msgid="8178083177238315647">"Return"</string> <string name="spoken_description_search" msgid="1247236163755920808">"Търсене"</string> <string name="spoken_description_dot" msgid="40711082435231673">"Точка"</string> diff --git a/java/res/values-cs/strings.xml b/java/res/values-cs/strings.xml index b190857a0..1c4afe215 100644 --- a/java/res/values-cs/strings.xml +++ b/java/res/values-cs/strings.xml @@ -93,8 +93,7 @@ <string name="spoken_description_tab" msgid="2667716002663482248">"Tabulátor"</string> <string name="spoken_description_space" msgid="2582521050049860859">"Mezerník"</string> <string name="spoken_description_mic" msgid="615536748882611950">"Hlasový vstup"</string> - <!-- no translation found for spoken_description_emoji (6934027701390427635) --> - <skip /> + <string name="spoken_description_emoji" msgid="6934027701390427635">"Emodži"</string> <string name="spoken_description_return" msgid="8178083177238315647">"Enter"</string> <string name="spoken_description_search" msgid="1247236163755920808">"vyhledávací tlačítko"</string> <string name="spoken_description_dot" msgid="40711082435231673">"Tečka"</string> diff --git a/java/res/values-da/strings.xml b/java/res/values-da/strings.xml index e87fffdee..c2894f743 100644 --- a/java/res/values-da/strings.xml +++ b/java/res/values-da/strings.xml @@ -93,8 +93,7 @@ <string name="spoken_description_tab" msgid="2667716002663482248">"Tabulatortast"</string> <string name="spoken_description_space" msgid="2582521050049860859">"Mellemrum"</string> <string name="spoken_description_mic" msgid="615536748882611950">"Taleinput"</string> - <!-- no translation found for spoken_description_emoji (6934027701390427635) --> - <skip /> + <string name="spoken_description_emoji" msgid="6934027701390427635">"Emoji"</string> <string name="spoken_description_return" msgid="8178083177238315647">"Tilbage"</string> <string name="spoken_description_search" msgid="1247236163755920808">"Søg"</string> <string name="spoken_description_dot" msgid="40711082435231673">"Punktum"</string> diff --git a/java/res/values-es-rUS/strings.xml b/java/res/values-es-rUS/strings.xml index 2e8dc1646..0690d5604 100644 --- a/java/res/values-es-rUS/strings.xml +++ b/java/res/values-es-rUS/strings.xml @@ -93,8 +93,7 @@ <string name="spoken_description_tab" msgid="2667716002663482248">"Pestaña"</string> <string name="spoken_description_space" msgid="2582521050049860859">"Espacio"</string> <string name="spoken_description_mic" msgid="615536748882611950">"Entrada de voz"</string> - <!-- no translation found for spoken_description_emoji (6934027701390427635) --> - <skip /> + <string name="spoken_description_emoji" msgid="6934027701390427635">"Emoji"</string> <string name="spoken_description_return" msgid="8178083177238315647">"Volver"</string> <string name="spoken_description_search" msgid="1247236163755920808">"Buscar"</string> <string name="spoken_description_dot" msgid="40711082435231673">"Punto"</string> diff --git a/java/res/values-fa/strings.xml b/java/res/values-fa/strings.xml index 14957ebcf..f57a469f8 100644 --- a/java/res/values-fa/strings.xml +++ b/java/res/values-fa/strings.xml @@ -97,8 +97,7 @@ <string name="spoken_description_tab" msgid="2667716002663482248">"Tab"</string> <string name="spoken_description_space" msgid="2582521050049860859">"فاصله"</string> <string name="spoken_description_mic" msgid="615536748882611950">"ورودی صدا"</string> - <!-- no translation found for spoken_description_emoji (6934027701390427635) --> - <skip /> + <string name="spoken_description_emoji" msgid="6934027701390427635">"Emoji"</string> <string name="spoken_description_return" msgid="8178083177238315647">"Return"</string> <string name="spoken_description_search" msgid="1247236163755920808">"جستجو"</string> <string name="spoken_description_dot" msgid="40711082435231673">"نقطه"</string> diff --git a/java/res/values-fi/strings.xml b/java/res/values-fi/strings.xml index 514e07cb7..9839b395e 100644 --- a/java/res/values-fi/strings.xml +++ b/java/res/values-fi/strings.xml @@ -93,8 +93,7 @@ <string name="spoken_description_tab" msgid="2667716002663482248">"Sarkain"</string> <string name="spoken_description_space" msgid="2582521050049860859">"Välilyönti"</string> <string name="spoken_description_mic" msgid="615536748882611950">"Äänisyöte"</string> - <!-- no translation found for spoken_description_emoji (6934027701390427635) --> - <skip /> + <string name="spoken_description_emoji" msgid="6934027701390427635">"Emoji"</string> <string name="spoken_description_return" msgid="8178083177238315647">"Takaisin"</string> <string name="spoken_description_search" msgid="1247236163755920808">"Haku"</string> <string name="spoken_description_dot" msgid="40711082435231673">"Piste"</string> diff --git a/java/res/values-fr-rCA/strings.xml b/java/res/values-fr-rCA/strings.xml index b0b4c0145..217211ce7 100644 --- a/java/res/values-fr-rCA/strings.xml +++ b/java/res/values-fr-rCA/strings.xml @@ -93,8 +93,7 @@ <string name="spoken_description_tab" msgid="2667716002663482248">"Onglet"</string> <string name="spoken_description_space" msgid="2582521050049860859">"Espace"</string> <string name="spoken_description_mic" msgid="615536748882611950">"Saisie vocale"</string> - <!-- no translation found for spoken_description_emoji (6934027701390427635) --> - <skip /> + <string name="spoken_description_emoji" msgid="6934027701390427635">"Emoji"</string> <string name="spoken_description_return" msgid="8178083177238315647">"Renvoyer"</string> <string name="spoken_description_search" msgid="1247236163755920808">"Rechercher"</string> <string name="spoken_description_dot" msgid="40711082435231673">"Point"</string> diff --git a/java/res/values-fr/strings.xml b/java/res/values-fr/strings.xml index 1afd4af0e..6d0e43c2f 100644 --- a/java/res/values-fr/strings.xml +++ b/java/res/values-fr/strings.xml @@ -93,8 +93,7 @@ <string name="spoken_description_tab" msgid="2667716002663482248">"Tabulation"</string> <string name="spoken_description_space" msgid="2582521050049860859">"Espace"</string> <string name="spoken_description_mic" msgid="615536748882611950">"Saisie vocale"</string> - <!-- no translation found for spoken_description_emoji (6934027701390427635) --> - <skip /> + <string name="spoken_description_emoji" msgid="6934027701390427635">"Emoji"</string> <string name="spoken_description_return" msgid="8178083177238315647">"Entrée"</string> <string name="spoken_description_search" msgid="1247236163755920808">"Rechercher"</string> <string name="spoken_description_dot" msgid="40711082435231673">"Point"</string> diff --git a/java/res/values-hy-rAM/strings.xml b/java/res/values-hy-rAM/strings.xml index 975b7b33b..3bd55143d 100644 --- a/java/res/values-hy-rAM/strings.xml +++ b/java/res/values-hy-rAM/strings.xml @@ -93,8 +93,7 @@ <string name="spoken_description_tab" msgid="2667716002663482248">"Tab"</string> <string name="spoken_description_space" msgid="2582521050049860859">"Բացակ"</string> <string name="spoken_description_mic" msgid="615536748882611950">"Ձայնային մուտքագրում"</string> - <!-- no translation found for spoken_description_emoji (6934027701390427635) --> - <skip /> + <string name="spoken_description_emoji" msgid="6934027701390427635">"Զմայլիկներ"</string> <string name="spoken_description_return" msgid="8178083177238315647">"Վերադարձ"</string> <string name="spoken_description_search" msgid="1247236163755920808">"Որոնել"</string> <string name="spoken_description_dot" msgid="40711082435231673">"Կետ"</string> diff --git a/java/res/values-ja/strings.xml b/java/res/values-ja/strings.xml index 76ba650d4..5cdc6f4d1 100644 --- a/java/res/values-ja/strings.xml +++ b/java/res/values-ja/strings.xml @@ -93,8 +93,7 @@ <string name="spoken_description_tab" msgid="2667716002663482248">"Tab"</string> <string name="spoken_description_space" msgid="2582521050049860859">"Space"</string> <string name="spoken_description_mic" msgid="615536748882611950">"音声入力"</string> - <!-- no translation found for spoken_description_emoji (6934027701390427635) --> - <skip /> + <string name="spoken_description_emoji" msgid="6934027701390427635">"絵文字"</string> <string name="spoken_description_return" msgid="8178083177238315647">"Enter"</string> <string name="spoken_description_search" msgid="1247236163755920808">"検索"</string> <string name="spoken_description_dot" msgid="40711082435231673">"中点"</string> diff --git a/java/res/values-ka-rGE/strings.xml b/java/res/values-ka-rGE/strings.xml index dcb8061e0..cc6c5bb7c 100644 --- a/java/res/values-ka-rGE/strings.xml +++ b/java/res/values-ka-rGE/strings.xml @@ -93,8 +93,7 @@ <string name="spoken_description_tab" msgid="2667716002663482248">"Tab"</string> <string name="spoken_description_space" msgid="2582521050049860859">"შორისი"</string> <string name="spoken_description_mic" msgid="615536748882611950">"ხმოვანი შეყვანა"</string> - <!-- no translation found for spoken_description_emoji (6934027701390427635) --> - <skip /> + <string name="spoken_description_emoji" msgid="6934027701390427635">"Emoji"</string> <string name="spoken_description_return" msgid="8178083177238315647">"დაბრუნება"</string> <string name="spoken_description_search" msgid="1247236163755920808">"ძიება"</string> <string name="spoken_description_dot" msgid="40711082435231673">"წერტილი"</string> diff --git a/java/res/values-ko/strings.xml b/java/res/values-ko/strings.xml index 30907b6df..d756aa96f 100644 --- a/java/res/values-ko/strings.xml +++ b/java/res/values-ko/strings.xml @@ -93,8 +93,7 @@ <string name="spoken_description_tab" msgid="2667716002663482248">"탭"</string> <string name="spoken_description_space" msgid="2582521050049860859">"스페이스"</string> <string name="spoken_description_mic" msgid="615536748882611950">"음성 입력"</string> - <!-- no translation found for spoken_description_emoji (6934027701390427635) --> - <skip /> + <string name="spoken_description_emoji" msgid="6934027701390427635">"그림 이모티콘"</string> <string name="spoken_description_return" msgid="8178083177238315647">"리턴 키"</string> <string name="spoken_description_search" msgid="1247236163755920808">"검색"</string> <string name="spoken_description_dot" msgid="40711082435231673">"점"</string> diff --git a/java/res/values-mn-rMN/strings.xml b/java/res/values-mn-rMN/strings.xml index 684c03f2b..42e840895 100644 --- a/java/res/values-mn-rMN/strings.xml +++ b/java/res/values-mn-rMN/strings.xml @@ -93,7 +93,7 @@ <string name="spoken_description_tab" msgid="2667716002663482248">"Таб"</string> <string name="spoken_description_space" msgid="2582521050049860859">"Хоосон зай"</string> <string name="spoken_description_mic" msgid="615536748882611950">"Дуугаар оруулах"</string> - <string name="spoken_description_emoji" msgid="6934027701390427635">"Emoji"</string> + <string name="spoken_description_emoji" msgid="6934027701390427635">"Эможи"</string> <string name="spoken_description_return" msgid="8178083177238315647">"Буцах"</string> <string name="spoken_description_search" msgid="1247236163755920808">"Хайх"</string> <string name="spoken_description_dot" msgid="40711082435231673">"Цэг"</string> diff --git a/java/res/values-ms-rMY/strings.xml b/java/res/values-ms-rMY/strings.xml index 2cbba2194..1a3b3fc57 100644 --- a/java/res/values-ms-rMY/strings.xml +++ b/java/res/values-ms-rMY/strings.xml @@ -93,8 +93,7 @@ <string name="spoken_description_tab" msgid="2667716002663482248">"Tab"</string> <string name="spoken_description_space" msgid="2582521050049860859">"Ruang"</string> <string name="spoken_description_mic" msgid="615536748882611950">"Input suara"</string> - <!-- no translation found for spoken_description_emoji (6934027701390427635) --> - <skip /> + <string name="spoken_description_emoji" msgid="6934027701390427635">"Emoji"</string> <string name="spoken_description_return" msgid="8178083177238315647">"Kembali"</string> <string name="spoken_description_search" msgid="1247236163755920808">"Cari"</string> <string name="spoken_description_dot" msgid="40711082435231673">"Titik"</string> diff --git a/java/res/values-ne-rNP/strings.xml b/java/res/values-ne-rNP/strings.xml index 04a2d09f4..318071c76 100644 --- a/java/res/values-ne-rNP/strings.xml +++ b/java/res/values-ne-rNP/strings.xml @@ -93,8 +93,7 @@ <string name="spoken_description_tab" msgid="2667716002663482248">"ट्याब"</string> <string name="spoken_description_space" msgid="2582521050049860859">"स्पेस"</string> <string name="spoken_description_mic" msgid="615536748882611950">"आवाज इनपुट"</string> - <!-- no translation found for spoken_description_emoji (6934027701390427635) --> - <skip /> + <string name="spoken_description_emoji" msgid="6934027701390427635">"इमोजी"</string> <string name="spoken_description_return" msgid="8178083177238315647">"फर्कनुहोस्"</string> <string name="spoken_description_search" msgid="1247236163755920808">"खोज्नुहोस्"</string> <string name="spoken_description_dot" msgid="40711082435231673">"डट"</string> diff --git a/java/res/values-pt-rPT/strings.xml b/java/res/values-pt-rPT/strings.xml index 8b4131c11..c9622554f 100644 --- a/java/res/values-pt-rPT/strings.xml +++ b/java/res/values-pt-rPT/strings.xml @@ -93,8 +93,7 @@ <string name="spoken_description_tab" msgid="2667716002663482248">"Tab"</string> <string name="spoken_description_space" msgid="2582521050049860859">"Espaço"</string> <string name="spoken_description_mic" msgid="615536748882611950">"Entrada de voz"</string> - <!-- no translation found for spoken_description_emoji (6934027701390427635) --> - <skip /> + <string name="spoken_description_emoji" msgid="6934027701390427635">"Emoji"</string> <string name="spoken_description_return" msgid="8178083177238315647">"Enter"</string> <string name="spoken_description_search" msgid="1247236163755920808">"Pesquisar"</string> <string name="spoken_description_dot" msgid="40711082435231673">"Ponto"</string> diff --git a/java/res/values-pt/strings.xml b/java/res/values-pt/strings.xml index a74d24a27..96669d3da 100644 --- a/java/res/values-pt/strings.xml +++ b/java/res/values-pt/strings.xml @@ -93,8 +93,7 @@ <string name="spoken_description_tab" msgid="2667716002663482248">"Tab"</string> <string name="spoken_description_space" msgid="2582521050049860859">"Espaço"</string> <string name="spoken_description_mic" msgid="615536748882611950">"Entrada de voz"</string> - <!-- no translation found for spoken_description_emoji (6934027701390427635) --> - <skip /> + <string name="spoken_description_emoji" msgid="6934027701390427635">"Emojis"</string> <string name="spoken_description_return" msgid="8178083177238315647">"Voltar"</string> <string name="spoken_description_search" msgid="1247236163755920808">"Pesquisar"</string> <string name="spoken_description_dot" msgid="40711082435231673">"Ponto"</string> diff --git a/java/res/values-ro/strings.xml b/java/res/values-ro/strings.xml index d40f4427e..ac5143bda 100644 --- a/java/res/values-ro/strings.xml +++ b/java/res/values-ro/strings.xml @@ -93,8 +93,7 @@ <string name="spoken_description_tab" msgid="2667716002663482248">"Tab"</string> <string name="spoken_description_space" msgid="2582521050049860859">"Spaţiu"</string> <string name="spoken_description_mic" msgid="615536748882611950">"Intrare vocală"</string> - <!-- no translation found for spoken_description_emoji (6934027701390427635) --> - <skip /> + <string name="spoken_description_emoji" msgid="6934027701390427635">"Emoji"</string> <string name="spoken_description_return" msgid="8178083177238315647">"Enter"</string> <string name="spoken_description_search" msgid="1247236163755920808">"Căutaţi"</string> <string name="spoken_description_dot" msgid="40711082435231673">"Punct"</string> diff --git a/java/res/values-ru/strings.xml b/java/res/values-ru/strings.xml index 44cb0fab8..dd0657dcb 100644 --- a/java/res/values-ru/strings.xml +++ b/java/res/values-ru/strings.xml @@ -93,8 +93,7 @@ <string name="spoken_description_tab" msgid="2667716002663482248">"Клавиша табуляции"</string> <string name="spoken_description_space" msgid="2582521050049860859">"Пробел"</string> <string name="spoken_description_mic" msgid="615536748882611950">"Голосовой ввод"</string> - <!-- no translation found for spoken_description_emoji (6934027701390427635) --> - <skip /> + <string name="spoken_description_emoji" msgid="6934027701390427635">"Смайлики."</string> <string name="spoken_description_return" msgid="8178083177238315647">"Клавиша \"Ввод\""</string> <string name="spoken_description_search" msgid="1247236163755920808">"Поиск"</string> <string name="spoken_description_dot" msgid="40711082435231673">"Точка"</string> diff --git a/java/res/values-sk/strings.xml b/java/res/values-sk/strings.xml index 68df7ae41..c35982caf 100644 --- a/java/res/values-sk/strings.xml +++ b/java/res/values-sk/strings.xml @@ -93,8 +93,7 @@ <string name="spoken_description_tab" msgid="2667716002663482248">"Karta"</string> <string name="spoken_description_space" msgid="2582521050049860859">"Medzerník"</string> <string name="spoken_description_mic" msgid="615536748882611950">"Hlasový vstup"</string> - <!-- no translation found for spoken_description_emoji (6934027701390427635) --> - <skip /> + <string name="spoken_description_emoji" msgid="6934027701390427635">"Emoji"</string> <string name="spoken_description_return" msgid="8178083177238315647">"Enter"</string> <string name="spoken_description_search" msgid="1247236163755920808">"Hľadať"</string> <string name="spoken_description_dot" msgid="40711082435231673">"Bodka"</string> diff --git a/java/res/values-sr/strings.xml b/java/res/values-sr/strings.xml index e1ead18a7..2e9fbdbf3 100644 --- a/java/res/values-sr/strings.xml +++ b/java/res/values-sr/strings.xml @@ -93,8 +93,7 @@ <string name="spoken_description_tab" msgid="2667716002663482248">"Tab"</string> <string name="spoken_description_space" msgid="2582521050049860859">"Размак"</string> <string name="spoken_description_mic" msgid="615536748882611950">"Гласовни унос"</string> - <!-- no translation found for spoken_description_emoji (6934027701390427635) --> - <skip /> + <string name="spoken_description_emoji" msgid="6934027701390427635">"Емоџи"</string> <string name="spoken_description_return" msgid="8178083177238315647">"Return"</string> <string name="spoken_description_search" msgid="1247236163755920808">"Претражи"</string> <string name="spoken_description_dot" msgid="40711082435231673">"Тачка"</string> diff --git a/java/res/values-th/strings.xml b/java/res/values-th/strings.xml index fe118bd4d..cb857075f 100644 --- a/java/res/values-th/strings.xml +++ b/java/res/values-th/strings.xml @@ -93,8 +93,7 @@ <string name="spoken_description_tab" msgid="2667716002663482248">"แท็บ"</string> <string name="spoken_description_space" msgid="2582521050049860859">"Space"</string> <string name="spoken_description_mic" msgid="615536748882611950">"การป้อนข้อมูลด้วยเสียง"</string> - <!-- no translation found for spoken_description_emoji (6934027701390427635) --> - <skip /> + <string name="spoken_description_emoji" msgid="6934027701390427635">"อีโมจิ"</string> <string name="spoken_description_return" msgid="8178083177238315647">"Return"</string> <string name="spoken_description_search" msgid="1247236163755920808">"ค้นหา"</string> <string name="spoken_description_dot" msgid="40711082435231673">"เครื่องหมายจุด"</string> diff --git a/java/res/values-tl/strings.xml b/java/res/values-tl/strings.xml index 02bc8baa1..c5621b75e 100644 --- a/java/res/values-tl/strings.xml +++ b/java/res/values-tl/strings.xml @@ -93,8 +93,7 @@ <string name="spoken_description_tab" msgid="2667716002663482248">"Tab"</string> <string name="spoken_description_space" msgid="2582521050049860859">"Puwang"</string> <string name="spoken_description_mic" msgid="615536748882611950">"Input ng boses"</string> - <!-- no translation found for spoken_description_emoji (6934027701390427635) --> - <skip /> + <string name="spoken_description_emoji" msgid="6934027701390427635">"Emoji"</string> <string name="spoken_description_return" msgid="8178083177238315647">"Bumalik"</string> <string name="spoken_description_search" msgid="1247236163755920808">"Paghahanap"</string> <string name="spoken_description_dot" msgid="40711082435231673">"Tuldok"</string> diff --git a/java/res/values-tr/strings.xml b/java/res/values-tr/strings.xml index ca6d66400..a5832aec9 100644 --- a/java/res/values-tr/strings.xml +++ b/java/res/values-tr/strings.xml @@ -93,8 +93,7 @@ <string name="spoken_description_tab" msgid="2667716002663482248">"Sekme"</string> <string name="spoken_description_space" msgid="2582521050049860859">"Boşluk"</string> <string name="spoken_description_mic" msgid="615536748882611950">"Ses girişi"</string> - <!-- no translation found for spoken_description_emoji (6934027701390427635) --> - <skip /> + <string name="spoken_description_emoji" msgid="6934027701390427635">"Emoji"</string> <string name="spoken_description_return" msgid="8178083177238315647">"Enter"</string> <string name="spoken_description_search" msgid="1247236163755920808">"Ara"</string> <string name="spoken_description_dot" msgid="40711082435231673">"Nokta"</string> diff --git a/java/res/values-v20/platform-theme.xml b/java/res/values-v20/platform-theme.xml new file mode 100644 index 000000000..b8c1d9655 --- /dev/null +++ b/java/res/values-v20/platform-theme.xml @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/* +** +** Copyright 2014, 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. +*/ +--> + +<!-- TODO: This file is temporarily placed under values-v20. --> +<!-- TODO: It might be moved under values-v21. --> +<resources xmlns:android="http://schemas.android.com/apk/res/android"> + <!-- TODO: Use Theme.Quantum.Light once it is fixed. + <style name="platformActivityTheme" parent="@android:style/Theme.Quantum.Light" /> + --> + <style name="platformActivityTheme" parent="@android:style/Theme.Quantum.Light.NoActionBar.Fullscreen" /> + <style name="platformDialogTheme" parent="@android:style/Theme.Quantum.Light.Dialog" /> +</resources> diff --git a/java/res/values-vi/strings.xml b/java/res/values-vi/strings.xml index 952444209..ed795216c 100644 --- a/java/res/values-vi/strings.xml +++ b/java/res/values-vi/strings.xml @@ -93,8 +93,7 @@ <string name="spoken_description_tab" msgid="2667716002663482248">"Tab"</string> <string name="spoken_description_space" msgid="2582521050049860859">"Dấu cách"</string> <string name="spoken_description_mic" msgid="615536748882611950">"Nhập dữ liệu bằng giọng nói"</string> - <!-- no translation found for spoken_description_emoji (6934027701390427635) --> - <skip /> + <string name="spoken_description_emoji" msgid="6934027701390427635">"Biểu tượng cảm xúc"</string> <string name="spoken_description_return" msgid="8178083177238315647">"Quay lại"</string> <string name="spoken_description_search" msgid="1247236163755920808">"Tìm kiếm"</string> <string name="spoken_description_dot" msgid="40711082435231673">"Dấu chấm"</string> @@ -190,7 +189,7 @@ <string name="setup_step3_action" msgid="600879797256942259">"Định cấu hình các ngôn ngữ khác"</string> <string name="setup_finish_action" msgid="276559243409465389">"Đã xong"</string> <string name="show_setup_wizard_icon" msgid="5008028590593710830">"Hiển thị biểu tượng ứng dụng"</string> - <string name="show_setup_wizard_icon_summary" msgid="4119998322536880213">"Hiển thị biểu tượng ứng dụng trong trình khởi chạy"</string> + <string name="show_setup_wizard_icon_summary" msgid="4119998322536880213">"Hiển thị biểu tượng ứng dụng trong trình chạy"</string> <string name="app_name" msgid="6320102637491234792">"Nhà cung cấp từ điển"</string> <string name="dictionary_provider_name" msgid="3027315045397363079">"Nhà cung cấp từ điển"</string> <string name="dictionary_service_name" msgid="6237472350693511448">"Dịch vụ từ điển"</string> diff --git a/java/res/values-zh-rCN/strings.xml b/java/res/values-zh-rCN/strings.xml index 603e84b76..8b605dfc4 100644 --- a/java/res/values-zh-rCN/strings.xml +++ b/java/res/values-zh-rCN/strings.xml @@ -93,8 +93,7 @@ <string name="spoken_description_tab" msgid="2667716002663482248">"Tab"</string> <string name="spoken_description_space" msgid="2582521050049860859">"空格"</string> <string name="spoken_description_mic" msgid="615536748882611950">"语音输入"</string> - <!-- no translation found for spoken_description_emoji (6934027701390427635) --> - <skip /> + <string name="spoken_description_emoji" msgid="6934027701390427635">"表情符"</string> <string name="spoken_description_return" msgid="8178083177238315647">"返回"</string> <string name="spoken_description_search" msgid="1247236163755920808">"搜索"</string> <string name="spoken_description_dot" msgid="40711082435231673">"点"</string> diff --git a/java/res/values-zh-rTW/strings.xml b/java/res/values-zh-rTW/strings.xml index 2309c5c2e..412ffe978 100644 --- a/java/res/values-zh-rTW/strings.xml +++ b/java/res/values-zh-rTW/strings.xml @@ -93,8 +93,7 @@ <string name="spoken_description_tab" msgid="2667716002663482248">"Tab 鍵"</string> <string name="spoken_description_space" msgid="2582521050049860859">"空白鍵"</string> <string name="spoken_description_mic" msgid="615536748882611950">"語音輸入"</string> - <!-- no translation found for spoken_description_emoji (6934027701390427635) --> - <skip /> + <string name="spoken_description_emoji" msgid="6934027701390427635">"表情符號"</string> <string name="spoken_description_return" msgid="8178083177238315647">"返回"</string> <string name="spoken_description_search" msgid="1247236163755920808">"搜尋"</string> <string name="spoken_description_dot" msgid="40711082435231673">"點"</string> diff --git a/java/res/values/platform-theme.xml b/java/res/values/platform-theme.xml new file mode 100644 index 000000000..8e131a2b0 --- /dev/null +++ b/java/res/values/platform-theme.xml @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/* +** +** Copyright 2014, 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 xmlns:android="http://schemas.android.com/apk/res/android"> + <style name="platformActivityTheme" parent="@android:style/Theme.Holo" /> + <style name="platformDialogTheme" parent="@android:style/Theme.Holo.Dialog" /> +</resources> diff --git a/java/src/com/android/inputmethod/dictionarypack/MetadataDbHelper.java b/java/src/com/android/inputmethod/dictionarypack/MetadataDbHelper.java index 8badaf4b9..4a8fa51ee 100644 --- a/java/src/com/android/inputmethod/dictionarypack/MetadataDbHelper.java +++ b/java/src/com/android/inputmethod/dictionarypack/MetadataDbHelper.java @@ -45,10 +45,8 @@ public class MetadataDbHelper extends SQLiteOpenHelper { // This is the first released version of the database that implements CLIENTID. It is // used to identify the versions for upgrades. This should never change going forward. private static final int METADATA_DATABASE_VERSION_WITH_CLIENTID = 6; - // This is the current database version. It should be updated when the database schema - // gets updated. It is passed to the framework constructor of SQLiteOpenHelper, so - // that's what the framework uses to track our database version. - private static final int METADATA_DATABASE_VERSION = 6; + // The current database version. + private static final int CURRENT_METADATA_DATABASE_VERSION = 7; private final static long NOT_A_DOWNLOAD_ID = -1; @@ -169,7 +167,7 @@ public class MetadataDbHelper extends SQLiteOpenHelper { private MetadataDbHelper(final Context context, final String clientId) { super(context, METADATA_DATABASE_NAME_STEM + (TextUtils.isEmpty(clientId) ? "" : "." + clientId), - null, METADATA_DATABASE_VERSION); + null, CURRENT_METADATA_DATABASE_VERSION); mContext = context; mClientId = clientId; } @@ -219,22 +217,45 @@ public class MetadataDbHelper extends SQLiteOpenHelper { /** * Upgrade the database. Upgrade from version 3 is supported. + * Version 3 has a DB named METADATA_DATABASE_NAME_STEM containing a table METADATA_TABLE_NAME. + * Version 6 and above has a DB named METADATA_DATABASE_NAME_STEM containing a + * table CLIENT_TABLE_NAME, and for each client a table called METADATA_TABLE_STEM + "." + the + * name of the client and contains a table METADATA_TABLE_NAME. + * For schemas, see the above create statements. The schemas have never changed so far. + * + * This method is called by the framework. See {@link SQLiteOpenHelper#onUpgrade} + * @param db The database we are upgrading + * @param oldVersion The old database version (the one on the disk) + * @param newVersion The new database version as supplied to the constructor of SQLiteOpenHelper */ @Override public void onUpgrade(final SQLiteDatabase db, final int oldVersion, final int newVersion) { if (METADATA_DATABASE_INITIAL_VERSION == oldVersion - && METADATA_DATABASE_VERSION_WITH_CLIENTID == newVersion) { + && METADATA_DATABASE_VERSION_WITH_CLIENTID <= newVersion + && CURRENT_METADATA_DATABASE_VERSION >= newVersion) { // Upgrade from version METADATA_DATABASE_INITIAL_VERSION to version // METADATA_DATABASE_VERSION_WITH_CLIENT_ID + // Only the default database should contain the client table, so we test for mClientId. if (TextUtils.isEmpty(mClientId)) { - // Only the default database should contain the client table. - // Anyway in version 3 only the default table existed so the emptyness + // Anyway in version 3 only the default table existed so the emptiness // test should always be true, but better check to be sure. createClientTable(db); } + } else if (METADATA_DATABASE_VERSION_WITH_CLIENTID < newVersion + && CURRENT_METADATA_DATABASE_VERSION >= newVersion) { + // Here we drop the client table, so that all clients send us their information again. + // The client table contains the URL to hit to update the available dictionaries list, + // but the info about the dictionaries themselves is stored in the table called + // METADATA_TABLE_NAME and we want to keep it, so we only drop the client table. + db.execSQL("DROP TABLE IF EXISTS " + CLIENT_TABLE_NAME); + // Only the default database should contain the client table, so we test for mClientId. + if (TextUtils.isEmpty(mClientId)) { + createClientTable(db); + } } else { - // Version 3 was the earliest version, so we should never come here. If we do, we - // have no idea what this database is, so we'd better wipe it off. + // If we're not in the above case, either we are upgrading from an earlier versionCode + // and we should wipe the database, or we are handling a version we never heard about + // (can only be a bug) so it's safer to wipe the database. db.execSQL("DROP TABLE IF EXISTS " + METADATA_TABLE_NAME); db.execSQL("DROP TABLE IF EXISTS " + CLIENT_TABLE_NAME); onCreate(db); diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java b/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java index fd0be6f92..2e4a0902d 100644 --- a/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java +++ b/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java @@ -219,22 +219,15 @@ public final class KeyboardSwitcher implements KeyboardState.SwitchActions { return null; } - /** - * Update keyboard shift state triggered by connected EditText status change. - */ - public void updateShiftState() { - mState.onUpdateShiftState(mLatinIME.getCurrentAutoCapsState(), - mLatinIME.getCurrentRecapitalizeState()); - } - // TODO: Remove this method. Come up with a more comprehensive way to reset the keyboard layout // when a keyboard layout set doesn't get reloaded in LatinIME.onStartInputViewInternal(). public void resetKeyboardStateToAlphabet() { mState.onResetKeyboardStateToAlphabet(); } - public void onPressKey(final int code, final boolean isSinglePointer) { - mState.onPressKey(code, isSinglePointer, mLatinIME.getCurrentAutoCapsState()); + public void onPressKey(final int code, final boolean isSinglePointer, + final int currentAutoCapsState) { + mState.onPressKey(code, isSinglePointer, currentAutoCapsState); } public void onReleaseKey(final int code, final boolean withSliding) { @@ -338,8 +331,8 @@ public final class KeyboardSwitcher implements KeyboardState.SwitchActions { /** * Updates state machine to figure out when to automatically switch back to the previous mode. */ - public void onCodeInput(final int code) { - mState.onCodeInput(code, mLatinIME.getCurrentAutoCapsState()); + public void onCodeInput(final int code, final int currentAutoCapsState) { + mState.onCodeInput(code, currentAutoCapsState); } public boolean isShowingEmojiPalettes() { diff --git a/java/src/com/android/inputmethod/latin/ImportantNoticeDialog.java b/java/src/com/android/inputmethod/latin/ImportantNoticeDialog.java index 9870faa98..be54b669b 100644 --- a/java/src/com/android/inputmethod/latin/ImportantNoticeDialog.java +++ b/java/src/com/android/inputmethod/latin/ImportantNoticeDialog.java @@ -23,6 +23,7 @@ import android.content.DialogInterface.OnClickListener; import android.content.DialogInterface.OnDismissListener; import android.content.DialogInterface.OnShowListener; +import com.android.inputmethod.latin.utils.DialogUtils; import com.android.inputmethod.latin.utils.ImportantNoticeUtils; /** @@ -40,7 +41,7 @@ public final class ImportantNoticeDialog extends AlertDialog implements OnShowLi public ImportantNoticeDialog( final Context context, final ImportantNoticeDialogListener listener) { - super(context, THEME_HOLO_DARK); + super(DialogUtils.getPlatformDialogThemeContext(context)); mListener = listener; mNextImportantNoticeVersion = ImportantNoticeUtils.getNextImportantNoticeVersion(context); setMessage(ImportantNoticeUtils.getNextImportantNoticeContents(context)); diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index b4807b01a..ca99998e0 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -83,6 +83,7 @@ import com.android.inputmethod.latin.suggestions.SuggestionStripViewAccessor; import com.android.inputmethod.latin.utils.ApplicationUtils; import com.android.inputmethod.latin.utils.CapsModeUtils; import com.android.inputmethod.latin.utils.CoordinateUtils; +import com.android.inputmethod.latin.utils.DialogUtils; import com.android.inputmethod.latin.utils.ImportantNoticeUtils; import com.android.inputmethod.latin.utils.IntentUtils; import com.android.inputmethod.latin.utils.JniUtils; @@ -197,7 +198,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen latinIme.mSettings.getCurrent()); break; case MSG_UPDATE_SHIFT_STATE: - switcher.updateShiftState(); + switcher.requestUpdatingShiftState(); break; case MSG_SHOW_GESTURE_PREVIEW_AND_SUGGESTION_STRIP: if (msg.arg1 == ARG1_NOT_GESTURE_INPUT) { @@ -833,7 +834,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen // we need to re-evaluate the shift state, but not the whole layout which would be // disruptive. // Space state must be updated before calling updateShiftState - switcher.updateShiftState(); + switcher.requestUpdatingShiftState(); } // This will set the punctuation suggestions if next word suggestion is off; // otherwise it will clear the suggestion strip. @@ -912,7 +913,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen // TODO: find a better way to simulate actual execution. if (isInputViewShown() && mInputLogic.onUpdateSelection(oldSelStart, oldSelEnd, newSelStart, newSelEnd)) { - mKeyboardSwitcher.updateShiftState(); + mKeyboardSwitcher.requestUpdatingShiftState(); } mSubtypeState.currentSubtypeUsed(); @@ -1231,7 +1232,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen mInputLogic.onCodeInput(mSettings.getCurrent(), event, mKeyboardSwitcher.getKeyboardShiftMode(), mHandler); updateStateAfterInputTransaction(completeInputTransaction); - mKeyboardSwitcher.onCodeInput(codePoint); + mKeyboardSwitcher.onCodeInput(codePoint, getCurrentAutoCapsState()); } // A helper method to split the code point and the key code. Ultimately, they should not be @@ -1256,8 +1257,8 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen // TODO: have the keyboard pass the correct key code when we need it. final Event event = Event.createSoftwareTextEvent(rawText, Event.NOT_A_KEY_CODE); mInputLogic.onTextInput(mSettings.getCurrent(), event, mHandler); - mKeyboardSwitcher.updateShiftState(); - mKeyboardSwitcher.onCodeInput(Constants.CODE_OUTPUT_TEXT); + mKeyboardSwitcher.requestUpdatingShiftState(); + mKeyboardSwitcher.onCodeInput(Constants.CODE_OUTPUT_TEXT, getCurrentAutoCapsState()); } @Override @@ -1500,7 +1501,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen mHandler.postUpdateShiftState(); break; case InputTransaction.SHIFT_UPDATE_NOW: - mKeyboardSwitcher.updateShiftState(); + mKeyboardSwitcher.requestUpdatingShiftState(); break; default: // SHIFT_NO_UPDATE } @@ -1540,7 +1541,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen @Override public void onPressKey(final int primaryCode, final int repeatCount, final boolean isSinglePointer) { - mKeyboardSwitcher.onPressKey(primaryCode, isSinglePointer); + mKeyboardSwitcher.onPressKey(primaryCode, isSinglePointer, getCurrentAutoCapsState()); hapticAndAudioFeedback(primaryCode, repeatCount); } @@ -1662,8 +1663,9 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen } } }; - final AlertDialog.Builder builder = - new AlertDialog.Builder(this).setItems(items, listener).setTitle(title); + final AlertDialog.Builder builder = new AlertDialog.Builder( + DialogUtils.getPlatformDialogThemeContext(this)); + builder.setItems(items, listener).setTitle(title); showOptionDialog(builder.create()); } diff --git a/java/src/com/android/inputmethod/latin/WordComposer.java b/java/src/com/android/inputmethod/latin/WordComposer.java index f31fb134c..87cf64461 100644 --- a/java/src/com/android/inputmethod/latin/WordComposer.java +++ b/java/src/com/android/inputmethod/latin/WordComposer.java @@ -174,7 +174,6 @@ public final class WordComposer { final int keyY = event.mY; final int newIndex = size(); processEvent(event); - mCursorPositionWithinWord = mCodePointSize; if (newIndex < MAX_WORD_LENGTH) { mPrimaryKeyCodes[newIndex] = primaryCode >= Constants.CODE_SPACE ? Character.toLowerCase(primaryCode) : primaryCode; @@ -190,45 +189,51 @@ public final class WordComposer { newIndex, primaryCode, mIsFirstCharCapitalized); if (Character.isUpperCase(primaryCode)) mCapsCount++; if (Character.isDigit(primaryCode)) mDigitsCount++; - if (Constants.CODE_SINGLE_QUOTE == primaryCode) { - ++mTrailingSingleQuotesCount; - } else { - mTrailingSingleQuotesCount = 0; - } - mAutoCorrection = null; } private void processEvent(final Event event) { + final int primaryCode = event.mCodePoint; + final int keyX = event.mX; + final int keyY = event.mY; + final int newIndex = size(); mCombinerChain.processEvent(mEvents, event); mEvents.add(event); refreshTypedWordCache(); - } - - /** - * Delete the last composing unit as a result of hitting backspace. - */ - public void deleteLast(final Event event) { - processEvent(event); + mCursorPositionWithinWord = mCodePointSize; // We may have deleted the last one. - if (0 == size()) { + if (0 == mCodePointSize) { mIsFirstCharCapitalized = false; } - if (mTrailingSingleQuotesCount > 0) { - --mTrailingSingleQuotesCount; - } else { - int i = mTypedWordCache.length(); - while (i > 0) { - i = Character.offsetByCodePoints(mTypedWordCache, i, -1); - if (Constants.CODE_SINGLE_QUOTE != Character.codePointAt(mTypedWordCache, i)) { - break; + if (Constants.CODE_DELETE == event.mKeyCode) { + if (mTrailingSingleQuotesCount > 0) { + --mTrailingSingleQuotesCount; + } else { + // Delete, but we didn't end in a quote: must recompute mTrailingSingleQuotesCount + // We're only searching for single quotes, so no need to account for code points + for (int i = mTypedWordCache.length() - 1; i > 0; --i) { + if (Constants.CODE_SINGLE_QUOTE != mTypedWordCache.charAt(i)) { + break; + } + ++mTrailingSingleQuotesCount; } + } + } else { + if (Constants.CODE_SINGLE_QUOTE == primaryCode) { ++mTrailingSingleQuotesCount; + } else { + mTrailingSingleQuotesCount = 0; } } - mCursorPositionWithinWord = mCodePointSize; mAutoCorrection = null; } + /** + * Delete the last composing unit as a result of hitting backspace. + */ + public void deleteLast(final Event event) { + processEvent(event); + } + public void setCursorPositionWithinWord(final int posWithinWord) { mCursorPositionWithinWord = posWithinWord; // TODO: compute where that puts us inside the events diff --git a/java/src/com/android/inputmethod/latin/debug/ExternalDictionaryGetterForDebug.java b/java/src/com/android/inputmethod/latin/debug/ExternalDictionaryGetterForDebug.java index 800f56597..139e73aa4 100644 --- a/java/src/com/android/inputmethod/latin/debug/ExternalDictionaryGetterForDebug.java +++ b/java/src/com/android/inputmethod/latin/debug/ExternalDictionaryGetterForDebug.java @@ -28,6 +28,7 @@ import com.android.inputmethod.latin.BinaryDictionaryGetter; import com.android.inputmethod.latin.R; import com.android.inputmethod.latin.makedict.DictionaryHeader; import com.android.inputmethod.latin.utils.CollectionUtils; +import com.android.inputmethod.latin.utils.DialogUtils; import com.android.inputmethod.latin.utils.DictionaryInfoUtils; import com.android.inputmethod.latin.utils.LocaleUtils; @@ -70,7 +71,7 @@ public class ExternalDictionaryGetterForDebug { } private static void showNoFileDialog(final Context context) { - new AlertDialog.Builder(context) + new AlertDialog.Builder(DialogUtils.getPlatformDialogThemeContext(context)) .setMessage(R.string.read_external_dictionary_no_files_message) .setPositiveButton(android.R.string.ok, new OnClickListener() { @Override @@ -81,8 +82,8 @@ public class ExternalDictionaryGetterForDebug { } private static void showChooseFileDialog(final Context context, final String[] fileNames) { - final AlertDialog.Builder builder = new AlertDialog.Builder(context); - builder.setTitle(R.string.read_external_dictionary_multiple_files_title) + new AlertDialog.Builder(DialogUtils.getPlatformDialogThemeContext(context)) + .setTitle(R.string.read_external_dictionary_multiple_files_title) .setItems(fileNames, new OnClickListener() { @Override public void onClick(final DialogInterface dialog, final int which) { @@ -111,7 +112,7 @@ public class ExternalDictionaryGetterForDebug { final String title = String.format( context.getString(R.string.read_external_dictionary_confirm_install_message), languageName); - new AlertDialog.Builder(context) + new AlertDialog.Builder(DialogUtils.getPlatformDialogThemeContext(context)) .setTitle(title) .setMessage(message) .setNegativeButton(android.R.string.cancel, new OnClickListener() { @@ -167,7 +168,7 @@ public class ExternalDictionaryGetterForDebug { } } catch (IOException e) { // There was an error: show a dialog - new AlertDialog.Builder(context) + new AlertDialog.Builder(DialogUtils.getPlatformDialogThemeContext(context)) .setTitle(R.string.error) .setMessage(e.toString()) .setPositiveButton(android.R.string.ok, new OnClickListener() { diff --git a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java index c89be35ad..7ffc95697 100644 --- a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java +++ b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java @@ -537,7 +537,7 @@ public final class InputLogic { // after typing some letters and a period, then gesturing; the keyboard is not in // caps mode yet, but since a gesture is starting, it should go in caps mode, // unless the user explictly said it should not. - keyboardSwitcher.updateShiftState(); + keyboardSwitcher.requestUpdatingShiftState(); } } mConnection.endBatchEdit(); @@ -579,7 +579,7 @@ public final class InputLogic { promotePhantomSpace(settingsValues); mConnection.commitText(commitParts[0], 0); mSpaceState = SpaceState.PHANTOM; - keyboardSwitcher.updateShiftState(); + keyboardSwitcher.requestUpdatingShiftState(); mWordComposer.setCapitalizedModeAndPreviousWordAtStartComposingTime( getActualCapsMode(settingsValues, keyboardSwitcher.getKeyboardShiftMode()), commitParts[0]); @@ -823,13 +823,11 @@ public final class InputLogic { } if (Constants.CODE_SPACE == codePoint) { - if (inputTransaction.mSettingsValues.isSuggestionsRequested()) { - if (maybeDoubleSpacePeriod(inputTransaction)) { - inputTransaction.requireShiftUpdate(InputTransaction.SHIFT_UPDATE_NOW); - mSpaceState = SpaceState.DOUBLE; - } else if (!mSuggestedWords.isPunctuationSuggestions()) { - mSpaceState = SpaceState.WEAK; - } + if (maybeDoubleSpacePeriod(inputTransaction)) { + inputTransaction.requireShiftUpdate(InputTransaction.SHIFT_UPDATE_NOW); + mSpaceState = SpaceState.DOUBLE; + } else if (!mSuggestedWords.isPunctuationSuggestions()) { + mSpaceState = SpaceState.WEAK; } startDoubleSpacePeriodCountdown(inputTransaction); @@ -1821,7 +1819,7 @@ public final class InputLogic { } // Space state must be updated before calling updateShiftState mSpaceState = SpaceState.PHANTOM; - keyboardSwitcher.updateShiftState(); + keyboardSwitcher.requestUpdatingShiftState(); } /** diff --git a/java/src/com/android/inputmethod/latin/settings/AdditionalSubtypeSettings.java b/java/src/com/android/inputmethod/latin/settings/AdditionalSubtypeSettings.java index 6dae6206c..39977e76f 100644 --- a/java/src/com/android/inputmethod/latin/settings/AdditionalSubtypeSettings.java +++ b/java/src/com/android/inputmethod/latin/settings/AdditionalSubtypeSettings.java @@ -48,6 +48,7 @@ import com.android.inputmethod.latin.R; import com.android.inputmethod.latin.RichInputMethodManager; import com.android.inputmethod.latin.utils.AdditionalSubtypeUtils; import com.android.inputmethod.latin.utils.CollectionUtils; +import com.android.inputmethod.latin.utils.DialogUtils; import com.android.inputmethod.latin.utils.IntentUtils; import com.android.inputmethod.latin.utils.SubtypeLocaleUtils; @@ -517,7 +518,8 @@ public final class AdditionalSubtypeSettings extends PreferenceFragment { private AlertDialog createDialog( @SuppressWarnings("unused") final SubtypePreference subtypePref) { - final AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); + final AlertDialog.Builder builder = new AlertDialog.Builder( + DialogUtils.getPlatformDialogThemeContext(getActivity())); builder.setTitle(R.string.custom_input_styles_title) .setMessage(R.string.custom_input_style_note_message) .setNegativeButton(R.string.not_now, null) diff --git a/java/src/com/android/inputmethod/latin/utils/DialogUtils.java b/java/src/com/android/inputmethod/latin/utils/DialogUtils.java new file mode 100644 index 000000000..a05c932d0 --- /dev/null +++ b/java/src/com/android/inputmethod/latin/utils/DialogUtils.java @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2014 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.utils; + +import android.content.Context; +import android.view.ContextThemeWrapper; + +import com.android.inputmethod.latin.R; + +public final class DialogUtils { + private DialogUtils() { + // This utility class is not publicly instantiable. + } + + public static Context getPlatformDialogThemeContext(final Context context) { + // Because {@link AlertDialog.Builder.create()} doesn't honor the specified theme with + // createThemeContextWrapper=false, the result dialog box has unneeded paddings around it. + return new ContextThemeWrapper(context, R.style.platformDialogTheme); + } +} |