diff options
Diffstat (limited to 'java')
44 files changed, 1151 insertions, 436 deletions
diff --git a/java/AndroidManifest.xml b/java/AndroidManifest.xml index 23dbf7564..e229bc76a 100755 --- a/java/AndroidManifest.xml +++ b/java/AndroidManifest.xml @@ -1,6 +1,5 @@ <manifest xmlns:android="http://schemas.android.com/apk/res/android" - package="com.android.inputmethod.latin" - android:sharedUserId="android.uid.shared"> + package="com.android.inputmethod.latin"> <original-package android:name="com.android.inputmethod.latin" /> @@ -8,6 +7,7 @@ <uses-permission android:name="android.permission.READ_USER_DICTIONARY" /> <uses-permission android:name="android.permission.WRITE_USER_DICTIONARY" /> <uses-permission android:name="android.permission.RECORD_AUDIO" /> + <uses-permission android:name="android.permission.READ_CONTACTS" /> <application android:label="@string/english_ime_name" android:backupAgent="LatinIMEBackupAgent" diff --git a/java/MODULE_LICENSE_APACHE2 b/java/MODULE_LICENSE_APACHE2 new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/java/MODULE_LICENSE_APACHE2 diff --git a/java/NOTICE b/java/NOTICE new file mode 100644 index 000000000..7340b9e35 --- /dev/null +++ b/java/NOTICE @@ -0,0 +1,190 @@ + + Copyright (c) 2008, 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. + + 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. + + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + diff --git a/java/res/layout/input_trans.xml b/java/res/layout/input_trans.xml index a988bcc68..94806f7e3 100755 --- a/java/res/layout/input_trans.xml +++ b/java/res/layout/input_trans.xml @@ -25,5 +25,6 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:background="#A0000000" + android:verticalCorrection="0dip" android:keyBackground="@drawable/btn_keyboard_key_fulltrans" /> diff --git a/java/res/values-cs/strings.xml b/java/res/values-cs/strings.xml index 02361e1c1..7733d2139 100644 --- a/java/res/values-cs/strings.xml +++ b/java/res/values-cs/strings.xml @@ -1,18 +1,23 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Copyright (C) 2009 The Android Open Source Project +<!-- +/* +** +** Copyright 2008, 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. +*/ + --> - 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" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="english_ime_name" msgid="7252517407088836577">"Klávesnice Android"</string> @@ -124,4 +129,5 @@ <string name="language_selection_title" msgid="1651299598555326750">"Vstupní jazyky"</string> <string name="language_selection_summary" msgid="187110938289512256">"Jazyk můžete změnit posunutím prstu po mezerníku."</string> <string name="hint_add_to_dictionary" msgid="8058519710062071085">"← Uložte slovo opětovným klepnutím"</string> + <string name="has_dictionary" msgid="6071847973466625007">"K dispozici je slovník"</string> </resources> diff --git a/java/res/values-da/strings.xml b/java/res/values-da/strings.xml index 15f6b1c6b..a4dc2f22d 100644 --- a/java/res/values-da/strings.xml +++ b/java/res/values-da/strings.xml @@ -1,18 +1,23 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Copyright (C) 2009 The Android Open Source Project +<!-- +/* +** +** Copyright 2008, 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. +*/ + --> - 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" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="english_ime_name" msgid="7252517407088836577">"Android-tastatur"</string> @@ -58,7 +63,7 @@ <string name="alternates_for_c" msgid="151699780720639892">"ç"</string> <string name="alternates_for_y" msgid="1722776806607271199">"ýÿ"</string> <string name="tip_long_press" msgid="6101270866284343344">"Hold en tast nede for at se accenter (ø, ö osv.)"</string> - <string name="tip_dismiss" msgid="7585579046862204381">"Tryk på tilbagetasten ↶ for når som helst at lukke for tastaturet"</string> + <string name="tip_dismiss" msgid="7585579046862204381">"Tryk på knappen Tilbage ↶ for når som helst at lukke for tastaturet"</string> <string name="tip_access_symbols" msgid="6344098517525531652">"Få adgang til tal og symboler"</string> <string name="tip_add_to_dictionary" msgid="1487293888469227817">"Tryk og hold på ordet længst til venstre for at føje det til ordbogen"</string> <string name="touch_to_continue" msgid="7869803257948414531">"Berør dette tip for at fortsætte »"</string> @@ -124,4 +129,5 @@ <string name="language_selection_title" msgid="1651299598555326750">"Inputsprog"</string> <string name="language_selection_summary" msgid="187110938289512256">"Træk fingeren på mellemrumstasten for at skifte sprog"</string> <string name="hint_add_to_dictionary" msgid="8058519710062071085">"← Tast igen for at gemme"</string> + <string name="has_dictionary" msgid="6071847973466625007">"Ordbog er tilgængelig"</string> </resources> diff --git a/java/res/values-de/strings.xml b/java/res/values-de/strings.xml index e203fb394..f75bfc9d8 100644 --- a/java/res/values-de/strings.xml +++ b/java/res/values-de/strings.xml @@ -1,18 +1,23 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Copyright (C) 2009 The Android Open Source Project +<!-- +/* +** +** Copyright 2008, 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. +*/ + --> - 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" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="english_ime_name" msgid="7252517407088836577">"Android-Tastatur"</string> @@ -31,7 +36,7 @@ <string name="auto_complete_dialog_title" msgid="2172048590607201920">"Autom. vervollständigen"</string> <string name="prediction_landscape" msgid="4874601565593216183">"Textfeld vergrößern"</string> <string name="prediction_landscape_summary" msgid="6736551095997839472">"Wortvorschläge in Querformat ausblenden"</string> - <string name="auto_cap" msgid="1719746674854628252">"Autom. Groß-/Kleinschreibung"</string> + <string name="auto_cap" msgid="1719746674854628252">"Autom. Groß-/Kleinschr."</string> <string name="auto_cap_summary" msgid="3260681697600786825">"Sätze mit Großbuchstaben beginnen"</string> <string name="auto_punctuate" msgid="7276672334264521751">"Autom. Zeichensetzung"</string> <!-- no translation found for auto_punctuate_summary (6589441565817502132) --> @@ -43,7 +48,7 @@ <string name="auto_complete" msgid="1103196318775486023">"Autom. vervollständigen"</string> <string name="auto_complete_summary" msgid="6113149638718274624">"Leertaste und Interpunktion fügen autom. ein markiertes Wort ein"</string> <string-array name="prediction_modes"> - <item msgid="4870266572388153286">"Keine"</item> + <item msgid="4870266572388153286">"Kein"</item> <item msgid="1669461741568287396">"Standard"</item> <item msgid="4894328801530136615">"Erweitert"</item> </string-array> @@ -124,4 +129,5 @@ <string name="language_selection_title" msgid="1651299598555326750">"Eingabesprachen"</string> <string name="language_selection_summary" msgid="187110938289512256">"Finger über die Leertaste bewegen, um die Sprache zu ändern"</string> <string name="hint_add_to_dictionary" msgid="8058519710062071085">"← Zum Speichern erneut tippen"</string> + <string name="has_dictionary" msgid="6071847973466625007">"Wörterbuch verfügbar"</string> </resources> diff --git a/java/res/values-el/strings.xml b/java/res/values-el/strings.xml index 85c18dff4..c41617ffa 100644 --- a/java/res/values-el/strings.xml +++ b/java/res/values-el/strings.xml @@ -1,18 +1,23 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Copyright (C) 2009 The Android Open Source Project +<!-- +/* +** +** Copyright 2008, 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. +*/ + --> - 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" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="english_ime_name" msgid="7252517407088836577">"Πληκτρολόγιο Android"</string> @@ -124,4 +129,5 @@ <string name="language_selection_title" msgid="1651299598555326750">"Γλώσσες εισόδου"</string> <string name="language_selection_summary" msgid="187110938289512256">"Σύρετε το δάχτυλο στο πλήκτρο διαστήματος για να αλλάξετε γλώσσα"</string> <string name="hint_add_to_dictionary" msgid="8058519710062071085">"← Πατήστε ξανά για αποθήκευση"</string> + <string name="has_dictionary" msgid="6071847973466625007">"Λεξικό διαθέσιμο"</string> </resources> diff --git a/java/res/values-es-rUS/strings.xml b/java/res/values-es-rUS/strings.xml index 541e153b3..6c43e4cc4 100644 --- a/java/res/values-es-rUS/strings.xml +++ b/java/res/values-es-rUS/strings.xml @@ -1,18 +1,23 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Copyright (C) 2009 The Android Open Source Project +<!-- +/* +** +** Copyright 2008, 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. +*/ + --> - 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" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="english_ime_name" msgid="7252517407088836577">"Teclado de Android"</string> @@ -67,7 +72,7 @@ <string name="tip_to_view_accents" msgid="5433158573693308501"><b>"Toca y mantén presionada una tecla para ver los acentos"\n"(ø, ö, ô, ó, y así sucesivamente)."</b></string> <string name="tip_to_open_symbols" msgid="7345139325622444880"><b>"Cambia de números a símbolos tocando esta tecla."</b></string> <string name="tip_to_close_symbols" msgid="5227724217206927185"><b>"Vuelve a letras tocando esta tecla nuevamente."</b></string> - <string name="tip_to_launch_settings" msgid="8402961128983196128"><b>"Toca &amp y mantén presionada esta tecla para cambiar la configuración del teclado, como completar automáticamente."</b></string> + <string name="tip_to_launch_settings" msgid="8402961128983196128"><b>"Toca y mantén presionada esta tecla para cambiar la configuración del teclado, como completar automáticamente."</b></string> <string name="tip_to_start_typing" msgid="7213843601369174313"><b>"¡Pruébalo!"</b></string> <string name="label_go_key" msgid="1635148082137219148">"Ir"</string> <string name="label_next_key" msgid="362972844525672568">"Siguiente"</string> @@ -113,7 +118,7 @@ <string name="auto_submit_summary" msgid="4961875269610384226">"Presionar automáticamente Ingresar al buscar o ir al campo siguiente."</string> <string name="open_the_keyboard" msgid="2215920976029260466"><font size="17"><b>"Abrir el teclado"\n</b></font><font size="3">\n</font>"Tocar cualquier campo de texto."</string> <string name="close_the_keyboard" msgid="6251022259044940103"><font size="17"><b>"Cerrar el teclado"\n</b></font><font size="3">\n</font>"Presionar la tecla Atrás."</string> - <string name="touch_and_hold" msgid="6154166367273010534"><font size="17"><b>"Tocar & y mantener presionada una tecla para las opciones"\n</b></font><font size="3">\n</font>"Acceder a puntuación y acentos."</string> + <string name="touch_and_hold" msgid="6154166367273010534"><font size="17"><b>"Tocar y mantener presionada una tecla para las opciones"\n</b></font><font size="3">\n</font>"Acceder a puntuación y acentos."</string> <string name="keyboard_settings" msgid="4585753477617374032"><font size="17"><b>"Configuración del teclado"\n</b></font><font size="3">\n</font>"Tocar & y mantener presionada la tecla "<b>"?123"</b>"."</string> <string name="popular_domain_0" msgid="3745279225122472969">".com"</string> <string name="popular_domain_1" msgid="1370572248164278467">".net"</string> @@ -124,4 +129,5 @@ <string name="language_selection_title" msgid="1651299598555326750">"Idiomas de entrada"</string> <string name="language_selection_summary" msgid="187110938289512256">"Deslizarse manualmente por la barra espaciadora para cambiar el idioma"</string> <string name="hint_add_to_dictionary" msgid="8058519710062071085">"← Presionar nuevamente para guardar"</string> + <string name="has_dictionary" msgid="6071847973466625007">"Diccionario disponible"</string> </resources> diff --git a/java/res/values-es/strings.xml b/java/res/values-es/strings.xml index fbc597ed2..d3d794421 100644 --- a/java/res/values-es/strings.xml +++ b/java/res/values-es/strings.xml @@ -1,18 +1,23 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Copyright (C) 2009 The Android Open Source Project +<!-- +/* +** +** Copyright 2008, 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. +*/ + --> - 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" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="english_ime_name" msgid="7252517407088836577">"Teclado de Android"</string> @@ -121,7 +126,8 @@ <string name="popular_domain_3" msgid="8718639560809452028">".gov"</string> <string name="popular_domain_4" msgid="35359437471311470">".edu"</string> <string name="inputMethod" msgid="7854532062009028116">"Método de introducción de texto"</string> - <string name="language_selection_title" msgid="1651299598555326750">"Idiomas de entrada"</string> + <string name="language_selection_title" msgid="1651299598555326750">"Idiomas"</string> <string name="language_selection_summary" msgid="187110938289512256">"Deslizar el dedo por la barra espaciadora para cambiar el idioma"</string> <string name="hint_add_to_dictionary" msgid="8058519710062071085">"← Volver a tocar para guardar"</string> + <string name="has_dictionary" msgid="6071847973466625007">"Hay un diccionario disponible."</string> </resources> diff --git a/java/res/values-fr/strings.xml b/java/res/values-fr/strings.xml index 085941415..2f449c488 100644 --- a/java/res/values-fr/strings.xml +++ b/java/res/values-fr/strings.xml @@ -1,18 +1,23 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Copyright (C) 2009 The Android Open Source Project +<!-- +/* +** +** Copyright 2008, 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. +*/ + --> - 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" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="english_ime_name" msgid="7252517407088836577">"Clavier Android"</string> @@ -124,4 +129,5 @@ <string name="language_selection_title" msgid="1651299598555326750">"Langues de saisie"</string> <string name="language_selection_summary" msgid="187110938289512256">"Faites glisser votre doigt sur la barre d\'espacement pour changer la langue."</string> <string name="hint_add_to_dictionary" msgid="8058519710062071085">"← Appuyer de nouveau pour enregistrer"</string> + <string name="has_dictionary" msgid="6071847973466625007">"Dictionnaire disponible"</string> </resources> diff --git a/java/res/values-it/strings.xml b/java/res/values-it/strings.xml index 1135dd00a..96619269c 100644 --- a/java/res/values-it/strings.xml +++ b/java/res/values-it/strings.xml @@ -1,24 +1,29 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Copyright (C) 2009 The Android Open Source Project +<!-- +/* +** +** Copyright 2008, 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. +*/ + --> - 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" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="english_ime_name" msgid="7252517407088836577">"Tastiera Android"</string> <string name="english_ime_settings" msgid="6661589557206947774">"Impostazioni tastiera Android"</string> - <string name="vibrate_on_keypress" msgid="5258079494276955460">"Vibra se premi un tasto"</string> - <string name="sound_on_keypress" msgid="6093592297198243644">"Suona se premi un tasto"</string> + <string name="vibrate_on_keypress" msgid="5258079494276955460">"Vibra alla pressione di un tasto"</string> + <string name="sound_on_keypress" msgid="6093592297198243644">"Suona alla pressione di un tasto"</string> <string name="hit_correction" msgid="4855351009261318389">"Correggi errori di digitazione"</string> <string name="hit_correction_summary" msgid="8761701873008070796">"Attiva la correzione degli errori di inserimento"</string> <string name="hit_correction_land" msgid="2567691684825205448">"Errori di inserimento in visualizzazione orizzontale"</string> @@ -124,4 +129,5 @@ <string name="language_selection_title" msgid="1651299598555326750">"Lingue comandi"</string> <string name="language_selection_summary" msgid="187110938289512256">"Scorri il dito sulla barra spaziatrice per cambiare la lingua"</string> <string name="hint_add_to_dictionary" msgid="8058519710062071085">"← Tocca di nuovo per salvare"</string> + <string name="has_dictionary" msgid="6071847973466625007">"Dizionario disponibile"</string> </resources> diff --git a/java/res/values-ja/strings.xml b/java/res/values-ja/strings.xml index 9097bd936..7867684cb 100644 --- a/java/res/values-ja/strings.xml +++ b/java/res/values-ja/strings.xml @@ -1,18 +1,23 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Copyright (C) 2009 The Android Open Source Project +<!-- +/* +** +** Copyright 2008, 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. +*/ + --> - 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" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="english_ime_name" msgid="7252517407088836577">"Androidキーボード"</string> @@ -124,4 +129,5 @@ <string name="language_selection_title" msgid="1651299598555326750">"入力言語"</string> <string name="language_selection_summary" msgid="187110938289512256">"スペースバーで指をスライドさせて言語を変更する"</string> <string name="hint_add_to_dictionary" msgid="8058519710062071085">"←保存するにはもう一度タップ"</string> + <string name="has_dictionary" msgid="6071847973466625007">"辞書を利用できます"</string> </resources> diff --git a/java/res/values-ko/strings.xml b/java/res/values-ko/strings.xml index 15000e655..4cc0933be 100644 --- a/java/res/values-ko/strings.xml +++ b/java/res/values-ko/strings.xml @@ -1,18 +1,23 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Copyright (C) 2009 The Android Open Source Project +<!-- +/* +** +** Copyright 2008, 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. +*/ + --> - 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" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="english_ime_name" msgid="7252517407088836577">"Android 키보드"</string> @@ -124,4 +129,5 @@ <string name="language_selection_title" msgid="1651299598555326750">"입력 언어"</string> <string name="language_selection_summary" msgid="187110938289512256">"손가락을 스페이스바에서 미끄러지듯 움직여 언어 변경"</string> <string name="hint_add_to_dictionary" msgid="8058519710062071085">"← 저장하려면 다시 누르세요."</string> + <string name="has_dictionary" msgid="6071847973466625007">"사전 사용 가능"</string> </resources> diff --git a/java/res/values-nb/strings.xml b/java/res/values-nb/strings.xml index a7ddc7533..041d07eb3 100644 --- a/java/res/values-nb/strings.xml +++ b/java/res/values-nb/strings.xml @@ -1,18 +1,23 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Copyright (C) 2009 The Android Open Source Project +<!-- +/* +** +** Copyright 2008, 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. +*/ + --> - 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" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="english_ime_name" msgid="7252517407088836577">"Skjermtastatur"</string> @@ -40,7 +45,7 @@ <string name="quick_fixes_summary" msgid="3405028402510332373">"Retter vanlige stavefeil"</string> <string name="show_suggestions" msgid="507074425254289133">"Vis forslag"</string> <string name="show_suggestions_summary" msgid="1989672863935759654">"Vis foreslåtte ord under skriving"</string> - <string name="auto_complete" msgid="1103196318775486023">"Autokomplettering"</string> + <string name="auto_complete" msgid="1103196318775486023">"Autofullføring"</string> <string name="auto_complete_summary" msgid="6113149638718274624">"Mellomrom og punktum setter automatisk inn valgt ord"</string> <string-array name="prediction_modes"> <item msgid="4870266572388153286">"Ingen"</item> @@ -105,8 +110,8 @@ <item msgid="7283103513488381103">"Av"</item> </string-array> <string-array name="voice_input_modes_summary"> - <item msgid="554248625705084903">"Mikronfon på hovedtastatur"</item> - <item msgid="6907837061058876770">"Mikronfon på talltastatur"</item> + <item msgid="554248625705084903">"Mikrofon på hovedtastatur"</item> + <item msgid="6907837061058876770">"Mikrofon på talltastatur"</item> <item msgid="3664304608587798036">"Talekommando er deaktivert"</item> </string-array> <string name="auto_submit" msgid="9151008027068358518">"Send inn automatisk etter tale"</string> @@ -124,4 +129,5 @@ <string name="language_selection_title" msgid="1651299598555326750">"Inndataspråk"</string> <string name="language_selection_summary" msgid="187110938289512256">"Dra fingeren på mellomromstasten for å endre språk"</string> <string name="hint_add_to_dictionary" msgid="8058519710062071085">"← Trykk på nytt for å lagre"</string> + <string name="has_dictionary" msgid="6071847973466625007">"Ordbok tilgjengelig"</string> </resources> diff --git a/java/res/values-nl/strings.xml b/java/res/values-nl/strings.xml index 9a69c128e..a88836d9c 100644 --- a/java/res/values-nl/strings.xml +++ b/java/res/values-nl/strings.xml @@ -1,18 +1,23 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Copyright (C) 2009 The Android Open Source Project +<!-- +/* +** +** Copyright 2008, 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. +*/ + --> - 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" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="english_ime_name" msgid="7252517407088836577">"Android-toetsenbord"</string> @@ -124,4 +129,5 @@ <string name="language_selection_title" msgid="1651299598555326750">"Invoertalen"</string> <string name="language_selection_summary" msgid="187110938289512256">"Schuif uw vinger over de spatiebalk om de taal te wijzigen"</string> <string name="hint_add_to_dictionary" msgid="8058519710062071085">"← Tik nogmaals om op te slaan"</string> + <string name="has_dictionary" msgid="6071847973466625007">"Woordenboek beschikbaar"</string> </resources> diff --git a/java/res/values-pl/strings.xml b/java/res/values-pl/strings.xml index a411cc213..6db80456f 100644 --- a/java/res/values-pl/strings.xml +++ b/java/res/values-pl/strings.xml @@ -1,18 +1,23 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Copyright (C) 2009 The Android Open Source Project +<!-- +/* +** +** Copyright 2008, 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. +*/ + --> - 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" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="english_ime_name" msgid="7252517407088836577">"Klawiatura Android"</string> @@ -124,4 +129,5 @@ <string name="language_selection_title" msgid="1651299598555326750">"Języki wprowadzania"</string> <string name="language_selection_summary" msgid="187110938289512256">"Przesuń palcem po spacji, aby zmienić język"</string> <string name="hint_add_to_dictionary" msgid="8058519710062071085">"← Dotknij ponownie, aby zapisać"</string> + <string name="has_dictionary" msgid="6071847973466625007">"Słownik dostępny"</string> </resources> diff --git a/java/res/values-pt-rPT/strings.xml b/java/res/values-pt-rPT/strings.xml index 399975d88..3b6fc3165 100644 --- a/java/res/values-pt-rPT/strings.xml +++ b/java/res/values-pt-rPT/strings.xml @@ -1,18 +1,23 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Copyright (C) 2009 The Android Open Source Project +<!-- +/* +** +** Copyright 2008, 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. +*/ + --> - 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" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="english_ime_name" msgid="7252517407088836577">"Teclado do Android"</string> @@ -31,7 +36,7 @@ <string name="auto_complete_dialog_title" msgid="2172048590607201920">"Conclusão automática"</string> <string name="prediction_landscape" msgid="4874601565593216183">"Aumentar o tamanho do campo de texto"</string> <string name="prediction_landscape_summary" msgid="6736551095997839472">"Ocultar sugestões de palavras na vista horizontal"</string> - <string name="auto_cap" msgid="1719746674854628252">"Maiúsculas automáticas"</string> + <string name="auto_cap" msgid="1719746674854628252">"Letras maiúsculas automáticas"</string> <string name="auto_cap_summary" msgid="3260681697600786825">"Colocar inicial maiúscula no início de uma frase"</string> <string name="auto_punctuate" msgid="7276672334264521751">"Pontuação automática"</string> <!-- no translation found for auto_punctuate_summary (6589441565817502132) --> @@ -39,7 +44,7 @@ <string name="quick_fixes" msgid="5353213327680897927">"Correcções rápidas"</string> <string name="quick_fixes_summary" msgid="3405028402510332373">"Corrige os erros de escrita comuns"</string> <string name="show_suggestions" msgid="507074425254289133">"Mostrar sugestões"</string> - <string name="show_suggestions_summary" msgid="1989672863935759654">"Apresentar palavras sugeridas durante a escrita"</string> + <string name="show_suggestions_summary" msgid="1989672863935759654">"Apresentar sugestões de palavras ao escrever"</string> <string name="auto_complete" msgid="1103196318775486023">"Conclusão automática"</string> <string name="auto_complete_summary" msgid="6113149638718274624">"A barra de espaços e a pontuação inserem automaticamente uma palavra realçada"</string> <string-array name="prediction_modes"> @@ -124,4 +129,5 @@ <string name="language_selection_title" msgid="1651299598555326750">"Idiomas de entrada"</string> <string name="language_selection_summary" msgid="187110938289512256">"Deslize o dedo pela barra de espaço para alterar o idioma"</string> <string name="hint_add_to_dictionary" msgid="8058519710062071085">"← Toque novamente para guardar"</string> + <string name="has_dictionary" msgid="6071847973466625007">"Dicionário disponível"</string> </resources> diff --git a/java/res/values-pt/strings.xml b/java/res/values-pt/strings.xml index 18ffdf011..0d7fbf357 100644 --- a/java/res/values-pt/strings.xml +++ b/java/res/values-pt/strings.xml @@ -1,18 +1,23 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Copyright (C) 2009 The Android Open Source Project +<!-- +/* +** +** Copyright 2008, 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. +*/ + --> - 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" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="english_ime_name" msgid="7252517407088836577">"Teclado Android"</string> @@ -124,4 +129,5 @@ <string name="language_selection_title" msgid="1651299598555326750">"Idiomas de entrada"</string> <string name="language_selection_summary" msgid="187110938289512256">"Deslize o dedo na barra de espaços para alterar o idioma"</string> <string name="hint_add_to_dictionary" msgid="8058519710062071085">"← Toque novamente para salvar"</string> + <string name="has_dictionary" msgid="6071847973466625007">"Dicionário disponível"</string> </resources> diff --git a/java/res/values-ru/strings.xml b/java/res/values-ru/strings.xml index d4ebc6d60..8a60c2844 100644 --- a/java/res/values-ru/strings.xml +++ b/java/res/values-ru/strings.xml @@ -1,18 +1,23 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Copyright (C) 2009 The Android Open Source Project +<!-- +/* +** +** Copyright 2008, 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. +*/ + --> - 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" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="english_ime_name" msgid="7252517407088836577">"Клавиатура Android"</string> @@ -124,4 +129,5 @@ <string name="language_selection_title" msgid="1651299598555326750">"Языки ввода"</string> <string name="language_selection_summary" msgid="187110938289512256">"Для изменения языка проведите пальцем по пробелу"</string> <string name="hint_add_to_dictionary" msgid="8058519710062071085">"← Нажмите повторно, чтобы сохранить"</string> + <string name="has_dictionary" msgid="6071847973466625007">"Доступен словарь"</string> </resources> diff --git a/java/res/values-sv/donottranslate.xml b/java/res/values-sv/donottranslate.xml deleted file mode 100644 index 7f6f357d6..000000000 --- a/java/res/values-sv/donottranslate.xml +++ /dev/null @@ -1,29 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- -/* -** -** Copyright 2009, 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:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="alternates_for_d">ðď</string> - <string name="alternates_for_l">ł</string> - <string name="alternates_for_r">ř</string> - <string name="alternates_for_t">ťþ</string> - <string name="alternates_for_v">w</string> - <string name="alternates_for_z">źžż</string> - <string name="alternates_for_ae">æ</string> - <string name="alternates_for_oe">øœ</string> -</resources> diff --git a/java/res/values-sv/strings.xml b/java/res/values-sv/strings.xml index 2d07a076a..7a467b576 100644 --- a/java/res/values-sv/strings.xml +++ b/java/res/values-sv/strings.xml @@ -1,18 +1,23 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Copyright (C) 2009 The Android Open Source Project +<!-- +/* +** +** Copyright 2008, 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. +*/ + --> - 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" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="english_ime_name" msgid="7252517407088836577">"Androids tangentbord"</string> @@ -124,4 +129,5 @@ <string name="language_selection_title" msgid="1651299598555326750">"Inmatningsspråk"</string> <string name="language_selection_summary" msgid="187110938289512256">"Dra med fingret på blanksteg om du vill ändra språk"</string> <string name="hint_add_to_dictionary" msgid="8058519710062071085">"← Peka igen för att spara"</string> + <string name="has_dictionary" msgid="6071847973466625007">"En ordlista är tillgänglig"</string> </resources> diff --git a/java/res/values-tr/strings.xml b/java/res/values-tr/strings.xml index e150a5ee7..0fbdc7da3 100644 --- a/java/res/values-tr/strings.xml +++ b/java/res/values-tr/strings.xml @@ -1,18 +1,23 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Copyright (C) 2009 The Android Open Source Project +<!-- +/* +** +** Copyright 2008, 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. +*/ + --> - 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" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="english_ime_name" msgid="7252517407088836577">"Android klavyesi"</string> @@ -124,4 +129,5 @@ <string name="language_selection_title" msgid="1651299598555326750">"Giriş dilleri"</string> <string name="language_selection_summary" msgid="187110938289512256">"Dili değiştirmek için parmağınızı boşluk çubuğu üzerinde kaydırın"</string> <string name="hint_add_to_dictionary" msgid="8058519710062071085">"← Kaydetmek için tekrar dokunun"</string> + <string name="has_dictionary" msgid="6071847973466625007">"Sözlük kullanılabilir"</string> </resources> diff --git a/java/res/values-zh-rCN/strings.xml b/java/res/values-zh-rCN/strings.xml index f3729914b..3fe189621 100644 --- a/java/res/values-zh-rCN/strings.xml +++ b/java/res/values-zh-rCN/strings.xml @@ -1,18 +1,23 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Copyright (C) 2009 The Android Open Source Project +<!-- +/* +** +** Copyright 2008, 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. +*/ + --> - 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" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="english_ime_name" msgid="7252517407088836577">"Android 键盘"</string> @@ -124,4 +129,5 @@ <string name="language_selection_title" msgid="1651299598555326750">"输入语言"</string> <string name="language_selection_summary" msgid="187110938289512256">"在空格键上滑动手指可更改语言"</string> <string name="hint_add_to_dictionary" msgid="8058519710062071085">"← 再次点按即可保存"</string> + <string name="has_dictionary" msgid="6071847973466625007">"提供字典"</string> </resources> diff --git a/java/res/values-zh-rTW/strings.xml b/java/res/values-zh-rTW/strings.xml index f6b4e312f..683078eef 100644 --- a/java/res/values-zh-rTW/strings.xml +++ b/java/res/values-zh-rTW/strings.xml @@ -1,18 +1,23 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Copyright (C) 2009 The Android Open Source Project +<!-- +/* +** +** Copyright 2008, 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. +*/ + --> - 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" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="english_ime_name" msgid="7252517407088836577">"Android 鍵盤"</string> @@ -124,6 +129,5 @@ <string name="language_selection_title" msgid="1651299598555326750">"輸入語言"</string> <string name="language_selection_summary" msgid="187110938289512256">"以手指在空白鍵上滑動可變更語言"</string> <string name="hint_add_to_dictionary" msgid="8058519710062071085">"← 再次輕按可儲存"</string> - <!-- no translation found for has_dictionary (6071847973466625007) --> - <skip /> + <string name="has_dictionary" msgid="6071847973466625007">"可使用字典"</string> </resources> diff --git a/java/res/xml-sv/kbd_qwerty.xml b/java/res/xml-sv/kbd_qwerty.xml index b98f6135a..54d7d68a9 100644 --- a/java/res/xml-sv/kbd_qwerty.xml +++ b/java/res/xml-sv/kbd_qwerty.xml @@ -19,9 +19,10 @@ --> <!-- - Swedish Keyboard Layout. - Key placement according to Svensk standard SS 66 22 41. - Foreign letters according to Svenska skrivregler (2:a uppl.) §302. + Swedish Keyboard Layout + + Key positioning: Svensk standard SS 66 22 41 + Foreign letters: Svenska skrivregler (2:a uppl.) §302 Local additions: €ß --> @@ -38,40 +39,41 @@ <Key android:codes="119" android:keyLabel="w"/> <Key android:codes="101" android:keyLabel="e" android:popupKeyboard="@xml/kbd_popup_template" - android:popupCharacters="@string/alternates_for_e"/> + android:popupCharacters="éèêëę€"/> <Key android:codes="114" android:keyLabel="r" android:popupKeyboard="@xml/kbd_popup_template" - android:popupCharacters="@string/alternates_for_r"/> + android:popupCharacters="ř"/> <Key android:codes="116" android:keyLabel="t" android:popupKeyboard="@xml/kbd_popup_template" - android:popupCharacters="@string/alternates_for_t"/> + android:popupCharacters="ťþ"/> <Key android:codes="121" android:keyLabel="y" android:popupKeyboard="@xml/kbd_popup_template" - android:popupCharacters="@string/alternates_for_y"/> + android:popupCharacters="ýÿü"/> <Key android:codes="117" android:keyLabel="u" android:popupKeyboard="@xml/kbd_popup_template" - android:popupCharacters="@string/alternates_for_u"/> + android:popupCharacters="úùûū"/> <Key android:codes="105" android:keyLabel="i" android:popupKeyboard="@xml/kbd_popup_template" - android:popupCharacters="@string/alternates_for_i"/> + android:popupCharacters="íìîï"/> <Key android:codes="111" android:keyLabel="o" android:popupKeyboard="@xml/kbd_popup_template" - android:popupCharacters="@string/alternates_for_o"/> + android:popupCharacters="óòôõ"/> <Key android:codes="112" android:keyLabel="p"/> - <Key android:keyLabel="å" android:keyWidth="8.75%p" android:keyEdgeFlags="right"/> + <Key android:keyLabel="å" + android:keyWidth="8.75%p" android:keyEdgeFlags="right"/> </Row> <Row> - <Key android:codes="97" android:keyLabel="a" android:keyWidth="8.75%p" + <Key android:codes="97" android:keyLabel="a" android:popupKeyboard="@xml/kbd_popup_template" - android:popupCharacters="@string/alternates_for_a" - android:keyEdgeFlags="left"/> + android:popupCharacters="áàâąã" + android:keyWidth="8.75%p" android:keyEdgeFlags="left"/> <Key android:codes="115" android:keyLabel="s" android:popupKeyboard="@xml/kbd_popup_template" - android:popupCharacters="@string/alternates_for_s"/> + android:popupCharacters="śšşß"/> <Key android:codes="100" android:keyLabel="d" android:popupKeyboard="@xml/kbd_popup_template" - android:popupCharacters="@string/alternates_for_d"/> + android:popupCharacters="ðď"/> <Key android:codes="102" android:keyLabel="f"/> <Key android:codes="103" android:keyLabel="g"/> <Key android:codes="104" android:keyLabel="h"/> @@ -79,13 +81,14 @@ <Key android:codes="107" android:keyLabel="k"/> <Key android:codes="108" android:keyLabel="l" android:popupKeyboard="@xml/kbd_popup_template" - android:popupCharacters="@string/alternates_for_l"/> + android:popupCharacters="ł"/> <Key android:keyLabel="ö" android:popupKeyboard="@xml/kbd_popup_template" - android:popupCharacters="@string/alternates_for_oe"/> - <Key android:keyLabel="ä" android:keyEdgeFlags="right" android:keyWidth="8.75%p" + android:popupCharacters="øœ"/> + <Key android:keyLabel="ä" android:popupKeyboard="@xml/kbd_popup_template" - android:popupCharacters="@string/alternates_for_ae"/> + android:popupCharacters="æ" + android:keyWidth="8.75%p" android:keyEdgeFlags="right"/> </Row> <Row android:keyWidth="10%p"> @@ -95,18 +98,18 @@ android:isSticky="true" android:keyEdgeFlags="left"/> <Key android:codes="122" android:keyLabel="z" android:popupKeyboard="@xml/kbd_popup_template" - android:popupCharacters="@string/alternates_for_z"/> + android:popupCharacters="źžż"/> <Key android:codes="120" android:keyLabel="x"/> <Key android:codes="99" android:keyLabel="c" android:popupKeyboard="@xml/kbd_popup_template" - android:popupCharacters="@string/alternates_for_c"/> + android:popupCharacters="çćč"/> <Key android:codes="118" android:keyLabel="v" android:popupKeyboard="@xml/kbd_popup_template" - android:popupCharacters="@string/alternates_for_v"/> + android:popupCharacters="w"/> <Key android:codes="98" android:keyLabel="b"/> <Key android:codes="110" android:keyLabel="n" android:popupKeyboard="@xml/kbd_popup_template" - android:popupCharacters="@string/alternates_for_n"/> + android:popupCharacters="ńñň"/> <Key android:codes="109" android:keyLabel="m"/> <Key android:codes="-5" android:keyIcon="@drawable/sym_keyboard_delete" android:keyWidth="15%p" android:keyEdgeFlags="right" diff --git a/java/src/com/android/inputmethod/latin/AutoDictionary.java b/java/src/com/android/inputmethod/latin/AutoDictionary.java index da9dd6eb9..93f1985ca 100644 --- a/java/src/com/android/inputmethod/latin/AutoDictionary.java +++ b/java/src/com/android/inputmethod/latin/AutoDictionary.java @@ -17,6 +17,8 @@ package com.android.inputmethod.latin; import java.util.HashMap; +import java.util.Set; +import java.util.Map.Entry; import android.content.ContentValues; import android.content.Context; @@ -24,8 +26,8 @@ import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; import android.database.sqlite.SQLiteQueryBuilder; +import android.os.AsyncTask; import android.provider.BaseColumns; -import android.provider.UserDictionary.Words; import android.util.Log; /** @@ -51,6 +53,9 @@ public class AutoDictionary extends ExpandableDictionary { // Locale for which this auto dictionary is storing words private String mLocale; + private HashMap<String,Integer> mPendingWrites = new HashMap<String,Integer>(); + private final Object mPendingWritesLock = new Object(); + private static final String DATABASE_NAME = "auto_dict.db"; private static final int DATABASE_VERSION = 1; @@ -78,13 +83,15 @@ public class AutoDictionary extends ExpandableDictionary { sDictProjectionMap.put(COLUMN_LOCALE, COLUMN_LOCALE); } - private DatabaseHelper mOpenHelper; + private static DatabaseHelper mOpenHelper = null; public AutoDictionary(Context context, LatinIME ime, String locale) { super(context); mIme = ime; mLocale = locale; - mOpenHelper = new DatabaseHelper(getContext()); + if (mOpenHelper == null) { + mOpenHelper = new DatabaseHelper(getContext()); + } if (mLocale != null && mLocale.length() > 1) { loadDictionary(); } @@ -98,7 +105,11 @@ public class AutoDictionary extends ExpandableDictionary { @Override public void close() { - mOpenHelper.close(); + flushPendingWrites(); + // Don't close the database as locale changes will require it to be reopened anyway + // Also, the database is written to somewhat frequently, so it needs to be kept alive + // throughout the life of the process. + // mOpenHelper.close(); super.close(); } @@ -106,21 +117,24 @@ public class AutoDictionary extends ExpandableDictionary { public void loadDictionaryAsync() { // Load the words that correspond to the current input locale Cursor cursor = query(COLUMN_LOCALE + "=?", new String[] { mLocale }); - if (cursor.moveToFirst()) { - int wordIndex = cursor.getColumnIndex(COLUMN_WORD); - int frequencyIndex = cursor.getColumnIndex(COLUMN_FREQUENCY); - while (!cursor.isAfterLast()) { - String word = cursor.getString(wordIndex); - int frequency = cursor.getInt(frequencyIndex); - // Safeguard against adding really long words. Stack may overflow due - // to recursive lookup - if (word.length() < getMaxWordLength()) { - super.addWord(word, frequency); + try { + if (cursor.moveToFirst()) { + int wordIndex = cursor.getColumnIndex(COLUMN_WORD); + int frequencyIndex = cursor.getColumnIndex(COLUMN_FREQUENCY); + while (!cursor.isAfterLast()) { + String word = cursor.getString(wordIndex); + int frequency = cursor.getInt(frequencyIndex); + // Safeguard against adding really long words. Stack may overflow due + // to recursive lookup + if (word.length() < getMaxWordLength()) { + super.addWord(word, frequency); + } + cursor.moveToNext(); } - cursor.moveToNext(); } + } finally { + cursor.close(); } - cursor.close(); } @Override @@ -135,14 +149,29 @@ public class AutoDictionary extends ExpandableDictionary { int freq = getWordFrequency(word); freq = freq < 0 ? addFrequency : freq + addFrequency; super.addWord(word, freq); + if (freq >= PROMOTION_THRESHOLD) { mIme.promoteToUserDictionary(word, FREQUENCY_FOR_AUTO_ADD); - // Delete the word (for input locale) from the auto dictionary db, as it - // is now in the user dictionary provider. - delete(COLUMN_WORD + "=? AND " + COLUMN_LOCALE + "=?", - new String[] { word, mLocale }); - } else { - update(word, freq, mLocale); + freq = 0; + } + + synchronized (mPendingWritesLock) { + // Write a null frequency if it is to be deleted from the db + mPendingWrites.put(word, freq == 0 ? null : new Integer(freq)); + } + } + + /** + * Schedules a background thread to write any pending words to the database. + */ + public void flushPendingWrites() { + synchronized (mPendingWritesLock) { + // Nothing pending? Return + if (mPendingWrites.isEmpty()) return; + // Create a background thread to write the pending entries + new UpdateDbTask(getContext(), mOpenHelper, mPendingWrites, mLocale).execute(); + // Create a new map for writing new entries into while the old one is written to db + mPendingWrites = new HashMap<String, Integer>(); } } @@ -186,26 +215,45 @@ public class AutoDictionary extends ExpandableDictionary { return c; } - private int delete(String where, String[] whereArgs) { - SQLiteDatabase db = mOpenHelper.getWritableDatabase(); - int count = db.delete(AUTODICT_TABLE_NAME, where, whereArgs); - return count; - } + /** + * Async task to write pending words to the database so that it stays in sync with + * the in-memory trie. + */ + private static class UpdateDbTask extends AsyncTask<Void, Void, Void> { + private final HashMap<String, Integer> mMap; + private final DatabaseHelper mDbHelper; + private final String mLocale; - private int update(String word, int frequency, String locale) { - SQLiteDatabase db = mOpenHelper.getWritableDatabase(); - long count = db.delete(AUTODICT_TABLE_NAME, COLUMN_WORD + "=? AND " + COLUMN_LOCALE + "=?", - new String[] { word, locale }); - count = db.insert(AUTODICT_TABLE_NAME, null, - getContentValues(word, frequency, locale)); - return (int) count; - } + public UpdateDbTask(Context context, DatabaseHelper openHelper, + HashMap<String, Integer> pendingWrites, String locale) { + mMap = pendingWrites; + mLocale = locale; + mDbHelper = openHelper; + } + + @Override + protected Void doInBackground(Void... v) { + SQLiteDatabase db = mDbHelper.getWritableDatabase(); + // Write all the entries to the db + Set<Entry<String,Integer>> mEntries = mMap.entrySet(); + for (Entry<String,Integer> entry : mEntries) { + Integer freq = entry.getValue(); + db.delete(AUTODICT_TABLE_NAME, COLUMN_WORD + "=? AND " + COLUMN_LOCALE + "=?", + new String[] { entry.getKey(), mLocale }); + if (freq != null) { + db.insert(AUTODICT_TABLE_NAME, null, + getContentValues(entry.getKey(), freq, mLocale)); + } + } + return null; + } - private ContentValues getContentValues(String word, int frequency, String locale) { - ContentValues values = new ContentValues(4); - values.put(COLUMN_WORD, word); - values.put(COLUMN_FREQUENCY, frequency); - values.put(COLUMN_LOCALE, locale); - return values; + private ContentValues getContentValues(String word, int frequency, String locale) { + ContentValues values = new ContentValues(4); + values.put(COLUMN_WORD, word); + values.put(COLUMN_FREQUENCY, frequency); + values.put(COLUMN_LOCALE, locale); + return values; + } } } diff --git a/java/src/com/android/inputmethod/latin/BinaryDictionary.java b/java/src/com/android/inputmethod/latin/BinaryDictionary.java index 43f4c4cb6..87de94b76 100644 --- a/java/src/com/android/inputmethod/latin/BinaryDictionary.java +++ b/java/src/com/android/inputmethod/latin/BinaryDictionary.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2009 Google Inc. + * Copyright (C) 2008 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 diff --git a/java/src/com/android/inputmethod/latin/CandidateView.java b/java/src/com/android/inputmethod/latin/CandidateView.java index 0c0373b3b..3a199bbaf 100755 --- a/java/src/com/android/inputmethod/latin/CandidateView.java +++ b/java/src/com/android/inputmethod/latin/CandidateView.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2009 Google Inc. + * Copyright (C) 2008 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 diff --git a/java/src/com/android/inputmethod/latin/CandidateViewContainer.java b/java/src/com/android/inputmethod/latin/CandidateViewContainer.java index e13f2738c..e0cb8c3b0 100644 --- a/java/src/com/android/inputmethod/latin/CandidateViewContainer.java +++ b/java/src/com/android/inputmethod/latin/CandidateViewContainer.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2009 Google Inc. + * Copyright (C) 2008 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 diff --git a/java/src/com/android/inputmethod/latin/Dictionary.java b/java/src/com/android/inputmethod/latin/Dictionary.java index b656d04dc..e7b526663 100644 --- a/java/src/com/android/inputmethod/latin/Dictionary.java +++ b/java/src/com/android/inputmethod/latin/Dictionary.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2009 Google Inc. + * Copyright (C) 2008 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 diff --git a/java/src/com/android/inputmethod/latin/InputLanguageSelection.java b/java/src/com/android/inputmethod/latin/InputLanguageSelection.java index b1ddb2175..b5a11010b 100644 --- a/java/src/com/android/inputmethod/latin/InputLanguageSelection.java +++ b/java/src/com/android/inputmethod/latin/InputLanguageSelection.java @@ -23,6 +23,8 @@ import java.util.Locale; import android.content.SharedPreferences; import android.content.SharedPreferences.Editor; +import android.content.res.Configuration; +import android.content.res.Resources; import android.os.Bundle; import android.preference.CheckBoxPreference; import android.preference.PreferenceActivity; @@ -35,7 +37,7 @@ public class InputLanguageSelection extends PreferenceActivity { private String mSelectedLanguages; private ArrayList<Loc> mAvailableLanguages = new ArrayList<Loc>(); private static final String[] BLACKLIST_LANGUAGES = { - "ko", "ja", "zh" + "ko", "ja", "zh", "el" }; private static class Loc implements Comparable { @@ -75,6 +77,9 @@ public class InputLanguageSelection extends PreferenceActivity { pref.setTitle(LanguageSwitcher.toTitleCase(locale.getDisplayName(locale))); boolean checked = isLocaleIn(locale, languageList); pref.setChecked(checked); + if (hasDictionary(locale)) { + pref.setSummary(R.string.has_dictionary); + } parent.addPreference(pref); } } @@ -92,6 +97,25 @@ public class InputLanguageSelection extends PreferenceActivity { return false; } + private boolean hasDictionary(Locale locale) { + Resources res = getResources(); + Configuration conf = res.getConfiguration(); + Locale saveLocale = conf.locale; + boolean haveDictionary = false; + conf.locale = locale; + res.updateConfiguration(conf, res.getDisplayMetrics()); + BinaryDictionary bd = new BinaryDictionary(this, R.raw.main); + // Is the dictionary larger than a placeholder? Arbitrarily chose a lower limit of + // 4000-5000 words, whereas the LARGE_DICTIONARY is about 20000+ words. + if (bd.getSize() > Suggest.LARGE_DICTIONARY_THRESHOLD / 4) { + haveDictionary = true; + } + bd.close(); + conf.locale = saveLocale; + res.updateConfiguration(conf, res.getDisplayMetrics()); + return haveDictionary; + } + private String get5Code(Locale locale) { String country = locale.getCountry(); return locale.getLanguage() diff --git a/java/src/com/android/inputmethod/latin/KeyboardSwitcher.java b/java/src/com/android/inputmethod/latin/KeyboardSwitcher.java index 438680cf8..1a196448f 100644 --- a/java/src/com/android/inputmethod/latin/KeyboardSwitcher.java +++ b/java/src/com/android/inputmethod/latin/KeyboardSwitcher.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008 Google Inc. + * Copyright (C) 2008 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 diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index ffa7b0a4b..d0baed52a 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -1,6 +1,6 @@ /* - * Copyright (C) 2008-2009 Google Inc. - * + * Copyright (C) 2008 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 @@ -39,7 +39,7 @@ import android.os.Handler; import android.os.Message; import android.os.SystemClock; import android.preference.PreferenceManager; -import android.speech.RecognitionManager; +import android.speech.SpeechRecognizer; import android.text.AutoText; import android.text.ClipboardManager; import android.text.TextUtils; @@ -158,7 +158,7 @@ public class LatinIME extends InputMethodService private UserDictionary mUserDictionary; private ContactsDictionary mContactsDictionary; - private ExpandableDictionary mAutoDictionary; + private AutoDictionary mAutoDictionary; private Hints mHints; @@ -226,6 +226,9 @@ public class LatinIME extends InputMethodService private long mSwipeTriggerTimeMillis; private boolean mConfigurationChanging; + // Keeps track of most recently inserted text (multi-character key) for reverting + private CharSequence mEnteredText; + // For each word, a list of potential replacements, usually from voice. private Map<String, List<CharSequence>> mWordToSuggestions = new HashMap<String, List<CharSequence>>(); @@ -234,6 +237,7 @@ public class LatinIME extends InputMethodService List<String> candidates; Map<String, List<CharSequence>> alternatives; } + private boolean mRefreshKeyboardRequired; Handler mHandler = new Handler() { @@ -451,6 +455,8 @@ public class LatinIME extends InputMethodService mCompletions = null; mCapsLock = false; mEmailText = false; + mEnteredText = null; + switch (attribute.inputType & EditorInfo.TYPE_MASK_CLASS) { case EditorInfo.TYPE_CLASS_NUMBER: case EditorInfo.TYPE_CLASS_DATETIME: @@ -552,6 +558,7 @@ public class LatinIME extends InputMethodService if (VOICE_INSTALLED && !mConfigurationChanging) { if (mAfterVoiceInput) { + mVoiceInput.flushAllTextModificationCounters(); mVoiceInput.logInputEnded(); } mVoiceInput.flushLogs(); @@ -560,6 +567,7 @@ public class LatinIME extends InputMethodService if (mInputView != null) { mInputView.closing(); } + if (mAutoDictionary != null) mAutoDictionary.flushPendingWrites(); } @Override @@ -567,8 +575,6 @@ public class LatinIME extends InputMethodService super.onUpdateExtractedText(token, text); InputConnection ic = getCurrentInputConnection(); if (!mImmediatelyAfterVoiceInput && mAfterVoiceInput && ic != null) { - mVoiceInput.logTextModified(); - if (mHints.showPunctuationHintIfNecessary(ic)) { mVoiceInput.logPunctuationHintDisplayed(); } @@ -592,6 +598,11 @@ public class LatinIME extends InputMethodService + ", ce=" + candidatesEnd); } + if (mAfterVoiceInput) { + mVoiceInput.setCursorPos(newSelEnd); + mVoiceInput.setSelectionSpan(newSelEnd - newSelStart); + } + mSuggestionShouldReplaceCurrentWord = false; // If the current selection in the text view changes, we should // clear whatever candidate text we have. @@ -975,6 +986,8 @@ public class LatinIME extends InputMethodService if (mKeyboardSwitcher.onKey(primaryCode)) { changeKeyboardMode(); } + // Reset after any single keystroke + mEnteredText = null; } public void onText(CharSequence text) { @@ -993,16 +1006,32 @@ public class LatinIME extends InputMethodService updateShiftKeyState(getCurrentInputEditorInfo()); mJustRevertedSeparator = null; mJustAddedAutoSpace = false; + mEnteredText = text; } private void handleBackspace() { if (VOICE_INSTALLED && mVoiceInputHighlighted) { + mVoiceInput.incrementTextModificationDeleteCount( + mVoiceResults.candidates.get(0).toString().length()); revertVoiceInput(); return; } boolean deleteChar = false; InputConnection ic = getCurrentInputConnection(); if (ic == null) return; + + if (mAfterVoiceInput) { + // Don't log delete if the user is pressing delete at + // the beginning of the text box (hence not deleting anything) + if (mVoiceInput.getCursorPos() > 0) { + // If anything was selected before the delete was pressed, increment the + // delete count by the length of the selection + int deleteLen = mVoiceInput.getSelectionSpan() > 0 ? + mVoiceInput.getSelectionSpan() : 1; + mVoiceInput.incrementTextModificationDeleteCount(deleteLen); + } + } + if (mPredicting) { final int length = mComposing.length(); if (length > 0) { @@ -1024,6 +1053,8 @@ public class LatinIME extends InputMethodService if (TextEntryState.getState() == TextEntryState.STATE_UNDO_COMMIT) { revertLastWord(deleteChar); return; + } else if (mEnteredText != null && sameAsTextBeforeCursor(ic, mEnteredText)) { + ic.deleteSurroundingText(mEnteredText.length(), 0); } else if (deleteChar) { sendDownUpKeyEvents(KeyEvent.KEYCODE_DEL); if (mDeleteCount > DELETE_ACCELERATE_AT) { @@ -1048,6 +1079,12 @@ public class LatinIME extends InputMethodService if (VOICE_INSTALLED && mVoiceInputHighlighted) { commitVoiceInput(); } + + if (mAfterVoiceInput) { + // Assume input length is 1. This assumption fails for smiley face insertions. + mVoiceInput.incrementTextModificationInsertCount(1); + } + if (isAlphabet(primaryCode) && isPredictionOn() && !isCursorTouchingWord()) { if (!mPredicting) { mPredicting = true; @@ -1091,6 +1128,12 @@ public class LatinIME extends InputMethodService if (VOICE_INSTALLED && mVoiceInputHighlighted) { commitVoiceInput(); } + + if (mAfterVoiceInput){ + // Assume input length is 1. This assumption fails for smiley face insertions. + mVoiceInput.incrementTextModificationInsertPunctuationCount(1); + } + boolean pickedDefault = false; // Handle separator InputConnection ic = getCurrentInputConnection(); @@ -1344,7 +1387,7 @@ public class LatinIME extends InputMethodService String bestResult = nBest.get(0).toString(); - mVoiceInput.logVoiceInputDelivered(); + mVoiceInput.logVoiceInputDelivered(bestResult.length()); mHints.registerVoiceResult(bestResult); @@ -1405,7 +1448,7 @@ public class LatinIME extends InputMethodService ((LatinKeyboard) mInputView.getKeyboard()).setPreferredLetters(nextLettersFrequencies); - boolean correctionAvailable = mSuggest.hasMinimalCorrection(); + boolean correctionAvailable = !mInputTypeNoAutoCorrect && mSuggest.hasMinimalCorrection(); //|| mCorrectionMode == mSuggest.CORRECTION_FULL; CharSequence typedWord = mWord.getTypedWord(); // If we're in basic correct @@ -1436,7 +1479,7 @@ public class LatinIME extends InputMethodService mHandler.removeMessages(MSG_UPDATE_SUGGESTIONS); updateSuggestions(); } - if (mBestWord != null) { + if (mBestWord != null && mBestWord.length() > 0) { TextEntryState.acceptedDefault(mWord.getTypedWord(), mBestWord); mJustAccepted = true; pickSuggestion(mBestWord); @@ -1448,6 +1491,12 @@ public class LatinIME extends InputMethodService public void pickSuggestionManually(int index, CharSequence suggestion) { if (mAfterVoiceInput && mShowingVoiceSuggestions) mVoiceInput.logNBestChoose(index); + if (mAfterVoiceInput && !mShowingVoiceSuggestions) { + mVoiceInput.flushAllTextModificationCounters(); + // send this intent AFTER logging any prior aggregated edits. + mVoiceInput.logTextModifiedByChooseSuggestion(suggestion.length()); + } + InputConnection ic = getCurrentInputConnection(); if (ic != null) { ic.beginBatchEdit(); @@ -1480,7 +1529,9 @@ public class LatinIME extends InputMethodService mJustAccepted = true; pickSuggestion(suggestion); // Add the word to the auto dictionary if it's not a known word - checkAddToDictionary(suggestion, AutoDictionary.FREQUENCY_FOR_PICKED); + if (index == 0) { + checkAddToDictionary(suggestion, AutoDictionary.FREQUENCY_FOR_PICKED); + } TextEntryState.acceptedSuggestion(mComposing.toString(), suggestion); // Follow it with a space if (mAutoSpace) { @@ -1526,8 +1577,13 @@ public class LatinIME extends InputMethodService } private void checkAddToDictionary(CharSequence suggestion, int frequencyDelta) { + // 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 + // want corrections enabled or learned. + if (!(mCorrectionMode == Suggest.CORRECTION_FULL)) return; if (mAutoDictionary.isValidWord(suggestion) - || !mSuggest.isValidWord(suggestion.toString().toLowerCase())) { + || (!mSuggest.isValidWord(suggestion.toString()) + && !mSuggest.isValidWord(suggestion.toString().toLowerCase()))) { mAutoDictionary.addWord(suggestion.toString(), frequencyDelta); } } @@ -1548,6 +1604,11 @@ public class LatinIME extends InputMethodService return false; } + private boolean sameAsTextBeforeCursor(InputConnection ic, CharSequence text) { + CharSequence beforeText = ic.getTextBeforeCursor(text.length(), 0); + return TextUtils.equals(text, beforeText); + } + public void revertLastWord(boolean deleteChar) { final int length = mComposing.length(); if (!mPredicting && length > 0) { @@ -1679,7 +1740,7 @@ public class LatinIME extends InputMethodService return ENABLE_VOICE_BUTTON && fieldCanDoVoice(fieldContext) && !(attribute != null && attribute.privateImeOptions != null && attribute.privateImeOptions.equals(IME_OPTION_NO_MICROPHONE)) - && RecognitionManager.isRecognitionAvailable(this); + && SpeechRecognizer.isRecognitionAvailable(this); } // receive ringer mode changes to detect silent mode diff --git a/java/src/com/android/inputmethod/latin/LatinIMEBackupAgent.java b/java/src/com/android/inputmethod/latin/LatinIMEBackupAgent.java index 62da86cd4..568b31d04 100644 --- a/java/src/com/android/inputmethod/latin/LatinIMEBackupAgent.java +++ b/java/src/com/android/inputmethod/latin/LatinIMEBackupAgent.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009 Google Inc. + * Copyright (C) 2008 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 @@ -16,13 +16,13 @@ package com.android.inputmethod.latin; -import android.app.backup.BackupHelperAgent; +import android.app.backup.BackupAgentHelper; import android.app.backup.SharedPreferencesBackupHelper; /** * Backs up the Latin IME shared preferences. */ -public class LatinIMEBackupAgent extends BackupHelperAgent { +public class LatinIMEBackupAgent extends BackupAgentHelper { public void onCreate() { addHelper("shared_pref", new SharedPreferencesBackupHelper(this, diff --git a/java/src/com/android/inputmethod/latin/LatinIMESettings.java b/java/src/com/android/inputmethod/latin/LatinIMESettings.java index f76ec99b6..21b967420 100644 --- a/java/src/com/android/inputmethod/latin/LatinIMESettings.java +++ b/java/src/com/android/inputmethod/latin/LatinIMESettings.java @@ -1,6 +1,6 @@ /* - * Copyright (C) 2008-2009 Google Inc. - * + * Copyright (C) 2008 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 @@ -31,7 +31,7 @@ import android.preference.Preference; import android.preference.PreferenceActivity; import android.preference.PreferenceGroup; import android.preference.Preference.OnPreferenceClickListener; -import android.speech.RecognitionManager; +import android.speech.SpeechRecognizer; import android.text.AutoText; import android.util.Log; @@ -88,7 +88,7 @@ public class LatinIMESettings extends PreferenceActivity .removePreference(mQuickFixes); } if (!LatinIME.VOICE_INSTALLED - || !RecognitionManager.isRecognitionAvailable(this)) { + || !SpeechRecognizer.isRecognitionAvailable(this)) { getPreferenceScreen().removePreference(mVoicePreference); } else { updateVoiceModeSummary(); diff --git a/java/src/com/android/inputmethod/latin/LatinKeyboard.java b/java/src/com/android/inputmethod/latin/LatinKeyboard.java index 58e1dc767..32cd8a45f 100644 --- a/java/src/com/android/inputmethod/latin/LatinKeyboard.java +++ b/java/src/com/android/inputmethod/latin/LatinKeyboard.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2009 Google Inc. + * Copyright (C) 2008 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 diff --git a/java/src/com/android/inputmethod/latin/LatinKeyboardView.java b/java/src/com/android/inputmethod/latin/LatinKeyboardView.java index 2686a93c6..6ba2095c0 100644 --- a/java/src/com/android/inputmethod/latin/LatinKeyboardView.java +++ b/java/src/com/android/inputmethod/latin/LatinKeyboardView.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2009 Google Inc. + * Copyright (C) 2008 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 @@ -23,6 +23,7 @@ import android.graphics.Canvas; import android.graphics.Paint; import android.inputmethodservice.Keyboard; import android.inputmethodservice.KeyboardView; +import android.inputmethodservice.KeyboardView.OnKeyboardActionListener; import android.inputmethodservice.Keyboard.Key; import android.os.Handler; import android.os.Message; @@ -43,10 +44,27 @@ public class LatinKeyboardView extends KeyboardView { private Keyboard mPhoneKeyboard; + /** Whether the extension of this keyboard is visible */ private boolean mExtensionVisible; + /** The view that is shown as an extension of this keyboard view */ private LatinKeyboardView mExtension; + /** The popup window that contains the extension of this keyboard */ private PopupWindow mExtensionPopup; + /** Whether this view is an extension of another keyboard */ + private boolean mIsExtensionType; private boolean mFirstEvent; + /** Whether we've started dropping move events because we found a big jump */ + private boolean mDroppingEvents; + /** + * Whether multi-touch disambiguation needs to be disabled for any reason. There are 2 reasons + * for this to happen - (1) if a real multi-touch event has occured and (2) we've opened an + * extension keyboard. + */ + private boolean mDisableDisambiguation; + /** The distance threshold at which we start treating the touch session as a multi-touch */ + private int mJumpThresholdSquare = Integer.MAX_VALUE; + /** The y coordinate of the last row */ + private int mLastRowY; public LatinKeyboardView(Context context, AttributeSet attrs) { super(context, attrs); @@ -61,6 +79,17 @@ public class LatinKeyboardView extends KeyboardView { } @Override + public void setKeyboard(Keyboard k) { + super.setKeyboard(k); + // One-seventh of the keyboard width seems like a reasonable threshold + mJumpThresholdSquare = k.getMinWidth() / 7; + mJumpThresholdSquare *= mJumpThresholdSquare; + // Assuming there are 4 rows, this is the coordinate of the last row + mLastRowY = (k.getHeight() * 3) / 4; + setKeyboardLocal(k); + } + + @Override protected boolean onLongPress(Key key) { if (key.codes[0] == Keyboard.KEYCODE_MODE_CHANGE) { getOnKeyboardActionListener().onKey(KEYCODE_OPTIONS, null); @@ -78,6 +107,83 @@ public class LatinKeyboardView extends KeyboardView { } } + /** + * This function checks to see if we need to handle any sudden jumps in the pointer location + * that could be due to a multi-touch being treated as a move by the firmware or hardware. + * Once a sudden jump is detected, all subsequent move events are discarded + * until an UP is received.<P> + * When a sudden jump is detected, an UP event is simulated at the last position and when + * the sudden moves subside, a DOWN event is simulated for the second key. + * @param me the motion event + * @return true if the event was consumed, so that it doesn't continue to be handled by + * KeyboardView. + */ + private boolean handleSuddenJump(MotionEvent me) { + final int action = me.getAction(); + final int x = (int) me.getX(); + final int y = (int) me.getY(); + boolean result = false; + + // Real multi-touch event? Stop looking for sudden jumps + if (me.getPointerCount() > 1) { + mDisableDisambiguation = true; + } + if (mDisableDisambiguation) { + // If UP, reset the multi-touch flag + if (action == MotionEvent.ACTION_UP) mDisableDisambiguation = false; + return false; + } + + switch (action) { + case MotionEvent.ACTION_DOWN: + // Reset the "session" + mDroppingEvents = false; + mDisableDisambiguation = false; + break; + case MotionEvent.ACTION_MOVE: + // Is this a big jump? + final int distanceSquare = (mLastX - x) * (mLastX - x) + (mLastY - y) * (mLastY - y); + // Check the distance and also if the move is not entirely within the bottom row + // If it's only in the bottom row, it might be an intentional slide gesture + // for language switching + if (distanceSquare > mJumpThresholdSquare + && (mLastY < mLastRowY || y < mLastRowY)) { + // If we're not yet dropping events, start dropping and send an UP event + if (!mDroppingEvents) { + mDroppingEvents = true; + // Send an up event + MotionEvent translated = MotionEvent.obtain(me.getEventTime(), me.getEventTime(), + MotionEvent.ACTION_UP, + mLastX, mLastY, me.getMetaState()); + super.onTouchEvent(translated); + translated.recycle(); + } + result = true; + } else if (mDroppingEvents) { + // If moves are small and we're already dropping events, continue dropping + result = true; + } + break; + case MotionEvent.ACTION_UP: + if (mDroppingEvents) { + // Send a down event first, as we dropped a bunch of sudden jumps and assume that + // the user is releasing the touch on the second key. + MotionEvent translated = MotionEvent.obtain(me.getEventTime(), me.getEventTime(), + MotionEvent.ACTION_DOWN, + x, y, me.getMetaState()); + super.onTouchEvent(translated); + translated.recycle(); + mDroppingEvents = false; + // Let the up event get processed as well, result = false + } + break; + } + // Track the previous coordinate + mLastX = x; + mLastY = y; + return result; + } + @Override public boolean onTouchEvent(MotionEvent me) { LatinKeyboard keyboard = (LatinKeyboard) getKeyboard(); @@ -86,6 +192,12 @@ public class LatinKeyboardView extends KeyboardView { mLastY = (int) me.getY(); invalidate(); } + // If an extension keyboard is visible or this is an extension keyboard, don't look + // for sudden jumps. Otherwise, if there was a sudden jump, return without processing the + // actual motion event. + if (!mExtensionVisible && !mIsExtensionType + && handleSuddenJump(me)) return true; + // Reset any bounding box controls in the keyboard if (me.getAction() == MotionEvent.ACTION_DOWN) { keyboard.keyReleased(); @@ -139,6 +251,8 @@ public class LatinKeyboardView extends KeyboardView { } else { mFirstEvent = true; } + // Stop processing multi-touch errors + mDisableDisambiguation = true; } return true; } @@ -157,7 +271,15 @@ public class LatinKeyboardView extends KeyboardView { } } + private void setExtensionType(boolean isExtensionType) { + mIsExtensionType = isExtensionType; + } + private boolean openExtension() { + // If the current keyboard is not visible, don't show the popup + if (!isShown()) { + return false; + } if (((LatinKeyboard) getKeyboard()).getExtension() == 0) return false; makePopupWindow(); mExtensionVisible = true; @@ -172,7 +294,9 @@ public class LatinKeyboardView extends KeyboardView { LayoutInflater li = (LayoutInflater) getContext().getSystemService( Context.LAYOUT_INFLATER_SERVICE); mExtension = (LatinKeyboardView) li.inflate(R.layout.input_trans, null); - mExtension.setOnKeyboardActionListener((LatinIME) getContext()); + mExtension.setExtensionType(true); + mExtension.setOnKeyboardActionListener( + new ExtensionKeyboardListener(getOnKeyboardActionListener())); mExtension.setPopupParent(this); mExtension.setPopupOffset(0, -windowLocation[1]); Keyboard keyboard; @@ -181,6 +305,7 @@ public class LatinKeyboardView extends KeyboardView { mExtensionPopup.setContentView(mExtension); mExtensionPopup.setWidth(getWidth()); mExtensionPopup.setHeight(keyboard.getHeight()); + mExtensionPopup.setAnimationStyle(-1); getLocationInWindow(windowLocation); // TODO: Fix the "- 30". mExtension.setPopupOffset(0, -windowLocation[1] - 30); @@ -201,11 +326,42 @@ public class LatinKeyboardView extends KeyboardView { } private void closeExtension() { - mExtension.setVisibility(INVISIBLE); mExtension.closing(); + mExtension.setVisibility(INVISIBLE); mExtensionVisible = false; } + private static class ExtensionKeyboardListener implements OnKeyboardActionListener { + private OnKeyboardActionListener mTarget; + ExtensionKeyboardListener(OnKeyboardActionListener target) { + mTarget = target; + } + public void onKey(int primaryCode, int[] keyCodes) { + mTarget.onKey(primaryCode, keyCodes); + } + public void onPress(int primaryCode) { + mTarget.onPress(primaryCode); + } + public void onRelease(int primaryCode) { + mTarget.onRelease(primaryCode); + } + public void onText(CharSequence text) { + mTarget.onText(text); + } + public void swipeDown() { + // Don't pass through + } + public void swipeLeft() { + // Don't pass through + } + public void swipeRight() { + // Don't pass through + } + public void swipeUp() { + // Don't pass through + } + } + /**************************** INSTRUMENTATION *******************************/ static final boolean DEBUG_AUTO_PLAY = false; @@ -224,9 +380,7 @@ public class LatinKeyboardView extends KeyboardView { private int mLastY; private Paint mPaint; - @Override - public void setKeyboard(Keyboard k) { - super.setKeyboard(k); + private void setKeyboardLocal(Keyboard k) { if (DEBUG_AUTO_PLAY) { findKeys(); if (mHandler2 == null) { diff --git a/java/src/com/android/inputmethod/latin/Suggest.java b/java/src/com/android/inputmethod/latin/Suggest.java index 712b9cf37..a70bea003 100755 --- a/java/src/com/android/inputmethod/latin/Suggest.java +++ b/java/src/com/android/inputmethod/latin/Suggest.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2009 Google Inc. + * Copyright (C) 2008 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 @@ -39,7 +39,7 @@ public class Suggest implements Dictionary.WordCallback { public static final int CORRECTION_BASIC = 1; public static final int CORRECTION_FULL = 2; - private static final int LARGE_DICTIONARY_THRESHOLD = 200 * 1000; + static final int LARGE_DICTIONARY_THRESHOLD = 200 * 1000; private BinaryDictionary mMainDict; @@ -346,11 +346,10 @@ public class Suggest implements Dictionary.WordCallback { if (word == null || word.length() == 0) { return false; } - return (mCorrectionMode == CORRECTION_FULL && mMainDict.isValidWord(word)) - || (mCorrectionMode > CORRECTION_NONE && - ((mUserDictionary != null && mUserDictionary.isValidWord(word))) - || (mAutoDictionary != null && mAutoDictionary.isValidWord(word)) - || (mContactsDictionary != null && mContactsDictionary.isValidWord(word))); + return mMainDict.isValidWord(word) + || (mUserDictionary != null && mUserDictionary.isValidWord(word)) + || (mAutoDictionary != null && mAutoDictionary.isValidWord(word)) + || (mContactsDictionary != null && mContactsDictionary.isValidWord(word)); } private void collectGarbage() { diff --git a/java/src/com/android/inputmethod/latin/TextEntryState.java b/java/src/com/android/inputmethod/latin/TextEntryState.java index c5e8ad9a1..d056ceb16 100644 --- a/java/src/com/android/inputmethod/latin/TextEntryState.java +++ b/java/src/com/android/inputmethod/latin/TextEntryState.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2009 Google Inc. + * Copyright (C) 2008 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 diff --git a/java/src/com/android/inputmethod/latin/Tutorial.java b/java/src/com/android/inputmethod/latin/Tutorial.java index 03d4858c4..a8123317b 100644 --- a/java/src/com/android/inputmethod/latin/Tutorial.java +++ b/java/src/com/android/inputmethod/latin/Tutorial.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2009 Google Inc. + * Copyright (C) 2008 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 diff --git a/java/src/com/android/inputmethod/latin/WordComposer.java b/java/src/com/android/inputmethod/latin/WordComposer.java index e97cb24ba..19f714ae7 100644 --- a/java/src/com/android/inputmethod/latin/WordComposer.java +++ b/java/src/com/android/inputmethod/latin/WordComposer.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2009 Google Inc. + * Copyright (C) 2008 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 @@ -84,11 +84,27 @@ public class WordComposer { */ public void add(int primaryCode, int[] codes) { mTypedWord.append((char) primaryCode); + correctPrimaryJuxtapos(primaryCode, codes); mCodes.add(codes); if (Character.isUpperCase((char) primaryCode)) mCapsCount++; } /** + * Swaps the first and second values in the codes array if the primary code is not the first + * value in the array but the second. This happens when the preferred key is not the key that + * the user released the finger on. + * @param primaryCode the preferred character + * @param codes array of codes based on distance from touch point + */ + private void correctPrimaryJuxtapos(int primaryCode, int[] codes) { + if (codes.length < 2) return; + if (codes[0] > 0 && codes[1] > 0 && codes[0] != primaryCode && codes[1] == primaryCode) { + codes[1] = codes[0]; + codes[0] = primaryCode; + } + } + + /** * Delete the last keystroke as a result of hitting backspace. */ public void deleteLast() { diff --git a/java/src/com/android/inputmethod/voice/VoiceInput.java b/java/src/com/android/inputmethod/voice/VoiceInput.java index e881856dd..ac06ab50d 100644 --- a/java/src/com/android/inputmethod/voice/VoiceInput.java +++ b/java/src/com/android/inputmethod/voice/VoiceInput.java @@ -26,7 +26,7 @@ import android.os.Bundle; import android.os.Handler; import android.os.Message; import android.speech.RecognitionListener; -import android.speech.RecognitionManager; +import android.speech.SpeechRecognizer; import android.speech.RecognizerIntent; import android.util.Log; import android.view.View; @@ -94,6 +94,12 @@ public class VoiceInput implements OnClickListener { public static final int WORKING = 2; public static final int ERROR = 3; + private int mAfterVoiceInputDeleteCount = 0; + private int mAfterVoiceInputInsertCount = 0; + private int mAfterVoiceInputInsertPunctuationCount = 0; + private int mAfterVoiceInputCursorPos = 0; + private int mAfterVoiceInputSelectionSpan = 0; + private int mState = DEFAULT; private final static int MSG_CLOSE_ERROR_DIALOG = 1; @@ -128,7 +134,7 @@ public class VoiceInput implements OnClickListener { public void onCancelVoice(); } - private RecognitionManager mRecognitionManager; + private SpeechRecognizer mSpeechRecognizer; private RecognitionListener mRecognitionListener; private RecognitionView mRecognitionView; private UiListener mUiListener; @@ -141,8 +147,8 @@ public class VoiceInput implements OnClickListener { public VoiceInput(Context context, UiListener uiHandler) { mLogger = VoiceInputLogger.getLogger(context); mRecognitionListener = new ImeRecognitionListener(); - mRecognitionManager = RecognitionManager.createRecognitionManager(context); - mRecognitionManager.setRecognitionListener(mRecognitionListener); + mSpeechRecognizer = SpeechRecognizer.createSpeechRecognizer(context); + mSpeechRecognizer.setRecognitionListener(mRecognitionListener); mUiListener = uiHandler; mContext = context; newView(); @@ -161,6 +167,87 @@ public class VoiceInput implements OnClickListener { mBlacklist.addApp("com.android.setupwizard"); } + public void setCursorPos(int pos) { + mAfterVoiceInputCursorPos = pos; + } + + public int getCursorPos() { + return mAfterVoiceInputCursorPos; + } + + public void setSelectionSpan(int span) { + mAfterVoiceInputSelectionSpan = span; + } + + public int getSelectionSpan() { + return mAfterVoiceInputSelectionSpan; + } + + public void incrementTextModificationDeleteCount(int count){ + mAfterVoiceInputDeleteCount += count; + // Send up intents for other text modification types + if (mAfterVoiceInputInsertCount > 0) { + logTextModifiedByTypingInsertion(mAfterVoiceInputInsertCount); + mAfterVoiceInputInsertCount = 0; + } + if (mAfterVoiceInputInsertPunctuationCount > 0) { + logTextModifiedByTypingInsertionPunctuation(mAfterVoiceInputInsertPunctuationCount); + mAfterVoiceInputInsertPunctuationCount = 0; + } + + } + + public void incrementTextModificationInsertCount(int count){ + mAfterVoiceInputInsertCount += count; + if (mAfterVoiceInputSelectionSpan > 0) { + // If text was highlighted before inserting the char, count this as + // a delete. + mAfterVoiceInputDeleteCount += mAfterVoiceInputSelectionSpan; + } + // Send up intents for other text modification types + if (mAfterVoiceInputDeleteCount > 0) { + logTextModifiedByTypingDeletion(mAfterVoiceInputDeleteCount); + mAfterVoiceInputDeleteCount = 0; + } + if (mAfterVoiceInputInsertPunctuationCount > 0) { + logTextModifiedByTypingInsertionPunctuation(mAfterVoiceInputInsertPunctuationCount); + mAfterVoiceInputInsertPunctuationCount = 0; + } + } + + public void incrementTextModificationInsertPunctuationCount(int count){ + mAfterVoiceInputInsertPunctuationCount += 1; + if (mAfterVoiceInputSelectionSpan > 0) { + // If text was highlighted before inserting the char, count this as + // a delete. + mAfterVoiceInputDeleteCount += mAfterVoiceInputSelectionSpan; + } + // Send up intents for aggregated non-punctuation insertions + if (mAfterVoiceInputDeleteCount > 0) { + logTextModifiedByTypingDeletion(mAfterVoiceInputDeleteCount); + mAfterVoiceInputDeleteCount = 0; + } + if (mAfterVoiceInputInsertCount > 0) { + logTextModifiedByTypingInsertion(mAfterVoiceInputInsertCount); + mAfterVoiceInputInsertCount = 0; + } + } + + public void flushAllTextModificationCounters() { + if (mAfterVoiceInputInsertCount > 0) { + logTextModifiedByTypingInsertion(mAfterVoiceInputInsertCount); + mAfterVoiceInputInsertCount = 0; + } + if (mAfterVoiceInputDeleteCount > 0) { + logTextModifiedByTypingDeletion(mAfterVoiceInputDeleteCount); + mAfterVoiceInputDeleteCount = 0; + } + if (mAfterVoiceInputInsertPunctuationCount > 0) { + logTextModifiedByTypingInsertionPunctuation(mAfterVoiceInputInsertPunctuationCount); + mAfterVoiceInputInsertPunctuationCount = 0; + } + } + /** * The configuration of the IME changed and may have caused the views to be layed out * again. Restore the state of the recognition view. @@ -247,7 +334,7 @@ public class VoiceInput implements OnClickListener { EXTRA_SPEECH_INPUT_POSSIBLY_COMPLETE_SILENCE_LENGTH_MILLIS, null /* rely on endpointer default */); - mRecognitionManager.startListening(intent); + mSpeechRecognizer.startListening(intent); } /** @@ -270,7 +357,7 @@ public class VoiceInput implements OnClickListener { } public void destroy() { - mRecognitionManager.destroy(); + mSpeechRecognizer.destroy(); } /** @@ -302,8 +389,20 @@ public class VoiceInput implements OnClickListener { } } - public void logTextModified() { - mLogger.textModified(); + public void logTextModifiedByTypingInsertion(int length) { + mLogger.textModifiedByTypingInsertion(length); + } + + public void logTextModifiedByTypingInsertionPunctuation(int length) { + mLogger.textModifiedByTypingInsertionPunctuation(length); + } + + public void logTextModifiedByTypingDeletion(int length) { + mLogger.textModifiedByTypingDeletion(length); + } + + public void logTextModifiedByChooseSuggestion(int length) { + mLogger.textModifiedByChooseSuggestion(length); } public void logKeyboardWarningDialogShown() { @@ -330,8 +429,8 @@ public class VoiceInput implements OnClickListener { mLogger.punctuationHintDisplayed(); } - public void logVoiceInputDelivered() { - mLogger.voiceInputDelivered(); + public void logVoiceInputDelivered(int length) { + mLogger.voiceInputDelivered(length); } public void logNBestChoose(int index) { @@ -385,7 +484,7 @@ public class VoiceInput implements OnClickListener { // Remove all pending tasks (e.g., timers to cancel voice input) mHandler.removeMessages(MSG_CLOSE_ERROR_DIALOG); - mRecognitionManager.cancel(); + mSpeechRecognizer.cancel(); mUiListener.onCancelVoice(); mRecognitionView.finish(); } @@ -393,20 +492,20 @@ public class VoiceInput implements OnClickListener { private int getErrorStringId(int errorType, boolean endpointed) { switch (errorType) { // We use CLIENT_ERROR to signify that voice search is not available on the device. - case RecognitionManager.ERROR_CLIENT: + case SpeechRecognizer.ERROR_CLIENT: return R.string.voice_not_installed; - case RecognitionManager.ERROR_NETWORK: + case SpeechRecognizer.ERROR_NETWORK: return R.string.voice_network_error; - case RecognitionManager.ERROR_NETWORK_TIMEOUT: + case SpeechRecognizer.ERROR_NETWORK_TIMEOUT: return endpointed ? R.string.voice_network_error : R.string.voice_too_much_speech; - case RecognitionManager.ERROR_AUDIO: + case SpeechRecognizer.ERROR_AUDIO: return R.string.voice_audio_error; - case RecognitionManager.ERROR_SERVER: + case SpeechRecognizer.ERROR_SERVER: return R.string.voice_server_error; - case RecognitionManager.ERROR_SPEECH_TIMEOUT: + case SpeechRecognizer.ERROR_SPEECH_TIMEOUT: return R.string.voice_speech_timeout; - case RecognitionManager.ERROR_NO_MATCH: + case SpeechRecognizer.ERROR_NO_MATCH: return R.string.voice_no_match; default: return R.string.voice_error; } @@ -463,7 +562,7 @@ public class VoiceInput implements OnClickListener { public void onResults(Bundle resultsBundle) { List<String> results = resultsBundle - .getStringArrayList(RecognitionManager.RESULTS_RECOGNITION); + .getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION); mState = DEFAULT; final Map<String, List<CharSequence>> alternatives = diff --git a/java/src/com/android/inputmethod/voice/VoiceInputLogger.java b/java/src/com/android/inputmethod/voice/VoiceInputLogger.java index 659033340..9d3a92037 100644 --- a/java/src/com/android/inputmethod/voice/VoiceInputLogger.java +++ b/java/src/com/android/inputmethod/voice/VoiceInputLogger.java @@ -147,12 +147,43 @@ public class VoiceInputLogger { mContext.sendBroadcast(i); } - public void voiceInputDelivered() { - mContext.sendBroadcast(newLoggingBroadcast(LoggingEvents.VoiceIme.VOICE_INPUT_DELIVERED)); + public void voiceInputDelivered(int length) { + Intent i = newLoggingBroadcast(LoggingEvents.VoiceIme.VOICE_INPUT_DELIVERED); + i.putExtra(LoggingEvents.VoiceIme.EXTRA_TEXT_MODIFIED_LENGTH, length); + mContext.sendBroadcast(i); + } + + public void textModifiedByTypingInsertion(int length) { + Intent i = newLoggingBroadcast(LoggingEvents.VoiceIme.TEXT_MODIFIED); + i.putExtra(LoggingEvents.VoiceIme.EXTRA_TEXT_MODIFIED_LENGTH, length); + i.putExtra(LoggingEvents.VoiceIme.EXTRA_TEXT_MODIFIED_TYPE, + LoggingEvents.VoiceIme.TEXT_MODIFIED_TYPE_TYPING_INSERTION); + mContext.sendBroadcast(i); + } + + public void textModifiedByTypingInsertionPunctuation(int length) { + Intent i = newLoggingBroadcast(LoggingEvents.VoiceIme.TEXT_MODIFIED); + i.putExtra(LoggingEvents.VoiceIme.EXTRA_TEXT_MODIFIED_LENGTH, length); + i.putExtra(LoggingEvents.VoiceIme.EXTRA_TEXT_MODIFIED_TYPE, + LoggingEvents.VoiceIme.TEXT_MODIFIED_TYPE_TYPING_INSERTION_PUNCTUATION); + mContext.sendBroadcast(i); + } + + public void textModifiedByTypingDeletion(int length) { + Intent i = newLoggingBroadcast(LoggingEvents.VoiceIme.TEXT_MODIFIED); + i.putExtra(LoggingEvents.VoiceIme.EXTRA_TEXT_MODIFIED_LENGTH, length); + i.putExtra(LoggingEvents.VoiceIme.EXTRA_TEXT_MODIFIED_TYPE, + LoggingEvents.VoiceIme.TEXT_MODIFIED_TYPE_TYPING_DELETION); + + mContext.sendBroadcast(i); } - public void textModified() { - mContext.sendBroadcast(newLoggingBroadcast(LoggingEvents.VoiceIme.TEXT_MODIFIED)); + public void textModifiedByChooseSuggestion(int length) { + Intent i = newLoggingBroadcast(LoggingEvents.VoiceIme.TEXT_MODIFIED); + i.putExtra(LoggingEvents.VoiceIme.EXTRA_TEXT_MODIFIED_LENGTH, length); + i.putExtra(LoggingEvents.VoiceIme.EXTRA_TEXT_MODIFIED_TYPE, + LoggingEvents.VoiceIme.TEXT_MODIFIED_TYPE_CHOOSE_SUGGESTION); + mContext.sendBroadcast(i); } public void nBestChoose(int index) { |