diff --git a/java/res/drawable-hdpi/btn_candidate_normal.9.png b/java/res/drawable-hdpi/btn_candidate_normal.9.png
deleted file mode 100644
index 7cab5a899..000000000
Binary files a/java/res/drawable-hdpi/btn_candidate_normal.9.png and /dev/null differ
diff --git a/java/res/drawable-hdpi/highlight_pressed.png b/java/res/drawable-hdpi/highlight_pressed.png
deleted file mode 100644
index ae04901a0..000000000
Binary files a/java/res/drawable-hdpi/highlight_pressed.png and /dev/null differ
diff --git a/java/res/drawable-hdpi/keyboard_key_feedback_background_holo.9.png b/java/res/drawable-hdpi/keyboard_key_feedback_background_holo.9.png
index 943f9e4bc..8d6acacfb 100644
Binary files a/java/res/drawable-hdpi/keyboard_key_feedback_background_holo.9.png and b/java/res/drawable-hdpi/keyboard_key_feedback_background_holo.9.png differ
diff --git a/java/res/drawable-hdpi/sym_keyboard_voice_off_holo.png b/java/res/drawable-hdpi/sym_keyboard_voice_off_holo.png
index 8a445eb56..6e6279a8a 100644
Binary files a/java/res/drawable-hdpi/sym_keyboard_voice_off_holo.png and b/java/res/drawable-hdpi/sym_keyboard_voice_off_holo.png differ
diff --git a/java/res/drawable-mdpi/btn_candidate_normal.9.png b/java/res/drawable-mdpi/btn_candidate_normal.9.png
deleted file mode 100644
index fa6c0feff..000000000
Binary files a/java/res/drawable-mdpi/btn_candidate_normal.9.png and /dev/null differ
diff --git a/java/res/drawable-mdpi/highlight_pressed.png b/java/res/drawable-mdpi/highlight_pressed.png
deleted file mode 100644
index d27f1061a..000000000
Binary files a/java/res/drawable-mdpi/highlight_pressed.png and /dev/null differ
diff --git a/java/res/drawable-mdpi/keyboard_key_feedback_background_holo.9.png b/java/res/drawable-mdpi/keyboard_key_feedback_background_holo.9.png
index a7acb4a4d..286cf84fc 100644
Binary files a/java/res/drawable-mdpi/keyboard_key_feedback_background_holo.9.png and b/java/res/drawable-mdpi/keyboard_key_feedback_background_holo.9.png differ
diff --git a/java/res/drawable-mdpi/sym_keyboard_voice_off_holo.png b/java/res/drawable-mdpi/sym_keyboard_voice_off_holo.png
index 081a13096..44919dfcc 100644
Binary files a/java/res/drawable-mdpi/sym_keyboard_voice_off_holo.png and b/java/res/drawable-mdpi/sym_keyboard_voice_off_holo.png differ
diff --git a/java/res/drawable-mdpi/top_suggest_line_holo.9.png b/java/res/drawable-mdpi/top_suggest_line_holo.9.png
deleted file mode 100644
index 8fdffd317..000000000
Binary files a/java/res/drawable-mdpi/top_suggest_line_holo.9.png and /dev/null differ
diff --git a/java/res/drawable/btn_candidate.xml b/java/res/drawable/btn_candidate.xml
index b0c1c3038..efcee9f54 100644
--- a/java/res/drawable/btn_candidate.xml
+++ b/java/res/drawable/btn_candidate.xml
@@ -24,6 +24,4 @@
-
diff --git a/java/res/drawable/ic_suggest_scroll_background.xml b/java/res/drawable/ic_suggest_scroll_background.xml
deleted file mode 100644
index 9d246e40e..000000000
--- a/java/res/drawable/ic_suggest_scroll_background.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/java/res/drawable/keyboard_key_feedback_honeycomb.xml b/java/res/drawable/keyboard_key_feedback_honeycomb.xml
index dd9b53e46..a3ea140cd 100644
--- a/java/res/drawable/keyboard_key_feedback_honeycomb.xml
+++ b/java/res/drawable/keyboard_key_feedback_honeycomb.xml
@@ -16,6 +16,6 @@
+ android:drawable="@drawable/keyboard_key_feedback_more_background_holo" />
diff --git a/java/res/layout-xlarge/candidate.xml b/java/res/layout-xlarge/candidate.xml
index 74532a1e2..6d3e4ab17 100644
--- a/java/res/layout-xlarge/candidate.xml
+++ b/java/res/layout-xlarge/candidate.xml
@@ -20,24 +20,24 @@
+ android:gravity="bottom" />
diff --git a/java/res/layout-xlarge/candidates.xml b/java/res/layout-xlarge/candidates.xml
index e2ddb84b1..d10035c9c 100644
--- a/java/res/layout-xlarge/candidates.xml
+++ b/java/res/layout-xlarge/candidates.xml
@@ -22,7 +22,7 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="match_parent"
- android:layout_height="@dimen/candidate_strip_height"
+ android:layout_height="wrap_content"
android:background="@drawable/keyboard_suggest_strip_holo"
android:paddingRight="@dimen/candidate_strip_padding"
android:paddingLeft="@dimen/candidate_strip_padding"
@@ -30,7 +30,7 @@
-
-
-
-
diff --git a/java/res/layout/candidate.xml b/java/res/layout/candidate.xml
index f2c4126b3..78d2750eb 100644
--- a/java/res/layout/candidate.xml
+++ b/java/res/layout/candidate.xml
@@ -20,24 +20,24 @@
+ android:gravity="bottom" />
diff --git a/java/res/layout/candidates.xml b/java/res/layout/candidates.xml
index 1b8d04183..794c4ed42 100644
--- a/java/res/layout/candidates.xml
+++ b/java/res/layout/candidates.xml
@@ -22,7 +22,7 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="match_parent"
- android:layout_height="@dimen/candidate_strip_height"
+ android:layout_height="wrap_content"
android:background="@drawable/keyboard_suggest_strip"
android:paddingRight="@dimen/candidate_strip_padding"
android:paddingLeft="@dimen/candidate_strip_padding"
@@ -30,7 +30,7 @@
diff --git a/java/res/layout/input_stone_normal.xml b/java/res/layout/input_stone_normal.xml
index 6ae9aed55..8baecabdb 100644
--- a/java/res/layout/input_stone_normal.xml
+++ b/java/res/layout/input_stone_normal.xml
@@ -25,6 +25,7 @@
android:layout_alignParentBottom="true"
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:padding="0dip"
android:background="@drawable/keyboard_background"
latin:keyBackground="@drawable/btn_keyboard_key_stone"
@@ -32,5 +33,5 @@
latin:keyTextColorDisabled="#FF808080"
latin:shadowColor="@color/latinkeyboard_key_color_white"
latin:colorScheme="black"
- latin:popupLayout="@layout/input_stone_popup"
+ latin:popupLayout="@layout/keyboard_popup_stone"
/>
diff --git a/java/res/layout/key_preview_honeycomb.xml b/java/res/layout/key_preview_honeycomb.xml
index a90fe5588..2fbfbb517 100644
--- a/java/res/layout/key_preview_honeycomb.xml
+++ b/java/res/layout/key_preview_honeycomb.xml
@@ -23,7 +23,7 @@
android:layout_height="80sp"
android:textSize="40sp"
android:textColor="@color/latinkeyboard_key_color_white"
- android:minWidth="24dip"
+ android:minWidth="32dip"
android:gravity="center"
android:background="@drawable/keyboard_key_feedback_honeycomb"
/>
diff --git a/java/res/layout/keyboard_popup.xml b/java/res/layout/keyboard_popup.xml
index ac8134bfb..013662240 100644
--- a/java/res/layout/keyboard_popup.xml
+++ b/java/res/layout/keyboard_popup.xml
@@ -19,20 +19,19 @@
-->
diff --git a/java/res/values-ar/strings.xml b/java/res/values-ar/strings.xml
index d1d70ff74..4c04fce9a 100644
--- a/java/res/values-ar/strings.xml
+++ b/java/res/values-ar/strings.xml
@@ -106,6 +106,7 @@
"المس الكلمات التي تم إدخالها لتصحيحها، وذلك فقط عندما تكون الاقتراحات مرئية."
"مظهر لوحة المفاتيح"
"لوحة مفاتيح تشيكية"
+ "لوحة المفاتيح العربية"
"لوحة مفاتيح دانماركية"
"لوحة مفاتيح ألمانية"
"لوحة مفاتيح إنجليزية (بريطانيا)"
@@ -115,6 +116,7 @@
"لوحة مفاتيح فرنسية"
"لوحة مفاتيح فرنسية (كندا)"
"لوحة مفاتيح فرنسية (سويسرا)"
+ "لوحة المفاتيح العبرية"
"لوحة مفاتيح إيطالية"
"لوحة مفاتيح نرويجية"
"لوحة مفاتيح بولندية"
diff --git a/java/res/values-bg/strings.xml b/java/res/values-bg/strings.xml
index 418bb18a1..de00621ae 100644
--- a/java/res/values-bg/strings.xml
+++ b/java/res/values-bg/strings.xml
@@ -106,6 +106,7 @@
"Докоснете въведените думи, за да ги поправите – само когато предложенията са видими"
"Тема на клавиатурата"
"чешка клавиатура"
+ "клавиатура на арабски"
"датска клавиатура"
"немска клавиатура"
"английска (Великобрит.) клавиатура"
@@ -115,6 +116,7 @@
"френска клавиатура"
"френска (Канада) клавиатура"
"френска (Швейцария) клавиатура"
+ "клавиатура на иврит"
"италианска клавиатура"
"норвежка клавиатура"
"нидерландска клавиатура"
diff --git a/java/res/values-ca/strings.xml b/java/res/values-ca/strings.xml
index 1bfa3a9ab..2923d1347 100644
--- a/java/res/values-ca/strings.xml
+++ b/java/res/values-ca/strings.xml
@@ -106,6 +106,7 @@
"Toca les paraules introduïdes per corregir-les, només quan els suggeriments siguin visibles"
"Tema del teclat"
"Teclat txec"
+ "Teclat àrab"
"Teclat danès"
"Teclat alemany"
"Teclat anglès (Regne Unit)"
@@ -115,6 +116,7 @@
"Teclat francès"
"Teclat francès (Canadà)"
"Teclat francès (Suïssa)"
+ "Teclat hebreu"
"Teclat italià"
"Teclat noruec"
"Teclat holandès"
diff --git a/java/res/values-cs/strings.xml b/java/res/values-cs/strings.xml
index b0cb7daf7..09e68725c 100644
--- a/java/res/values-cs/strings.xml
+++ b/java/res/values-cs/strings.xml
@@ -106,6 +106,7 @@
"Klepnutím na zadaná slova tato slova opravíte, musí však být viditelné návrhy."
"Motiv klávesnice"
"Klávesnice – čeština"
+ "Klávesnice – arabština"
"Klávesnice – dánština"
"Klávesnice – němčina"
"Klávesnice – angličtina (VB)"
@@ -115,6 +116,7 @@
"Klávesnice – francouzština"
"Klávesnice – francouzština (Kanada)"
"Klávesnice – francouzština (Švýc.)"
+ "Klávesnice – hebrejština"
"Klávesnice – italština"
"Klávesnice – norština"
"Klávesnice – holandština"
diff --git a/java/res/values-da/strings.xml b/java/res/values-da/strings.xml
index eb79888d6..d9d1b43c5 100644
--- a/java/res/values-da/strings.xml
+++ b/java/res/values-da/strings.xml
@@ -106,6 +106,7 @@
"Tryk på de indtastede ord for at rette dem. Kun når der er synlige forslag."
"Tastaturtema"
"Tjekkisk tastatur"
+ "Arabisk tastatur"
"Dansk tastatur"
"Tysk tastatur"
"Engelsk tastatur (Storbritannien)"
@@ -115,6 +116,7 @@
"Fransk tastatur"
"Fransk tastatur (Canada)"
"Fransk tastatur (Schweiz)"
+ "Hebraisk tastatur"
"Italiensk tastatur"
"Norsk tastatur"
"Hollandsk tastatur"
diff --git a/java/res/values-de/strings.xml b/java/res/values-de/strings.xml
index 396d74dd8..74c1041a0 100644
--- a/java/res/values-de/strings.xml
+++ b/java/res/values-de/strings.xml
@@ -40,11 +40,11 @@
"Automatisch"
"Immer anzeigen"
"Immer ausblenden"
- "Auto-Korrektur"
+ "Autokorrektur"
"Korrektur fehlerhafter Wörter durch Leertaste und Satzzeichen"
"Aus"
"Mäßig"
- "Aggressiv"
+ "Stark"
"Bigramm-Vorschläge"
"Zur Verbesserung des Vorschlags vorheriges Wort verwenden"
"%s: gespeichert"
@@ -94,7 +94,7 @@
"Aus"
"Mikro auf Haupttastatur"
"Mikro auf Symboltastatur"
- "Spracheing. deaktiviert"
+ "Spracheingabe deaktiviert"
"Eingabemethode auswählen"
"Eingabesprachen"
"Finger über die Leertaste bewegen, um die Eingabesprache zu wechseln"
@@ -106,6 +106,7 @@
"Tippen Sie zum Korrigieren auf eingegebene Wörter (nur, wenn Vorschläge angezeigt werden)."
"Tastaturdesign"
"Tschechische Tastatur"
+ "Arabische Tastatur"
"Dänische Tastatur"
"Deutsche Tastatur"
"Englische Tastatur (GB)"
@@ -115,6 +116,7 @@
"Französische Tastatur"
"Französische Tastatur (Kanada)"
"Französische Tastatur (Schweiz)"
+ "Hebräische Tastatur"
"Italienische Tastatur"
"Norwegische Tastatur"
"Niederländische Tastatur"
diff --git a/java/res/values-el/strings.xml b/java/res/values-el/strings.xml
index 6d0869bf1..70f1d48c5 100644
--- a/java/res/values-el/strings.xml
+++ b/java/res/values-el/strings.xml
@@ -106,6 +106,7 @@
"Αγγίξτε τις λέξες για να τις διορθώσετε, μόνο όταν οι προτάσεις είναι ορατές"
"Θέμα πληκτρολογίου"
"Τσεχικό πληκτρολόγιο"
+ "Πληκτρολόγιο με αραβική γραφή"
"Δανικό πληκτρολόγιο"
"Γερμανικό πληκτρολόγιο"
"Αγγλικό (ΗΒ) πληκτρολόγιο"
@@ -115,6 +116,7 @@
"Γαλλικό πληκτρολόγιο"
"Γαλλικό (Καναδάς) πληκτρολόγιο"
"Γαλλικό (Ελβετία) πληκτρολόγιο"
+ "Πληκτρολόγιο με εβραϊκή γραφή"
"Ιταλικό πληκτρολόγιο"
"Νορβηγικό πληκτρολόγιο"
"Ολλανδικό πληκτρολόγιο"
diff --git a/java/res/values-en-rGB/strings.xml b/java/res/values-en-rGB/strings.xml
index b2e62b0cd..64006345a 100644
--- a/java/res/values-en-rGB/strings.xml
+++ b/java/res/values-en-rGB/strings.xml
@@ -106,6 +106,7 @@
"Touch words entered to correct them, only when suggestions are visible"
"Keyboard Theme"
"Czech Keyboard"
+ "Arabic Keyboard"
"Danish Keyboard"
"German Keyboard"
"English (UK) Keyboard"
@@ -115,6 +116,7 @@
"French Keyboard"
"French (Canada) Keyboard"
"French (Switzerland) Keyboard"
+ "Hebrew Keyboard"
"Italian Keyboard"
"Norwegian Keyboard"
"Dutch Keyboard"
diff --git a/java/res/values-es-rUS/strings.xml b/java/res/values-es-rUS/strings.xml
index 02f36ff79..a00005098 100644
--- a/java/res/values-es-rUS/strings.xml
+++ b/java/res/values-es-rUS/strings.xml
@@ -106,6 +106,7 @@
"Toca las palabras ingresadas que desees corregir solo cuando las sugerencias estén visibles."
"Tema del teclado"
"Teclado en checo"
+ "Teclado árabe"
"Teclado en danés"
"Teclado en alemán"
"Teclado en inglés (Reino Unido)"
@@ -115,6 +116,7 @@
"Teclado en francés"
"Teclado en francés (Canadá)"
"Teclado en francés (Suiza)"
+ "Teclado hebreo"
"Teclado en italiano"
"Teclado en noruego"
"Teclado en holandés"
diff --git a/java/res/values-es/strings.xml b/java/res/values-es/strings.xml
index f9a86ffd6..b5439d453 100644
--- a/java/res/values-es/strings.xml
+++ b/java/res/values-es/strings.xml
@@ -106,6 +106,7 @@
"Toca las palabras introducidas para corregirlas, solo cuando las sugerencias sean visibles."
"Tema de teclado"
"Teclado checo"
+ "Teclado árabe"
"Teclado danés"
"Teclado alemán"
"Teclado inglés (Reino Unido)"
@@ -115,6 +116,7 @@
"Teclado francés"
"Teclado francés (Canadá)"
"Teclado francés (Suiza)"
+ "Teclado hebreo"
"Teclado italiano"
"Teclado noruego"
"Teclado holandés"
diff --git a/java/res/values-fa/strings.xml b/java/res/values-fa/strings.xml
index b594411ac..ca7c1412d 100644
--- a/java/res/values-fa/strings.xml
+++ b/java/res/values-fa/strings.xml
@@ -106,6 +106,7 @@
"فقط هنگامی که پیشنهادات قابل مشاهده هستند، برای تصحیح کلمات وارد شده آنها را لمس کنید"
"طرح زمینه صفحه کلید"
"صفحه کلید چک"
+ "صفحه کلید عربی"
"صفحه کلید دانمارکی"
"صفحه کلید آلمانی"
"صفحه کلید انگلیسی (بریتانیایی)"
@@ -115,6 +116,7 @@
"صفحه کلید فرانسوی"
"صفحه کلید فرانسوی (کانادایی)"
"صفحه کلید فرانسوی (سوئیس)"
+ "صفحه کلید عبری"
"صفحه کلید ایتالیایی"
"صفحه کلید نروژی"
"صفحه کلید هلندی"
diff --git a/java/res/values-fi/strings.xml b/java/res/values-fi/strings.xml
index 0bf385552..56d2df721 100644
--- a/java/res/values-fi/strings.xml
+++ b/java/res/values-fi/strings.xml
@@ -106,6 +106,7 @@
"Korjaa annetut sanat napauttamalla. (Vain, kun ehdotuksia on näkyvillä.)"
"Näppäimistön teema"
"Näppäimistö: tšekki"
+ "Arabiankielinen näppäimistö"
"Näppäimistö: tanska"
"Näppäimistö: saksa"
"Näppäimistö: englanti (UK)"
@@ -115,6 +116,7 @@
"Näppäimistö: ranska"
"Näppäimistö: ranska (Kanada)"
"Näppäimistö: ranska (Sveitsi)"
+ "Hepreankielinen näppäimistö"
"Näppäimistö: italia"
"Näppäimistö: norja"
"Näppäimistö: hollanti"
diff --git a/java/res/values-fr/strings.xml b/java/res/values-fr/strings.xml
index b7aac9445..86e37b32d 100644
--- a/java/res/values-fr/strings.xml
+++ b/java/res/values-fr/strings.xml
@@ -40,7 +40,7 @@
"Automatique"
"Toujours afficher"
"Toujours masquer"
- "Correction auto"
+ "Correction auto."
"Corriger autom. orthographe (pression sur barre espace/signes ponctuation)"
"Désactiver"
"Simple"
@@ -106,6 +106,7 @@
"Appuyer sur les mots saisis pour les corriger, uniquement lorsque des suggestions sont visibles"
"Thème du clavier"
"Clavier tchèque"
+ "Clavier arabe"
"Clavier danois"
"Clavier allemand"
"Clavier anglais (Royaume-Uni)"
@@ -115,6 +116,7 @@
"Clavier français"
"Clavier français (Canada)"
"Clavier français (Suisse)"
+ "Clavier hébreu"
"Clavier italien"
"Clavier norvégien"
"Clavier néerlandais"
diff --git a/java/res/values-hr/strings.xml b/java/res/values-hr/strings.xml
index e6879a6d1..24e70cf8e 100644
--- a/java/res/values-hr/strings.xml
+++ b/java/res/values-hr/strings.xml
@@ -106,6 +106,7 @@
"Dodirnite unesene riječi da biste ih ispravili samo kada su prijedlozi vidljivi"
"Tema tipkovnice"
"Češka tipkovnica"
+ "Arapska tipkovnica"
"Danska tipkovnica"
"Njemačka tipkovnica"
"Engleska (UK) tipkovnica"
@@ -115,6 +116,7 @@
"Francuska tipkovnica"
"Francuska (Kanada) tipkovnica"
"Francuska (Švicarska) tipkovnica"
+ "Hebrejska tipkovnica"
"Talijanska tipkovnica"
"Norveška tipkovnica"
"Nizozemska tipkovnica"
diff --git a/java/res/values-hu/strings.xml b/java/res/values-hu/strings.xml
index a8bf98367..cfcdf45ad 100644
--- a/java/res/values-hu/strings.xml
+++ b/java/res/values-hu/strings.xml
@@ -106,6 +106,7 @@
"A beírt szavakat csak akkor javíthatja ki megérintve, ha látszanak javaslatok"
"Billentyűzettéma"
"Cseh billentyűzet"
+ "Arab billentyűzet"
"Dán billentyűzet"
"Német billentyűzet"
"Angol (UK) billentyűzet"
@@ -115,6 +116,7 @@
"Francia billentyűzet"
"Francia (kanadai) billentyűzet"
"Francia (svájci) billentyűzet"
+ "Héber billentyűzet"
"Olasz billentyűzet"
"Norvég billentyűzet"
"Holland billentyűzet"
diff --git a/java/res/values-in/strings.xml b/java/res/values-in/strings.xml
index 4df7f1e7f..5dfcbf0ff 100644
--- a/java/res/values-in/strings.xml
+++ b/java/res/values-in/strings.xml
@@ -106,6 +106,7 @@
"Sentuh kata yang dimasukkan untuk memperbaikinya, hanya saat saran dapat dilihat"
"Tema Keyboard"
"Keyboard Cheska"
+ "Papan Tombol Arab"
"Keyboard Denmark"
"Keyboard Jerman"
"Keyboard Inggris (Britania Raya)"
@@ -115,6 +116,7 @@
"Keyboard Prancis"
"Keyboard Prancis (Kanada)"
"Keyboard Prancis (Swiss)"
+ "Papan tombol Ibrani"
"Keyboard Italia"
"Keyboard Norwegia"
"Keyboard Belanda"
diff --git a/java/res/values-it/strings.xml b/java/res/values-it/strings.xml
index 9bf4f9e30..64bbf654b 100644
--- a/java/res/values-it/strings.xml
+++ b/java/res/values-it/strings.xml
@@ -106,6 +106,7 @@
"Tocca le parole inserite per correggerle, solo quando sono visibili i suggerimenti"
"Tema della tastiera"
"Tastiera ceca"
+ "Tastiera araba"
"Tastiera danese"
"Tastiera tedesca"
"Tastiera inglese (Regno Unito)"
@@ -115,6 +116,7 @@
"Tastiera francese"
"Tastiera francese (Canada)"
"Tastiera francese (Svizzera)"
+ "Tastiera ebraica"
"Tastiera italiana"
"Tastiera norvegese"
"Tastiera olandese"
diff --git a/java/res/values-iw/strings.xml b/java/res/values-iw/strings.xml
index af0854c97..2ad86c910 100644
--- a/java/res/values-iw/strings.xml
+++ b/java/res/values-iw/strings.xml
@@ -106,6 +106,7 @@
"גע במילים שהוזנו כדי לתקן אותן, רק כאשר הצעות מוצגות"
"עיצוב מקלדת"
"מקלדת צ\'כית"
+ "מקלדת בשפה הערבית"
"מקלדת דנית"
"מקלדת גרמנית "
"מקלדת אנגלית (בריטניה)"
@@ -115,6 +116,7 @@
"מקלדת צרפתית"
"מקלדת צרפתית (קנדה)"
"מקלדת צרפתית (שוויץ)"
+ "מקלדת בשפה העברית"
"מקלדת איטלקית"
"מקלדת נורווגית"
"מקלדת הולנדית"
diff --git a/java/res/values-ja/strings.xml b/java/res/values-ja/strings.xml
index cd2cf8070..768122c60 100644
--- a/java/res/values-ja/strings.xml
+++ b/java/res/values-ja/strings.xml
@@ -106,6 +106,7 @@
"候補が表示されているときのみ、入力した語句をタップして修正する"
"キーボードテーマ"
"チェコ語のキーボード"
+ "アラビア語のキーボード"
"デンマーク語のキーボード"
"ドイツ語のキーボード"
"英語(英国)のキーボード"
@@ -115,6 +116,7 @@
"フランス語のキーボード"
"フランス語(カナダ)のキーボード"
"フランス語(スイス)のキーボード"
+ "ヘブライ語のキーボード"
"イタリア語のキーボード"
"ノルウェー語のキーボード"
"オランダ語のキーボード"
diff --git a/java/res/values-ko/strings.xml b/java/res/values-ko/strings.xml
index 7a09da880..850981cca 100644
--- a/java/res/values-ko/strings.xml
+++ b/java/res/values-ko/strings.xml
@@ -106,6 +106,7 @@
"입력한 단어를 터치하여 수정(추천 단어가 표시되는 경우에만)"
"키보드 테마"
"체코어 키보드"
+ "아랍어 키보드"
"덴마크어 키보드"
"독일어 키보드"
"영어(영국) 키보드"
@@ -115,6 +116,7 @@
"프랑스어 키보드"
"프랑스어(캐나다) 키보드"
"프랑스어(스위스) 키보드"
+ "히브리어 키보드"
"이탈리아어 키보드"
"노르웨이어 키보드"
"네덜란드어 키보드"
diff --git a/java/res/values-land/dimens.xml b/java/res/values-land/dimens.xml
index 7df124bfc..6954ba2ae 100644
--- a/java/res/values-land/dimens.xml
+++ b/java/res/values-land/dimens.xml
@@ -27,6 +27,7 @@
0.270in
0.0in
0.0in
+ 0.0in
38dip
63dip
2dip
diff --git a/java/res/values-lt/strings.xml b/java/res/values-lt/strings.xml
index c12c62aaa..247e201fb 100644
--- a/java/res/values-lt/strings.xml
+++ b/java/res/values-lt/strings.xml
@@ -106,6 +106,7 @@
"Jei norite ištaisyti įvestus žodžius, palieskite juos tik tada, kai matomi pasiūlymai"
"Klaviatūros tema"
"Čekiška klaviatūra"
+ "Arabiška klaviatūra"
"Daniška klaviatūra"
"Vokiška klaviatūra"
"Angliška (JK) klaviatūra"
@@ -115,6 +116,7 @@
"Prancūziška klaviatūra"
"Prancūziška (Kanada) klaviatūra"
"Prancūziška (Šveicarija) klaviatūra"
+ "Hebrajiška klaviatūra"
"Itališka klaviatūra"
"Norvegiška klaviatūra"
"Olandiška klaviatūra"
diff --git a/java/res/values-lv/strings.xml b/java/res/values-lv/strings.xml
index 8b975b033..5d0c0ae7e 100644
--- a/java/res/values-lv/strings.xml
+++ b/java/res/values-lv/strings.xml
@@ -106,6 +106,7 @@
"Pieskarties ievadītajiem vārdiem, lai tos labotu (tikai tad, ja tiek rādīti ieteikumi)."
"Tastatūras motīvs"
"Čehu tastatūra"
+ "Arābu tastatūra"
"Dāņu tastatūra"
"Vācu tastatūra"
"Angļu (Lielbritānija) tastatūra"
@@ -115,6 +116,7 @@
"Franču tastatūra"
"Franču (Kanāda) tastatūra"
"Franču (Šveices) tastatūra"
+ "Ebreju tastatūra"
"Itāļu tastatūra"
"Norvēģu tastatūra"
"Holandiešu tastatūra"
diff --git a/java/res/values-nb/strings.xml b/java/res/values-nb/strings.xml
index 0471e74c3..944e8dd5a 100644
--- a/java/res/values-nb/strings.xml
+++ b/java/res/values-nb/strings.xml
@@ -106,6 +106,7 @@
"Når forslag er synlige, kan du trykke på ord du har skrevet inn, for å endre dem"
"Tastaturtema"
"Tsjekkisk tastatur"
+ "Arabisk tastatur"
"Dansk tastatur"
"Tysk tastatur"
"Engelsk tastatur (Storbritannia)"
@@ -115,6 +116,7 @@
"Fransk tastatur"
"Fransk tastatur (Canada)"
"Fransk tastatur (Sveits)"
+ "Hebraisk tastatur"
"Italiensk tastatur"
"Norsk tastatur"
"Nederlandsk tastatur"
diff --git a/java/res/values-nl/strings.xml b/java/res/values-nl/strings.xml
index e5439eb38..e52ad2e2a 100644
--- a/java/res/values-nl/strings.xml
+++ b/java/res/values-nl/strings.xml
@@ -106,6 +106,7 @@
"Ingevoerde woorden aanraken om ze te verbeteren, alleen mogelijk wanneer suggesties zichtbaar zijn"
"Toetsenbordthema"
"Tsjechisch toetsenbord"
+ "Arabisch toetsenbord"
"Deens toetsenbord"
"Duits toetsenbord"
"Engels toetsenbord (VK)"
@@ -115,6 +116,7 @@
"Frans toetsenbord"
"Frans toetsenbord (Canada)"
"Frans toetsenbord (Zwitserland)"
+ "Hebreeuws toetsenbord"
"Italiaans toetsenbord"
"Noors toetsenbord"
"Nederlands toetsenbord"
diff --git a/java/res/values-pl/strings.xml b/java/res/values-pl/strings.xml
index 7edd98840..b0c707f35 100644
--- a/java/res/values-pl/strings.xml
+++ b/java/res/values-pl/strings.xml
@@ -41,7 +41,7 @@
"Zawsze pokazuj"
"Zawsze ukrywaj"
"Autokorekta"
- "Spacja i znaki przestankowe powodują automatyczne poprawianie błędnie napisanych słów"
+ "Spacja i znaki przestankowe poprawiają błędnie wpisane słowa"
"Wyłącz"
"Umiarkowana"
"Agresywna"
@@ -71,7 +71,7 @@
"Wprowadzanie głosowe"
"Wprowadzanie głosowe obecnie nie jest obsługiwane w Twoim języku, ale działa w języku angielskim."
"Funkcja wprowadzania głosowego wykorzystuje mechanizm rozpoznawania mowy. Obowiązuje ""Polityka prywatności Google Mobile""."
- "Aby wyłączyć wprowadzanie głosowe, przejdź do ustawień metody wprowadzania."
+ "Aby wyłączyć rozpoznawanie mowy, przejdź do ustawień sposobu wprowadzania tekstu."
"Aby użyć wprowadzania głosowego, naciśnij przycisk mikrofonu."
"Mów teraz"
"W toku"
@@ -95,17 +95,18 @@
"Mikrofon na klawiaturze głównej"
"Mikrofon na klawiaturze z symbolami"
"Wprowadzanie głosowe jest wyłączone"
- "Wybierz metodę wprowadzania"
+ "Wybierz sposób wprowadzania tekstu"
"Języki wprowadzania"
"Przesuń palcem po spacji, aby zmienić język"
"← Dotknij ponownie, aby zapisać"
"Słownik dostępny"
"Włącz przesyłanie opinii użytkownika"
- "Pomóż ulepszyć edytor tej metody wprowadzania, automatycznie wysyłając do Google statystyki użycia i raporty o awariach."
+ "Pomóż ulepszyć edytor wprowadzania tekstu, automatycznie wysyłając do Google statystyki użycia i raporty o awariach."
"Popraw dotknięte słowo"
"Dotykaj wprowadzonych słów, aby je poprawiać tylko wówczas, gdy widoczne są sugestie."
"Motyw klawiatury"
"Klawiatura czeska"
+ "Klawiatura arabska"
"Klawiatura duńska"
"Klawiatura niemiecka"
"Klawiatura angielska (UK)"
@@ -115,6 +116,7 @@
"Klawiatura francuska"
"Klawiatura francuska (Kanada)"
"Klawiatura francuska (Szwajcaria)"
+ "Klawiatura hebrajska"
"Klawiatura włoska"
"Klawiatura norweska"
"Klawiatura holenderska"
diff --git a/java/res/values-pt-rPT/strings.xml b/java/res/values-pt-rPT/strings.xml
index f06d64c70..83686662b 100644
--- a/java/res/values-pt-rPT/strings.xml
+++ b/java/res/values-pt-rPT/strings.xml
@@ -106,6 +106,7 @@
"Tocar nas palavras introduzidas para as corrigir, apenas quando as sugestões estiverem visíveis"
"Tema do teclado"
"Teclado checo"
+ "Teclado árabe"
"Teclado dinamarquês"
"Teclado alemão"
"Teclado inglês (Reino Unido)"
@@ -115,6 +116,7 @@
"Teclado francês"
"Teclado francês (Canadá)"
"Teclado francês (Suíça)"
+ "Teclado hebraico"
"Teclado italiano"
"Teclado norueguês"
"Teclado holandês"
diff --git a/java/res/values-pt/strings.xml b/java/res/values-pt/strings.xml
index 9fc1a97f2..0d09b1119 100644
--- a/java/res/values-pt/strings.xml
+++ b/java/res/values-pt/strings.xml
@@ -106,6 +106,7 @@
"Toque nas palavras digitadas para corrigi-las apenas quando as sugestões estiverem visíveis"
"Tema do teclado"
"Teclado em tcheco"
+ "Teclado árabe"
"Teclado para dinamarquês"
"Teclado para alemão"
"Teclado para inglês (Reino Unido)"
@@ -115,6 +116,7 @@
"Teclado para francês"
"Teclado para francês (Canadá)"
"Teclado para francês (Suíça)"
+ "Teclado hebraico"
"Teclado para italiano"
"Teclado para norueguês"
"Teclado para holandês"
diff --git a/java/res/values-rm/strings.xml b/java/res/values-rm/strings.xml
index 57548b5e4..c788597d6 100644
--- a/java/res/values-rm/strings.xml
+++ b/java/res/values-rm/strings.xml
@@ -146,6 +146,8 @@
"Design da la tastatura"
+
+
@@ -164,6 +166,8 @@
+
+
diff --git a/java/res/values-ro/strings.xml b/java/res/values-ro/strings.xml
index 52bed2785..a0b5df381 100644
--- a/java/res/values-ro/strings.xml
+++ b/java/res/values-ro/strings.xml
@@ -106,6 +106,7 @@
"Atingeţi cuvintele introduse pentru a le corecta, numai când pot fi văzute sugestii"
"Temă pentru tastatură"
"Tastatură cehă"
+ "Tastatură arabă"
"Tastatură daneză"
"Tastatură germană"
"Tastatură engleză (Marea Britanie)"
@@ -115,6 +116,7 @@
"Tastatură franceză"
"Tastatură franceză (Canada)"
"Tastatură franceză (Elveţia)"
+ "Tastatură ebraică"
"Tastatură italiană"
"Tastatură norvegiană"
"Tastatură olandeză"
diff --git a/java/res/values-ru/strings.xml b/java/res/values-ru/strings.xml
index 21fd02bd3..c1e379dd9 100644
--- a/java/res/values-ru/strings.xml
+++ b/java/res/values-ru/strings.xml
@@ -28,7 +28,7 @@
"Увеличение нажатых"
"Общие"
"Коррекция текста"
- "Автоподст. заглавных"
+ "Заглавные автоматически"
"Быстрое исправление"
"Исправлять распространенные опечатки"
"Показать варианты исправлений"
@@ -94,7 +94,7 @@
"Выкл."
"Значок на основной клавиатуре"
"Значок на клавиатуре символов"
- "Голосовой ввод отключен"
+ "Голосовой ввод откл."
"Выбрать способ ввода"
"Языки ввода"
"Для изменения языка проведите пальцем по пробелу"
@@ -106,6 +106,7 @@
"Нажмите на слово, чтобы исправить его (при наличии подсказок)"
"Вид клавиатуры"
"Клавиатура: чешская"
+ "Арабская клавиатура"
"Клавиатура: датская"
"Клавиатура: немецкая"
"Клавиатура: английская (Великобритания)"
@@ -115,6 +116,7 @@
"Клавиатура: французская"
"Клавиатура: французская"
"Клавиатура: французская (Швейцария)"
+ "Клавиатура на иврите"
"Клавиатура: итальянская"
"Клавиатура: норвежская"
"Клавиатура: голландская"
diff --git a/java/res/values-sk/strings.xml b/java/res/values-sk/strings.xml
index 569f273a4..20e29764a 100644
--- a/java/res/values-sk/strings.xml
+++ b/java/res/values-sk/strings.xml
@@ -106,6 +106,7 @@
"Dotykom zadaných slov tieto slová opravíte, musia však byť viditeľné návrhy"
"Motív klávesnice"
"klávesnica – čeština"
+ "klávesnica – arabčina"
"klávesnica – dánčina"
"klávesnica – nemčina"
"klávesnica – angličtina (br.)"
@@ -115,6 +116,7 @@
"klávesnica – francúzština"
"klávesnica – francúzština (Kanada)"
"klávesnica – francúzština (Švajč.)"
+ "klávesnica – hebrejčina"
"klávesnica – taliančina"
"klávesnica – nórčina"
"klávesnica – holandčina"
diff --git a/java/res/values-sl/strings.xml b/java/res/values-sl/strings.xml
index 715e6c567..12df259da 100644
--- a/java/res/values-sl/strings.xml
+++ b/java/res/values-sl/strings.xml
@@ -106,6 +106,7 @@
"Dotaknite se vnesenih besed in jih popravite, samo ko so predlogi vidni"
"Tema tipkovnice"
"Češka tipkovnica"
+ "Arabska tipkovnica"
"Danska tipkovnica"
"Nemška tipkovnica"
"Tipkovnica za britansko angleščino"
@@ -115,6 +116,7 @@
"Francoska tipkovnica"
"Tipkovnica za kanadsko francoščino"
"Tipkovnica za švicarsko francoščino"
+ "Hebrejska tipkovnica"
"Italijanska tipkovnica"
"Norveška tipkovnica"
"Nizozemska tipkovnica"
diff --git a/java/res/values-sr/strings.xml b/java/res/values-sr/strings.xml
index 115732779..1e637fd01 100644
--- a/java/res/values-sr/strings.xml
+++ b/java/res/values-sr/strings.xml
@@ -106,6 +106,7 @@
"Додирните унете речи да бисте их исправили само када су предлози видљиви"
"Тема тастатуре"
"Језик тастатуре: чешки"
+ "Језик тастатуре: арапски"
"Језик тастатуре: дански"
"Језик тастатуре: немачки"
"Језик тастатуре: енглески (УК)"
@@ -115,6 +116,7 @@
"Језик тастатуре: француски"
"Језик тастатуре: француски (Канада)"
"Језик тастатуре: француски (Швајц.)"
+ "Језик тастатуре: хебрејски"
"Језик тастатуре: италијански"
"Језик тастатуре: норвешки"
"Језик тастатуре: холандски"
diff --git a/java/res/values-sv/strings.xml b/java/res/values-sv/strings.xml
index b8c62f46e..fc311e7ff 100644
--- a/java/res/values-sv/strings.xml
+++ b/java/res/values-sv/strings.xml
@@ -106,6 +106,7 @@
"Tryck på skrivna ord om du vill korrigera dem, endast när förslag visas"
"Tangentbordstema"
"Tjeckiskt tangentbord"
+ "Arabiskt tangentbord"
"Danskt tangentbord"
"Tyskt tangentbord"
"Engelskt tangentbord (Storbrit.)"
@@ -115,6 +116,7 @@
"Franskt tangentbord"
"Franskt tangentbord (Kanada)"
"Franskt tangentbord (Schweiz)"
+ "Hebreiskt tangentbord"
"Italienskt tangentbord"
"Norskt tangentbord"
"Holländskt tangentbord"
diff --git a/java/res/values-th/strings.xml b/java/res/values-th/strings.xml
index 836b98724..c19b7d538 100644
--- a/java/res/values-th/strings.xml
+++ b/java/res/values-th/strings.xml
@@ -106,6 +106,7 @@
"แตะคำที่ป้อนไว้เพื่อแก้ไข เฉพาะเมื่อเห็นข้อเสนอแนะเท่านั้น"
"ชุดรูปแบบแป้นพิมพ์"
"แป้นพิมพ์ภาษาเช็ก"
+ "แป้นพิมพ์ภาษาอาหรับ"
"แป้นพิมพ์ภาษาเดนมาร์ก"
"แป้นพิมพ์ภาษาเยอรมัน"
"แป้นพิมพ์ภาษาอังกฤษ (สหราชอาณาจักร)"
@@ -115,6 +116,7 @@
"แป้นพิมพ์ภาษาฝรั่งเศส"
"แป้นพิมพ์ภาษาฝรั่งเศส (แคนาดา)"
"แป้นพิมพ์ภาษาฝรั่งเศส (สวิตเซอร์แลนด์)"
+ "แป้นพิมพ์ภาษาฮิบรู"
"แป้นพิมพ์ภาษาอิตาลี"
"แป้นพิมพ์ภาษานอร์เวย์"
"แป้นพิมพ์ภาษาดัตช์"
diff --git a/java/res/values-tl/strings.xml b/java/res/values-tl/strings.xml
index 55f98de10..ce9abf8bd 100644
--- a/java/res/values-tl/strings.xml
+++ b/java/res/values-tl/strings.xml
@@ -106,6 +106,7 @@
"Pindutin ang mga inilagay na salita upang iwasto ang mga ito, kapag nakikita lang ang mga suhestiyon"
"Tema ng Keyboard"
"Czech na Keyboard"
+ "Arabic na Keyboard"
"Danish na Keyboard"
"German na Keyboard"
"Ingles (UK) na Keyboard"
@@ -115,6 +116,7 @@
"French na Keyboard"
"French (Canada) na Keyboard"
"French (Switzerland) na Keyboard"
+ "Hebrew na Keyboard"
"Italian na Keyboard"
"Norwegian na Keyboard"
"Dutch na Keyboard"
diff --git a/java/res/values-tr/strings.xml b/java/res/values-tr/strings.xml
index 1baed4de6..da8b287d3 100644
--- a/java/res/values-tr/strings.xml
+++ b/java/res/values-tr/strings.xml
@@ -94,7 +94,7 @@
"Kapalı"
"Ana klavyede mikrfn"
"Simge klavysnd mikrf"
- "Sesle giriş devr dşı"
+ "Sesle grş devre dışı"
"Giriş yöntemini seç"
"Giriş dilleri"
"Dili değiştirmek için parmağınızı boşluk çubuğu üzerinde kaydırın"
@@ -106,6 +106,7 @@
"Yalnızca öneriler görünür olduğunda, düzeltmek için girilen kelimelere dokunun"
"Klavye Teması"
"Çekçe Klavye"
+ "Arapça Klavye"
"Danca Klavye"
"Almanca Klavye"
"İngilizce (İngiltere) Klavye"
@@ -115,6 +116,7 @@
"Fransızca Klavye"
"Fransızca (Kanada) Klavye"
"Fransızca (İsviçre) Klavye"
+ "İbranice Klavye"
"İtalyanca Klavye"
"Norveççe Klavye"
"Felemenkçe Klavye"
diff --git a/java/res/values-uk/strings.xml b/java/res/values-uk/strings.xml
index 26906329a..53063393a 100644
--- a/java/res/values-uk/strings.xml
+++ b/java/res/values-uk/strings.xml
@@ -106,6 +106,7 @@
"Торкніться введених слів, щоб виправити їх, лише коли ввімкнено пропозиції"
"Тема клавіатури"
"Чеська розкладка"
+ "Розкладка для арабської мови"
"Данська розкладка"
"Німецька розкладка"
"Англ. розкладка (Великобританія)"
@@ -115,6 +116,7 @@
"Французька розкладка"
"Французька розкладка (Канада)"
"Французька розкладка (Швейцарія)"
+ "Розкладка для івриту"
"Італійська розкладка"
"Норвезька розкладка"
"Голланд. розклад."
diff --git a/java/res/values-vi/strings.xml b/java/res/values-vi/strings.xml
index 70defe3b7..0473464b5 100644
--- a/java/res/values-vi/strings.xml
+++ b/java/res/values-vi/strings.xml
@@ -106,6 +106,7 @@
"Chạm các từ đã nhập để sửa, chỉ khi các đề xuất hiển thị"
"Chủ đề bàn phím"
"Bàn phím tiếng Séc"
+ "Bàn phím tiếng Ả Rập"
"Bàn phím tiếng Đan Mạch"
"Bàn phím tiếng Đức"
"Bàn phím tiếng Anh (Anh)"
@@ -115,6 +116,7 @@
"Bàn phím tiếng Pháp"
"Bàn phím tiếng Pháp (Canada)"
"Bàn phím tiếng Pháp (Thụy Sĩ)"
+ "Bàn phím tiếng Do Thái"
"Bàn phím tiếng Ý"
"Bàn phím tiếng Na Uy"
"Bàn phím tiếng Hà Lan"
diff --git a/java/res/values-xlarge-land/dimens.xml b/java/res/values-xlarge-land/dimens.xml
index 625dd263c..fd6b1f386 100644
--- a/java/res/values-xlarge-land/dimens.xml
+++ b/java/res/values-xlarge-land/dimens.xml
@@ -19,7 +19,7 @@
-->
-
+
58.0mm
@@ -28,12 +28,14 @@
13.0mm
1.1mm
0.0mm
-
- 13.0mm
+ 0.0mm
28dip
20dip
18dip
+ 26.5mm
+ 7.5mm
+
40.0mm
diff --git a/java/res/values-xlarge/config.xml b/java/res/values-xlarge/config.xml
index f075b1b50..ed8dc3e52 100644
--- a/java/res/values-xlarge/config.xml
+++ b/java/res/values-xlarge/config.xml
@@ -22,7 +22,8 @@
false
false
false
- false
+
+ true
false
false
false
diff --git a/java/res/values-xlarge/dimens.xml b/java/res/values-xlarge/dimens.xml
index 69283202e..0dc5621ff 100644
--- a/java/res/values-xlarge/dimens.xml
+++ b/java/res/values-xlarge/dimens.xml
@@ -19,7 +19,7 @@
-->
-
+
48.0mm
@@ -28,8 +28,8 @@
10.0mm
1.1mm
0.0mm
-
- 13.0mm
+ 0.0mm
+ 40dip
12dip
@@ -39,9 +39,11 @@
26dip
16dip
- 24dip
6dip
+ 24dip
+ 23.0mm
+ 8.0mm
46dip
15.0mm
diff --git a/java/res/values-zh-rCN/strings.xml b/java/res/values-zh-rCN/strings.xml
index 3b092bfcc..5578566a2 100644
--- a/java/res/values-zh-rCN/strings.xml
+++ b/java/res/values-zh-rCN/strings.xml
@@ -106,6 +106,7 @@
"仅在系统显示建议后,才触摸输入的字词进行更正"
"键盘主题"
"捷克语键盘"
+ "阿拉伯语键盘"
"丹麦语键盘"
"德语键盘"
"英语(英国)键盘"
@@ -115,6 +116,7 @@
"法语键盘"
"法语(加拿大)键盘"
"法语(瑞士)键盘"
+ "希伯来语键盘"
"意大利语键盘"
"挪威语键盘"
"荷兰语键盘"
diff --git a/java/res/values-zh-rTW/strings.xml b/java/res/values-zh-rTW/strings.xml
index c9c7ae88a..591c137f1 100644
--- a/java/res/values-zh-rTW/strings.xml
+++ b/java/res/values-zh-rTW/strings.xml
@@ -106,6 +106,7 @@
"輕觸輸入的字詞即可加以修正 (出現建議時才適用)"
"鍵盤主題"
"捷克文鍵盤"
+ "阿拉伯文鍵盤"
"丹麥文鍵盤"
"德文鍵盤"
"英文 (英國) 鍵盤"
@@ -115,6 +116,7 @@
"法文鍵盤"
"法文 (加拿大) 鍵盤"
"法文 (瑞士) 鍵盤"
+ "希伯來文鍵盤"
"義大利文鍵盤"
"挪威文鍵盤"
"荷蘭文鍵盤"
diff --git a/java/res/values/attrs.xml b/java/res/values/attrs.xml
index f0da2744b..9b38139f0 100644
--- a/java/res/values/attrs.xml
+++ b/java/res/values/attrs.xml
@@ -107,8 +107,8 @@
-
-
+
+
@@ -142,6 +142,9 @@
+
+
+
diff --git a/java/res/values/colors.xml b/java/res/values/colors.xml
index 0161589a4..733a464cc 100644
--- a/java/res/values/colors.xml
+++ b/java/res/values/colors.xml
@@ -21,11 +21,9 @@
#FFFFFFFF
#FFFCAE00
#FFFCAE00
- #00000000
#80000000
#80FFFFFF
#FFC0C0C0
- #A0000000
#FFFFFFFF
#FFFFFFFF
#FF000000
diff --git a/java/res/values/dimens.xml b/java/res/values/dimens.xml
index 7f00cdba3..767dc4aa9 100644
--- a/java/res/values/dimens.xml
+++ b/java/res/values/dimens.xml
@@ -19,7 +19,7 @@
-->
-
+
1.265in
@@ -28,25 +28,29 @@
0.325in
0.00in
0.06in
-
- 80sp
+ 0.0in
+ 16dip
+ 32dip
8dip
0.390in
-0.325in
-
- 0.13in
- 0.083in
- 40sp
-
- 0.13in
- 0.000in
-0.05in
+ 0.13in
+ 0.083in
+
+ 0.13in
+ 80sp
+ 0.000in
+ 36sp
+ 130sp
+ 0.193in
+
42dip
63dip
0dip
diff --git a/java/res/values/donottranslate-altchars.xml b/java/res/values/donottranslate-altchars.xml
index 518e74af1..621a2ea92 100644
--- a/java/res/values/donottranslate-altchars.xml
+++ b/java/res/values/donottranslate-altchars.xml
@@ -47,11 +47,7 @@
¢,£,€,¥,₱
¢,£,$,¥,₱
¢,$,€,¥,₱
- "\@drawable/sym_keyboard_settings|\@integer/key_settings,\@drawable/sym_keyboard_mic|\@integer/key_voice"
":-)|:-) ,:-(|:-( ,;-)|;-) ,:-P|:-P ,=-O|=-O ,:-*|:-* ,:O|:O ,B-)|B-) ,:-$|:-$ ,:-!|:-! ,:-[|:-[ ,O:-)|O:-) ,:-\\\\\\\\|:-\\\\\\\\ ,:\'(|:\'( ,:-D|:-D "
- "\@drawable/sym_keyboard_settings|\@integer/key_settings,/"
- "\@drawable/sym_keyboard_settings|\@integer/key_settings,\@"
- "\@drawable/sym_keyboard_settings|\@integer/key_settings,\\,"
":,/,&,(,),-,+,;,\@,\',\",\?,!,\\,"
".com"
diff --git a/java/res/xml-xlarge/kbd_key_styles.xml b/java/res/xml-xlarge/kbd_key_styles.xml
index fc06d00fc..4fefe0056 100644
--- a/java/res/xml-xlarge/kbd_key_styles.xml
+++ b/java/res/xml-xlarge/kbd_key_styles.xml
@@ -28,7 +28,7 @@
>
+ latin:isFunctional="true" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/java/res/xml/kbd_azerty_rows.xml b/java/res/xml/kbd_azerty_rows.xml
index 9eeb22ecb..ab3e1a097 100644
--- a/java/res/xml/kbd_azerty_rows.xml
+++ b/java/res/xml/kbd_azerty_rows.xml
@@ -108,6 +108,7 @@
-
diff --git a/java/res/xml/kbd_key_styles.xml b/java/res/xml/kbd_key_styles.xml
index 473510ec4..bfc7c4ff2 100644
--- a/java/res/xml/kbd_key_styles.xml
+++ b/java/res/xml/kbd_key_styles.xml
@@ -21,14 +21,45 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+ latin:parentStyle="settingsPopupStyle" />
-
+ latin:parentStyle="settingsPopupStyle" />
-
-
-
-
diff --git a/java/res/xml/kbd_qwerty_black_symbol.xml b/java/res/xml/kbd_qwerty_black_symbol.xml
deleted file mode 100644
index 6e45c12bf..000000000
--- a/java/res/xml/kbd_qwerty_black_symbol.xml
+++ /dev/null
@@ -1,84 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/java/res/xml/kbd_qwerty_f1.xml b/java/res/xml/kbd_qwerty_f1.xml
index cbdb8c09a..3ebdd1039 100644
--- a/java/res/xml/kbd_qwerty_f1.xml
+++ b/java/res/xml/kbd_qwerty_f1.xml
@@ -27,18 +27,14 @@
>
+ latin:keyStyle="settingsPopupStyle" />
+ latin:keyStyle="settingsPopupStyle" />
@@ -48,15 +44,12 @@
-
+
+
-
+ latin:keyStyle="settingsPopupStyle" />
+
diff --git a/java/res/xml/kbd_qwerty_row3.xml b/java/res/xml/kbd_qwerty_row3.xml
index 26608fd71..3d106e615 100644
--- a/java/res/xml/kbd_qwerty_row3.xml
+++ b/java/res/xml/kbd_qwerty_row3.xml
@@ -27,6 +27,7 @@
diff --git a/java/res/xml/kbd_qwertz_rows.xml b/java/res/xml/kbd_qwertz_rows.xml
index 375f12335..bb41f067a 100644
--- a/java/res/xml/kbd_qwertz_rows.xml
+++ b/java/res/xml/kbd_qwertz_rows.xml
@@ -78,6 +78,7 @@
diff --git a/java/res/xml/kbd_symbols_f1.xml b/java/res/xml/kbd_symbols_f1.xml
index 8487b6158..0fb7136b9 100644
--- a/java/res/xml/kbd_symbols_f1.xml
+++ b/java/res/xml/kbd_symbols_f1.xml
@@ -28,14 +28,11 @@
-
+
+
-
+ latin:keyStyle="settingsPopupStyle" />
+
diff --git a/java/res/xml/kbd_symbols_shift.xml b/java/res/xml/kbd_symbols_shift.xml
index 368ee805b..36f0c64a9 100644
--- a/java/res/xml/kbd_symbols_shift.xml
+++ b/java/res/xml/kbd_symbols_shift.xml
@@ -89,6 +89,7 @@
@@ -110,6 +111,7 @@
diff --git a/java/res/xml/method.xml b/java/res/xml/method.xml
index a9883b118..31ba650f1 100644
--- a/java/res/xml/method.xml
+++ b/java/res/xml/method.xml
@@ -24,6 +24,7 @@
+
getEnabledInputMethodSubtypeList(
InputMethodInfoCompatWrapper imi, boolean allowsImplicitlySelectedSubtypes) {
+ if (!SUBTYPE_SUPPORTED) {
+ String[] languages = mLanguageSwitcherProxy.getEnabledLanguages();
+ List subtypeList =
+ new ArrayList();
+ for (String lang: languages) {
+ subtypeList.add(new InputMethodSubtypeCompatWrapper(0, 0, lang, KEYBOARD_MODE, ""));
+ }
+ return subtypeList;
+ }
Object retval = CompatUtils.invoke(mImm, null, METHOD_getEnabledInputMethodSubtypeList,
(imi != null ? imi.getInputMethodInfo() : null), allowsImplicitlySelectedSubtypes);
if (retval == null || !(retval instanceof List) || ((List>)retval).isEmpty()) {
@@ -170,6 +195,10 @@ public class InputMethodManagerCompatWrapper {
public void setInputMethodAndSubtype(
IBinder token, String id, InputMethodSubtypeCompatWrapper subtype) {
+ if (!SUBTYPE_SUPPORTED) {
+ mLanguageSwitcherProxy.setLocale(subtype.getLocale());
+ return;
+ }
CompatUtils.invoke(mImm, null, METHOD_setInputMethodAndSubtype,
token, id, subtype.getOriginalObject());
}
diff --git a/java/src/com/android/inputmethod/compat/InputMethodSubtypeCompatWrapper.java b/java/src/com/android/inputmethod/compat/InputMethodSubtypeCompatWrapper.java
index 317b02216..86c8af37f 100644
--- a/java/src/com/android/inputmethod/compat/InputMethodSubtypeCompatWrapper.java
+++ b/java/src/com/android/inputmethod/compat/InputMethodSubtypeCompatWrapper.java
@@ -58,9 +58,6 @@ public final class InputMethodSubtypeCompatWrapper extends AbstractCompatWrapper
public InputMethodSubtypeCompatWrapper(Object subtype) {
super((CLASS_InputMethodSubtype != null && CLASS_InputMethodSubtype.isInstance(subtype))
? subtype : null);
- if (DBG) {
- Log.d(TAG, "CreateInputMethodSubtypeCompatWrapper");
- }
mDummyNameResId = 0;
mDummyIconResId = 0;
mDummyLocale = DEFAULT_LOCALE;
diff --git a/java/src/com/android/inputmethod/deprecated/LanguageSwitcherProxy.java b/java/src/com/android/inputmethod/deprecated/LanguageSwitcherProxy.java
new file mode 100644
index 000000000..5d165cda9
--- /dev/null
+++ b/java/src/com/android/inputmethod/deprecated/LanguageSwitcherProxy.java
@@ -0,0 +1,73 @@
+/*
+ * Copyright (C) 2011 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package com.android.inputmethod.deprecated;
+
+import com.android.inputmethod.compat.InputMethodManagerCompatWrapper;
+import com.android.inputmethod.deprecated.languageswitcher.LanguageSwitcher;
+import com.android.inputmethod.latin.LatinIME;
+
+import android.content.SharedPreferences;
+import android.content.res.Configuration;
+
+import java.util.Locale;
+
+// This class is used only when the IME doesn't use method.xml for language switching.
+public class LanguageSwitcherProxy {
+ private static final LanguageSwitcherProxy sInstance = new LanguageSwitcherProxy();
+ private LanguageSwitcher mLanguageSwitcher;
+ private SharedPreferences mPrefs;
+
+ public static LanguageSwitcherProxy getInstance() {
+ if (InputMethodManagerCompatWrapper.SUBTYPE_SUPPORTED) return null;
+ return sInstance;
+ }
+
+ public static void init(LatinIME service, SharedPreferences prefs) {
+ if (InputMethodManagerCompatWrapper.SUBTYPE_SUPPORTED) return;
+ final Configuration conf = service.getResources().getConfiguration();
+ sInstance.mLanguageSwitcher = new LanguageSwitcher(service);
+ sInstance.mLanguageSwitcher.loadLocales(prefs, conf.locale);
+ sInstance.mPrefs = prefs;
+ }
+
+ public static void onConfigurationChanged(Configuration conf) {
+ if (InputMethodManagerCompatWrapper.SUBTYPE_SUPPORTED) return;
+ sInstance.mLanguageSwitcher.onConfigurationChanged(conf, sInstance.mPrefs);
+ }
+
+ public static void loadSettings() {
+ if (InputMethodManagerCompatWrapper.SUBTYPE_SUPPORTED) return;
+ sInstance.mLanguageSwitcher.loadLocales(sInstance.mPrefs, null);
+ }
+
+ public int getLocaleCount() {
+ return mLanguageSwitcher.getLocaleCount();
+ }
+
+ public String[] getEnabledLanguages() {
+ return mLanguageSwitcher.getEnabledLanguages();
+ }
+
+ public Locale getInputLocale() {
+ return mLanguageSwitcher.getInputLocale();
+ }
+
+ public void setLocale(String localeStr) {
+ mLanguageSwitcher.setLocale(localeStr);
+ mLanguageSwitcher.persist(mPrefs);
+ }
+}
diff --git a/java/src/com/android/inputmethod/latin/LanguageSwitcher.java b/java/src/com/android/inputmethod/deprecated/languageswitcher/LanguageSwitcher.java
similarity index 77%
rename from java/src/com/android/inputmethod/latin/LanguageSwitcher.java
rename to java/src/com/android/inputmethod/deprecated/languageswitcher/LanguageSwitcher.java
index 6faf7f95e..639b7cdd0 100644
--- a/java/src/com/android/inputmethod/latin/LanguageSwitcher.java
+++ b/java/src/com/android/inputmethod/deprecated/languageswitcher/LanguageSwitcher.java
@@ -14,10 +14,16 @@
* the License.
*/
-package com.android.inputmethod.latin;
+package com.android.inputmethod.deprecated.languageswitcher;
+
+import com.android.inputmethod.compat.InputMethodSubtypeCompatWrapper;
+import com.android.inputmethod.latin.LatinIME;
+import com.android.inputmethod.latin.Settings;
+import com.android.inputmethod.latin.SharedPreferencesCompat;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
+import android.content.res.Configuration;
import android.text.TextUtils;
import java.util.ArrayList;
@@ -29,6 +35,8 @@ import java.util.Locale;
*/
public class LanguageSwitcher {
+ private static final String KEYBOARD_MODE = "keyboard";
+
private final ArrayList mLocales = new ArrayList();
private final LatinIME mIme;
private String[] mSelectedLanguageArray;
@@ -46,12 +54,24 @@ public class LanguageSwitcher {
return mLocales.size();
}
+ public void onConfigurationChanged(Configuration conf, SharedPreferences prefs) {
+ final Locale newLocale = conf.locale;
+ if (!getSystemLocale().toString().equals(newLocale.toString())) {
+ loadLocales(prefs, newLocale);
+ }
+ }
+
/**
* Loads the currently selected input languages from shared preferences.
- * @param sp
+ * @param sp shared preference for getting the current input language and enabled languages
+ * @param systemLocale the current system locale, stored for changing the current input language
+ * based on the system current system locale.
* @return whether there was any change
*/
- public boolean loadLocales(SharedPreferences sp) {
+ public boolean loadLocales(SharedPreferences sp, Locale systemLocale) {
+ if (systemLocale != null) {
+ setSystemLocale(systemLocale);
+ }
String selectedLanguages = sp.getString(Settings.PREF_SELECTED_LANGUAGES, null);
String currentLanguage = sp.getString(Settings.PREF_INPUT_LANGUAGE, null);
if (selectedLanguages == null || selectedLanguages.length() < 1) {
@@ -151,7 +171,7 @@ public class LanguageSwitcher {
* Sets the system locale (display UI) used for comparing with the input language.
* @param locale the locale of the system
*/
- public void setSystemLocale(Locale locale) {
+ private void setSystemLocale(Locale locale) {
mSystemLocale = locale;
}
@@ -159,7 +179,7 @@ public class LanguageSwitcher {
* Returns the system locale.
* @return the system locale
*/
- public Locale getSystemLocale() {
+ private Locale getSystemLocale() {
return mSystemLocale;
}
@@ -185,9 +205,22 @@ public class LanguageSwitcher {
mCurrentIndex = prevLocaleIndex();
}
+ public void setLocale(String localeStr) {
+ final int N = mLocales.size();
+ for (int i = 0; i < N; ++i) {
+ if (mLocales.get(i).toString().equals(localeStr)) {
+ mCurrentIndex = i;
+ }
+ }
+ }
+
public void persist(SharedPreferences prefs) {
Editor editor = prefs.edit();
editor.putString(Settings.PREF_INPUT_LANGUAGE, getInputLanguage());
SharedPreferencesCompat.apply(editor);
+ // When the current language is changed, the event for this change should be handled
+ // internally as a subtype switching.
+ mIme.notifyOnCurrentInputMethodSubtypeChanged(new InputMethodSubtypeCompatWrapper(
+ 0, 0, getInputLocale().toString(), KEYBOARD_MODE, ""));
}
}
diff --git a/java/src/com/android/inputmethod/keyboard/Key.java b/java/src/com/android/inputmethod/keyboard/Key.java
index 7396f0518..1b7e8ef21 100644
--- a/java/src/com/android/inputmethod/keyboard/Key.java
+++ b/java/src/com/android/inputmethod/keyboard/Key.java
@@ -61,8 +61,11 @@ public class Key {
public final int mWidth;
/** Height of the key, not including the gap */
public final int mHeight;
- /** The horizontal gap before this key */
+ /** The horizontal gap around this key */
public final int mGap;
+ /** The visual insets */
+ public final int mVisualInsetsLeft;
+ public final int mVisualInsetsRight;
/** Whether this key is sticky, i.e., a toggle key */
public final boolean mSticky;
/** X coordinate of the key in the keyboard layout */
@@ -83,8 +86,8 @@ public class Key {
* {@link Keyboard#EDGE_TOP} and {@link Keyboard#EDGE_BOTTOM}.
*/
public final int mEdgeFlags;
- /** Whether this is a modifier key, such as Shift or Alt */
- public final boolean mModifier;
+ /** Whether this is a functional key which has different key top than normal key */
+ public final boolean mFunctional;
/** Whether this key repeats itself when held down */
public final boolean mRepeatable;
@@ -93,8 +96,8 @@ public class Key {
/** The current pressed state of this key */
public boolean mPressed;
- /** If this is a sticky key, is it on? */
- public boolean mOn;
+ /** If this is a sticky key, is its highlight on? */
+ public boolean mHighlightOn;
/** Key is enabled and responds on press */
public boolean mEnabled = true;
@@ -144,13 +147,14 @@ public class Key {
mKeyboard = keyboard;
mHeight = keyboard.getRowHeight() - keyboard.getVerticalGap();
mGap = keyboard.getHorizontalGap();
+ mVisualInsetsLeft = mVisualInsetsRight = 0;
mWidth = width - mGap;
mEdgeFlags = edgeFlags;
mHintIcon = null;
mManualTemporaryUpperCaseHintIcon = null;
mManualTemporaryUpperCaseCode = Keyboard.CODE_DUMMY;
mLabelOption = 0;
- mModifier = false;
+ mFunctional = false;
mSticky = false;
mRepeatable = false;
mPopupCharacters = null;
@@ -224,12 +228,16 @@ public class Key {
mKeyboard.getMaxPopupKeyboardColumn());
mRepeatable = style.getBoolean(keyAttr, R.styleable.Keyboard_Key_isRepeatable, false);
- mModifier = style.getBoolean(keyAttr, R.styleable.Keyboard_Key_isModifier, false);
+ mFunctional = style.getBoolean(keyAttr, R.styleable.Keyboard_Key_isFunctional, false);
mSticky = style.getBoolean(keyAttr, R.styleable.Keyboard_Key_isSticky, false);
mEnabled = style.getBoolean(keyAttr, R.styleable.Keyboard_Key_enabled, true);
mEdgeFlags = style.getFlag(keyAttr, R.styleable.Keyboard_Key_keyEdgeFlags, 0)
| row.mRowEdgeFlags;
+ mVisualInsetsLeft = KeyboardParser.getDimensionOrFraction(keyAttr,
+ R.styleable.Keyboard_Key_visualInsetsLeft, mKeyboard.getDisplayHeight(), 0);
+ mVisualInsetsRight = KeyboardParser.getDimensionOrFraction(keyAttr,
+ R.styleable.Keyboard_Key_visualInsetsRight, mKeyboard.getDisplayHeight(), 0);
mPreviewIcon = style.getDrawable(keyAttr, R.styleable.Keyboard_Key_iconPreview);
Keyboard.setDefaultBounds(mPreviewIcon);
mIcon = style.getDrawable(keyAttr, R.styleable.Keyboard_Key_keyIcon);
@@ -315,22 +323,19 @@ public class Key {
/**
* Informs the key that it has been pressed, in case it needs to change its appearance or
* state.
- * @see #onReleased(boolean)
+ * @see #onReleased()
*/
public void onPressed() {
- mPressed = !mPressed;
+ mPressed = true;
}
/**
- * Changes the pressed state of the key. If it is a sticky key, it will also change the
- * toggled state of the key if the finger was release inside.
- * @param inside whether the finger was released inside the key
+ * Informs the key that it has been released, in case it needs to change its appearance or
+ * state.
* @see #onPressed()
*/
- public void onReleased(boolean inside) {
- mPressed = !mPressed;
- if (mSticky && !mKeyboard.isShiftLockEnabled(this))
- mOn = !mOn;
+ public void onReleased() {
+ mPressed = false;
}
public boolean isInside(int x, int y) {
@@ -376,20 +381,14 @@ public class Key {
return dx * dx + dy * dy;
}
- // sticky is used for shift key. If a key is not sticky and is modifier,
- // the key will be treated as functional.
- private boolean isFunctionalKey() {
- return !mSticky && mModifier;
- }
-
/**
* Returns the drawable state for the key, based on the current state and type of the key.
* @return the drawable state of the key.
* @see android.graphics.drawable.StateListDrawable#setState(int[])
*/
public int[] getCurrentDrawableState() {
- final boolean pressed = mEnabled && mPressed;
- if (isFunctionalKey()) {
+ final boolean pressed = mPressed;
+ if (!mSticky && mFunctional) {
if (pressed) {
return KEY_STATE_FUNCTIONAL_PRESSED;
} else {
@@ -399,7 +398,7 @@ public class Key {
int[] states = KEY_STATE_NORMAL;
- if (mOn) {
+ if (mHighlightOn) {
if (pressed) {
states = KEY_STATE_PRESSED_ON;
} else {
diff --git a/java/src/com/android/inputmethod/keyboard/KeyStyles.java b/java/src/com/android/inputmethod/keyboard/KeyStyles.java
index 169f2e6c3..d464c2029 100644
--- a/java/src/com/android/inputmethod/keyboard/KeyStyles.java
+++ b/java/src/com/android/inputmethod/keyboard/KeyStyles.java
@@ -185,7 +185,7 @@ public class KeyStyles {
readDrawable(keyAttr, R.styleable.Keyboard_Key_iconPreview);
readDrawable(keyAttr, R.styleable.Keyboard_Key_keyHintIcon);
readDrawable(keyAttr, R.styleable.Keyboard_Key_shiftedIcon);
- readBoolean(keyAttr, R.styleable.Keyboard_Key_isModifier);
+ readBoolean(keyAttr, R.styleable.Keyboard_Key_isFunctional);
readBoolean(keyAttr, R.styleable.Keyboard_Key_isSticky);
readBoolean(keyAttr, R.styleable.Keyboard_Key_isRepeatable);
readBoolean(keyAttr, R.styleable.Keyboard_Key_enabled);
diff --git a/java/src/com/android/inputmethod/keyboard/Keyboard.java b/java/src/com/android/inputmethod/keyboard/Keyboard.java
index 06d44680d..f720334f1 100644
--- a/java/src/com/android/inputmethod/keyboard/Keyboard.java
+++ b/java/src/com/android/inputmethod/keyboard/Keyboard.java
@@ -165,7 +165,9 @@ public class Keyboard {
GRID_HEIGHT = res.getInteger(R.integer.config_keyboard_grid_height);
GRID_SIZE = GRID_WIDTH * GRID_HEIGHT;
- mDisplayWidth = width;
+ final int horizontalEdgesPadding = (int)res.getDimension(
+ R.dimen.keyboard_horizontal_edges_padding);
+ mDisplayWidth = width - horizontalEdgesPadding * 2;
mDisplayHeight = height;
mDefaultHorizontalGap = 0;
@@ -293,7 +295,7 @@ public class Keyboard {
public boolean setShiftLocked(boolean newShiftLockState) {
final Map shiftedIcons = getShiftedIcons();
for (final Key key : getShiftKeys()) {
- key.mOn = newShiftLockState;
+ key.mHighlightOn = newShiftLockState;
key.setIcon(newShiftLockState ? shiftedIcons.get(key) : mNormalShiftIcons.get(key));
}
mShiftState.setShiftLocked(newShiftLockState);
diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardParser.java b/java/src/com/android/inputmethod/keyboard/KeyboardParser.java
index 62e6f302d..9c556c309 100644
--- a/java/src/com/android/inputmethod/keyboard/KeyboardParser.java
+++ b/java/src/com/android/inputmethod/keyboard/KeyboardParser.java
@@ -122,6 +122,7 @@ public class KeyboardParser {
private final Keyboard mKeyboard;
private final Resources mResources;
+ private int mHorizontalEdgesPadding;
private int mCurrentX = 0;
private int mCurrentY = 0;
private int mMaxRowWidth = 0;
@@ -132,6 +133,7 @@ public class KeyboardParser {
public KeyboardParser(Keyboard keyboard, Resources res) {
mKeyboard = keyboard;
mResources = res;
+ mHorizontalEdgesPadding = (int)res.getDimension(R.dimen.keyboard_horizontal_edges_padding);
}
public int getMaxRowWidth() {
@@ -151,6 +153,7 @@ public class KeyboardParser {
final String tag = parser.getName();
if (TAG_KEYBOARD.equals(tag)) {
parseKeyboardAttributes(parser);
+ startKeyboard();
parseKeyboardContent(parser, mKeyboard.getKeys());
break;
} else {
@@ -520,25 +523,32 @@ public class KeyboardParser {
throw new NonEmptyTag(tag, parser);
}
+ private void startKeyboard() {
+ mCurrentY += (int)mResources.getDimension(R.dimen.keyboard_top_padding);
+ }
+
private void startRow(Row row) {
mCurrentX = 0;
+ setSpacer(mHorizontalEdgesPadding);
mCurrentRow = row;
}
private void endRow() {
if (mCurrentRow == null)
throw new InflateException("orphant end row tag");
+ setSpacer(mHorizontalEdgesPadding);
+ if (mCurrentX > mMaxRowWidth)
+ mMaxRowWidth = mCurrentX;
mCurrentY += mCurrentRow.mDefaultHeight;
mCurrentRow = null;
}
private void endKey(Key key) {
mCurrentX += key.mGap + key.mWidth;
- if (mCurrentX > mMaxRowWidth)
- mMaxRowWidth = mCurrentX;
}
private void endKeyboard(int defaultVerticalGap) {
+ mCurrentY += (int)mResources.getDimension(R.dimen.keyboard_bottom_padding);
mTotalHeight = mCurrentY - defaultVerticalGap;
}
diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java b/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java
index cfa3c446e..dd25b3427 100644
--- a/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java
+++ b/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java
@@ -263,10 +263,10 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha
int xmlId = mode == KeyboardId.MODE_PHONE ? R.xml.kbd_phone : R.xml.kbd_symbols;
final String xmlName = res.getResourceEntryName(xmlId);
mSymbolsId = new KeyboardId(xmlName, xmlId, colorScheme, locale, orientation, mode,
- attribute, hasSettingsKey, mVoiceKeyEnabled, hasVoiceKey, true);
+ attribute, hasSettingsKey, mVoiceKeyEnabled, hasVoiceKey, false);
xmlId = mode == KeyboardId.MODE_PHONE ? R.xml.kbd_phone_symbols : R.xml.kbd_symbols_shift;
mSymbolsShiftedId = new KeyboardId(xmlName, xmlId, colorScheme, locale, orientation, mode,
- attribute, hasSettingsKey, mVoiceKeyEnabled, hasVoiceKey, true);
+ attribute, hasSettingsKey, mVoiceKeyEnabled, hasVoiceKey, false);
}
public int getKeyboardMode() {
@@ -565,16 +565,14 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha
mCurrentId = mSymbolsShiftedId;
keyboard = getKeyboard(mCurrentId);
// Symbol shifted keyboard has an ALT key that has a caps lock style indicator. To
- // enable the indicator, we need to call enableShiftLock() and setShiftLocked(true).
- // Thus we can keep the ALT key's Key.on value true while LatinKey.onRelease() is
- // called.
+ // enable the indicator, we need to call setShiftLocked(true).
keyboard.setShiftLocked(true);
} else {
mCurrentId = mSymbolsId;
keyboard = getKeyboard(mCurrentId);
// Symbol keyboard has an ALT key that has a caps lock style indicator. To disable the
- // indicator, we need to call enableShiftLock() and setShiftLocked(false).
- keyboard.setShifted(false);
+ // indicator, we need to call setShiftLocked(false).
+ keyboard.setShiftLocked(false);
}
setKeyboard(keyboard);
}
diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardView.java b/java/src/com/android/inputmethod/keyboard/KeyboardView.java
index 61af15b1d..7b570d7ed 100644
--- a/java/src/com/android/inputmethod/keyboard/KeyboardView.java
+++ b/java/src/com/android/inputmethod/keyboard/KeyboardView.java
@@ -37,7 +37,6 @@ import android.graphics.drawable.Drawable;
import android.os.Handler;
import android.os.Message;
import android.os.SystemClock;
-import android.provider.Settings;
import android.util.AttributeSet;
import android.util.Log;
import android.util.TypedValue;
@@ -378,6 +377,7 @@ public class KeyboardView extends View implements PointerTracker.UIProxy {
}
mPreviewPopup.setTouchable(false);
mPreviewPopup.setAnimationStyle(R.style.KeyPreviewAnimation);
+ mPreviewPopup.setClippingEnabled(false);
mDelayBeforePreview = res.getInteger(R.integer.config_delay_before_preview);
mDelayAfterPreview = res.getInteger(R.integer.config_delay_after_preview);
mKeyLabelHorizontalPadding = (int)res.getDimension(
@@ -677,11 +677,13 @@ public class KeyboardView extends View implements PointerTracker.UIProxy {
// Switch the character to uppercase if shift is pressed
String label = key.mLabel == null? null : adjustCase(key.mLabel).toString();
+ final int keyDrawX = key.mX + key.mVisualInsetsLeft;
+ final int keyDrawWidth = key.mWidth - key.mVisualInsetsLeft - key.mVisualInsetsRight;
final Rect bounds = keyBackground.getBounds();
- if (key.mWidth != bounds.right || key.mHeight != bounds.bottom) {
- keyBackground.setBounds(0, 0, key.mWidth, key.mHeight);
+ if (keyDrawWidth != bounds.right || key.mHeight != bounds.bottom) {
+ keyBackground.setBounds(0, 0, keyDrawWidth, key.mHeight);
}
- canvas.translate(key.mX + kbdPaddingLeft, key.mY + kbdPaddingTop);
+ canvas.translate(keyDrawX + kbdPaddingLeft, key.mY + kbdPaddingTop);
keyBackground.draw(canvas);
final int rowHeight = padding.top + key.mHeight;
@@ -697,14 +699,14 @@ public class KeyboardView extends View implements PointerTracker.UIProxy {
baseline = key.mHeight -
+ labelCharHeight * KEY_LABEL_VERTICAL_PADDING_FACTOR;
if (DEBUG_SHOW_ALIGN)
- drawHorizontalLine(canvas, (int)baseline, key.mWidth, 0xc0008000,
+ drawHorizontalLine(canvas, (int)baseline, keyDrawWidth, 0xc0008000,
new Paint());
} else { // Align center
final float centerY = (key.mHeight + padding.top - padding.bottom) / 2;
baseline = centerY
+ labelCharHeight * KEY_LABEL_VERTICAL_ADJUSTMENT_FACTOR_CENTER;
if (DEBUG_SHOW_ALIGN)
- drawHorizontalLine(canvas, (int)baseline, key.mWidth, 0xc0008000,
+ drawHorizontalLine(canvas, (int)baseline, keyDrawWidth, 0xc0008000,
new Paint());
}
// Horizontal label text alignment
@@ -715,12 +717,12 @@ public class KeyboardView extends View implements PointerTracker.UIProxy {
if (DEBUG_SHOW_ALIGN)
drawVerticalLine(canvas, positionX, rowHeight, 0xc0800080, new Paint());
} else if ((key.mLabelOption & KEY_LABEL_OPTION_ALIGN_RIGHT) != 0) {
- positionX = key.mWidth - mKeyLabelHorizontalPadding - padding.right;
+ positionX = keyDrawWidth - mKeyLabelHorizontalPadding - padding.right;
paint.setTextAlign(Align.RIGHT);
if (DEBUG_SHOW_ALIGN)
drawVerticalLine(canvas, positionX, rowHeight, 0xc0808000, new Paint());
} else {
- positionX = (key.mWidth + padding.left - padding.right) / 2;
+ positionX = (keyDrawWidth + padding.left - padding.right) / 2;
paint.setTextAlign(Align.CENTER);
if (DEBUG_SHOW_ALIGN) {
if (label.length() > 1)
@@ -756,13 +758,13 @@ public class KeyboardView extends View implements PointerTracker.UIProxy {
if (DEBUG_SHOW_ALIGN)
drawVerticalLine(canvas, drawableX, rowHeight, 0xc0800080, new Paint());
} else if ((key.mLabelOption & KEY_LABEL_OPTION_ALIGN_RIGHT) != 0) {
- drawableX = key.mWidth - padding.right - mKeyLabelHorizontalPadding
+ drawableX = keyDrawWidth - padding.right - mKeyLabelHorizontalPadding
- drawableWidth;
if (DEBUG_SHOW_ALIGN)
drawVerticalLine(canvas, drawableX + drawableWidth, rowHeight,
0xc0808000, new Paint());
} else { // Align center
- drawableX = (key.mWidth + padding.left - padding.right - drawableWidth) / 2;
+ drawableX = (keyDrawWidth + padding.left - padding.right - drawableWidth) / 2;
if (DEBUG_SHOW_ALIGN)
drawVerticalLine(canvas, drawableX + drawableWidth / 2, rowHeight,
0xc0008080, new Paint());
@@ -773,7 +775,7 @@ public class KeyboardView extends View implements PointerTracker.UIProxy {
0x80c00000, new Paint());
}
if (key.mHintIcon != null) {
- final int drawableWidth = key.mWidth;
+ final int drawableWidth = keyDrawWidth;
final int drawableHeight = key.mHeight;
final int drawableX = 0;
final int drawableY = HINT_ICON_VERTICAL_ADJUSTMENT_PIXEL;
@@ -785,7 +787,7 @@ public class KeyboardView extends View implements PointerTracker.UIProxy {
drawRectangle(canvas, drawableX, drawableY, drawableWidth, drawableHeight,
0x80c0c000, new Paint());
}
- canvas.translate(-key.mX - kbdPaddingLeft, -key.mY - kbdPaddingTop);
+ canvas.translate(-keyDrawX - kbdPaddingLeft, -key.mY - kbdPaddingTop);
}
// TODO: Move this function to ProximityInfo for getting rid of public declarations for
@@ -921,6 +923,8 @@ public class KeyboardView extends View implements PointerTracker.UIProxy {
// WindowManager.BadTokenException.
if (key == null || !mInForeground)
return;
+ final int keyDrawX = key.mX + key.mVisualInsetsLeft;
+ final int keyDrawWidth = key.mWidth - key.mVisualInsetsLeft - key.mVisualInsetsRight;
// What we show as preview should match what we show on key top in onBufferDraw().
if (key.mLabel != null) {
// TODO Should take care of temporaryShiftLabel here.
@@ -941,7 +945,7 @@ public class KeyboardView extends View implements PointerTracker.UIProxy {
}
mPreviewText.measure(MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED),
MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED));
- int popupWidth = Math.max(mPreviewText.getMeasuredWidth(), key.mWidth
+ int popupWidth = Math.max(mPreviewText.getMeasuredWidth(), keyDrawWidth
+ mPreviewText.getPaddingLeft() + mPreviewText.getPaddingRight());
final int popupHeight = mPreviewHeight;
LayoutParams lp = mPreviewText.getLayoutParams();
@@ -950,7 +954,7 @@ public class KeyboardView extends View implements PointerTracker.UIProxy {
lp.height = popupHeight;
}
- int popupPreviewX = key.mX - (popupWidth - key.mWidth) / 2;
+ int popupPreviewX = keyDrawX - (popupWidth - keyDrawWidth) / 2;
int popupPreviewY = key.mY - popupHeight + mPreviewOffset;
mHandler.cancelDismissPreview();
@@ -973,10 +977,10 @@ public class KeyboardView extends View implements PointerTracker.UIProxy {
if (popupPreviewY + mWindowY < 0) {
// If the key you're pressing is on the left side of the keyboard, show the popup on
// the right, offset by enough to see at least one key to the left/right.
- if (key.mX + key.mWidth <= getWidth() / 2) {
- popupPreviewX += (int) (key.mWidth * 2.5);
+ if (keyDrawX + keyDrawWidth <= getWidth() / 2) {
+ popupPreviewX += (int) (keyDrawWidth * 2.5);
} else {
- popupPreviewX -= (int) (key.mWidth * 2.5);
+ popupPreviewX -= (int) (keyDrawWidth * 2.5);
}
popupPreviewY += popupHeight;
}
@@ -1056,7 +1060,7 @@ public class KeyboardView extends View implements PointerTracker.UIProxy {
mKeyboardActionListener.onCodeInput(Keyboard.CODE_CAPSLOCK, null, 0, 0);
}
- private void onDoubleTapShiftKey(PointerTracker tracker) {
+ private void onDoubleTapShiftKey(@SuppressWarnings("unused") PointerTracker tracker) {
// When shift key is double tapped, the first tap is correctly processed as usual tap. And
// the second tap is treated as this double tap event, so that we need not mark tracker
// calling setAlreadyProcessed() nor remove the tracker from mPointerQueueueue.
diff --git a/java/src/com/android/inputmethod/keyboard/LatinKeyboard.java b/java/src/com/android/inputmethod/keyboard/LatinKeyboard.java
index 5820049bb..9d9793e1e 100644
--- a/java/src/com/android/inputmethod/keyboard/LatinKeyboard.java
+++ b/java/src/com/android/inputmethod/keyboard/LatinKeyboard.java
@@ -229,7 +229,7 @@ public class LatinKeyboard extends Keyboard {
final Bitmap buffer = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
final Canvas canvas = new Canvas(buffer);
final Resources res = mContext.getResources();
- canvas.drawColor(res.getColor(R.color.latinkeyboard_transparent), PorterDuff.Mode.CLEAR);
+ canvas.drawColor(res.getColor(android.R.color.transparent), PorterDuff.Mode.CLEAR);
SubtypeSwitcher subtypeSwitcher = SubtypeSwitcher.getInstance();
// If application locales are explicitly selected.
@@ -271,7 +271,7 @@ public class LatinKeyboard extends Keyboard {
canvas.drawText(language, width / 2, baseline - descent, paint);
// Put arrows that are already layed out on either side of the text
- if (SubtypeSwitcher.getInstance().useSpacebarLanguageSwitcher()
+ if (subtypeSwitcher.useSpacebarLanguageSwitcher()
&& subtypeSwitcher.getEnabledKeyboardLocaleCount() > 1) {
mButtonArrowLeftIcon.draw(canvas);
mButtonArrowRightIcon.draw(canvas);
diff --git a/java/src/com/android/inputmethod/keyboard/PointerTracker.java b/java/src/com/android/inputmethod/keyboard/PointerTracker.java
index 746857819..eb5335ffd 100644
--- a/java/src/com/android/inputmethod/keyboard/PointerTracker.java
+++ b/java/src/com/android/inputmethod/keyboard/PointerTracker.java
@@ -87,6 +87,9 @@ public class PointerTracker {
// true if sliding key is allowed.
private boolean mIsAllowedSlidingKeyInput;
+ // ignore modifier key if true
+ private boolean mIgnoreModifierKey;
+
// pressed key
private int mPreviousKey = NOT_A_KEY;
@@ -139,8 +142,12 @@ public class PointerTracker {
// Returns true if keyboard has been changed by this callback.
private boolean callListenerOnPressAndCheckKeyboardLayoutChange(Key key, boolean withSliding) {
+ final boolean ignoreModifierKey = mIgnoreModifierKey && isModifierCode(key.mCode);
if (DEBUG_LISTENER)
- Log.d(TAG, "onPress : " + keyCodePrintable(key.mCode) + " sliding=" + withSliding);
+ Log.d(TAG, "onPress : " + keyCodePrintable(key.mCode) + " sliding=" + withSliding
+ + " ignoreModifier=" + ignoreModifierKey);
+ if (ignoreModifierKey)
+ return false;
if (key.mEnabled) {
mListener.onPress(key.mCode, withSliding);
final boolean keyboardLayoutHasBeenChanged = mKeyboardLayoutHasBeenChanged;
@@ -153,9 +160,13 @@ public class PointerTracker {
// Note that we need primaryCode argument because the keyboard may in shifted state and the
// primaryCode is different from {@link Key#mCode}.
private void callListenerOnCodeInput(Key key, int primaryCode, int[] keyCodes, int x, int y) {
+ final boolean ignoreModifierKey = mIgnoreModifierKey && isModifierCode(key.mCode);
if (DEBUG_LISTENER)
Log.d(TAG, "onCodeInput: " + keyCodePrintable(primaryCode)
- + " codes="+ Arrays.toString(keyCodes) + " x=" + x + " y=" + y);
+ + " codes="+ Arrays.toString(keyCodes) + " x=" + x + " y=" + y
+ + " ignoreModifier=" + ignoreModifierKey);
+ if (ignoreModifierKey)
+ return;
if (key.mEnabled)
mListener.onCodeInput(primaryCode, keyCodes, x, y);
}
@@ -170,8 +181,12 @@ public class PointerTracker {
// Note that we need primaryCode argument because the keyboard may in shifted state and the
// primaryCode is different from {@link Key#mCode}.
private void callListenerOnRelease(Key key, int primaryCode, boolean withSliding) {
+ final boolean ignoreModifierKey = mIgnoreModifierKey && isModifierCode(key.mCode);
if (DEBUG_LISTENER)
- Log.d(TAG, "onRelease : " + keyCodePrintable(primaryCode) + " sliding=" + withSliding);
+ Log.d(TAG, "onRelease : " + keyCodePrintable(primaryCode) + " sliding="
+ + withSliding + " ignoreModifier=" + ignoreModifierKey);
+ if (ignoreModifierKey)
+ return;
if (key.mEnabled)
mListener.onRelease(primaryCode, withSliding);
}
@@ -243,9 +258,7 @@ public class PointerTracker {
mPreviousKey = keyIndex;
if (keyIndex != oldKeyIndex) {
if (isValidKeyIndex(oldKeyIndex)) {
- // if new key index is not a key, old key was just released inside of the key.
- final boolean inside = (keyIndex == NOT_A_KEY);
- mKeys[oldKeyIndex].onReleased(inside);
+ mKeys[oldKeyIndex].onReleased();
mProxy.invalidateKey(mKeys[oldKeyIndex]);
}
if (isValidKeyIndex(keyIndex)) {
@@ -329,17 +342,18 @@ public class PointerTracker {
mKeyAlreadyProcessed = false;
mIsRepeatableKey = false;
mIsInSlidingKeyInput = false;
- if (isValidKeyIndex(keyIndex)) {
+ mIgnoreModifierKey = false;
+ final Key key = getKey(keyIndex);
+ if (key != null) {
// This onPress call may have changed keyboard layout. Those cases are detected at
// {@link #setKeyboard}. In those cases, we should update keyIndex according to the new
// keyboard layout.
- if (callListenerOnPressAndCheckKeyboardLayoutChange(mKeys[keyIndex], false))
+ if (callListenerOnPressAndCheckKeyboardLayoutChange(key, false))
keyIndex = mKeyState.onDownKey(x, y, eventTime);
- }
- if (isValidKeyIndex(keyIndex)) {
+
// Accessibility disables key repeat because users may need to pause on a key to hear
// its spoken description.
- if (mKeys[keyIndex].mRepeatable && !mIsAccessibilityEnabled) {
+ if (key.mRepeatable && !mIsAccessibilityEnabled) {
repeatKey(keyIndex);
mHandler.startKeyRepeatTimer(mDelayBeforeKeyRepeatStart, keyIndex, this);
mIsRepeatableKey = true;
@@ -349,6 +363,12 @@ public class PointerTracker {
showKeyPreviewAndUpdateKeyGraphics(keyIndex);
}
+ private void startSlidingKeyInput(Key key) {
+ if (!mIsInSlidingKeyInput)
+ mIgnoreModifierKey = isModifierCode(key.mCode);
+ mIsInSlidingKeyInput = true;
+ }
+
public void onMoveEvent(int x, int y, long eventTime, PointerTrackerQueue queue) {
if (ENABLE_ASSERTION) checkAssertion(queue);
if (DEBUG_MOVE_EVENT)
@@ -376,8 +396,8 @@ public class PointerTracker {
// The pointer has been slid in to the new key from the previous key, we must call
// onRelease() first to notify that the previous key has been released, then call
// onPress() to notify that the new key is being pressed.
- mIsInSlidingKeyInput = true;
callListenerOnRelease(oldKey, oldKey.mCode, true);
+ startSlidingKeyInput(oldKey);
mHandler.cancelLongPressTimers();
if (mIsAllowedSlidingKeyInput) {
// This onPress call may have changed keyboard layout. Those cases are detected
@@ -411,8 +431,8 @@ public class PointerTracker {
if (oldKey != null && !isMinorMoveBounce(x, y, keyIndex)) {
// The pointer has been slid out from the previous key, we must call onRelease() to
// notify that the previous key has been released.
- mIsInSlidingKeyInput = true;
callListenerOnRelease(oldKey, oldKey.mCode, true);
+ startSlidingKeyInput(oldKey);
mHandler.cancelLongPressTimers();
if (mIsAllowedSlidingKeyInput) {
keyState.onMoveToNewKey(keyIndex, x ,y);
@@ -423,7 +443,7 @@ public class PointerTracker {
}
}
}
- showKeyPreviewAndUpdateKeyGraphics(mKeyState.getKeyIndex());
+ showKeyPreviewAndUpdateKeyGraphics(keyState.getKeyIndex());
}
public void onUpEvent(int x, int y, long eventTime, PointerTrackerQueue queue) {
@@ -526,6 +546,9 @@ public class PointerTracker {
}
private void showKeyPreviewAndUpdateKeyGraphics(int keyIndex) {
+ final Key key = getKey(keyIndex);
+ if (key != null && !key.mEnabled)
+ return;
updateKeyGraphics(keyIndex);
// The modifier key, such as shift key, should not be shown as preview when multi-touch is
// supported. On the other hand, if multi-touch is not supported, the modifier key should
@@ -545,6 +568,8 @@ public class PointerTracker {
return;
}
Key key = getKey(keyIndex);
+ if (!key.mEnabled)
+ return;
if (key.mCode == Keyboard.CODE_SHIFT) {
mHandler.startLongPressShiftTimer(mLongPressShiftKeyTimeout, keyIndex, this);
} else if (key.mManualTemporaryUpperCaseCode != Keyboard.CODE_DUMMY
diff --git a/java/src/com/android/inputmethod/keyboard/SlidingLocaleDrawable.java b/java/src/com/android/inputmethod/keyboard/SlidingLocaleDrawable.java
index 41f8c2a7c..eee0ac61b 100644
--- a/java/src/com/android/inputmethod/keyboard/SlidingLocaleDrawable.java
+++ b/java/src/com/android/inputmethod/keyboard/SlidingLocaleDrawable.java
@@ -63,7 +63,7 @@ public class SlidingLocaleDrawable extends Drawable {
mHeight = height;
final TextPaint textPaint = new TextPaint();
textPaint.setTextSize(getTextSizeFromTheme(android.R.style.TextAppearance_Medium, 18));
- textPaint.setColor(R.color.latinkeyboard_transparent);
+ textPaint.setColor(android.R.color.transparent);
textPaint.setTextAlign(Align.CENTER);
textPaint.setAlpha(LatinKeyboard.OPACITY_FULLY_OPAQUE);
textPaint.setAntiAlias(true);
diff --git a/java/src/com/android/inputmethod/latin/ExpandableDictionary.java b/java/src/com/android/inputmethod/latin/ExpandableDictionary.java
index d87fbce51..be2c6b21b 100644
--- a/java/src/com/android/inputmethod/latin/ExpandableDictionary.java
+++ b/java/src/com/android/inputmethod/latin/ExpandableDictionary.java
@@ -32,12 +32,14 @@ public class ExpandableDictionary extends Dictionary {
*/
protected static final int MAX_WORD_LENGTH = 32;
+ // Bigram frequency is a fixed point number with 1 meaning 1.2 and 255 meaning 1.8.
+ protected static final int BIGRAM_MAX_FREQUENCY = 255;
+
private Context mContext;
private char[] mWordBuilder = new char[MAX_WORD_LENGTH];
private int mDicTypeId;
private int mMaxDepth;
private int mInputLength;
- private StringBuilder sb = new StringBuilder(MAX_WORD_LENGTH);
private static final char QUOTE = '\'';
@@ -98,6 +100,7 @@ public class ExpandableDictionary extends Dictionary {
public int addFrequency(int add) {
mFrequency += add;
+ if (mFrequency > BIGRAM_MAX_FREQUENCY) mFrequency = BIGRAM_MAX_FREQUENCY;
return mFrequency;
}
}
@@ -462,6 +465,9 @@ public class ExpandableDictionary extends Dictionary {
}
}
+ // Local to reverseLookUp, but do not allocate each time.
+ private final char[] mLookedUpString = new char[MAX_WORD_LENGTH];
+
/**
* reverseLookUp retrieves the full word given a list of terminal nodes and adds those words
* through callback.
@@ -474,18 +480,15 @@ public class ExpandableDictionary extends Dictionary {
for (NextWord nextWord : terminalNodes) {
node = nextWord.mWord;
freq = nextWord.getFrequency();
- // TODO Not the best way to limit suggestion threshold
- if (freq >= UserBigramDictionary.SUGGEST_THRESHOLD) {
- sb.setLength(0);
- do {
- sb.insert(0, node.mCode);
- node = node.mParent;
- } while(node != null);
+ int index = MAX_WORD_LENGTH;
+ do {
+ --index;
+ mLookedUpString[index] = node.mCode;
+ node = node.mParent;
+ } while (node != null);
- // TODO better way to feed char array?
- callback.addWord(sb.toString().toCharArray(), 0, sb.length(), freq, mDicTypeId,
- DataType.BIGRAM);
- }
+ callback.addWord(mLookedUpString, index, MAX_WORD_LENGTH - index, freq, mDicTypeId,
+ DataType.BIGRAM);
}
}
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index 35f43124d..3905a4c7a 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -23,6 +23,7 @@ import com.android.inputmethod.compat.InputMethodManagerCompatWrapper;
import com.android.inputmethod.compat.InputMethodServiceCompatWrapper;
import com.android.inputmethod.compat.InputTypeCompatUtils;
import com.android.inputmethod.compat.VibratorCompatWrapper;
+import com.android.inputmethod.deprecated.LanguageSwitcherProxy;
import com.android.inputmethod.deprecated.VoiceProxy;
import com.android.inputmethod.keyboard.Keyboard;
import com.android.inputmethod.keyboard.KeyboardActionListener;
@@ -30,7 +31,6 @@ import com.android.inputmethod.keyboard.KeyboardSwitcher;
import com.android.inputmethod.keyboard.KeyboardView;
import com.android.inputmethod.keyboard.LatinKeyboard;
import com.android.inputmethod.keyboard.LatinKeyboardView;
-import com.android.inputmethod.latin.Utils.RingCharBuffer;
import android.app.AlertDialog;
import android.content.BroadcastReceiver;
@@ -380,6 +380,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
SubtypeSwitcher.init(this, prefs);
KeyboardSwitcher.init(this, prefs);
AccessibilityUtils.init(this, prefs);
+ LanguageSwitcherProxy.init(this, prefs);
super.onCreate();
@@ -517,6 +518,9 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
super.onConfigurationChanged(conf);
mVoiceProxy.onConfigurationChanged(conf);
mConfigurationChanging = false;
+
+ // This will work only when the subtype is not supported.
+ LanguageSwitcherProxy.onConfigurationChanged(conf);
}
@Override
@@ -1156,10 +1160,10 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
onSettingsKeyLongPressed();
break;
case Keyboard.CODE_NEXT_LANGUAGE:
- toggleLanguage(false, true);
+ toggleLanguage(true);
break;
case Keyboard.CODE_PREV_LANGUAGE:
- toggleLanguage(false, false);
+ toggleLanguage(false);
break;
case Keyboard.CODE_CAPSLOCK:
switcher.toggleCapsLock();
@@ -1174,10 +1178,8 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
if (primaryCode != Keyboard.CODE_ENTER) {
mJustAddedAutoSpace = false;
}
- RingCharBuffer.getInstance().push((char)primaryCode, x, y);
- LatinImeLogger.logOnInputChar();
if (isWordSeparator(primaryCode)) {
- handleSeparator(primaryCode);
+ handleSeparator(primaryCode, x, y);
} else {
handleCharacter(primaryCode, keyCodes, x, y);
}
@@ -1357,10 +1359,10 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
}
switcher.updateShiftState();
if (LatinIME.PERF_DEBUG) measureCps();
- TextEntryState.typedCharacter((char) code, isWordSeparator(code));
+ TextEntryState.typedCharacter((char) code, isWordSeparator(code), x, y);
}
- private void handleSeparator(int primaryCode) {
+ private void handleSeparator(int primaryCode, int x, int y) {
mVoiceProxy.handleSeparator();
// Should dismiss the "Touch again to save" message when handling separator
@@ -1381,7 +1383,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
// in Italian dov' should not be expanded to dove' because the elision
// requires the last vowel to be removed.
if (mAutoCorrectOn && primaryCode != '\'') {
- pickedDefault = pickDefaultSuggestion();
+ pickedDefault = pickDefaultSuggestion(primaryCode);
// Picked the suggestion by the space key. We consider this
// as "added an auto space".
if (primaryCode == Keyboard.CODE_SPACE) {
@@ -1403,7 +1405,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
reswapPeriodAndSpace();
}
- TextEntryState.typedCharacter((char) primaryCode, true);
+ TextEntryState.typedCharacter((char) primaryCode, true, x, y);
if (TextEntryState.isPunctuationAfterAccepted() && primaryCode != Keyboard.CODE_ENTER) {
swapPunctuationAndSpace();
} else if (isSuggestionsRequested() && primaryCode == Keyboard.CODE_SPACE) {
@@ -1592,14 +1594,14 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
setCandidatesViewShown(isCandidateStripVisible());
}
- private boolean pickDefaultSuggestion() {
+ private boolean pickDefaultSuggestion(int separatorCode) {
// Complete any pending candidate query first
if (mHandler.hasPendingUpdateSuggestions()) {
mHandler.cancelUpdateSuggestions();
updateSuggestions();
}
if (mBestWord != null && mBestWord.length() > 0) {
- TextEntryState.acceptedDefault(mWord.getTypedWord(), mBestWord);
+ TextEntryState.acceptedDefault(mWord.getTypedWord(), mBestWord, separatorCode);
mJustAccepted = true;
pickSuggestion(mBestWord);
// Add the word to the auto dictionary if it's not a known word
@@ -1688,7 +1690,8 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
// Fool the state watcher so that a subsequent backspace will not do a revert, unless
// we just did a correction, in which case we need to stay in
// TextEntryState.State.PICKED_SUGGESTION state.
- TextEntryState.typedCharacter((char) Keyboard.CODE_SPACE, true);
+ TextEntryState.typedCharacter((char) Keyboard.CODE_SPACE, true,
+ WordComposer.NOT_A_COORDINATE, WordComposer.NOT_A_COORDINATE);
setPunctuationSuggestions();
} else if (!showingAddToDictionaryHint) {
// If we're not showing the "Touch again to save", then show corrections again.
@@ -1895,7 +1898,8 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
ic.commitText(mComposing, 1);
TextEntryState.acceptedTyped(mComposing);
ic.commitText(punctuation, 1);
- TextEntryState.typedCharacter(punctuation.charAt(0), true);
+ TextEntryState.typedCharacter(punctuation.charAt(0), true,
+ WordComposer.NOT_A_COORDINATE, WordComposer.NOT_A_COORDINATE);
// Clear composing text
mComposing.setLength(0);
} else {
@@ -1931,17 +1935,9 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
return mWord.isFirstCharCapitalized();
}
- // Notify that language or mode have been changed and toggleLanguage will update KeyboaredID
+ // Notify that language or mode have been changed and toggleLanguage will update KeyboardID
// according to new language or mode.
public void onRefreshKeyboard() {
- toggleLanguage(true, true);
- }
-
- // "reset" and "next" are used only for USE_SPACEBAR_LANGUAGE_SWITCHER.
- private void toggleLanguage(boolean reset, boolean next) {
- if (mSubtypeSwitcher.useSpacebarLanguageSwitcher()) {
- mSubtypeSwitcher.toggleLanguage(reset, next);
- }
// Reload keyboard because the current language has been changed.
mKeyboardSwitcher.loadKeyboard(getCurrentInputEditorInfo(),
mSubtypeSwitcher.isShortcutImeEnabled() && mVoiceProxy.isVoiceButtonEnabled(),
@@ -1950,6 +1946,14 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
mKeyboardSwitcher.updateShiftState();
}
+ // "reset" and "next" are used only for USE_SPACEBAR_LANGUAGE_SWITCHER.
+ private void toggleLanguage(boolean next) {
+ if (mSubtypeSwitcher.useSpacebarLanguageSwitcher()) {
+ mSubtypeSwitcher.toggleLanguage(next);
+ }
+ onRefreshKeyboard();// no need??
+ }
+
@Override
public void onSwipeDown() {
if (mConfigSwipeDownDismissKeyboardEnabled)
@@ -2135,7 +2139,9 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
updateCorrectionMode();
updateAutoTextEnabled();
updateSuggestionVisibility(prefs);
- SubtypeSwitcher.getInstance().loadSettings();
+
+ // This will work only when the subtype is not supported.
+ LanguageSwitcherProxy.loadSettings();
}
/**
diff --git a/java/src/com/android/inputmethod/latin/LatinImeLogger.java b/java/src/com/android/inputmethod/latin/LatinImeLogger.java
index aaecfffdd..e460471a5 100644
--- a/java/src/com/android/inputmethod/latin/LatinImeLogger.java
+++ b/java/src/com/android/inputmethod/latin/LatinImeLogger.java
@@ -45,10 +45,10 @@ public class LatinImeLogger implements SharedPreferences.OnSharedPreferenceChang
String before, String after, int position, List suggestions) {
}
- public static void logOnAutoSuggestion(String before, String after) {
+ public static void logOnAutoCorrection(String before, String after, int separatorCode) {
}
- public static void logOnAutoSuggestionCanceled() {
+ public static void logOnAutoCorrectionCancelled() {
}
public static void logOnDelete() {
@@ -57,6 +57,9 @@ public class LatinImeLogger implements SharedPreferences.OnSharedPreferenceChang
public static void logOnInputChar() {
}
+ public static void logOnInputSeparator() {
+ }
+
public static void logOnException(String metaData, Throwable e) {
}
diff --git a/java/src/com/android/inputmethod/latin/SubtypeSwitcher.java b/java/src/com/android/inputmethod/latin/SubtypeSwitcher.java
index 053e2abe4..2cdc4d2cd 100644
--- a/java/src/com/android/inputmethod/latin/SubtypeSwitcher.java
+++ b/java/src/com/android/inputmethod/latin/SubtypeSwitcher.java
@@ -57,7 +57,6 @@ public class SubtypeSwitcher {
private static final SubtypeSwitcher sInstance = new SubtypeSwitcher();
private /* final */ LatinIME mService;
- private /* final */ SharedPreferences mPrefs;
private /* final */ InputMethodManagerCompatWrapper mImm;
private /* final */ Resources mResources;
private /* final */ ConnectivityManager mConnectivityManager;
@@ -66,6 +65,7 @@ public class SubtypeSwitcher {
mEnabledKeyboardSubtypesOfCurrentInputMethod =
new ArrayList();
private final ArrayList mEnabledLanguagesOfCurrentInputMethod = new ArrayList();
+ private final LanguageBarInfo mLanguageBarInfo = new LanguageBarInfo();
/*-----------------------------------------------------------*/
// Variants which should be changed only by reload functions.
@@ -78,6 +78,7 @@ public class SubtypeSwitcher {
private Locale mSystemLocale;
private Locale mInputLocale;
private String mInputLocaleStr;
+ private String mInputMethodId;
private VoiceProxy.VoiceInputWrapper mVoiceInputWrapper;
/*-----------------------------------------------------------*/
@@ -100,7 +101,6 @@ public class SubtypeSwitcher {
private void initialize(LatinIME service, SharedPreferences prefs) {
mService = service;
- mPrefs = prefs;
mResources = service.getResources();
mImm = InputMethodManagerCompatWrapper.getInstance(service);
mConnectivityManager = (ConnectivityManager) service.getSystemService(
@@ -114,13 +114,12 @@ public class SubtypeSwitcher {
mAllEnabledSubtypesOfCurrentInputMethod = null;
// TODO: Voice input should be created here
mVoiceInputWrapper = null;
- mConfigUseSpacebarLanguageSwitcher = mResources.getBoolean(
+ mConfigUseSpacebarLanguageSwitcher = service.getResources().getBoolean(
R.bool.config_use_spacebar_language_switcher);
- if (mConfigUseSpacebarLanguageSwitcher)
- initLanguageSwitcher(service);
final NetworkInfo info = mConnectivityManager.getActiveNetworkInfo();
mIsNetworkConnected = (info != null && info.isConnected());
+ mInputMethodId = Utils.getInputMethodId(mImm, service.getPackageName());
}
// Update all parameters stored in SubtypeSwitcher.
@@ -134,11 +133,7 @@ public class SubtypeSwitcher {
// Update parameters which are changed outside LatinIME. This parameters affect UI so they
// should be updated every time onStartInputview.
public void updateParametersOnStartInputView() {
- if (mConfigUseSpacebarLanguageSwitcher) {
- updateForSpacebarLanguageSwitch();
- } else {
- updateEnabledSubtypes();
- }
+ updateEnabledSubtypes();
updateShortcutIME();
}
@@ -150,7 +145,7 @@ public class SubtypeSwitcher {
null, true);
mEnabledLanguagesOfCurrentInputMethod.clear();
mEnabledKeyboardSubtypesOfCurrentInputMethod.clear();
- for (InputMethodSubtypeCompatWrapper ims: mAllEnabledSubtypesOfCurrentInputMethod) {
+ for (InputMethodSubtypeCompatWrapper ims : mAllEnabledSubtypesOfCurrentInputMethod) {
final String locale = ims.getLocale();
final String mode = ims.getMode();
mLocaleSplitter.setString(locale);
@@ -172,6 +167,10 @@ public class SubtypeSwitcher {
Log.w(TAG, "Last subtype was disabled. Update to the current one.");
}
updateSubtype(mImm.getCurrentInputMethodSubtype());
+ } else {
+ // mLanguageBarInfo.update() will be called in updateSubtype so there is no need
+ // to call this in the if-clause above.
+ mLanguageBarInfo.update();
}
}
@@ -269,6 +268,7 @@ public class SubtypeSwitcher {
mVoiceInputWrapper.reset();
}
}
+ mLanguageBarInfo.update();
}
// Update the current input locale from Locale string.
@@ -303,12 +303,21 @@ public class SubtypeSwitcher {
////////////////////////////
public void switchToShortcutIME() {
- final IBinder token = mService.getWindow().getWindow().getAttributes().token;
- if (token == null || mShortcutInputMethodInfo == null) {
+ if (mShortcutInputMethodInfo == null) {
return;
}
+
final String imiId = mShortcutInputMethodInfo.getId();
final InputMethodSubtypeCompatWrapper subtype = mShortcutSubtype;
+ switchToTargetIME(imiId, subtype);
+ }
+
+ private void switchToTargetIME(
+ final String imiId, final InputMethodSubtypeCompatWrapper subtype) {
+ final IBinder token = mService.getWindow().getWindow().getAttributes().token;
+ if (token == null) {
+ return;
+ }
new AsyncTask() {
@Override
protected Void doInBackground(Void... params) {
@@ -412,11 +421,7 @@ public class SubtypeSwitcher {
//////////////////////////////////
public int getEnabledKeyboardLocaleCount() {
- if (mConfigUseSpacebarLanguageSwitcher) {
- return mLanguageSwitcher.getLocaleCount();
- } else {
- return mEnabledKeyboardSubtypesOfCurrentInputMethod.size();
- }
+ return mEnabledKeyboardSubtypesOfCurrentInputMethod.size();
}
public boolean useSpacebarLanguageSwitcher() {
@@ -428,74 +433,37 @@ public class SubtypeSwitcher {
}
public Locale getInputLocale() {
- if (mConfigUseSpacebarLanguageSwitcher) {
- return mLanguageSwitcher.getInputLocale();
- } else {
- return mInputLocale;
- }
+ return mInputLocale;
}
public String getInputLocaleStr() {
- if (mConfigUseSpacebarLanguageSwitcher) {
- String inputLanguage = null;
- inputLanguage = mLanguageSwitcher.getInputLanguage();
- // Should return system locale if there is no Language available.
- if (inputLanguage == null) {
- inputLanguage = getSystemLocale().getLanguage();
- }
- return inputLanguage;
- } else {
- return mInputLocaleStr;
- }
+ return mInputLocaleStr;
}
public String[] getEnabledLanguages() {
- if (mConfigUseSpacebarLanguageSwitcher) {
- return mLanguageSwitcher.getEnabledLanguages();
- } else {
- int enabledLanguageCount = mEnabledLanguagesOfCurrentInputMethod.size();
- // Workaround for explicitly specifying the voice language
- if (enabledLanguageCount == 1) {
- mEnabledLanguagesOfCurrentInputMethod.add(
- mEnabledLanguagesOfCurrentInputMethod.get(0));
- ++enabledLanguageCount;
- }
- return mEnabledLanguagesOfCurrentInputMethod.toArray(
- new String[enabledLanguageCount]);
+ int enabledLanguageCount = mEnabledLanguagesOfCurrentInputMethod.size();
+ // Workaround for explicitly specifying the voice language
+ if (enabledLanguageCount == 1) {
+ mEnabledLanguagesOfCurrentInputMethod.add(mEnabledLanguagesOfCurrentInputMethod
+ .get(0));
+ ++enabledLanguageCount;
}
+ return mEnabledLanguagesOfCurrentInputMethod.toArray(new String[enabledLanguageCount]);
}
public Locale getSystemLocale() {
- if (mConfigUseSpacebarLanguageSwitcher) {
- return mLanguageSwitcher.getSystemLocale();
- } else {
- return mSystemLocale;
- }
+ return mSystemLocale;
}
public boolean isSystemLanguageSameAsInputLanguage() {
- if (mConfigUseSpacebarLanguageSwitcher) {
- return getSystemLocale().getLanguage().equalsIgnoreCase(
- getInputLocaleStr().substring(0, 2));
- } else {
- return mIsSystemLanguageSameAsInputLanguage;
- }
+ return mIsSystemLanguageSameAsInputLanguage;
}
public void onConfigurationChanged(Configuration conf) {
final Locale systemLocale = conf.locale;
// If system configuration was changed, update all parameters.
if (!TextUtils.equals(systemLocale.toString(), mSystemLocale.toString())) {
- if (mConfigUseSpacebarLanguageSwitcher) {
- // If the system locale changes and is different from the saved
- // locale (mSystemLocale), then reload the input locale list from the
- // latin ime settings (shared prefs) and reset the input locale
- // to the first one.
- mLanguageSwitcher.loadLocales(mPrefs);
- mLanguageSwitcher.setSystemLocale(systemLocale);
- } else {
- updateAllParameters();
- }
+ updateAllParameters();
}
}
@@ -554,7 +522,70 @@ public class SubtypeSwitcher {
// Spacebar Language Switch support //
//////////////////////////////////////
- private LanguageSwitcher mLanguageSwitcher;
+ private class LanguageBarInfo {
+ private int mCurrentKeyboardSubtypeIndex;
+ private InputMethodSubtypeCompatWrapper mNextKeyboardSubtype;
+ private InputMethodSubtypeCompatWrapper mPreviousKeyboardSubtype;
+ private String mNextLanguage;
+ private String mPreviousLanguage;
+ public LanguageBarInfo() {
+ update();
+ }
+
+ private String getNextLanguage() {
+ return mNextLanguage;
+ }
+
+ private String getPreviousLanguage() {
+ return mPreviousLanguage;
+ }
+
+ public InputMethodSubtypeCompatWrapper getNextKeyboardSubtype() {
+ return mNextKeyboardSubtype;
+ }
+
+ public InputMethodSubtypeCompatWrapper getPreviousKeyboardSubtype() {
+ return mPreviousKeyboardSubtype;
+ }
+
+ public void update() {
+ if (!mConfigUseSpacebarLanguageSwitcher
+ || mEnabledKeyboardSubtypesOfCurrentInputMethod == null
+ || mEnabledKeyboardSubtypesOfCurrentInputMethod.size() == 0) return;
+ mCurrentKeyboardSubtypeIndex = getCurrentIndex();
+ mNextKeyboardSubtype = getNextKeyboardSubtypeInternal(mCurrentKeyboardSubtypeIndex);
+ Locale locale = new Locale(mNextKeyboardSubtype.getLocale());
+ mNextLanguage = getDisplayLanguage(locale);
+ mPreviousKeyboardSubtype = getPreviousKeyboardSubtypeInternal(
+ mCurrentKeyboardSubtypeIndex);
+ locale = new Locale(mPreviousKeyboardSubtype.getLocale());
+ mPreviousLanguage = getDisplayLanguage(locale);
+ }
+
+ private int normalize(int index) {
+ final int N = mEnabledKeyboardSubtypesOfCurrentInputMethod.size();
+ final int ret = index % N;
+ return ret < 0 ? ret + N : ret;
+ }
+
+ private int getCurrentIndex() {
+ final int N = mEnabledKeyboardSubtypesOfCurrentInputMethod.size();
+ for (int i = 0; i < N; ++i) {
+ if (mEnabledKeyboardSubtypesOfCurrentInputMethod.get(i).equals(mCurrentSubtype)) {
+ return i;
+ }
+ }
+ return 0;
+ }
+
+ private InputMethodSubtypeCompatWrapper getNextKeyboardSubtypeInternal(int index) {
+ return mEnabledKeyboardSubtypesOfCurrentInputMethod.get(normalize(index + 1));
+ }
+
+ private InputMethodSubtypeCompatWrapper getPreviousKeyboardSubtypeInternal(int index) {
+ return mEnabledKeyboardSubtypesOfCurrentInputMethod.get(normalize(index - 1));
+ }
+ }
public static String getFullDisplayName(Locale locale, boolean returnsNameInThisLocale) {
if (returnsNameInThisLocale) {
@@ -579,32 +610,16 @@ public class SubtypeSwitcher {
return Character.toUpperCase(s.charAt(0)) + s.substring(1);
}
- private void updateForSpacebarLanguageSwitch() {
- // We need to update mNeedsToDisplayLanguage in onStartInputView because
- // getEnabledKeyboardLocaleCount could have been changed.
- mNeedsToDisplayLanguage = !(getEnabledKeyboardLocaleCount() <= 1
- && getSystemLocale().getLanguage().equalsIgnoreCase(
- getInputLocale().getLanguage()));
- }
-
public String getInputLanguageName() {
return getDisplayLanguage(getInputLocale());
}
public String getNextInputLanguageName() {
- if (mConfigUseSpacebarLanguageSwitcher) {
- return getDisplayLanguage(mLanguageSwitcher.getNextInputLocale());
- } else {
- return "";
- }
+ return mLanguageBarInfo.getNextLanguage();
}
public String getPreviousInputLanguageName() {
- if (mConfigUseSpacebarLanguageSwitcher) {
- return getDisplayLanguage(mLanguageSwitcher.getPrevInputLocale());
- } else {
- return "";
- }
+ return mLanguageBarInfo.getPreviousLanguage();
}
/////////////////////////////
@@ -644,31 +659,23 @@ public class SubtypeSwitcher {
return voiceInputSupportedLocales.contains(locale);
}
- public void loadSettings() {
- if (mConfigUseSpacebarLanguageSwitcher) {
- mLanguageSwitcher.loadLocales(mPrefs);
- }
+ private void changeToNextSubtype() {
+ final InputMethodSubtypeCompatWrapper subtype =
+ mLanguageBarInfo.getNextKeyboardSubtype();
+ switchToTargetIME(mInputMethodId, subtype);
}
- public void toggleLanguage(boolean reset, boolean next) {
- if (mConfigUseSpacebarLanguageSwitcher) {
- if (reset) {
- mLanguageSwitcher.reset();
- } else {
- if (next) {
- mLanguageSwitcher.next();
- } else {
- mLanguageSwitcher.prev();
- }
- }
- mLanguageSwitcher.persist(mPrefs);
- }
+ private void changeToPreviousSubtype() {
+ final InputMethodSubtypeCompatWrapper subtype =
+ mLanguageBarInfo.getPreviousKeyboardSubtype();
+ switchToTargetIME(mInputMethodId, subtype);
}
- private void initLanguageSwitcher(LatinIME service) {
- final Configuration conf = service.getResources().getConfiguration();
- mLanguageSwitcher = new LanguageSwitcher(service);
- mLanguageSwitcher.loadLocales(mPrefs);
- mLanguageSwitcher.setSystemLocale(conf.locale);
+ public void toggleLanguage(boolean next) {
+ if (next) {
+ changeToNextSubtype();
+ } else {
+ changeToPreviousSubtype();
+ }
}
}
diff --git a/java/src/com/android/inputmethod/latin/TextEntryState.java b/java/src/com/android/inputmethod/latin/TextEntryState.java
index 63196430b..de13f3ae4 100644
--- a/java/src/com/android/inputmethod/latin/TextEntryState.java
+++ b/java/src/com/android/inputmethod/latin/TextEntryState.java
@@ -16,6 +16,8 @@
package com.android.inputmethod.latin;
+import com.android.inputmethod.latin.Utils.RingCharBuffer;
+
import android.util.Log;
public class TextEntryState {
@@ -43,10 +45,12 @@ public class TextEntryState {
sState = newState;
}
- public static void acceptedDefault(CharSequence typedWord, CharSequence actualWord) {
+ public static void acceptedDefault(CharSequence typedWord, CharSequence actualWord,
+ int separatorCode) {
if (typedWord == null) return;
setState(ACCEPTED_DEFAULT);
- LatinImeLogger.logOnAutoSuggestion(typedWord.toString(), actualWord.toString());
+ LatinImeLogger.logOnAutoCorrection(
+ typedWord.toString(), actualWord.toString(), separatorCode);
if (DEBUG)
displayState("acceptedDefault", "typedWord", typedWord, "actualWord", actualWord);
}
@@ -95,7 +99,7 @@ public class TextEntryState {
if (DEBUG) displayState("onAbortRecorrection");
}
- public static void typedCharacter(char c, boolean isSeparator) {
+ public static void typedCharacter(char c, boolean isSeparator, int x, int y) {
final boolean isSpace = (c == ' ');
switch (sState) {
case IN_WORD:
@@ -149,13 +153,19 @@ public class TextEntryState {
setState(START);
break;
}
+ RingCharBuffer.getInstance().push(c, x, y);
+ if (isSeparator) {
+ LatinImeLogger.logOnInputSeparator();
+ } else {
+ LatinImeLogger.logOnInputChar();
+ }
if (DEBUG) displayState("typedCharacter", "char", c, "isSeparator", isSeparator);
}
public static void backspace() {
if (sState == ACCEPTED_DEFAULT) {
setState(UNDO_COMMIT);
- LatinImeLogger.logOnAutoSuggestionCanceled();
+ LatinImeLogger.logOnAutoCorrectionCancelled();
} else if (sState == UNDO_COMMIT) {
setState(IN_WORD);
}
diff --git a/java/src/com/android/inputmethod/latin/UserBigramDictionary.java b/java/src/com/android/inputmethod/latin/UserBigramDictionary.java
index 4750fb991..bb6642cd9 100644
--- a/java/src/com/android/inputmethod/latin/UserBigramDictionary.java
+++ b/java/src/com/android/inputmethod/latin/UserBigramDictionary.java
@@ -44,12 +44,6 @@ public class UserBigramDictionary extends ExpandableDictionary {
/** Maximum frequency for all pairs */
private static final int FREQUENCY_MAX = 127;
- /**
- * If this pair is typed 6 times, it would be suggested.
- * Should be smaller than ContactsDictionary.FREQUENCY_FOR_CONTACTS_BIGRAM
- */
- protected static final int SUGGEST_THRESHOLD = 6 * FREQUENCY_FOR_TYPED;
-
/** Maximum number of pairs. Pruning will start when databases goes above this number. */
private static int sMaxUserBigrams = 10000;
diff --git a/java/src/com/android/inputmethod/latin/Utils.java b/java/src/com/android/inputmethod/latin/Utils.java
index e679209e7..69552a390 100644
--- a/java/src/com/android/inputmethod/latin/Utils.java
+++ b/java/src/com/android/inputmethod/latin/Utils.java
@@ -209,11 +209,11 @@ public class Utils {
return mCharBuf[mEnd];
}
}
- public char getLastChar() {
- if (mLength < 1) {
+ public char getBackwardNthChar(int n) {
+ if (mLength <= n || n < 0) {
return PLACEHOLDER_DELIMITER_CHAR;
} else {
- return mCharBuf[normalize(mEnd - 1)];
+ return mCharBuf[normalize(mEnd - n - 1)];
}
}
public int getPreviousX(char c, int back) {
@@ -234,9 +234,16 @@ public class Utils {
return mYBuf[index];
}
}
- public String getLastString() {
+ public String getLastWord(int ignoreCharCount) {
StringBuilder sb = new StringBuilder();
- for (int i = 0; i < mLength; ++i) {
+ int i = ignoreCharCount;
+ for (; i < mLength; ++i) {
+ char c = mCharBuf[normalize(mEnd - 1 - i)];
+ if (!((LatinIME)mContext).isWordSeparator(c)) {
+ break;
+ }
+ }
+ for (; i < mLength; ++i) {
char c = mCharBuf[normalize(mEnd - 1 - i)];
if (!((LatinIME)mContext).isWordSeparator(c)) {
sb.append(c);
diff --git a/native/src/defines.h b/native/src/defines.h
index 926120703..ff195f40c 100644
--- a/native/src/defines.h
+++ b/native/src/defines.h
@@ -138,7 +138,8 @@ static void prof_out(void) {
#define SUGGEST_WORDS_WITH_SPACE_PROXIMITY true
// The following "rate"s are used as a multiplier before dividing by 100, so they are in percent.
-#define WORDS_WITH_MISSING_CHARACTER_DEMOTION_RATE 70
+#define WORDS_WITH_MISSING_CHARACTER_DEMOTION_RATE 90
+#define WORDS_WITH_MISSING_CHARACTER_DEMOTION_START_POS_10X 12
#define WORDS_WITH_MISSING_SPACE_CHARACTER_DEMOTION_RATE 80
#define WORDS_WITH_EXCESSIVE_CHARACTER_DEMOTION_RATE 75
#define WORDS_WITH_EXCESSIVE_CHARACTER_OUT_OF_PROXIMITY_DEMOTION_RATE 75
diff --git a/native/src/unigram_dictionary.cpp b/native/src/unigram_dictionary.cpp
index c18829014..2ae2bca92 100644
--- a/native/src/unigram_dictionary.cpp
+++ b/native/src/unigram_dictionary.cpp
@@ -518,9 +518,12 @@ inline int UnigramDictionary::calculateFinalFreq(const int inputIndex, const int
// TODO: Demote by edit distance
int finalFreq = freq * matchWeight;
if (skipPos >= 0) {
- if (mInputLength >= 3) {
- multiplyRate(WORDS_WITH_MISSING_CHARACTER_DEMOTION_RATE *
- (mInputLength - 2) / (mInputLength - 1), &finalFreq);
+ if (mInputLength >= 2) {
+ const int demotionRate = WORDS_WITH_MISSING_CHARACTER_DEMOTION_RATE
+ * (10 * mInputLength - WORDS_WITH_MISSING_CHARACTER_DEMOTION_START_POS_10X)
+ / (10 * mInputLength
+ - WORDS_WITH_MISSING_CHARACTER_DEMOTION_START_POS_10X + 10);
+ multiplyRate(demotionRate, &finalFreq);
} else {
finalFreq = 0;
}