am c8b9c322: (-s ours) am 1f2113b2: Import revised translations.  DO NOT MERGE
diff --git a/java/res/drawable-mdpi/keyboard_hint_at.9.png b/java/res/drawable-mdpi/keyboard_hint_at.9.png
new file mode 100644
index 0000000..69baede
--- /dev/null
+++ b/java/res/drawable-mdpi/keyboard_hint_at.9.png
Binary files differ
diff --git a/java/res/drawable-mdpi/keyboard_hint_colon.9.png b/java/res/drawable-mdpi/keyboard_hint_colon.9.png
new file mode 100644
index 0000000..9d0d7cb
--- /dev/null
+++ b/java/res/drawable-mdpi/keyboard_hint_colon.9.png
Binary files differ
diff --git a/java/res/drawable-mdpi/keyboard_hint_doublecross.9.png b/java/res/drawable-mdpi/keyboard_hint_doublecross.9.png
new file mode 100644
index 0000000..d24aa0f
--- /dev/null
+++ b/java/res/drawable-mdpi/keyboard_hint_doublecross.9.png
Binary files differ
diff --git a/java/res/drawable-mdpi/keyboard_hint_exclamation.9.png b/java/res/drawable-mdpi/keyboard_hint_exclamation.9.png
new file mode 100644
index 0000000..f6cc7fe
--- /dev/null
+++ b/java/res/drawable-mdpi/keyboard_hint_exclamation.9.png
Binary files differ
diff --git a/java/res/drawable-mdpi/keyboard_hint_greater.9.png b/java/res/drawable-mdpi/keyboard_hint_greater.9.png
new file mode 100644
index 0000000..5210392
--- /dev/null
+++ b/java/res/drawable-mdpi/keyboard_hint_greater.9.png
Binary files differ
diff --git a/java/res/drawable-mdpi/keyboard_hint_plus.9.png b/java/res/drawable-mdpi/keyboard_hint_plus.9.png
new file mode 100644
index 0000000..d1d85ac
--- /dev/null
+++ b/java/res/drawable-mdpi/keyboard_hint_plus.9.png
Binary files differ
diff --git a/java/res/drawable-mdpi/keyboard_hint_question.9.png b/java/res/drawable-mdpi/keyboard_hint_question.9.png
new file mode 100644
index 0000000..37f6e5f
--- /dev/null
+++ b/java/res/drawable-mdpi/keyboard_hint_question.9.png
Binary files differ
diff --git a/java/res/drawable-mdpi/keyboard_hint_quote.9.png b/java/res/drawable-mdpi/keyboard_hint_quote.9.png
new file mode 100644
index 0000000..e7d2cb5
--- /dev/null
+++ b/java/res/drawable-mdpi/keyboard_hint_quote.9.png
Binary files differ
diff --git a/java/res/drawable-mdpi/keyboard_hint_smaller.9.png b/java/res/drawable-mdpi/keyboard_hint_smaller.9.png
new file mode 100644
index 0000000..76553cf
--- /dev/null
+++ b/java/res/drawable-mdpi/keyboard_hint_smaller.9.png
Binary files differ
diff --git a/java/res/drawable-mdpi/keyboard_hint_star.9.png b/java/res/drawable-mdpi/keyboard_hint_star.9.png
new file mode 100644
index 0000000..47978c4
--- /dev/null
+++ b/java/res/drawable-mdpi/keyboard_hint_star.9.png
Binary files differ
diff --git a/java/res/drawable-xlarge/btn_keyboard_key_dark_normal_holo.9.png b/java/res/drawable-xlarge/btn_keyboard_key_dark_normal_holo.9.png
new file mode 100644
index 0000000..c23ff18
--- /dev/null
+++ b/java/res/drawable-xlarge/btn_keyboard_key_dark_normal_holo.9.png
Binary files differ
diff --git a/java/res/drawable-xlarge/btn_keyboard_key_dark_normal_off_holo.9.png b/java/res/drawable-xlarge/btn_keyboard_key_dark_normal_off_holo.9.png
new file mode 100644
index 0000000..e29de9a
--- /dev/null
+++ b/java/res/drawable-xlarge/btn_keyboard_key_dark_normal_off_holo.9.png
Binary files differ
diff --git a/java/res/drawable-xlarge/btn_keyboard_key_dark_normal_on_holo.9.png b/java/res/drawable-xlarge/btn_keyboard_key_dark_normal_on_holo.9.png
new file mode 100644
index 0000000..d46c03a
--- /dev/null
+++ b/java/res/drawable-xlarge/btn_keyboard_key_dark_normal_on_holo.9.png
Binary files differ
diff --git a/java/res/drawable-xlarge/btn_keyboard_key_dark_pressed_holo.9.png b/java/res/drawable-xlarge/btn_keyboard_key_dark_pressed_holo.9.png
new file mode 100644
index 0000000..45ca3a7
--- /dev/null
+++ b/java/res/drawable-xlarge/btn_keyboard_key_dark_pressed_holo.9.png
Binary files differ
diff --git a/java/res/drawable-xlarge/btn_keyboard_key_dark_pressed_off_holo.9.png b/java/res/drawable-xlarge/btn_keyboard_key_dark_pressed_off_holo.9.png
new file mode 100644
index 0000000..da039f3
--- /dev/null
+++ b/java/res/drawable-xlarge/btn_keyboard_key_dark_pressed_off_holo.9.png
Binary files differ
diff --git a/java/res/drawable-xlarge/btn_keyboard_key_dark_pressed_on_holo.9.png b/java/res/drawable-xlarge/btn_keyboard_key_dark_pressed_on_holo.9.png
new file mode 100644
index 0000000..315ab17
--- /dev/null
+++ b/java/res/drawable-xlarge/btn_keyboard_key_dark_pressed_on_holo.9.png
Binary files differ
diff --git a/java/res/drawable-xlarge/btn_keyboard_key_gingerbread.xml b/java/res/drawable-xlarge/btn_keyboard_key_gingerbread.xml
new file mode 100644
index 0000000..3dab843
--- /dev/null
+++ b/java/res/drawable-xlarge/btn_keyboard_key_gingerbread.xml
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2010 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<!-- TODO: Remove "gingerbread" from file name and rename this to "btn_keyboard_key.xml". -->
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+
+    <!-- Functional keys. -->
+
+    <item android:state_single="true" android:state_pressed="true"
+          android:drawable="@drawable/btn_keyboard_key_dark_pressed_holo" />
+    <item android:state_single="true"
+          android:drawable="@drawable/btn_keyboard_key_dark_normal_holo" />
+
+    <!-- Toggle keys. Use checkable/checked state. -->
+
+    <item android:state_checkable="true" android:state_checked="true" android:state_pressed="true"
+          android:drawable="@drawable/btn_keyboard_key_dark_pressed_on_holo" />
+    <item android:state_checkable="true" android:state_pressed="true"
+          android:drawable="@drawable/btn_keyboard_key_dark_pressed_off_holo" />
+    <item android:state_checkable="true" android:state_checked="true"
+          android:drawable="@drawable/btn_keyboard_key_dark_normal_on_holo" />
+    <item android:state_checkable="true"
+          android:drawable="@drawable/btn_keyboard_key_dark_normal_off_holo" />
+
+    <!-- Normal keys -->
+
+    <item android:state_pressed="true"
+          android:drawable="@drawable/btn_keyboard_key_light_pressed_holo" />
+    <item android:drawable="@drawable/btn_keyboard_key_light_normal_holo" />
+</selector>
diff --git a/java/res/drawable-xlarge/btn_keyboard_key_light_normal_holo.9.png b/java/res/drawable-xlarge/btn_keyboard_key_light_normal_holo.9.png
new file mode 100644
index 0000000..a1c80a2
--- /dev/null
+++ b/java/res/drawable-xlarge/btn_keyboard_key_light_normal_holo.9.png
Binary files differ
diff --git a/java/res/drawable-xlarge/btn_keyboard_key_light_pressed_holo.9.png b/java/res/drawable-xlarge/btn_keyboard_key_light_pressed_holo.9.png
new file mode 100644
index 0000000..90babfc
--- /dev/null
+++ b/java/res/drawable-xlarge/btn_keyboard_key_light_pressed_holo.9.png
Binary files differ
diff --git a/java/res/drawable-xlarge/key_hint_0_holo.9.png b/java/res/drawable-xlarge/key_hint_0_holo.9.png
new file mode 100644
index 0000000..33b6b40
--- /dev/null
+++ b/java/res/drawable-xlarge/key_hint_0_holo.9.png
Binary files differ
diff --git a/java/res/drawable-xlarge/key_hint_1_holo.9.png b/java/res/drawable-xlarge/key_hint_1_holo.9.png
new file mode 100644
index 0000000..df47e7b
--- /dev/null
+++ b/java/res/drawable-xlarge/key_hint_1_holo.9.png
Binary files differ
diff --git a/java/res/drawable-xlarge/key_hint_2_holo.9.png b/java/res/drawable-xlarge/key_hint_2_holo.9.png
new file mode 100644
index 0000000..bea76f3
--- /dev/null
+++ b/java/res/drawable-xlarge/key_hint_2_holo.9.png
Binary files differ
diff --git a/java/res/drawable-xlarge/key_hint_3_holo.9.png b/java/res/drawable-xlarge/key_hint_3_holo.9.png
new file mode 100644
index 0000000..8f8f89d
--- /dev/null
+++ b/java/res/drawable-xlarge/key_hint_3_holo.9.png
Binary files differ
diff --git a/java/res/drawable-xlarge/key_hint_4_holo.9.png b/java/res/drawable-xlarge/key_hint_4_holo.9.png
new file mode 100644
index 0000000..feaa88a
--- /dev/null
+++ b/java/res/drawable-xlarge/key_hint_4_holo.9.png
Binary files differ
diff --git a/java/res/drawable-xlarge/key_hint_5_holo.9.png b/java/res/drawable-xlarge/key_hint_5_holo.9.png
new file mode 100644
index 0000000..b3635e0
--- /dev/null
+++ b/java/res/drawable-xlarge/key_hint_5_holo.9.png
Binary files differ
diff --git a/java/res/drawable-xlarge/key_hint_6_holo.9.png b/java/res/drawable-xlarge/key_hint_6_holo.9.png
new file mode 100644
index 0000000..1345980
--- /dev/null
+++ b/java/res/drawable-xlarge/key_hint_6_holo.9.png
Binary files differ
diff --git a/java/res/drawable-xlarge/key_hint_7_holo.9.png b/java/res/drawable-xlarge/key_hint_7_holo.9.png
new file mode 100644
index 0000000..4373010
--- /dev/null
+++ b/java/res/drawable-xlarge/key_hint_7_holo.9.png
Binary files differ
diff --git a/java/res/drawable-xlarge/key_hint_8_holo.9.png b/java/res/drawable-xlarge/key_hint_8_holo.9.png
new file mode 100644
index 0000000..1bde6d1
--- /dev/null
+++ b/java/res/drawable-xlarge/key_hint_8_holo.9.png
Binary files differ
diff --git a/java/res/drawable-xlarge/key_hint_9_holo.9.png b/java/res/drawable-xlarge/key_hint_9_holo.9.png
new file mode 100644
index 0000000..61d6f55
--- /dev/null
+++ b/java/res/drawable-xlarge/key_hint_9_holo.9.png
Binary files differ
diff --git a/java/res/drawable-xlarge/key_hint_at_holo.9.png b/java/res/drawable-xlarge/key_hint_at_holo.9.png
new file mode 100644
index 0000000..f422a84
--- /dev/null
+++ b/java/res/drawable-xlarge/key_hint_at_holo.9.png
Binary files differ
diff --git a/java/res/drawable-xlarge/key_hint_colon_holo.9.png b/java/res/drawable-xlarge/key_hint_colon_holo.9.png
new file mode 100644
index 0000000..7c769bd
--- /dev/null
+++ b/java/res/drawable-xlarge/key_hint_colon_holo.9.png
Binary files differ
diff --git a/java/res/drawable-xlarge/key_hint_comma_holo.9.png b/java/res/drawable-xlarge/key_hint_comma_holo.9.png
new file mode 100644
index 0000000..a9689ad
--- /dev/null
+++ b/java/res/drawable-xlarge/key_hint_comma_holo.9.png
Binary files differ
diff --git a/java/res/drawable-xlarge/key_hint_dash_holo.9.png b/java/res/drawable-xlarge/key_hint_dash_holo.9.png
new file mode 100644
index 0000000..2402994
--- /dev/null
+++ b/java/res/drawable-xlarge/key_hint_dash_holo.9.png
Binary files differ
diff --git a/java/res/drawable-xlarge/key_hint_equal_holo.9.png b/java/res/drawable-xlarge/key_hint_equal_holo.9.png
new file mode 100644
index 0000000..89e5084
--- /dev/null
+++ b/java/res/drawable-xlarge/key_hint_equal_holo.9.png
Binary files differ
diff --git a/java/res/drawable-xlarge/key_hint_exclamation_holo.9.png b/java/res/drawable-xlarge/key_hint_exclamation_holo.9.png
new file mode 100644
index 0000000..f349538
--- /dev/null
+++ b/java/res/drawable-xlarge/key_hint_exclamation_holo.9.png
Binary files differ
diff --git a/java/res/drawable-xlarge/key_hint_larger_holo.9.png b/java/res/drawable-xlarge/key_hint_larger_holo.9.png
new file mode 100644
index 0000000..2d73436
--- /dev/null
+++ b/java/res/drawable-xlarge/key_hint_larger_holo.9.png
Binary files differ
diff --git a/java/res/drawable-xlarge/key_hint_parenclose_holo.9.png b/java/res/drawable-xlarge/key_hint_parenclose_holo.9.png
new file mode 100644
index 0000000..48f9f80
--- /dev/null
+++ b/java/res/drawable-xlarge/key_hint_parenclose_holo.9.png
Binary files differ
diff --git a/java/res/drawable-xlarge/key_hint_parenopen_holo.9.png b/java/res/drawable-xlarge/key_hint_parenopen_holo.9.png
new file mode 100644
index 0000000..f05ae20
--- /dev/null
+++ b/java/res/drawable-xlarge/key_hint_parenopen_holo.9.png
Binary files differ
diff --git a/java/res/drawable-xlarge/key_hint_period_holo.9.png b/java/res/drawable-xlarge/key_hint_period_holo.9.png
new file mode 100644
index 0000000..ec330fb
--- /dev/null
+++ b/java/res/drawable-xlarge/key_hint_period_holo.9.png
Binary files differ
diff --git a/java/res/drawable-xlarge/key_hint_plus_holo.9.png b/java/res/drawable-xlarge/key_hint_plus_holo.9.png
new file mode 100644
index 0000000..770bf5d
--- /dev/null
+++ b/java/res/drawable-xlarge/key_hint_plus_holo.9.png
Binary files differ
diff --git a/java/res/drawable-xlarge/key_hint_question_holo.9.png b/java/res/drawable-xlarge/key_hint_question_holo.9.png
new file mode 100644
index 0000000..f24bb1c
--- /dev/null
+++ b/java/res/drawable-xlarge/key_hint_question_holo.9.png
Binary files differ
diff --git a/java/res/drawable-xlarge/key_hint_quote_holo.9.png b/java/res/drawable-xlarge/key_hint_quote_holo.9.png
new file mode 100644
index 0000000..ceee67d
--- /dev/null
+++ b/java/res/drawable-xlarge/key_hint_quote_holo.9.png
Binary files differ
diff --git a/java/res/drawable-xlarge/key_hint_semicolon_holo.9.png b/java/res/drawable-xlarge/key_hint_semicolon_holo.9.png
new file mode 100644
index 0000000..e8d6b02
--- /dev/null
+++ b/java/res/drawable-xlarge/key_hint_semicolon_holo.9.png
Binary files differ
diff --git a/java/res/drawable-xlarge/key_hint_simplequote_holo.9.png b/java/res/drawable-xlarge/key_hint_simplequote_holo.9.png
new file mode 100644
index 0000000..7cafbb0
--- /dev/null
+++ b/java/res/drawable-xlarge/key_hint_simplequote_holo.9.png
Binary files differ
diff --git a/java/res/drawable-xlarge/key_hint_slash_holo.9.png b/java/res/drawable-xlarge/key_hint_slash_holo.9.png
new file mode 100644
index 0000000..676d566
--- /dev/null
+++ b/java/res/drawable-xlarge/key_hint_slash_holo.9.png
Binary files differ
diff --git a/java/res/drawable-xlarge/key_hint_smaller_holo.9.png b/java/res/drawable-xlarge/key_hint_smaller_holo.9.png
new file mode 100644
index 0000000..97cf26e
--- /dev/null
+++ b/java/res/drawable-xlarge/key_hint_smaller_holo.9.png
Binary files differ
diff --git a/java/res/drawable-xlarge/key_hint_star_holo.9.png b/java/res/drawable-xlarge/key_hint_star_holo.9.png
new file mode 100644
index 0000000..b10aa89
--- /dev/null
+++ b/java/res/drawable-xlarge/key_hint_star_holo.9.png
Binary files differ
diff --git a/java/res/drawable-xlarge/key_hint_underline_holo.9.png b/java/res/drawable-xlarge/key_hint_underline_holo.9.png
new file mode 100644
index 0000000..38abfcb
--- /dev/null
+++ b/java/res/drawable-xlarge/key_hint_underline_holo.9.png
Binary files differ
diff --git a/java/res/values-cs/strings.xml b/java/res/values-cs/strings.xml
index 7a4cf78..497e0b8 100644
--- a/java/res/values-cs/strings.xml
+++ b/java/res/values-cs/strings.xml
@@ -22,10 +22,12 @@
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="english_ime_name" msgid="7252517407088836577">"Klávesnice Android"</string>
     <string name="english_ime_settings" msgid="6661589557206947774">"Nastavení klávesnice Android"</string>
-    <string name="english_ime_input_options" msgid="3909945612939668554">"Možnosti zadávání textu a dat"</string>
+    <!-- no translation found for english_ime_input_options (3909945612939668554) -->
+    <skip />
     <string name="vibrate_on_keypress" msgid="5258079494276955460">"Při stisku klávesy vibrovat"</string>
     <string name="sound_on_keypress" msgid="6093592297198243644">"Zvuk při stisku klávesy"</string>
-    <string name="popup_on_keypress" msgid="123894815723512944">"Zobrazit znaky při stisku klávesy"</string>
+    <!-- no translation found for popup_on_keypress (123894815723512944) -->
+    <skip />
     <string name="hit_correction" msgid="4855351009261318389">"Opravovat překlepy"</string>
     <string name="hit_correction_summary" msgid="8761701873008070796">"Povolit opravu chyb vstupu"</string>
     <string name="hit_correction_land" msgid="2567691684825205448">"Chyby vstupu v zobrazení na šířku"</string>
@@ -48,10 +50,14 @@
     <string name="show_suggestions_summary" msgid="1989672863935759654">"Zobrazovat navržená slova během psaní"</string>
     <string name="auto_complete" msgid="1103196318775486023">"Automatické dokončování"</string>
     <string name="auto_complete_summary" msgid="6113149638718274624">"Stisknutím mezerníku nebo interpunkčního znaménka automaticky vložíte zvýrazněné slovo."</string>
-    <string name="prefs_settings_key" msgid="4623341240804046498">"Zobrazit klávesu Nastavení"</string>
-    <string name="settings_key_mode_auto_name" msgid="2993460277873684680">"Automaticky"</string>
-    <string name="settings_key_mode_always_show_name" msgid="3047567041784760575">"Vždy zobrazovat"</string>
-    <string name="settings_key_mode_always_hide_name" msgid="7833948046716923994">"Vždy skrývat"</string>
+    <!-- no translation found for prefs_settings_key (4623341240804046498) -->
+    <skip />
+    <!-- no translation found for settings_key_mode_auto_name (2993460277873684680) -->
+    <skip />
+    <!-- no translation found for settings_key_mode_always_show_name (3047567041784760575) -->
+    <skip />
+    <!-- no translation found for settings_key_mode_always_hide_name (7833948046716923994) -->
+    <skip />
     <!-- no translation found for settings_key_modes:0 (8549888726962891527) -->
     <!-- no translation found for settings_key_modes:1 (881280041213210923) -->
     <!-- no translation found for settings_key_modes:2 (7317310620171067848) -->
@@ -125,16 +131,24 @@
     <string name="popular_domain_2" msgid="3036812463748402878">".org"</string>
     <string name="popular_domain_3" msgid="8718639560809452028">".net"</string>
     <string name="popular_domain_4" msgid="35359437471311470">".eu"</string>
-    <string name="selectInputMethod" msgid="315076553378705821">"Výběr metody zadávání dat"</string>
+    <!-- no translation found for selectInputMethod (315076553378705821) -->
+    <skip />
     <string name="language_selection_title" msgid="1651299598555326750">"Vstupní jazyky"</string>
     <string name="language_selection_summary" msgid="187110938289512256">"Jazyk můžete změnit posunutím prstu po mezerníku."</string>
-    <string name="hint_add_to_dictionary" msgid="9006292060636342317">"← Dalším dotykem slovo uložíte"</string>
+    <string name="hint_add_to_dictionary" msgid="8058519710062071085">"← Uložte slovo opětovným klepnutím"</string>
     <string name="has_dictionary" msgid="6071847973466625007">"K dispozici je slovník"</string>
-    <string name="prefs_enable_log" msgid="6620424505072963557">"Aktivovat zasílání statistik užívání a zpráv o selhání"</string>
-    <string name="prefs_description_log" msgid="5827825607258246003">"Automatickým zasíláním statistik o užívání editoru zadávání dat a zpráv o jeho selhání do Googlu můžete přispět k vylepšení tohoto nástroje."</string>
-    <!-- outdated translation 5809974560359283818 -->     <string name="prefs_enable_recorrection" msgid="4588408906649533582">"Dotykem aktivujete opravy"</string>
-    <!-- outdated translation 5037231665897435902 -->     <string name="prefs_enable_recorrection_summary" msgid="1056068922330206170">"Dotknete-li se slov, která jste napsali, můžete je opravit."</string>
-    <string name="keyboard_layout" msgid="437433231038683666">"Motiv klávesnice"</string>
-    <string name="subtype_mode_keyboard" msgid="2242090416595003881">"klávesnice"</string>
-    <string name="subtype_mode_voice" msgid="4394113125441627771">"hlas"</string>
+    <!-- no translation found for prefs_enable_log (6620424505072963557) -->
+    <skip />
+    <!-- no translation found for prefs_description_log (5827825607258246003) -->
+    <skip />
+    <!-- no translation found for prefs_enable_recorrection (4966265843750259377) -->
+    <skip />
+    <!-- no translation found for prefs_enable_recorrection_summary (8181745740388568396) -->
+    <skip />
+    <!-- no translation found for keyboard_layout (437433231038683666) -->
+    <skip />
+    <!-- no translation found for subtype_mode_keyboard (2242090416595003881) -->
+    <skip />
+    <!-- no translation found for subtype_mode_voice (4394113125441627771) -->
+    <skip />
 </resources>
diff --git a/java/res/values-da/strings.xml b/java/res/values-da/strings.xml
index c4d67fd..191f432 100644
--- a/java/res/values-da/strings.xml
+++ b/java/res/values-da/strings.xml
@@ -22,10 +22,12 @@
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="english_ime_name" msgid="7252517407088836577">"Android-tastatur"</string>
     <string name="english_ime_settings" msgid="6661589557206947774">"Indstillinger for Android-tastatur"</string>
-    <string name="english_ime_input_options" msgid="3909945612939668554">"Indstillinger for input"</string>
+    <!-- no translation found for english_ime_input_options (3909945612939668554) -->
+    <skip />
     <string name="vibrate_on_keypress" msgid="5258079494276955460">"Vibration ved tastetryk"</string>
     <string name="sound_on_keypress" msgid="6093592297198243644">"Lyd ved tastetryk"</string>
-    <string name="popup_on_keypress" msgid="123894815723512944">"Popup ved tastetryk"</string>
+    <!-- no translation found for popup_on_keypress (123894815723512944) -->
+    <skip />
     <string name="hit_correction" msgid="4855351009261318389">"Ret stavefejl"</string>
     <string name="hit_correction_summary" msgid="8761701873008070796">"Aktiver fejlretning af input"</string>
     <string name="hit_correction_land" msgid="2567691684825205448">"Inputfejl i landskab"</string>
@@ -48,10 +50,14 @@
     <string name="show_suggestions_summary" msgid="1989672863935759654">"Vis ordforslag under indtastning"</string>
     <string name="auto_complete" msgid="1103196318775486023">"Udfyld automatisk"</string>
     <string name="auto_complete_summary" msgid="6113149638718274624">"Mellemrumstast og tegnsætning indsætter automatisk fremhævet ord"</string>
-    <string name="prefs_settings_key" msgid="4623341240804046498">"Vis indstillingsnøgle"</string>
-    <string name="settings_key_mode_auto_name" msgid="2993460277873684680">"Automatisk"</string>
-    <string name="settings_key_mode_always_show_name" msgid="3047567041784760575">"Vis altid"</string>
-    <string name="settings_key_mode_always_hide_name" msgid="7833948046716923994">"Skjul altid"</string>
+    <!-- no translation found for prefs_settings_key (4623341240804046498) -->
+    <skip />
+    <!-- no translation found for settings_key_mode_auto_name (2993460277873684680) -->
+    <skip />
+    <!-- no translation found for settings_key_mode_always_show_name (3047567041784760575) -->
+    <skip />
+    <!-- no translation found for settings_key_mode_always_hide_name (7833948046716923994) -->
+    <skip />
     <!-- no translation found for settings_key_modes:0 (8549888726962891527) -->
     <!-- no translation found for settings_key_modes:1 (881280041213210923) -->
     <!-- no translation found for settings_key_modes:2 (7317310620171067848) -->
@@ -125,16 +131,24 @@
     <string name="popular_domain_2" msgid="3036812463748402878">".org"</string>
     <string name="popular_domain_3" msgid="8718639560809452028">".gov"</string>
     <string name="popular_domain_4" msgid="35359437471311470">".edu"</string>
-    <string name="selectInputMethod" msgid="315076553378705821">"Vælg inputmetode"</string>
+    <!-- no translation found for selectInputMethod (315076553378705821) -->
+    <skip />
     <string name="language_selection_title" msgid="1651299598555326750">"Inputsprog"</string>
     <string name="language_selection_summary" msgid="187110938289512256">"Træk fingeren på mellemrumstasten for at skifte sprog"</string>
-    <string name="hint_add_to_dictionary" msgid="9006292060636342317">"← Tryk igen for at gemme"</string>
+    <string name="hint_add_to_dictionary" msgid="8058519710062071085">"← Tast igen for at gemme"</string>
     <string name="has_dictionary" msgid="6071847973466625007">"Ordbog er tilgængelig"</string>
-    <string name="prefs_enable_log" msgid="6620424505072963557">"Aktiver brugerfeedback"</string>
-    <string name="prefs_description_log" msgid="5827825607258246003">"Vær med til at forbedre denne inputmetode ved at sende anvendelsesstatistikker og rapporter om nedbrud til Google."</string>
-    <!-- outdated translation 5809974560359283818 -->     <string name="prefs_enable_recorrection" msgid="4588408906649533582">"Tryk for at rette ord igen"</string>
-    <!-- outdated translation 5037231665897435902 -->     <string name="prefs_enable_recorrection_summary" msgid="1056068922330206170">"Du kan rette ordene igen ved at trykke på de ord, du har indtastet"</string>
-    <string name="keyboard_layout" msgid="437433231038683666">"Tastaturtema"</string>
-    <string name="subtype_mode_keyboard" msgid="2242090416595003881">"tastatur"</string>
-    <string name="subtype_mode_voice" msgid="4394113125441627771">"stemme"</string>
+    <!-- no translation found for prefs_enable_log (6620424505072963557) -->
+    <skip />
+    <!-- no translation found for prefs_description_log (5827825607258246003) -->
+    <skip />
+    <!-- no translation found for prefs_enable_recorrection (4966265843750259377) -->
+    <skip />
+    <!-- no translation found for prefs_enable_recorrection_summary (8181745740388568396) -->
+    <skip />
+    <!-- no translation found for keyboard_layout (437433231038683666) -->
+    <skip />
+    <!-- no translation found for subtype_mode_keyboard (2242090416595003881) -->
+    <skip />
+    <!-- no translation found for subtype_mode_voice (4394113125441627771) -->
+    <skip />
 </resources>
diff --git a/java/res/values-de/strings.xml b/java/res/values-de/strings.xml
index 3153d29..5b8352d 100644
--- a/java/res/values-de/strings.xml
+++ b/java/res/values-de/strings.xml
@@ -22,10 +22,12 @@
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="english_ime_name" msgid="7252517407088836577">"Android-Tastatur"</string>
     <string name="english_ime_settings" msgid="6661589557206947774">"Android-Tastatureinstellungen"</string>
-    <string name="english_ime_input_options" msgid="3909945612939668554">"Eingabeoptionen"</string>
+    <!-- no translation found for english_ime_input_options (3909945612939668554) -->
+    <skip />
     <string name="vibrate_on_keypress" msgid="5258079494276955460">"Vibrieren b. Tastendruck"</string>
     <string name="sound_on_keypress" msgid="6093592297198243644">"Ton bei Tastendruck"</string>
-    <string name="popup_on_keypress" msgid="123894815723512944">"Pop-up bei Tastendruck"</string>
+    <!-- no translation found for popup_on_keypress (123894815723512944) -->
+    <skip />
     <string name="hit_correction" msgid="4855351009261318389">"Eingabefehler korrigieren"</string>
     <string name="hit_correction_summary" msgid="8761701873008070796">"Korrektur von Eingabefehlern aktivieren"</string>
     <string name="hit_correction_land" msgid="2567691684825205448">"Eingabefehler im Querformat"</string>
@@ -48,10 +50,14 @@
     <string name="show_suggestions_summary" msgid="1989672863935759654">"Vorgeschlagene Wörter während des Tippens anzeigen"</string>
     <string name="auto_complete" msgid="1103196318775486023">"Autom. vervollständigen"</string>
     <string name="auto_complete_summary" msgid="6113149638718274624">"Leertaste und Interpunktion fügen autom. ein markiertes Wort ein"</string>
-    <string name="prefs_settings_key" msgid="4623341240804046498">"Einstellungstaste anz."</string>
-    <string name="settings_key_mode_auto_name" msgid="2993460277873684680">"Automatisch"</string>
-    <string name="settings_key_mode_always_show_name" msgid="3047567041784760575">"Immer anzeigen"</string>
-    <string name="settings_key_mode_always_hide_name" msgid="7833948046716923994">"Immer ausblenden"</string>
+    <!-- no translation found for prefs_settings_key (4623341240804046498) -->
+    <skip />
+    <!-- no translation found for settings_key_mode_auto_name (2993460277873684680) -->
+    <skip />
+    <!-- no translation found for settings_key_mode_always_show_name (3047567041784760575) -->
+    <skip />
+    <!-- no translation found for settings_key_mode_always_hide_name (7833948046716923994) -->
+    <skip />
     <!-- no translation found for settings_key_modes:0 (8549888726962891527) -->
     <!-- no translation found for settings_key_modes:1 (881280041213210923) -->
     <!-- no translation found for settings_key_modes:2 (7317310620171067848) -->
@@ -97,7 +103,7 @@
     <string name="voice_audio_error" msgid="5072707727016414454">"Audio-Problem"</string>
     <string name="voice_server_error" msgid="7807129913977261644">"Serverfehler"</string>
     <string name="voice_speech_timeout" msgid="8461817525075498795">"Keine Sprache zu hören"</string>
-    <string name="voice_no_match" msgid="4285117547030179174">"Keine Treffer gefunden"</string>
+    <string name="voice_no_match" msgid="4285117547030179174">"Keine Übereinstimmungen gefunden"</string>
     <string name="voice_not_installed" msgid="5552450909753842415">"Sprach-Suche nicht installiert"</string>
     <string name="voice_swipe_hint" msgid="6943546180310682021"><b>"Hinweis:"</b>" Ziehen Sie zum Sprechen den Finger über die Tastatur."</string>
     <string name="voice_punctuation_hint" msgid="1611389463237317754"><b>"Hinweis:"</b>" Versuchen Sie beim nächsten Mal, Satzzeichen wie \"Punkt\", \"Komma\" oder \"Fragezeichen\" per Sprachbefehl einzugeben."</string>
@@ -125,16 +131,24 @@
     <string name="popular_domain_2" msgid="3036812463748402878">".org"</string>
     <string name="popular_domain_3" msgid="8718639560809452028">".gov"</string>
     <string name="popular_domain_4" msgid="35359437471311470">".edu"</string>
-    <string name="selectInputMethod" msgid="315076553378705821">"Eingabemethode auswählen"</string>
+    <!-- no translation found for selectInputMethod (315076553378705821) -->
+    <skip />
     <string name="language_selection_title" msgid="1651299598555326750">"Eingabesprachen"</string>
     <string name="language_selection_summary" msgid="187110938289512256">"Finger über die Leertaste bewegen, um die Eingabesprache zu wechseln"</string>
-    <string name="hint_add_to_dictionary" msgid="9006292060636342317">"← Zum Speichern erneut berühren"</string>
+    <string name="hint_add_to_dictionary" msgid="8058519710062071085">"← Zum Speichern erneut tippen"</string>
     <string name="has_dictionary" msgid="6071847973466625007">"Wörterbuch verfügbar"</string>
-    <string name="prefs_enable_log" msgid="6620424505072963557">"Nutzer-Feedback aktivieren"</string>
-    <string name="prefs_description_log" msgid="5827825607258246003">"Tragen Sie zur Verbesserung dieses Eingabemethodeneditors bei, indem Sie automatisch Nutzungsstatistiken und Absturzberichte an Google senden."</string>
-    <string name="prefs_enable_recorrection" msgid="4588408906649533582">"Wortkorrektur"</string>
-    <!-- outdated translation 5037231665897435902 -->     <string name="prefs_enable_recorrection_summary" msgid="1056068922330206170">"Sie können Wörter korrigieren, indem Sie die eingegebenen Wörter berühren."</string>
-    <string name="keyboard_layout" msgid="437433231038683666">"Tastaturdesign"</string>
-    <string name="subtype_mode_keyboard" msgid="2242090416595003881">"Tastatur"</string>
-    <string name="subtype_mode_voice" msgid="4394113125441627771">"Sprache"</string>
+    <!-- no translation found for prefs_enable_log (6620424505072963557) -->
+    <skip />
+    <!-- no translation found for prefs_description_log (5827825607258246003) -->
+    <skip />
+    <!-- no translation found for prefs_enable_recorrection (4966265843750259377) -->
+    <skip />
+    <!-- no translation found for prefs_enable_recorrection_summary (8181745740388568396) -->
+    <skip />
+    <!-- no translation found for keyboard_layout (437433231038683666) -->
+    <skip />
+    <!-- no translation found for subtype_mode_keyboard (2242090416595003881) -->
+    <skip />
+    <!-- no translation found for subtype_mode_voice (4394113125441627771) -->
+    <skip />
 </resources>
diff --git a/java/res/values-el/strings.xml b/java/res/values-el/strings.xml
index f249e9a..7d4d7dd 100644
--- a/java/res/values-el/strings.xml
+++ b/java/res/values-el/strings.xml
@@ -22,10 +22,12 @@
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="english_ime_name" msgid="7252517407088836577">"Πληκτρολόγιο Android"</string>
     <string name="english_ime_settings" msgid="6661589557206947774">"Ρυθμίσεις πληκτρολογίου Android"</string>
-    <string name="english_ime_input_options" msgid="3909945612939668554">"Επιλογές εισόδου"</string>
+    <!-- no translation found for english_ime_input_options (3909945612939668554) -->
+    <skip />
     <string name="vibrate_on_keypress" msgid="5258079494276955460">"Δόνηση κατά το πάτημα πλήκτρων"</string>
     <string name="sound_on_keypress" msgid="6093592297198243644">"Ήχος κατά το πάτημα πλήκτρων"</string>
-    <string name="popup_on_keypress" msgid="123894815723512944">"Εμφάνιση με το πάτημα πλήκτρου"</string>
+    <!-- no translation found for popup_on_keypress (123894815723512944) -->
+    <skip />
     <string name="hit_correction" msgid="4855351009261318389">"Διόρθωση σφαλμάτων πληκτρολόγησης"</string>
     <string name="hit_correction_summary" msgid="8761701873008070796">"Ενεργοποίηση διόρθωσης σφαλμάτων εισόδου"</string>
     <string name="hit_correction_land" msgid="2567691684825205448">"Σφάλματα οριζόντιας εισαγωγής"</string>
@@ -48,10 +50,14 @@
     <string name="show_suggestions_summary" msgid="1989672863935759654">"Προβολή προτεινόμενων λέξεων κατά την πληκτρολόγηση"</string>
     <string name="auto_complete" msgid="1103196318775486023">"Αυτόματη συμπλήρωση"</string>
     <string name="auto_complete_summary" msgid="6113149638718274624">"Τα πλήκ.διαστήμ.και τονισμού εισάγ.αυτόμ.την επιλ.λέξη"</string>
-    <string name="prefs_settings_key" msgid="4623341240804046498">"Εμφάνιση πλήκτρου ρυθμίσεων"</string>
-    <string name="settings_key_mode_auto_name" msgid="2993460277873684680">"Αυτόματο"</string>
-    <string name="settings_key_mode_always_show_name" msgid="3047567041784760575">"Να εμφανίζεται πάντα"</string>
-    <string name="settings_key_mode_always_hide_name" msgid="7833948046716923994">"Πάντα απόκρυψη"</string>
+    <!-- no translation found for prefs_settings_key (4623341240804046498) -->
+    <skip />
+    <!-- no translation found for settings_key_mode_auto_name (2993460277873684680) -->
+    <skip />
+    <!-- no translation found for settings_key_mode_always_show_name (3047567041784760575) -->
+    <skip />
+    <!-- no translation found for settings_key_mode_always_hide_name (7833948046716923994) -->
+    <skip />
     <!-- no translation found for settings_key_modes:0 (8549888726962891527) -->
     <!-- no translation found for settings_key_modes:1 (881280041213210923) -->
     <!-- no translation found for settings_key_modes:2 (7317310620171067848) -->
@@ -125,16 +131,24 @@
     <string name="popular_domain_2" msgid="3036812463748402878">".org"</string>
     <string name="popular_domain_3" msgid="8718639560809452028">".gov"</string>
     <string name="popular_domain_4" msgid="35359437471311470">".edu"</string>
-    <string name="selectInputMethod" msgid="315076553378705821">"Επιλογή μεθόδου εισόδου"</string>
+    <!-- no translation found for selectInputMethod (315076553378705821) -->
+    <skip />
     <string name="language_selection_title" msgid="1651299598555326750">"Γλώσσες εισόδου"</string>
     <string name="language_selection_summary" msgid="187110938289512256">"Σύρετε το δάχτυλο στο πλήκτρο διαστήματος για να αλλάξετε γλώσσα"</string>
-    <string name="hint_add_to_dictionary" msgid="9006292060636342317">"← Αγγίξτε ξανά για αποθήκευση"</string>
+    <string name="hint_add_to_dictionary" msgid="8058519710062071085">"← Πατήστε ξανά για αποθήκευση"</string>
     <string name="has_dictionary" msgid="6071847973466625007">"Λεξικό διαθέσιμο"</string>
-    <string name="prefs_enable_log" msgid="6620424505072963557">"Ενεργοποίηση σχολίων χρηστών"</string>
-    <string name="prefs_description_log" msgid="5827825607258246003">"Βοηθήστε μας να βελτιώσουμε αυτό το πρόγραμμα επεξεργασίας μεθόδου εισόδου στέλνοντας αυτόματα στατιστικά στοιχεία και αναφορές σφαλμάτων στην Google."</string>
-    <!-- outdated translation 5809974560359283818 -->     <string name="prefs_enable_recorrection" msgid="4588408906649533582">"Αγγίξτε για να διορθώσετε ξανά τις λέξεις"</string>
-    <!-- outdated translation 5037231665897435902 -->     <string name="prefs_enable_recorrection_summary" msgid="1056068922330206170">"Μπορείτε να διορθώσετε ξανά τις λέξεις αγγίζοντας τις λέξεις που έχετε πληκτρολογήσει"</string>
-    <string name="keyboard_layout" msgid="437433231038683666">"Θέμα πληκτρολογίου"</string>
-    <string name="subtype_mode_keyboard" msgid="2242090416595003881">"πληκτρολόγιο"</string>
-    <string name="subtype_mode_voice" msgid="4394113125441627771">"φωνητική"</string>
+    <!-- no translation found for prefs_enable_log (6620424505072963557) -->
+    <skip />
+    <!-- no translation found for prefs_description_log (5827825607258246003) -->
+    <skip />
+    <!-- no translation found for prefs_enable_recorrection (4966265843750259377) -->
+    <skip />
+    <!-- no translation found for prefs_enable_recorrection_summary (8181745740388568396) -->
+    <skip />
+    <!-- no translation found for keyboard_layout (437433231038683666) -->
+    <skip />
+    <!-- no translation found for subtype_mode_keyboard (2242090416595003881) -->
+    <skip />
+    <!-- no translation found for subtype_mode_voice (4394113125441627771) -->
+    <skip />
 </resources>
diff --git a/java/res/values-es-rUS/strings.xml b/java/res/values-es-rUS/strings.xml
index 3abc8de..e5c937f 100644
--- a/java/res/values-es-rUS/strings.xml
+++ b/java/res/values-es-rUS/strings.xml
@@ -22,10 +22,12 @@
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="english_ime_name" msgid="7252517407088836577">"Teclado de Android"</string>
     <string name="english_ime_settings" msgid="6661589557206947774">"Configuración de teclado de Android"</string>
-    <string name="english_ime_input_options" msgid="3909945612939668554">"Opciones de entrada"</string>
+    <!-- no translation found for english_ime_input_options (3909945612939668554) -->
+    <skip />
     <string name="vibrate_on_keypress" msgid="5258079494276955460">"Vibrar al pulsar teclas"</string>
     <string name="sound_on_keypress" msgid="6093592297198243644">"Sonar al pulsar las teclas"</string>
-    <string name="popup_on_keypress" msgid="123894815723512944">"Aviso emergente sobre keypress"</string>
+    <!-- no translation found for popup_on_keypress (123894815723512944) -->
+    <skip />
     <string name="hit_correction" msgid="4855351009261318389">"Corregir errores de escritura"</string>
     <string name="hit_correction_summary" msgid="8761701873008070796">"Habilitar corrección de error de entrada"</string>
     <string name="hit_correction_land" msgid="2567691684825205448">"Errores de entrada apaisada"</string>
@@ -48,10 +50,14 @@
     <string name="show_suggestions_summary" msgid="1989672863935759654">"Mostrar palabras sugeridas mientras escribe"</string>
     <string name="auto_complete" msgid="1103196318775486023">"Completar automát."</string>
     <string name="auto_complete_summary" msgid="6113149638718274624">"La barra espaciadora o la puntuación insertan automáticamente la palabra resaltada."</string>
-    <string name="prefs_settings_key" msgid="4623341240804046498">"Mostrar tecla de configuración"</string>
-    <string name="settings_key_mode_auto_name" msgid="2993460277873684680">"Automático"</string>
-    <string name="settings_key_mode_always_show_name" msgid="3047567041784760575">"Mostrar siempre"</string>
-    <string name="settings_key_mode_always_hide_name" msgid="7833948046716923994">"Ocultar siempre"</string>
+    <!-- no translation found for prefs_settings_key (4623341240804046498) -->
+    <skip />
+    <!-- no translation found for settings_key_mode_auto_name (2993460277873684680) -->
+    <skip />
+    <!-- no translation found for settings_key_mode_always_show_name (3047567041784760575) -->
+    <skip />
+    <!-- no translation found for settings_key_mode_always_hide_name (7833948046716923994) -->
+    <skip />
     <!-- no translation found for settings_key_modes:0 (8549888726962891527) -->
     <!-- no translation found for settings_key_modes:1 (881280041213210923) -->
     <!-- no translation found for settings_key_modes:2 (7317310620171067848) -->
@@ -125,16 +131,24 @@
     <string name="popular_domain_2" msgid="3036812463748402878">".org"</string>
     <string name="popular_domain_3" msgid="8718639560809452028">".gov"</string>
     <string name="popular_domain_4" msgid="35359437471311470">".edu"</string>
-    <string name="selectInputMethod" msgid="315076553378705821">"Seleccionar método de entrada"</string>
+    <!-- no translation found for selectInputMethod (315076553378705821) -->
+    <skip />
     <string name="language_selection_title" msgid="1651299598555326750">"Idiomas de entrada"</string>
     <string name="language_selection_summary" msgid="187110938289512256">"Deslizarse manualmente por la barra espaciadora para cambiar el idioma"</string>
-    <string name="hint_add_to_dictionary" msgid="9006292060636342317">"← Tocar de nuevo para guardar"</string>
+    <string name="hint_add_to_dictionary" msgid="8058519710062071085">"← Presionar nuevamente para guardar"</string>
     <string name="has_dictionary" msgid="6071847973466625007">"Diccionario disponible"</string>
-    <string name="prefs_enable_log" msgid="6620424505072963557">"Habilitar los comentarios del usuario"</string>
-    <string name="prefs_description_log" msgid="5827825607258246003">"Ayuda a mejorar este editor de método de introducción de texto al enviar las estadísticas de uso y los informes de error a Google."</string>
-    <string name="prefs_enable_recorrection" msgid="4588408906649533582">"Tocar para corregir palabras"</string>
-    <string name="prefs_enable_recorrection_summary" msgid="1056068922330206170">"Toca las palabras ingresadas que desees corregir"</string>
-    <string name="keyboard_layout" msgid="437433231038683666">"Tema del teclado"</string>
-    <string name="subtype_mode_keyboard" msgid="2242090416595003881">"Teclado"</string>
-    <string name="subtype_mode_voice" msgid="4394113125441627771">"Voz"</string>
+    <!-- no translation found for prefs_enable_log (6620424505072963557) -->
+    <skip />
+    <!-- no translation found for prefs_description_log (5827825607258246003) -->
+    <skip />
+    <!-- no translation found for prefs_enable_recorrection (4966265843750259377) -->
+    <skip />
+    <!-- no translation found for prefs_enable_recorrection_summary (8181745740388568396) -->
+    <skip />
+    <!-- no translation found for keyboard_layout (437433231038683666) -->
+    <skip />
+    <!-- no translation found for subtype_mode_keyboard (2242090416595003881) -->
+    <skip />
+    <!-- no translation found for subtype_mode_voice (4394113125441627771) -->
+    <skip />
 </resources>
diff --git a/java/res/values-es/strings.xml b/java/res/values-es/strings.xml
index cd6dc8e..d5be135 100644
--- a/java/res/values-es/strings.xml
+++ b/java/res/values-es/strings.xml
@@ -22,10 +22,12 @@
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="english_ime_name" msgid="7252517407088836577">"Teclado de Android"</string>
     <string name="english_ime_settings" msgid="6661589557206947774">"Ajustes del teclado de Android"</string>
-    <string name="english_ime_input_options" msgid="3909945612939668554">"Opciones introducción texto"</string>
+    <!-- no translation found for english_ime_input_options (3909945612939668554) -->
+    <skip />
     <string name="vibrate_on_keypress" msgid="5258079494276955460">"Vibrar al pulsar tecla"</string>
     <string name="sound_on_keypress" msgid="6093592297198243644">"Sonido al pulsar tecla"</string>
-    <string name="popup_on_keypress" msgid="123894815723512944">"Popup al pulsar"</string>
+    <!-- no translation found for popup_on_keypress (123894815723512944) -->
+    <skip />
     <string name="hit_correction" msgid="4855351009261318389">"Corregir errores de escritura"</string>
     <string name="hit_correction_summary" msgid="8761701873008070796">"Habilitar la introducción de corrección de errores"</string>
     <string name="hit_correction_land" msgid="2567691684825205448">"Errores de introducción de datos en vista horizontal"</string>
@@ -48,10 +50,14 @@
     <string name="show_suggestions_summary" msgid="1989672863935759654">"Muestra las palabras sugeridas mientras se escribe."</string>
     <string name="auto_complete" msgid="1103196318775486023">"Autocompletar"</string>
     <string name="auto_complete_summary" msgid="6113149638718274624">"La barra espaciadora y los signos de puntuación insertan automáticamente la palabra resaltada."</string>
-    <string name="prefs_settings_key" msgid="4623341240804046498">"Mostrar tecla de ajustes"</string>
-    <string name="settings_key_mode_auto_name" msgid="2993460277873684680">"Automáticamente"</string>
-    <string name="settings_key_mode_always_show_name" msgid="3047567041784760575">"Mostrar siempre"</string>
-    <string name="settings_key_mode_always_hide_name" msgid="7833948046716923994">"Ocultar siempre"</string>
+    <!-- no translation found for prefs_settings_key (4623341240804046498) -->
+    <skip />
+    <!-- no translation found for settings_key_mode_auto_name (2993460277873684680) -->
+    <skip />
+    <!-- no translation found for settings_key_mode_always_show_name (3047567041784760575) -->
+    <skip />
+    <!-- no translation found for settings_key_mode_always_hide_name (7833948046716923994) -->
+    <skip />
     <!-- no translation found for settings_key_modes:0 (8549888726962891527) -->
     <!-- no translation found for settings_key_modes:1 (881280041213210923) -->
     <!-- no translation found for settings_key_modes:2 (7317310620171067848) -->
@@ -88,7 +94,7 @@
     <string name="voice_warning_may_not_understand" msgid="4611518823070986445">"La introducción de voz es una función en fase experimental que utiliza la tecnología de reconocimiento de voz en red de Google."</string>
     <string name="voice_warning_how_to_turn_off" msgid="5652369578498701761">"Para desactivar la función de introducción de voz, accede a la configuración del teclado."</string>
     <string name="voice_hint_dialog_message" msgid="6892342981545727994">"Para utilizar la función de introducción de voz, pulsa el botón de micrófono o desliza el dedo por el teclado en pantalla."</string>
-    <string name="voice_listening" msgid="467518160751321844">"Habla ahora"</string>
+    <string name="voice_listening" msgid="467518160751321844">"Hablar ahora"</string>
     <string name="voice_working" msgid="6666937792815731889">"En curso"</string>
     <string name="voice_initializing" msgid="661962047129906646"></string>
     <string name="voice_error" msgid="5140896300312186162">"Se ha producido un error. Inténtalo de nuevo."</string>
@@ -125,16 +131,24 @@
     <string name="popular_domain_2" msgid="3036812463748402878">".org"</string>
     <string name="popular_domain_3" msgid="8718639560809452028">".gov"</string>
     <string name="popular_domain_4" msgid="35359437471311470">".edu"</string>
-    <string name="selectInputMethod" msgid="315076553378705821">"Seleccionar método de introducción de texto"</string>
+    <!-- no translation found for selectInputMethod (315076553378705821) -->
+    <skip />
     <string name="language_selection_title" msgid="1651299598555326750">"Idiomas"</string>
     <string name="language_selection_summary" msgid="187110938289512256">"Deslizar el dedo por la barra espaciadora para cambiar el idioma"</string>
-    <string name="hint_add_to_dictionary" msgid="9006292060636342317">"← Volver a tocar para guardar"</string>
+    <string name="hint_add_to_dictionary" msgid="8058519710062071085">"← Volver a tocar para guardar"</string>
     <string name="has_dictionary" msgid="6071847973466625007">"Hay un diccionario disponible."</string>
-    <string name="prefs_enable_log" msgid="6620424505072963557">"Habilitar comentarios de usuarios"</string>
-    <string name="prefs_description_log" msgid="5827825607258246003">"Ayuda a mejorar este editor de método de introducción de texto enviando estadísticas de uso e informes de error a Google."</string>
-    <string name="prefs_enable_recorrection" msgid="4588408906649533582">"Tocar para corregir palabras"</string>
-    <string name="prefs_enable_recorrection_summary" msgid="1056068922330206170">"Tocar palabras introducidas para corregirlas"</string>
-    <string name="keyboard_layout" msgid="437433231038683666">"Tema de teclado"</string>
-    <string name="subtype_mode_keyboard" msgid="2242090416595003881">"teclado"</string>
-    <string name="subtype_mode_voice" msgid="4394113125441627771">"voz"</string>
+    <!-- no translation found for prefs_enable_log (6620424505072963557) -->
+    <skip />
+    <!-- no translation found for prefs_description_log (5827825607258246003) -->
+    <skip />
+    <!-- no translation found for prefs_enable_recorrection (4966265843750259377) -->
+    <skip />
+    <!-- no translation found for prefs_enable_recorrection_summary (8181745740388568396) -->
+    <skip />
+    <!-- no translation found for keyboard_layout (437433231038683666) -->
+    <skip />
+    <!-- no translation found for subtype_mode_keyboard (2242090416595003881) -->
+    <skip />
+    <!-- no translation found for subtype_mode_voice (4394113125441627771) -->
+    <skip />
 </resources>
diff --git a/java/res/values-fr/strings.xml b/java/res/values-fr/strings.xml
index f8f4bac..ef5a708 100644
--- a/java/res/values-fr/strings.xml
+++ b/java/res/values-fr/strings.xml
@@ -22,10 +22,12 @@
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="english_ime_name" msgid="7252517407088836577">"Clavier Android"</string>
     <string name="english_ime_settings" msgid="6661589557206947774">"Paramètres du clavier Android"</string>
-    <string name="english_ime_input_options" msgid="3909945612939668554">"Options de saisie"</string>
+    <!-- no translation found for english_ime_input_options (3909945612939668554) -->
+    <skip />
     <string name="vibrate_on_keypress" msgid="5258079494276955460">"Vibrer à chaque touche"</string>
     <string name="sound_on_keypress" msgid="6093592297198243644">"Son à chaque touche"</string>
-    <string name="popup_on_keypress" msgid="123894815723512944">"Agrandir les caractères à chaque touche"</string>
+    <!-- no translation found for popup_on_keypress (123894815723512944) -->
+    <skip />
     <string name="hit_correction" msgid="4855351009261318389">"Corriger les fautes de frappe"</string>
     <string name="hit_correction_summary" msgid="8761701873008070796">"Activer la correction des erreurs de saisie"</string>
     <string name="hit_correction_land" msgid="2567691684825205448">"Erreurs de saisie en mode paysage"</string>
@@ -48,10 +50,14 @@
     <string name="show_suggestions_summary" msgid="1989672863935759654">"Afficher les suggestions de terme lors de la saisie"</string>
     <string name="auto_complete" msgid="1103196318775486023">"Saisie semi-automatique"</string>
     <string name="auto_complete_summary" msgid="6113149638718274624">"Insérer auto. le terme surligné avec barre espace/ponctuation"</string>
-    <string name="prefs_settings_key" msgid="4623341240804046498">"Afficher la touche des paramètres"</string>
-    <string name="settings_key_mode_auto_name" msgid="2993460277873684680">"Automatique"</string>
-    <string name="settings_key_mode_always_show_name" msgid="3047567041784760575">"Toujours afficher"</string>
-    <string name="settings_key_mode_always_hide_name" msgid="7833948046716923994">"Toujours masquer"</string>
+    <!-- no translation found for prefs_settings_key (4623341240804046498) -->
+    <skip />
+    <!-- no translation found for settings_key_mode_auto_name (2993460277873684680) -->
+    <skip />
+    <!-- no translation found for settings_key_mode_always_show_name (3047567041784760575) -->
+    <skip />
+    <!-- no translation found for settings_key_mode_always_hide_name (7833948046716923994) -->
+    <skip />
     <!-- no translation found for settings_key_modes:0 (8549888726962891527) -->
     <!-- no translation found for settings_key_modes:1 (881280041213210923) -->
     <!-- no translation found for settings_key_modes:2 (7317310620171067848) -->
@@ -125,16 +131,24 @@
     <string name="popular_domain_2" msgid="3036812463748402878">".org"</string>
     <string name="popular_domain_3" msgid="8718639560809452028">".gouv"</string>
     <string name="popular_domain_4" msgid="35359437471311470">".edu"</string>
-    <string name="selectInputMethod" msgid="315076553378705821">"Sélectionner un mode de saisie."</string>
+    <!-- no translation found for selectInputMethod (315076553378705821) -->
+    <skip />
     <string name="language_selection_title" msgid="1651299598555326750">"Langues de saisie"</string>
     <string name="language_selection_summary" msgid="187110938289512256">"Faites glisser votre doigt sur la barre d\'espacement pour changer la langue."</string>
-    <string name="hint_add_to_dictionary" msgid="9006292060636342317">"← Appuyer de nouveau pour enregistrer"</string>
+    <string name="hint_add_to_dictionary" msgid="8058519710062071085">"← Appuyer de nouveau pour enregistrer"</string>
     <string name="has_dictionary" msgid="6071847973466625007">"Dictionnaire disponible"</string>
-    <string name="prefs_enable_log" msgid="6620424505072963557">"Autoriser les commentaires des utilisateurs"</string>
-    <string name="prefs_description_log" msgid="5827825607258246003">"Contribuer à l\'amélioration de cet éditeur du mode de saisie grâce à l\'envoi automatique de statistiques d\'utilisation et de rapports d\'incident à Google."</string>
-    <string name="prefs_enable_recorrection" msgid="4588408906649533582">"Appuyer pour corriger les suggestions"</string>
-    <string name="prefs_enable_recorrection_summary" msgid="1056068922330206170">"Appuyer sur les mots saisis pour les corriger"</string>
-    <string name="keyboard_layout" msgid="437433231038683666">"Thème du clavier"</string>
-    <string name="subtype_mode_keyboard" msgid="2242090416595003881">"clavier"</string>
-    <string name="subtype_mode_voice" msgid="4394113125441627771">"voix"</string>
+    <!-- no translation found for prefs_enable_log (6620424505072963557) -->
+    <skip />
+    <!-- no translation found for prefs_description_log (5827825607258246003) -->
+    <skip />
+    <!-- no translation found for prefs_enable_recorrection (4966265843750259377) -->
+    <skip />
+    <!-- no translation found for prefs_enable_recorrection_summary (8181745740388568396) -->
+    <skip />
+    <!-- no translation found for keyboard_layout (437433231038683666) -->
+    <skip />
+    <!-- no translation found for subtype_mode_keyboard (2242090416595003881) -->
+    <skip />
+    <!-- no translation found for subtype_mode_voice (4394113125441627771) -->
+    <skip />
 </resources>
diff --git a/java/res/values-it/strings.xml b/java/res/values-it/strings.xml
index 94cdb96..1f213fc 100644
--- a/java/res/values-it/strings.xml
+++ b/java/res/values-it/strings.xml
@@ -22,10 +22,12 @@
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="english_ime_name" msgid="7252517407088836577">"Tastiera Android"</string>
     <string name="english_ime_settings" msgid="6661589557206947774">"Impostazioni tastiera Android"</string>
-    <string name="english_ime_input_options" msgid="3909945612939668554">"Opzioni inserimento"</string>
+    <!-- no translation found for english_ime_input_options (3909945612939668554) -->
+    <skip />
     <string name="vibrate_on_keypress" msgid="5258079494276955460">"Vibrazione tasti"</string>
     <string name="sound_on_keypress" msgid="6093592297198243644">"Suono tasti"</string>
-    <string name="popup_on_keypress" msgid="123894815723512944">"Popup alla pressione di un tasto"</string>
+    <!-- no translation found for popup_on_keypress (123894815723512944) -->
+    <skip />
     <string name="hit_correction" msgid="4855351009261318389">"Correggi errori di digitazione"</string>
     <string name="hit_correction_summary" msgid="8761701873008070796">"Attiva la correzione degli errori di inserimento"</string>
     <string name="hit_correction_land" msgid="2567691684825205448">"Errori di inserimento in visualizzazione orizzontale"</string>
@@ -48,10 +50,14 @@
     <string name="show_suggestions_summary" msgid="1989672863935759654">"Visualizza le parole suggerite durante la digitazione"</string>
     <string name="auto_complete" msgid="1103196318775486023">"Completamento autom."</string>
     <string name="auto_complete_summary" msgid="6113149638718274624">"Barra spaziatrice e punteggiatura inseriscono la parola evidenziata"</string>
-    <string name="prefs_settings_key" msgid="4623341240804046498">"Mostra tasto impostazioni"</string>
-    <string name="settings_key_mode_auto_name" msgid="2993460277873684680">"Automatico"</string>
-    <string name="settings_key_mode_always_show_name" msgid="3047567041784760575">"Mostra sempre"</string>
-    <string name="settings_key_mode_always_hide_name" msgid="7833948046716923994">"Nascondi sempre"</string>
+    <!-- no translation found for prefs_settings_key (4623341240804046498) -->
+    <skip />
+    <!-- no translation found for settings_key_mode_auto_name (2993460277873684680) -->
+    <skip />
+    <!-- no translation found for settings_key_mode_always_show_name (3047567041784760575) -->
+    <skip />
+    <!-- no translation found for settings_key_mode_always_hide_name (7833948046716923994) -->
+    <skip />
     <!-- no translation found for settings_key_modes:0 (8549888726962891527) -->
     <!-- no translation found for settings_key_modes:1 (881280041213210923) -->
     <!-- no translation found for settings_key_modes:2 (7317310620171067848) -->
@@ -125,16 +131,24 @@
     <string name="popular_domain_2" msgid="3036812463748402878">".org"</string>
     <string name="popular_domain_3" msgid="8718639560809452028">".gov"</string>
     <string name="popular_domain_4" msgid="35359437471311470">".edu"</string>
-    <string name="selectInputMethod" msgid="315076553378705821">"Seleziona metodo di inserimento"</string>
+    <!-- no translation found for selectInputMethod (315076553378705821) -->
+    <skip />
     <string name="language_selection_title" msgid="1651299598555326750">"Lingue comandi"</string>
     <string name="language_selection_summary" msgid="187110938289512256">"Scorri il dito sulla barra spaziatrice per cambiare la lingua"</string>
-    <string name="hint_add_to_dictionary" msgid="9006292060636342317">"← Tocca di nuovo per salvare"</string>
+    <string name="hint_add_to_dictionary" msgid="8058519710062071085">"← Tocca di nuovo per salvare"</string>
     <string name="has_dictionary" msgid="6071847973466625007">"Dizionario disponibile"</string>
-    <string name="prefs_enable_log" msgid="6620424505072963557">"Attiva commenti degli utenti"</string>
-    <string name="prefs_description_log" msgid="5827825607258246003">"Aiuta a migliorare l\'editor del metodo di inserimento inviando automaticamente a Google statistiche sull\'utilizzo e segnalazioni sugli arresti anomali."</string>
-    <!-- outdated translation 5809974560359283818 -->     <string name="prefs_enable_recorrection" msgid="4588408906649533582">"Tocca per correggere di nuovo le parole"</string>
-    <!-- outdated translation 5037231665897435902 -->     <string name="prefs_enable_recorrection_summary" msgid="1056068922330206170">"Puoi correggere di nuovo le parole toccando quelle che hai digitato"</string>
-    <string name="keyboard_layout" msgid="437433231038683666">"Tema della tastiera"</string>
-    <string name="subtype_mode_keyboard" msgid="2242090416595003881">"tastiera"</string>
-    <string name="subtype_mode_voice" msgid="4394113125441627771">"vocale"</string>
+    <!-- no translation found for prefs_enable_log (6620424505072963557) -->
+    <skip />
+    <!-- no translation found for prefs_description_log (5827825607258246003) -->
+    <skip />
+    <!-- no translation found for prefs_enable_recorrection (4966265843750259377) -->
+    <skip />
+    <!-- no translation found for prefs_enable_recorrection_summary (8181745740388568396) -->
+    <skip />
+    <!-- no translation found for keyboard_layout (437433231038683666) -->
+    <skip />
+    <!-- no translation found for subtype_mode_keyboard (2242090416595003881) -->
+    <skip />
+    <!-- no translation found for subtype_mode_voice (4394113125441627771) -->
+    <skip />
 </resources>
diff --git a/java/res/values-ja/strings.xml b/java/res/values-ja/strings.xml
index 2589c89..5a9e053 100644
--- a/java/res/values-ja/strings.xml
+++ b/java/res/values-ja/strings.xml
@@ -22,10 +22,12 @@
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="english_ime_name" msgid="7252517407088836577">"Androidキーボード"</string>
     <string name="english_ime_settings" msgid="6661589557206947774">"Androidキーボードの設定"</string>
-    <string name="english_ime_input_options" msgid="3909945612939668554">"入力オプション"</string>
+    <!-- no translation found for english_ime_input_options (3909945612939668554) -->
+    <skip />
     <string name="vibrate_on_keypress" msgid="5258079494276955460">"キー操作バイブ"</string>
     <string name="sound_on_keypress" msgid="6093592297198243644">"キー操作音"</string>
-    <string name="popup_on_keypress" msgid="123894815723512944">"キー押下時に文字をポップアップ表示"</string>
+    <!-- no translation found for popup_on_keypress (123894815723512944) -->
+    <skip />
     <string name="hit_correction" msgid="4855351009261318389">"入力ミス補正"</string>
     <string name="hit_correction_summary" msgid="8761701873008070796">"入力間違いを自動修正する"</string>
     <string name="hit_correction_land" msgid="2567691684825205448">"横表示での入力修正"</string>
@@ -48,10 +50,14 @@
     <string name="show_suggestions_summary" msgid="1989672863935759654">"入力時に入力候補を表示する"</string>
     <string name="auto_complete" msgid="1103196318775486023">"オートコンプリート"</string>
     <string name="auto_complete_summary" msgid="6113149638718274624">"反転表示されている変換候補をスペースまたは句読点キーで挿入する"</string>
-    <string name="prefs_settings_key" msgid="4623341240804046498">"設定キーを表示"</string>
-    <string name="settings_key_mode_auto_name" msgid="2993460277873684680">"自動"</string>
-    <string name="settings_key_mode_always_show_name" msgid="3047567041784760575">"常に表示"</string>
-    <string name="settings_key_mode_always_hide_name" msgid="7833948046716923994">"常に非表示"</string>
+    <!-- no translation found for prefs_settings_key (4623341240804046498) -->
+    <skip />
+    <!-- no translation found for settings_key_mode_auto_name (2993460277873684680) -->
+    <skip />
+    <!-- no translation found for settings_key_mode_always_show_name (3047567041784760575) -->
+    <skip />
+    <!-- no translation found for settings_key_mode_always_hide_name (7833948046716923994) -->
+    <skip />
     <!-- no translation found for settings_key_modes:0 (8549888726962891527) -->
     <!-- no translation found for settings_key_modes:1 (881280041213210923) -->
     <!-- no translation found for settings_key_modes:2 (7317310620171067848) -->
@@ -125,16 +131,24 @@
     <string name="popular_domain_2" msgid="3036812463748402878">".org"</string>
     <string name="popular_domain_3" msgid="8718639560809452028">".gov"</string>
     <string name="popular_domain_4" msgid="35359437471311470">".edu"</string>
-    <string name="selectInputMethod" msgid="315076553378705821">"入力方法の選択"</string>
+    <!-- no translation found for selectInputMethod (315076553378705821) -->
+    <skip />
     <string name="language_selection_title" msgid="1651299598555326750">"入力言語"</string>
     <string name="language_selection_summary" msgid="187110938289512256">"スペースバーで指をスライドさせて言語を変更する"</string>
-    <string name="hint_add_to_dictionary" msgid="9006292060636342317">"←保存するにはもう一度タップ"</string>
+    <string name="hint_add_to_dictionary" msgid="8058519710062071085">"←保存するにはもう一度タップ"</string>
     <string name="has_dictionary" msgid="6071847973466625007">"辞書を利用できます"</string>
-    <string name="prefs_enable_log" msgid="6620424505072963557">"ユーザーフィードバックを有効にする"</string>
-    <string name="prefs_description_log" msgid="5827825607258246003">"IMEの機能向上のため、使用統計状況やクラッシュレポートをGoogleに自動送信します。"</string>
-    <!-- outdated translation 5809974560359283818 -->     <string name="prefs_enable_recorrection" msgid="4588408906649533582">"タップして語句を再修正"</string>
-    <!-- outdated translation 5037231665897435902 -->     <string name="prefs_enable_recorrection_summary" msgid="1056068922330206170">"入力した語句をタップすると語句を再修正できます"</string>
-    <string name="keyboard_layout" msgid="437433231038683666">"キーボードテーマ"</string>
-    <string name="subtype_mode_keyboard" msgid="2242090416595003881">"キーボード"</string>
-    <string name="subtype_mode_voice" msgid="4394113125441627771">"音声"</string>
+    <!-- no translation found for prefs_enable_log (6620424505072963557) -->
+    <skip />
+    <!-- no translation found for prefs_description_log (5827825607258246003) -->
+    <skip />
+    <!-- no translation found for prefs_enable_recorrection (4966265843750259377) -->
+    <skip />
+    <!-- no translation found for prefs_enable_recorrection_summary (8181745740388568396) -->
+    <skip />
+    <!-- no translation found for keyboard_layout (437433231038683666) -->
+    <skip />
+    <!-- no translation found for subtype_mode_keyboard (2242090416595003881) -->
+    <skip />
+    <!-- no translation found for subtype_mode_voice (4394113125441627771) -->
+    <skip />
 </resources>
diff --git a/java/res/values-ko/strings.xml b/java/res/values-ko/strings.xml
index ab3aa91..c6b66d0 100644
--- a/java/res/values-ko/strings.xml
+++ b/java/res/values-ko/strings.xml
@@ -22,10 +22,12 @@
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="english_ime_name" msgid="7252517407088836577">"Android 키보드"</string>
     <string name="english_ime_settings" msgid="6661589557206947774">"Android 키보드 설정"</string>
-    <string name="english_ime_input_options" msgid="3909945612939668554">"입력 옵션"</string>
+    <!-- no translation found for english_ime_input_options (3909945612939668554) -->
+    <skip />
     <string name="vibrate_on_keypress" msgid="5258079494276955460">"키를 누를 때 진동 발생"</string>
     <string name="sound_on_keypress" msgid="6093592297198243644">"키를 누를 때 소리 발생"</string>
-    <string name="popup_on_keypress" msgid="123894815723512944">"키를 누를 때 팝업"</string>
+    <!-- no translation found for popup_on_keypress (123894815723512944) -->
+    <skip />
     <string name="hit_correction" msgid="4855351009261318389">"입력 오류 수정"</string>
     <string name="hit_correction_summary" msgid="8761701873008070796">"입력 오류 수정 사용"</string>
     <string name="hit_correction_land" msgid="2567691684825205448">"가로 입력 오류"</string>
@@ -48,10 +50,14 @@
     <string name="show_suggestions_summary" msgid="1989672863935759654">"글자를 입력하는 동안 추천 단어를 표시"</string>
     <string name="auto_complete" msgid="1103196318775486023">"자동 완성"</string>
     <string name="auto_complete_summary" msgid="6113149638718274624">"스페이스바와 문장부호 키로 강조 표시된 단어를 자동 삽입"</string>
-    <string name="prefs_settings_key" msgid="4623341240804046498">"설정 키 표시"</string>
-    <string name="settings_key_mode_auto_name" msgid="2993460277873684680">"자동"</string>
-    <string name="settings_key_mode_always_show_name" msgid="3047567041784760575">"항상 표시"</string>
-    <string name="settings_key_mode_always_hide_name" msgid="7833948046716923994">"항상 숨기기"</string>
+    <!-- no translation found for prefs_settings_key (4623341240804046498) -->
+    <skip />
+    <!-- no translation found for settings_key_mode_auto_name (2993460277873684680) -->
+    <skip />
+    <!-- no translation found for settings_key_mode_always_show_name (3047567041784760575) -->
+    <skip />
+    <!-- no translation found for settings_key_mode_always_hide_name (7833948046716923994) -->
+    <skip />
     <!-- no translation found for settings_key_modes:0 (8549888726962891527) -->
     <!-- no translation found for settings_key_modes:1 (881280041213210923) -->
     <!-- no translation found for settings_key_modes:2 (7317310620171067848) -->
@@ -125,16 +131,24 @@
     <string name="popular_domain_2" msgid="3036812463748402878">".org"</string>
     <string name="popular_domain_3" msgid="8718639560809452028">".gov"</string>
     <string name="popular_domain_4" msgid="35359437471311470">".edu"</string>
-    <string name="selectInputMethod" msgid="315076553378705821">"입력 방법 선택"</string>
+    <!-- no translation found for selectInputMethod (315076553378705821) -->
+    <skip />
     <string name="language_selection_title" msgid="1651299598555326750">"입력 언어"</string>
     <string name="language_selection_summary" msgid="187110938289512256">"손가락을 스페이스바에서 미끄러지듯 움직여 언어 변경"</string>
-    <string name="hint_add_to_dictionary" msgid="9006292060636342317">"← 저장하려면 다시 터치하세요."</string>
+    <string name="hint_add_to_dictionary" msgid="8058519710062071085">"← 저장하려면 다시 누르세요."</string>
     <string name="has_dictionary" msgid="6071847973466625007">"사전 사용 가능"</string>
-    <string name="prefs_enable_log" msgid="6620424505072963557">"사용자 의견 사용"</string>
-    <string name="prefs_description_log" msgid="5827825607258246003">"사용 통계 및 충돌 보고서를 Google에 자동으로 전송하여 입력 방법 편집기의 개선에 도움을 줍니다."</string>
-    <!-- outdated translation 5809974560359283818 -->     <string name="prefs_enable_recorrection" msgid="4588408906649533582">"터치하여 단어 다시 수정"</string>
-    <!-- outdated translation 5037231665897435902 -->     <string name="prefs_enable_recorrection_summary" msgid="1056068922330206170">"입력한 단어를 터치하면 다시 수정할 수 있습니다."</string>
-    <string name="keyboard_layout" msgid="437433231038683666">"키보드 테마"</string>
-    <string name="subtype_mode_keyboard" msgid="2242090416595003881">"키보드"</string>
-    <string name="subtype_mode_voice" msgid="4394113125441627771">"음성"</string>
+    <!-- no translation found for prefs_enable_log (6620424505072963557) -->
+    <skip />
+    <!-- no translation found for prefs_description_log (5827825607258246003) -->
+    <skip />
+    <!-- no translation found for prefs_enable_recorrection (4966265843750259377) -->
+    <skip />
+    <!-- no translation found for prefs_enable_recorrection_summary (8181745740388568396) -->
+    <skip />
+    <!-- no translation found for keyboard_layout (437433231038683666) -->
+    <skip />
+    <!-- no translation found for subtype_mode_keyboard (2242090416595003881) -->
+    <skip />
+    <!-- no translation found for subtype_mode_voice (4394113125441627771) -->
+    <skip />
 </resources>
diff --git a/java/res/values-nb/strings.xml b/java/res/values-nb/strings.xml
index c98b8f4..0f33dd2 100644
--- a/java/res/values-nb/strings.xml
+++ b/java/res/values-nb/strings.xml
@@ -22,10 +22,12 @@
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="english_ime_name" msgid="7252517407088836577">"Skjermtastatur"</string>
     <string name="english_ime_settings" msgid="6661589557206947774">"Innstillinger for skjermtastatur"</string>
-    <string name="english_ime_input_options" msgid="3909945612939668554">"Inndataalternativer"</string>
+    <!-- no translation found for english_ime_input_options (3909945612939668554) -->
+    <skip />
     <string name="vibrate_on_keypress" msgid="5258079494276955460">"Vibrer ved tastetrykk"</string>
     <string name="sound_on_keypress" msgid="6093592297198243644">"Lyd ved tastetrykk"</string>
-    <string name="popup_on_keypress" msgid="123894815723512944">"Hurtigvindu ved tastetrykk"</string>
+    <!-- no translation found for popup_on_keypress (123894815723512944) -->
+    <skip />
     <string name="hit_correction" msgid="4855351009261318389">"Rett opp skrivefeil"</string>
     <string name="hit_correction_summary" msgid="8761701873008070796">"Slå på retting av skrivefeil"</string>
     <string name="hit_correction_land" msgid="2567691684825205448">"Rett opp skrivefeil i breddeformat"</string>
@@ -48,10 +50,14 @@
     <string name="show_suggestions_summary" msgid="1989672863935759654">"Vis foreslåtte ord under skriving"</string>
     <string name="auto_complete" msgid="1103196318775486023">"Autofullføring"</string>
     <string name="auto_complete_summary" msgid="6113149638718274624">"Mellomrom og punktum setter automatisk inn valgt ord"</string>
-    <string name="prefs_settings_key" msgid="4623341240804046498">"Vis innstillingsnøkkel"</string>
-    <string name="settings_key_mode_auto_name" msgid="2993460277873684680">"Automatisk"</string>
-    <string name="settings_key_mode_always_show_name" msgid="3047567041784760575">"Vis alltid"</string>
-    <string name="settings_key_mode_always_hide_name" msgid="7833948046716923994">"Skjul alltid"</string>
+    <!-- no translation found for prefs_settings_key (4623341240804046498) -->
+    <skip />
+    <!-- no translation found for settings_key_mode_auto_name (2993460277873684680) -->
+    <skip />
+    <!-- no translation found for settings_key_mode_always_show_name (3047567041784760575) -->
+    <skip />
+    <!-- no translation found for settings_key_mode_always_hide_name (7833948046716923994) -->
+    <skip />
     <!-- no translation found for settings_key_modes:0 (8549888726962891527) -->
     <!-- no translation found for settings_key_modes:1 (881280041213210923) -->
     <!-- no translation found for settings_key_modes:2 (7317310620171067848) -->
@@ -125,16 +131,24 @@
     <string name="popular_domain_2" msgid="3036812463748402878">".net"</string>
     <string name="popular_domain_3" msgid="8718639560809452028">".org"</string>
     <string name="popular_domain_4" msgid="35359437471311470">".info"</string>
-    <string name="selectInputMethod" msgid="315076553378705821">"Velg inndatametode"</string>
+    <!-- no translation found for selectInputMethod (315076553378705821) -->
+    <skip />
     <string name="language_selection_title" msgid="1651299598555326750">"Inndataspråk"</string>
     <string name="language_selection_summary" msgid="187110938289512256">"Dra fingeren på mellomromstasten for å endre språk"</string>
-    <string name="hint_add_to_dictionary" msgid="9006292060636342317">"Trykk på nytt for å lagre"</string>
+    <string name="hint_add_to_dictionary" msgid="8058519710062071085">"← Trykk på nytt for å lagre"</string>
     <string name="has_dictionary" msgid="6071847973466625007">"Ordbok tilgjengelig"</string>
-    <string name="prefs_enable_log" msgid="6620424505072963557">"Aktiver brukertilbakemelding"</string>
-    <string name="prefs_description_log" msgid="5827825607258246003">"Ved å sende bruksstatistikk og programstopprapporter til Google automatisk, hjelper du oss med å gjøre redigeringsfunksjonen for denne inndatametoden enda bedre."</string>
-    <!-- outdated translation 5809974560359283818 -->     <string name="prefs_enable_recorrection" msgid="4588408906649533582">"Trykk for å endre ord"</string>
-    <!-- outdated translation 5037231665897435902 -->     <string name="prefs_enable_recorrection_summary" msgid="1056068922330206170">"Du kan endre innskrevne ord ved å trykke på dem"</string>
-    <string name="keyboard_layout" msgid="437433231038683666">"Tastaturtema"</string>
-    <string name="subtype_mode_keyboard" msgid="2242090416595003881">"tastatur"</string>
-    <string name="subtype_mode_voice" msgid="4394113125441627771">"stemme"</string>
+    <!-- no translation found for prefs_enable_log (6620424505072963557) -->
+    <skip />
+    <!-- no translation found for prefs_description_log (5827825607258246003) -->
+    <skip />
+    <!-- no translation found for prefs_enable_recorrection (4966265843750259377) -->
+    <skip />
+    <!-- no translation found for prefs_enable_recorrection_summary (8181745740388568396) -->
+    <skip />
+    <!-- no translation found for keyboard_layout (437433231038683666) -->
+    <skip />
+    <!-- no translation found for subtype_mode_keyboard (2242090416595003881) -->
+    <skip />
+    <!-- no translation found for subtype_mode_voice (4394113125441627771) -->
+    <skip />
 </resources>
diff --git a/java/res/values-nl/strings.xml b/java/res/values-nl/strings.xml
index c907344..59eccd8 100644
--- a/java/res/values-nl/strings.xml
+++ b/java/res/values-nl/strings.xml
@@ -22,10 +22,12 @@
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="english_ime_name" msgid="7252517407088836577">"Android-toetsenbord"</string>
     <string name="english_ime_settings" msgid="6661589557206947774">"Instellingen voor Android-toetsenbord"</string>
-    <string name="english_ime_input_options" msgid="3909945612939668554">"Invoeropties"</string>
+    <!-- no translation found for english_ime_input_options (3909945612939668554) -->
+    <skip />
     <string name="vibrate_on_keypress" msgid="5258079494276955460">"Trillen bij druk op toets"</string>
     <string name="sound_on_keypress" msgid="6093592297198243644">"Geluid bij druk op een toets"</string>
-    <string name="popup_on_keypress" msgid="123894815723512944">"Pop-up bij toetsaanslag"</string>
+    <!-- no translation found for popup_on_keypress (123894815723512944) -->
+    <skip />
     <string name="hit_correction" msgid="4855351009261318389">"Typefouten corrigeren"</string>
     <string name="hit_correction_summary" msgid="8761701873008070796">"Foutcorrectie tijdens invoer inschakelen"</string>
     <string name="hit_correction_land" msgid="2567691684825205448">"Invoerfouten in liggende weergave"</string>
@@ -48,10 +50,14 @@
     <string name="show_suggestions_summary" msgid="1989672863935759654">"Voorgestelde woorden weergeven tijdens typen"</string>
     <string name="auto_complete" msgid="1103196318775486023">"Auto-aanvullen"</string>
     <string name="auto_complete_summary" msgid="6113149638718274624">"Gemarkeerd woord automatisch invoegen met spatiebalk en interpunctie"</string>
-    <string name="prefs_settings_key" msgid="4623341240804046498">"Instellingscode weergeven"</string>
-    <string name="settings_key_mode_auto_name" msgid="2993460277873684680">"Automatisch"</string>
-    <string name="settings_key_mode_always_show_name" msgid="3047567041784760575">"Altijd weergeven"</string>
-    <string name="settings_key_mode_always_hide_name" msgid="7833948046716923994">"Altijd verbergen"</string>
+    <!-- no translation found for prefs_settings_key (4623341240804046498) -->
+    <skip />
+    <!-- no translation found for settings_key_mode_auto_name (2993460277873684680) -->
+    <skip />
+    <!-- no translation found for settings_key_mode_always_show_name (3047567041784760575) -->
+    <skip />
+    <!-- no translation found for settings_key_mode_always_hide_name (7833948046716923994) -->
+    <skip />
     <!-- no translation found for settings_key_modes:0 (8549888726962891527) -->
     <!-- no translation found for settings_key_modes:1 (881280041213210923) -->
     <!-- no translation found for settings_key_modes:2 (7317310620171067848) -->
@@ -125,16 +131,24 @@
     <string name="popular_domain_2" msgid="3036812463748402878">".org"</string>
     <string name="popular_domain_3" msgid="8718639560809452028">".gov"</string>
     <string name="popular_domain_4" msgid="35359437471311470">".edu"</string>
-    <string name="selectInputMethod" msgid="315076553378705821">"Invoermethode selecteren"</string>
+    <!-- no translation found for selectInputMethod (315076553378705821) -->
+    <skip />
     <string name="language_selection_title" msgid="1651299598555326750">"Invoertalen"</string>
     <string name="language_selection_summary" msgid="187110938289512256">"Schuif uw vinger over de spatiebalk om de taal te wijzigen"</string>
-    <string name="hint_add_to_dictionary" msgid="9006292060636342317">"← Raak nogmaals aan om op te slaan"</string>
+    <string name="hint_add_to_dictionary" msgid="8058519710062071085">"← Tik nogmaals om op te slaan"</string>
     <string name="has_dictionary" msgid="6071847973466625007">"Woordenboek beschikbaar"</string>
-    <string name="prefs_enable_log" msgid="6620424505072963557">"Gebruikersfeedback inschakelen."</string>
-    <string name="prefs_description_log" msgid="5827825607258246003">"Help deze invoermethode te verbeteren door automatisch gebruiksstatistieken en crashmeldingen naar Google te verzenden."</string>
-    <!-- outdated translation 5809974560359283818 -->     <string name="prefs_enable_recorrection" msgid="4588408906649533582">"Raak aan om woorden opnieuw te corrigeren"</string>
-    <!-- outdated translation 5037231665897435902 -->     <string name="prefs_enable_recorrection_summary" msgid="1056068922330206170">"U kunt woorden opnieuw corrigeren door woorden aan te raken die u heeft getypt"</string>
-    <string name="keyboard_layout" msgid="437433231038683666">"Toetsenbordthema"</string>
-    <string name="subtype_mode_keyboard" msgid="2242090416595003881">"toetsenbord"</string>
-    <string name="subtype_mode_voice" msgid="4394113125441627771">"spraak"</string>
+    <!-- no translation found for prefs_enable_log (6620424505072963557) -->
+    <skip />
+    <!-- no translation found for prefs_description_log (5827825607258246003) -->
+    <skip />
+    <!-- no translation found for prefs_enable_recorrection (4966265843750259377) -->
+    <skip />
+    <!-- no translation found for prefs_enable_recorrection_summary (8181745740388568396) -->
+    <skip />
+    <!-- no translation found for keyboard_layout (437433231038683666) -->
+    <skip />
+    <!-- no translation found for subtype_mode_keyboard (2242090416595003881) -->
+    <skip />
+    <!-- no translation found for subtype_mode_voice (4394113125441627771) -->
+    <skip />
 </resources>
diff --git a/java/res/values-pl/strings.xml b/java/res/values-pl/strings.xml
index a2f429e..2335858 100644
--- a/java/res/values-pl/strings.xml
+++ b/java/res/values-pl/strings.xml
@@ -22,10 +22,12 @@
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="english_ime_name" msgid="7252517407088836577">"Klawiatura Android"</string>
     <string name="english_ime_settings" msgid="6661589557206947774">"Ustawienia klawiatury Android"</string>
-    <string name="english_ime_input_options" msgid="3909945612939668554">"Opcje wprowadzania"</string>
+    <!-- no translation found for english_ime_input_options (3909945612939668554) -->
+    <skip />
     <string name="vibrate_on_keypress" msgid="5258079494276955460">"Wibracja przy naciśnięciu"</string>
     <string name="sound_on_keypress" msgid="6093592297198243644">"Dźwięk przy naciśnięciu"</string>
-    <string name="popup_on_keypress" msgid="123894815723512944">"Wyświetlaj po naciśnięciu klawisza"</string>
+    <!-- no translation found for popup_on_keypress (123894815723512944) -->
+    <skip />
     <string name="hit_correction" msgid="4855351009261318389">"Popraw błędy pisowni"</string>
     <string name="hit_correction_summary" msgid="8761701873008070796">"Włącz poprawianie błędów wprowadzania"</string>
     <string name="hit_correction_land" msgid="2567691684825205448">"Błędy wprowadzania w orientacji poziomej"</string>
@@ -48,10 +50,14 @@
     <string name="show_suggestions_summary" msgid="1989672863935759654">"Wyświetl sugerowane słowa podczas wpisywania"</string>
     <string name="auto_complete" msgid="1103196318775486023">"Autouzupełnianie"</string>
     <string name="auto_complete_summary" msgid="6113149638718274624">"Spacja i znaki przestankowe wstawiają wyróżnione słowo"</string>
-    <string name="prefs_settings_key" msgid="4623341240804046498">"Pokaż klawisz ustawień"</string>
-    <string name="settings_key_mode_auto_name" msgid="2993460277873684680">"Automatycznie"</string>
-    <string name="settings_key_mode_always_show_name" msgid="3047567041784760575">"Zawsze pokazuj"</string>
-    <string name="settings_key_mode_always_hide_name" msgid="7833948046716923994">"Zawsze ukrywaj"</string>
+    <!-- no translation found for prefs_settings_key (4623341240804046498) -->
+    <skip />
+    <!-- no translation found for settings_key_mode_auto_name (2993460277873684680) -->
+    <skip />
+    <!-- no translation found for settings_key_mode_always_show_name (3047567041784760575) -->
+    <skip />
+    <!-- no translation found for settings_key_mode_always_hide_name (7833948046716923994) -->
+    <skip />
     <!-- no translation found for settings_key_modes:0 (8549888726962891527) -->
     <!-- no translation found for settings_key_modes:1 (881280041213210923) -->
     <!-- no translation found for settings_key_modes:2 (7317310620171067848) -->
@@ -97,7 +103,7 @@
     <string name="voice_audio_error" msgid="5072707727016414454">"Problem z dźwiękiem"</string>
     <string name="voice_server_error" msgid="7807129913977261644">"Błąd serwera"</string>
     <string name="voice_speech_timeout" msgid="8461817525075498795">"Nie wykryto mowy"</string>
-    <string name="voice_no_match" msgid="4285117547030179174">"Brak wyników"</string>
+    <string name="voice_no_match" msgid="4285117547030179174">"Nie znaleziono żadnych wyników"</string>
     <string name="voice_not_installed" msgid="5552450909753842415">"Wyszukiwanie głosowe nie jest zainstalowane"</string>
     <string name="voice_swipe_hint" msgid="6943546180310682021"><b>"Wskazówka:"</b>" przesuń palcem po klawiaturze, aby mówić."</string>
     <string name="voice_punctuation_hint" msgid="1611389463237317754"><b>"Wskazówka:"</b>" następnym razem spróbuj wypowiadać nazwy znaków interpunkcyjnych: „kropka”, „przecinek” lub „pytajnik”."</string>
@@ -125,16 +131,24 @@
     <string name="popular_domain_2" msgid="3036812463748402878">".org"</string>
     <string name="popular_domain_3" msgid="8718639560809452028">".gov"</string>
     <string name="popular_domain_4" msgid="35359437471311470">".edu"</string>
-    <string name="selectInputMethod" msgid="315076553378705821">"Wybierz metodę wprowadzania"</string>
+    <!-- no translation found for selectInputMethod (315076553378705821) -->
+    <skip />
     <string name="language_selection_title" msgid="1651299598555326750">"Języki wprowadzania"</string>
     <string name="language_selection_summary" msgid="187110938289512256">"Przesuń palcem po spacji, aby zmienić język"</string>
-    <string name="hint_add_to_dictionary" msgid="9006292060636342317">"← Dotknij ponownie, aby zapisać"</string>
+    <string name="hint_add_to_dictionary" msgid="8058519710062071085">"← Dotknij ponownie, aby zapisać"</string>
     <string name="has_dictionary" msgid="6071847973466625007">"Słownik dostępny"</string>
-    <string name="prefs_enable_log" msgid="6620424505072963557">"Włącz przesyłanie opinii użytkownika"</string>
-    <string name="prefs_description_log" msgid="5827825607258246003">"Pomóż ulepszyć edytor tej metody wprowadzania, automatycznie wysyłając do Google statystyki użycia i raporty o awariach."</string>
-    <!-- outdated translation 5809974560359283818 -->     <string name="prefs_enable_recorrection" msgid="4588408906649533582">"Dotknij, aby ponownie poprawić słowa"</string>
-    <!-- outdated translation 5037231665897435902 -->     <string name="prefs_enable_recorrection_summary" msgid="1056068922330206170">"Możesz ponownie poprawiać wprowadzone słowa, dotykając ich"</string>
-    <string name="keyboard_layout" msgid="437433231038683666">"Motyw klawiatury"</string>
-    <string name="subtype_mode_keyboard" msgid="2242090416595003881">"klawiatura"</string>
-    <string name="subtype_mode_voice" msgid="4394113125441627771">"głosowe"</string>
+    <!-- no translation found for prefs_enable_log (6620424505072963557) -->
+    <skip />
+    <!-- no translation found for prefs_description_log (5827825607258246003) -->
+    <skip />
+    <!-- no translation found for prefs_enable_recorrection (4966265843750259377) -->
+    <skip />
+    <!-- no translation found for prefs_enable_recorrection_summary (8181745740388568396) -->
+    <skip />
+    <!-- no translation found for keyboard_layout (437433231038683666) -->
+    <skip />
+    <!-- no translation found for subtype_mode_keyboard (2242090416595003881) -->
+    <skip />
+    <!-- no translation found for subtype_mode_voice (4394113125441627771) -->
+    <skip />
 </resources>
diff --git a/java/res/values-pt-rPT/strings.xml b/java/res/values-pt-rPT/strings.xml
index 01d96ed..473e9ad 100644
--- a/java/res/values-pt-rPT/strings.xml
+++ b/java/res/values-pt-rPT/strings.xml
@@ -22,10 +22,12 @@
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="english_ime_name" msgid="7252517407088836577">"Teclado do Android"</string>
     <string name="english_ime_settings" msgid="6661589557206947774">"Definições de teclado do Android"</string>
-    <string name="english_ime_input_options" msgid="3909945612939668554">"Opções de introdução"</string>
+    <!-- no translation found for english_ime_input_options (3909945612939668554) -->
+    <skip />
     <string name="vibrate_on_keypress" msgid="5258079494276955460">"Vibrar ao primir as teclas"</string>
     <string name="sound_on_keypress" msgid="6093592297198243644">"Som ao premir as teclas"</string>
-    <string name="popup_on_keypress" msgid="123894815723512944">"Mostrar popup ao premir tecla"</string>
+    <!-- no translation found for popup_on_keypress (123894815723512944) -->
+    <skip />
     <string name="hit_correction" msgid="4855351009261318389">"Corrigir erros de escrita"</string>
     <string name="hit_correction_summary" msgid="8761701873008070796">"Activar a correcção de erros de entrada"</string>
     <string name="hit_correction_land" msgid="2567691684825205448">"Erros de entrada na horizontal"</string>
@@ -48,10 +50,14 @@
     <string name="show_suggestions_summary" msgid="1989672863935759654">"Apresentar sugestões de palavras ao escrever"</string>
     <string name="auto_complete" msgid="1103196318775486023">"Conclusão automática"</string>
     <string name="auto_complete_summary" msgid="6113149638718274624">"A barra de espaços e a pontuação inserem automaticamente uma palavra realçada"</string>
-    <string name="prefs_settings_key" msgid="4623341240804046498">"Mostrar tecla das definições"</string>
-    <string name="settings_key_mode_auto_name" msgid="2993460277873684680">"Automático"</string>
-    <string name="settings_key_mode_always_show_name" msgid="3047567041784760575">"Mostrar sempre"</string>
-    <string name="settings_key_mode_always_hide_name" msgid="7833948046716923994">"Ocultar sempre"</string>
+    <!-- no translation found for prefs_settings_key (4623341240804046498) -->
+    <skip />
+    <!-- no translation found for settings_key_mode_auto_name (2993460277873684680) -->
+    <skip />
+    <!-- no translation found for settings_key_mode_always_show_name (3047567041784760575) -->
+    <skip />
+    <!-- no translation found for settings_key_mode_always_hide_name (7833948046716923994) -->
+    <skip />
     <!-- no translation found for settings_key_modes:0 (8549888726962891527) -->
     <!-- no translation found for settings_key_modes:1 (881280041213210923) -->
     <!-- no translation found for settings_key_modes:2 (7317310620171067848) -->
@@ -125,16 +131,24 @@
     <string name="popular_domain_2" msgid="3036812463748402878">".org"</string>
     <string name="popular_domain_3" msgid="8718639560809452028">".gov"</string>
     <string name="popular_domain_4" msgid="35359437471311470">".edu"</string>
-    <string name="selectInputMethod" msgid="315076553378705821">"Seleccionar método de entrada"</string>
+    <!-- no translation found for selectInputMethod (315076553378705821) -->
+    <skip />
     <string name="language_selection_title" msgid="1651299598555326750">"Idiomas de entrada"</string>
     <string name="language_selection_summary" msgid="187110938289512256">"Deslize o dedo pela barra de espaço para alterar o idioma"</string>
-    <string name="hint_add_to_dictionary" msgid="9006292060636342317">"← Toque novamente para guardar"</string>
+    <string name="hint_add_to_dictionary" msgid="8058519710062071085">"← Toque novamente para guardar"</string>
     <string name="has_dictionary" msgid="6071847973466625007">"Dicionário disponível"</string>
-    <string name="prefs_enable_log" msgid="6620424505072963557">"Activar comentários do utilizador"</string>
-    <string name="prefs_description_log" msgid="5827825607258246003">"Envie automaticamente estatísticas de utilização e relatórios de falhas para a Google e ajude-nos a melhor este editor de método de introdução."</string>
-    <!-- outdated translation 5809974560359283818 -->     <string name="prefs_enable_recorrection" msgid="4588408906649533582">"Tocar para voltar a corrigir palavras"</string>
-    <!-- outdated translation 5037231665897435902 -->     <string name="prefs_enable_recorrection_summary" msgid="1056068922330206170">"Pode voltar a corrigir palavras tocando naquelas que escreveu"</string>
-    <string name="keyboard_layout" msgid="437433231038683666">"Tema do teclado"</string>
-    <string name="subtype_mode_keyboard" msgid="2242090416595003881">"teclado"</string>
-    <string name="subtype_mode_voice" msgid="4394113125441627771">"voz"</string>
+    <!-- no translation found for prefs_enable_log (6620424505072963557) -->
+    <skip />
+    <!-- no translation found for prefs_description_log (5827825607258246003) -->
+    <skip />
+    <!-- no translation found for prefs_enable_recorrection (4966265843750259377) -->
+    <skip />
+    <!-- no translation found for prefs_enable_recorrection_summary (8181745740388568396) -->
+    <skip />
+    <!-- no translation found for keyboard_layout (437433231038683666) -->
+    <skip />
+    <!-- no translation found for subtype_mode_keyboard (2242090416595003881) -->
+    <skip />
+    <!-- no translation found for subtype_mode_voice (4394113125441627771) -->
+    <skip />
 </resources>
diff --git a/java/res/values-pt/strings.xml b/java/res/values-pt/strings.xml
index 0acaf25..4b99889 100644
--- a/java/res/values-pt/strings.xml
+++ b/java/res/values-pt/strings.xml
@@ -22,10 +22,12 @@
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="english_ime_name" msgid="7252517407088836577">"Teclado Android"</string>
     <string name="english_ime_settings" msgid="6661589557206947774">"Configurações de teclado Android"</string>
-    <string name="english_ime_input_options" msgid="3909945612939668554">"Opções de entrada"</string>
+    <!-- no translation found for english_ime_input_options (3909945612939668554) -->
+    <skip />
     <string name="vibrate_on_keypress" msgid="5258079494276955460">"Vibrar ao tocar a tecla"</string>
     <string name="sound_on_keypress" msgid="6093592297198243644">"Som ao tocar a tecla"</string>
-    <string name="popup_on_keypress" msgid="123894815723512944">"Exibir pop-up ao tocar a tecla"</string>
+    <!-- no translation found for popup_on_keypress (123894815723512944) -->
+    <skip />
     <string name="hit_correction" msgid="4855351009261318389">"Corrigir erros de digitação"</string>
     <string name="hit_correction_summary" msgid="8761701873008070796">"Ativar a correção de erro de entrada"</string>
     <string name="hit_correction_land" msgid="2567691684825205448">"Erros de entrada de paisagem"</string>
@@ -48,10 +50,14 @@
     <string name="show_suggestions_summary" msgid="1989672863935759654">"Exibir sugestões de palavras durante a digitação"</string>
     <string name="auto_complete" msgid="1103196318775486023">"Conclusão automática"</string>
     <string name="auto_complete_summary" msgid="6113149638718274624">"Barra de espaço e pontuação inserem a palavra destacada"</string>
-    <string name="prefs_settings_key" msgid="4623341240804046498">"Mostrar tecla de configurações"</string>
-    <string name="settings_key_mode_auto_name" msgid="2993460277873684680">"Automático"</string>
-    <string name="settings_key_mode_always_show_name" msgid="3047567041784760575">"Mostrar sempre"</string>
-    <string name="settings_key_mode_always_hide_name" msgid="7833948046716923994">"Sempre ocultar"</string>
+    <!-- no translation found for prefs_settings_key (4623341240804046498) -->
+    <skip />
+    <!-- no translation found for settings_key_mode_auto_name (2993460277873684680) -->
+    <skip />
+    <!-- no translation found for settings_key_mode_always_show_name (3047567041784760575) -->
+    <skip />
+    <!-- no translation found for settings_key_mode_always_hide_name (7833948046716923994) -->
+    <skip />
     <!-- no translation found for settings_key_modes:0 (8549888726962891527) -->
     <!-- no translation found for settings_key_modes:1 (881280041213210923) -->
     <!-- no translation found for settings_key_modes:2 (7317310620171067848) -->
@@ -125,16 +131,24 @@
     <string name="popular_domain_2" msgid="3036812463748402878">".org"</string>
     <string name="popular_domain_3" msgid="8718639560809452028">".gov"</string>
     <string name="popular_domain_4" msgid="35359437471311470">".edu"</string>
-    <string name="selectInputMethod" msgid="315076553378705821">"Selecionar método de entrada"</string>
+    <!-- no translation found for selectInputMethod (315076553378705821) -->
+    <skip />
     <string name="language_selection_title" msgid="1651299598555326750">"Idiomas de entrada"</string>
     <string name="language_selection_summary" msgid="187110938289512256">"Deslize o dedo na barra de espaços para alterar o idioma"</string>
-    <string name="hint_add_to_dictionary" msgid="9006292060636342317">"← Toque novamente para salvar"</string>
+    <string name="hint_add_to_dictionary" msgid="8058519710062071085">"← Toque novamente para salvar"</string>
     <string name="has_dictionary" msgid="6071847973466625007">"Dicionário disponível"</string>
-    <string name="prefs_enable_log" msgid="6620424505072963557">"Ativar comentário do usuário"</string>
-    <string name="prefs_description_log" msgid="5827825607258246003">"Ajude a melhorar este editor de método de entrada enviando automaticamente ao Google estatísticas de uso e relatórios de falhas."</string>
-    <!-- outdated translation 5809974560359283818 -->     <string name="prefs_enable_recorrection" msgid="4588408906649533582">"Toque para corrigir novamente as palavras"</string>
-    <!-- outdated translation 5037231665897435902 -->     <string name="prefs_enable_recorrection_summary" msgid="1056068922330206170">"Você pode fazer novamente a correção tocando nas palavras digitadas"</string>
-    <string name="keyboard_layout" msgid="437433231038683666">"Tema do teclado"</string>
-    <string name="subtype_mode_keyboard" msgid="2242090416595003881">"teclado"</string>
-    <string name="subtype_mode_voice" msgid="4394113125441627771">"voz"</string>
+    <!-- no translation found for prefs_enable_log (6620424505072963557) -->
+    <skip />
+    <!-- no translation found for prefs_description_log (5827825607258246003) -->
+    <skip />
+    <!-- no translation found for prefs_enable_recorrection (4966265843750259377) -->
+    <skip />
+    <!-- no translation found for prefs_enable_recorrection_summary (8181745740388568396) -->
+    <skip />
+    <!-- no translation found for keyboard_layout (437433231038683666) -->
+    <skip />
+    <!-- no translation found for subtype_mode_keyboard (2242090416595003881) -->
+    <skip />
+    <!-- no translation found for subtype_mode_voice (4394113125441627771) -->
+    <skip />
 </resources>
diff --git a/java/res/values-rm/strings.xml b/java/res/values-rm/strings.xml
index 91dbf72..da7b3a1 100644
--- a/java/res/values-rm/strings.xml
+++ b/java/res/values-rm/strings.xml
@@ -22,6 +22,8 @@
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="english_ime_name" msgid="7252517407088836577">"Tastatura Android"</string>
     <string name="english_ime_settings" msgid="6661589557206947774">"Parameters da la tastatura Android"</string>
+    <!-- no translation found for english_ime_input_options (3909945612939668554) -->
+    <skip />
     <string name="vibrate_on_keypress" msgid="5258079494276955460">"Vibrar cun smatgar in buttun"</string>
     <string name="sound_on_keypress" msgid="6093592297198243644">"Tun cun smatgar in buttun"</string>
     <!-- no translation found for popup_on_keypress (123894815723512944) -->
@@ -48,6 +50,17 @@
     <string name="show_suggestions_summary" msgid="1989672863935759654">"Mussar pleds proponids durant l\'endataziun"</string>
     <string name="auto_complete" msgid="1103196318775486023">"Cumplettaziun automatica"</string>
     <string name="auto_complete_summary" msgid="6113149638718274624">"Inserir auto. il pled marcà cun la tasta da vid/interpuncziun"</string>
+    <!-- no translation found for prefs_settings_key (4623341240804046498) -->
+    <skip />
+    <!-- no translation found for settings_key_mode_auto_name (2993460277873684680) -->
+    <skip />
+    <!-- no translation found for settings_key_mode_always_show_name (3047567041784760575) -->
+    <skip />
+    <!-- no translation found for settings_key_mode_always_hide_name (7833948046716923994) -->
+    <skip />
+    <!-- no translation found for settings_key_modes:0 (8549888726962891527) -->
+    <!-- no translation found for settings_key_modes:1 (881280041213210923) -->
+    <!-- no translation found for settings_key_modes:2 (7317310620171067848) -->
     <!-- no translation found for bigram_suggestion (1323347224043514969) -->
     <skip />
     <!-- no translation found for bigram_suggestion_summary (4383845146070101531) -->
@@ -120,6 +133,8 @@
     <string name="popular_domain_2" msgid="3036812463748402878">".org"</string>
     <string name="popular_domain_3" msgid="8718639560809452028">".gov"</string>
     <string name="popular_domain_4" msgid="35359437471311470">".edu"</string>
+    <!-- no translation found for selectInputMethod (315076553378705821) -->
+    <skip />
     <string name="language_selection_title" msgid="1651299598555326750">"Linguas da cumonds vocals"</string>
     <string name="language_selection_summary" msgid="187110938289512256">"Stritgar cun il det sur la tasta da vid per midar la lingua"</string>
     <string name="hint_add_to_dictionary" msgid="8058519710062071085">"← Tippar danovamain per memorisar"</string>
@@ -128,8 +143,14 @@
     <skip />
     <!-- no translation found for prefs_description_log (5827825607258246003) -->
     <skip />
+    <!-- no translation found for prefs_enable_recorrection (4966265843750259377) -->
+    <skip />
+    <!-- no translation found for prefs_enable_recorrection_summary (8181745740388568396) -->
+    <skip />
     <!-- no translation found for keyboard_layout (437433231038683666) -->
     <skip />
-    <!-- no translation found for prefs_debug_mode (3889340783846594980) -->
+    <!-- no translation found for subtype_mode_keyboard (2242090416595003881) -->
+    <skip />
+    <!-- no translation found for subtype_mode_voice (4394113125441627771) -->
     <skip />
 </resources>
diff --git a/java/res/values-ru/strings.xml b/java/res/values-ru/strings.xml
index ae5e391..98b36ed 100644
--- a/java/res/values-ru/strings.xml
+++ b/java/res/values-ru/strings.xml
@@ -22,10 +22,12 @@
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="english_ime_name" msgid="7252517407088836577">"Клавиатура Android"</string>
     <string name="english_ime_settings" msgid="6661589557206947774">"Настройки клавиатуры Android"</string>
-    <string name="english_ime_input_options" msgid="3909945612939668554">"Параметры ввода"</string>
+    <!-- no translation found for english_ime_input_options (3909945612939668554) -->
+    <skip />
     <string name="vibrate_on_keypress" msgid="5258079494276955460">"Виброотклик клавиш"</string>
     <string name="sound_on_keypress" msgid="6093592297198243644">"Звук клавиш"</string>
-    <string name="popup_on_keypress" msgid="123894815723512944">"Показывать при нажатии"</string>
+    <!-- no translation found for popup_on_keypress (123894815723512944) -->
+    <skip />
     <string name="hit_correction" msgid="4855351009261318389">"Исправлять опечатки"</string>
     <string name="hit_correction_summary" msgid="8761701873008070796">"Включить исправление ошибок при вводе"</string>
     <string name="hit_correction_land" msgid="2567691684825205448">"Ошибки при вводе в горизонтальной ориентации"</string>
@@ -48,14 +50,18 @@
     <string name="show_suggestions_summary" msgid="1989672863935759654">"Предлагать варианты слов во время ввода"</string>
     <string name="auto_complete" msgid="1103196318775486023">"Автозавершение"</string>
     <string name="auto_complete_summary" msgid="6113149638718274624">"При нажатии пробела вставлять предложенное слово"</string>
-    <string name="prefs_settings_key" msgid="4623341240804046498">"Показывать кнопку настроек"</string>
-    <string name="settings_key_mode_auto_name" msgid="2993460277873684680">"Автоматически"</string>
-    <string name="settings_key_mode_always_show_name" msgid="3047567041784760575">"Всегда показывать"</string>
-    <string name="settings_key_mode_always_hide_name" msgid="7833948046716923994">"Всегда скрывать"</string>
+    <!-- no translation found for prefs_settings_key (4623341240804046498) -->
+    <skip />
+    <!-- no translation found for settings_key_mode_auto_name (2993460277873684680) -->
+    <skip />
+    <!-- no translation found for settings_key_mode_always_show_name (3047567041784760575) -->
+    <skip />
+    <!-- no translation found for settings_key_mode_always_hide_name (7833948046716923994) -->
+    <skip />
     <!-- no translation found for settings_key_modes:0 (8549888726962891527) -->
     <!-- no translation found for settings_key_modes:1 (881280041213210923) -->
     <!-- no translation found for settings_key_modes:2 (7317310620171067848) -->
-    <string name="bigram_suggestion" msgid="1323347224043514969">"Биграммные подсказки"</string>
+    <string name="bigram_suggestion" msgid="1323347224043514969">"Биграммные подсказки "</string>
     <string name="bigram_suggestion_summary" msgid="4383845146070101531">"Используйте предыдущее слово, чтобы исправить подсказку"</string>
   <string-array name="prediction_modes">
     <item msgid="4870266572388153286">"Нет"</item>
@@ -125,16 +131,24 @@
     <string name="popular_domain_2" msgid="3036812463748402878">".org"</string>
     <string name="popular_domain_3" msgid="8718639560809452028">".gov"</string>
     <string name="popular_domain_4" msgid="35359437471311470">".edu"</string>
-    <string name="selectInputMethod" msgid="315076553378705821">"Выбрать способ ввода"</string>
+    <!-- no translation found for selectInputMethod (315076553378705821) -->
+    <skip />
     <string name="language_selection_title" msgid="1651299598555326750">"Языки ввода"</string>
     <string name="language_selection_summary" msgid="187110938289512256">"Для изменения языка проведите пальцем по пробелу"</string>
-    <string name="hint_add_to_dictionary" msgid="9006292060636342317">"← Нажмите еще раз, чтобы сохранить"</string>
+    <string name="hint_add_to_dictionary" msgid="8058519710062071085">"← Нажмите повторно, чтобы сохранить"</string>
     <string name="has_dictionary" msgid="6071847973466625007">"Доступен словарь"</string>
-    <string name="prefs_enable_log" msgid="6620424505072963557">"Включить отправку сведений"</string>
-    <string name="prefs_description_log" msgid="5827825607258246003">"Помогите усовершенствовать редактор способа ввода, разрешив отправку статистики и отчетов о сбоях в Google."</string>
-    <!-- outdated translation 5809974560359283818 -->     <string name="prefs_enable_recorrection" msgid="4588408906649533582">"Исправление нажатием"</string>
-    <!-- outdated translation 5037231665897435902 -->     <string name="prefs_enable_recorrection_summary" msgid="1056068922330206170">"Нажмите на слово, чтобы исправить его"</string>
-    <string name="keyboard_layout" msgid="437433231038683666">"Вид клавиатуры"</string>
-    <string name="subtype_mode_keyboard" msgid="2242090416595003881">"клавиатура"</string>
-    <string name="subtype_mode_voice" msgid="4394113125441627771">"голосовой"</string>
+    <!-- no translation found for prefs_enable_log (6620424505072963557) -->
+    <skip />
+    <!-- no translation found for prefs_description_log (5827825607258246003) -->
+    <skip />
+    <!-- no translation found for prefs_enable_recorrection (4966265843750259377) -->
+    <skip />
+    <!-- no translation found for prefs_enable_recorrection_summary (8181745740388568396) -->
+    <skip />
+    <!-- no translation found for keyboard_layout (437433231038683666) -->
+    <skip />
+    <!-- no translation found for subtype_mode_keyboard (2242090416595003881) -->
+    <skip />
+    <!-- no translation found for subtype_mode_voice (4394113125441627771) -->
+    <skip />
 </resources>
diff --git a/java/res/values-sv/strings.xml b/java/res/values-sv/strings.xml
index eaa3d19..6b7ffd9 100644
--- a/java/res/values-sv/strings.xml
+++ b/java/res/values-sv/strings.xml
@@ -22,10 +22,12 @@
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="english_ime_name" msgid="7252517407088836577">"Androids tangentbord"</string>
     <string name="english_ime_settings" msgid="6661589557206947774">"Inställningar för Androids tangentbord"</string>
-    <string name="english_ime_input_options" msgid="3909945612939668554">"Inmatningsalternativ"</string>
+    <!-- no translation found for english_ime_input_options (3909945612939668554) -->
+    <skip />
     <string name="vibrate_on_keypress" msgid="5258079494276955460">"Vibrera vid tangenttryck"</string>
     <string name="sound_on_keypress" msgid="6093592297198243644">"Knappljud"</string>
-    <string name="popup_on_keypress" msgid="123894815723512944">"Popup vid knapptryck"</string>
+    <!-- no translation found for popup_on_keypress (123894815723512944) -->
+    <skip />
     <string name="hit_correction" msgid="4855351009261318389">"Rätta skrivfel"</string>
     <string name="hit_correction_summary" msgid="8761701873008070796">"Aktivera rättning av felaktiga inmatningar"</string>
     <string name="hit_correction_land" msgid="2567691684825205448">"Inmatningsfel i liggande vy"</string>
@@ -48,10 +50,14 @@
     <string name="show_suggestions_summary" msgid="1989672863935759654">"Visar ordförslag när du skriver"</string>
     <string name="auto_complete" msgid="1103196318775486023">"Komplettera automatiskt"</string>
     <string name="auto_complete_summary" msgid="6113149638718274624">"Blanksteg och punkt infogar automatiskt markerat ord"</string>
-    <string name="prefs_settings_key" msgid="4623341240804046498">"Visa inställningsknapp"</string>
-    <string name="settings_key_mode_auto_name" msgid="2993460277873684680">"Automatiskt"</string>
-    <string name="settings_key_mode_always_show_name" msgid="3047567041784760575">"Visa alltid"</string>
-    <string name="settings_key_mode_always_hide_name" msgid="7833948046716923994">"Dölj alltid"</string>
+    <!-- no translation found for prefs_settings_key (4623341240804046498) -->
+    <skip />
+    <!-- no translation found for settings_key_mode_auto_name (2993460277873684680) -->
+    <skip />
+    <!-- no translation found for settings_key_mode_always_show_name (3047567041784760575) -->
+    <skip />
+    <!-- no translation found for settings_key_mode_always_hide_name (7833948046716923994) -->
+    <skip />
     <!-- no translation found for settings_key_modes:0 (8549888726962891527) -->
     <!-- no translation found for settings_key_modes:1 (881280041213210923) -->
     <!-- no translation found for settings_key_modes:2 (7317310620171067848) -->
@@ -125,16 +131,24 @@
     <string name="popular_domain_2" msgid="3036812463748402878">".org"</string>
     <string name="popular_domain_3" msgid="8718639560809452028">".gov"</string>
     <string name="popular_domain_4" msgid="35359437471311470">".edu"</string>
-    <string name="selectInputMethod" msgid="315076553378705821">"Välj inmatningsmetod"</string>
+    <!-- no translation found for selectInputMethod (315076553378705821) -->
+    <skip />
     <string name="language_selection_title" msgid="1651299598555326750">"Inmatningsspråk"</string>
     <string name="language_selection_summary" msgid="187110938289512256">"Dra med fingret på blanksteg om du vill ändra språk"</string>
-    <string name="hint_add_to_dictionary" msgid="9006292060636342317">"← Tryck igen för att spara"</string>
+    <string name="hint_add_to_dictionary" msgid="8058519710062071085">"← Peka igen för att spara"</string>
     <string name="has_dictionary" msgid="6071847973466625007">"En ordlista är tillgänglig"</string>
-    <string name="prefs_enable_log" msgid="6620424505072963557">"Aktivera synpunkter från användare"</string>
-    <string name="prefs_description_log" msgid="5827825607258246003">"Du kan hjälpa till att förbättra inmatningsmetoden genom att automatiskt skicka användningsstatistik och felrapporter till Google."</string>
-    <!-- outdated translation 5809974560359283818 -->     <string name="prefs_enable_recorrection" msgid="4588408906649533582">"Tryck om du vill korrigera om ord"</string>
-    <!-- outdated translation 5037231665897435902 -->     <string name="prefs_enable_recorrection_summary" msgid="1056068922330206170">"Du kan korrigera om ord genom att trycka på ord som du har skrivit"</string>
-    <string name="keyboard_layout" msgid="437433231038683666">"Tangentbordstema"</string>
-    <string name="subtype_mode_keyboard" msgid="2242090416595003881">"tangentbord"</string>
-    <string name="subtype_mode_voice" msgid="4394113125441627771">"röst"</string>
+    <!-- no translation found for prefs_enable_log (6620424505072963557) -->
+    <skip />
+    <!-- no translation found for prefs_description_log (5827825607258246003) -->
+    <skip />
+    <!-- no translation found for prefs_enable_recorrection (4966265843750259377) -->
+    <skip />
+    <!-- no translation found for prefs_enable_recorrection_summary (8181745740388568396) -->
+    <skip />
+    <!-- no translation found for keyboard_layout (437433231038683666) -->
+    <skip />
+    <!-- no translation found for subtype_mode_keyboard (2242090416595003881) -->
+    <skip />
+    <!-- no translation found for subtype_mode_voice (4394113125441627771) -->
+    <skip />
 </resources>
diff --git a/java/res/values-tr/strings.xml b/java/res/values-tr/strings.xml
index 599ddb2..e0ec094 100644
--- a/java/res/values-tr/strings.xml
+++ b/java/res/values-tr/strings.xml
@@ -22,10 +22,12 @@
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="english_ime_name" msgid="7252517407088836577">"Android klavyesi"</string>
     <string name="english_ime_settings" msgid="6661589557206947774">"Android klavye ayarları"</string>
-    <string name="english_ime_input_options" msgid="3909945612939668554">"Giriş seçenekleri"</string>
+    <!-- no translation found for english_ime_input_options (3909945612939668554) -->
+    <skip />
     <string name="vibrate_on_keypress" msgid="5258079494276955460">"Tuşa basıldığında titret"</string>
     <string name="sound_on_keypress" msgid="6093592297198243644">"Tuşa basıldığında ses çıkar"</string>
-    <string name="popup_on_keypress" msgid="123894815723512944">"Tuşa basıldığında pop-up aç"</string>
+    <!-- no translation found for popup_on_keypress (123894815723512944) -->
+    <skip />
     <string name="hit_correction" msgid="4855351009261318389">"Yazım hatalarını düzelt"</string>
     <string name="hit_correction_summary" msgid="8761701873008070796">"Giriş hatası düzeltmeyi etkinleştir"</string>
     <string name="hit_correction_land" msgid="2567691684825205448">"Yatay giriş hataları"</string>
@@ -48,10 +50,14 @@
     <string name="show_suggestions_summary" msgid="1989672863935759654">"Yazarken önerilen kelimeleri görüntüle"</string>
     <string name="auto_complete" msgid="1103196318775486023">"Otomatik tamamla"</string>
     <string name="auto_complete_summary" msgid="6113149638718274624">"Boşluk tuşu ve noktalama vurgulanan kelimeyi otomatik ekler"</string>
-    <string name="prefs_settings_key" msgid="4623341240804046498">"Ayarları göster tuşu"</string>
-    <string name="settings_key_mode_auto_name" msgid="2993460277873684680">"Otomatik"</string>
-    <string name="settings_key_mode_always_show_name" msgid="3047567041784760575">"Her zaman göster"</string>
-    <string name="settings_key_mode_always_hide_name" msgid="7833948046716923994">"Her zaman gizle"</string>
+    <!-- no translation found for prefs_settings_key (4623341240804046498) -->
+    <skip />
+    <!-- no translation found for settings_key_mode_auto_name (2993460277873684680) -->
+    <skip />
+    <!-- no translation found for settings_key_mode_always_show_name (3047567041784760575) -->
+    <skip />
+    <!-- no translation found for settings_key_mode_always_hide_name (7833948046716923994) -->
+    <skip />
     <!-- no translation found for settings_key_modes:0 (8549888726962891527) -->
     <!-- no translation found for settings_key_modes:1 (881280041213210923) -->
     <!-- no translation found for settings_key_modes:2 (7317310620171067848) -->
@@ -125,16 +131,24 @@
     <string name="popular_domain_2" msgid="3036812463748402878">".org"</string>
     <string name="popular_domain_3" msgid="8718639560809452028">".gov"</string>
     <string name="popular_domain_4" msgid="35359437471311470">".edu"</string>
-    <string name="selectInputMethod" msgid="315076553378705821">"Giriş yöntemini seç"</string>
+    <!-- no translation found for selectInputMethod (315076553378705821) -->
+    <skip />
     <string name="language_selection_title" msgid="1651299598555326750">"Giriş dilleri"</string>
     <string name="language_selection_summary" msgid="187110938289512256">"Dili değiştirmek için parmağınızı boşluk çubuğu üzerinde kaydırın"</string>
-    <string name="hint_add_to_dictionary" msgid="9006292060636342317">"← Kaydetmek için tekrar dokunun"</string>
+    <string name="hint_add_to_dictionary" msgid="8058519710062071085">"← Kaydetmek için tekrar dokunun"</string>
     <string name="has_dictionary" msgid="6071847973466625007">"Sözlük kullanılabilir"</string>
-    <string name="prefs_enable_log" msgid="6620424505072963557">"Kullanıcı geri bildirimini etkinleştir"</string>
-    <string name="prefs_description_log" msgid="5827825607258246003">"Kullanım istatistiklerini ve kilitlenme raporlarını Google\'a otomatik olarak göndererek bu giriş yöntemi düzenleyicisinin iyileştirilmesine yardımcı olun."</string>
-    <!-- outdated translation 5809974560359283818 -->     <string name="prefs_enable_recorrection" msgid="4588408906649533582">"Kelimeleri düzeltmek için dokunun"</string>
-    <!-- outdated translation 5037231665897435902 -->     <string name="prefs_enable_recorrection_summary" msgid="1056068922330206170">"Yazdığınız kelimelere dokunarak kelimelerde düzeltme yapabilirsiniz"</string>
-    <string name="keyboard_layout" msgid="437433231038683666">"Klavye Teması"</string>
-    <string name="subtype_mode_keyboard" msgid="2242090416595003881">"klavye"</string>
-    <string name="subtype_mode_voice" msgid="4394113125441627771">"ses"</string>
+    <!-- no translation found for prefs_enable_log (6620424505072963557) -->
+    <skip />
+    <!-- no translation found for prefs_description_log (5827825607258246003) -->
+    <skip />
+    <!-- no translation found for prefs_enable_recorrection (4966265843750259377) -->
+    <skip />
+    <!-- no translation found for prefs_enable_recorrection_summary (8181745740388568396) -->
+    <skip />
+    <!-- no translation found for keyboard_layout (437433231038683666) -->
+    <skip />
+    <!-- no translation found for subtype_mode_keyboard (2242090416595003881) -->
+    <skip />
+    <!-- no translation found for subtype_mode_voice (4394113125441627771) -->
+    <skip />
 </resources>
diff --git a/java/res/values-xlarge/bools.xml b/java/res/values-xlarge/bools.xml
new file mode 100644
index 0000000..2ac5fc6
--- /dev/null
+++ b/java/res/values-xlarge/bools.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2010, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+<resources>
+    <!-- Whether or not Popup on key press is enabled by default -->
+    <bool name="default_popup_preview">false</bool>
+    <bool name="config_enable_show_settings_key_option">false</bool>
+    <bool name="config_dynamic_key_top_enter_key">false</bool>
+    <bool name="config_dynamic_key_top_symbol_key">false</bool>
+</resources>
diff --git a/java/res/values-xlarge/dimens.xml b/java/res/values-xlarge/dimens.xml
new file mode 100644
index 0000000..4614f72
--- /dev/null
+++ b/java/res/values-xlarge/dimens.xml
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2010, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<resources>
+    <!-- key_height + key_bottom_gap = popup_key_height -->
+    <dimen name="key_height">0.450in</dimen>
+    <dimen name="key_bottom_gap">0.03in</dimen>
+    <dimen name="key_horizontal_gap">0.03in</dimen>
+    <dimen name="popup_key_height">0.450in</dimen>
+    <dimen name="keyboard_bottom_padding">0.10in</dimen>
+    <!-- key_height x 1.6 -->
+    <dimen name="key_preview_height">0.720in</dimen>
+    <!-- Amount of allowance for selecting keys in a mini popup keyboard by sliding finger. -->
+    <!-- popup_key_height x 1.7 -->
+    <dimen name="mini_keyboard_slide_allowance">0.765in</dimen>
+    <!-- popup_key_height x 1.0 -->
+    <dimen name="mini_keyboard_vertical_correction">-0.450in</dimen>
+
+    <dimen name="key_text_size">0.175in</dimen>
+    <dimen name="key_label_text_size">0.100in</dimen>
+    <dimen name="key_preview_text_size_large">0.245in</dimen>
+    <!-- We use "inch", not "dip" because this value tries dealing with physical distance related
+         to user's finger. -->
+    <dimen name="keyboard_vertical_correction">0.0in</dimen>
+
+    <dimen name="candidate_strip_height">46dip</dimen>
+    <dimen name="spacebar_vertical_correction">0dip</dimen>
+</resources>
diff --git a/java/res/values-zh-rCN/strings.xml b/java/res/values-zh-rCN/strings.xml
index 7a4bcea..b8973b2 100644
--- a/java/res/values-zh-rCN/strings.xml
+++ b/java/res/values-zh-rCN/strings.xml
@@ -22,10 +22,12 @@
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="english_ime_name" msgid="7252517407088836577">"Android 键盘"</string>
     <string name="english_ime_settings" msgid="6661589557206947774">"Android 键盘设置"</string>
-    <string name="english_ime_input_options" msgid="3909945612939668554">"输入选项"</string>
+    <!-- no translation found for english_ime_input_options (3909945612939668554) -->
+    <skip />
     <string name="vibrate_on_keypress" msgid="5258079494276955460">"按键时振动"</string>
     <string name="sound_on_keypress" msgid="6093592297198243644">"按键时播放音效"</string>
-    <string name="popup_on_keypress" msgid="123894815723512944">"按键时显示弹出窗口"</string>
+    <!-- no translation found for popup_on_keypress (123894815723512944) -->
+    <skip />
     <string name="hit_correction" msgid="4855351009261318389">"纠正输入错误"</string>
     <string name="hit_correction_summary" msgid="8761701873008070796">"启用输入错误纠正功能"</string>
     <string name="hit_correction_land" msgid="2567691684825205448">"横向输入错误"</string>
@@ -48,10 +50,14 @@
     <string name="show_suggestions_summary" msgid="1989672863935759654">"输入时启用联想提示"</string>
     <string name="auto_complete" msgid="1103196318775486023">"自动填写"</string>
     <string name="auto_complete_summary" msgid="6113149638718274624">"按空格键和标点符号时自动插入突出显示的字词"</string>
-    <string name="prefs_settings_key" msgid="4623341240804046498">"显示设置键"</string>
-    <string name="settings_key_mode_auto_name" msgid="2993460277873684680">"自动"</string>
-    <string name="settings_key_mode_always_show_name" msgid="3047567041784760575">"始终显示"</string>
-    <string name="settings_key_mode_always_hide_name" msgid="7833948046716923994">"始终隐藏"</string>
+    <!-- no translation found for prefs_settings_key (4623341240804046498) -->
+    <skip />
+    <!-- no translation found for settings_key_mode_auto_name (2993460277873684680) -->
+    <skip />
+    <!-- no translation found for settings_key_mode_always_show_name (3047567041784760575) -->
+    <skip />
+    <!-- no translation found for settings_key_mode_always_hide_name (7833948046716923994) -->
+    <skip />
     <!-- no translation found for settings_key_modes:0 (8549888726962891527) -->
     <!-- no translation found for settings_key_modes:1 (881280041213210923) -->
     <!-- no translation found for settings_key_modes:2 (7317310620171067848) -->
@@ -125,16 +131,24 @@
     <string name="popular_domain_2" msgid="3036812463748402878">".org"</string>
     <string name="popular_domain_3" msgid="8718639560809452028">".gov"</string>
     <string name="popular_domain_4" msgid="35359437471311470">".edu"</string>
-    <string name="selectInputMethod" msgid="315076553378705821">"选择输入法"</string>
+    <!-- no translation found for selectInputMethod (315076553378705821) -->
+    <skip />
     <string name="language_selection_title" msgid="1651299598555326750">"输入语言"</string>
     <string name="language_selection_summary" msgid="187110938289512256">"在空格键上滑动手指可更改语言"</string>
-    <string name="hint_add_to_dictionary" msgid="9006292060636342317">"← 再次触摸即可保存"</string>
+    <string name="hint_add_to_dictionary" msgid="8058519710062071085">"← 再次点按即可保存"</string>
     <string name="has_dictionary" msgid="6071847973466625007">"提供字典"</string>
-    <string name="prefs_enable_log" msgid="6620424505072963557">"启用用户反馈"</string>
-    <string name="prefs_description_log" msgid="5827825607258246003">"自动向 Google 发送使用情况统计信息和崩溃报告,帮助改进该输入法编辑器。"</string>
-    <!-- outdated translation 5809974560359283818 -->     <string name="prefs_enable_recorrection" msgid="4588408906649533582">"触摸即可更正字词"</string>
-    <!-- outdated translation 5037231665897435902 -->     <string name="prefs_enable_recorrection_summary" msgid="1056068922330206170">"您可以触摸已键入的字词,对其进行更正"</string>
-    <string name="keyboard_layout" msgid="437433231038683666">"键盘主题"</string>
-    <string name="subtype_mode_keyboard" msgid="2242090416595003881">"键盘"</string>
-    <string name="subtype_mode_voice" msgid="4394113125441627771">"语音"</string>
+    <!-- no translation found for prefs_enable_log (6620424505072963557) -->
+    <skip />
+    <!-- no translation found for prefs_description_log (5827825607258246003) -->
+    <skip />
+    <!-- no translation found for prefs_enable_recorrection (4966265843750259377) -->
+    <skip />
+    <!-- no translation found for prefs_enable_recorrection_summary (8181745740388568396) -->
+    <skip />
+    <!-- no translation found for keyboard_layout (437433231038683666) -->
+    <skip />
+    <!-- no translation found for subtype_mode_keyboard (2242090416595003881) -->
+    <skip />
+    <!-- no translation found for subtype_mode_voice (4394113125441627771) -->
+    <skip />
 </resources>
diff --git a/java/res/values-zh-rTW/strings.xml b/java/res/values-zh-rTW/strings.xml
index cbd0796..d9e0dac 100644
--- a/java/res/values-zh-rTW/strings.xml
+++ b/java/res/values-zh-rTW/strings.xml
@@ -22,10 +22,12 @@
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="english_ime_name" msgid="7252517407088836577">"Android 鍵盤"</string>
     <string name="english_ime_settings" msgid="6661589557206947774">"Android 鍵盤設定"</string>
-    <string name="english_ime_input_options" msgid="3909945612939668554">"輸入選項"</string>
+    <!-- no translation found for english_ime_input_options (3909945612939668554) -->
+    <skip />
     <string name="vibrate_on_keypress" msgid="5258079494276955460">"按鍵時震動"</string>
     <string name="sound_on_keypress" msgid="6093592297198243644">"按鍵時播放音效"</string>
-    <string name="popup_on_keypress" msgid="123894815723512944">"按鍵時顯示彈出式視窗"</string>
+    <!-- no translation found for popup_on_keypress (123894815723512944) -->
+    <skip />
     <string name="hit_correction" msgid="4855351009261318389">"修正輸入錯誤"</string>
     <string name="hit_correction_summary" msgid="8761701873008070796">"啟用輸入錯誤修正功能"</string>
     <string name="hit_correction_land" msgid="2567691684825205448">"橫向輸入錯誤"</string>
@@ -48,10 +50,14 @@
     <string name="show_suggestions_summary" msgid="1989672863935759654">"打字時顯示建議字詞"</string>
     <string name="auto_complete" msgid="1103196318775486023">"自動完成"</string>
     <string name="auto_complete_summary" msgid="6113149638718274624">"在反白顯示的字詞處自動插入空白鍵和標點符號鍵盤"</string>
-    <string name="prefs_settings_key" msgid="4623341240804046498">"顯示設定金鑰"</string>
-    <string name="settings_key_mode_auto_name" msgid="2993460277873684680">"自動"</string>
-    <string name="settings_key_mode_always_show_name" msgid="3047567041784760575">"永遠顯示"</string>
-    <string name="settings_key_mode_always_hide_name" msgid="7833948046716923994">"永遠隱藏"</string>
+    <!-- no translation found for prefs_settings_key (4623341240804046498) -->
+    <skip />
+    <!-- no translation found for settings_key_mode_auto_name (2993460277873684680) -->
+    <skip />
+    <!-- no translation found for settings_key_mode_always_show_name (3047567041784760575) -->
+    <skip />
+    <!-- no translation found for settings_key_mode_always_hide_name (7833948046716923994) -->
+    <skip />
     <!-- no translation found for settings_key_modes:0 (8549888726962891527) -->
     <!-- no translation found for settings_key_modes:1 (881280041213210923) -->
     <!-- no translation found for settings_key_modes:2 (7317310620171067848) -->
@@ -125,16 +131,24 @@
     <string name="popular_domain_2" msgid="3036812463748402878">".org"</string>
     <string name="popular_domain_3" msgid="8718639560809452028">".gov"</string>
     <string name="popular_domain_4" msgid="35359437471311470">".edu"</string>
-    <string name="selectInputMethod" msgid="315076553378705821">"選取輸入法"</string>
+    <!-- no translation found for selectInputMethod (315076553378705821) -->
+    <skip />
     <string name="language_selection_title" msgid="1651299598555326750">"輸入語言"</string>
     <string name="language_selection_summary" msgid="187110938289512256">"以手指在空白鍵上滑動可變更語言"</string>
-    <string name="hint_add_to_dictionary" msgid="9006292060636342317">"← 再次輕觸即可儲存"</string>
+    <string name="hint_add_to_dictionary" msgid="8058519710062071085">"← 再次輕按可儲存"</string>
     <string name="has_dictionary" msgid="6071847973466625007">"可使用字典"</string>
-    <string name="prefs_enable_log" msgid="6620424505072963557">"啟用使用者意見回饋"</string>
-    <string name="prefs_description_log" msgid="5827825607258246003">"自動將使用統計資料和當機報告傳送給 Google,協助改善這個輸入法編輯器。"</string>
-    <!-- outdated translation 5809974560359283818 -->     <string name="prefs_enable_recorrection" msgid="4588408906649533582">"輕觸即可重新修正字詞"</string>
-    <!-- outdated translation 5037231665897435902 -->     <string name="prefs_enable_recorrection_summary" msgid="1056068922330206170">"只要輕觸您所輸入的字詞,即可重新予以修正"</string>
-    <string name="keyboard_layout" msgid="437433231038683666">"鍵盤主題"</string>
-    <string name="subtype_mode_keyboard" msgid="2242090416595003881">"鍵盤"</string>
-    <string name="subtype_mode_voice" msgid="4394113125441627771">"語音"</string>
+    <!-- no translation found for prefs_enable_log (6620424505072963557) -->
+    <skip />
+    <!-- no translation found for prefs_description_log (5827825607258246003) -->
+    <skip />
+    <!-- no translation found for prefs_enable_recorrection (4966265843750259377) -->
+    <skip />
+    <!-- no translation found for prefs_enable_recorrection_summary (8181745740388568396) -->
+    <skip />
+    <!-- no translation found for keyboard_layout (437433231038683666) -->
+    <skip />
+    <!-- no translation found for subtype_mode_keyboard (2242090416595003881) -->
+    <skip />
+    <!-- no translation found for subtype_mode_voice (4394113125441627771) -->
+    <skip />
 </resources>
diff --git a/java/res/values/attrs.xml b/java/res/values/attrs.xml
index 995373e..318286e 100644
--- a/java/res/values/attrs.xml
+++ b/java/res/values/attrs.xml
@@ -69,4 +69,68 @@
 
     </declare-styleable>
 
+    <declare-styleable name="BaseKeyboard">
+        <!-- Default width of a key, in pixels or percentage of display width. -->
+        <attr name="keyWidth" format="dimension|fraction" />
+        <!-- Default height of a key, in pixels or percentage of display width. -->
+        <attr name="keyHeight" format="dimension|fraction" />
+        <!-- Default horizontal gap between keys. -->
+        <attr name="horizontalGap" format="dimension|fraction" />
+        <!-- Default vertical gap between rows of keys. -->
+        <attr name="verticalGap" format="dimension|fraction" />
+    </declare-styleable>
+
+    <declare-styleable name="BaseKeyboard_Key">
+        <!-- The unicode value or comma-separated values that this key outputs. -->
+        <attr name="codes" format="integer|string" />
+        <!-- The XML keyboard layout of any popup keyboard. -->
+        <attr name="popupKeyboard" format="reference" />
+        <!-- The characters to display in the popup keyboard. -->
+        <attr name="popupCharacters" format="string" />
+        <!-- Key edge flags. -->
+        <attr name="keyEdgeFlags">
+            <!-- Key is anchored to the left of the keyboard. -->
+            <flag name="left" value="1" />
+            <!-- Key is anchored to the right of the keyboard. -->
+            <flag name="right" value="2" />
+        </attr>
+        <!-- Whether this is a modifier key such as Alt or Shift. -->
+        <attr name="isModifier" format="boolean" />
+        <!-- Whether this is a toggle key. -->
+        <attr name="isSticky" format="boolean" />
+        <!-- Whether long-pressing on this key will make it repeat. -->
+        <attr name="isRepeatable" format="boolean" />
+        <!-- The icon to show in the popup preview. -->
+        <attr name="iconPreview" format="reference" />
+        <!-- The string of characters to output when this key is pressed. -->
+        <attr name="keyOutputText" format="string" />
+        <!-- The label to display on the key. -->
+        <attr name="keyLabel" format="string" />
+        <!-- The label to display on the key when keyboard is in temporary shift mode. -->
+        <attr name="temporaryShiftKeyLabel" format="string" />
+        <!-- The icon to display on the key instead of the label. -->
+        <attr name="keyIcon" format="reference" />
+        <!-- The hint icon to display on the key in conjunction with the label -->
+        <attr name="keyHintIcon" format="reference" />
+        <!-- Mode of the keyboard. If the mode doesn't match the
+             requested keyboard mode, the key will be skipped. -->
+        <attr name="keyboardMode" />
+    </declare-styleable>
+
+    <declare-styleable name="BaseKeyboard_Row">
+        <!-- Row edge flags. -->
+        <attr name="rowEdgeFlags">
+            <!-- Row is anchored to the top of the keyboard. -->
+            <flag name="top" value="4" />
+            <!-- Row is anchored to the bottom of the keyboard. -->
+            <flag name="bottom" value="8" />
+        </attr>
+        <!-- Mode of the keyboard. If the mode doesn't match the
+             requested keyboard mode, the row will be skipped. -->
+        <attr name="keyboardMode" format="reference" />
+    </declare-styleable>
+
+    <declare-styleable name="BaseKeyboard_Include">
+        <attr name="keyboardLayout" format="reference" />
+    </declare-styleable>
 </resources>
diff --git a/java/res/values/bools.xml b/java/res/values/bools.xml
index 5a24e4c..0497a6a 100644
--- a/java/res/values/bools.xml
+++ b/java/res/values/bools.xml
@@ -30,4 +30,7 @@
     <bool name="default_popup_preview">true</bool>
     <bool name="default_recorrection_enabled">true</bool>
     <bool name="config_long_press_comma_for_settings_enabled">true</bool>
+    <bool name="config_enable_show_settings_key_option">true</bool>
+    <bool name="config_dynamic_key_top_enter_key">true</bool>
+    <bool name="config_dynamic_key_top_symbol_key">true</bool>
 </resources>
diff --git a/java/res/values/config.xml b/java/res/values/config.xml
index edb6cd8..a1577e4 100644
--- a/java/res/values/config.xml
+++ b/java/res/values/config.xml
@@ -29,4 +29,14 @@
     <integer name="config_key_repeat_interval">50</integer>
     <integer name="config_long_press_key_timeout">400</integer>
     <integer name="config_multi_tap_key_timeout">800</integer>
+    <string-array name="auto_complete_threshold_values">
+        <!-- Off, When auto completing setting is Off, this value is not used. -->
+        <item></item>
+        <!-- Modest : Suggestion whose normalized score is greater than this value
+             will be subject to auto-completion. -->
+        <item>0.22</item>
+        <!-- Aggressive : Suggestion whose normalized score is greater than this value
+             will be subject to auto-completion. -->
+        <item>0</item>
+    </string-array>
 </resources>
diff --git a/java/res/values/dimens.xml b/java/res/values/dimens.xml
index c00c56a..765262d 100644
--- a/java/res/values/dimens.xml
+++ b/java/res/values/dimens.xml
@@ -22,19 +22,9 @@
     <!-- key_height + key_bottom_gap = popup_key_height -->
     <dimen name="key_height">0.290in</dimen>
     <dimen name="key_bottom_gap">0.035in</dimen>
+    <dimen name="key_horizontal_gap">0.000in</dimen>
     <dimen name="popup_key_height">0.325in</dimen>
     <dimen name="keyboard_bottom_padding">0.06in</dimen>
-    <dimen name="bubble_pointer_offset">22dip</dimen>
-    <dimen name="candidate_strip_height">42dip</dimen>
-    <dimen name="candidate_strip_fading_edge_length">63dip</dimen>
-    <dimen name="spacebar_vertical_correction">4dip</dimen>
-    <!-- If the screen height in landscape is larger than the below value, then the keyboard
-         will not go into extract (fullscreen) mode. -->
-    <dimen name="max_height_for_fullscreen">2.5in</dimen>
-    <dimen name="key_text_size">0.13in</dimen>
-    <dimen name="key_label_text_size">0.083in</dimen>
-    <dimen name="key_preview_text_size_large">0.236in</dimen>
-    <dimen name="key_preview_offset">0.000in</dimen>
     <!-- key_height x 1.6 -->
     <dimen name="key_preview_height">0.464in</dimen>
     <!-- Amount of allowance for selecting keys in a mini popup keyboard by sliding finger. -->
@@ -42,9 +32,23 @@
     <dimen name="mini_keyboard_slide_allowance">0.553in</dimen>
     <!-- popup_key_height x 1.0 -->
     <dimen name="mini_keyboard_vertical_correction">-0.325in</dimen>
-    <dimen name="key_hysteresis_distance">0.05in</dimen>
+
+    <dimen name="key_text_size">0.13in</dimen>
+    <dimen name="key_label_text_size">0.083in</dimen>
+    <dimen name="key_preview_text_size_large">0.236in</dimen>
+    <dimen name="key_preview_offset">0.000in</dimen>
     <!-- We use "inch", not "dip" because this value tries dealing with physical distance related
          to user's finger. -->
     <dimen name="keyboard_vertical_correction">-0.05in</dimen>
+
+    <dimen name="candidate_strip_height">42dip</dimen>
+    <dimen name="candidate_strip_fading_edge_length">63dip</dimen>
+    <dimen name="spacebar_vertical_correction">4dip</dimen>
+    <!-- If the screen height in landscape is larger than the below value, then the keyboard
+         will not go into extract (fullscreen) mode. -->
+    <dimen name="max_height_for_fullscreen">2.5in</dimen>
+    <dimen name="bubble_pointer_offset">22dip</dimen>
+
+    <dimen name="key_hysteresis_distance">0.05in</dimen>
     <dimen name="candidate_min_touchable_width">0.3in</dimen>
 </resources>
diff --git a/java/res/values/donottranslate.xml b/java/res/values/donottranslate.xml
index 9366099..a7c1fcd 100644
--- a/java/res/values/donottranslate.xml
+++ b/java/res/values/donottranslate.xml
@@ -23,7 +23,7 @@
     <!-- Symbols that are sentence separators, for purposes of making it hug the last sentence. -->
     <string name="sentence_separators">.,!?)</string>
     <!-- Symbols that are suggested between words -->
-    <string name="suggested_punctuations">!?,\u0022\u0027:()-/@_</string>
+    <string name="suggested_punctuations">!?,\u0022\u0027:();-/@_</string>
 
     <!-- Option values to show/hide the settings key in onscreen keyboard -->
     <!-- Automatically decide to show or hide the settings key -->
diff --git a/java/res/values/strings.xml b/java/res/values/strings.xml
index 6644d22..1f73b15 100644
--- a/java/res/values/strings.xml
+++ b/java/res/values/strings.xml
@@ -31,7 +31,7 @@
     <!-- Option to play back sound on keypress in soft keyboard -->
     <string name="sound_on_keypress">Sound on keypress</string>
 
-    <!-- Option to pop up the character with a larger font above soft keyboard -->
+    <!-- Option to control whether or not to show a popup with a larger font on each key press. -->
     <string name="popup_on_keypress">Popup on keypress</string>
 
     <!-- Option to enable using nearby keys when correcting/predicting -->
@@ -86,11 +86,6 @@
     <!-- Description for show suggestions -->
     <string name="show_suggestions_summary">Display suggested words while typing</string>
     
-    <!-- Option to enable auto completion -->
-    <string name="auto_complete">Auto-complete</string>
-    <!-- Description for auto completion -->
-    <string name="auto_complete_summary">Spacebar and punctuation automatically insert highlighted word</string>
-    
     <!-- Option to show/hide the settings key -->
     <string name="prefs_settings_key">Show settings key</string>
     <!-- Array of the settings key mode values -->
@@ -112,6 +107,31 @@
         <item>@string/settings_key_mode_always_hide_name</item>
     </string-array>
 
+    <!-- Option to decide the auto completion threshold score -->
+    <!-- Option to enable auto completion -->
+    <string name="auto_complete">Auto-complete</string>
+    <!-- Description for auto completion -->
+    <string name="auto_complete_summary">Spacebar and punctuation automatically insert highlighted word</string>
+    <string name="auto_completion_threshold_mode_value_off" translatable="false">0</string>
+    <string name="auto_completion_threshold_mode_value_modest" translatable="false">1</string>
+    <string name="auto_completion_threshold_mode_value_aggeressive" translatable="false">2</string>
+    <string-array name="auto_completion_threshold_mode_values" translatable="false">
+      <item>@string/auto_completion_threshold_mode_value_off</item>
+      <item>@string/auto_completion_threshold_mode_value_modest</item>
+      <item>@string/auto_completion_threshold_mode_value_aggeressive</item>
+    </string-array>
+    <!-- Option to disable auto completion. -->
+    <string name="auto_completion_threshold_mode_off">Off</string>
+    <!-- Option to use modest auto completion. -->
+    <string name="auto_completion_threshold_mode_modest">Modest</string>
+    <!-- Option to use aggressive auto completion. -->
+    <string name="auto_completion_threshold_mode_aggeressive">Aggressive</string>
+    <string-array name="auto_completion_threshold_modes">
+      <item>@string/auto_completion_threshold_mode_off</item>
+      <item>@string/auto_completion_threshold_mode_modest</item>
+      <item>@string/auto_completion_threshold_mode_aggeressive</item>
+    </string-array>
+
     <!-- Option to enable bigram completion -->
     <string name="bigram_suggestion">Bigram Suggestions</string>
     <!-- Description for auto completion -->
@@ -192,6 +212,14 @@
     <string name="label_alpha_key">ABC</string>
     <!-- Label for ALT modifier key.  Must be short to fit on key! -->
     <string name="label_alt_key">ALT</string>
+    <!-- Label for Shift modifier key of symbol keyboard.  Must be short to fit on key! -->
+    <string name="label_more_key">More</string>
+    <!-- Label for "Tab" key.  Must be short to fit on key! -->
+    <string name="label_tab_key">Tab</string>
+    <!-- Label for "Pause" key of phone number keyboard.  Must be short to fit on key! -->
+    <string name="label_pause_key">Pause</string>
+    <!-- Label for "Wait" key of phone number keyboard.  Must be short to fit on key! -->
+    <string name="label_wait_key">Wait</string>
 
     <!-- Voice related labels -->
 
diff --git a/java/res/xml-da/kbd_qwerty.xml b/java/res/xml-da/kbd_qwerty.xml
index b7b1b17..f1f9904 100644
--- a/java/res/xml-da/kbd_qwerty.xml
+++ b/java/res/xml-da/kbd_qwerty.xml
@@ -25,512 +25,155 @@
 -->
 
 <Keyboard
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    android:keyWidth="9.09%p"
-    android:horizontalGap="0px"
-    android:verticalGap="@dimen/key_bottom_gap"
-    android:keyHeight="@dimen/key_height"
+    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+    latin:keyWidth="9.09%p"
+    latin:horizontalGap="@dimen/key_horizontal_gap"
+    latin:verticalGap="@dimen/key_bottom_gap"
+    latin:keyHeight="@dimen/key_height"
 >
     <Row
-        android:rowEdgeFlags="top"
+        latin:rowEdgeFlags="top"
     >
         <Key
-            android:keyLabel="q"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_q"
-            android:keyWidth="8.75%p"
-            android:keyEdgeFlags="left" />
+            latin:keyLabel="q"
+            latin:keyHintIcon="@drawable/keyboard_hint_1"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_q"
+            latin:keyWidth="8.75%p"
+            latin:keyEdgeFlags="left" />
         <Key
-            android:keyLabel="w"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_w" />
+            latin:keyLabel="w"
+            latin:keyHintIcon="@drawable/keyboard_hint_2"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_w" />
         <Key
-            android:keyLabel="e"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_e" />
+            latin:keyLabel="e"
+            latin:keyHintIcon="@drawable/keyboard_hint_3"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_e" />
         <Key
-            android:keyLabel="r"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_r" />
+            latin:keyLabel="r"
+            latin:keyHintIcon="@drawable/keyboard_hint_4"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_r" />
         <Key
-            android:keyLabel="t"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_t" />
+            latin:keyLabel="t"
+            latin:keyHintIcon="@drawable/keyboard_hint_5"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_t" />
         <Key
-            android:keyLabel="y"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_y" />
+            latin:keyLabel="y"
+            latin:keyHintIcon="@drawable/keyboard_hint_6"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_y" />
         <Key
-            android:keyLabel="u"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_u" />
+            latin:keyLabel="u"
+            latin:keyHintIcon="@drawable/keyboard_hint_7"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_u" />
         <Key
-            android:keyLabel="i"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_i" />
+            latin:keyLabel="i"
+            latin:keyHintIcon="@drawable/keyboard_hint_8"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_i" />
         <Key
-            android:keyLabel="o"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_o" />
+            latin:keyLabel="o"
+            latin:keyHintIcon="@drawable/keyboard_hint_9"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_o" />
         <Key
-            android:keyLabel="p"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_p" />
+            latin:keyLabel="p"
+            latin:keyHintIcon="@drawable/keyboard_hint_0"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_p" />
         <Key
-            android:keyLabel="å"
-            android:keyWidth="8.75%p"
-            android:keyEdgeFlags="right" />
+            latin:keyLabel="å"
+            latin:keyWidth="8.75%p"
+            latin:keyEdgeFlags="right" />
     </Row>
     <Row>
         <Key
-            android:keyLabel="a"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_a"
-            android:keyWidth="8.75%p"
-            android:keyEdgeFlags="left" />
+            latin:keyLabel="a"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_a"
+            latin:keyWidth="8.75%p"
+            latin:keyEdgeFlags="left" />
         <Key
-            android:keyLabel="s"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_s" />
+            latin:keyLabel="s"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_s" />
         <Key
-            android:keyLabel="d"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_d" />
+            latin:keyLabel="d"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_d" />
         <Key
-            android:keyLabel="f" />
+            latin:keyLabel="f" />
         <Key
-            android:keyLabel="g"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_g" />
+            latin:keyLabel="g"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_g" />
         <Key
-            android:keyLabel="h" />
+            latin:keyLabel="h" />
         <Key
-            android:keyLabel="j" />
+            latin:keyLabel="j" />
         <Key
-            android:keyLabel="k" />
+            latin:keyLabel="k" />
         <Key
-            android:keyLabel="l"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_l" />
+            latin:keyLabel="l"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_l" />
         <Key
-            android:keyLabel="æ"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_ae" />
+            latin:keyLabel="æ"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_ae" />
         <Key
-            android:keyLabel="ø"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_oe"
-            android:keyWidth="8.75%p"
-            android:keyEdgeFlags="right" />
+            latin:keyLabel="ø"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_oe"
+            latin:keyWidth="8.75%p"
+            latin:keyEdgeFlags="right" />
     </Row>
     <Row
-        android:keyWidth="10%p"
+        latin:keyWidth="10%p"
     >
         <Key
-            android:codes="@integer/key_shift"
-            android:keyIcon="@drawable/sym_keyboard_shift"
-            android:iconPreview="@drawable/sym_keyboard_feedback_shift"
-            android:keyWidth="15%p"
-            android:isModifier="true"
-            android:isSticky="true"
-            android:keyEdgeFlags="left" />
+            latin:codes="@integer/key_shift"
+            latin:keyIcon="@drawable/sym_keyboard_shift"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_shift"
+            latin:keyWidth="15%p"
+            latin:isModifier="true"
+            latin:isSticky="true"
+            latin:keyEdgeFlags="left" />
         <Key
-            android:keyLabel="z"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_z" />
+            latin:keyLabel="z"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_z" />
         <Key
-            android:keyLabel="x" />
+            latin:keyLabel="x" />
         <Key
-            android:keyLabel="c"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_c" />
+            latin:keyLabel="c"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_c" />
         <Key
-            android:keyLabel="v"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_v" />
+            latin:keyLabel="v"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_v" />
         <Key
-            android:keyLabel="b" />
+            latin:keyLabel="b" />
         <Key
-            android:keyLabel="n"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_n" />
+            latin:keyLabel="n"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_n" />
         <Key
-            android:keyLabel="m" />
+            latin:keyLabel="m" />
         <Key
-            android:codes="@integer/key_delete"
-            android:keyIcon="@drawable/sym_keyboard_delete"
-            android:iconPreview="@drawable/sym_keyboard_feedback_delete"
-            android:keyWidth="15%p"
-            android:isModifier="true"
-            android:isRepeatable="true"
-            android:keyEdgeFlags="right" />
+            latin:codes="@integer/key_delete"
+            latin:keyIcon="@drawable/sym_keyboard_delete"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_delete"
+            latin:keyWidth="15%p"
+            latin:isModifier="true"
+            latin:isRepeatable="true"
+            latin:keyEdgeFlags="right" />
     </Row>
-    <Row
-        android:keyboardMode="@+id/mode_normal"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="40%p"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_keyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_url"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="40%p"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_keyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_email"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="40%p"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_keyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_im"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="40%p"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel=":-)"
-            android:keyOutputText=":-) "
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_smileys"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_webentry"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="20%p"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_tab"
-            android:keyIcon="@drawable/sym_keyboard_tab"
-            android:iconPreview="@drawable/sym_keyboard_feedback_tab"
-            android:keyWidth="20%p"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_keyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_normal_with_settings_key"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_keyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_keyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="25%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_url_with_settings_key"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_keyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_keyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="25%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_email_with_settings_key"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_keyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_keyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="25%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_im_with_settings_key"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_keyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel=":-)"
-            android:keyOutputText=":-) "
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_smileys"
-            android:keyWidth="25%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_webentry_with_settings_key"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_keyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_tab"
-            android:keyIcon="@drawable/sym_keyboard_tab"
-            android:iconPreview="@drawable/sym_keyboard_feedback_tab"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_keyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="15%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
+    <include latin:keyboardLayout="@xml/kbd_qwerty_row4" />
 </Keyboard>
diff --git a/java/res/xml-da/kbd_qwerty_black.xml b/java/res/xml-da/kbd_qwerty_black.xml
index 3fb4acd..b7ebc66 100644
--- a/java/res/xml-da/kbd_qwerty_black.xml
+++ b/java/res/xml-da/kbd_qwerty_black.xml
@@ -25,454 +25,154 @@
 -->
 
 <Keyboard
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    android:keyWidth="9.09%p"
-    android:horizontalGap="0px"
-    android:verticalGap="@dimen/key_bottom_gap"
-    android:keyHeight="@dimen/key_height"
+    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+    latin:keyWidth="9.09%p"
+    latin:horizontalGap="@dimen/key_horizontal_gap"
+    latin:verticalGap="@dimen/key_bottom_gap"
+    latin:keyHeight="@dimen/key_height"
 >
     <Row
-        android:rowEdgeFlags="top"
+        latin:rowEdgeFlags="top"
     >
         <Key
-            android:keyLabel="q"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_q"
-            android:keyWidth="8.75%p"
-            android:keyEdgeFlags="left" />
+            latin:keyLabel="q"
+            latin:keyHintIcon="@drawable/keyboard_hint_1"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_q"
+            latin:keyWidth="8.75%p"
+            latin:keyEdgeFlags="left" />
         <Key
-            android:keyLabel="w"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_w" />
+            latin:keyLabel="w"
+            latin:keyHintIcon="@drawable/keyboard_hint_2"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_w" />
         <Key
-            android:keyLabel="e"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_e" />
+            latin:keyLabel="e"
+            latin:keyHintIcon="@drawable/keyboard_hint_3"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_e" />
         <Key
-            android:keyLabel="r"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_r" />
+            latin:keyLabel="r"
+            latin:keyHintIcon="@drawable/keyboard_hint_4"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_r" />
         <Key
-            android:keyLabel="t"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_t" />
+            latin:keyLabel="t"
+            latin:keyHintIcon="@drawable/keyboard_hint_5"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_t" />
         <Key
-            android:keyLabel="y"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_y" />
+            latin:keyLabel="y"
+            latin:keyHintIcon="@drawable/keyboard_hint_6"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_y" />
         <Key
-            android:keyLabel="u"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_u" />
+            latin:keyLabel="u"
+            latin:keyHintIcon="@drawable/keyboard_hint_7"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_u" />
         <Key
-            android:keyLabel="i"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_i" />
+            latin:keyLabel="i"
+            latin:keyHintIcon="@drawable/keyboard_hint_8"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_i" />
         <Key
-            android:keyLabel="o"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_o" />
+            latin:keyLabel="o"
+            latin:keyHintIcon="@drawable/keyboard_hint_9"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_o" />
         <Key
-            android:keyLabel="p"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_p" />
+            latin:keyLabel="p"
+            latin:keyHintIcon="@drawable/keyboard_hint_0"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_p" />
         <Key
-            android:keyLabel="å"
-            android:keyWidth="8.75%p"
-            android:keyEdgeFlags="right" />
+            latin:keyLabel="å"
+            latin:keyWidth="8.75%p"
+            latin:keyEdgeFlags="right" />
     </Row>
     <Row>
         <Key
-            android:keyLabel="a"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_a"
-            android:keyWidth="8.75%p"
-            android:keyEdgeFlags="left" />
+            latin:keyLabel="a"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_a"
+            latin:keyWidth="8.75%p"
+            latin:keyEdgeFlags="left" />
         <Key
-            android:keyLabel="s"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_s" />
+            latin:keyLabel="s"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_s" />
         <Key
-            android:keyLabel="d"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_d" />
+            latin:keyLabel="d"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_d" />
         <Key
-            android:keyLabel="f" />
+            latin:keyLabel="f" />
         <Key
-            android:keyLabel="g"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_g" />
+            latin:keyLabel="g"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_g" />
         <Key
-            android:keyLabel="h" />
+            latin:keyLabel="h" />
         <Key
-            android:keyLabel="j" />
+            latin:keyLabel="j" />
         <Key
-            android:keyLabel="k" />
+            latin:keyLabel="k" />
         <Key
-            android:keyLabel="l"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_l" />
+            latin:keyLabel="l"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_l" />
         <Key
-            android:keyLabel="æ"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_ae" />
+            latin:keyLabel="æ"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_ae" />
         <Key
-            android:keyLabel="ø"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_oe"
-            android:keyWidth="8.75%p"
-            android:keyEdgeFlags="right" />
+            latin:keyLabel="ø"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_oe"
+            latin:keyWidth="8.75%p"
+            latin:keyEdgeFlags="right" />
     </Row>
     <Row
-        android:keyWidth="10%p"
+        latin:keyWidth="10%p"
     >
         <Key
-            android:codes="@integer/key_shift"
-            android:keyIcon="@drawable/sym_bkeyboard_shift"
-            android:iconPreview="@drawable/sym_keyboard_feedback_shift"
-            android:keyWidth="15%p"
-            android:isModifier="true"
-            android:isSticky="true"
-            android:keyEdgeFlags="left" />
+            latin:codes="@integer/key_shift"
+            latin:keyIcon="@drawable/sym_bkeyboard_shift"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_shift"
+            latin:keyWidth="15%p"
+            latin:isModifier="true"
+            latin:isSticky="true"
+            latin:keyEdgeFlags="left" />
         <Key
-            android:keyLabel="z"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_z" />
+            latin:keyLabel="z"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_z" />
         <Key
-            android:keyLabel="x" />
+            latin:keyLabel="x" />
         <Key
-            android:keyLabel="c"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_c" />
+            latin:keyLabel="c"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_c" />
         <Key
-            android:keyLabel="v"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_v" />
+            latin:keyLabel="v"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_v" />
         <Key
-            android:keyLabel="b" />
+            latin:keyLabel="b" />
         <Key
-            android:keyLabel="n"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_n" />
+            latin:keyLabel="n"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_n" />
         <Key
-            android:keyLabel="m" />
+            latin:keyLabel="m" />
         <Key
-            android:codes="@integer/key_delete"
-            android:keyIcon="@drawable/sym_bkeyboard_delete"
-            android:iconPreview="@drawable/sym_keyboard_feedback_delete"
-            android:keyWidth="15%p"
-            android:isRepeatable="true"
-            android:keyEdgeFlags="right" />
+            latin:codes="@integer/key_delete"
+            latin:keyIcon="@drawable/sym_bkeyboard_delete"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_delete"
+            latin:keyWidth="15%p"
+            latin:isRepeatable="true"
+            latin:keyEdgeFlags="right" />
     </Row>
-    <Row
-        android:keyboardMode="@+id/mode_normal"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="40%p" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_bkeyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_url"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="40%p" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_bkeyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_email"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="40%p" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_bkeyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_im"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="40%p" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:keyLabel=":-)"
-            android:keyOutputText=":-) "
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_smileys"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_webentry"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="20%p" />
-        <Key
-            android:codes="@integer/key_tab"
-            android:keyIcon="@drawable/sym_bkeyboard_tab"
-            android:iconPreview="@drawable/sym_keyboard_feedback_tab"
-            android:keyWidth="20%p" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_bkeyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_normal_with_settings_key"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_bkeyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_bkeyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="25%p"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_url_with_settings_key"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_bkeyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_bkeyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="25%p"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_email_with_settings_key"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_bkeyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_bkeyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="25%p"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_im_with_settings_key"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_bkeyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:keyLabel=":-)"
-            android:keyOutputText=":-) "
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_smileys"
-            android:keyWidth="25%p"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_webentry_with_settings_key"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_bkeyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p" />
-        <Key
-            android:codes="@integer/key_tab"
-            android:keyIcon="@drawable/sym_bkeyboard_tab"
-            android:iconPreview="@drawable/sym_keyboard_feedback_tab" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_bkeyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="15%p"
-            android:keyEdgeFlags="right" />
-    </Row>
+    <include latin:keyboardLayout="@xml/kbd_qwerty_black_row4" />
 </Keyboard>
diff --git a/java/res/xml-de/kbd_qwerty.xml b/java/res/xml-de/kbd_qwerty.xml
index 6f34b45..0832cbc 100644
--- a/java/res/xml-de/kbd_qwerty.xml
+++ b/java/res/xml-de/kbd_qwerty.xml
@@ -19,497 +19,141 @@
 -->
 
 <Keyboard
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    android:keyWidth="10%p"
-    android:horizontalGap="0px"
-    android:verticalGap="@dimen/key_bottom_gap"
-    android:keyHeight="@dimen/key_height"
+    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+    latin:keyWidth="10%p"
+    latin:horizontalGap="@dimen/key_horizontal_gap"
+    latin:verticalGap="@dimen/key_bottom_gap"
+    latin:keyHeight="@dimen/key_height"
 >
     <Row
-        android:rowEdgeFlags="top"
+        latin:rowEdgeFlags="top"
     >
         <Key
-            android:keyLabel="q"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_q"
-            android:keyEdgeFlags="left" />
+            latin:keyLabel="q"
+            latin:keyHintIcon="@drawable/keyboard_hint_1"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_q"
+            latin:keyEdgeFlags="left" />
         <Key
-            android:keyLabel="w"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_w" />
+            latin:keyLabel="w"
+            latin:keyHintIcon="@drawable/keyboard_hint_2"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_w" />
         <Key
-            android:keyLabel="e"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_e" />
+            latin:keyLabel="e"
+            latin:keyHintIcon="@drawable/keyboard_hint_3"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_e" />
         <Key
-            android:keyLabel="r"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_r" />
+            latin:keyLabel="r"
+            latin:keyHintIcon="@drawable/keyboard_hint_4"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_r" />
         <Key
-            android:keyLabel="t"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_t" />
+            latin:keyLabel="t"
+            latin:keyHintIcon="@drawable/keyboard_hint_5"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_t" />
         <Key
-            android:keyLabel="z"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_z" />
+            latin:keyLabel="z"
+            latin:keyHintIcon="@drawable/keyboard_hint_6"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_z" />
         <Key
-            android:keyLabel="u"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_u" />
+            latin:keyLabel="u"
+            latin:keyHintIcon="@drawable/keyboard_hint_7"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_u" />
         <Key
-            android:keyLabel="i"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_i" />
+            latin:keyLabel="i"
+            latin:keyHintIcon="@drawable/keyboard_hint_8"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_i" />
         <Key
-            android:keyLabel="o"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_o" />
+            latin:keyLabel="o"
+            latin:keyHintIcon="@drawable/keyboard_hint_9"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_o" />
         <Key
-            android:keyLabel="p"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_p"
-            android:keyEdgeFlags="right" />
+            latin:keyLabel="p"
+            latin:keyHintIcon="@drawable/keyboard_hint_0"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_p"
+            latin:keyEdgeFlags="right" />
+    </Row>
+    <Row>
+        <Spacer
+            latin:horizontalGap="5%p" />
+        <Key
+            latin:keyLabel="a"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_a"
+            latin:keyEdgeFlags="left" />
+        <Key
+            latin:keyLabel="s"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_s" />
+        <Key
+            latin:keyLabel="d"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_d" />
+        <Key
+            latin:keyLabel="f" />
+        <Key
+            latin:keyLabel="g"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_g" />
+        <Key
+            latin:keyLabel="h" />
+        <Key
+            latin:keyLabel="j" />
+        <Key
+            latin:keyLabel="k" />
+        <Key
+            latin:keyLabel="l"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_l"
+            latin:keyEdgeFlags="right" />
     </Row>
     <Row>
         <Key
-            android:keyLabel="a"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_a"
-            android:horizontalGap="5%p"
-            android:keyEdgeFlags="left" />
+            latin:codes="@integer/key_shift"
+            latin:keyIcon="@drawable/sym_keyboard_shift"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_shift"
+            latin:keyWidth="15%p"
+            latin:isModifier="true"
+            latin:isSticky="true"
+            latin:keyEdgeFlags="left" />
         <Key
-            android:keyLabel="s"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_s" />
+            latin:keyLabel="y"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_y" />
         <Key
-            android:keyLabel="d"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_d" />
+            latin:keyLabel="x" />
         <Key
-            android:keyLabel="f" />
+            latin:keyLabel="c"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_c" />
         <Key
-            android:keyLabel="g"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_g" />
+            latin:keyLabel="v"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_v" />
         <Key
-            android:keyLabel="h" />
+            latin:keyLabel="b" />
         <Key
-            android:keyLabel="j" />
+            latin:keyLabel="n"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_n" />
         <Key
-            android:keyLabel="k" />
+            latin:keyLabel="m" />
         <Key
-            android:keyLabel="l"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_l"
-            android:keyEdgeFlags="right" />
+            latin:codes="@integer/key_delete"
+            latin:keyIcon="@drawable/sym_keyboard_delete"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_delete"
+            latin:keyWidth="15%p"
+            latin:isModifier="true"
+            latin:isRepeatable="true"
+            latin:keyEdgeFlags="right" />
     </Row>
-    <Row>
-        <Key
-            android:codes="@integer/key_shift"
-            android:keyIcon="@drawable/sym_keyboard_shift"
-            android:iconPreview="@drawable/sym_keyboard_feedback_shift"
-            android:keyWidth="15%p"
-            android:isModifier="true"
-            android:isSticky="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:keyLabel="y"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_y" />
-        <Key
-            android:keyLabel="x" />
-        <Key
-            android:keyLabel="c"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_c" />
-        <Key
-            android:keyLabel="v"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_v" />
-        <Key
-            android:keyLabel="b" />
-        <Key
-            android:keyLabel="n"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_n" />
-        <Key
-            android:keyLabel="m" />
-        <Key
-            android:codes="@integer/key_delete"
-            android:keyIcon="@drawable/sym_keyboard_delete"
-            android:iconPreview="@drawable/sym_keyboard_feedback_delete"
-            android:keyWidth="15%p"
-            android:isModifier="true"
-            android:isRepeatable="true"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_normal"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="40%p"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_keyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_url"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="40%p"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_keyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_email"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="40%p"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_keyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_im"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="40%p"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel=":-)"
-            android:keyOutputText=":-) "
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_smileys"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_webentry"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="20%p"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_tab"
-            android:keyIcon="@drawable/sym_keyboard_tab"
-            android:iconPreview="@drawable/sym_keyboard_feedback_tab"
-            android:keyWidth="20%p"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_keyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_normal_with_settings_key"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_keyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_keyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="25%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_url_with_settings_key"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_keyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_keyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="25%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_email_with_settings_key"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_keyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_keyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="25%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_im_with_settings_key"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_keyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel=":-)"
-            android:keyOutputText=":-) "
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_smileys"
-            android:keyWidth="25%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_webentry_with_settings_key"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_keyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_tab"
-            android:keyIcon="@drawable/sym_keyboard_tab"
-            android:iconPreview="@drawable/sym_keyboard_feedback_tab"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_keyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="15%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
+    <include latin:keyboardLayout="@xml/kbd_qwerty_row4" />
 </Keyboard>
diff --git a/java/res/xml-de/kbd_qwerty_black.xml b/java/res/xml-de/kbd_qwerty_black.xml
index 8335370..13a7dcb 100644
--- a/java/res/xml-de/kbd_qwerty_black.xml
+++ b/java/res/xml-de/kbd_qwerty_black.xml
@@ -19,439 +19,140 @@
 -->
 
 <Keyboard
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    android:keyWidth="10%p"
-    android:horizontalGap="0px"
-    android:verticalGap="@dimen/key_bottom_gap"
-    android:keyHeight="@dimen/key_height"
+    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+    latin:keyWidth="10%p"
+    latin:horizontalGap="@dimen/key_horizontal_gap"
+    latin:verticalGap="@dimen/key_bottom_gap"
+    latin:keyHeight="@dimen/key_height"
 >
     <Row
-        android:rowEdgeFlags="top"
+        latin:rowEdgeFlags="top"
     >
         <Key
-            android:keyLabel="q"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_q"
-            android:keyEdgeFlags="left" />
+            latin:keyLabel="q"
+            latin:keyHintIcon="@drawable/keyboard_hint_1"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_q"
+            latin:keyEdgeFlags="left" />
         <Key
-            android:keyLabel="w"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_w" />
+            latin:keyLabel="w"
+            latin:keyHintIcon="@drawable/keyboard_hint_2"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_w" />
         <Key
-            android:keyLabel="e"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_e" />
+            latin:keyLabel="e"
+            latin:keyHintIcon="@drawable/keyboard_hint_3"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_e" />
         <Key
-            android:keyLabel="r"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_r" />
+            latin:keyLabel="r"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:keyHintIcon="@drawable/keyboard_hint_4"
+            latin:popupCharacters="@string/alternates_for_r" />
         <Key
-            android:keyLabel="t"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_t" />
+            latin:keyLabel="t"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:keyHintIcon="@drawable/keyboard_hint_5"
+            latin:popupCharacters="@string/alternates_for_t" />
         <Key
-            android:keyLabel="z"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_z" />
+            latin:keyLabel="z"
+            latin:keyHintIcon="@drawable/keyboard_hint_6"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_z" />
         <Key
-            android:keyLabel="u"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_u" />
+            latin:keyLabel="u"
+            latin:keyHintIcon="@drawable/keyboard_hint_7"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_u" />
         <Key
-            android:keyLabel="i"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_i" />
+            latin:keyLabel="i"
+            latin:keyHintIcon="@drawable/keyboard_hint_8"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_i" />
         <Key
-            android:keyLabel="o"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_o" />
+            latin:keyLabel="o"
+            latin:keyHintIcon="@drawable/keyboard_hint_9"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_o" />
         <Key
-            android:keyLabel="p"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_p"
-            android:keyEdgeFlags="right" />
+            latin:keyLabel="p"
+            latin:keyHintIcon="@drawable/keyboard_hint_0"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_p"
+            latin:keyEdgeFlags="right" />
+    </Row>
+    <Row>
+        <Spacer
+            latin:horizontalGap="5%p" />
+        <Key
+            latin:keyLabel="a"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_a"
+            latin:keyEdgeFlags="left" />
+        <Key
+            latin:keyLabel="s"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_s" />
+        <Key
+            latin:keyLabel="d"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_d" />
+        <Key
+            latin:keyLabel="f" />
+        <Key
+            latin:keyLabel="g"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_g" />
+        <Key
+            latin:keyLabel="h" />
+        <Key
+            latin:keyLabel="j" />
+        <Key
+            latin:keyLabel="k" />
+        <Key
+            latin:keyLabel="l"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_l"
+            latin:keyEdgeFlags="right" />
     </Row>
     <Row>
         <Key
-            android:keyLabel="a"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_a"
-            android:horizontalGap="5%p"
-            android:keyEdgeFlags="left" />
+            latin:codes="@integer/key_shift"
+            latin:keyIcon="@drawable/sym_bkeyboard_shift"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_shift"
+            latin:keyWidth="15%p"
+            latin:isModifier="true"
+            latin:isSticky="true"
+            latin:keyEdgeFlags="left" />
         <Key
-            android:keyLabel="s"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_s" />
+            latin:keyLabel="y"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_y" />
         <Key
-            android:keyLabel="d"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_d" />
+            latin:keyLabel="x" />
         <Key
-            android:keyLabel="f" />
+            latin:keyLabel="c"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_c" />
         <Key
-            android:keyLabel="g"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_g" />
+            latin:keyLabel="v"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_v" />
         <Key
-            android:keyLabel="h" />
+            latin:keyLabel="b" />
         <Key
-            android:keyLabel="j" />
+            latin:keyLabel="n"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_n" />
         <Key
-            android:keyLabel="k" />
+            latin:keyLabel="m" />
         <Key
-            android:keyLabel="l"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_l"
-            android:keyEdgeFlags="right" />
+            latin:codes="@integer/key_delete"
+            latin:keyIcon="@drawable/sym_bkeyboard_delete"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_delete"
+            latin:keyWidth="15%p"
+            latin:isRepeatable="true"
+            latin:keyEdgeFlags="right" />
     </Row>
-    <Row>
-        <Key
-            android:codes="@integer/key_shift"
-            android:keyIcon="@drawable/sym_bkeyboard_shift"
-            android:iconPreview="@drawable/sym_keyboard_feedback_shift"
-            android:keyWidth="15%p"
-            android:isModifier="true"
-            android:isSticky="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:keyLabel="y"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_y" />
-        <Key
-            android:keyLabel="x" />
-        <Key
-            android:keyLabel="c"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_c" />
-        <Key
-            android:keyLabel="v"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_v" />
-        <Key
-            android:keyLabel="b" />
-        <Key
-            android:keyLabel="n"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_n" />
-        <Key
-            android:keyLabel="m" />
-        <Key
-            android:codes="@integer/key_delete"
-            android:keyIcon="@drawable/sym_bkeyboard_delete"
-            android:iconPreview="@drawable/sym_keyboard_feedback_delete"
-            android:keyWidth="15%p"
-            android:isRepeatable="true"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_normal"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="40%p" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_bkeyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_url"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:keyLabel="/" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="40%p" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_bkeyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_email"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:keyLabel="\@" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="40%p" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_bkeyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_im"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="40%p" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:keyLabel=":-)"
-            android:keyOutputText=":-) "
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_smileys"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_webentry"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="20%p" />
-        <Key
-            android:codes="@integer/key_tab"
-            android:keyIcon="@drawable/sym_bkeyboard_tab"
-            android:iconPreview="@drawable/sym_keyboard_feedback_tab"
-            android:keyWidth="20%p" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_bkeyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_normal_with_settings_key"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_bkeyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_bkeyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="25%p"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_url_with_settings_key"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_bkeyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings" />
-        <Key
-            android:keyLabel="/" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_bkeyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="25%p"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_email_with_settings_key"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_bkeyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings" />
-        <Key
-            android:keyLabel="\@" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_bkeyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="25%p"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_im_with_settings_key"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_bkeyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:keyLabel=":-)"
-            android:keyOutputText=":-) "
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_smileys"
-            android:keyWidth="25%p"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_webentry_with_settings_key"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_bkeyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p" />
-        <Key
-            android:codes="@integer/key_tab"
-            android:keyIcon="@drawable/sym_bkeyboard_tab"
-            android:iconPreview="@drawable/sym_keyboard_feedback_tab" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_bkeyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="15%p"
-            android:keyEdgeFlags="right" />
-    </Row>
+    <include latin:keyboardLayout="@xml/kbd_qwerty_black_row4" />
 </Keyboard>
diff --git a/java/res/xml-fr/kbd_qwerty.xml b/java/res/xml-fr/kbd_qwerty.xml
index 9a2c75d..95c1073 100644
--- a/java/res/xml-fr/kbd_qwerty.xml
+++ b/java/res/xml-fr/kbd_qwerty.xml
@@ -19,498 +19,141 @@
 -->
 
 <Keyboard
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    android:keyWidth="10%p"
-    android:horizontalGap="0px"
-    android:verticalGap="@dimen/key_bottom_gap"
-    android:keyHeight="@dimen/key_height"
+    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+    latin:keyWidth="10%p"
+    latin:horizontalGap="@dimen/key_horizontal_gap"
+    latin:verticalGap="@dimen/key_bottom_gap"
+    latin:keyHeight="@dimen/key_height"
 >
     <Row
-        android:rowEdgeFlags="top"
+        latin:rowEdgeFlags="top"
     >
         <Key
-            android:keyLabel="a"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_a"
-            android:keyEdgeFlags="left" />
+            latin:keyLabel="a"
+            latin:keyHintIcon="@drawable/keyboard_hint_1"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_a"
+            latin:keyEdgeFlags="left" />
         <Key
-            android:keyLabel="z"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_z" />
+            latin:keyLabel="z"
+            latin:keyHintIcon="@drawable/keyboard_hint_2"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_z" />
         <Key
-            android:keyLabel="e"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_e" />
+            latin:keyLabel="e"
+            latin:keyHintIcon="@drawable/keyboard_hint_3"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_e" />
         <Key
-            android:keyLabel="r"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_r" />
+            latin:keyLabel="r"
+            latin:keyHintIcon="@drawable/keyboard_hint_4"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_r" />
         <Key
-            android:keyLabel="t"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_t" />
+            latin:keyLabel="t"
+            latin:keyHintIcon="@drawable/keyboard_hint_5"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_t" />
         <Key
-            android:keyLabel="y"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_y" />
+            latin:keyLabel="y"
+            latin:keyHintIcon="@drawable/keyboard_hint_6"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_y" />
         <Key
-            android:keyLabel="u"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_u" />
+            latin:keyLabel="u"
+            latin:keyHintIcon="@drawable/keyboard_hint_7"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_u" />
         <Key
-            android:keyLabel="i"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_i" />
+            latin:keyLabel="i"
+            latin:keyHintIcon="@drawable/keyboard_hint_8"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_i" />
         <Key
-            android:keyLabel="o"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_o" />
+            latin:keyLabel="o"
+            latin:keyHintIcon="@drawable/keyboard_hint_9"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_o" />
         <Key
-            android:keyLabel="p"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_p"
-            android:keyEdgeFlags="right" />
+            latin:keyLabel="p"
+            latin:keyHintIcon="@drawable/keyboard_hint_0"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_p"
+            latin:keyEdgeFlags="right" />
     </Row>
     <Row>
         <Key
-            android:keyLabel="q"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_q"
-            android:keyEdgeFlags="left" />
+            latin:keyLabel="q"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_q"
+            latin:keyEdgeFlags="left" />
         <Key
-            android:keyLabel="s"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_s" />
+            latin:keyLabel="s"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_s" />
         <Key
-            android:keyLabel="d"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_d" />
+            latin:keyLabel="d"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_d" />
         <Key
-            android:keyLabel="f" />
+            latin:keyLabel="f" />
         <Key
-            android:keyLabel="g"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_g" />
+            latin:keyLabel="g"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_g" />
         <Key
-            android:keyLabel="h" />
+            latin:keyLabel="h" />
         <Key
-            android:keyLabel="j" />
+            latin:keyLabel="j" />
         <Key
-            android:keyLabel="k" />
+            latin:keyLabel="k" />
         <Key
-            android:keyLabel="l"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_l" />
+            latin:keyLabel="l"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_l" />
         <Key
-            android:keyLabel="m"
-            android:keyEdgeFlags="right" />
+            latin:keyLabel="m"
+            latin:keyEdgeFlags="right" />
     </Row>
     <Row>
         <Key
-            android:codes="@integer/key_shift"
-            android:keyIcon="@drawable/sym_keyboard_shift"
-            android:iconPreview="@drawable/sym_keyboard_feedback_shift"
-            android:keyWidth="15%p"
-            android:isModifier="true"
-            android:isSticky="true"
-            android:keyEdgeFlags="left" />
+            latin:codes="@integer/key_shift"
+            latin:keyIcon="@drawable/sym_keyboard_shift"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_shift"
+            latin:keyWidth="15%p"
+            latin:isModifier="true"
+            latin:isSticky="true"
+            latin:keyEdgeFlags="left" />
         <Key
-            android:keyLabel="w"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_w" />
+            latin:keyLabel="w"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_w" />
         <Key
-            android:keyLabel="x" />
+            latin:keyLabel="x" />
         <Key
-            android:keyLabel="c"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_c" />
+            latin:keyLabel="c"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_c" />
         <Key
-            android:keyLabel="v"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_v" />
+            latin:keyLabel="v"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_v" />
         <Key
-            android:keyLabel="b" />
+            latin:keyLabel="b" />
         <Key
-            android:keyLabel="n"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_n" />
+            latin:keyLabel="n"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_n" />
         <Key
-            android:keyLabel="\'" />
+            latin:keyLabel="\'" />
         <Key
-            android:codes="@integer/key_delete"
-            android:keyIcon="@drawable/sym_keyboard_delete"
-            android:iconPreview="@drawable/sym_keyboard_feedback_delete"
-            android:keyWidth="15%p"
-            android:isModifier="true"
-            android:isRepeatable="true"
-            android:keyEdgeFlags="right" />
+            latin:codes="@integer/key_delete"
+            latin:keyIcon="@drawable/sym_keyboard_delete"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_delete"
+            latin:keyWidth="15%p"
+            latin:isModifier="true"
+            latin:isRepeatable="true"
+            latin:keyEdgeFlags="right" />
     </Row>
-    <Row
-        android:keyboardMode="@+id/mode_normal"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="40%p"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_keyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_url"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="40%p"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_keyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_email"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="40%p"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_keyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_im"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="40%p"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel=":-)"
-            android:keyOutputText=":-) "
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_smileys"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_webentry"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="20%p"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_tab"
-            android:keyIcon="@drawable/sym_keyboard_tab"
-            android:iconPreview="@drawable/sym_keyboard_feedback_tab"
-            android:keyWidth="20%p"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_keyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_normal_with_settings_key"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_keyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_keyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="25%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_url_with_settings_key"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_keyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_keyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="25%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_email_with_settings_key"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_keyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_keyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="25%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_im_with_settings_key"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_keyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel=":-)"
-            android:keyOutputText=":-) "
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_smileys"
-            android:keyWidth="25%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_webentry_with_settings_key"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_keyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_tab"
-            android:keyIcon="@drawable/sym_keyboard_tab"
-            android:iconPreview="@drawable/sym_keyboard_feedback_tab"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_keyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="15%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
+    <include latin:keyboardLayout="@xml/kbd_qwerty_row4" />
 </Keyboard>
diff --git a/java/res/xml-fr/kbd_qwerty_black.xml b/java/res/xml-fr/kbd_qwerty_black.xml
index f11c4a0..b46ce9c 100644
--- a/java/res/xml-fr/kbd_qwerty_black.xml
+++ b/java/res/xml-fr/kbd_qwerty_black.xml
@@ -19,440 +19,140 @@
 -->
 
 <Keyboard
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    android:keyWidth="10%p"
-    android:horizontalGap="0px"
-    android:verticalGap="@dimen/key_bottom_gap"
-    android:keyHeight="@dimen/key_height"
+    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+    latin:keyWidth="10%p"
+    latin:horizontalGap="@dimen/key_horizontal_gap"
+    latin:verticalGap="@dimen/key_bottom_gap"
+    latin:keyHeight="@dimen/key_height"
 >
     <Row
-        android:rowEdgeFlags="top"
+        latin:rowEdgeFlags="top"
     >
         <Key
-            android:keyLabel="a"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_a"
-            android:keyEdgeFlags="left" />
+            latin:keyLabel="a"
+            latin:keyHintIcon="@drawable/keyboard_hint_1"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_a"
+            latin:keyEdgeFlags="left" />
         <Key
-            android:keyLabel="z"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_z" />
+            latin:keyLabel="z"
+            latin:keyHintIcon="@drawable/keyboard_hint_2"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_z" />
         <Key
-            android:keyLabel="e"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_e" />
+            latin:keyLabel="e"
+            latin:keyHintIcon="@drawable/keyboard_hint_3"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_e" />
         <Key
-            android:keyLabel="r"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_r" />
+            latin:keyLabel="r"
+            latin:keyHintIcon="@drawable/keyboard_hint_4"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_r" />
         <Key
-            android:keyLabel="t"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_t" />
+            latin:keyLabel="t"
+            latin:keyHintIcon="@drawable/keyboard_hint_5"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_t" />
         <Key
-            android:keyLabel="y"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_y" />
+            latin:keyLabel="y"
+            latin:keyHintIcon="@drawable/keyboard_hint_6"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_y" />
         <Key
-            android:keyLabel="u"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_u" />
+            latin:keyLabel="u"
+            latin:keyHintIcon="@drawable/keyboard_hint_7"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_u" />
         <Key
-            android:keyLabel="i"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_i" />
+            latin:keyLabel="i"
+            latin:keyHintIcon="@drawable/keyboard_hint_8"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_i" />
         <Key
-            android:keyLabel="o"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_o" />
+            latin:keyLabel="o"
+            latin:keyHintIcon="@drawable/keyboard_hint_9"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_o" />
         <Key
-            android:keyLabel="p"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_p"
-            android:keyEdgeFlags="right" />
+            latin:keyLabel="p"
+            latin:keyHintIcon="@drawable/keyboard_hint_0"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_p"
+            latin:keyEdgeFlags="right" />
     </Row>
     <Row>
         <Key
-            android:keyLabel="q"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_q"
-            android:keyEdgeFlags="left" />
+            latin:keyLabel="q"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_q"
+            latin:keyEdgeFlags="left" />
         <Key
-            android:keyLabel="s"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_s" />
+            latin:keyLabel="s"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_s" />
         <Key
-            android:keyLabel="d"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_d" />
+            latin:keyLabel="d"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_d" />
         <Key
-            android:keyLabel="f" />
+            latin:keyLabel="f" />
         <Key
-            android:keyLabel="g"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_g" />
+            latin:keyLabel="g"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_g" />
         <Key
-            android:keyLabel="h" />
+            latin:keyLabel="h" />
         <Key
-            android:keyLabel="j" />
+            latin:keyLabel="j" />
         <Key
-            android:keyLabel="k" />
+            latin:keyLabel="k" />
         <Key
-            android:keyLabel="l"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_l" />
+            latin:keyLabel="l"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_l" />
         <Key
-            android:keyLabel="m"
-            android:keyEdgeFlags="right" />
+            latin:keyLabel="m"
+            latin:keyEdgeFlags="right" />
     </Row>
     <Row>
         <Key
-            android:codes="@integer/key_shift"
-            android:keyIcon="@drawable/sym_bkeyboard_shift"
-            android:iconPreview="@drawable/sym_keyboard_feedback_shift"
-            android:keyWidth="15%p"
-            android:isModifier="true"
-            android:isSticky="true"
-            android:keyEdgeFlags="left" />
+            latin:codes="@integer/key_shift"
+            latin:keyIcon="@drawable/sym_bkeyboard_shift"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_shift"
+            latin:keyWidth="15%p"
+            latin:isModifier="true"
+            latin:isSticky="true"
+            latin:keyEdgeFlags="left" />
         <Key
-            android:keyLabel="w"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_w" />
+            latin:keyLabel="w"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_w" />
         <Key
-            android:keyLabel="x" />
+            latin:keyLabel="x" />
         <Key
-            android:keyLabel="c"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_c" />
+            latin:keyLabel="c"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_c" />
         <Key
-            android:keyLabel="v"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_v" />
+            latin:keyLabel="v"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_v" />
         <Key
-            android:keyLabel="b" />
+            latin:keyLabel="b" />
         <Key
-            android:keyLabel="n"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_n" />
+            latin:keyLabel="n"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_n" />
         <Key
-            android:keyLabel="\'" />
+            latin:keyLabel="\'" />
         <Key
-            android:codes="@integer/key_delete"
-            android:keyIcon="@drawable/sym_bkeyboard_delete"
-            android:iconPreview="@drawable/sym_keyboard_feedback_delete"
-            android:keyWidth="15%p"
-            android:isRepeatable="true"
-            android:keyEdgeFlags="right" />
+            latin:codes="@integer/key_delete"
+            latin:keyIcon="@drawable/sym_bkeyboard_delete"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_delete"
+            latin:keyWidth="15%p"
+            latin:isRepeatable="true"
+            latin:keyEdgeFlags="right" />
     </Row>
-    <Row
-        android:keyboardMode="@+id/mode_normal"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="40%p" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_bkeyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_url"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="40%p" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_bkeyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_email"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="40%p" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_bkeyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_im"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="40%p" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:keyLabel=":-)"
-            android:keyOutputText=":-) "
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_smileys"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_webentry"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="20%p" />
-        <Key
-            android:codes="@integer/key_tab"
-            android:keyIcon="@drawable/sym_bkeyboard_tab"
-            android:iconPreview="@drawable/sym_keyboard_feedback_tab"
-            android:keyWidth="20%p" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_bkeyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_normal_with_settings_key"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_bkeyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_bkeyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="25%p"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_url_with_settings_key"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_bkeyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_bkeyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="25%p"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_email_with_settings_key"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_bkeyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_bkeyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="25%p"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_im_with_settings_key"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_bkeyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:keyLabel=":-)"
-            android:keyOutputText=":-) "
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_smileys"
-            android:keyWidth="25%p"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_webentry_with_settings_key"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_bkeyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p" />
-        <Key
-            android:codes="@integer/key_tab"
-            android:keyIcon="@drawable/sym_bkeyboard_tab"
-            android:iconPreview="@drawable/sym_keyboard_feedback_tab" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_bkeyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="15%p"
-            android:keyEdgeFlags="right" />
-    </Row>
+    <include latin:keyboardLayout="@xml/kbd_qwerty_black_row4" />
 </Keyboard>
diff --git a/java/res/xml-iw/kbd_qwerty.xml b/java/res/xml-iw/kbd_qwerty.xml
index 5d8338a..fd94a12 100644
--- a/java/res/xml-iw/kbd_qwerty.xml
+++ b/java/res/xml-iw/kbd_qwerty.xml
@@ -19,456 +19,92 @@
 -->
 
 <Keyboard
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    android:keyWidth="10%p"
-    android:horizontalGap="0px"
-    android:verticalGap="@dimen/key_bottom_gap"
-    android:keyHeight="@dimen/key_height"
+    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+    latin:keyWidth="10%p"
+    latin:horizontalGap="@dimen/key_horizontal_gap"
+    latin:verticalGap="@dimen/key_bottom_gap"
+    latin:keyHeight="@dimen/key_height"
 >
     <Row
-        android:rowEdgeFlags="top"
+        latin:rowEdgeFlags="top"
     >
+        <Spacer
+            latin:horizontalGap="5%p" />
         <Key
-            android:keyLabel="ק"
-            android:horizontalGap="5%p"
-            android:keyEdgeFlags="left" />
+            latin:keyLabel="ק"
+            latin:keyEdgeFlags="left" />
         <Key
-            android:keyLabel="ר" />
+            latin:keyLabel="ר" />
         <Key
-            android:keyLabel="א" />
+            latin:keyLabel="א" />
         <Key
-            android:keyLabel="ט" />
+            latin:keyLabel="ט" />
         <Key
-            android:keyLabel="ו" />
+            latin:keyLabel="ו" />
         <Key
-            android:keyLabel="ן" />
+            latin:keyLabel="ן" />
         <Key
-            android:keyLabel="ם" />
+            latin:keyLabel="ם" />
         <Key
-            android:keyLabel="פ" />
+            latin:keyLabel="פ" />
+        <Spacer
+            latin:horizontalGap="1.25%p" />
         <Key
-            android:codes="@integer/key_delete"
-            android:keyIcon="@drawable/sym_keyboard_delete"
-            android:iconPreview="@drawable/sym_keyboard_feedback_delete"
-            android:keyWidth="13.75%p"
-            android:isModifier="true"
-            android:horizontalGap="1.25%p"
-            android:isRepeatable="true"
-            android:keyEdgeFlags="right" />
+            latin:codes="@integer/key_delete"
+            latin:keyIcon="@drawable/sym_keyboard_delete"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_delete"
+            latin:keyWidth="13.75%p"
+            latin:isModifier="true"
+            latin:isRepeatable="true"
+            latin:keyEdgeFlags="right" />
     </Row>
     <Row>
         <Key
-            android:keyLabel="ש"
-            android:keyEdgeFlags="left" />
+            latin:keyLabel="ש"
+            latin:keyEdgeFlags="left" />
         <Key
-            android:keyLabel="ד" />
+            latin:keyLabel="ד" />
         <Key
-            android:keyLabel="ג" />
+            latin:keyLabel="ג" />
         <Key
-            android:keyLabel="כ" />
+            latin:keyLabel="כ" />
         <Key
-            android:keyLabel="ע" />
+            latin:keyLabel="ע" />
         <Key
-            android:keyLabel="י" />
+            latin:keyLabel="י" />
         <Key
-            android:keyLabel="ח" />
+            latin:keyLabel="ח" />
         <Key
-            android:keyLabel="ל" />
+            latin:keyLabel="ל" />
         <Key
-            android:keyLabel="ך" />
+            latin:keyLabel="ך" />
         <Key
-            android:keyLabel="ף"
-            android:keyEdgeFlags="right" />
+            latin:keyLabel="ף"
+            latin:keyEdgeFlags="right" />
     </Row>
     <Row>
+        <Spacer
+            latin:horizontalGap="5%p" />
         <Key
-            android:keyLabel="ז"
-            android:horizontalGap="5%p"
-            android:keyEdgeFlags="left" />
+            latin:keyLabel="ז"
+            latin:keyEdgeFlags="left" />
         <Key
-            android:keyLabel="ס" />
+            latin:keyLabel="ס" />
         <Key
-            android:keyLabel="ב" />
+            latin:keyLabel="ב" />
         <Key
-            android:keyLabel="ה" />
+            latin:keyLabel="ה" />
         <Key
-            android:keyLabel="נ" />
+            latin:keyLabel="נ" />
         <Key
-            android:keyLabel="מ" />
+            latin:keyLabel="מ" />
         <Key
-            android:keyLabel="צ" />
+            latin:keyLabel="צ" />
         <Key
-            android:keyLabel="ת" />
+            latin:keyLabel="ת" />
         <Key
-            android:keyLabel="ץ"
-            android:keyEdgeFlags="right" />
+            latin:keyLabel="ץ"
+            latin:keyEdgeFlags="right" />
     </Row>
-    <Row
-        android:keyboardMode="@+id/mode_normal"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="40%p"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_keyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_url"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="40%p"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_keyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_email"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="40%p"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_keyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_im"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="40%p"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel=":-)"
-            android:keyOutputText=":-) "
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_smileys"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_webentry"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="20%p"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_tab"
-            android:keyIcon="@drawable/sym_keyboard_tab"
-            android:iconPreview="@drawable/sym_keyboard_feedback_tab"
-            android:keyWidth="20%p"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_keyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_normal_with_settings_key"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_keyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_keyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="25%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_url_with_settings_key"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_keyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_keyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="25%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_email_with_settings_key"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_keyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_keyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="25%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_im_with_settings_key"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_keyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel=":-)"
-            android:keyOutputText=":-) "
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_smileys"
-            android:keyWidth="25%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_webentry_with_settings_key"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_keyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_tab"
-            android:keyIcon="@drawable/sym_keyboard_tab"
-            android:iconPreview="@drawable/sym_keyboard_feedback_tab"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_keyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="15%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
+    <include latin:keyboardLayout="@xml/kbd_qwerty_row4" />
 </Keyboard>
diff --git a/java/res/xml-iw/kbd_qwerty_black.xml b/java/res/xml-iw/kbd_qwerty_black.xml
index eee6dc1..1c1c1e3 100644
--- a/java/res/xml-iw/kbd_qwerty_black.xml
+++ b/java/res/xml-iw/kbd_qwerty_black.xml
@@ -19,398 +19,91 @@
 -->
 
 <Keyboard
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    android:keyWidth="10%p"
-    android:horizontalGap="0px"
-    android:verticalGap="@dimen/key_bottom_gap"
-    android:keyHeight="@dimen/key_height"
+    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+    latin:keyWidth="10%p"
+    latin:horizontalGap="@dimen/key_horizontal_gap"
+    latin:verticalGap="@dimen/key_bottom_gap"
+    latin:keyHeight="@dimen/key_height"
 >
     <Row
-        android:rowEdgeFlags="top"
+        latin:rowEdgeFlags="top"
     >
+        <Spacer
+            latin:horizontalGap="5%p" />
         <Key
-            android:keyLabel="ק"
-            android:horizontalGap="5%p"
-            android:keyEdgeFlags="left" />
+            latin:keyLabel="ק"
+            latin:keyEdgeFlags="left" />
         <Key
-            android:keyLabel="ר" />
+            latin:keyLabel="ר" />
         <Key
-            android:keyLabel="א" />
+            latin:keyLabel="א" />
         <Key
-            android:keyLabel="ט" />
+            latin:keyLabel="ט" />
         <Key
-            android:keyLabel="ו" />
+            latin:keyLabel="ו" />
         <Key
-            android:keyLabel="ן" />
+            latin:keyLabel="ן" />
         <Key
-            android:keyLabel="ם" />
+            latin:keyLabel="ם" />
         <Key
-            android:keyLabel="פ" />
+            latin:keyLabel="פ" />
+        <Spacer
+            latin:horizontalGap="1.25%p" />
         <Key
-            android:codes="@integer/key_delete"
-            android:keyIcon="@drawable/sym_bkeyboard_delete"
-            android:iconPreview="@drawable/sym_keyboard_feedback_delete"
-            android:keyWidth="13.75%p"
-            android:horizontalGap="1.25%p"
-            android:isRepeatable="true"
-            android:keyEdgeFlags="right" />
+            latin:codes="@integer/key_delete"
+            latin:keyIcon="@drawable/sym_bkeyboard_delete"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_delete"
+            latin:keyWidth="13.75%p"
+            latin:isRepeatable="true"
+            latin:keyEdgeFlags="right" />
     </Row>
     <Row>
         <Key
-            android:keyLabel="ש"
-            android:keyEdgeFlags="left" />
+            latin:keyLabel="ש"
+            latin:keyEdgeFlags="left" />
         <Key
-            android:keyLabel="ד" />
+            latin:keyLabel="ד" />
         <Key
-            android:keyLabel="ג" />
+            latin:keyLabel="ג" />
         <Key
-            android:keyLabel="כ" />
+            latin:keyLabel="כ" />
         <Key
-            android:keyLabel="ע" />
+            latin:keyLabel="ע" />
         <Key
-            android:keyLabel="י" />
+            latin:keyLabel="י" />
         <Key
-            android:keyLabel="ח" />
+            latin:keyLabel="ח" />
         <Key
-            android:keyLabel="ל" />
+            latin:keyLabel="ל" />
         <Key
-            android:keyLabel="ך" />
+            latin:keyLabel="ך" />
         <Key
-            android:keyLabel="ף"
-            android:keyEdgeFlags="right" />
+            latin:keyLabel="ף"
+            latin:keyEdgeFlags="right" />
     </Row>
     <Row>
+        <Spacer
+            latin:horizontalGap="5%p" />
         <Key
-            android:keyLabel="ז"
-            android:horizontalGap="5%p"
-            android:keyEdgeFlags="left" />
+            latin:keyLabel="ז"
+            latin:keyEdgeFlags="left" />
         <Key
-            android:keyLabel="ס" />
+            latin:keyLabel="ס" />
         <Key
-            android:keyLabel="ב" />
+            latin:keyLabel="ב" />
         <Key
-            android:keyLabel="ה" />
+            latin:keyLabel="ה" />
         <Key
-            android:keyLabel="נ" />
+            latin:keyLabel="נ" />
         <Key
-            android:keyLabel="מ" />
+            latin:keyLabel="מ" />
         <Key
-            android:keyLabel="צ" />
+            latin:keyLabel="צ" />
         <Key
-            android:keyLabel="ת" />
+            latin:keyLabel="ת" />
         <Key
-            android:keyLabel="ץ"
-            android:keyEdgeFlags="right" />
+            latin:keyLabel="ץ"
+            latin:keyEdgeFlags="right" />
     </Row>
-    <Row
-        android:keyboardMode="@+id/mode_normal"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="40%p" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_bkeyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_url"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="40%p" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_bkeyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_email"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="40%p" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_bkeyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_im"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="40%p" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:keyLabel=":-)"
-            android:keyOutputText=":-) "
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_smileys"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_webentry"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="20%p" />
-        <Key
-            android:codes="@integer/key_tab"
-            android:keyIcon="@drawable/sym_bkeyboard_tab"
-            android:iconPreview="@drawable/sym_keyboard_feedback_tab"
-            android:keyWidth="20%p" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_bkeyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_normal_with_settings_key"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_bkeyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_bkeyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="25%p"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_url_with_settings_key"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_bkeyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_bkeyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="25%p"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_email_with_settings_key"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_bkeyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_bkeyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="25%p"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_im_with_settings_key"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_bkeyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:keyLabel=":-)"
-            android:keyOutputText=":-) "
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_smileys"
-            android:keyWidth="25%p"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_webentry_with_settings_key"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_bkeyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p" />
-        <Key
-            android:codes="@integer/key_tab"
-            android:keyIcon="@drawable/sym_bkeyboard_tab"
-            android:iconPreview="@drawable/sym_keyboard_feedback_tab" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_bkeyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="15%p"
-            android:keyEdgeFlags="right" />
-    </Row>
+    <include latin:keyboardLayout="@xml/kbd_qwerty_black_row4" />
 </Keyboard>
diff --git a/java/res/xml-nb/kbd_qwerty.xml b/java/res/xml-nb/kbd_qwerty.xml
index 14071d7..32512da 100644
--- a/java/res/xml-nb/kbd_qwerty.xml
+++ b/java/res/xml-nb/kbd_qwerty.xml
@@ -25,512 +25,155 @@
 -->
 
 <Keyboard
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    android:keyWidth="9.09%p"
-    android:horizontalGap="0px"
-    android:verticalGap="@dimen/key_bottom_gap"
-    android:keyHeight="@dimen/key_height"
+    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+    latin:keyWidth="9.09%p"
+    latin:horizontalGap="@dimen/key_horizontal_gap"
+    latin:verticalGap="@dimen/key_bottom_gap"
+    latin:keyHeight="@dimen/key_height"
 >
     <Row
-        android:rowEdgeFlags="top"
+        latin:rowEdgeFlags="top"
     >
         <Key
-            android:keyLabel="q"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_q"
-            android:keyWidth="8.75%p"
-            android:keyEdgeFlags="left" />
+            latin:keyLabel="q"
+            latin:keyHintIcon="@drawable/keyboard_hint_1"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_q"
+            latin:keyWidth="8.75%p"
+            latin:keyEdgeFlags="left" />
         <Key
-            android:keyLabel="w"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_w" />
+            latin:keyLabel="w"
+            latin:keyHintIcon="@drawable/keyboard_hint_2"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_w" />
         <Key
-            android:keyLabel="e"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_e" />
+            latin:keyLabel="e"
+            latin:keyHintIcon="@drawable/keyboard_hint_3"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_e" />
         <Key
-            android:keyLabel="r"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_r" />
+            latin:keyLabel="r"
+            latin:keyHintIcon="@drawable/keyboard_hint_4"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_r" />
         <Key
-            android:keyLabel="t"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_t" />
+            latin:keyLabel="t"
+            latin:keyHintIcon="@drawable/keyboard_hint_5"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_t" />
         <Key
-            android:keyLabel="y"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_y" />
+            latin:keyLabel="y"
+            latin:keyHintIcon="@drawable/keyboard_hint_6"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_y" />
         <Key
-            android:keyLabel="u"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_u" />
+            latin:keyLabel="u"
+            latin:keyHintIcon="@drawable/keyboard_hint_7"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_u" />
         <Key
-            android:keyLabel="i"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_i" />
+            latin:keyLabel="i"
+            latin:keyHintIcon="@drawable/keyboard_hint_8"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_i" />
         <Key
-            android:keyLabel="o"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_o" />
+            latin:keyLabel="o"
+            latin:keyHintIcon="@drawable/keyboard_hint_9"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_o" />
         <Key
-            android:keyLabel="p"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_p" />
+            latin:keyLabel="p"
+            latin:keyHintIcon="@drawable/keyboard_hint_0"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_p" />
         <Key
-            android:keyLabel="å"
-            android:keyWidth="8.75%p"
-            android:keyEdgeFlags="right" />
+            latin:keyLabel="å"
+            latin:keyWidth="8.75%p"
+            latin:keyEdgeFlags="right" />
     </Row>
     <Row>
         <Key
-            android:keyLabel="a"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_a"
-            android:keyWidth="8.75%p"
-            android:keyEdgeFlags="left" />
+            latin:keyLabel="a"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_a"
+            latin:keyWidth="8.75%p"
+            latin:keyEdgeFlags="left" />
         <Key
-            android:keyLabel="s"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_s" />
+            latin:keyLabel="s"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_s" />
         <Key
-            android:keyLabel="d"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_d" />
+            latin:keyLabel="d"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_d" />
         <Key
-            android:keyLabel="f" />
+            latin:keyLabel="f" />
         <Key
-            android:keyLabel="g"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_g" />
+            latin:keyLabel="g"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_g" />
         <Key
-            android:keyLabel="h" />
+            latin:keyLabel="h" />
         <Key
-            android:keyLabel="j" />
+            latin:keyLabel="j" />
         <Key
-            android:keyLabel="k" />
+            latin:keyLabel="k" />
         <Key
-            android:keyLabel="l"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_l" />
+            latin:keyLabel="l"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_l" />
         <Key
-            android:keyLabel="ø"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_oe" />
+            latin:keyLabel="ø"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_oe" />
         <Key
-            android:keyLabel="æ"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_ae"
-            android:keyWidth="8.75%p"
-            android:keyEdgeFlags="right" />
+            latin:keyLabel="æ"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_ae"
+            latin:keyWidth="8.75%p"
+            latin:keyEdgeFlags="right" />
     </Row>
     <Row
-        android:keyWidth="10%p"
+        latin:keyWidth="10%p"
     >
         <Key
-            android:codes="@integer/key_shift"
-            android:keyIcon="@drawable/sym_keyboard_shift"
-            android:iconPreview="@drawable/sym_keyboard_feedback_shift"
-            android:keyWidth="15%p"
-            android:isModifier="true"
-            android:isSticky="true"
-            android:keyEdgeFlags="left" />
+            latin:codes="@integer/key_shift"
+            latin:keyIcon="@drawable/sym_keyboard_shift"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_shift"
+            latin:keyWidth="15%p"
+            latin:isModifier="true"
+            latin:isSticky="true"
+            latin:keyEdgeFlags="left" />
         <Key
-            android:keyLabel="z"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_z" />
+            latin:keyLabel="z"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_z" />
         <Key
-            android:keyLabel="x" />
+            latin:keyLabel="x" />
         <Key
-            android:keyLabel="c"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_c" />
+            latin:keyLabel="c"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_c" />
         <Key
-            android:keyLabel="v"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_v" />
+            latin:keyLabel="v"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_v" />
         <Key
-            android:keyLabel="b" />
+            latin:keyLabel="b" />
         <Key
-            android:keyLabel="n"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_n" />
+            latin:keyLabel="n"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_n" />
         <Key
-            android:keyLabel="m" />
+            latin:keyLabel="m" />
         <Key
-            android:codes="@integer/key_delete"
-            android:keyIcon="@drawable/sym_keyboard_delete"
-            android:iconPreview="@drawable/sym_keyboard_feedback_delete"
-            android:keyWidth="15%p"
-            android:isModifier="true"
-            android:isRepeatable="true"
-            android:keyEdgeFlags="right" />
+            latin:codes="@integer/key_delete"
+            latin:keyIcon="@drawable/sym_keyboard_delete"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_delete"
+            latin:keyWidth="15%p"
+            latin:isModifier="true"
+            latin:isRepeatable="true"
+            latin:keyEdgeFlags="right" />
     </Row>
-    <Row
-        android:keyboardMode="@+id/mode_normal"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="40%p"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_keyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_url"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="40%p"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_keyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_email"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="40%p"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_keyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_im"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="40%p"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel=":-)"
-            android:keyOutputText=":-) "
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_smileys"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_webentry"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="20%p"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_tab"
-            android:keyIcon="@drawable/sym_keyboard_tab"
-            android:iconPreview="@drawable/sym_keyboard_feedback_tab"
-            android:keyWidth="20%p"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_keyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_normal_with_settings_key"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_keyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_keyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="25%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_url_with_settings_key"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_keyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_keyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="25%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_email_with_settings_key"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_keyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_keyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="25%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_im_with_settings_key"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_keyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel=":-)"
-            android:keyOutputText=":-) "
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_smileys"
-            android:keyWidth="25%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_webentry_with_settings_key"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_keyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_tab"
-            android:keyIcon="@drawable/sym_keyboard_tab"
-            android:iconPreview="@drawable/sym_keyboard_feedback_tab"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_keyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="15%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
+    <include latin:keyboardLayout="@xml/kbd_qwerty_row4" />
 </Keyboard>
diff --git a/java/res/xml-nb/kbd_qwerty_black.xml b/java/res/xml-nb/kbd_qwerty_black.xml
index d90313a..982a3de 100644
--- a/java/res/xml-nb/kbd_qwerty_black.xml
+++ b/java/res/xml-nb/kbd_qwerty_black.xml
@@ -25,454 +25,154 @@
 -->
 
 <Keyboard
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    android:keyWidth="9.09%p"
-    android:horizontalGap="0px"
-    android:verticalGap="@dimen/key_bottom_gap"
-    android:keyHeight="@dimen/key_height"
+    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+    latin:keyWidth="9.09%p"
+    latin:horizontalGap="@dimen/key_horizontal_gap"
+    latin:verticalGap="@dimen/key_bottom_gap"
+    latin:keyHeight="@dimen/key_height"
 >
     <Row
-        android:rowEdgeFlags="top"
+        latin:rowEdgeFlags="top"
     >
         <Key
-            android:keyLabel="q"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_q"
-            android:keyWidth="8.75%p"
-            android:keyEdgeFlags="left" />
+            latin:keyLabel="q"
+            latin:keyHintIcon="@drawable/keyboard_hint_1"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_q"
+            latin:keyWidth="8.75%p"
+            latin:keyEdgeFlags="left" />
         <Key
-            android:keyLabel="w"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_w" />
+            latin:keyLabel="w"
+            latin:keyHintIcon="@drawable/keyboard_hint_2"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_w" />
         <Key
-            android:keyLabel="e"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_e" />
+            latin:keyLabel="e"
+            latin:keyHintIcon="@drawable/keyboard_hint_3"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_e" />
         <Key
-            android:keyLabel="r"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_r" />
+            latin:keyLabel="r"
+            latin:keyHintIcon="@drawable/keyboard_hint_4"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_r" />
         <Key
-            android:keyLabel="t"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_t" />
+            latin:keyLabel="t"
+            latin:keyHintIcon="@drawable/keyboard_hint_5"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_t" />
         <Key
-            android:keyLabel="y"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_y" />
+            latin:keyLabel="y"
+            latin:keyHintIcon="@drawable/keyboard_hint_6"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_y" />
         <Key
-            android:keyLabel="u"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_u" />
+            latin:keyLabel="u"
+            latin:keyHintIcon="@drawable/keyboard_hint_7"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_u" />
         <Key
-            android:keyLabel="i"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_i" />
+            latin:keyLabel="i"
+            latin:keyHintIcon="@drawable/keyboard_hint_8"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_i" />
         <Key
-            android:keyLabel="o"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_o" />
+            latin:keyLabel="o"
+            latin:keyHintIcon="@drawable/keyboard_hint_9"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_o" />
         <Key
-            android:keyLabel="p"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_p" />
+            latin:keyLabel="p"
+            latin:keyHintIcon="@drawable/keyboard_hint_0"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_p" />
         <Key
-            android:keyLabel="å"
-            android:keyWidth="8.75%p"
-            android:keyEdgeFlags="right" />
+            latin:keyLabel="å"
+            latin:keyWidth="8.75%p"
+            latin:keyEdgeFlags="right" />
     </Row>
     <Row>
         <Key
-            android:keyLabel="a"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_a"
-            android:keyWidth="8.75%p"
-            android:keyEdgeFlags="left" />
+            latin:keyLabel="a"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_a"
+            latin:keyWidth="8.75%p"
+            latin:keyEdgeFlags="left" />
         <Key
-            android:keyLabel="s"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_s" />
+            latin:keyLabel="s"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_s" />
         <Key
-            android:keyLabel="d"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_d" />
+            latin:keyLabel="d"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_d" />
         <Key
-            android:keyLabel="f" />
+            latin:keyLabel="f" />
         <Key
-            android:keyLabel="g"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_g" />
+            latin:keyLabel="g"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_g" />
         <Key
-            android:keyLabel="h" />
+            latin:keyLabel="h" />
         <Key
-            android:keyLabel="j" />
+            latin:keyLabel="j" />
         <Key
-            android:keyLabel="k" />
+            latin:keyLabel="k" />
         <Key
-            android:keyLabel="l"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_l" />
+            latin:keyLabel="l"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_l" />
         <Key
-            android:keyLabel="ø"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_oe" />
+            latin:keyLabel="ø"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_oe" />
         <Key
-            android:keyLabel="æ"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_ae"
-            android:keyWidth="8.75%p"
-            android:keyEdgeFlags="right" />
+            latin:keyLabel="æ"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_ae"
+            latin:keyWidth="8.75%p"
+            latin:keyEdgeFlags="right" />
     </Row>
     <Row
-        android:keyWidth="10%p"
+        latin:keyWidth="10%p"
     >
         <Key
-            android:codes="@integer/key_shift"
-            android:keyIcon="@drawable/sym_bkeyboard_shift"
-            android:iconPreview="@drawable/sym_keyboard_feedback_shift"
-            android:keyWidth="15%p"
-            android:isModifier="true"
-            android:isSticky="true"
-            android:keyEdgeFlags="left" />
+            latin:codes="@integer/key_shift"
+            latin:keyIcon="@drawable/sym_bkeyboard_shift"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_shift"
+            latin:keyWidth="15%p"
+            latin:isModifier="true"
+            latin:isSticky="true"
+            latin:keyEdgeFlags="left" />
         <Key
-            android:keyLabel="z"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_z" />
+            latin:keyLabel="z"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_z" />
         <Key
-            android:keyLabel="x" />
+            latin:keyLabel="x" />
         <Key
-            android:keyLabel="c"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_c" />
+            latin:keyLabel="c"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_c" />
         <Key
-            android:keyLabel="v"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_v" />
+            latin:keyLabel="v"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_v" />
         <Key
-            android:keyLabel="b" />
+            latin:keyLabel="b" />
         <Key
-            android:keyLabel="n"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_n" />
+            latin:keyLabel="n"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_n" />
         <Key
-            android:keyLabel="m" />
+            latin:keyLabel="m" />
         <Key
-            android:codes="@integer/key_delete"
-            android:keyIcon="@drawable/sym_bkeyboard_delete"
-            android:iconPreview="@drawable/sym_keyboard_feedback_delete"
-            android:keyWidth="15%p"
-            android:isRepeatable="true"
-            android:keyEdgeFlags="right" />
+            latin:codes="@integer/key_delete"
+            latin:keyIcon="@drawable/sym_bkeyboard_delete"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_delete"
+            latin:keyWidth="15%p"
+            latin:isRepeatable="true"
+            latin:keyEdgeFlags="right" />
     </Row>
-    <Row
-        android:keyboardMode="@+id/mode_normal"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="40%p" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_bkeyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_url"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="40%p" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_bkeyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_email"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="40%p" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_bkeyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_im"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="40%p" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:keyLabel=":-)"
-            android:keyOutputText=":-) "
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_smileys"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_webentry"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="20%p" />
-        <Key
-            android:codes="@integer/key_tab"
-            android:keyIcon="@drawable/sym_bkeyboard_tab"
-            android:iconPreview="@drawable/sym_keyboard_feedback_tab"
-            android:keyWidth="20%p" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_bkeyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_normal_with_settings_key"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_bkeyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_bkeyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="25%p"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_url_with_settings_key"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_bkeyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_bkeyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="25%p"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_email_with_settings_key"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_bkeyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_bkeyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="25%p"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_im_with_settings_key"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_bkeyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:keyLabel=":-)"
-            android:keyOutputText=":-) "
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_smileys"
-            android:keyWidth="25%p"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_webentry_with_settings_key"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_bkeyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p" />
-        <Key
-            android:codes="@integer/key_tab"
-            android:keyIcon="@drawable/sym_bkeyboard_tab"
-            android:iconPreview="@drawable/sym_keyboard_feedback_tab" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_bkeyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="15%p"
-            android:keyEdgeFlags="right" />
-    </Row>
+    <include latin:keyboardLayout="@xml/kbd_qwerty_black_row4" />
 </Keyboard>
diff --git a/java/res/xml-ru/kbd_qwerty.xml b/java/res/xml-ru/kbd_qwerty.xml
index c0b98ba..80a9ddd 100644
--- a/java/res/xml-ru/kbd_qwerty.xml
+++ b/java/res/xml-ru/kbd_qwerty.xml
@@ -19,496 +19,139 @@
 -->
 
 <Keyboard
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    android:keyWidth="9.09%p"
-    android:horizontalGap="0px"
-    android:verticalGap="@dimen/key_bottom_gap"
-    android:keyHeight="@dimen/key_height"
+    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+    latin:keyWidth="9.091%p"
+    latin:horizontalGap="@dimen/key_horizontal_gap"
+    latin:verticalGap="@dimen/key_bottom_gap"
+    latin:keyHeight="@dimen/key_height"
 >
     <Row
-        android:rowEdgeFlags="top"
+        latin:rowEdgeFlags="top"
     >
         <Key
-            android:keyLabel="й"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="1"
-            android:keyWidth="8.75%p"
-            android:keyEdgeFlags="left" />
+            latin:keyLabel="й"
+            latin:keyHintIcon="@drawable/keyboard_hint_1"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="1"
+            latin:keyWidth="8.75%p"
+            latin:keyEdgeFlags="left" />
         <Key
-            android:keyLabel="ц"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="2" />
+            latin:keyLabel="ц"
+            latin:keyHintIcon="@drawable/keyboard_hint_2"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="2" />
         <Key
-            android:keyLabel="у"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="3" />
+            latin:keyLabel="у"
+            latin:keyHintIcon="@drawable/keyboard_hint_3"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="3" />
         <Key
-            android:keyLabel="к"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="4" />
+            latin:keyLabel="к"
+            latin:keyHintIcon="@drawable/keyboard_hint_4"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="4" />
         <Key
-            android:keyLabel="е"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_cyrillic_e" />
+            latin:keyLabel="е"
+            latin:keyHintIcon="@drawable/keyboard_hint_5"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_cyrillic_e" />
         <Key
-            android:keyLabel="н"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="6" />
+            latin:keyLabel="н"
+            latin:keyHintIcon="@drawable/keyboard_hint_6"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="6" />
         <Key
-            android:keyLabel="г"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="7" />
+            latin:keyLabel="г"
+            latin:keyHintIcon="@drawable/keyboard_hint_7"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="7" />
         <Key
-            android:keyLabel="ш"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="8" />
+            latin:keyLabel="ш"
+            latin:keyHintIcon="@drawable/keyboard_hint_8"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="8" />
         <Key
-            android:keyLabel="щ"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="9" />
+            latin:keyLabel="щ"
+            latin:keyHintIcon="@drawable/keyboard_hint_9"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="9" />
         <Key
-            android:keyLabel="з"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="0" />
+            latin:keyLabel="з"
+            latin:keyHintIcon="@drawable/keyboard_hint_0"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="0" />
         <Key
-            android:keyLabel="х"
-            android:keyWidth="8.75%p"
-            android:keyEdgeFlags="right" />
+            latin:keyLabel="х"
+            latin:keyWidth="8.75%p"
+            latin:keyEdgeFlags="right" />
     </Row>
     <Row>
         <Key
-            android:keyLabel="ф"
-            android:keyWidth="8.75%p"
-            android:keyEdgeFlags="left" />
+            latin:keyLabel="ф"
+            latin:keyWidth="8.75%p"
+            latin:keyEdgeFlags="left" />
         <Key
-            android:keyLabel="ы" />
+            latin:keyLabel="ы" />
         <Key
-            android:keyLabel="в" />
+            latin:keyLabel="в" />
         <Key
-            android:keyLabel="а" />
+            latin:keyLabel="а" />
         <Key
-            android:keyLabel="п" />
+            latin:keyLabel="п" />
         <Key
-            android:keyLabel="р" />
+            latin:keyLabel="р" />
         <Key
-            android:keyLabel="о" />
+            latin:keyLabel="о" />
         <Key
-            android:keyLabel="л" />
+            latin:keyLabel="л" />
         <Key
-            android:keyLabel="д" />
+            latin:keyLabel="д" />
         <Key
-            android:keyLabel="ж" />
+            latin:keyLabel="ж" />
         <Key
-            android:keyLabel="э"
-            android:keyWidth="8.75%p"
-            android:keyEdgeFlags="right" />
+            latin:keyLabel="э"
+            latin:keyWidth="8.75%p"
+            latin:keyEdgeFlags="right" />
     </Row>
     <Row
-        android:keyWidth="8.5%p"
+        latin:keyWidth="8.5%p"
     >
         <Key
-            android:codes="@integer/key_shift"
-            android:keyIcon="@drawable/sym_keyboard_shift"
-            android:iconPreview="@drawable/sym_keyboard_feedback_shift"
-            android:keyWidth="11.75%p"
-            android:isModifier="true"
-            android:isSticky="true"
-            android:keyEdgeFlags="left" />
+            latin:codes="@integer/key_shift"
+            latin:keyIcon="@drawable/sym_keyboard_shift"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_shift"
+            latin:keyWidth="11.75%p"
+            latin:isModifier="true"
+            latin:isSticky="true"
+            latin:keyEdgeFlags="left" />
         <Key
-            android:keyLabel="я" />
+            latin:keyLabel="я" />
         <Key
-            android:keyLabel="ч" />
+            latin:keyLabel="ч" />
         <Key
-            android:keyLabel="с" />
+            latin:keyLabel="с" />
         <Key
-            android:keyLabel="м" />
+            latin:keyLabel="м" />
         <Key
-            android:keyLabel="и" />
+            latin:keyLabel="и" />
         <Key
-            android:keyLabel="т" />
+            latin:keyLabel="т" />
         <Key
-            android:keyLabel="ь"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_cyrillic_soft_sign" />
+            latin:keyLabel="ь"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_cyrillic_soft_sign" />
         <Key
-            android:keyLabel="б" />
+            latin:keyLabel="б" />
         <Key
-            android:keyLabel="ю" />
+            latin:keyLabel="ю" />
         <Key
-            android:codes="@integer/key_delete"
-            android:keyIcon="@drawable/sym_keyboard_delete"
-            android:iconPreview="@drawable/sym_keyboard_feedback_delete"
-            android:keyWidth="11.75%p"
-            android:isModifier="true"
-            android:isRepeatable="true"
-            android:keyEdgeFlags="right" />
+            latin:codes="@integer/key_delete"
+            latin:keyIcon="@drawable/sym_keyboard_delete"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_delete"
+            latin:keyWidth="11.75%p"
+            latin:isModifier="true"
+            latin:isRepeatable="true"
+            latin:keyEdgeFlags="right" />
     </Row>
-    <Row
-        android:keyboardMode="@+id/mode_normal"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="40%p"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_keyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_url"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="40%p"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_keyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_email"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="40%p"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_keyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_im"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="40%p"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel=":-)"
-            android:keyOutputText=":-) "
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_smileys"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_webentry"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="20%p"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_tab"
-            android:keyIcon="@drawable/sym_keyboard_tab"
-            android:iconPreview="@drawable/sym_keyboard_feedback_tab"
-            android:keyWidth="20%p"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_keyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_normal_with_settings_key"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_keyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_keyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="25%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_url_with_settings_key"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_keyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_keyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="25%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_email_with_settings_key"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_keyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_keyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="25%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_im_with_settings_key"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_keyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel=":-)"
-            android:keyOutputText=":-) "
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_smileys"
-            android:keyWidth="25%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_webentry_with_settings_key"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_keyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_tab"
-            android:keyIcon="@drawable/sym_keyboard_tab"
-            android:iconPreview="@drawable/sym_keyboard_feedback_tab"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_keyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="15%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
+    <include latin:keyboardLayout="@xml/kbd_qwerty_row4" />
 </Keyboard>
diff --git a/java/res/xml-ru/kbd_qwerty_black.xml b/java/res/xml-ru/kbd_qwerty_black.xml
index 94a450c..2635541 100644
--- a/java/res/xml-ru/kbd_qwerty_black.xml
+++ b/java/res/xml-ru/kbd_qwerty_black.xml
@@ -19,438 +19,138 @@
 -->
 
 <Keyboard
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    android:keyWidth="9.09%p"
-    android:horizontalGap="0px"
-    android:verticalGap="@dimen/key_bottom_gap"
-    android:keyHeight="@dimen/key_height"
+    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+    latin:keyWidth="9.09%p"
+    latin:horizontalGap="@dimen/key_horizontal_gap"
+    latin:verticalGap="@dimen/key_bottom_gap"
+    latin:keyHeight="@dimen/key_height"
 >
     <Row
-        android:rowEdgeFlags="top"
+        latin:rowEdgeFlags="top"
     >
         <Key
-            android:keyLabel="й"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="1"
-            android:keyWidth="8.75%p"
-            android:keyEdgeFlags="left" />
+            latin:keyLabel="й"
+            latin:keyHintIcon="@drawable/keyboard_hint_1"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="1"
+            latin:keyWidth="8.75%p"
+            latin:keyEdgeFlags="left" />
         <Key
-            android:keyLabel="ц"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="2" />
+            latin:keyLabel="ц"
+            latin:keyHintIcon="@drawable/keyboard_hint_2"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="2" />
         <Key
-            android:keyLabel="у"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="3" />
+            latin:keyLabel="у"
+            latin:keyHintIcon="@drawable/keyboard_hint_3"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="3" />
         <Key
-            android:keyLabel="к"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="4" />
+            latin:keyLabel="к"
+            latin:keyHintIcon="@drawable/keyboard_hint_4"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="4" />
         <Key
-            android:keyLabel="е"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_cyrillic_e" />
+            latin:keyLabel="е"
+            latin:keyHintIcon="@drawable/keyboard_hint_5"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_cyrillic_e" />
         <Key
-            android:keyLabel="н"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="6" />
+            latin:keyLabel="н"
+            latin:keyHintIcon="@drawable/keyboard_hint_6"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="6" />
         <Key
-            android:keyLabel="г"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="7" />
+            latin:keyLabel="г"
+            latin:keyHintIcon="@drawable/keyboard_hint_7"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="7" />
         <Key
-            android:keyLabel="ш"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="8" />
+            latin:keyLabel="ш"
+            latin:keyHintIcon="@drawable/keyboard_hint_8"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="8" />
         <Key
-            android:keyLabel="щ"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="9" />
+            latin:keyLabel="щ"
+            latin:keyHintIcon="@drawable/keyboard_hint_9"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="9" />
         <Key
-            android:keyLabel="з"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="0" />
+            latin:keyLabel="з"
+            latin:keyHintIcon="@drawable/keyboard_hint_0"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="0" />
         <Key
-            android:keyLabel="х"
-            android:keyWidth="8.75%p"
-            android:keyEdgeFlags="right" />
+            latin:keyLabel="х"
+            latin:keyWidth="8.75%p"
+            latin:keyEdgeFlags="right" />
     </Row>
     <Row>
         <Key
-            android:keyLabel="ф"
-            android:keyWidth="8.75%p"
-            android:keyEdgeFlags="left" />
+            latin:keyLabel="ф"
+            latin:keyWidth="8.75%p"
+            latin:keyEdgeFlags="left" />
         <Key
-            android:keyLabel="ы" />
+            latin:keyLabel="ы" />
         <Key
-            android:keyLabel="в" />
+            latin:keyLabel="в" />
         <Key
-            android:keyLabel="а" />
+            latin:keyLabel="а" />
         <Key
-            android:keyLabel="п" />
+            latin:keyLabel="п" />
         <Key
-            android:keyLabel="р" />
+            latin:keyLabel="р" />
         <Key
-            android:keyLabel="о" />
+            latin:keyLabel="о" />
         <Key
-            android:keyLabel="л" />
+            latin:keyLabel="л" />
         <Key
-            android:keyLabel="д" />
+            latin:keyLabel="д" />
         <Key
-            android:keyLabel="ж" />
+            latin:keyLabel="ж" />
         <Key
-            android:keyLabel="э"
-            android:keyWidth="8.75%p"
-            android:keyEdgeFlags="right" />
+            latin:keyLabel="э"
+            latin:keyWidth="8.75%p"
+            latin:keyEdgeFlags="right" />
     </Row>
     <Row
-        android:keyWidth="8.5%p"
+        latin:keyWidth="8.5%p"
     >
         <Key
-            android:codes="@integer/key_shift"
-            android:keyIcon="@drawable/sym_bkeyboard_shift"
-            android:iconPreview="@drawable/sym_keyboard_feedback_shift"
-            android:keyWidth="11.75%p"
-            android:isModifier="true"
-            android:isSticky="true"
-            android:keyEdgeFlags="left" />
+            latin:codes="@integer/key_shift"
+            latin:keyIcon="@drawable/sym_bkeyboard_shift"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_shift"
+            latin:keyWidth="11.75%p"
+            latin:isModifier="true"
+            latin:isSticky="true"
+            latin:keyEdgeFlags="left" />
         <Key
-            android:keyLabel="я" />
+            latin:keyLabel="я" />
         <Key
-            android:keyLabel="ч" />
+            latin:keyLabel="ч" />
         <Key
-            android:keyLabel="с" />
+            latin:keyLabel="с" />
         <Key
-            android:keyLabel="м" />
+            latin:keyLabel="м" />
         <Key
-            android:keyLabel="и" />
+            latin:keyLabel="и" />
         <Key
-            android:keyLabel="т" />
+            latin:keyLabel="т" />
         <Key
-            android:keyLabel="ь"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_cyrillic_soft_sign" />
+            latin:keyLabel="ь"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_cyrillic_soft_sign" />
         <Key
-            android:keyLabel="б" />
+            latin:keyLabel="б" />
         <Key
-            android:keyLabel="ю" />
+            latin:keyLabel="ю" />
         <Key
-            android:codes="@integer/key_delete"
-            android:keyIcon="@drawable/sym_bkeyboard_delete"
-            android:iconPreview="@drawable/sym_keyboard_feedback_delete"
-            android:keyWidth="11.75%p"
-            android:isRepeatable="true"
-            android:keyEdgeFlags="right" />
+            latin:codes="@integer/key_delete"
+            latin:keyIcon="@drawable/sym_bkeyboard_delete"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_delete"
+            latin:keyWidth="11.75%p"
+            latin:isRepeatable="true"
+            latin:keyEdgeFlags="right" />
     </Row>
-    <Row
-        android:keyboardMode="@+id/mode_normal"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="40%p" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_bkeyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_url"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="40%p" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_bkeyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_email"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="40%p" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_bkeyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_im"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="40%p" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:keyLabel=":-)"
-            android:keyOutputText=":-) "
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_smileys"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_webentry"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="20%p" />
-        <Key
-            android:codes="@integer/key_tab"
-            android:keyIcon="@drawable/sym_bkeyboard_tab"
-            android:iconPreview="@drawable/sym_keyboard_feedback_tab"
-            android:keyWidth="20%p" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_bkeyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_normal_with_settings_key"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_bkeyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_bkeyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="25%p"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_url_with_settings_key"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_bkeyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_bkeyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="25%p"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_email_with_settings_key"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_bkeyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_bkeyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="25%p"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_im_with_settings_key"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_bkeyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:keyLabel=":-)"
-            android:keyOutputText=":-) "
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_smileys"
-            android:keyWidth="25%p"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_webentry_with_settings_key"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_bkeyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p" />
-        <Key
-            android:codes="@integer/key_tab"
-            android:keyIcon="@drawable/sym_bkeyboard_tab"
-            android:iconPreview="@drawable/sym_keyboard_feedback_tab" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_bkeyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="15%p"
-            android:keyEdgeFlags="right" />
-    </Row>
+    <include latin:keyboardLayout="@xml/kbd_qwerty_black_row4" />
 </Keyboard>
diff --git a/java/res/xml-sr/kbd_qwerty.xml b/java/res/xml-sr/kbd_qwerty.xml
index 464c74f..c9a4e44 100644
--- a/java/res/xml-sr/kbd_qwerty.xml
+++ b/java/res/xml-sr/kbd_qwerty.xml
@@ -20,488 +20,131 @@
 
 <!-- Serbian keyboard layout, based on the X11 layout for Serbian -->
 <Keyboard
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    android:keyWidth="9.09%p"
-    android:horizontalGap="0px"
-    android:verticalGap="@dimen/key_bottom_gap"
-    android:keyHeight="@dimen/key_height"
+    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+    latin:keyWidth="9.09%p"
+    latin:horizontalGap="@dimen/key_horizontal_gap"
+    latin:verticalGap="@dimen/key_bottom_gap"
+    latin:keyHeight="@dimen/key_height"
 >
     <Row
-        android:rowEdgeFlags="top"
+        latin:rowEdgeFlags="top"
     >
         <Key
-            android:keyLabel="љ"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="1"
-            android:keyEdgeFlags="left" />
+            latin:keyLabel="љ"
+            latin:keyHintIcon="@drawable/keyboard_hint_1"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="1"
+            latin:keyEdgeFlags="left" />
         <Key
-            android:keyLabel="њ"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="2" />
+            latin:keyLabel="њ"
+            latin:keyHintIcon="@drawable/keyboard_hint_2"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="2" />
         <Key
-            android:keyLabel="е"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="3" />
+            latin:keyLabel="е"
+            latin:keyHintIcon="@drawable/keyboard_hint_3"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="3" />
         <Key
-            android:keyLabel="р"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="4" />
+            latin:keyLabel="р"
+            latin:keyHintIcon="@drawable/keyboard_hint_4"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="4" />
         <Key
-            android:keyLabel="т"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="5" />
+            latin:keyLabel="т"
+            latin:keyHintIcon="@drawable/keyboard_hint_5"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="5" />
         <Key
-            android:keyLabel="з"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="6" />
+            latin:keyLabel="з"
+            latin:keyHintIcon="@drawable/keyboard_hint_6"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="6" />
         <Key
-            android:keyLabel="у"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="7" />
+            latin:keyLabel="у"
+            latin:keyHintIcon="@drawable/keyboard_hint_7"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="7" />
         <Key
-            android:keyLabel="и"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="8" />
+            latin:keyLabel="и"
+            latin:keyHintIcon="@drawable/keyboard_hint_8"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="8" />
         <Key
-            android:keyLabel="о"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="9" />
+            latin:keyLabel="о"
+            latin:keyHintIcon="@drawable/keyboard_hint_9"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="9" />
         <Key
-            android:keyLabel="п"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="0" />
+            latin:keyLabel="п"
+            latin:keyHintIcon="@drawable/keyboard_hint_0"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="0" />
         <Key
-            android:keyLabel="ш"
-            android:keyEdgeFlags="right" />
+            latin:keyLabel="ш"
+            latin:keyEdgeFlags="right" />
     </Row>
     <Row>
         <Key
-            android:keyLabel="а"
-            android:keyEdgeFlags="left" />
+            latin:keyLabel="а"
+            latin:keyEdgeFlags="left" />
         <Key
-            android:keyLabel="с" />
+            latin:keyLabel="с" />
         <Key
-            android:keyLabel="д" />
+            latin:keyLabel="д" />
         <Key
-            android:keyLabel="ф" />
+            latin:keyLabel="ф" />
         <Key
-            android:keyLabel="г" />
+            latin:keyLabel="г" />
         <Key
-            android:keyLabel="х" />
+            latin:keyLabel="х" />
         <Key
-            android:keyLabel="ј" />
+            latin:keyLabel="ј" />
         <Key
-            android:keyLabel="к" />
+            latin:keyLabel="к" />
         <Key
-            android:keyLabel="л" />
+            latin:keyLabel="л" />
         <Key
-            android:keyLabel="ч" />
+            latin:keyLabel="ч" />
         <Key
-            android:keyLabel="ћ" />
+            latin:keyLabel="ћ" />
         <Key
-            android:keyLabel="ђ"
-            android:keyEdgeFlags="right" />
+            latin:keyLabel="ђ"
+            latin:keyEdgeFlags="right" />
     </Row>
     <Row
-        android:keyWidth="8.5%p"
+        latin:keyWidth="8.5%p"
     >
         <Key
-            android:codes="@integer/key_shift"
-            android:keyIcon="@drawable/sym_keyboard_shift"
-            android:iconPreview="@drawable/sym_keyboard_feedback_shift"
-            android:keyWidth="11.75%p"
-            android:isModifier="true"
-            android:isSticky="true"
-            android:keyEdgeFlags="left" />
+            latin:codes="@integer/key_shift"
+            latin:keyIcon="@drawable/sym_keyboard_shift"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_shift"
+            latin:keyWidth="11.75%p"
+            latin:isModifier="true"
+            latin:isSticky="true"
+            latin:keyEdgeFlags="left" />
         <Key
-            android:keyLabel="ж" />
+            latin:keyLabel="ж" />
         <Key
-            android:keyLabel="џ" />
+            latin:keyLabel="џ" />
         <Key
-            android:keyLabel="ц" />
+            latin:keyLabel="ц" />
         <Key
-            android:keyLabel="в" />
+            latin:keyLabel="в" />
         <Key
-            android:keyLabel="б" />
+            latin:keyLabel="б" />
         <Key
-            android:keyLabel="н" />
+            latin:keyLabel="н" />
         <Key
-            android:keyLabel="м" />
+            latin:keyLabel="м" />
         <Key
-            android:codes="@integer/key_delete"
-            android:keyIcon="@drawable/sym_keyboard_delete"
-            android:iconPreview="@drawable/sym_keyboard_feedback_delete"
-            android:keyWidth="11.75%p"
-            android:isModifier="true"
-            android:isRepeatable="true"
-            android:keyEdgeFlags="right" />
+            latin:codes="@integer/key_delete"
+            latin:keyIcon="@drawable/sym_keyboard_delete"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_delete"
+            latin:keyWidth="11.75%p"
+            latin:isModifier="true"
+            latin:isRepeatable="true"
+            latin:keyEdgeFlags="right" />
     </Row>
-    <Row
-        android:keyboardMode="@+id/mode_normal"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="40%p"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_keyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_url"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="40%p"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_keyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_email"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="40%p"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_keyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_im"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="40%p"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel=":-)"
-            android:keyOutputText=":-) "
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_smileys"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_webentry"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="20%p"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_tab"
-            android:keyIcon="@drawable/sym_keyboard_tab"
-            android:iconPreview="@drawable/sym_keyboard_feedback_tab"
-            android:keyWidth="20%p"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_keyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_normal_with_settings_key"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_keyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_keyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="25%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_url_with_settings_key"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_keyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_keyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="25%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_email_with_settings_key"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_keyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_keyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="25%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_im_with_settings_key"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_keyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel=":-)"
-            android:keyOutputText=":-) "
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_smileys"
-            android:keyWidth="25%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_webentry_with_settings_key"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_keyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_tab"
-            android:keyIcon="@drawable/sym_keyboard_tab"
-            android:iconPreview="@drawable/sym_keyboard_feedback_tab"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_keyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="15%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
+    <include latin:keyboardLayout="@xml/kbd_qwerty_row4" />
 </Keyboard>
diff --git a/java/res/xml-sr/kbd_qwerty_black.xml b/java/res/xml-sr/kbd_qwerty_black.xml
index 2ffa240..f760c5e 100644
--- a/java/res/xml-sr/kbd_qwerty_black.xml
+++ b/java/res/xml-sr/kbd_qwerty_black.xml
@@ -20,430 +20,130 @@
 
 <!-- Serbian keyboard layout, based on the X11 layout for Serbian -->
 <Keyboard
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    android:keyWidth="9.09%p"
-    android:horizontalGap="0px"
-    android:verticalGap="@dimen/key_bottom_gap"
-    android:keyHeight="@dimen/key_height"
+    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+    latin:keyWidth="9.09%p"
+    latin:horizontalGap="@dimen/key_horizontal_gap"
+    latin:verticalGap="@dimen/key_bottom_gap"
+    latin:keyHeight="@dimen/key_height"
 >
     <Row
-        android:rowEdgeFlags="top"
+        latin:rowEdgeFlags="top"
     >
         <Key
-            android:keyLabel="љ"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="1"
-            android:keyEdgeFlags="left" />
+            latin:keyLabel="љ"
+            latin:keyHintIcon="@drawable/keyboard_hint_1"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="1"
+            latin:keyEdgeFlags="left" />
         <Key
-            android:keyLabel="њ"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="2" />
+            latin:keyLabel="њ"
+            latin:keyHintIcon="@drawable/keyboard_hint_2"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="2" />
         <Key
-            android:keyLabel="е"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="3" />
+            latin:keyLabel="е"
+            latin:keyHintIcon="@drawable/keyboard_hint_3"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="3" />
         <Key
-            android:keyLabel="р"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="4" />
+            latin:keyLabel="р"
+            latin:keyHintIcon="@drawable/keyboard_hint_4"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="4" />
         <Key
-            android:keyLabel="т"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="5" />
+            latin:keyLabel="т"
+            latin:keyHintIcon="@drawable/keyboard_hint_5"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="5" />
         <Key
-            android:keyLabel="з"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="6" />
+            latin:keyLabel="з"
+            latin:keyHintIcon="@drawable/keyboard_hint_6"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="6" />
         <Key
-            android:keyLabel="у"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="7" />
+            latin:keyLabel="у"
+            latin:keyHintIcon="@drawable/keyboard_hint_7"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="7" />
         <Key
-            android:keyLabel="и"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="8" />
+            latin:keyLabel="и"
+            latin:keyHintIcon="@drawable/keyboard_hint_8"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="8" />
         <Key
-            android:keyLabel="о"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="9" />
+            latin:keyLabel="о"
+            latin:keyHintIcon="@drawable/keyboard_hint_9"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="9" />
         <Key
-            android:keyLabel="п"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="0" />
+            latin:keyLabel="п"
+            latin:keyHintIcon="@drawable/keyboard_hint_0"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="0" />
         <Key
-            android:keyLabel="ш"
-            android:keyEdgeFlags="right" />
+            latin:keyLabel="ш"
+            latin:keyEdgeFlags="right" />
     </Row>
     <Row>
         <Key
-            android:keyLabel="а"
-            android:keyEdgeFlags="left" />
+            latin:keyLabel="а"
+            latin:keyEdgeFlags="left" />
         <Key
-            android:keyLabel="с" />
+            latin:keyLabel="с" />
         <Key
-            android:keyLabel="д" />
+            latin:keyLabel="д" />
         <Key
-            android:keyLabel="ф" />
+            latin:keyLabel="ф" />
         <Key
-            android:keyLabel="г" />
+            latin:keyLabel="г" />
         <Key
-            android:keyLabel="х" />
+            latin:keyLabel="х" />
         <Key
-            android:keyLabel="ј" />
+            latin:keyLabel="ј" />
         <Key
-            android:keyLabel="к" />
+            latin:keyLabel="к" />
         <Key
-            android:keyLabel="л" />
+            latin:keyLabel="л" />
         <Key
-            android:keyLabel="ч" />
+            latin:keyLabel="ч" />
         <Key
-            android:keyLabel="ћ" />
+            latin:keyLabel="ћ" />
         <Key
-            android:keyLabel="ђ"
-            android:keyEdgeFlags="right" />
+            latin:keyLabel="ђ"
+            latin:keyEdgeFlags="right" />
     </Row>
     <Row
-        android:keyWidth="8.5%p"
+        latin:keyWidth="8.5%p"
     >
         <Key
-            android:codes="@integer/key_shift"
-            android:keyIcon="@drawable/sym_bkeyboard_shift"
-            android:iconPreview="@drawable/sym_keyboard_feedback_shift"
-            android:keyWidth="11.75%p"
-            android:isModifier="true"
-            android:isSticky="true"
-            android:keyEdgeFlags="left" />
+            latin:codes="@integer/key_shift"
+            latin:keyIcon="@drawable/sym_bkeyboard_shift"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_shift"
+            latin:keyWidth="11.75%p"
+            latin:isModifier="true"
+            latin:isSticky="true"
+            latin:keyEdgeFlags="left" />
         <Key
-            android:keyLabel="ж" />
+            latin:keyLabel="ж" />
         <Key
-            android:keyLabel="џ" />
+            latin:keyLabel="џ" />
         <Key
-            android:keyLabel="ц" />
+            latin:keyLabel="ц" />
         <Key
-            android:keyLabel="в" />
+            latin:keyLabel="в" />
         <Key
-            android:keyLabel="б" />
+            latin:keyLabel="б" />
         <Key
-            android:keyLabel="н" />
+            latin:keyLabel="н" />
         <Key
-            android:keyLabel="м" />
+            latin:keyLabel="м" />
         <Key
-            android:codes="@integer/key_delete"
-            android:keyIcon="@drawable/sym_bkeyboard_delete"
-            android:iconPreview="@drawable/sym_keyboard_feedback_delete"
-            android:keyWidth="11.75%p"
-            android:isRepeatable="true"
-            android:keyEdgeFlags="right" />
+            latin:codes="@integer/key_delete"
+            latin:keyIcon="@drawable/sym_bkeyboard_delete"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_delete"
+            latin:keyWidth="11.75%p"
+            latin:isRepeatable="true"
+            latin:keyEdgeFlags="right" />
     </Row>
-    <Row
-        android:keyboardMode="@+id/mode_normal"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="40%p" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_bkeyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_url"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="40%p" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_bkeyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_email"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="40%p" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_bkeyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_im"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="40%p" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:keyLabel=":-)"
-            android:keyOutputText=":-) "
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_smileys"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_webentry"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="20%p" />
-        <Key
-            android:codes="@integer/key_tab"
-            android:keyIcon="@drawable/sym_bkeyboard_tab"
-            android:iconPreview="@drawable/sym_keyboard_feedback_tab"
-            android:keyWidth="20%p" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_bkeyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_normal_with_settings_key"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_bkeyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_bkeyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="25%p"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_url_with_settings_key"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_bkeyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_bkeyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="25%p"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_email_with_settings_key"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_bkeyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_bkeyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="25%p"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_im_with_settings_key"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_bkeyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:keyLabel=":-)"
-            android:keyOutputText=":-) "
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_smileys"
-            android:keyWidth="25%p"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_webentry_with_settings_key"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_bkeyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p" />
-        <Key
-            android:codes="@integer/key_tab"
-            android:keyIcon="@drawable/sym_bkeyboard_tab"
-            android:iconPreview="@drawable/sym_keyboard_feedback_tab" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_bkeyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="15%p"
-            android:keyEdgeFlags="right" />
-    </Row>
+    <include latin:keyboardLayout="@xml/kbd_qwerty_black_row4" />
 </Keyboard>
diff --git a/java/res/xml-sv/kbd_qwerty.xml b/java/res/xml-sv/kbd_qwerty.xml
index 0fc80a3..ae70024 100644
--- a/java/res/xml-sv/kbd_qwerty.xml
+++ b/java/res/xml-sv/kbd_qwerty.xml
@@ -27,511 +27,154 @@
 -->
 
 <Keyboard
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    android:keyWidth="9.09%p"
-    android:horizontalGap="0px"
-    android:verticalGap="@dimen/key_bottom_gap"
-    android:keyHeight="@dimen/key_height"
+    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+    latin:keyWidth="9.09%p"
+    latin:horizontalGap="@dimen/key_horizontal_gap"
+    latin:verticalGap="@dimen/key_bottom_gap"
+    latin:keyHeight="@dimen/key_height"
 >
     <Row
-        android:rowEdgeFlags="top"
+        latin:rowEdgeFlags="top"
     >
         <Key
-            android:keyLabel="q"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_q"
-            android:keyWidth="8.75%p"
-            android:keyEdgeFlags="left" />
+            latin:keyLabel="q"
+            latin:keyHintIcon="@drawable/keyboard_hint_1"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_q"
+            latin:keyWidth="8.75%p"
+            latin:keyEdgeFlags="left" />
         <Key
-            android:keyLabel="w"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_w" />
+            latin:keyLabel="w"
+            latin:keyHintIcon="@drawable/keyboard_hint_2"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_w" />
         <Key
-            android:keyLabel="e"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_e" />
+            latin:keyLabel="e"
+            latin:keyHintIcon="@drawable/keyboard_hint_3"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_e" />
         <Key
-            android:keyLabel="r"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_r" />
+            latin:keyLabel="r"
+            latin:keyHintIcon="@drawable/keyboard_hint_4"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_r" />
         <Key
-            android:keyLabel="t"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_t" />
+            latin:keyLabel="t"
+            latin:keyHintIcon="@drawable/keyboard_hint_5"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_t" />
         <Key
-            android:keyLabel="y"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_y" />
+            latin:keyLabel="y"
+            latin:keyHintIcon="@drawable/keyboard_hint_6"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_y" />
         <Key
-            android:keyLabel="u"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_u" />
+            latin:keyLabel="u"
+            latin:keyHintIcon="@drawable/keyboard_hint_7"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_u" />
         <Key
-            android:keyLabel="i"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_i" />
+            latin:keyLabel="i"
+            latin:keyHintIcon="@drawable/keyboard_hint_8"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_i" />
         <Key
-            android:keyLabel="o"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_o" />
+            latin:keyLabel="o"
+            latin:keyHintIcon="@drawable/keyboard_hint_9"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_o" />
         <Key
-            android:keyLabel="p"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_p" />
+            latin:keyLabel="p"
+            latin:keyHintIcon="@drawable/keyboard_hint_0"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_p" />
         <Key
-            android:keyLabel="å"
-            android:keyWidth="8.75%p"
-            android:keyEdgeFlags="right" />
+            latin:keyLabel="å"
+            latin:keyWidth="8.75%p"
+            latin:keyEdgeFlags="right" />
     </Row>
     <Row>
         <Key
-            android:keyLabel="a"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_a"
-            android:keyWidth="8.75%p"
-            android:keyEdgeFlags="left" />
+            latin:keyLabel="a"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_a"
+            latin:keyWidth="8.75%p"
+            latin:keyEdgeFlags="left" />
         <Key
-            android:keyLabel="s"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_s" />
+            latin:keyLabel="s"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_s" />
         <Key
-            android:keyLabel="d"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_d" />
+            latin:keyLabel="d"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_d" />
         <Key
-            android:keyLabel="f" />
+            latin:keyLabel="f" />
         <Key
-            android:keyLabel="g"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_g" />
+            latin:keyLabel="g"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_g" />
         <Key
-            android:keyLabel="h" />
+            latin:keyLabel="h" />
         <Key
-            android:keyLabel="j" />
+            latin:keyLabel="j" />
         <Key
-            android:keyLabel="k" />
+            latin:keyLabel="k" />
         <Key
-            android:keyLabel="l"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_l" />
+            latin:keyLabel="l"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_l" />
         <Key
-            android:keyLabel="ö"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_o_umlaut" />
+            latin:keyLabel="ö"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_o_umlaut" />
         <Key
-            android:keyLabel="ä"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_a_umlaut"
-            android:keyWidth="8.75%p"
-            android:keyEdgeFlags="right" />
+            latin:keyLabel="ä"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_a_umlaut"
+            latin:keyWidth="8.75%p"
+            latin:keyEdgeFlags="right" />
     </Row>
     <Row
-        android:keyWidth="10%p"
+        latin:keyWidth="10%p"
     >
         <Key
-            android:codes="@integer/key_shift"
-            android:keyIcon="@drawable/sym_keyboard_shift"
-            android:iconPreview="@drawable/sym_keyboard_feedback_shift"
-            android:keyWidth="15%p"
-            android:isModifier="true"
-            android:isSticky="true"
-            android:keyEdgeFlags="left" />
+            latin:codes="@integer/key_shift"
+            latin:keyIcon="@drawable/sym_keyboard_shift"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_shift"
+            latin:keyWidth="15%p"
+            latin:isModifier="true"
+            latin:isSticky="true"
+            latin:keyEdgeFlags="left" />
         <Key
-            android:keyLabel="z"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_z" />
+            latin:keyLabel="z"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_z" />
         <Key
-            android:keyLabel="x" />
+            latin:keyLabel="x" />
         <Key
-            android:keyLabel="c"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_c" />
+            latin:keyLabel="c"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_c" />
         <Key
-            android:keyLabel="v"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_v" />
+            latin:keyLabel="v"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_v" />
         <Key
-            android:keyLabel="b" />
+            latin:keyLabel="b" />
         <Key
-            android:keyLabel="n"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_n" />
+            latin:keyLabel="n"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_n" />
         <Key
-            android:keyLabel="m" />
+            latin:keyLabel="m" />
         <Key
-            android:codes="@integer/key_delete"
-            android:keyIcon="@drawable/sym_keyboard_delete"
-            android:iconPreview="@drawable/sym_keyboard_feedback_delete"
-            android:keyWidth="15%p"
-            android:isRepeatable="true"
-            android:keyEdgeFlags="right" />
+            latin:codes="@integer/key_delete"
+            latin:keyIcon="@drawable/sym_keyboard_delete"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_delete"
+            latin:keyWidth="15%p"
+            latin:isRepeatable="true"
+            latin:keyEdgeFlags="right" />
     </Row>
-    <Row
-        android:keyboardMode="@+id/mode_normal"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="40%p"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_keyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_url"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="40%p"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_keyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_email"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="40%p"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_keyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_im"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="40%p"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel=":-)"
-            android:keyOutputText=":-) "
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_smileys"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_webentry"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="20%p"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_tab"
-            android:keyIcon="@drawable/sym_keyboard_tab"
-            android:iconPreview="@drawable/sym_keyboard_feedback_tab"
-            android:keyWidth="20%p"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_keyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_normal_with_settings_key"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_keyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_keyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="25%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_url_with_settings_key"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_keyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_keyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="25%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_email_with_settings_key"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_keyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_keyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="25%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_im_with_settings_key"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_keyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel=":-)"
-            android:keyOutputText=":-) "
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_smileys"
-            android:keyWidth="25%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_webentry_with_settings_key"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_keyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_tab"
-            android:keyIcon="@drawable/sym_keyboard_tab"
-            android:iconPreview="@drawable/sym_keyboard_feedback_tab"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_keyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="15%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
+    <include latin:keyboardLayout="@xml/kbd_qwerty_row4" />
 </Keyboard>
diff --git a/java/res/xml-sv/kbd_qwerty_black.xml b/java/res/xml-sv/kbd_qwerty_black.xml
index d03fb77..463b60b 100644
--- a/java/res/xml-sv/kbd_qwerty_black.xml
+++ b/java/res/xml-sv/kbd_qwerty_black.xml
@@ -27,454 +27,154 @@
 -->
 
 <Keyboard
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    android:keyWidth="9.09%p"
-    android:horizontalGap="0px"
-    android:verticalGap="@dimen/key_bottom_gap"
-    android:keyHeight="@dimen/key_height"
+    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+    latin:keyWidth="9.09%p"
+    latin:horizontalGap="@dimen/key_horizontal_gap"
+    latin:verticalGap="@dimen/key_bottom_gap"
+    latin:keyHeight="@dimen/key_height"
 >
     <Row
-        android:rowEdgeFlags="top"
+        latin:rowEdgeFlags="top"
     >
         <Key
-            android:keyLabel="q"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_q"
-            android:keyWidth="8.75%p"
-            android:keyEdgeFlags="left" />
+            latin:keyLabel="q"
+            latin:keyHintIcon="@drawable/keyboard_hint_1"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_q"
+            latin:keyWidth="8.75%p"
+            latin:keyEdgeFlags="left" />
         <Key
-            android:keyLabel="w"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_w" />
+            latin:keyLabel="w"
+            latin:keyHintIcon="@drawable/keyboard_hint_2"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_w" />
         <Key
-            android:keyLabel="e"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_e" />
+            latin:keyLabel="e"
+            latin:keyHintIcon="@drawable/keyboard_hint_3"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_e" />
         <Key
-            android:keyLabel="r"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_r" />
+            latin:keyLabel="r"
+            latin:keyHintIcon="@drawable/keyboard_hint_4"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_r" />
         <Key
-            android:keyLabel="t"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_t" />
+            latin:keyLabel="t"
+            latin:keyHintIcon="@drawable/keyboard_hint_5"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_t" />
         <Key
-            android:keyLabel="y"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_y" />
+            latin:keyLabel="y"
+            latin:keyHintIcon="@drawable/keyboard_hint_6"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_y" />
         <Key
-            android:keyLabel="u"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_u" />
+            latin:keyLabel="u"
+            latin:keyHintIcon="@drawable/keyboard_hint_7"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_u" />
         <Key
-            android:keyLabel="i"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_i" />
+            latin:keyLabel="i"
+            latin:keyHintIcon="@drawable/keyboard_hint_8"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_i" />
         <Key
-            android:keyLabel="o"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_o" />
+            latin:keyLabel="o"
+            latin:keyHintIcon="@drawable/keyboard_hint_9"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_o" />
         <Key
-            android:keyLabel="p"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_p" />
+            latin:keyLabel="p"
+            latin:keyHintIcon="@drawable/keyboard_hint_0"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_p" />
         <Key
-            android:keyLabel="å"
-            android:keyWidth="8.75%p"
-            android:keyEdgeFlags="right" />
+            latin:keyLabel="å"
+            latin:keyWidth="8.75%p"
+            latin:keyEdgeFlags="right" />
     </Row>
     <Row>
         <Key
-            android:keyLabel="a"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_a"
-            android:keyWidth="8.75%p"
-            android:keyEdgeFlags="left" />
+            latin:keyLabel="a"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_a"
+            latin:keyWidth="8.75%p"
+            latin:keyEdgeFlags="left" />
         <Key
-            android:keyLabel="s"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_s" />
+            latin:keyLabel="s"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_s" />
         <Key
-            android:keyLabel="d"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_d" />
+            latin:keyLabel="d"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_d" />
         <Key
-            android:keyLabel="f" />
+            latin:keyLabel="f" />
         <Key
-            android:keyLabel="g"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_g" />
+            latin:keyLabel="g"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_g" />
         <Key
-            android:keyLabel="h" />
+            latin:keyLabel="h" />
         <Key
-            android:keyLabel="j" />
+            latin:keyLabel="j" />
         <Key
-            android:keyLabel="k" />
+            latin:keyLabel="k" />
         <Key
-            android:keyLabel="l"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_l" />
+            latin:keyLabel="l"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_l" />
         <Key
-            android:keyLabel="ö"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_o_umlaut" />
+            latin:keyLabel="ö"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_o_umlaut" />
         <Key
-            android:keyLabel="ä"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_a_umlaut"
-            android:keyWidth="8.75%p"
-            android:keyEdgeFlags="right" />
+            latin:keyLabel="ä"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_a_umlaut"
+            latin:keyWidth="8.75%p"
+            latin:keyEdgeFlags="right" />
     </Row>
     <Row
-        android:keyWidth="10%p"
+        latin:keyWidth="10%p"
     >
         <Key
-            android:codes="@integer/key_shift"
-            android:keyIcon="@drawable/sym_bkeyboard_shift"
-            android:iconPreview="@drawable/sym_keyboard_feedback_shift"
-            android:keyWidth="15%p"
-            android:isModifier="true"
-            android:isSticky="true"
-            android:keyEdgeFlags="left" />
+            latin:codes="@integer/key_shift"
+            latin:keyIcon="@drawable/sym_bkeyboard_shift"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_shift"
+            latin:keyWidth="15%p"
+            latin:isModifier="true"
+            latin:isSticky="true"
+            latin:keyEdgeFlags="left" />
         <Key
-            android:keyLabel="z"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_z" />
+            latin:keyLabel="z"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_z" />
         <Key
-            android:keyLabel="x" />
+            latin:keyLabel="x" />
         <Key
-            android:keyLabel="c"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_c" />
+            latin:keyLabel="c"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_c" />
         <Key
-            android:keyLabel="v"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_v" />
+            latin:keyLabel="v"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_v" />
         <Key
-            android:keyLabel="b" />
+            latin:keyLabel="b" />
         <Key
-            android:keyLabel="n"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_n" />
+            latin:keyLabel="n"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_n" />
         <Key
-            android:keyLabel="m" />
+            latin:keyLabel="m" />
         <Key
-            android:codes="@integer/key_delete"
-            android:keyIcon="@drawable/sym_bkeyboard_delete"
-            android:iconPreview="@drawable/sym_keyboard_feedback_delete"
-            android:keyWidth="15%p"
-            android:isRepeatable="true"
-            android:keyEdgeFlags="right" />
+            latin:codes="@integer/key_delete"
+            latin:keyIcon="@drawable/sym_bkeyboard_delete"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_delete"
+            latin:keyWidth="15%p"
+            latin:isRepeatable="true"
+            latin:keyEdgeFlags="right" />
     </Row>
-    <Row
-        android:keyboardMode="@+id/mode_normal"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="40%p" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_bkeyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_url"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="40%p" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_bkeyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_email"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="40%p" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_bkeyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_im"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="40%p" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:keyLabel=":-)"
-            android:keyOutputText=":-) "
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_smileys"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_webentry"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="20%p" />
-        <Key
-            android:codes="@integer/key_tab"
-            android:keyIcon="@drawable/sym_bkeyboard_tab"
-            android:iconPreview="@drawable/sym_keyboard_feedback_tab"
-            android:keyWidth="20%p" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_bkeyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_normal_with_settings_key"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_bkeyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_bkeyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="25%p"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_url_with_settings_key"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_bkeyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_bkeyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="25%p"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_email_with_settings_key"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_bkeyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_bkeyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="25%p"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_im_with_settings_key"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_bkeyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:keyLabel=":-)"
-            android:keyOutputText=":-) "
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_smileys"
-            android:keyWidth="25%p"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_webentry_with_settings_key"
-        android:keyWidth="10%p"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_bkeyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p" />
-        <Key
-            android:codes="@integer/key_tab"
-            android:keyIcon="@drawable/sym_bkeyboard_tab"
-            android:iconPreview="@drawable/sym_keyboard_feedback_tab" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_bkeyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="15%p"
-            android:keyEdgeFlags="right" />
-    </Row>
+    <include latin:keyboardLayout="@xml/kbd_qwerty_black_row4" />
 </Keyboard>
diff --git a/java/res/xml-xlarge-land/kbd_popup_template.xml b/java/res/xml-xlarge-land/kbd_popup_template.xml
new file mode 100644
index 0000000..5fe9f67
--- /dev/null
+++ b/java/res/xml-xlarge-land/kbd_popup_template.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2010, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<Keyboard xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+    latin:keyWidth="5.0%p"
+    latin:horizontalGap="@dimen/key_horizontal_gap"
+    latin:verticalGap="0px"
+    latin:keyHeight="@dimen/key_height"
+    >
+</Keyboard>
diff --git a/java/res/xml-xlarge-land/popup_smileys.xml b/java/res/xml-xlarge-land/popup_smileys.xml
new file mode 100644
index 0000000..bdd6805
--- /dev/null
+++ b/java/res/xml-xlarge-land/popup_smileys.xml
@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2010, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<Keyboard
+    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+    latin:keyWidth="5.0%p"
+    latin:horizontalGap="0px"
+    latin:verticalGap="0px"
+    latin:keyHeight="@dimen/popup_key_height"
+>
+    <Row
+        latin:rowEdgeFlags="top"
+    >
+        <Key
+            latin:keyLabel=":-)"
+            latin:keyOutputText=":-) "
+            latin:keyEdgeFlags="left" />
+        <Key
+            latin:keyLabel=":-("
+            latin:keyOutputText=":-( " />
+        <Key
+            latin:keyLabel=";-)"
+            latin:keyOutputText=";-) " />
+        <Key
+            latin:keyLabel=":-P"
+            latin:keyOutputText=":-P " />
+        <Key
+            latin:keyLabel="=-O"
+            latin:keyOutputText="=-O "
+            latin:keyEdgeFlags="right" />
+    </Row>
+    <Row>
+        <Key
+            latin:keyLabel=":-*"
+            latin:keyOutputText=":-* "
+            latin:keyEdgeFlags="left" />
+        <Key
+            latin:keyLabel=":O"
+            latin:keyOutputText=":O " />
+        <Key
+            latin:keyLabel="B-)"
+            latin:keyOutputText="B-) " />
+        <Key
+            latin:keyLabel=":-$"
+            latin:keyOutputText=":-$ " />
+        <Key
+            latin:keyLabel=":-!"
+            latin:keyOutputText=":-! "
+            latin:keyEdgeFlags="right" />
+    </Row>
+    <Row
+        latin:rowEdgeFlags="bottom"
+    >
+        <Key
+            latin:keyLabel=":-["
+            latin:keyOutputText=":-[ "
+            latin:keyEdgeFlags="left" />
+        <Key
+            latin:keyLabel="O:-)"
+            latin:keyOutputText="O:-) " />
+        <Key
+            latin:keyLabel=":-\\"
+            latin:keyOutputText=":-\\ " />
+        <Key
+            latin:keyLabel=":'("
+            latin:keyOutputText=":'( " />
+        <Key
+            latin:keyLabel=":-D"
+            latin:keyOutputText=":-D "
+            latin:keyEdgeFlags="right" />
+    </Row>
+</Keyboard>
diff --git a/java/res/xml-xlarge/kbd_phone.xml b/java/res/xml-xlarge/kbd_phone.xml
new file mode 100644
index 0000000..107731f
--- /dev/null
+++ b/java/res/xml-xlarge/kbd_phone.xml
@@ -0,0 +1,171 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2010, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<Keyboard
+    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+    latin:keyWidth="7.5%p"
+    latin:horizontalGap="@dimen/key_horizontal_gap"
+    latin:verticalGap="@dimen/key_bottom_gap"
+    latin:keyHeight="@dimen/key_height"
+>
+    <!-- This row is intentionally not marked as a top row -->
+    <Row>
+        <Key
+            latin:codes="@integer/key_tab"
+            latin:keyLabel="@string/label_tab_key"
+            latin:keyWidth="15.0%p"
+            latin:isModifier="true"
+            latin:keyEdgeFlags="left" />
+        <!-- To match one character label size with "Tab", I placed spaces around the char '-'
+             and '+'. -->
+        <Spacer
+            latin:horizontalGap="6.0%p" />
+        <Key
+            latin:codes="45"
+            latin:keyLabel=" - " />
+        <Key
+            latin:codes="43"
+            latin:keyLabel=" + " />
+        <Spacer
+            latin:horizontalGap="11.5%p" />
+        <Key
+            latin:codes="49"
+            latin:keyIcon="@drawable/sym_keyboard_num1"
+            latin:keyWidth="10.5%p " />
+        <Key
+            latin:codes="50"
+            latin:keyIcon="@drawable/sym_keyboard_num2"
+            latin:keyWidth="10.5%p " />
+        <Key
+            latin:codes="51"
+            latin:keyIcon="@drawable/sym_keyboard_num3"
+            latin:keyWidth="10.5%p " />
+        <Spacer
+            latin:horizontalGap="6.0%p" />
+        <Key
+            latin:codes="@integer/key_delete"
+            latin:keyIcon="@drawable/sym_keyboard_delete"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_delete"
+            latin:keyWidth="15.0%p"
+            latin:isModifier="true"
+            latin:isRepeatable="true"
+            latin:keyEdgeFlags="right" />
+    </Row>
+    <Row>
+        <Key
+            latin:codes="@integer/key_symbol"
+            latin:keyLabel="@string/label_more_key"
+            latin:keyWidth="15.0%p"
+            latin:isModifier="true"
+            latin:isSticky="true"
+            latin:keyEdgeFlags="left" />
+        <!-- To match one character label size with "More", I placed spaces around the char ','
+             and '.'. -->
+        <Spacer
+            latin:horizontalGap="6.0%p" />
+        <Key
+            latin:codes="44"
+            latin:keyLabel=" , " />
+        <Key
+            latin:codes="46"
+            latin:keyLabel=" . " />
+        <Spacer
+            latin:horizontalGap="11.5%p" />
+        <Key
+            latin:codes="52"
+            latin:keyIcon="@drawable/sym_keyboard_num4"
+            latin:keyWidth="10.5%p " />
+        <Key
+            latin:codes="53"
+            latin:keyIcon="@drawable/sym_keyboard_num5"
+            latin:keyWidth="10.5%p " />
+        <Key
+            latin:codes="54"
+            latin:keyIcon="@drawable/sym_keyboard_num6"
+            latin:keyWidth="10.5%p " />
+        <Spacer
+            latin:horizontalGap="6.0%p" />
+        <Key
+            latin:codes="@integer/key_return"
+            latin:keyIcon="@drawable/sym_keyboard_return"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_return"
+            latin:keyWidth="15.0%p"
+            latin:isModifier="true"
+            latin:keyEdgeFlags="right" />
+    </Row>
+    <Row>
+        <!-- To match one character label size with "More", I placed spaces around the char '('
+             and ')'. -->
+        <!-- There is an empty area bellow the "More" key and left of the "(" key.  To ignore
+             the touch event on the area, "(" is intentionally not marked as a left edge key. -->
+        <Spacer
+            latin:horizontalGap="21.0%p" />
+        <Key
+            latin:codes="40"
+            latin:keyLabel=" ( " />
+        <Key
+            latin:codes="41"
+            latin:keyLabel=" ) " />
+        <Spacer
+            latin:horizontalGap="11.5%p" />
+        <Key
+            latin:codes="55"
+            latin:keyIcon="@drawable/sym_keyboard_num7"
+            latin:keyWidth="10.5%p " />
+        <Key
+            latin:codes="56"
+            latin:keyIcon="@drawable/sym_keyboard_num8"
+            latin:keyWidth="10.5%p " />
+        <Key
+            latin:codes="57"
+            latin:keyIcon="@drawable/sym_keyboard_num9"
+            latin:keyWidth="10.5%p " />
+        <!-- There is an empty area bellow the "Enter" key and right of the "9" key.  To ignore
+             the touch event on the area, "9" is intentionally not marked as a right edge key. -->
+        </Row>
+    <!-- This row is intentionally not marked as a bottom row -->
+    <Row>
+        <!-- There is an empty area bellow the "More" key and left of the "space" key.  To ignore
+             the touch event on the area, "space" is intentionally not marked as a left edge key. -->
+        <Spacer
+            latin:horizontalGap="21.0%p" />
+        <Key
+            latin:codes="@integer/key_space"
+            latin:keyIcon="@drawable/sym_keyboard_space"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_space"
+            latin:keyWidth="15.0%p" />
+        <Spacer
+            latin:horizontalGap="11.5%p" />
+        <Key
+            latin:codes="42"
+            latin:keyIcon="@drawable/sym_keyboard_numstar"
+            latin:keyWidth="10.5%p " />
+        <Key
+            latin:codes="48"
+            latin:keyIcon="@drawable/sym_keyboard_num0"
+            latin:keyWidth="10.5%p " />
+        <Key
+            latin:codes="35"
+            latin:keyIcon="@drawable/sym_keyboard_numpound"
+            latin:keyWidth="10.5%p " />
+        <!-- There is an empty area bellow the "Enter" key and right of the "#" key.  To ignore
+             the touch event on the area, "#" is intentionally not marked as a right edge key. -->
+    </Row>
+</Keyboard>
diff --git a/java/res/xml-xlarge/kbd_phone_symbols.xml b/java/res/xml-xlarge/kbd_phone_symbols.xml
new file mode 100644
index 0000000..a7dcd32
--- /dev/null
+++ b/java/res/xml-xlarge/kbd_phone_symbols.xml
@@ -0,0 +1,180 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2010, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<Keyboard
+    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+    latin:keyWidth="7.5%p"
+    latin:horizontalGap="@dimen/key_horizontal_gap"
+    latin:verticalGap="@dimen/key_bottom_gap"
+    latin:keyHeight="@dimen/key_height"
+>
+    <!-- This row is intentionally not marked as a top row -->
+    <Row>
+        <Key
+            latin:codes="@integer/key_tab"
+            latin:keyLabel="@string/label_tab_key"
+            latin:keyWidth="15.0%p"
+            latin:isModifier="true"
+            latin:keyEdgeFlags="left" />
+        <Spacer
+            latin:horizontalGap="4.0%p" />
+        <Key
+            latin:codes="44"
+            latin:keyLabel="@string/label_pause_key" />
+        <!-- To match one character label size with "Tab" and "Pause, I placed spaces around the
+             char '-' and '+'. -->
+        <Key
+            latin:codes="45"
+            latin:keyLabel=" - " />
+        <Key
+            latin:codes="43"
+            latin:keyLabel=" + " />
+        <Spacer
+            latin:horizontalGap="6.0%p" />
+        <Key
+            latin:codes="49"
+            latin:keyIcon="@drawable/sym_keyboard_num1"
+            latin:keyWidth="10.5%p " />
+        <Key
+            latin:codes="50"
+            latin:keyIcon="@drawable/sym_keyboard_num2"
+            latin:keyWidth="10.5%p " />
+        <Key
+            latin:codes="51"
+            latin:keyIcon="@drawable/sym_keyboard_num3"
+            latin:keyWidth="10.5%p " />
+        <Spacer
+            latin:horizontalGap="6.0%p" />
+        <Key
+            latin:codes="@integer/key_delete"
+            latin:keyIcon="@drawable/sym_keyboard_delete"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_delete"
+            latin:keyWidth="15.0%p"
+            latin:isModifier="true"
+            latin:isRepeatable="true"
+            latin:keyEdgeFlags="right" />
+    </Row>
+    <Row>
+        <Key
+            latin:codes="@integer/key_symbol"
+            latin:keyLabel="@string/label_more_key"
+            latin:keyWidth="15.0%p"
+            latin:isModifier="true"
+            latin:isSticky="true"
+            latin:keyEdgeFlags="left" />
+        <Spacer
+            latin:horizontalGap="4.0%p" />
+        <Key
+            latin:codes="59"
+            latin:keyLabel="@string/label_wait_key" />
+        <!-- To match one character label size with "More" and "Wait", I placed spaces around the
+             char ',' and '.'. -->
+        <Key
+            latin:codes="44"
+            latin:keyLabel=" , " />
+        <Key
+            latin:codes="46"
+            latin:keyLabel=" . " />
+        <Spacer
+            latin:horizontalGap="6.0%p" />
+        <Key
+            latin:codes="52"
+            latin:keyIcon="@drawable/sym_keyboard_num4"
+            latin:keyWidth="10.5%p " />
+        <Key
+            latin:codes="53"
+            latin:keyIcon="@drawable/sym_keyboard_num5"
+            latin:keyWidth="10.5%p " />
+        <Key
+            latin:codes="54"
+            latin:keyIcon="@drawable/sym_keyboard_num6"
+            latin:keyWidth="10.5%p " />
+        <Spacer
+            latin:horizontalGap="6.0%p" />
+        <Key
+            latin:codes="@integer/key_return"
+            latin:keyIcon="@drawable/sym_keyboard_return"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_return"
+            latin:keyWidth="15.0%p"
+            latin:isModifier="true"
+            latin:keyEdgeFlags="right" />
+    </Row>
+    <Row>
+        <!-- To match one character label size with "More" and etc., I placed spaces around the
+             char 'N', '(' and ')'. -->
+        <!-- There is an empty area bellow the "More" key and left of the "(" key.  To ignore
+             the touch event on the area, "(" is intentionally not marked as a left edge key. -->
+        <Spacer
+            latin:horizontalGap="19.0%p" />
+        <Key
+            latin:codes="78"
+            latin:keyLabel=" N " />
+        <Key
+            latin:codes="40"
+            latin:keyLabel=" ( " />
+        <Key
+            latin:codes="41"
+            latin:keyLabel=" ) " />
+        <Spacer
+            latin:horizontalGap="6.0%p" />
+        <Key
+            latin:codes="55"
+            latin:keyIcon="@drawable/sym_keyboard_num7"
+            latin:keyWidth="10.5%p " />
+        <Key
+            latin:codes="56"
+            latin:keyIcon="@drawable/sym_keyboard_num8"
+            latin:keyWidth="10.5%p " />
+        <Key
+            latin:codes="57"
+            latin:keyIcon="@drawable/sym_keyboard_num9"
+            latin:keyWidth="10.5%p " />
+        <!-- There is an empty area bellow the "Enter" key and right of the "9" key.  To ignore
+             the touch event on the area, "9" is intentionally not marked as a right edge key. -->
+    </Row>
+    <!-- This row is intentionally not marked as a bottom row -->
+    <Row>
+        <!-- There is an empty area bellow the "More" key and left of the "space" key.  To ignore
+             the touch event on the area, "space" is intentionally not marked as a left edge key. -->
+        <Spacer
+            latin:horizontalGap="19.0%p" />
+        <Key
+            latin:codes="@integer/key_space"
+            latin:keyIcon="@drawable/sym_keyboard_space"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_space"
+            latin:keyWidth="22.5%p" />
+        <Spacer
+            latin:horizontalGap="6.0%p" />
+        <Key
+            latin:codes="42"
+            latin:keyIcon="@drawable/sym_keyboard_numstar"
+            latin:keyWidth="10.5%p " />
+        <Key
+            latin:codes="48"
+            latin:keyIcon="@drawable/sym_keyboard_num0"
+            latin:keyWidth="10.5%p " />
+        <Key
+            latin:codes="35"
+            latin:keyIcon="@drawable/sym_keyboard_numpound"
+            latin:keyWidth="10.5%p " />
+        <!-- There is an empty area bellow the "Enter" key and right of the "#" key.  To ignore
+             the touch event on the area, "#" is intentionally not marked as a right edge key. -->
+    </Row>
+</Keyboard>
diff --git a/java/res/xml-xlarge/kbd_popup_template.xml b/java/res/xml-xlarge/kbd_popup_template.xml
new file mode 100644
index 0000000..55ebda5
--- /dev/null
+++ b/java/res/xml-xlarge/kbd_popup_template.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2008, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<Keyboard xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+    latin:keyWidth="7.5%p"
+    latin:horizontalGap="@dimen/key_horizontal_gap"
+    latin:verticalGap="0px"
+    latin:keyHeight="@dimen/key_height"
+    >
+</Keyboard>
diff --git a/java/res/xml-xlarge/kbd_qwerty.xml b/java/res/xml-xlarge/kbd_qwerty.xml
new file mode 100644
index 0000000..6836c2d
--- /dev/null
+++ b/java/res/xml-xlarge/kbd_qwerty.xml
@@ -0,0 +1,109 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2010, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<Keyboard
+    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+    latin:keyWidth="7.5%p"
+    latin:horizontalGap="@dimen/key_horizontal_gap"
+    latin:verticalGap="@dimen/key_bottom_gap"
+    latin:keyHeight="@dimen/key_height"
+>
+    <!-- This row is intentionally not marked as a top row -->
+    <Row>
+        <include latin:keyboardLayout="@xml/kbd_qwerty_row1_common" />
+    </Row>
+    <!-- TODO: We should have new attributes for <Key> to eliminate these excess duplications -->
+    <Row
+        latin:keyboardMode="@+id/mode_normal"
+    >
+        <include latin:keyboardLayout="@xml/kbd_qwerty_row2_common" />
+    </Row>
+    <Row
+        latin:keyboardMode="@+id/mode_url"
+    >
+        <include latin:keyboardLayout="@xml/kbd_qwerty_row2_common" />
+    </Row>
+    <Row
+        latin:keyboardMode="@+id/mode_email"
+    >
+        <include latin:keyboardLayout="@xml/kbd_qwerty_row2_email" />
+    </Row>
+    <Row
+        latin:keyboardMode="@+id/mode_im"
+    >
+        <include latin:keyboardLayout="@xml/kbd_qwerty_row2_common" />
+    </Row>
+    <Row
+        latin:keyboardMode="@+id/mode_webentry"
+    >
+        <include latin:keyboardLayout="@xml/kbd_qwerty_row2_common" />
+    </Row>
+    <Row
+        latin:keyboardMode="@+id/mode_normal"
+    >
+        <include latin:keyboardLayout="@xml/kbd_qwerty_row3_common" />
+    </Row>
+    <Row
+        latin:keyboardMode="@+id/mode_url"
+    >
+        <include latin:keyboardLayout="@xml/kbd_qwerty_row3_common" />
+    </Row>
+    <Row
+        latin:keyboardMode="@+id/mode_email"
+    >
+        <include latin:keyboardLayout="@xml/kbd_qwerty_row3_email" />
+    </Row>
+    <Row
+        latin:keyboardMode="@+id/mode_im"
+    >
+        <include latin:keyboardLayout="@xml/kbd_qwerty_row3_common" />
+    </Row>
+    <Row
+        latin:keyboardMode="@+id/mode_webentry"
+    >
+        <include latin:keyboardLayout="@xml/kbd_qwerty_row3_common" />
+    </Row>
+    <!-- This row is intentionally not marked as a bottom row -->
+    <Row
+        latin:keyboardMode="@+id/mode_normal"
+    >
+        <include latin:keyboardLayout="@xml/kbd_qwerty_row4_common" />
+    </Row>
+    <Row
+        latin:keyboardMode="@+id/mode_url"
+    >
+        <include latin:keyboardLayout="@xml/kbd_qwerty_row4_url" />
+    </Row>
+    <Row
+        latin:keyboardMode="@+id/mode_email"
+    >
+        <include latin:keyboardLayout="@xml/kbd_qwerty_row4_email" />
+    </Row>
+    <Row
+        latin:keyboardMode="@+id/mode_im"
+    >
+        <include latin:keyboardLayout="@xml/kbd_qwerty_row4_im" />
+    </Row>
+    <Row
+        latin:keyboardMode="@+id/mode_webentry"
+    >
+        <include latin:keyboardLayout="@xml/kbd_qwerty_row4_common" />
+    </Row>
+</Keyboard>
diff --git a/java/res/xml-xlarge/kbd_qwerty_row1_common.xml b/java/res/xml-xlarge/kbd_qwerty_row1_common.xml
new file mode 100644
index 0000000..98b8571
--- /dev/null
+++ b/java/res/xml-xlarge/kbd_qwerty_row1_common.xml
@@ -0,0 +1,94 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2010, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<merge
+    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+>
+    <Key
+        latin:codes="@integer/key_tab"
+        latin:keyLabel="Tab"
+        latin:keyWidth="7.0%p"
+        latin:isModifier="true"
+        latin:keyEdgeFlags="left" />
+    <Key
+        latin:keyLabel="q"
+        latin:keyHintIcon="@drawable/key_hint_1_holo"
+        latin:popupKeyboard="@xml/kbd_popup_template"
+        latin:popupCharacters="@string/alternates_for_q" />
+    <Key
+        latin:keyLabel="w"
+        latin:keyHintIcon="@drawable/key_hint_2_holo"
+        latin:popupKeyboard="@xml/kbd_popup_template"
+        latin:popupCharacters="@string/alternates_for_w" />
+    <Key
+        latin:keyLabel="e"
+        latin:keyHintIcon="@drawable/key_hint_3_holo"
+        latin:popupKeyboard="@xml/kbd_popup_template"
+        latin:popupCharacters="@string/alternates_for_e" />
+    <Key
+        latin:keyLabel="r"
+        latin:keyHintIcon="@drawable/key_hint_4_holo"
+        latin:popupKeyboard="@xml/kbd_popup_template"
+        latin:popupCharacters="@string/alternates_for_r" />
+    <Key
+        latin:keyLabel="t"
+        latin:keyHintIcon="@drawable/key_hint_5_holo"
+        latin:popupKeyboard="@xml/kbd_popup_template"
+        latin:popupCharacters="@string/alternates_for_t" />
+    <Key
+        latin:keyLabel="y"
+        latin:keyHintIcon="@drawable/key_hint_6_holo"
+        latin:popupKeyboard="@xml/kbd_popup_template"
+        latin:popupCharacters="@string/alternates_for_y" />
+    <Key
+        latin:keyLabel="u"
+        latin:keyHintIcon="@drawable/key_hint_7_holo"
+        latin:popupKeyboard="@xml/kbd_popup_template"
+        latin:popupCharacters="@string/alternates_for_u" />
+    <Key
+        latin:keyLabel="i"
+        latin:keyHintIcon="@drawable/key_hint_8_holo"
+        latin:popupKeyboard="@xml/kbd_popup_template"
+        latin:popupCharacters="@string/alternates_for_i" />
+    <Key
+        latin:keyLabel="o"
+        latin:keyHintIcon="@drawable/key_hint_9_holo"
+        latin:popupKeyboard="@xml/kbd_popup_template"
+        latin:popupCharacters="@string/alternates_for_o" />
+    <Key
+        latin:keyLabel="p"
+        latin:keyHintIcon="@drawable/key_hint_0_holo"
+        latin:popupKeyboard="@xml/kbd_popup_template"
+        latin:popupCharacters="@string/alternates_for_p" />
+    <Key
+        latin:keyLabel="="
+        latin:temporaryShiftKeyLabel="+"
+        latin:keyHintIcon="@drawable/key_hint_plus_holo"
+        latin:popupKeyboard="@xml/kbd_popup_template"
+        latin:popupCharacters="+" />
+    <Key
+        latin:codes="@integer/key_delete"
+        latin:keyIcon="@drawable/sym_keyboard_delete"
+        latin:iconPreview="@drawable/sym_keyboard_feedback_delete"
+        latin:keyWidth="10.5%p"
+        latin:isModifier="true"
+        latin:isRepeatable="true"
+        latin:keyEdgeFlags="right" />
+</merge>
diff --git a/java/res/xml-xlarge/kbd_qwerty_row2_common.xml b/java/res/xml-xlarge/kbd_qwerty_row2_common.xml
new file mode 100644
index 0000000..907de3c
--- /dev/null
+++ b/java/res/xml-xlarge/kbd_qwerty_row2_common.xml
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2010, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<merge
+    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+>
+    <Key
+        latin:codes="@integer/key_symbol"
+        latin:keyLabel="@string/label_symbol_key"
+        latin:keyWidth="8.75%p"
+        latin:isModifier="true"
+        latin:keyEdgeFlags="left" />
+    <Key
+        latin:keyLabel="a"
+        latin:popupKeyboard="@xml/kbd_popup_template"
+        latin:popupCharacters="@string/alternates_for_a" />
+    <Key
+        latin:keyLabel="s"
+        latin:popupKeyboard="@xml/kbd_popup_template"
+        latin:popupCharacters="@string/alternates_for_s" />
+    <Key
+        latin:keyLabel="d"
+        latin:popupKeyboard="@xml/kbd_popup_template"
+        latin:popupCharacters="@string/alternates_for_d" />
+    <Key
+        latin:keyLabel="f" />
+    <Key
+        latin:keyLabel="g"
+        latin:popupKeyboard="@xml/kbd_popup_template"
+        latin:popupCharacters="@string/alternates_for_g" />
+    <Key
+        latin:keyLabel="h" />
+    <Key
+        latin:keyLabel="j" />
+    <Key
+        latin:keyLabel="k" />
+    <Key
+        latin:keyLabel="l"
+        latin:popupKeyboard="@xml/kbd_popup_template"
+        latin:popupCharacters="@string/alternates_for_l" />
+    <Key
+        latin:keyLabel=";"
+        latin:temporaryShiftKeyLabel=":"
+        latin:keyHintIcon="@drawable/key_hint_colon_holo"
+        latin:popupKeyboard="@xml/kbd_popup_template"
+        latin:popupCharacters=":" />
+    <Key
+        latin:keyLabel="\'"
+        latin:temporaryShiftKeyLabel="&quot;"
+        latin:keyHintIcon="@drawable/key_hint_quote_holo"
+        latin:popupKeyboard="@xml/kbd_popup_template"
+        latin:popupCharacters="&quot;" />
+    <Key
+        latin:codes="@integer/key_return"
+        latin:keyIcon="@drawable/sym_keyboard_return"
+        latin:iconPreview="@drawable/sym_keyboard_feedback_return"
+        latin:keyWidth="8.75%p"
+        latin:isModifier="true"
+        latin:keyEdgeFlags="right" />
+</merge>
diff --git a/java/res/xml-xlarge/kbd_qwerty_row2_email.xml b/java/res/xml-xlarge/kbd_qwerty_row2_email.xml
new file mode 100644
index 0000000..e274537
--- /dev/null
+++ b/java/res/xml-xlarge/kbd_qwerty_row2_email.xml
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2010, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<merge
+    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+>
+    <Key
+        latin:codes="@integer/key_symbol"
+        latin:keyLabel="@string/label_symbol_key"
+        latin:keyWidth="8.75%p"
+        latin:isModifier="true"
+        latin:keyEdgeFlags="left" />
+    <Key
+        latin:keyLabel="a"
+        latin:popupKeyboard="@xml/kbd_popup_template"
+        latin:popupCharacters="@string/alternates_for_a" />
+    <Key
+        latin:keyLabel="s"
+        latin:popupKeyboard="@xml/kbd_popup_template"
+        latin:popupCharacters="@string/alternates_for_s" />
+    <Key
+        latin:keyLabel="d"
+        latin:popupKeyboard="@xml/kbd_popup_template"
+        latin:popupCharacters="@string/alternates_for_d" />
+    <Key
+        latin:keyLabel="f" />
+    <Key
+        latin:keyLabel="g"
+        latin:popupKeyboard="@xml/kbd_popup_template"
+        latin:popupCharacters="@string/alternates_for_g" />
+    <Key
+        latin:keyLabel="h" />
+    <Key
+        latin:keyLabel="j" />
+    <Key
+        latin:keyLabel="k" />
+    <Key
+        latin:keyLabel="l"
+        latin:popupKeyboard="@xml/kbd_popup_template"
+        latin:popupCharacters="@string/alternates_for_l" />
+    <Key
+        latin:keyLabel=";" />
+    <Key
+        latin:keyLabel="\'"
+        latin:temporaryShiftKeyLabel="&quot;"
+        latin:keyHintIcon="@drawable/key_hint_quote_holo"
+        latin:popupKeyboard="@xml/kbd_popup_template"
+        latin:popupCharacters="&quot;" />
+    <Key
+        latin:codes="@integer/key_return"
+        latin:keyIcon="@drawable/sym_keyboard_return"
+        latin:iconPreview="@drawable/sym_keyboard_feedback_return"
+        latin:keyWidth="8.75%p"
+        latin:isModifier="true"
+        latin:keyEdgeFlags="right" />
+</merge>
diff --git a/java/res/xml-xlarge/kbd_qwerty_row3_common.xml b/java/res/xml-xlarge/kbd_qwerty_row3_common.xml
new file mode 100644
index 0000000..b3fa466
--- /dev/null
+++ b/java/res/xml-xlarge/kbd_qwerty_row3_common.xml
@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2010, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<merge
+    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+>
+    <Key
+        latin:codes="@integer/key_shift"
+        latin:keyIcon="@drawable/sym_keyboard_shift"
+        latin:iconPreview="@drawable/sym_keyboard_feedback_shift"
+        latin:keyWidth="12.5%p"
+        latin:isModifier="true"
+        latin:isSticky="true"
+        latin:keyEdgeFlags="left" />
+    <Key
+        latin:keyLabel="z"
+        latin:popupKeyboard="@xml/kbd_popup_template"
+        latin:popupCharacters="@string/alternates_for_z" />
+    <Key
+        latin:keyLabel="x" />
+    <Key
+        latin:keyLabel="c"
+        latin:popupKeyboard="@xml/kbd_popup_template"
+        latin:popupCharacters="@string/alternates_for_c" />
+    <Key
+        latin:keyLabel="v"
+        latin:popupKeyboard="@xml/kbd_popup_template"
+        latin:popupCharacters="@string/alternates_for_v" />
+    <Key
+        latin:keyLabel="b" />
+    <Key
+        latin:keyLabel="n"
+        latin:popupKeyboard="@xml/kbd_popup_template"
+        latin:popupCharacters="@string/alternates_for_n" />
+    <Key
+        latin:keyLabel="m" />
+    <Key
+        latin:keyLabel=","
+        latin:temporaryShiftKeyLabel="*"
+        latin:keyHintIcon="@drawable/key_hint_star_holo"
+        latin:popupKeyboard="@xml/kbd_popup_template"
+        latin:popupCharacters="*" />
+    <Key
+        latin:keyLabel="."
+        latin:temporaryShiftKeyLabel="!"
+        latin:keyHintIcon="@drawable/key_hint_exclamation_holo"
+        latin:popupKeyboard="@xml/kbd_popup_template"
+        latin:popupCharacters="!" />
+    <Key
+        latin:keyLabel="/"
+        latin:temporaryShiftKeyLabel="\?"
+        latin:keyHintIcon="@drawable/key_hint_question_holo"
+        latin:popupKeyboard="@xml/kbd_popup_template"
+        latin:popupCharacters="\?" />
+    <Key
+        latin:codes="@integer/key_shift"
+        latin:keyIcon="@drawable/sym_keyboard_shift"
+        latin:iconPreview="@drawable/sym_keyboard_feedback_shift"
+        latin:keyWidth="12.5%p"
+        latin:isModifier="true"
+        latin:isSticky="true"
+        latin:keyEdgeFlags="right" />
+</merge>
diff --git a/java/res/xml-xlarge/kbd_qwerty_row3_email.xml b/java/res/xml-xlarge/kbd_qwerty_row3_email.xml
new file mode 100644
index 0000000..d498406
--- /dev/null
+++ b/java/res/xml-xlarge/kbd_qwerty_row3_email.xml
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2010, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<merge
+    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+>
+    <Key
+        latin:codes="@integer/key_shift"
+        latin:keyIcon="@drawable/sym_keyboard_shift"
+        latin:iconPreview="@drawable/sym_keyboard_feedback_shift"
+        latin:keyWidth="12.5%p"
+        latin:isModifier="true"
+        latin:isSticky="true"
+        latin:keyEdgeFlags="left" />
+    <Key
+        latin:keyLabel="z"
+        latin:popupKeyboard="@xml/kbd_popup_template"
+        latin:popupCharacters="@string/alternates_for_z" />
+    <Key
+        latin:keyLabel="x" />
+    <Key
+        latin:keyLabel="c"
+        latin:popupKeyboard="@xml/kbd_popup_template"
+        latin:popupCharacters="@string/alternates_for_c" />
+    <Key
+        latin:keyLabel="v"
+        latin:popupKeyboard="@xml/kbd_popup_template"
+        latin:popupCharacters="@string/alternates_for_v" />
+    <Key
+        latin:keyLabel="b" />
+    <Key
+        latin:keyLabel="n"
+        latin:popupKeyboard="@xml/kbd_popup_template"
+        latin:popupCharacters="@string/alternates_for_n" />
+    <Key
+        latin:keyLabel="m" />
+    <Key
+        latin:keyLabel="," />
+    <Key
+        latin:keyLabel="." />
+    <Key
+        latin:keyLabel="\@" />
+    <Key
+        latin:codes="@integer/key_shift"
+        latin:keyIcon="@drawable/sym_keyboard_shift"
+        latin:iconPreview="@drawable/sym_keyboard_feedback_shift"
+        latin:keyWidth="12.5%p"
+        latin:isModifier="true"
+        latin:isSticky="true"
+        latin:keyEdgeFlags="right" />
+</merge>
diff --git a/java/res/xml-xlarge/kbd_qwerty_row4_common.xml b/java/res/xml-xlarge/kbd_qwerty_row4_common.xml
new file mode 100644
index 0000000..63e5a24
--- /dev/null
+++ b/java/res/xml-xlarge/kbd_qwerty_row4_common.xml
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2010, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<merge
+    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+>
+    <Spacer
+        latin:horizontalGap="16.25%p" />
+    <Key
+        latin:keyLabel="("
+        latin:temporaryShiftKeyLabel="&lt;"
+        latin:keyHintIcon="@drawable/key_hint_smaller_holo"
+        latin:popupKeyboard="@xml/kbd_popup_template"
+        latin:popupCharacters="&lt;" />
+    <Key
+        latin:keyLabel=")"
+        latin:temporaryShiftKeyLabel="&gt;"
+        latin:keyHintIcon="@drawable/key_hint_larger_holo"
+        latin:popupKeyboard="@xml/kbd_popup_template"
+        latin:popupCharacters="&gt;" />
+    <Key
+        latin:codes="@integer/key_space"
+        latin:keyIcon="@drawable/sym_keyboard_space"
+        latin:iconPreview="@drawable/sym_keyboard_feedback_space"
+        latin:keyWidth="37.5%p"
+        latin:isModifier="true" />
+    <Key
+        latin:keyLabel="_"
+        latin:temporaryShiftKeyLabel="\@"
+        latin:keyHintIcon="@drawable/key_hint_at_holo"
+        latin:popupKeyboard="@xml/kbd_popup_template"
+        latin:popupCharacters="\@" />
+    <Key
+        latin:keyLabel="-"
+        latin:temporaryShiftKeyLabel="#"
+        latin:keyHintIcon="@drawable/keyboard_hint_doublecross"
+        latin:popupKeyboard="@xml/kbd_popup_template"
+        latin:popupCharacters="#" />
+</merge>
diff --git a/java/res/xml-xlarge/kbd_qwerty_row4_email.xml b/java/res/xml-xlarge/kbd_qwerty_row4_email.xml
new file mode 100644
index 0000000..c5a5b06
--- /dev/null
+++ b/java/res/xml-xlarge/kbd_qwerty_row4_email.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2010, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<merge
+    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+>
+    <Spacer
+        latin:horizontalGap="16.25%p" />
+    <Key
+        latin:keyLabel=".com"
+        latin:keyOutputText=".com"
+        latin:keyWidth="15.0%p" />
+    <Key
+        latin:codes="@integer/key_space"
+        latin:keyIcon="@drawable/sym_keyboard_space"
+        latin:iconPreview="@drawable/sym_keyboard_feedback_space"
+        latin:keyWidth="37.5%p"
+        latin:isModifier="true" />
+    <Key
+        latin:keyLabel="_" />
+    <Key
+        latin:keyLabel="-" />
+</merge>
diff --git a/java/res/xml-xlarge/kbd_qwerty_row4_im.xml b/java/res/xml-xlarge/kbd_qwerty_row4_im.xml
new file mode 100644
index 0000000..57af233
--- /dev/null
+++ b/java/res/xml-xlarge/kbd_qwerty_row4_im.xml
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2010, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<merge
+    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+>
+    <Spacer
+        latin:horizontalGap="16.25%p" />
+    <Key
+        latin:keyLabel=":-)"
+        latin:keyOutputText=":-)"
+        latin:keyHintIcon="@drawable/hint_popup"
+        latin:popupKeyboard="@xml/popup_smileys"
+        latin:keyWidth="15.0%p" />
+    <Key
+        latin:codes="@integer/key_space"
+        latin:keyIcon="@drawable/sym_keyboard_space"
+        latin:iconPreview="@drawable/sym_keyboard_feedback_space"
+        latin:keyWidth="37.5%p"
+        latin:isModifier="true" />
+    <Key
+        latin:keyLabel="_"
+        latin:temporaryShiftKeyLabel="\@"
+        latin:keyHintIcon="@drawable/key_hint_at_holo"
+        latin:popupKeyboard="@xml/kbd_popup_template"
+        latin:popupCharacters="\@" />
+    <Key
+        latin:keyLabel="-"
+        latin:temporaryShiftKeyLabel="#"
+        latin:keyHintIcon="@drawable/keyboard_hint_doublecross"
+        latin:popupKeyboard="@xml/kbd_popup_template"
+        latin:popupCharacters="#" />
+</merge>
diff --git a/java/res/xml-xlarge/kbd_qwerty_row4_url.xml b/java/res/xml-xlarge/kbd_qwerty_row4_url.xml
new file mode 100644
index 0000000..dd57b88
--- /dev/null
+++ b/java/res/xml-xlarge/kbd_qwerty_row4_url.xml
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2010, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<merge
+    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+>
+    <Spacer
+        latin:horizontalGap="16.25%p" />
+    <Key
+        latin:keyLabel=".com"
+        latin:keyOutputText=".com"
+        latin:keyWidth="15.0%p" />
+    <Key
+        latin:codes="@integer/key_space"
+        latin:keyIcon="@drawable/sym_keyboard_space"
+        latin:iconPreview="@drawable/sym_keyboard_feedback_space"
+        latin:keyWidth="37.5%p"
+        latin:isModifier="true" />
+    <Key
+        latin:keyLabel="_"
+        latin:temporaryShiftKeyLabel="\@"
+        latin:keyHintIcon="@drawable/key_hint_at_holo"
+        latin:popupKeyboard="@xml/kbd_popup_template"
+        latin:popupCharacters="\@" />
+    <Key
+        latin:keyLabel="-"
+        latin:temporaryShiftKeyLabel="#"
+        latin:keyHintIcon="@drawable/keyboard_hint_doublecross"
+        latin:popupKeyboard="@xml/kbd_popup_template"
+        latin:popupCharacters="#" />
+</merge>
diff --git a/java/res/xml-xlarge/kbd_symbols.xml b/java/res/xml-xlarge/kbd_symbols.xml
new file mode 100644
index 0000000..34fc114
--- /dev/null
+++ b/java/res/xml-xlarge/kbd_symbols.xml
@@ -0,0 +1,161 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2010, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<Keyboard
+    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+    latin:keyWidth="7.5%p"
+    latin:horizontalGap="@dimen/key_horizontal_gap"
+    latin:verticalGap="@dimen/key_bottom_gap"
+    latin:keyHeight="@dimen/key_height"
+>
+    <!-- This row is intentionally not marked as a top row -->
+    <Row>
+        <Key
+            latin:codes="@integer/key_tab"
+            latin:keyLabel="Tab"
+            latin:keyWidth="7.0%p"
+            latin:isModifier="true"
+            latin:keyEdgeFlags="left" />
+        <Key
+            latin:keyLabel="1" />
+        <Key
+            latin:keyLabel="2" />
+        <Key
+            latin:keyLabel="3" />
+        <Key
+            latin:keyLabel="4" />
+        <Key
+            latin:keyLabel="5" />
+        <Key
+            latin:keyLabel="6" />
+        <Key
+            latin:keyLabel="7" />
+        <Key
+            latin:keyLabel="8" />
+        <Key
+            latin:keyLabel="9" />
+        <Key
+            latin:keyLabel="0" />
+        <Key
+            latin:keyLabel="~" />
+        <Key
+            latin:codes="@integer/key_delete"
+            latin:keyIcon="@drawable/sym_keyboard_delete"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_delete"
+            latin:keyWidth="10.5%p"
+            latin:isModifier="true"
+            latin:isRepeatable="true"
+            latin:keyEdgeFlags="right" />
+    </Row>
+    <Row>
+        <Key
+            latin:codes="@integer/key_symbol"
+            latin:keyLabel="@string/label_alpha_key"
+            latin:keyWidth="8.75%p"
+            latin:isModifier="true"
+            latin:keyEdgeFlags="left" />
+        <Key
+            latin:keyLabel="\@" />
+        <Key
+            latin:keyLabel="#" />
+        <Key
+            latin:keyLabel="$" />
+        <Key
+            latin:keyLabel="%" />
+        <Key
+            latin:keyLabel="^" />
+        <Key
+            latin:keyLabel="&amp;" />
+        <Key
+            latin:keyLabel="*" />
+        <Key
+            latin:keyLabel="-" />
+        <Key
+            latin:keyLabel="+" />
+        <Key
+            latin:keyLabel="(" />
+        <Key
+            latin:keyLabel=")" />
+        <Key
+            latin:codes="@integer/key_return"
+            latin:keyIcon="@drawable/sym_keyboard_return"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_return"
+            latin:keyWidth="8.75%p"
+            latin:isModifier="true"
+            latin:keyEdgeFlags="right" />
+    </Row>
+    <Row>
+        <Key
+            latin:codes="@integer/key_shift"
+            latin:keyLabel="@string/label_more_key"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_shift"
+            latin:keyWidth="12.5%p"
+            latin:isModifier="true"
+            latin:isSticky="true"
+            latin:keyEdgeFlags="left" />
+        <Key
+            latin:keyLabel="!" />
+        <Key
+            latin:keyLabel="&quot;" />
+        <Key
+            latin:keyLabel="\'" />
+        <Key
+            latin:keyLabel=":" />
+        <Key
+            latin:keyLabel=";" />
+        <Key
+            latin:keyLabel="/" />
+        <Key
+            latin:keyLabel="\\" />
+        <Key
+            latin:keyLabel="," />
+        <Key
+            latin:keyLabel="." />
+        <Key
+            latin:keyLabel="\?" />
+        <Key
+            latin:codes="@integer/key_shift"
+            latin:keyLabel="@string/label_more_key"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_shift"
+            latin:keyWidth="12.5%p"
+            latin:isModifier="true"
+            latin:isSticky="true"
+            latin:keyEdgeFlags="right" />
+    </Row>
+    <!-- This row is intentionally not marked as a bottom row -->
+    <Row>
+        <Spacer
+            latin:horizontalGap="16.25%p" />
+        <Key
+            latin:keyLabel="&lt;" />
+        <Key
+            latin:keyLabel="&gt;" />
+        <Key
+            latin:codes="@integer/key_space"
+            latin:keyIcon="@drawable/sym_keyboard_space"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_space"
+            latin:keyWidth="37.5%p"
+            latin:isModifier="true" />
+        <Key
+            latin:keyLabel="[" />
+        <Key
+            latin:keyLabel="]" />
+    </Row>
+</Keyboard>
diff --git a/java/res/xml-xlarge/kbd_symbols_shift.xml b/java/res/xml-xlarge/kbd_symbols_shift.xml
new file mode 100644
index 0000000..8ed1c11
--- /dev/null
+++ b/java/res/xml-xlarge/kbd_symbols_shift.xml
@@ -0,0 +1,161 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2010, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<Keyboard
+    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+    latin:keyWidth="7.5%p"
+    latin:horizontalGap="@dimen/key_horizontal_gap"
+    latin:verticalGap="@dimen/key_bottom_gap"
+    latin:keyHeight="@dimen/key_height"
+>
+    <!-- This row is intentionally not marked as a top row -->
+    <Row>
+        <Key
+            latin:codes="@integer/key_tab"
+            latin:keyLabel="Tab"
+            latin:keyWidth="7.0%p"
+            latin:isModifier="true"
+            latin:keyEdgeFlags="left" />
+        <Key
+            latin:keyLabel="∞" />
+        <Key
+            latin:keyLabel="±" />
+        <Key
+            latin:keyLabel="|" />
+        <Key
+            latin:keyLabel="•" />
+        <Key
+            latin:keyLabel="√" />
+        <Key
+            latin:keyLabel="π" />
+        <Key
+            latin:keyLabel="÷" />
+        <Key
+            latin:keyLabel="×" />
+        <Key
+            latin:keyLabel="±" />
+        <Key
+            latin:keyLabel="∆" />
+        <Key
+            latin:keyLabel="≈" />
+        <Key
+            latin:codes="@integer/key_delete"
+            latin:keyIcon="@drawable/sym_keyboard_delete"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_delete"
+            latin:keyWidth="10.5%p"
+            latin:isModifier="true"
+            latin:isRepeatable="true"
+            latin:keyEdgeFlags="right" />
+    </Row>
+    <Row>
+        <Key
+            latin:codes="@integer/key_symbol"
+            latin:keyLabel="@string/label_alpha_key"
+            latin:keyWidth="8.75%p"
+            latin:isModifier="true"
+            latin:keyEdgeFlags="left" />
+        <Key
+            latin:keyLabel="£" />
+        <Key
+            latin:keyLabel="¢" />
+        <Key
+            latin:keyLabel="¥" />
+        <Key
+            latin:keyLabel="€" />
+        <Key
+            latin:keyLabel="¼" />
+        <Key
+            latin:keyLabel="½" />
+        <Key
+            latin:keyLabel="¾" />
+        <Key
+            latin:keyLabel="_" />
+        <Key
+            latin:keyLabel="=" />
+        <Key
+            latin:keyLabel="{" />
+        <Key
+            latin:keyLabel="}" />
+        <Key
+            latin:codes="@integer/key_return"
+            latin:keyIcon="@drawable/sym_keyboard_return"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_return"
+            latin:keyWidth="8.75%p"
+            latin:isModifier="true"
+            latin:keyEdgeFlags="right" />
+    </Row>
+    <Row>
+        <Key
+            latin:codes="@integer/key_shift"
+            latin:keyLabel="@string/label_more_key"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_shift"
+            latin:keyWidth="12.5%p"
+            latin:isModifier="true"
+            latin:isSticky="true"
+            latin:keyEdgeFlags="left" />
+        <Key
+            latin:keyLabel="¡" />
+        <Key
+            latin:keyLabel="°" />
+        <Key
+            latin:keyLabel="©" />
+        <Key
+            latin:keyLabel="®" />
+        <Key
+            latin:keyLabel="¶" />
+        <Key
+            latin:keyLabel="§" />
+        <Key
+            latin:keyLabel="¤" />
+        <Key
+            latin:keyLabel="¬" />
+        <Key
+            latin:keyLabel="…" />
+        <Key
+            latin:keyLabel="¿" />
+        <Key
+            latin:codes="@integer/key_shift"
+            latin:keyLabel="@string/label_more_key"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_shift"
+            latin:keyWidth="12.5%p"
+            latin:isModifier="true"
+            latin:isSticky="true"
+            latin:keyEdgeFlags="right" />
+    </Row>
+    <!-- This row is intentionally not marked as a bottom row -->
+    <Row>
+        <Spacer
+            latin:horizontalGap="16.25%p" />
+        <Key
+            latin:keyLabel="≤" />
+        <Key
+            latin:keyLabel="≥" />
+        <Key
+            latin:codes="@integer/key_space"
+            latin:keyIcon="@drawable/sym_keyboard_space"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_space"
+            latin:keyWidth="37.5%p"
+            latin:isModifier="true" />
+        <Key
+            latin:keyLabel="²" />
+        <Key
+            latin:keyLabel="³" />
+    </Row>
+</Keyboard>
diff --git a/java/res/xml-xlarge/popup_smileys.xml b/java/res/xml-xlarge/popup_smileys.xml
new file mode 100644
index 0000000..2cfcf74
--- /dev/null
+++ b/java/res/xml-xlarge/popup_smileys.xml
@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2010, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<Keyboard
+    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+    latin:keyWidth="7.5%p"
+    latin:horizontalGap="0px"
+    latin:verticalGap="0px"
+    latin:keyHeight="@dimen/popup_key_height"
+>
+    <Row
+        latin:rowEdgeFlags="top"
+    >
+        <Key
+            latin:keyLabel=":-)"
+            latin:keyOutputText=":-) "
+            latin:keyEdgeFlags="left" />
+        <Key
+            latin:keyLabel=":-("
+            latin:keyOutputText=":-( " />
+        <Key
+            latin:keyLabel=";-)"
+            latin:keyOutputText=";-) " />
+        <Key
+            latin:keyLabel=":-P"
+            latin:keyOutputText=":-P " />
+        <Key
+            latin:keyLabel="=-O"
+            latin:keyOutputText="=-O "
+            latin:keyEdgeFlags="right" />
+    </Row>
+    <Row>
+        <Key
+            latin:keyLabel=":-*"
+            latin:keyOutputText=":-* "
+            latin:keyEdgeFlags="left" />
+        <Key
+            latin:keyLabel=":O"
+            latin:keyOutputText=":O " />
+        <Key
+            latin:keyLabel="B-)"
+            latin:keyOutputText="B-) " />
+        <Key
+            latin:keyLabel=":-$"
+            latin:keyOutputText=":-$ " />
+        <Key
+            latin:keyLabel=":-!"
+            latin:keyOutputText=":-! "
+            latin:keyEdgeFlags="right" />
+    </Row>
+    <Row
+        latin:rowEdgeFlags="bottom"
+    >
+        <Key
+            latin:keyLabel=":-["
+            latin:keyOutputText=":-[ "
+            latin:keyEdgeFlags="left" />
+        <Key
+            latin:keyLabel="O:-)"
+            latin:keyOutputText="O:-) " />
+        <Key
+            latin:keyLabel=":-\\"
+            latin:keyOutputText=":-\\ " />
+        <Key
+            latin:keyLabel=":'("
+            latin:keyOutputText=":'( " />
+        <Key
+            latin:keyLabel=":-D"
+            latin:keyOutputText=":-D "
+            latin:keyEdgeFlags="right" />
+    </Row>
+</Keyboard>
diff --git a/java/res/xml/kbd_phone.xml b/java/res/xml/kbd_phone.xml
index 10774c6..e6f6a09 100644
--- a/java/res/xml/kbd_phone.xml
+++ b/java/res/xml/kbd_phone.xml
@@ -19,88 +19,88 @@
 -->
 
 <Keyboard
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    android:keyWidth="26.67%p"
-    android:horizontalGap="0px"
-    android:verticalGap="@dimen/key_bottom_gap"
-    android:keyHeight="@dimen/key_height"
+    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+    latin:keyWidth="26.67%p"
+    latin:horizontalGap="@dimen/key_horizontal_gap"
+    latin:verticalGap="@dimen/key_bottom_gap"
+    latin:keyHeight="@dimen/key_height"
 >
     <Row
-        android:rowEdgeFlags="top"
+        latin:rowEdgeFlags="top"
     >
         <Key
-            android:codes="49"
-            android:keyIcon="@drawable/sym_keyboard_num1"
-            android:keyEdgeFlags="left" />
+            latin:codes="49"
+            latin:keyIcon="@drawable/sym_keyboard_num1"
+            latin:keyEdgeFlags="left" />
         <Key
-            android:codes="50"
-            android:keyIcon="@drawable/sym_keyboard_num2" />
+            latin:codes="50"
+            latin:keyIcon="@drawable/sym_keyboard_num2" />
         <Key
-            android:codes="51"
-            android:keyIcon="@drawable/sym_keyboard_num3" />
+            latin:codes="51"
+            latin:keyIcon="@drawable/sym_keyboard_num3" />
         <Key
-            android:keyLabel="-"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
+            latin:keyLabel="-"
+            latin:keyWidth="20%p"
+            latin:isModifier="true"
+            latin:keyEdgeFlags="right" />
     </Row>
     <Row>
         <Key
-            android:codes="52"
-            android:keyIcon="@drawable/sym_keyboard_num4"
-            android:keyEdgeFlags="left" />
+            latin:codes="52"
+            latin:keyIcon="@drawable/sym_keyboard_num4"
+            latin:keyEdgeFlags="left" />
         <Key
-            android:codes="53"
-            android:keyIcon="@drawable/sym_keyboard_num5" />
+            latin:codes="53"
+            latin:keyIcon="@drawable/sym_keyboard_num5" />
         <Key
-            android:codes="54"
-            android:keyIcon="@drawable/sym_keyboard_num6" />
+            latin:codes="54"
+            latin:keyIcon="@drawable/sym_keyboard_num6" />
         <Key
-            android:keyLabel="."
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
+            latin:keyLabel="."
+            latin:keyWidth="20%p"
+            latin:isModifier="true"
+            latin:keyEdgeFlags="right" />
     </Row>
     <Row>
         <Key
-            android:codes="55"
-            android:keyIcon="@drawable/sym_keyboard_num7"
-            android:keyEdgeFlags="left" />
+            latin:codes="55"
+            latin:keyIcon="@drawable/sym_keyboard_num7"
+            latin:keyEdgeFlags="left" />
         <Key
-            android:codes="56"
-            android:keyIcon="@drawable/sym_keyboard_num8" />
+            latin:codes="56"
+            latin:keyIcon="@drawable/sym_keyboard_num8" />
         <Key
-            android:codes="57"
-            android:keyIcon="@drawable/sym_keyboard_num9" />
+            latin:codes="57"
+            latin:keyIcon="@drawable/sym_keyboard_num9" />
         <Key
-            android:codes="@integer/key_delete"
-            android:keyIcon="@drawable/sym_keyboard_delete"
-            android:iconPreview="@drawable/sym_keyboard_feedback_delete"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:isRepeatable="true"
-            android:keyEdgeFlags="right" />
+            latin:codes="@integer/key_delete"
+            latin:keyIcon="@drawable/sym_keyboard_delete"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_delete"
+            latin:keyWidth="20%p"
+            latin:isModifier="true"
+            latin:isRepeatable="true"
+            latin:keyEdgeFlags="right" />
     </Row>
     <Row
-        android:rowEdgeFlags="bottom"
+        latin:rowEdgeFlags="bottom"
     >
         <Key
-            android:codes="@integer/key_symbol"
-            android:keyIcon="@drawable/sym_keyboard_numalt"
-            android:iconPreview="@drawable/sym_keyboard_feedback_numalt"
-            android:keyEdgeFlags="left" />
+            latin:codes="@integer/key_symbol"
+            latin:keyIcon="@drawable/sym_keyboard_numalt"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_numalt"
+            latin:keyEdgeFlags="left" />
         <Key
-            android:codes="48"
-            android:keyIcon="@drawable/sym_keyboard_num0" />
+            latin:codes="48"
+            latin:keyIcon="@drawable/sym_keyboard_num0" />
         <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space" />
+            latin:codes="@integer/key_space"
+            latin:keyIcon="@drawable/sym_keyboard_space"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_space" />
         <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_keyboard_return"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
+            latin:codes="@integer/key_return"
+            latin:keyIcon="@drawable/sym_keyboard_return"
+            latin:keyWidth="20%p"
+            latin:isModifier="true"
+            latin:keyEdgeFlags="right" />
     </Row>
 </Keyboard>
diff --git a/java/res/xml/kbd_phone_black.xml b/java/res/xml/kbd_phone_black.xml
index 5afa9a1..86759d6 100644
--- a/java/res/xml/kbd_phone_black.xml
+++ b/java/res/xml/kbd_phone_black.xml
@@ -19,83 +19,83 @@
 -->
 
 <Keyboard
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    android:keyWidth="26.67%p"
-    android:horizontalGap="0px"
-    android:verticalGap="@dimen/key_bottom_gap"
-    android:keyHeight="@dimen/key_height"
+    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+    latin:keyWidth="26.67%p"
+    latin:horizontalGap="@dimen/key_horizontal_gap"
+    latin:verticalGap="@dimen/key_bottom_gap"
+    latin:keyHeight="@dimen/key_height"
 >
     <Row
-        android:rowEdgeFlags="top"
+        latin:rowEdgeFlags="top"
     >
         <Key
-            android:codes="49"
-            android:keyIcon="@drawable/sym_bkeyboard_num1"
-            android:keyEdgeFlags="left" />
+            latin:codes="49"
+            latin:keyIcon="@drawable/sym_bkeyboard_num1"
+            latin:keyEdgeFlags="left" />
         <Key
-            android:codes="50"
-            android:keyIcon="@drawable/sym_bkeyboard_num2" />
+            latin:codes="50"
+            latin:keyIcon="@drawable/sym_bkeyboard_num2" />
         <Key
-            android:codes="51"
-            android:keyIcon="@drawable/sym_bkeyboard_num3" />
+            latin:codes="51"
+            latin:keyIcon="@drawable/sym_bkeyboard_num3" />
         <Key
-            android:keyLabel="-"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="right" />
+            latin:keyLabel="-"
+            latin:keyWidth="20%p"
+            latin:keyEdgeFlags="right" />
     </Row>
     <Row>
         <Key
-            android:codes="52"
-            android:keyIcon="@drawable/sym_bkeyboard_num4"
-            android:keyEdgeFlags="left" />
+            latin:codes="52"
+            latin:keyIcon="@drawable/sym_bkeyboard_num4"
+            latin:keyEdgeFlags="left" />
         <Key
-            android:codes="53"
-            android:keyIcon="@drawable/sym_bkeyboard_num5" />
+            latin:codes="53"
+            latin:keyIcon="@drawable/sym_bkeyboard_num5" />
         <Key
-            android:codes="54"
-            android:keyIcon="@drawable/sym_bkeyboard_num6" />
+            latin:codes="54"
+            latin:keyIcon="@drawable/sym_bkeyboard_num6" />
         <Key
-            android:keyLabel="."
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="right" />
+            latin:keyLabel="."
+            latin:keyWidth="20%p"
+            latin:keyEdgeFlags="right" />
     </Row>
     <Row>
         <Key
-            android:codes="55"
-            android:keyIcon="@drawable/sym_bkeyboard_num7"
-            android:keyEdgeFlags="left" />
+            latin:codes="55"
+            latin:keyIcon="@drawable/sym_bkeyboard_num7"
+            latin:keyEdgeFlags="left" />
         <Key
-            android:codes="56"
-            android:keyIcon="@drawable/sym_bkeyboard_num8" />
+            latin:codes="56"
+            latin:keyIcon="@drawable/sym_bkeyboard_num8" />
         <Key
-            android:codes="57"
-            android:keyIcon="@drawable/sym_bkeyboard_num9" />
+            latin:codes="57"
+            latin:keyIcon="@drawable/sym_bkeyboard_num9" />
         <Key
-            android:codes="@integer/key_delete"
-            android:keyIcon="@drawable/sym_bkeyboard_delete"
-            android:iconPreview="@drawable/sym_keyboard_feedback_delete"
-            android:keyWidth="20%p"
-            android:isRepeatable="true"
-            android:keyEdgeFlags="right" />
+            latin:codes="@integer/key_delete"
+            latin:keyIcon="@drawable/sym_bkeyboard_delete"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_delete"
+            latin:keyWidth="20%p"
+            latin:isRepeatable="true"
+            latin:keyEdgeFlags="right" />
     </Row>
     <Row
-        android:rowEdgeFlags="bottom"
+        latin:rowEdgeFlags="bottom"
     >
         <Key
-            android:codes="@integer/key_symbol"
-            android:keyIcon="@drawable/sym_bkeyboard_numalt"
-            android:iconPreview="@drawable/sym_keyboard_feedback_numalt" />
+            latin:codes="@integer/key_symbol"
+            latin:keyIcon="@drawable/sym_bkeyboard_numalt"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_numalt" />
         <Key
-            android:codes="48"
-            android:keyIcon="@drawable/sym_bkeyboard_num0" />
+            latin:codes="48"
+            latin:keyIcon="@drawable/sym_bkeyboard_num0" />
         <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space" />
+            latin:codes="@integer/key_space"
+            latin:keyIcon="@drawable/sym_bkeyboard_space"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_space" />
         <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_bkeyboard_return"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="right" />
+            latin:codes="@integer/key_return"
+            latin:keyIcon="@drawable/sym_bkeyboard_return"
+            latin:keyWidth="20%p"
+            latin:keyEdgeFlags="right" />
     </Row>
 </Keyboard>
diff --git a/java/res/xml/kbd_phone_symbols.xml b/java/res/xml/kbd_phone_symbols.xml
index 4c928a8..1c691d2 100644
--- a/java/res/xml/kbd_phone_symbols.xml
+++ b/java/res/xml/kbd_phone_symbols.xml
@@ -19,84 +19,84 @@
 -->
 
 <Keyboard
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    android:keyWidth="26.67%p"
-    android:horizontalGap="0px"
-    android:verticalGap="@dimen/key_bottom_gap"
-    android:keyHeight="@dimen/key_height"
+    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+    latin:keyWidth="26.67%p"
+    latin:horizontalGap="@dimen/key_horizontal_gap"
+    latin:verticalGap="@dimen/key_bottom_gap"
+    latin:keyHeight="@dimen/key_height"
 >
     <Row
-        android:rowEdgeFlags="top"
+        latin:rowEdgeFlags="top"
     >
         <Key
-            android:keyLabel="("
-            android:keyEdgeFlags="left" />
+            latin:keyLabel="("
+            latin:keyEdgeFlags="left" />
         <Key
-            android:keyLabel="/" />
+            latin:keyLabel="/" />
         <Key
-            android:keyLabel=")" />
+            latin:keyLabel=")" />
         <Key
-            android:keyLabel="-"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
+            latin:keyLabel="-"
+            latin:keyWidth="20%p"
+            latin:isModifier="true"
+            latin:keyEdgeFlags="right" />
     </Row>
     <Row>
         <Key
-            android:keyLabel="N"
-            android:keyEdgeFlags="left" />
+            latin:keyLabel="N"
+            latin:keyEdgeFlags="left" />
         <!-- Pause is a comma. Check PhoneNumberUtils.java to see if this 
             has changed. -->
         <Key
-            android:codes="44"
-            android:keyLabel="Pause" />
+            latin:codes="44"
+            latin:keyLabel="Pause" />
         <Key
-            android:keyLabel="," />
+            latin:keyLabel="," />
         <Key
-            android:keyLabel="."
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
+            latin:keyLabel="."
+            latin:keyWidth="20%p"
+            latin:isModifier="true"
+            latin:keyEdgeFlags="right" />
     </Row>
     <Row>
         <Key
-            android:codes="42"
-            android:keyIcon="@drawable/sym_keyboard_numstar"
-            android:keyEdgeFlags="left" />
+            latin:codes="42"
+            latin:keyIcon="@drawable/sym_keyboard_numstar"
+            latin:keyEdgeFlags="left" />
         <!-- Wait is a semicolon. -->
         <Key
-            android:codes="59"
-            android:keyLabel="Wait" />
+            latin:codes="59"
+            latin:keyLabel="Wait" />
         <Key
-            android:codes="35"
-            android:keyIcon="@drawable/sym_keyboard_numpound" />
+            latin:codes="35"
+            latin:keyIcon="@drawable/sym_keyboard_numpound" />
         <Key
-            android:codes="@integer/key_delete"
-            android:keyIcon="@drawable/sym_keyboard_delete"
-            android:iconPreview="@drawable/sym_keyboard_feedback_delete"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:isRepeatable="true"
-            android:keyEdgeFlags="right" />
+            latin:codes="@integer/key_delete"
+            latin:keyIcon="@drawable/sym_keyboard_delete"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_delete"
+            latin:keyWidth="20%p"
+            latin:isModifier="true"
+            latin:isRepeatable="true"
+            latin:keyEdgeFlags="right" />
     </Row>
     <Row
-        android:rowEdgeFlags="bottom"
+        latin:rowEdgeFlags="bottom"
     >
         <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_phone_key"
-            android:keyEdgeFlags="left" />
+            latin:codes="@integer/key_symbol"
+            latin:keyLabel="@string/label_phone_key"
+            latin:keyEdgeFlags="left" />
         <Key
-            android:keyLabel="+" />
+            latin:keyLabel="+" />
         <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space" />
+            latin:codes="@integer/key_space"
+            latin:keyIcon="@drawable/sym_keyboard_space"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_space" />
         <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_keyboard_return"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
+            latin:codes="@integer/key_return"
+            latin:keyIcon="@drawable/sym_keyboard_return"
+            latin:keyWidth="20%p"
+            latin:isModifier="true"
+            latin:keyEdgeFlags="right" />
     </Row>
 </Keyboard>
diff --git a/java/res/xml/kbd_phone_symbols_black.xml b/java/res/xml/kbd_phone_symbols_black.xml
index 4d686e1..3e46c53 100644
--- a/java/res/xml/kbd_phone_symbols_black.xml
+++ b/java/res/xml/kbd_phone_symbols_black.xml
@@ -19,80 +19,80 @@
 -->
 
 <Keyboard
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    android:keyWidth="26.67%p"
-    android:horizontalGap="0px"
-    android:verticalGap="@dimen/key_bottom_gap"
-    android:keyHeight="@dimen/key_height"
+    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+    latin:keyWidth="26.67%p"
+    latin:horizontalGap="@dimen/key_horizontal_gap"
+    latin:verticalGap="@dimen/key_bottom_gap"
+    latin:keyHeight="@dimen/key_height"
 >
     <Row
-        android:rowEdgeFlags="top"
+        latin:rowEdgeFlags="top"
     >
         <Key
-            android:keyLabel="("
-            android:keyEdgeFlags="left" />
+            latin:keyLabel="("
+            latin:keyEdgeFlags="left" />
         <Key
-            android:keyLabel="/" />
+            latin:keyLabel="/" />
         <Key
-            android:keyLabel=")" />
+            latin:keyLabel=")" />
         <Key
-            android:keyLabel="-"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="right" />
+            latin:keyLabel="-"
+            latin:keyWidth="20%p"
+            latin:keyEdgeFlags="right" />
     </Row>
     <Row>
         <Key
-            android:keyLabel="N"
-            android:keyEdgeFlags="left" />
+            latin:keyLabel="N"
+            latin:keyEdgeFlags="left" />
         <!-- Pause is a comma. Check PhoneNumberUtils.java to see if this 
             has changed. -->
         <Key
-            android:codes="44"
-            android:keyLabel="Pause" />
+            latin:codes="44"
+            latin:keyLabel="Pause" />
         <Key
-            android:keyLabel="," />
+            latin:keyLabel="," />
         <Key
-            android:keyLabel="."
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="right" />
+            latin:keyLabel="."
+            latin:keyWidth="20%p"
+            latin:keyEdgeFlags="right" />
     </Row>
     <Row>
         <Key
-            android:codes="42"
-            android:keyIcon="@drawable/sym_bkeyboard_numstar"
-            android:keyEdgeFlags="left" />
+            latin:codes="42"
+            latin:keyIcon="@drawable/sym_bkeyboard_numstar"
+            latin:keyEdgeFlags="left" />
         <!-- Wait is a semicolon. -->
         <Key
-            android:codes="59"
-            android:keyLabel="Wait" />
+            latin:codes="59"
+            latin:keyLabel="Wait" />
         <Key
-            android:codes="35"
-            android:keyIcon="@drawable/sym_bkeyboard_numpound" />
+            latin:codes="35"
+            latin:keyIcon="@drawable/sym_bkeyboard_numpound" />
         <Key
-            android:codes="@integer/key_delete"
-            android:keyIcon="@drawable/sym_bkeyboard_delete"
-            android:iconPreview="@drawable/sym_keyboard_feedback_delete"
-            android:keyWidth="20%p"
-            android:isRepeatable="true"
-            android:keyEdgeFlags="right" />
+            latin:codes="@integer/key_delete"
+            latin:keyIcon="@drawable/sym_bkeyboard_delete"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_delete"
+            latin:keyWidth="20%p"
+            latin:isRepeatable="true"
+            latin:keyEdgeFlags="right" />
     </Row>
     <Row
-        android:rowEdgeFlags="bottom"
+        latin:rowEdgeFlags="bottom"
     >
         <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_phone_key"
-            android:keyEdgeFlags="left" />
+            latin:codes="@integer/key_symbol"
+            latin:keyLabel="@string/label_phone_key"
+            latin:keyEdgeFlags="left" />
         <Key
-            android:keyLabel="+" />
+            latin:keyLabel="+" />
         <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space" />
+            latin:codes="@integer/key_space"
+            latin:keyIcon="@drawable/sym_bkeyboard_space"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_space" />
         <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_bkeyboard_return"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="right" />
+            latin:codes="@integer/key_return"
+            latin:keyIcon="@drawable/sym_bkeyboard_return"
+            latin:keyWidth="20%p"
+            latin:keyEdgeFlags="right" />
     </Row>
 </Keyboard>
diff --git a/java/res/xml/kbd_popup_narrow_template.xml b/java/res/xml/kbd_popup_narrow_template.xml
index 23c686e..9b78711 100644
--- a/java/res/xml/kbd_popup_narrow_template.xml
+++ b/java/res/xml/kbd_popup_narrow_template.xml
@@ -18,10 +18,10 @@
 */
 -->
 
-<Keyboard xmlns:android="http://schemas.android.com/apk/res/android"
-    android:keyWidth="9.45%p"
-    android:horizontalGap="0px"
-    android:verticalGap="0px"
-    android:keyHeight="@dimen/popup_key_height"
+<Keyboard xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+    latin:keyWidth="9.45%p"
+    latin:horizontalGap="0px"
+    latin:verticalGap="0px"
+    latin:keyHeight="@dimen/popup_key_height"
     >
 </Keyboard>
diff --git a/java/res/xml/kbd_popup_template.xml b/java/res/xml/kbd_popup_template.xml
index a287be1..004d490 100644
--- a/java/res/xml/kbd_popup_template.xml
+++ b/java/res/xml/kbd_popup_template.xml
@@ -18,10 +18,10 @@
 */
 -->
 
-<Keyboard xmlns:android="http://schemas.android.com/apk/res/android"
-    android:keyWidth="10%p"
-    android:horizontalGap="0px"
-    android:verticalGap="0px"
-    android:keyHeight="@dimen/popup_key_height"
+<Keyboard xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+    latin:keyWidth="10%p"
+    latin:horizontalGap="@dimen/key_horizontal_gap"
+    latin:verticalGap="0px"
+    latin:keyHeight="@dimen/popup_key_height"
     >
 </Keyboard>
diff --git a/java/res/xml/kbd_qwerty.xml b/java/res/xml/kbd_qwerty.xml
index a4ab0f8..517b4fe 100644
--- a/java/res/xml/kbd_qwerty.xml
+++ b/java/res/xml/kbd_qwerty.xml
@@ -19,487 +19,141 @@
 -->
 
 <Keyboard
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    android:keyWidth="10%p"
-    android:horizontalGap="0px"
-    android:verticalGap="@dimen/key_bottom_gap"
-    android:keyHeight="@dimen/key_height"
+    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+    latin:keyWidth="10%p"
+    latin:horizontalGap="@dimen/key_horizontal_gap"
+    latin:verticalGap="@dimen/key_bottom_gap"
+    latin:keyHeight="@dimen/key_height"
 >
     <Row
-        android:rowEdgeFlags="top"
+        latin:rowEdgeFlags="top"
     >
         <Key
-            android:keyLabel="q"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_q"
-            android:keyEdgeFlags="left" />
+            latin:keyLabel="q"
+            latin:keyHintIcon="@drawable/keyboard_hint_1"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_q"
+            latin:keyEdgeFlags="left" />
         <Key
-            android:keyLabel="w"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_w" />
+            latin:keyLabel="w"
+            latin:keyHintIcon="@drawable/keyboard_hint_2"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_w" />
         <Key
-            android:keyLabel="e"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_e" />
+            latin:keyLabel="e"
+            latin:keyHintIcon="@drawable/keyboard_hint_3"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_e" />
         <Key
-            android:keyLabel="r"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_r" />
+            latin:keyLabel="r"
+            latin:keyHintIcon="@drawable/keyboard_hint_4"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_r" />
         <Key
-            android:keyLabel="t"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_t" />
+            latin:keyLabel="t"
+            latin:keyHintIcon="@drawable/keyboard_hint_5"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_t" />
         <Key
-            android:keyLabel="y"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_y" />
+            latin:keyLabel="y"
+            latin:keyHintIcon="@drawable/keyboard_hint_6"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_y" />
         <Key
-            android:keyLabel="u"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_u" />
+            latin:keyLabel="u"
+            latin:keyHintIcon="@drawable/keyboard_hint_7"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_u" />
         <Key
-            android:keyLabel="i"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_i" />
+            latin:keyLabel="i"
+            latin:keyHintIcon="@drawable/keyboard_hint_8"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_i" />
         <Key
-            android:keyLabel="o"
-            android:popupKeyboard="@xml/kbd_popup_narrow_template"
-            android:popupCharacters="@string/alternates_for_o" />
+            latin:keyLabel="o"
+            latin:keyHintIcon="@drawable/keyboard_hint_9"
+            latin:popupKeyboard="@xml/kbd_popup_narrow_template"
+            latin:popupCharacters="@string/alternates_for_o" />
         <Key
-            android:keyLabel="p"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_p"
-            android:keyEdgeFlags="right" />
+            latin:keyLabel="p"
+            latin:keyHintIcon="@drawable/keyboard_hint_0"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_p"
+            latin:keyEdgeFlags="right" />
+    </Row>
+    <Row>
+        <Spacer
+            latin:horizontalGap="5%p" />
+        <Key
+            latin:keyLabel="a"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_a"
+            latin:keyEdgeFlags="left" />
+        <Key
+            latin:keyLabel="s"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_s" />
+        <Key
+            latin:keyLabel="d"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_d" />
+        <Key
+            latin:keyLabel="f" />
+        <Key
+            latin:keyLabel="g"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_g" />
+        <Key
+            latin:keyLabel="h" />
+        <Key
+            latin:keyLabel="j" />
+        <Key
+            latin:keyLabel="k" />
+        <Key
+            latin:keyLabel="l"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_l"
+            latin:keyEdgeFlags="right" />
     </Row>
     <Row>
         <Key
-            android:keyLabel="a"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_a"
-            android:horizontalGap="5%p"
-            android:keyEdgeFlags="left" />
+            latin:codes="@integer/key_shift"
+            latin:keyIcon="@drawable/sym_keyboard_shift"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_shift"
+            latin:keyWidth="15%p"
+            latin:isModifier="true"
+            latin:isSticky="true"
+            latin:keyEdgeFlags="left" />
         <Key
-            android:keyLabel="s"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_s" />
+            latin:keyLabel="z"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_z" />
         <Key
-            android:keyLabel="d"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_d" />
+            latin:keyLabel="x" />
         <Key
-            android:keyLabel="f" />
+            latin:keyLabel="c"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_c" />
         <Key
-            android:keyLabel="g"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_g" />
+            latin:keyLabel="v"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_v" />
         <Key
-            android:keyLabel="h" />
+            latin:keyLabel="b" />
         <Key
-            android:keyLabel="j" />
+            latin:keyLabel="n"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_n" />
         <Key
-            android:keyLabel="k" />
+            latin:keyLabel="m" />
         <Key
-            android:keyLabel="l"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_l"
-            android:keyEdgeFlags="right" />
+            latin:codes="@integer/key_delete"
+            latin:keyIcon="@drawable/sym_keyboard_delete"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_delete"
+            latin:keyWidth="15%p"
+            latin:isModifier="true"
+            latin:isRepeatable="true"
+            latin:keyEdgeFlags="right" />
     </Row>
-    <Row>
-        <Key
-            android:codes="@integer/key_shift"
-            android:keyIcon="@drawable/sym_keyboard_shift"
-            android:iconPreview="@drawable/sym_keyboard_feedback_shift"
-            android:keyWidth="15%p"
-            android:isModifier="true"
-            android:isSticky="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:keyLabel="z"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_z" />
-        <Key
-            android:keyLabel="x" />
-        <Key
-            android:keyLabel="c"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_c" />
-        <Key
-            android:keyLabel="v"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_v" />
-        <Key
-            android:keyLabel="b" />
-        <Key
-            android:keyLabel="n"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_n" />
-        <Key
-            android:keyLabel="m" />
-        <Key
-            android:codes="@integer/key_delete"
-            android:keyIcon="@drawable/sym_keyboard_delete"
-            android:iconPreview="@drawable/sym_keyboard_feedback_delete"
-            android:keyWidth="15%p"
-            android:isModifier="true"
-            android:isRepeatable="true"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_normal"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="40%p"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_keyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_url"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="40%p"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_keyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_email"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="40%p"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_keyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_im"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="40%p"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel=":-)"
-            android:keyOutputText=":-) "
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_smileys"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_webentry"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="20%p"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_tab"
-            android:keyIcon="@drawable/sym_keyboard_tab"
-            android:iconPreview="@drawable/sym_keyboard_feedback_tab"
-            android:keyWidth="20%p"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_keyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_normal_with_settings_key"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_keyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_keyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="25%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_url_with_settings_key"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_keyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_keyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="25%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_email_with_settings_key"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_keyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_keyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="25%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_im_with_settings_key"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_keyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel=":-)"
-            android:keyOutputText=":-) "
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_smileys"
-            android:keyWidth="25%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_webentry_with_settings_key"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_keyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_tab"
-            android:keyIcon="@drawable/sym_keyboard_tab"
-            android:iconPreview="@drawable/sym_keyboard_feedback_tab"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_keyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="15%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
-    </Row>
+    <include latin:keyboardLayout="@xml/kbd_qwerty_row4" />
 </Keyboard>
diff --git a/java/res/xml/kbd_qwerty_black.xml b/java/res/xml/kbd_qwerty_black.xml
index 787e4ef..76412f6 100644
--- a/java/res/xml/kbd_qwerty_black.xml
+++ b/java/res/xml/kbd_qwerty_black.xml
@@ -19,429 +19,140 @@
 -->
 
 <Keyboard
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    android:keyWidth="10%p"
-    android:horizontalGap="0px"
-    android:verticalGap="@dimen/key_bottom_gap"
-    android:keyHeight="@dimen/key_height"
+    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+    latin:keyWidth="10%p"
+    latin:horizontalGap="@dimen/key_horizontal_gap"
+    latin:verticalGap="@dimen/key_bottom_gap"
+    latin:keyHeight="@dimen/key_height"
 >
     <Row
-        android:rowEdgeFlags="top"
+        latin:rowEdgeFlags="top"
     >
         <Key
-            android:keyLabel="q"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_q"
-            android:keyEdgeFlags="left" />
+            latin:keyLabel="q"
+            latin:keyHintIcon="@drawable/keyboard_hint_1"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_q"
+            latin:keyEdgeFlags="left" />
         <Key
-            android:keyLabel="w"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_w" />
+            latin:keyLabel="w"
+            latin:keyHintIcon="@drawable/keyboard_hint_2"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_w" />
         <Key
-            android:keyLabel="e"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_e" />
+            latin:keyLabel="e"
+            latin:keyHintIcon="@drawable/keyboard_hint_3"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_e" />
         <Key
-            android:keyLabel="r"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_r" />
+            latin:keyLabel="r"
+            latin:keyHintIcon="@drawable/keyboard_hint_4"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_r" />
         <Key
-            android:keyLabel="t"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_t" />
+            latin:keyLabel="t"
+            latin:keyHintIcon="@drawable/keyboard_hint_5"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_t" />
         <Key
-            android:keyLabel="y"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_y" />
+            latin:keyLabel="y"
+            latin:keyHintIcon="@drawable/keyboard_hint_6"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_y" />
         <Key
-            android:keyLabel="u"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_u" />
+            latin:keyLabel="u"
+            latin:keyHintIcon="@drawable/keyboard_hint_7"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_u" />
         <Key
-            android:keyLabel="i"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_i" />
+            latin:keyLabel="i"
+            latin:keyHintIcon="@drawable/keyboard_hint_8"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_i" />
         <Key
-            android:keyLabel="o"
-            android:popupKeyboard="@xml/kbd_popup_narrow_template"
-            android:popupCharacters="@string/alternates_for_o" />
+            latin:keyLabel="o"
+            latin:keyHintIcon="@drawable/keyboard_hint_9"
+            latin:popupKeyboard="@xml/kbd_popup_narrow_template"
+            latin:popupCharacters="@string/alternates_for_o" />
         <Key
-            android:keyLabel="p"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_p"
-            android:keyEdgeFlags="right" />
+            latin:keyLabel="p"
+            latin:keyHintIcon="@drawable/keyboard_hint_0"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_p"
+            latin:keyEdgeFlags="right" />
+    </Row>
+    <Row>
+        <Spacer
+            latin:horizontalGap="5%p" />
+        <Key
+            latin:keyLabel="a"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_a"
+            latin:keyEdgeFlags="left" />
+        <Key
+            latin:keyLabel="s"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_s" />
+        <Key
+            latin:keyLabel="d"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_d" />
+        <Key
+            latin:keyLabel="f" />
+        <Key
+            latin:keyLabel="g"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_g" />
+        <Key
+            latin:keyLabel="h" />
+        <Key
+            latin:keyLabel="j" />
+        <Key
+            latin:keyLabel="k" />
+        <Key
+            latin:keyLabel="l"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_l"
+            latin:keyEdgeFlags="right" />
     </Row>
     <Row>
         <Key
-            android:keyLabel="a"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_a"
-            android:horizontalGap="5%p"
-            android:keyEdgeFlags="left" />
+            latin:codes="@integer/key_shift"
+            latin:keyIcon="@drawable/sym_bkeyboard_shift"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_shift"
+            latin:keyWidth="15%p"
+            latin:isModifier="true"
+            latin:isSticky="true"
+            latin:keyEdgeFlags="left" />
         <Key
-            android:keyLabel="s"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_s" />
+            latin:keyLabel="z"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_z" />
         <Key
-            android:keyLabel="d"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_d" />
+            latin:keyLabel="x" />
         <Key
-            android:keyLabel="f" />
+            latin:keyLabel="c"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_c" />
         <Key
-            android:keyLabel="g"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_g" />
+            latin:keyLabel="v"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_v" />
         <Key
-            android:keyLabel="h" />
+            latin:keyLabel="b" />
         <Key
-            android:keyLabel="j" />
+            latin:keyLabel="n"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="@string/alternates_for_n" />
         <Key
-            android:keyLabel="k" />
+            latin:keyLabel="m" />
         <Key
-            android:keyLabel="l"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_l"
-            android:keyEdgeFlags="right" />
+            latin:codes="@integer/key_delete"
+            latin:keyIcon="@drawable/sym_bkeyboard_delete"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_delete"
+            latin:keyWidth="15%p"
+            latin:isRepeatable="true"
+            latin:keyEdgeFlags="right" />
     </Row>
-    <Row>
-        <Key
-            android:codes="@integer/key_shift"
-            android:keyIcon="@drawable/sym_bkeyboard_shift"
-            android:iconPreview="@drawable/sym_keyboard_feedback_shift"
-            android:keyWidth="15%p"
-            android:isModifier="true"
-            android:isSticky="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:keyLabel="z"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_z" />
-        <Key
-            android:keyLabel="x" />
-        <Key
-            android:keyLabel="c"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_c" />
-        <Key
-            android:keyLabel="v"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_v" />
-        <Key
-            android:keyLabel="b" />
-        <Key
-            android:keyLabel="n"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="@string/alternates_for_n" />
-        <Key
-            android:keyLabel="m" />
-        <Key
-            android:codes="@integer/key_delete"
-            android:keyIcon="@drawable/sym_bkeyboard_delete"
-            android:iconPreview="@drawable/sym_keyboard_feedback_delete"
-            android:keyWidth="15%p"
-            android:isRepeatable="true"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_normal"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="40%p" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_bkeyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_url"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="40%p" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_bkeyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_email"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="40%p" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_bkeyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_im"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="40%p" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:keyLabel=":-)"
-            android:keyOutputText=":-) "
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_smileys"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_webentry"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="20%p" />
-        <Key
-            android:codes="@integer/key_tab"
-            android:keyIcon="@drawable/sym_bkeyboard_tab"
-            android:iconPreview="@drawable/sym_keyboard_feedback_tab"
-            android:keyWidth="20%p" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_bkeyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_normal_with_settings_key"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_bkeyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_bkeyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="25%p"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_url_with_settings_key"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_bkeyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_bkeyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="25%p"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_email_with_settings_key"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_bkeyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_bkeyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="25%p"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_im_with_settings_key"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_bkeyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:keyLabel=":-)"
-            android:keyOutputText=":-) "
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_smileys"
-            android:keyWidth="25%p"
-            android:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        android:keyboardMode="@+id/mode_webentry_with_settings_key"
-        android:rowEdgeFlags="bottom"
-    >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_symbol_key"
-            android:keyWidth="15%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_bkeyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p" />
-        <Key
-            android:codes="@integer/key_tab"
-            android:keyIcon="@drawable/sym_bkeyboard_tab"
-            android:iconPreview="@drawable/sym_keyboard_feedback_tab" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_bkeyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="15%p"
-            android:keyEdgeFlags="right" />
-    </Row>
+    <include latin:keyboardLayout="@xml/kbd_qwerty_black_row4" />
 </Keyboard>
diff --git a/java/res/xml/kbd_qwerty_black_row4.xml b/java/res/xml/kbd_qwerty_black_row4.xml
new file mode 100644
index 0000000..330ddda
--- /dev/null
+++ b/java/res/xml/kbd_qwerty_black_row4.xml
@@ -0,0 +1,335 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2010, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<merge
+    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+>
+    <Row
+        latin:keyboardMode="@+id/mode_normal"
+        latin:keyWidth="10%p"
+        latin:rowEdgeFlags="bottom"
+    >
+        <Key
+            latin:codes="@integer/key_symbol"
+            latin:keyLabel="@string/label_symbol_key"
+            latin:keyWidth="20%p"
+            latin:keyEdgeFlags="left" />
+        <Key
+            latin:codes="@integer/key_f1" />
+        <Key
+            latin:codes="@integer/key_space"
+            latin:keyIcon="@drawable/sym_bkeyboard_space"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_space"
+            latin:keyWidth="40%p" />
+        <Key
+            latin:keyLabel="."
+            latin:keyHintIcon="@drawable/hint_popup"
+            latin:popupKeyboard="@xml/popup_punctuation" />
+        <Key
+            latin:codes="@integer/key_return"
+            latin:keyIcon="@drawable/sym_bkeyboard_return"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_return"
+            latin:keyWidth="20%p"
+            latin:keyEdgeFlags="right" />
+    </Row>
+    <Row
+        latin:keyboardMode="@+id/mode_url"
+        latin:keyWidth="10%p"
+        latin:rowEdgeFlags="bottom"
+    >
+        <Key
+            latin:codes="@integer/key_symbol"
+            latin:keyLabel="@string/label_symbol_key"
+            latin:keyWidth="20%p"
+            latin:keyEdgeFlags="left" />
+        <Key
+            latin:codes="@integer/key_f1" />
+        <Key
+            latin:codes="@integer/key_space"
+            latin:keyIcon="@drawable/sym_bkeyboard_space"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_space"
+            latin:keyWidth="40%p" />
+        <Key
+            latin:keyLabel="."
+            latin:keyHintIcon="@drawable/hint_popup"
+            latin:popupKeyboard="@xml/popup_punctuation" />
+        <Key
+            latin:codes="@integer/key_return"
+            latin:keyIcon="@drawable/sym_bkeyboard_return"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_return"
+            latin:keyWidth="20%p"
+            latin:keyEdgeFlags="right" />
+    </Row>
+    <Row
+        latin:keyboardMode="@+id/mode_email"
+        latin:keyWidth="10%p"
+        latin:rowEdgeFlags="bottom"
+    >
+        <Key
+            latin:codes="@integer/key_symbol"
+            latin:keyLabel="@string/label_symbol_key"
+            latin:keyWidth="20%p"
+            latin:keyEdgeFlags="left" />
+        <Key
+            latin:codes="@integer/key_f1" />
+        <Key
+            latin:codes="@integer/key_space"
+            latin:keyIcon="@drawable/sym_bkeyboard_space"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_space"
+            latin:keyWidth="40%p" />
+        <Key
+            latin:keyLabel="."
+            latin:keyHintIcon="@drawable/hint_popup"
+            latin:popupKeyboard="@xml/popup_punctuation" />
+        <Key
+            latin:codes="@integer/key_return"
+            latin:keyIcon="@drawable/sym_bkeyboard_return"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_return"
+            latin:keyWidth="20%p"
+            latin:keyEdgeFlags="right" />
+    </Row>
+    <Row
+        latin:keyboardMode="@+id/mode_im"
+        latin:keyWidth="10%p"
+        latin:rowEdgeFlags="bottom"
+    >
+        <Key
+            latin:codes="@integer/key_symbol"
+            latin:keyLabel="@string/label_symbol_key"
+            latin:keyWidth="20%p"
+            latin:keyEdgeFlags="left" />
+        <Key
+            latin:codes="@integer/key_f1" />
+        <Key
+            latin:codes="@integer/key_space"
+            latin:keyIcon="@drawable/sym_bkeyboard_space"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_space"
+            latin:keyWidth="40%p" />
+        <Key
+            latin:keyLabel="."
+            latin:keyHintIcon="@drawable/hint_popup"
+            latin:popupKeyboard="@xml/popup_punctuation" />
+        <Key
+            latin:keyLabel=":-)"
+            latin:keyOutputText=":-) "
+            latin:keyHintIcon="@drawable/hint_popup"
+            latin:popupKeyboard="@xml/popup_smileys"
+            latin:keyWidth="20%p"
+            latin:keyEdgeFlags="right" />
+    </Row>
+    <Row
+        latin:keyboardMode="@+id/mode_webentry"
+        latin:keyWidth="10%p"
+        latin:rowEdgeFlags="bottom"
+    >
+        <Key
+            latin:codes="@integer/key_symbol"
+            latin:keyLabel="@string/label_symbol_key"
+            latin:keyWidth="20%p"
+            latin:keyEdgeFlags="left" />
+        <Key
+            latin:codes="@integer/key_f1" />
+        <Key
+            latin:codes="@integer/key_space"
+            latin:keyIcon="@drawable/sym_bkeyboard_space"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_space"
+            latin:keyWidth="20%p" />
+        <Key
+            latin:codes="@integer/key_tab"
+            latin:keyIcon="@drawable/sym_bkeyboard_tab"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_tab"
+            latin:keyWidth="20%p" />
+        <Key
+            latin:keyLabel="."
+            latin:keyHintIcon="@drawable/hint_popup"
+            latin:popupKeyboard="@xml/popup_punctuation" />
+        <Key
+            latin:codes="@integer/key_return"
+            latin:keyIcon="@drawable/sym_bkeyboard_return"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_return"
+            latin:keyWidth="20%p"
+            latin:keyEdgeFlags="right" />
+    </Row>
+    <Row
+        latin:keyboardMode="@+id/mode_normal_with_settings_key"
+        latin:keyWidth="10%p"
+        latin:rowEdgeFlags="bottom"
+    >
+        <Key
+            latin:codes="@integer/key_symbol"
+            latin:keyLabel="@string/label_symbol_key"
+            latin:keyWidth="15%p"
+            latin:keyEdgeFlags="left" />
+        <Key
+            latin:codes="@integer/key_settings"
+            latin:keyIcon="@drawable/sym_bkeyboard_settings"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_settings" />
+        <Key
+            latin:codes="@integer/key_f1" />
+        <Key
+            latin:codes="@integer/key_space"
+            latin:keyIcon="@drawable/sym_bkeyboard_space"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_space"
+            latin:keyWidth="30%p" />
+        <Key
+            latin:keyLabel="."
+            latin:keyHintIcon="@drawable/hint_popup"
+            latin:popupKeyboard="@xml/popup_punctuation" />
+        <Key
+            latin:codes="@integer/key_return"
+            latin:keyIcon="@drawable/sym_bkeyboard_return"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_return"
+            latin:keyWidth="25%p"
+            latin:keyEdgeFlags="right" />
+    </Row>
+    <Row
+        latin:keyboardMode="@+id/mode_url_with_settings_key"
+        latin:keyWidth="10%p"
+        latin:rowEdgeFlags="bottom"
+    >
+        <Key
+            latin:codes="@integer/key_symbol"
+            latin:keyLabel="@string/label_symbol_key"
+            latin:keyWidth="15%p"
+            latin:keyEdgeFlags="left" />
+        <Key
+            latin:codes="@integer/key_settings"
+            latin:keyIcon="@drawable/sym_bkeyboard_settings"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_settings" />
+        <Key
+            latin:codes="@integer/key_f1" />
+        <Key
+            latin:codes="@integer/key_space"
+            latin:keyIcon="@drawable/sym_bkeyboard_space"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_space"
+            latin:keyWidth="30%p" />
+        <Key
+            latin:keyLabel="."
+            latin:keyHintIcon="@drawable/hint_popup"
+            latin:popupKeyboard="@xml/popup_punctuation" />
+        <Key
+            latin:codes="@integer/key_return"
+            latin:keyIcon="@drawable/sym_bkeyboard_return"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_return"
+            latin:keyWidth="25%p"
+            latin:keyEdgeFlags="right" />
+    </Row>
+    <Row
+        latin:keyboardMode="@+id/mode_email_with_settings_key"
+        latin:keyWidth="10%p"
+        latin:rowEdgeFlags="bottom"
+    >
+        <Key
+            latin:codes="@integer/key_symbol"
+            latin:keyLabel="@string/label_symbol_key"
+            latin:keyWidth="15%p"
+            latin:keyEdgeFlags="left" />
+        <Key
+            latin:codes="@integer/key_settings"
+            latin:keyIcon="@drawable/sym_bkeyboard_settings"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_settings" />
+        <Key
+            latin:codes="@integer/key_f1" />
+        <Key
+            latin:codes="@integer/key_space"
+            latin:keyIcon="@drawable/sym_bkeyboard_space"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_space"
+            latin:keyWidth="30%p" />
+        <Key
+            latin:keyLabel="."
+            latin:keyHintIcon="@drawable/hint_popup"
+            latin:popupKeyboard="@xml/popup_punctuation" />
+        <Key
+            latin:codes="@integer/key_return"
+            latin:keyIcon="@drawable/sym_bkeyboard_return"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_return"
+            latin:keyWidth="25%p"
+            latin:keyEdgeFlags="right" />
+    </Row>
+    <Row
+        latin:keyboardMode="@+id/mode_im_with_settings_key"
+        latin:keyWidth="10%p"
+        latin:rowEdgeFlags="bottom"
+    >
+        <Key
+            latin:codes="@integer/key_symbol"
+            latin:keyLabel="@string/label_symbol_key"
+            latin:keyWidth="15%p"
+            latin:keyEdgeFlags="left" />
+        <Key
+            latin:codes="@integer/key_settings"
+            latin:keyIcon="@drawable/sym_bkeyboard_settings"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_settings" />
+        <Key
+            latin:codes="@integer/key_f1" />
+        <Key
+            latin:codes="@integer/key_space"
+            latin:keyIcon="@drawable/sym_bkeyboard_space"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_space"
+            latin:keyWidth="30%p" />
+        <Key
+            latin:keyLabel="."
+            latin:keyHintIcon="@drawable/hint_popup"
+            latin:popupKeyboard="@xml/popup_punctuation" />
+        <Key
+            latin:keyLabel=":-)"
+            latin:keyOutputText=":-) "
+            latin:keyHintIcon="@drawable/hint_popup"
+            latin:popupKeyboard="@xml/popup_smileys"
+            latin:keyWidth="25%p"
+            latin:keyEdgeFlags="right" />
+    </Row>
+    <Row
+        latin:keyboardMode="@+id/mode_webentry_with_settings_key"
+        latin:keyWidth="10%p"
+        latin:rowEdgeFlags="bottom"
+    >
+        <Key
+            latin:codes="@integer/key_symbol"
+            latin:keyLabel="@string/label_symbol_key"
+            latin:keyWidth="15%p"
+            latin:keyEdgeFlags="left" />
+        <Key
+            latin:codes="@integer/key_settings"
+            latin:keyIcon="@drawable/sym_bkeyboard_settings"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_settings" />
+        <Key
+            latin:codes="@integer/key_f1" />
+        <Key
+            latin:codes="@integer/key_space"
+            latin:keyIcon="@drawable/sym_bkeyboard_space"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_space"
+            latin:keyWidth="30%p" />
+        <Key
+            latin:codes="@integer/key_tab"
+            latin:keyIcon="@drawable/sym_bkeyboard_tab"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_tab" />
+        <Key
+            latin:keyLabel="."
+            latin:keyHintIcon="@drawable/hint_popup"
+            latin:popupKeyboard="@xml/popup_punctuation" />
+        <Key
+            latin:codes="@integer/key_return"
+            latin:keyIcon="@drawable/sym_bkeyboard_return"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_return"
+            latin:keyWidth="15%p"
+            latin:keyEdgeFlags="right" />
+    </Row>
+</merge>
diff --git a/java/res/xml/kbd_qwerty_row4.xml b/java/res/xml/kbd_qwerty_row4.xml
new file mode 100644
index 0000000..17b7c52
--- /dev/null
+++ b/java/res/xml/kbd_qwerty_row4.xml
@@ -0,0 +1,392 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2010, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<merge
+    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+>
+    <Row
+        latin:keyboardMode="@+id/mode_normal"
+        latin:keyWidth="10%p"
+        latin:rowEdgeFlags="bottom"
+    >
+        <Key
+            latin:codes="@integer/key_symbol"
+            latin:keyLabel="@string/label_symbol_key"
+            latin:keyWidth="20%p"
+            latin:isModifier="true"
+            latin:keyEdgeFlags="left" />
+        <Key
+            latin:codes="@integer/key_f1"
+            latin:isModifier="true" />
+        <Key
+            latin:codes="@integer/key_space"
+            latin:keyIcon="@drawable/sym_keyboard_space"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_space"
+            latin:keyWidth="40%p"
+            latin:isModifier="true" />
+        <Key
+            latin:keyLabel="."
+            latin:keyHintIcon="@drawable/hint_popup"
+            latin:popupKeyboard="@xml/popup_punctuation"
+            latin:isModifier="true" />
+        <Key
+            latin:codes="@integer/key_return"
+            latin:keyIcon="@drawable/sym_keyboard_return"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_return"
+            latin:keyWidth="20%p"
+            latin:isModifier="true"
+            latin:keyEdgeFlags="right" />
+    </Row>
+    <Row
+        latin:keyboardMode="@+id/mode_url"
+        latin:keyWidth="10%p"
+        latin:rowEdgeFlags="bottom"
+    >
+        <Key
+            latin:codes="@integer/key_symbol"
+            latin:keyLabel="@string/label_symbol_key"
+            latin:keyWidth="20%p"
+            latin:isModifier="true"
+            latin:keyEdgeFlags="left" />
+        <Key
+            latin:codes="@integer/key_f1"
+            latin:isModifier="true" />
+        <Key
+            latin:codes="@integer/key_space"
+            latin:keyIcon="@drawable/sym_keyboard_space"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_space"
+            latin:keyWidth="40%p"
+            latin:isModifier="true" />
+        <Key
+            latin:keyLabel="."
+            latin:keyHintIcon="@drawable/hint_popup"
+            latin:popupKeyboard="@xml/popup_punctuation"
+            latin:isModifier="true" />
+        <Key
+            latin:codes="@integer/key_return"
+            latin:keyIcon="@drawable/sym_keyboard_return"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_return"
+            latin:keyWidth="20%p"
+            latin:isModifier="true"
+            latin:keyEdgeFlags="right" />
+    </Row>
+    <Row
+        latin:keyboardMode="@+id/mode_email"
+        latin:keyWidth="10%p"
+        latin:rowEdgeFlags="bottom"
+    >
+        <Key
+            latin:codes="@integer/key_symbol"
+            latin:keyLabel="@string/label_symbol_key"
+            latin:keyWidth="20%p"
+            latin:isModifier="true"
+            latin:keyEdgeFlags="left" />
+        <Key
+            latin:codes="@integer/key_f1"
+            latin:isModifier="true" />
+        <Key
+            latin:codes="@integer/key_space"
+            latin:keyIcon="@drawable/sym_keyboard_space"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_space"
+            latin:keyWidth="40%p"
+            latin:isModifier="true" />
+        <Key
+            latin:keyLabel="."
+            latin:keyHintIcon="@drawable/hint_popup"
+            latin:popupKeyboard="@xml/popup_punctuation"
+            latin:isModifier="true" />
+        <Key
+            latin:codes="@integer/key_return"
+            latin:keyIcon="@drawable/sym_keyboard_return"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_return"
+            latin:keyWidth="20%p"
+            latin:isModifier="true"
+            latin:keyEdgeFlags="right" />
+    </Row>
+    <Row
+        latin:keyboardMode="@+id/mode_im"
+        latin:keyWidth="10%p"
+        latin:rowEdgeFlags="bottom"
+    >
+        <Key
+            latin:codes="@integer/key_symbol"
+            latin:keyLabel="@string/label_symbol_key"
+            latin:keyWidth="20%p"
+            latin:isModifier="true"
+            latin:keyEdgeFlags="left" />
+        <Key
+            latin:codes="@integer/key_f1"
+            latin:isModifier="true" />
+        <Key
+            latin:codes="@integer/key_space"
+            latin:keyIcon="@drawable/sym_keyboard_space"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_space"
+            latin:keyWidth="40%p"
+            latin:isModifier="true" />
+        <Key
+            latin:keyLabel="."
+            latin:keyHintIcon="@drawable/hint_popup"
+            latin:popupKeyboard="@xml/popup_punctuation"
+            latin:isModifier="true" />
+        <Key
+            latin:keyLabel=":-)"
+            latin:keyOutputText=":-) "
+            latin:keyHintIcon="@drawable/hint_popup"
+            latin:popupKeyboard="@xml/popup_smileys"
+            latin:keyWidth="20%p"
+            latin:isModifier="true"
+            latin:keyEdgeFlags="right" />
+    </Row>
+    <Row
+        latin:keyboardMode="@+id/mode_webentry"
+        latin:keyWidth="10%p"
+        latin:rowEdgeFlags="bottom"
+    >
+        <Key
+            latin:codes="@integer/key_symbol"
+            latin:keyLabel="@string/label_symbol_key"
+            latin:keyWidth="20%p"
+            latin:isModifier="true"
+            latin:keyEdgeFlags="left" />
+        <Key
+            latin:codes="@integer/key_f1"
+            latin:isModifier="true" />
+        <Key
+            latin:codes="@integer/key_space"
+            latin:keyIcon="@drawable/sym_keyboard_space"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_space"
+            latin:keyWidth="20%p"
+            latin:isModifier="true" />
+        <Key
+            latin:codes="@integer/key_tab"
+            latin:keyIcon="@drawable/sym_keyboard_tab"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_tab"
+            latin:keyWidth="20%p"
+            latin:isModifier="true" />
+        <Key
+            latin:keyLabel="."
+            latin:keyHintIcon="@drawable/hint_popup"
+            latin:popupKeyboard="@xml/popup_punctuation"
+            latin:isModifier="true" />
+        <Key
+            latin:codes="@integer/key_return"
+            latin:keyIcon="@drawable/sym_keyboard_return"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_return"
+            latin:keyWidth="20%p"
+            latin:isModifier="true"
+            latin:keyEdgeFlags="right" />
+    </Row>
+    <Row
+        latin:keyboardMode="@+id/mode_normal_with_settings_key"
+        latin:keyWidth="10%p"
+        latin:rowEdgeFlags="bottom"
+    >
+        <Key
+            latin:codes="@integer/key_symbol"
+            latin:keyLabel="@string/label_symbol_key"
+            latin:keyWidth="15%p"
+            latin:isModifier="true"
+            latin:keyEdgeFlags="left" />
+        <Key
+            latin:codes="@integer/key_settings"
+            latin:keyIcon="@drawable/sym_keyboard_settings"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_settings"
+            latin:isModifier="true" />
+        <Key
+            latin:codes="@integer/key_f1"
+            latin:isModifier="true" />
+        <Key
+            latin:codes="@integer/key_space"
+            latin:keyIcon="@drawable/sym_keyboard_space"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_space"
+            latin:keyWidth="30%p"
+            latin:isModifier="true" />
+        <Key
+            latin:keyLabel="."
+            latin:keyHintIcon="@drawable/hint_popup"
+            latin:popupKeyboard="@xml/popup_punctuation"
+            latin:isModifier="true" />
+        <Key
+            latin:codes="@integer/key_return"
+            latin:keyIcon="@drawable/sym_keyboard_return"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_return"
+            latin:keyWidth="25%p"
+            latin:isModifier="true"
+            latin:keyEdgeFlags="right" />
+    </Row>
+    <Row
+        latin:keyboardMode="@+id/mode_url_with_settings_key"
+        latin:keyWidth="10%p"
+        latin:rowEdgeFlags="bottom"
+    >
+        <Key
+            latin:codes="@integer/key_symbol"
+            latin:keyLabel="@string/label_symbol_key"
+            latin:keyWidth="15%p"
+            latin:isModifier="true"
+            latin:keyEdgeFlags="left" />
+        <Key
+            latin:codes="@integer/key_settings"
+            latin:keyIcon="@drawable/sym_keyboard_settings"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_settings"
+            latin:isModifier="true" />
+        <Key
+            latin:codes="@integer/key_f1"
+            latin:isModifier="true" />
+        <Key
+            latin:codes="@integer/key_space"
+            latin:keyIcon="@drawable/sym_keyboard_space"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_space"
+            latin:keyWidth="30%p"
+            latin:isModifier="true" />
+        <Key
+            latin:keyLabel="."
+            latin:keyHintIcon="@drawable/hint_popup"
+            latin:popupKeyboard="@xml/popup_punctuation"
+            latin:isModifier="true" />
+        <Key
+            latin:codes="@integer/key_return"
+            latin:keyIcon="@drawable/sym_keyboard_return"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_return"
+            latin:keyWidth="25%p"
+            latin:isModifier="true"
+            latin:keyEdgeFlags="right" />
+    </Row>
+    <Row
+        latin:keyboardMode="@+id/mode_email_with_settings_key"
+        latin:keyWidth="10%p"
+        latin:rowEdgeFlags="bottom"
+    >
+        <Key
+            latin:codes="@integer/key_symbol"
+            latin:keyLabel="@string/label_symbol_key"
+            latin:keyWidth="15%p"
+            latin:isModifier="true"
+            latin:keyEdgeFlags="left" />
+        <Key
+            latin:codes="@integer/key_settings"
+            latin:keyIcon="@drawable/sym_keyboard_settings"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_settings"
+            latin:isModifier="true" />
+        <Key
+            latin:codes="@integer/key_f1"
+            latin:isModifier="true" />
+        <Key
+            latin:codes="@integer/key_space"
+            latin:keyIcon="@drawable/sym_keyboard_space"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_space"
+            latin:keyWidth="30%p"
+            latin:isModifier="true" />
+        <Key
+            latin:keyLabel="."
+            latin:keyHintIcon="@drawable/hint_popup"
+            latin:popupKeyboard="@xml/popup_punctuation"
+            latin:isModifier="true" />
+        <Key
+            latin:codes="@integer/key_return"
+            latin:keyIcon="@drawable/sym_keyboard_return"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_return"
+            latin:keyWidth="25%p"
+            latin:isModifier="true"
+            latin:keyEdgeFlags="right" />
+    </Row>
+    <Row
+        latin:keyboardMode="@+id/mode_im_with_settings_key"
+        latin:keyWidth="10%p"
+        latin:rowEdgeFlags="bottom"
+    >
+        <Key
+            latin:codes="@integer/key_symbol"
+            latin:keyLabel="@string/label_symbol_key"
+            latin:keyWidth="15%p"
+            latin:isModifier="true"
+            latin:keyEdgeFlags="left" />
+        <Key
+            latin:codes="@integer/key_settings"
+            latin:keyIcon="@drawable/sym_keyboard_settings"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_settings"
+            latin:isModifier="true" />
+        <Key
+            latin:codes="@integer/key_f1"
+            latin:isModifier="true" />
+        <Key
+            latin:codes="@integer/key_space"
+            latin:keyIcon="@drawable/sym_keyboard_space"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_space"
+            latin:keyWidth="30%p"
+            latin:isModifier="true" />
+        <Key
+            latin:keyLabel="."
+            latin:keyHintIcon="@drawable/hint_popup"
+            latin:popupKeyboard="@xml/popup_punctuation"
+            latin:isModifier="true" />
+        <Key
+            latin:keyLabel=":-)"
+            latin:keyOutputText=":-) "
+            latin:keyHintIcon="@drawable/hint_popup"
+            latin:popupKeyboard="@xml/popup_smileys"
+            latin:keyWidth="25%p"
+            latin:isModifier="true"
+            latin:keyEdgeFlags="right" />
+    </Row>
+    <Row
+        latin:keyboardMode="@+id/mode_webentry_with_settings_key"
+        latin:keyWidth="10%p"
+        latin:rowEdgeFlags="bottom"
+    >
+        <Key
+            latin:codes="@integer/key_symbol"
+            latin:keyLabel="@string/label_symbol_key"
+            latin:keyWidth="15%p"
+            latin:isModifier="true"
+            latin:keyEdgeFlags="left" />
+        <Key
+            latin:codes="@integer/key_settings"
+            latin:keyIcon="@drawable/sym_keyboard_settings"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_settings"
+            latin:isModifier="true" />
+        <Key
+            latin:codes="@integer/key_f1"
+            latin:isModifier="true" />
+        <Key
+            latin:codes="@integer/key_space"
+            latin:keyIcon="@drawable/sym_keyboard_space"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_space"
+            latin:keyWidth="30%p"
+            latin:isModifier="true" />
+        <Key
+            latin:codes="@integer/key_tab"
+            latin:keyIcon="@drawable/sym_keyboard_tab"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_tab"
+            latin:isModifier="true" />
+        <Key
+            latin:keyLabel="."
+            latin:keyHintIcon="@drawable/hint_popup"
+            latin:popupKeyboard="@xml/popup_punctuation"
+            latin:isModifier="true" />
+        <Key
+            latin:codes="@integer/key_return"
+            latin:keyIcon="@drawable/sym_keyboard_return"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_return"
+            latin:keyWidth="15%p"
+            latin:isModifier="true"
+            latin:keyEdgeFlags="right" />
+    </Row>
+</merge>
diff --git a/java/res/xml/kbd_symbols.xml b/java/res/xml/kbd_symbols.xml
index bcb6e8a..608ddda 100644
--- a/java/res/xml/kbd_symbols.xml
+++ b/java/res/xml/kbd_symbols.xml
@@ -19,196 +19,187 @@
 -->
 
 <Keyboard
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    android:keyWidth="10%p"
-    android:horizontalGap="0px"
-    android:verticalGap="@dimen/key_bottom_gap"
-    android:keyHeight="@dimen/key_height"
+    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+    latin:keyWidth="10%p"
+    latin:horizontalGap="@dimen/key_horizontal_gap"
+    latin:verticalGap="@dimen/key_bottom_gap"
+    latin:keyHeight="@dimen/key_height"
 >
     <Row
-        android:rowEdgeFlags="top"
+        latin:rowEdgeFlags="top"
     >
         <Key
-            android:keyLabel="1"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="¹½⅓¼⅛"
-            android:keyEdgeFlags="left" />
+            latin:keyLabel="1"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="¹½⅓¼⅛"
+            latin:keyEdgeFlags="left" />
         <Key
-            android:keyLabel="2"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="²⅔" />
+            latin:keyLabel="2"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="²⅔" />
         <Key
-            android:keyLabel="3"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="³¾⅜" />
+            latin:keyLabel="3"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="³¾⅜" />
         <Key
-            android:keyLabel="4"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="⁴" />
+            latin:keyLabel="4"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="⁴" />
         <Key
-            android:keyLabel="5"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="⅝" />
+            latin:keyLabel="5"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="⅝" />
         <Key
-            android:keyLabel="6" />
+            latin:keyLabel="6" />
         <Key
-            android:keyLabel="7"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="⅞" />
+            latin:keyLabel="7"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="⅞" />
         <Key
-            android:keyLabel="8" />
+            latin:keyLabel="8" />
         <Key
-            android:keyLabel="9" />
+            latin:keyLabel="9" />
         <Key
-            android:keyLabel="0"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="ⁿ∅"
-            android:keyEdgeFlags="right" />
+            latin:keyLabel="0"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="ⁿ∅"
+            latin:keyEdgeFlags="right" />
     </Row>
     <Row>
         <Key
-            android:keyLabel="\@"
-            android:keyEdgeFlags="left" />
+            latin:keyLabel="\@"
+            latin:keyEdgeFlags="left" />
         <Key
-            android:keyLabel="\#" />
+            latin:keyLabel="\#" />
         <Key
-            android:keyLabel="$"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="¢£€¥₣₤₱" />
+            latin:keyLabel="$"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="¢£€¥₣₤₱" />
         <Key
-            android:keyLabel="%"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="‰" />
+            latin:keyLabel="%"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="‰" />
         <Key
-            android:keyLabel="&amp;" />
+            latin:keyLabel="&amp;" />
         <Key
-            android:keyLabel="*"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="†‡★" />
+            latin:keyLabel="*"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="†‡★" />
         <Key
-            android:keyLabel="-"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="_–—" />
+            latin:keyLabel="-"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="_–—" />
         <Key
-            android:keyLabel="+"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="±" />
+            latin:keyLabel="+"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="±" />
         <Key
-            android:keyLabel="("
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="[{&lt;" />
+            latin:keyLabel="("
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="[{&lt;" />
         <Key
-            android:keyLabel=")"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="]}&gt;"
-            android:keyEdgeFlags="right" />
+            latin:keyLabel=")"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="]}&gt;"
+            latin:keyEdgeFlags="right" />
     </Row>
     <Row>
         <Key
-            android:codes="@integer/key_shift"
-            android:keyLabel="@string/label_alt_key"
-            android:keyWidth="15%p"
-            android:isModifier="true"
-            android:isSticky="true"
-            android:keyEdgeFlags="left" />
+            latin:codes="@integer/key_shift"
+            latin:keyLabel="@string/label_alt_key"
+            latin:keyWidth="15%p"
+            latin:isModifier="true"
+            latin:isSticky="true"
+            latin:keyEdgeFlags="left" />
         <Key
-            android:keyLabel="!"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="¡" />
+            latin:keyLabel="!"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="¡" />
         <Key
-            android:keyLabel="&quot;"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="“”«»˝" />
+            latin:keyLabel="&quot;"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="“”«»˝" />
         <Key
-            android:keyLabel="\'"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="‘’" />
+            latin:keyLabel="\'"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="‘’" />
         <Key
-            android:keyLabel=":" />
+            latin:keyLabel=":" />
         <Key
-            android:keyLabel=";" />
+            latin:keyLabel=";" />
         <Key
-            android:keyLabel="/" />
+            latin:keyLabel="/" />
         <Key
-            android:keyLabel="\?"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="¿" />
+            latin:keyLabel="\?"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="¿" />
         <Key
-            android:codes="@integer/key_delete"
-            android:keyIcon="@drawable/sym_keyboard_delete"
-            android:iconPreview="@drawable/sym_keyboard_feedback_delete"
-            android:keyWidth="15%p"
-            android:isModifier="true"
-            android:isRepeatable="true"
-            android:keyEdgeFlags="right" />
+            latin:codes="@integer/key_delete"
+            latin:keyIcon="@drawable/sym_keyboard_delete"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_delete"
+            latin:keyWidth="15%p"
+            latin:isModifier="true"
+            latin:isRepeatable="true"
+            latin:keyEdgeFlags="right" />
     </Row>
     <Row
-        android:keyboardMode="@+id/mode_symbols"
-        android:rowEdgeFlags="bottom"
+        latin:keyboardMode="@+id/mode_symbols_normal"
+        latin:rowEdgeFlags="bottom"
     >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_alpha_key"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="40%p"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_keyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
+        <include latin:keyboardLayout="@xml/kbd_symbols_row4_common" />
     </Row>
     <Row
-        android:keyboardMode="@+id/mode_symbols_with_settings_key"
-        android:rowEdgeFlags="bottom"
+        latin:keyboardMode="@+id/mode_symbols_url"
+        latin:rowEdgeFlags="bottom"
     >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_alpha_key"
-            android:keyWidth="15%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_keyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_f1"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_keyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="25%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
+        <include latin:keyboardLayout="@xml/kbd_symbols_row4_common" />
+    </Row>
+    <Row
+        latin:keyboardMode="@+id/mode_symbols_email"
+        latin:rowEdgeFlags="bottom"
+    >
+        <include latin:keyboardLayout="@xml/kbd_symbols_row4_common" />
+    </Row>
+    <Row
+        latin:keyboardMode="@+id/mode_symbols_im"
+        latin:rowEdgeFlags="bottom"
+    >
+        <include latin:keyboardLayout="@xml/kbd_symbols_row4_im" />
+    </Row>
+    <Row
+        latin:keyboardMode="@+id/mode_symbols_webentry"
+        latin:rowEdgeFlags="bottom"
+    >
+        <include latin:keyboardLayout="@xml/kbd_symbols_row4_common" />
+    </Row>
+    <Row
+        latin:keyboardMode="@+id/mode_symbols_normal_with_settings_key"
+        latin:rowEdgeFlags="bottom"
+    >
+        <include latin:keyboardLayout="@xml/kbd_symbols_row4_common_with_settings_key" />
+    </Row>
+    <Row
+        latin:keyboardMode="@+id/mode_symbols_url_with_settings_key"
+        latin:rowEdgeFlags="bottom"
+    >
+        <include latin:keyboardLayout="@xml/kbd_symbols_row4_common_with_settings_key" />
+    </Row>
+    <Row
+        latin:keyboardMode="@+id/mode_symbols_email_with_settings_key"
+        latin:rowEdgeFlags="bottom"
+    >
+        <include latin:keyboardLayout="@xml/kbd_symbols_row4_common_with_settings_key" />
+    </Row>
+    <Row
+        latin:keyboardMode="@+id/mode_symbols_im_with_settings_key"
+        latin:rowEdgeFlags="bottom"
+    >
+        <include latin:keyboardLayout="@xml/kbd_symbols_row4_im_with_settings_key" />
+    </Row>
+    <Row
+        latin:keyboardMode="@+id/mode_symbols_webentry_with_settings_key"
+        latin:rowEdgeFlags="bottom"
+    >
+        <include latin:keyboardLayout="@xml/kbd_symbols_row4_common_with_settings_key" />
     </Row>
 </Keyboard>
diff --git a/java/res/xml/kbd_symbols_black.xml b/java/res/xml/kbd_symbols_black.xml
index add6c01..9e401a1 100644
--- a/java/res/xml/kbd_symbols_black.xml
+++ b/java/res/xml/kbd_symbols_black.xml
@@ -19,184 +19,186 @@
 -->
 
 <Keyboard
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    android:keyWidth="10%p"
-    android:horizontalGap="0px"
-    android:verticalGap="@dimen/key_bottom_gap"
-    android:keyHeight="@dimen/key_height"
+    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+    latin:keyWidth="10%p"
+    latin:horizontalGap="@dimen/key_horizontal_gap"
+    latin:verticalGap="@dimen/key_bottom_gap"
+    latin:keyHeight="@dimen/key_height"
 >
     <Row
-        android:rowEdgeFlags="top"
+        latin:rowEdgeFlags="top"
     >
         <Key
-            android:keyLabel="1"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="¹½⅓¼⅛"
-            android:keyEdgeFlags="left" />
+            latin:keyLabel="1"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="¹½⅓¼⅛"
+            latin:keyEdgeFlags="left" />
         <Key
-            android:keyLabel="2"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="²⅔" />
+            latin:keyLabel="2"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="²⅔" />
         <Key
-            android:keyLabel="3"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="³¾⅜" />
+            latin:keyLabel="3"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="³¾⅜" />
         <Key
-            android:keyLabel="4"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="⁴" />
+            latin:keyLabel="4"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="⁴" />
         <Key
-            android:keyLabel="5"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="⅝" />
+            latin:keyLabel="5"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="⅝" />
         <Key
-            android:keyLabel="6" />
+            latin:keyLabel="6" />
         <Key
-            android:keyLabel="7"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="⅞" />
+            latin:keyLabel="7"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="⅞" />
         <Key
-            android:keyLabel="8" />
+            latin:keyLabel="8" />
         <Key
-            android:keyLabel="9" />
+            latin:keyLabel="9" />
         <Key
-            android:keyLabel="0"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="ⁿ∅"
-            android:keyEdgeFlags="right" />
+            latin:keyLabel="0"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="ⁿ∅"
+            latin:keyEdgeFlags="right" />
     </Row>
     <Row>
         <Key
-            android:keyLabel="\@"
-            android:keyEdgeFlags="left" />
+            latin:keyLabel="\@"
+            latin:keyEdgeFlags="left" />
         <Key
-            android:keyLabel="\#" />
+            latin:keyLabel="\#" />
         <Key
-            android:keyLabel="$"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="¢£€¥₣₤₱" />
+            latin:keyLabel="$"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="¢£€¥₣₤₱" />
         <Key
-            android:keyLabel="%"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="‰" />
+            latin:keyLabel="%"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="‰" />
         <Key
-            android:keyLabel="&amp;" />
+            latin:keyLabel="&amp;" />
         <Key
-            android:keyLabel="*"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="†‡★" />
+            latin:keyLabel="*"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="†‡★" />
         <Key
-            android:keyLabel="-"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="_–—" />
+            latin:keyLabel="-"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="_–—" />
         <Key
-            android:keyLabel="+"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="±" />
+            latin:keyLabel="+"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="±" />
         <Key
-            android:keyLabel="("
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="[{&lt;" />
+            latin:keyLabel="("
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="[{&lt;" />
         <Key
-            android:keyLabel=")"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="]}&gt;"
-            android:keyEdgeFlags="right" />
+            latin:keyLabel=")"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="]}&gt;"
+            latin:keyEdgeFlags="right" />
     </Row>
     <Row>
         <Key
-            android:codes="@integer/key_shift"
-            android:keyLabel="@string/label_alt_key"
-            android:keyWidth="15%p"
-            android:isModifier="true"
-            android:isSticky="true"
-            android:keyEdgeFlags="left" />
+            latin:codes="@integer/key_shift"
+            latin:keyLabel="@string/label_alt_key"
+            latin:keyWidth="15%p"
+            latin:isModifier="true"
+            latin:isSticky="true"
+            latin:keyEdgeFlags="left" />
         <Key
-            android:keyLabel="!"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="¡" />
+            latin:keyLabel="!"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="¡" />
         <Key
-            android:keyLabel="&quot;"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="“”«»˝" />
+            latin:keyLabel="&quot;"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="“”«»˝" />
         <Key
-            android:keyLabel="\'"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="‘’" />
+            latin:keyLabel="\'"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="‘’" />
         <Key
-            android:keyLabel=":" />
+            latin:keyLabel=":" />
         <Key
-            android:keyLabel=";" />
+            latin:keyLabel=";" />
         <Key
-            android:keyLabel="/" />
+            latin:keyLabel="/" />
         <Key
-            android:keyLabel="\?"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="¿" />
+            latin:keyLabel="\?"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="¿" />
         <Key
-            android:codes="@integer/key_delete"
-            android:keyIcon="@drawable/sym_bkeyboard_delete"
-            android:iconPreview="@drawable/sym_keyboard_feedback_delete"
-            android:keyWidth="15%p"
-            android:isRepeatable="true"
-            android:keyEdgeFlags="right" />
+            latin:codes="@integer/key_delete"
+            latin:keyIcon="@drawable/sym_bkeyboard_delete"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_delete"
+            latin:keyWidth="15%p"
+            latin:isRepeatable="true"
+            latin:keyEdgeFlags="right" />
     </Row>
     <Row
-        android:keyboardMode="@+id/mode_symbols"
-        android:rowEdgeFlags="bottom"
+        latin:keyboardMode="@+id/mode_symbols_normal"
+        latin:rowEdgeFlags="bottom"
     >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_alpha_key"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="40%p" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_bkeyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="right" />
+        <include latin:keyboardLayout="@xml/kbd_symbols_black_row4_common" />
     </Row>
     <Row
-        android:keyboardMode="@+id/mode_symbols_with_settings_key"
-        android:rowEdgeFlags="bottom"
+        latin:keyboardMode="@+id/mode_symbols_url"
+        latin:rowEdgeFlags="bottom"
     >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_alpha_key"
-            android:keyWidth="15%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_bkeyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings" />
-        <Key
-            android:codes="@integer/key_f1" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p" />
-        <Key
-            android:keyLabel="."
-            android:keyIcon="@drawable/hint_popup"
-            android:popupKeyboard="@xml/popup_punctuation" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_bkeyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="25%p"
-            android:keyEdgeFlags="right" />
+        <include latin:keyboardLayout="@xml/kbd_symbols_black_row4_common" />
+    </Row>
+    <Row
+        latin:keyboardMode="@+id/mode_symbols_email"
+        latin:rowEdgeFlags="bottom"
+    >
+        <include latin:keyboardLayout="@xml/kbd_symbols_black_row4_common" />
+    </Row>
+    <Row
+        latin:keyboardMode="@+id/mode_symbols_im"
+        latin:rowEdgeFlags="bottom"
+    >
+        <include latin:keyboardLayout="@xml/kbd_symbols_black_row4_im" />
+    </Row>
+    <Row
+        latin:keyboardMode="@+id/mode_symbols_webentry"
+        latin:rowEdgeFlags="bottom"
+    >
+        <include latin:keyboardLayout="@xml/kbd_symbols_black_row4_common" />
+    </Row>
+    <Row
+        latin:keyboardMode="@+id/mode_symbols_normal_with_settings_key"
+        latin:rowEdgeFlags="bottom"
+    >
+        <include latin:keyboardLayout="@xml/kbd_symbols_black_row4_common_with_settings_key" />
+    </Row>
+    <Row
+        latin:keyboardMode="@+id/mode_symbols_url_with_settings_key"
+        latin:rowEdgeFlags="bottom"
+    >
+        <include latin:keyboardLayout="@xml/kbd_symbols_black_row4_common_with_settings_key" />
+    </Row>
+    <Row
+        latin:keyboardMode="@+id/mode_symbols_email_with_settings_key"
+        latin:rowEdgeFlags="bottom"
+    >
+        <include latin:keyboardLayout="@xml/kbd_symbols_black_row4_common_with_settings_key" />
+    </Row>
+    <Row
+        latin:keyboardMode="@+id/mode_symbols_im_with_settings_key"
+        latin:rowEdgeFlags="bottom"
+    >
+        <include latin:keyboardLayout="@xml/kbd_symbols_black_row4_im_with_settings_key" />
+    </Row>
+    <Row
+        latin:keyboardMode="@+id/mode_symbols_webentry_with_settings_key"
+        latin:rowEdgeFlags="bottom"
+    >
+        <include latin:keyboardLayout="@xml/kbd_symbols_black_row4_common_with_settings_key" />
     </Row>
 </Keyboard>
diff --git a/java/res/xml/kbd_symbols_black_row4_common.xml b/java/res/xml/kbd_symbols_black_row4_common.xml
new file mode 100644
index 0000000..7433eca
--- /dev/null
+++ b/java/res/xml/kbd_symbols_black_row4_common.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2010, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<merge
+    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+>
+    <Key
+        latin:codes="@integer/key_symbol"
+        latin:keyLabel="@string/label_alpha_key"
+        latin:keyWidth="20%p"
+        latin:keyEdgeFlags="left" />
+    <Key
+        latin:codes="@integer/key_f1" />
+    <Key
+        latin:codes="@integer/key_space"
+        latin:keyIcon="@drawable/sym_bkeyboard_space"
+        latin:iconPreview="@drawable/sym_keyboard_feedback_space"
+        latin:keyWidth="40%p" />
+    <Key
+        latin:keyLabel="."
+        latin:keyHintIcon="@drawable/hint_popup"
+        latin:popupKeyboard="@xml/popup_punctuation" />
+    <Key
+        latin:codes="@integer/key_return"
+        latin:keyIcon="@drawable/sym_bkeyboard_return"
+        latin:iconPreview="@drawable/sym_keyboard_feedback_return"
+        latin:keyWidth="20%p"
+        latin:keyEdgeFlags="right" />
+</merge>
diff --git a/java/res/xml/kbd_symbols_black_row4_common_with_settings_key.xml b/java/res/xml/kbd_symbols_black_row4_common_with_settings_key.xml
new file mode 100644
index 0000000..bbb1699
--- /dev/null
+++ b/java/res/xml/kbd_symbols_black_row4_common_with_settings_key.xml
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2010, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<merge
+    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+>
+    <Key
+        latin:codes="@integer/key_symbol"
+        latin:keyLabel="@string/label_alpha_key"
+        latin:keyWidth="15%p"
+        latin:keyEdgeFlags="left" />
+    <Key
+        latin:codes="@integer/key_settings"
+        latin:keyIcon="@drawable/sym_bkeyboard_settings"
+        latin:iconPreview="@drawable/sym_keyboard_feedback_settings" />
+    <Key
+        latin:codes="@integer/key_f1" />
+    <Key
+        latin:codes="@integer/key_space"
+        latin:keyIcon="@drawable/sym_bkeyboard_space"
+        latin:iconPreview="@drawable/sym_keyboard_feedback_space"
+        latin:keyWidth="30%p" />
+    <Key
+        latin:keyLabel="."
+        latin:keyHintIcon="@drawable/hint_popup"
+        latin:popupKeyboard="@xml/popup_punctuation" />
+    <Key
+        latin:codes="@integer/key_return"
+        latin:keyIcon="@drawable/sym_bkeyboard_return"
+        latin:iconPreview="@drawable/sym_keyboard_feedback_return"
+        latin:keyWidth="25%p"
+        latin:keyEdgeFlags="right" />
+</merge>
diff --git a/java/res/xml/kbd_symbols_black_row4_im.xml b/java/res/xml/kbd_symbols_black_row4_im.xml
new file mode 100644
index 0000000..a1546b7
--- /dev/null
+++ b/java/res/xml/kbd_symbols_black_row4_im.xml
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2010, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<merge
+    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+>
+    <Key
+        latin:codes="@integer/key_symbol"
+        latin:keyLabel="@string/label_alpha_key"
+        latin:keyWidth="20%p"
+        latin:keyEdgeFlags="left" />
+    <Key
+        latin:codes="@integer/key_f1" />
+    <Key
+        latin:codes="@integer/key_space"
+        latin:keyIcon="@drawable/sym_bkeyboard_space"
+        latin:iconPreview="@drawable/sym_keyboard_feedback_space"
+        latin:keyWidth="40%p" />
+    <Key
+        latin:keyLabel="."
+        latin:keyHintIcon="@drawable/hint_popup"
+        latin:popupKeyboard="@xml/popup_punctuation" />
+    <Key
+        latin:keyLabel=":-)"
+        latin:keyOutputText=":-) "
+        latin:keyHintIcon="@drawable/hint_popup"
+        latin:popupKeyboard="@xml/popup_smileys"
+        latin:keyWidth="20%p"
+        latin:keyEdgeFlags="right" />
+</merge>
diff --git a/java/res/xml/kbd_symbols_black_row4_im_with_settings_key.xml b/java/res/xml/kbd_symbols_black_row4_im_with_settings_key.xml
new file mode 100644
index 0000000..4cab461
--- /dev/null
+++ b/java/res/xml/kbd_symbols_black_row4_im_with_settings_key.xml
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2010, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<merge
+    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+>
+    <Key
+        latin:codes="@integer/key_symbol"
+        latin:keyLabel="@string/label_alpha_key"
+        latin:keyWidth="15%p"
+        latin:keyEdgeFlags="left" />
+    <Key
+        latin:codes="@integer/key_settings"
+        latin:keyIcon="@drawable/sym_bkeyboard_settings"
+        latin:iconPreview="@drawable/sym_keyboard_feedback_settings" />
+    <Key
+        latin:codes="@integer/key_f1" />
+    <Key
+        latin:codes="@integer/key_space"
+        latin:keyIcon="@drawable/sym_bkeyboard_space"
+        latin:iconPreview="@drawable/sym_keyboard_feedback_space"
+        latin:keyWidth="30%p" />
+    <Key
+        latin:keyLabel="."
+        latin:keyHintIcon="@drawable/hint_popup"
+        latin:popupKeyboard="@xml/popup_punctuation" />
+    <Key
+        latin:keyLabel=":-)"
+        latin:keyOutputText=":-) "
+        latin:keyHintIcon="@drawable/hint_popup"
+        latin:popupKeyboard="@xml/popup_smileys"
+        latin:keyWidth="25%p"
+        latin:keyEdgeFlags="right" />
+</merge>
diff --git a/java/res/xml/kbd_symbols_row4_common.xml b/java/res/xml/kbd_symbols_row4_common.xml
new file mode 100644
index 0000000..ef7cdca
--- /dev/null
+++ b/java/res/xml/kbd_symbols_row4_common.xml
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2010, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<merge
+    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+>
+    <Key
+        latin:codes="@integer/key_symbol"
+        latin:keyLabel="@string/label_alpha_key"
+        latin:keyWidth="20%p"
+        latin:isModifier="true"
+        latin:keyEdgeFlags="left" />
+    <Key
+        latin:codes="@integer/key_f1"
+        latin:isModifier="true" />
+    <Key
+        latin:codes="@integer/key_space"
+        latin:keyIcon="@drawable/sym_keyboard_space"
+        latin:iconPreview="@drawable/sym_keyboard_feedback_space"
+        latin:keyWidth="40%p"
+        latin:isModifier="true" />
+    <Key
+        latin:keyLabel="."
+        latin:keyHintIcon="@drawable/hint_popup"
+        latin:popupKeyboard="@xml/popup_punctuation"
+        latin:isModifier="true" />
+    <Key
+        latin:codes="@integer/key_return"
+        latin:keyIcon="@drawable/sym_keyboard_return"
+        latin:iconPreview="@drawable/sym_keyboard_feedback_return"
+        latin:keyWidth="20%p"
+        latin:isModifier="true"
+        latin:keyEdgeFlags="right" />
+</merge>
diff --git a/java/res/xml/kbd_symbols_row4_common_with_settings_key.xml b/java/res/xml/kbd_symbols_row4_common_with_settings_key.xml
new file mode 100644
index 0000000..54b8542
--- /dev/null
+++ b/java/res/xml/kbd_symbols_row4_common_with_settings_key.xml
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2010, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<merge
+    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+>
+    <Key
+        latin:codes="@integer/key_symbol"
+        latin:keyLabel="@string/label_alpha_key"
+        latin:keyWidth="15%p"
+        latin:isModifier="true"
+        latin:keyEdgeFlags="left" />
+    <Key
+        latin:codes="@integer/key_settings"
+        latin:keyIcon="@drawable/sym_keyboard_settings"
+        latin:iconPreview="@drawable/sym_keyboard_feedback_settings"
+        latin:isModifier="true" />
+    <Key
+        latin:codes="@integer/key_f1"
+        latin:isModifier="true" />
+    <Key
+        latin:codes="@integer/key_space"
+        latin:keyIcon="@drawable/sym_keyboard_space"
+        latin:iconPreview="@drawable/sym_keyboard_feedback_space"
+        latin:keyWidth="30%p"
+        latin:isModifier="true" />
+    <Key
+        latin:keyLabel="."
+        latin:keyHintIcon="@drawable/hint_popup"
+        latin:popupKeyboard="@xml/popup_punctuation"
+        latin:isModifier="true" />
+    <Key
+        latin:codes="@integer/key_return"
+        latin:keyIcon="@drawable/sym_keyboard_return"
+        latin:iconPreview="@drawable/sym_keyboard_feedback_return"
+        latin:keyWidth="25%p"
+        latin:isModifier="true"
+        latin:keyEdgeFlags="right" />
+</merge>
diff --git a/java/res/xml/kbd_symbols_row4_im.xml b/java/res/xml/kbd_symbols_row4_im.xml
new file mode 100644
index 0000000..c7d679b
--- /dev/null
+++ b/java/res/xml/kbd_symbols_row4_im.xml
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2010, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<merge
+    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+>
+    <Key
+        latin:codes="@integer/key_symbol"
+        latin:keyLabel="@string/label_alpha_key"
+        latin:keyWidth="20%p"
+        latin:isModifier="true"
+        latin:keyEdgeFlags="left" />
+    <Key
+        latin:codes="@integer/key_f1"
+        latin:isModifier="true" />
+    <Key
+        latin:codes="@integer/key_space"
+        latin:keyIcon="@drawable/sym_keyboard_space"
+        latin:iconPreview="@drawable/sym_keyboard_feedback_space"
+        latin:keyWidth="40%p"
+        latin:isModifier="true" />
+    <Key
+        latin:keyLabel="."
+        latin:keyHintIcon="@drawable/hint_popup"
+        latin:popupKeyboard="@xml/popup_punctuation"
+        latin:isModifier="true" />
+    <Key
+        latin:keyLabel=":-)"
+        latin:keyOutputText=":-) "
+        latin:keyHintIcon="@drawable/hint_popup"
+        latin:popupKeyboard="@xml/popup_smileys"
+        latin:keyWidth="20%p"
+        latin:isModifier="true"
+        latin:keyEdgeFlags="right" />
+</merge>
diff --git a/java/res/xml/kbd_symbols_row4_im_with_settings_key.xml b/java/res/xml/kbd_symbols_row4_im_with_settings_key.xml
new file mode 100644
index 0000000..7cc209b
--- /dev/null
+++ b/java/res/xml/kbd_symbols_row4_im_with_settings_key.xml
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2010, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<merge
+    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+>
+    <Key
+        latin:codes="@integer/key_symbol"
+        latin:keyLabel="@string/label_alpha_key"
+        latin:keyWidth="15%p"
+        latin:isModifier="true"
+        latin:keyEdgeFlags="left" />
+    <Key
+        latin:codes="@integer/key_settings"
+        latin:keyIcon="@drawable/sym_keyboard_settings"
+        latin:iconPreview="@drawable/sym_keyboard_feedback_settings"
+        latin:isModifier="true" />
+    <Key
+        latin:codes="@integer/key_f1"
+        latin:isModifier="true" />
+    <Key
+        latin:codes="@integer/key_space"
+        latin:keyIcon="@drawable/sym_keyboard_space"
+        latin:iconPreview="@drawable/sym_keyboard_feedback_space"
+        latin:keyWidth="30%p"
+        latin:isModifier="true" />
+    <Key
+        latin:keyLabel="."
+        latin:keyHintIcon="@drawable/hint_popup"
+        latin:popupKeyboard="@xml/popup_punctuation"
+        latin:isModifier="true" />
+    <Key
+        latin:keyLabel=":-)"
+        latin:keyOutputText=":-) "
+        latin:keyHintIcon="@drawable/hint_popup"
+        latin:popupKeyboard="@xml/popup_smileys"
+        latin:keyWidth="25%p"
+        latin:isModifier="true"
+        latin:keyEdgeFlags="right" />
+</merge>
diff --git a/java/res/xml/kbd_symbols_shift.xml b/java/res/xml/kbd_symbols_shift.xml
index 9bee220..b8f8fae 100644
--- a/java/res/xml/kbd_symbols_shift.xml
+++ b/java/res/xml/kbd_symbols_shift.xml
@@ -19,171 +19,166 @@
 -->
 
 <Keyboard
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    android:keyWidth="10%p"
-    android:horizontalGap="0px"
-    android:verticalGap="@dimen/key_bottom_gap"
-    android:keyHeight="@dimen/key_height"
+    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+    latin:keyWidth="10%p"
+    latin:horizontalGap="@dimen/key_horizontal_gap"
+    latin:verticalGap="@dimen/key_bottom_gap"
+    latin:keyHeight="@dimen/key_height"
 >
     <Row
-        android:rowEdgeFlags="top"
+        latin:rowEdgeFlags="top"
     >
         <Key
-            android:keyLabel="~"
-            android:keyEdgeFlags="left" />
+            latin:keyLabel="~"
+            latin:keyEdgeFlags="left" />
         <Key
-            android:keyLabel="`" />
+            latin:keyLabel="`" />
         <Key
-            android:keyLabel="|" />
+            latin:keyLabel="|" />
         <Key
-            android:keyLabel="•"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="♪♥♠♦♣" />
+            latin:keyLabel="•"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="♪♥♠♦♣" />
         <Key
-            android:keyLabel="√" />
+            latin:keyLabel="√" />
         <Key
-            android:keyLabel="π"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="Π" />
+            latin:keyLabel="π"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="Π" />
         <Key
-            android:keyLabel="÷" />
+            latin:keyLabel="÷" />
         <Key
-            android:keyLabel="×" />
+            latin:keyLabel="×" />
         <Key
-            android:keyLabel="{" />
+            latin:keyLabel="{" />
         <Key
-            android:keyLabel="}"
-            android:keyEdgeFlags="right" />
+            latin:keyLabel="}"
+            latin:keyEdgeFlags="right" />
     </Row>
     <Row>
         <Key
-            android:codes="@integer/key_tab"
-            android:keyLabel="\u21E5"
-            android:keyEdgeFlags="left" />
+            latin:codes="@integer/key_tab"
+            latin:keyLabel="\u21E5"
+            latin:keyEdgeFlags="left" />
         <Key
-            android:keyLabel="£" />
+            latin:keyLabel="£" />
         <Key
-            android:keyLabel="¢" />
+            latin:keyLabel="¢" />
         <Key
-            android:keyLabel="€" />
+            latin:keyLabel="€" />
         <Key
-            android:keyLabel="°" />
+            latin:keyLabel="°" />
         <Key
-            android:keyLabel="^"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="↑↓←→" />
+            latin:keyLabel="^"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="↑↓←→" />
         <Key
-            android:keyLabel="_" />
+            latin:keyLabel="_" />
         <Key
-            android:keyLabel="="
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="≠≈∞" />
+            latin:keyLabel="="
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="≠≈∞" />
         <Key
-            android:keyLabel="[" />
+            latin:keyLabel="[" />
         <Key
-            android:keyLabel="]"
-            android:keyEdgeFlags="right" />
+            latin:keyLabel="]"
+            latin:keyEdgeFlags="right" />
     </Row>
     <Row>
         <Key
-            android:codes="@integer/key_shift"
-            android:keyLabel="@string/label_alt_key"
-            android:keyWidth="15%p"
-            android:isModifier="true"
-            android:isSticky="true"
-            android:keyEdgeFlags="left" />
+            latin:codes="@integer/key_shift"
+            latin:keyLabel="@string/label_alt_key"
+            latin:keyWidth="15%p"
+            latin:isModifier="true"
+            latin:isSticky="true"
+            latin:keyEdgeFlags="left" />
         <Key
-            android:keyLabel="™" />
+            latin:keyLabel="™" />
         <Key
-            android:keyLabel="®" />
+            latin:keyLabel="®" />
         <Key
-            android:keyLabel="©" />
+            latin:keyLabel="©" />
         <Key
-            android:keyLabel="¶"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="§" />
+            latin:keyLabel="¶"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="§" />
         <Key
-            android:keyLabel="\\" />
+            latin:keyLabel="\\" />
         <Key
-            android:keyLabel="&lt;"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="≤«‹" />
+            latin:keyLabel="&lt;"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="≤«‹" />
         <Key
-            android:keyLabel="&gt;"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="≥»›" />
+            latin:keyLabel="&gt;"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="≥»›" />
         <Key
-            android:codes="@integer/key_delete"
-            android:keyIcon="@drawable/sym_keyboard_delete"
-            android:iconPreview="@drawable/sym_keyboard_feedback_delete"
-            android:keyWidth="15%p"
-            android:isModifier="true"
-            android:isRepeatable="true"
-            android:keyEdgeFlags="right" />
+            latin:codes="@integer/key_delete"
+            latin:keyIcon="@drawable/sym_keyboard_delete"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_delete"
+            latin:keyWidth="15%p"
+            latin:isModifier="true"
+            latin:isRepeatable="true"
+            latin:keyEdgeFlags="right" />
     </Row>
     <Row
-        android:keyboardMode="@+id/mode_symbols"
-        android:rowEdgeFlags="bottom"
+        latin:keyboardMode="@+id/mode_symbols_normal"
+        latin:rowEdgeFlags="bottom"
     >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_alpha_key"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:keyLabel="„"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="40%p"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="…"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_keyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="20%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
+        <include latin:keyboardLayout="@xml/kbd_symbols_shift_row4_common" />
     </Row>
     <Row
-        android:keyboardMode="@+id/mode_symbols_with_settings_key"
-        android:rowEdgeFlags="bottom"
+        latin:keyboardMode="@+id/mode_symbols_url"
+        latin:rowEdgeFlags="bottom"
     >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_alpha_key"
-            android:keyWidth="15%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_keyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="„"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_keyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p"
-            android:isModifier="true" />
-        <Key
-            android:keyLabel="…"
-            android:isModifier="true" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_keyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="25%p"
-            android:isModifier="true"
-            android:keyEdgeFlags="right" />
+        <include latin:keyboardLayout="@xml/kbd_symbols_shift_row4_common" />
+    </Row>
+    <Row
+        latin:keyboardMode="@+id/mode_symbols_email"
+        latin:rowEdgeFlags="bottom"
+    >
+        <include latin:keyboardLayout="@xml/kbd_symbols_shift_row4_common" />
+    </Row>
+    <Row
+        latin:keyboardMode="@+id/mode_symbols_im"
+        latin:rowEdgeFlags="bottom"
+    >
+        <include latin:keyboardLayout="@xml/kbd_symbols_shift_row4_im" />
+    </Row>
+    <Row
+        latin:keyboardMode="@+id/mode_symbols_webentry"
+        latin:rowEdgeFlags="bottom"
+    >
+        <include latin:keyboardLayout="@xml/kbd_symbols_shift_row4_common" />
+    </Row>
+    <Row
+        latin:keyboardMode="@+id/mode_symbols_normal_with_settings_key"
+        latin:rowEdgeFlags="bottom"
+    >
+        <include latin:keyboardLayout="@xml/kbd_symbols_shift_row4_common_with_settings_key" />
+    </Row>
+    <Row
+        latin:keyboardMode="@+id/mode_symbols_url_with_settings_key"
+        latin:rowEdgeFlags="bottom"
+    >
+        <include latin:keyboardLayout="@xml/kbd_symbols_shift_row4_common_with_settings_key" />
+    </Row>
+    <Row
+        latin:keyboardMode="@+id/mode_symbols_email_with_settings_key"
+        latin:rowEdgeFlags="bottom"
+    >
+        <include latin:keyboardLayout="@xml/kbd_symbols_shift_row4_common_with_settings_key" />
+    </Row>
+    <Row
+        latin:keyboardMode="@+id/mode_symbols_im_with_settings_key"
+        latin:rowEdgeFlags="bottom"
+    >
+        <include latin:keyboardLayout="@xml/kbd_symbols_shift_row4_im_with_settings_key" />
+    </Row>
+    <Row
+        latin:keyboardMode="@+id/mode_symbols_webentry_with_settings_key"
+        latin:rowEdgeFlags="bottom"
+    >
+        <include latin:keyboardLayout="@xml/kbd_symbols_shift_row4_common_with_settings_key" />
     </Row>
 </Keyboard>
diff --git a/java/res/xml/kbd_symbols_shift_black.xml b/java/res/xml/kbd_symbols_shift_black.xml
index 52b67c3..34684a6 100644
--- a/java/res/xml/kbd_symbols_shift_black.xml
+++ b/java/res/xml/kbd_symbols_shift_black.xml
@@ -19,159 +19,165 @@
 -->
 
 <Keyboard
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    android:keyWidth="10%p"
-    android:horizontalGap="0px"
-    android:verticalGap="@dimen/key_bottom_gap"
-    android:keyHeight="@dimen/key_height"
+    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+    latin:keyWidth="10%p"
+    latin:horizontalGap="@dimen/key_horizontal_gap"
+    latin:verticalGap="@dimen/key_bottom_gap"
+    latin:keyHeight="@dimen/key_height"
 >
     <Row
-        android:rowEdgeFlags="top"
+        latin:rowEdgeFlags="top"
     >
         <Key
-            android:keyLabel="~"
-            android:keyEdgeFlags="left" />
+            latin:keyLabel="~"
+            latin:keyEdgeFlags="left" />
         <Key
-            android:keyLabel="`" />
+            latin:keyLabel="`" />
         <Key
-            android:keyLabel="|" />
+            latin:keyLabel="|" />
         <Key
-            android:keyLabel="•"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="♪♥♠♦♣" />
+            latin:keyLabel="•"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="♪♥♠♦♣" />
         <Key
-            android:keyLabel="√" />
+            latin:keyLabel="√" />
         <Key
-            android:keyLabel="π"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="Π" />
+            latin:keyLabel="π"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="Π" />
         <Key
-            android:keyLabel="÷" />
+            latin:keyLabel="÷" />
         <Key
-            android:keyLabel="×" />
+            latin:keyLabel="×" />
         <Key
-            android:keyLabel="{" />
+            latin:keyLabel="{" />
         <Key
-            android:keyLabel="}"
-            android:keyEdgeFlags="right" />
+            latin:keyLabel="}"
+            latin:keyEdgeFlags="right" />
     </Row>
     <Row>
         <Key
-            android:codes="@integer/key_tab"
-            android:keyLabel="\u21E5"
-            android:keyEdgeFlags="left" />
+            latin:codes="@integer/key_tab"
+            latin:keyLabel="\u21E5"
+            latin:keyEdgeFlags="left" />
         <Key
-            android:keyLabel="£" />
+            latin:keyLabel="£" />
         <Key
-            android:keyLabel="¢" />
+            latin:keyLabel="¢" />
         <Key
-            android:keyLabel="€" />
+            latin:keyLabel="€" />
         <Key
-            android:keyLabel="°" />
+            latin:keyLabel="°" />
         <Key
-            android:keyLabel="^"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="↑↓←→" />
+            latin:keyLabel="^"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="↑↓←→" />
         <Key
-            android:keyLabel="_" />
+            latin:keyLabel="_" />
         <Key
-            android:keyLabel="="
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="≠≈∞" />
+            latin:keyLabel="="
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="≠≈∞" />
         <Key
-            android:keyLabel="[" />
+            latin:keyLabel="[" />
         <Key
-            android:keyLabel="]"
-            android:keyEdgeFlags="right" />
+            latin:keyLabel="]"
+            latin:keyEdgeFlags="right" />
     </Row>
     <Row>
         <Key
-            android:codes="@integer/key_shift"
-            android:keyLabel="@string/label_alt_key"
-            android:keyWidth="15%p"
-            android:isModifier="true"
-            android:isSticky="true"
-            android:keyEdgeFlags="left" />
+            latin:codes="@integer/key_shift"
+            latin:keyLabel="@string/label_alt_key"
+            latin:keyWidth="15%p"
+            latin:isModifier="true"
+            latin:isSticky="true"
+            latin:keyEdgeFlags="left" />
         <Key
-            android:keyLabel="™" />
+            latin:keyLabel="™" />
         <Key
-            android:keyLabel="®" />
+            latin:keyLabel="®" />
         <Key
-            android:keyLabel="©" />
+            latin:keyLabel="©" />
         <Key
-            android:keyLabel="¶"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="§" />
+            latin:keyLabel="¶"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="§" />
         <Key
-            android:keyLabel="\\" />
+            latin:keyLabel="\\" />
         <Key
-            android:keyLabel="&lt;"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="≤«‹" />
+            latin:keyLabel="&lt;"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="≤«‹" />
         <Key
-            android:keyLabel="&gt;"
-            android:popupKeyboard="@xml/kbd_popup_template"
-            android:popupCharacters="≥»›" />
+            latin:keyLabel="&gt;"
+            latin:popupKeyboard="@xml/kbd_popup_template"
+            latin:popupCharacters="≥»›" />
         <Key
-            android:codes="@integer/key_delete"
-            android:keyIcon="@drawable/sym_bkeyboard_delete"
-            android:iconPreview="@drawable/sym_keyboard_feedback_delete"
-            android:keyWidth="15%p"
-            android:isRepeatable="true"
-            android:keyEdgeFlags="right" />
+            latin:codes="@integer/key_delete"
+            latin:keyIcon="@drawable/sym_bkeyboard_delete"
+            latin:iconPreview="@drawable/sym_keyboard_feedback_delete"
+            latin:keyWidth="15%p"
+            latin:isRepeatable="true"
+            latin:keyEdgeFlags="right" />
     </Row>
     <Row
-        android:keyboardMode="@+id/mode_symbols"
-        android:rowEdgeFlags="bottom"
+        latin:keyboardMode="@+id/mode_symbols_normal"
+        latin:rowEdgeFlags="bottom"
     >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_alpha_key"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:keyLabel="„" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="40%p" />
-        <Key
-            android:keyLabel="…" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_bkeyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="20%p"
-            android:keyEdgeFlags="right" />
+        <include latin:keyboardLayout="@xml/kbd_symbols_shift_black_row4_common" />
     </Row>
     <Row
-        android:keyboardMode="@+id/mode_symbols_with_settings_key"
-        android:rowEdgeFlags="bottom"
+        latin:keyboardMode="@+id/mode_symbols_url"
+        latin:rowEdgeFlags="bottom"
     >
-        <Key
-            android:codes="@integer/key_symbol"
-            android:keyLabel="@string/label_alpha_key"
-            android:keyWidth="15%p"
-            android:keyEdgeFlags="left" />
-        <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_bkeyboard_settings"
-            android:iconPreview="@drawable/sym_keyboard_feedback_settings" />
-        <Key
-            android:keyLabel="„" />
-        <Key
-            android:codes="@integer/key_space"
-            android:keyIcon="@drawable/sym_bkeyboard_space"
-            android:iconPreview="@drawable/sym_keyboard_feedback_space"
-            android:keyWidth="30%p" />
-        <Key
-            android:keyLabel="…" />
-        <Key
-            android:codes="@integer/key_return"
-            android:keyIcon="@drawable/sym_bkeyboard_return"
-            android:iconPreview="@drawable/sym_keyboard_feedback_return"
-            android:keyWidth="25%p"
-            android:keyEdgeFlags="right" />
+        <include latin:keyboardLayout="@xml/kbd_symbols_shift_black_row4_common" />
+    </Row>
+    <Row
+        latin:keyboardMode="@+id/mode_symbols_email"
+        latin:rowEdgeFlags="bottom"
+    >
+        <include latin:keyboardLayout="@xml/kbd_symbols_shift_black_row4_common" />
+    </Row>
+    <Row
+        latin:keyboardMode="@+id/mode_symbols_im"
+        latin:rowEdgeFlags="bottom"
+    >
+        <include latin:keyboardLayout="@xml/kbd_symbols_shift_black_row4_im" />
+    </Row>
+    <Row
+        latin:keyboardMode="@+id/mode_symbols_webentry"
+        latin:rowEdgeFlags="bottom"
+    >
+        <include latin:keyboardLayout="@xml/kbd_symbols_shift_black_row4_common" />
+    </Row>
+    <Row
+        latin:keyboardMode="@+id/mode_symbols_normal_with_settings_key"
+        latin:rowEdgeFlags="bottom"
+    >
+        <include latin:keyboardLayout="@xml/kbd_symbols_shift_black_row4_common_with_settings_key" />
+    </Row>
+    <Row
+        latin:keyboardMode="@+id/mode_symbols_url_with_settings_key"
+        latin:rowEdgeFlags="bottom"
+    >
+        <include latin:keyboardLayout="@xml/kbd_symbols_shift_black_row4_common_with_settings_key" />
+    </Row>
+    <Row
+        latin:keyboardMode="@+id/mode_symbols_email_with_settings_key"
+        latin:rowEdgeFlags="bottom"
+    >
+        <include latin:keyboardLayout="@xml/kbd_symbols_shift_black_row4_common_with_settings_key" />
+    </Row>
+    <Row
+        latin:keyboardMode="@+id/mode_symbols_im_with_settings_key"
+        latin:rowEdgeFlags="bottom"
+    >
+        <include latin:keyboardLayout="@xml/kbd_symbols_shift_black_row4_im_with_settings_key" />
+    </Row>
+    <Row
+        latin:keyboardMode="@+id/mode_symbols_webentry_with_settings_key"
+        latin:rowEdgeFlags="bottom"
+    >
+        <include latin:keyboardLayout="@xml/kbd_symbols_shift_black_row4_common_with_settings_key" />
     </Row>
 </Keyboard>
diff --git a/java/res/xml/kbd_symbols_shift_black_row4_common.xml b/java/res/xml/kbd_symbols_shift_black_row4_common.xml
new file mode 100644
index 0000000..beb5b3d
--- /dev/null
+++ b/java/res/xml/kbd_symbols_shift_black_row4_common.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2010, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<merge
+    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+>
+    <Key
+        latin:codes="@integer/key_symbol"
+        latin:keyLabel="@string/label_alpha_key"
+        latin:keyWidth="20%p"
+        latin:keyEdgeFlags="left" />
+    <Key
+        latin:keyLabel="„" />
+    <Key
+        latin:codes="@integer/key_space"
+        latin:keyIcon="@drawable/sym_bkeyboard_space"
+        latin:iconPreview="@drawable/sym_keyboard_feedback_space"
+        latin:keyWidth="40%p" />
+    <Key
+        latin:keyLabel="…" />
+    <Key
+        latin:codes="@integer/key_return"
+        latin:keyIcon="@drawable/sym_bkeyboard_return"
+        latin:iconPreview="@drawable/sym_keyboard_feedback_return"
+        latin:keyWidth="20%p"
+        latin:keyEdgeFlags="right" />
+</merge>
diff --git a/java/res/xml/kbd_symbols_shift_black_row4_common_with_settings_key.xml b/java/res/xml/kbd_symbols_shift_black_row4_common_with_settings_key.xml
new file mode 100644
index 0000000..97f882a
--- /dev/null
+++ b/java/res/xml/kbd_symbols_shift_black_row4_common_with_settings_key.xml
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2010, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<merge
+    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+>
+    <Key
+        latin:codes="@integer/key_symbol"
+        latin:keyLabel="@string/label_alpha_key"
+        latin:keyWidth="15%p"
+        latin:keyEdgeFlags="left" />
+    <Key
+        latin:codes="@integer/key_settings"
+        latin:keyIcon="@drawable/sym_bkeyboard_settings"
+        latin:iconPreview="@drawable/sym_keyboard_feedback_settings" />
+    <Key
+        latin:keyLabel="„" />
+    <Key
+        latin:codes="@integer/key_space"
+        latin:keyIcon="@drawable/sym_bkeyboard_space"
+        latin:iconPreview="@drawable/sym_keyboard_feedback_space"
+        latin:keyWidth="30%p" />
+    <Key
+        latin:keyLabel="…" />
+    <Key
+        latin:codes="@integer/key_return"
+        latin:keyIcon="@drawable/sym_bkeyboard_return"
+        latin:iconPreview="@drawable/sym_keyboard_feedback_return"
+        latin:keyWidth="25%p"
+        latin:keyEdgeFlags="right" />
+</merge>
diff --git a/java/res/xml/kbd_symbols_shift_black_row4_im.xml b/java/res/xml/kbd_symbols_shift_black_row4_im.xml
new file mode 100644
index 0000000..c0263c2
--- /dev/null
+++ b/java/res/xml/kbd_symbols_shift_black_row4_im.xml
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2010, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<merge
+    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+>
+    <Key
+        latin:codes="@integer/key_symbol"
+        latin:keyLabel="@string/label_alpha_key"
+        latin:keyWidth="20%p"
+        latin:keyEdgeFlags="left" />
+    <Key
+        latin:keyLabel="„" />
+    <Key
+        latin:codes="@integer/key_space"
+        latin:keyIcon="@drawable/sym_bkeyboard_space"
+        latin:iconPreview="@drawable/sym_keyboard_feedback_space"
+        latin:keyWidth="40%p" />
+    <Key
+        latin:keyLabel="…" />
+    <Key
+        latin:keyLabel=":-)"
+        latin:keyOutputText=":-) "
+        latin:keyHintIcon="@drawable/hint_popup"
+        latin:popupKeyboard="@xml/popup_smileys"
+        latin:keyWidth="20%p"
+        latin:keyEdgeFlags="right" />
+</merge>
diff --git a/java/res/xml/kbd_symbols_shift_black_row4_im_with_settings_key.xml b/java/res/xml/kbd_symbols_shift_black_row4_im_with_settings_key.xml
new file mode 100644
index 0000000..14d6a0b
--- /dev/null
+++ b/java/res/xml/kbd_symbols_shift_black_row4_im_with_settings_key.xml
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2010, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<merge
+    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+>
+    <Key
+        latin:codes="@integer/key_symbol"
+        latin:keyLabel="@string/label_alpha_key"
+        latin:keyWidth="15%p"
+        latin:keyEdgeFlags="left" />
+    <Key
+        latin:codes="@integer/key_settings"
+        latin:keyIcon="@drawable/sym_bkeyboard_settings"
+        latin:iconPreview="@drawable/sym_keyboard_feedback_settings" />
+    <Key
+        latin:keyLabel="„" />
+    <Key
+        latin:codes="@integer/key_space"
+        latin:keyIcon="@drawable/sym_bkeyboard_space"
+        latin:iconPreview="@drawable/sym_keyboard_feedback_space"
+        latin:keyWidth="30%p" />
+    <Key
+        latin:keyLabel="…" />
+    <Key
+        latin:keyLabel=":-)"
+        latin:keyOutputText=":-) "
+        latin:keyHintIcon="@drawable/hint_popup"
+        latin:popupKeyboard="@xml/popup_smileys"
+        latin:keyWidth="25%p"
+        latin:keyEdgeFlags="right" />
+</merge>
diff --git a/java/res/xml/kbd_symbols_shift_row4_common.xml b/java/res/xml/kbd_symbols_shift_row4_common.xml
new file mode 100644
index 0000000..4d5199e
--- /dev/null
+++ b/java/res/xml/kbd_symbols_shift_row4_common.xml
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2010, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<merge
+    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+>
+    <Key
+        latin:codes="@integer/key_symbol"
+        latin:keyLabel="@string/label_alpha_key"
+        latin:keyWidth="20%p"
+        latin:isModifier="true"
+        latin:keyEdgeFlags="left" />
+    <Key
+        latin:keyLabel="„"
+        latin:isModifier="true" />
+    <Key
+        latin:codes="@integer/key_space"
+        latin:keyIcon="@drawable/sym_keyboard_space"
+        latin:iconPreview="@drawable/sym_keyboard_feedback_space"
+        latin:keyWidth="40%p"
+        latin:isModifier="true" />
+    <Key
+        latin:keyLabel="…"
+        latin:isModifier="true" />
+    <Key
+        latin:codes="@integer/key_return"
+        latin:keyIcon="@drawable/sym_keyboard_return"
+        latin:iconPreview="@drawable/sym_keyboard_feedback_return"
+        latin:keyWidth="20%p"
+        latin:isModifier="true"
+        latin:keyEdgeFlags="right" />
+</merge>
diff --git a/java/res/xml/kbd_symbols_shift_row4_common_with_settings_key.xml b/java/res/xml/kbd_symbols_shift_row4_common_with_settings_key.xml
new file mode 100644
index 0000000..df570ea
--- /dev/null
+++ b/java/res/xml/kbd_symbols_shift_row4_common_with_settings_key.xml
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2010, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<merge
+    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+>
+    <Key
+        latin:codes="@integer/key_symbol"
+        latin:keyLabel="@string/label_alpha_key"
+        latin:keyWidth="15%p"
+        latin:isModifier="true"
+        latin:keyEdgeFlags="left" />
+    <Key
+        latin:codes="@integer/key_settings"
+        latin:keyIcon="@drawable/sym_keyboard_settings"
+        latin:iconPreview="@drawable/sym_keyboard_feedback_settings"
+        latin:isModifier="true" />
+    <Key
+        latin:keyLabel="„"
+        latin:isModifier="true" />
+    <Key
+        latin:codes="@integer/key_space"
+        latin:keyIcon="@drawable/sym_keyboard_space"
+        latin:iconPreview="@drawable/sym_keyboard_feedback_space"
+        latin:keyWidth="30%p"
+        latin:isModifier="true" />
+    <Key
+        latin:keyLabel="…"
+        latin:isModifier="true" />
+    <Key
+        latin:codes="@integer/key_return"
+        latin:keyIcon="@drawable/sym_keyboard_return"
+        latin:iconPreview="@drawable/sym_keyboard_feedback_return"
+        latin:keyWidth="25%p"
+        latin:isModifier="true"
+        latin:keyEdgeFlags="right" />
+</merge>
diff --git a/java/res/xml/kbd_symbols_shift_row4_im.xml b/java/res/xml/kbd_symbols_shift_row4_im.xml
new file mode 100644
index 0000000..69c6092
--- /dev/null
+++ b/java/res/xml/kbd_symbols_shift_row4_im.xml
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2010, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<merge
+    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+>
+    <Key
+        latin:codes="@integer/key_symbol"
+        latin:keyLabel="@string/label_alpha_key"
+        latin:keyWidth="20%p"
+        latin:isModifier="true"
+        latin:keyEdgeFlags="left" />
+    <Key
+        latin:keyLabel="„"
+        latin:isModifier="true" />
+    <Key
+        latin:codes="@integer/key_space"
+        latin:keyIcon="@drawable/sym_keyboard_space"
+        latin:iconPreview="@drawable/sym_keyboard_feedback_space"
+        latin:keyWidth="40%p"
+        latin:isModifier="true" />
+    <Key
+        latin:keyLabel="…"
+        latin:isModifier="true" />
+    <Key
+        latin:keyLabel=":-)"
+        latin:keyOutputText=":-) "
+        latin:keyHintIcon="@drawable/hint_popup"
+        latin:popupKeyboard="@xml/popup_smileys"
+        latin:keyWidth="20%p"
+        latin:isModifier="true"
+        latin:keyEdgeFlags="right" />
+</merge>
diff --git a/java/res/xml/kbd_symbols_shift_row4_im_with_settings_key.xml b/java/res/xml/kbd_symbols_shift_row4_im_with_settings_key.xml
new file mode 100644
index 0000000..aad6e40
--- /dev/null
+++ b/java/res/xml/kbd_symbols_shift_row4_im_with_settings_key.xml
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2010, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<merge
+    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+>
+    <Key
+        latin:codes="@integer/key_symbol"
+        latin:keyLabel="@string/label_alpha_key"
+        latin:keyWidth="15%p"
+        latin:isModifier="true"
+        latin:keyEdgeFlags="left" />
+    <Key
+        latin:codes="@integer/key_settings"
+        latin:keyIcon="@drawable/sym_keyboard_settings"
+        latin:iconPreview="@drawable/sym_keyboard_feedback_settings"
+        latin:isModifier="true" />
+    <Key
+        latin:keyLabel="„"
+        latin:isModifier="true" />
+    <Key
+        latin:codes="@integer/key_space"
+        latin:keyIcon="@drawable/sym_keyboard_space"
+        latin:iconPreview="@drawable/sym_keyboard_feedback_space"
+        latin:keyWidth="30%p"
+        latin:isModifier="true" />
+    <Key
+        latin:keyLabel="…"
+        latin:isModifier="true" />
+    <Key
+        latin:keyLabel=":-)"
+        latin:keyOutputText=":-) "
+        latin:keyHintIcon="@drawable/hint_popup"
+        latin:popupKeyboard="@xml/popup_smileys"
+        latin:keyWidth="25%p"
+        latin:isModifier="true"
+        latin:keyEdgeFlags="right" />
+</merge>
diff --git a/java/res/xml/method.xml b/java/res/xml/method.xml
index e5654e9..fab4bd7 100644
--- a/java/res/xml/method.xml
+++ b/java/res/xml/method.xml
@@ -20,7 +20,114 @@
 <!-- The attributes in this XML file provide configuration information -->
 <!-- for the Input Method Manager. -->
 
+<!-- cs, da, de, en, es, fr, it, iw, nb, nl, ru, sr, sv -->
+<!-- TODO: use <lang>_keyboard icon instead of a common keyboard icon. -->
+<!-- TODO: use <lang>_mic icon instead of a common mic icon. -->
 <input-method xmlns:android="http://schemas.android.com/apk/res/android"
         android:settingsActivity="com.android.inputmethod.latin.LatinIMESettings"
-        android:isDefault="@bool/im_is_default"
-/>
+        android:isDefault="@bool/im_is_default">
+    <subtype android:icon="@drawable/ic_subtype_keyboard"
+            android:imeSubtypeLocale="cs"
+            android:imeSubtypeMode="@string/subtype_mode_keyboard"
+    />
+    <subtype android:icon="@drawable/ic_subtype_keyboard"
+            android:imeSubtypeLocale="da"
+            android:imeSubtypeMode="@string/subtype_mode_keyboard"
+    />
+    <subtype android:icon="@drawable/ic_subtype_keyboard"
+            android:imeSubtypeLocale="de"
+            android:imeSubtypeMode="@string/subtype_mode_keyboard"
+    />
+    <subtype android:icon="@drawable/ic_subtype_keyboard"
+            android:imeSubtypeLocale="en"
+            android:imeSubtypeMode="@string/subtype_mode_keyboard"
+    />
+    <subtype android:icon="@drawable/ic_subtype_keyboard"
+            android:imeSubtypeLocale="es"
+            android:imeSubtypeMode="@string/subtype_mode_keyboard"
+    />
+    <subtype android:icon="@drawable/ic_subtype_keyboard"
+            android:imeSubtypeLocale="fr"
+            android:imeSubtypeMode="@string/subtype_mode_keyboard"
+    />
+    <subtype android:icon="@drawable/ic_subtype_keyboard"
+            android:imeSubtypeLocale="it"
+            android:imeSubtypeMode="@string/subtype_mode_keyboard"
+    />
+    <subtype android:icon="@drawable/ic_subtype_keyboard"
+            android:imeSubtypeLocale="iw"
+            android:imeSubtypeMode="@string/subtype_mode_keyboard"
+    />
+    <subtype android:icon="@drawable/ic_subtype_keyboard"
+            android:imeSubtypeLocale="nb"
+            android:imeSubtypeMode="@string/subtype_mode_keyboard"
+    />
+    <subtype android:icon="@drawable/ic_subtype_keyboard"
+            android:imeSubtypeLocale="nl"
+            android:imeSubtypeMode="@string/subtype_mode_keyboard"
+    />
+    <subtype android:icon="@drawable/ic_subtype_keyboard"
+            android:imeSubtypeLocale="ru"
+            android:imeSubtypeMode="@string/subtype_mode_keyboard"
+    />
+    <subtype android:icon="@drawable/ic_subtype_keyboard"
+            android:imeSubtypeLocale="sr"
+            android:imeSubtypeMode="@string/subtype_mode_keyboard"
+    />
+    <subtype android:icon="@drawable/ic_subtype_keyboard"
+            android:imeSubtypeLocale="sv"
+            android:imeSubtypeMode="@string/subtype_mode_keyboard"
+    />
+    <subtype android:icon="@drawable/ic_subtype_mic"
+            android:imeSubtypeLocale="cs"
+            android:imeSubtypeMode="@string/subtype_mode_voice"
+    />
+    <subtype android:icon="@drawable/ic_subtype_mic"
+            android:imeSubtypeLocale="da"
+            android:imeSubtypeMode="@string/subtype_mode_voice"
+    />
+    <subtype android:icon="@drawable/ic_subtype_mic"
+            android:imeSubtypeLocale="de"
+            android:imeSubtypeMode="@string/subtype_mode_voice"
+    />
+    <subtype android:icon="@drawable/ic_subtype_mic"
+            android:imeSubtypeLocale="en"
+            android:imeSubtypeMode="@string/subtype_mode_voice"
+    />
+    <subtype android:icon="@drawable/ic_subtype_mic"
+            android:imeSubtypeLocale="es"
+            android:imeSubtypeMode="@string/subtype_mode_voice"
+    />
+    <subtype android:icon="@drawable/ic_subtype_mic"
+            android:imeSubtypeLocale="fr"
+            android:imeSubtypeMode="@string/subtype_mode_voice"
+    />
+    <subtype android:icon="@drawable/ic_subtype_mic"
+            android:imeSubtypeLocale="it"
+            android:imeSubtypeMode="@string/subtype_mode_voice"
+    />
+    <subtype android:icon="@drawable/ic_subtype_mic"
+            android:imeSubtypeLocale="iw"
+            android:imeSubtypeMode="@string/subtype_mode_voice"
+    />
+    <subtype android:icon="@drawable/ic_subtype_mic"
+            android:imeSubtypeLocale="nb"
+            android:imeSubtypeMode="@string/subtype_mode_voice"
+    />
+    <subtype android:icon="@drawable/ic_subtype_mic"
+            android:imeSubtypeLocale="nl"
+            android:imeSubtypeMode="@string/subtype_mode_voice"
+    />
+    <subtype android:icon="@drawable/ic_subtype_mic"
+            android:imeSubtypeLocale="ru"
+            android:imeSubtypeMode="@string/subtype_mode_voice"
+    />
+    <subtype android:icon="@drawable/ic_subtype_mic"
+            android:imeSubtypeLocale="sr"
+            android:imeSubtypeMode="@string/subtype_mode_voice"
+    />
+    <subtype android:icon="@drawable/ic_subtype_mic"
+            android:imeSubtypeLocale="sv"
+            android:imeSubtypeMode="@string/subtype_mode_voice"
+    />
+</input-method>
diff --git a/java/res/xml/popup_at.xml b/java/res/xml/popup_at.xml
index 197eea4..4b19d4f 100644
--- a/java/res/xml/popup_at.xml
+++ b/java/res/xml/popup_at.xml
@@ -19,21 +19,21 @@
 -->
 
 <Keyboard
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    android:keyWidth="10%p"
-    android:horizontalGap="0px"
-    android:verticalGap="0px"
-    android:keyHeight="@dimen/popup_key_height"
+    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+    latin:keyWidth="10%p"
+    latin:horizontalGap="0px"
+    latin:verticalGap="0px"
+    latin:keyHeight="@dimen/popup_key_height"
 >
     <Row
-        android:rowEdgeFlags="top|bottom"
+        latin:rowEdgeFlags="top|bottom"
     >
         <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_keyboard_settings"
-            android:keyEdgeFlags="left" />
+            latin:codes="@integer/key_settings"
+            latin:keyIcon="@drawable/sym_keyboard_settings"
+            latin:keyEdgeFlags="left" />
         <Key
-            android:keyLabel="\@"
-            android:keyEdgeFlags="right" />
+            latin:keyLabel="\@"
+            latin:keyEdgeFlags="right" />
     </Row>
 </Keyboard>
diff --git a/java/res/xml/popup_comma.xml b/java/res/xml/popup_comma.xml
index 7666f4b..cef836a 100644
--- a/java/res/xml/popup_comma.xml
+++ b/java/res/xml/popup_comma.xml
@@ -19,21 +19,21 @@
 -->
 
 <Keyboard
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    android:keyWidth="10%p"
-    android:horizontalGap="0px"
-    android:verticalGap="0px"
-    android:keyHeight="@dimen/popup_key_height"
+    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+    latin:keyWidth="10%p"
+    latin:horizontalGap="0px"
+    latin:verticalGap="0px"
+    latin:keyHeight="@dimen/popup_key_height"
 >
     <Row
-        android:rowEdgeFlags="top|bottom"
+        latin:rowEdgeFlags="top|bottom"
     >
         <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_keyboard_settings"
-            android:keyEdgeFlags="left" />
+            latin:codes="@integer/key_settings"
+            latin:keyIcon="@drawable/sym_keyboard_settings"
+            latin:keyEdgeFlags="left" />
         <Key
-            android:keyLabel=","
-            android:keyEdgeFlags="right" />
+            latin:keyLabel=","
+            latin:keyEdgeFlags="right" />
     </Row>
 </Keyboard>
diff --git a/java/res/xml/popup_domains.xml b/java/res/xml/popup_domains.xml
index 4e9789f..5f92e2f 100644
--- a/java/res/xml/popup_domains.xml
+++ b/java/res/xml/popup_domains.xml
@@ -19,28 +19,28 @@
 -->
 
 <Keyboard
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    android:keyWidth="15%p"
-    android:horizontalGap="0px"
-    android:verticalGap="0px"
-    android:keyHeight="@dimen/popup_key_height"
+    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+    latin:keyWidth="15%p"
+    latin:horizontalGap="0px"
+    latin:verticalGap="0px"
+    latin:keyHeight="@dimen/popup_key_height"
 >
     <Row
-        android:rowEdgeFlags="top|bottom"
+        latin:rowEdgeFlags="top|bottom"
     >
         <Key
-            android:keyLabel="@string/popular_domain_1"
-            android:keyOutputText="@string/popular_domain_1"
-            android:keyEdgeFlags="left" />
+            latin:keyLabel="@string/popular_domain_1"
+            latin:keyOutputText="@string/popular_domain_1"
+            latin:keyEdgeFlags="left" />
         <Key
-            android:keyLabel="@string/popular_domain_2"
-            android:keyOutputText="@string/popular_domain_2" />
+            latin:keyLabel="@string/popular_domain_2"
+            latin:keyOutputText="@string/popular_domain_2" />
         <Key
-            android:keyLabel="@string/popular_domain_3"
-            android:keyOutputText="@string/popular_domain_3" />
+            latin:keyLabel="@string/popular_domain_3"
+            latin:keyOutputText="@string/popular_domain_3" />
         <Key
-            android:keyLabel="@string/popular_domain_4"
-            android:keyOutputText="@string/popular_domain_4"
-            android:keyEdgeFlags="right" />
+            latin:keyLabel="@string/popular_domain_4"
+            latin:keyOutputText="@string/popular_domain_4"
+            latin:keyEdgeFlags="right" />
     </Row>
 </Keyboard>
diff --git a/java/res/xml/popup_mic.xml b/java/res/xml/popup_mic.xml
index 5bbd7df..99c97ce 100644
--- a/java/res/xml/popup_mic.xml
+++ b/java/res/xml/popup_mic.xml
@@ -19,22 +19,22 @@
 -->
 
 <Keyboard
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    android:keyWidth="10%p"
-    android:horizontalGap="0px"
-    android:verticalGap="0px"
-    android:keyHeight="@dimen/popup_key_height"
+    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+    latin:keyWidth="10%p"
+    latin:horizontalGap="0px"
+    latin:verticalGap="0px"
+    latin:keyHeight="@dimen/popup_key_height"
 >
     <Row
-        android:rowEdgeFlags="top|bottom"
+        latin:rowEdgeFlags="top|bottom"
     >
         <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_keyboard_settings"
-            android:keyEdgeFlags="left" />
+            latin:codes="@integer/key_settings"
+            latin:keyIcon="@drawable/sym_keyboard_settings"
+            latin:keyEdgeFlags="left" />
         <Key
-            android:codes="@integer/key_voice"
-            android:keyIcon="@drawable/sym_keyboard_mic"
-            android:keyEdgeFlags="right" />
+            latin:codes="@integer/key_voice"
+            latin:keyIcon="@drawable/sym_keyboard_mic"
+            latin:keyEdgeFlags="right" />
     </Row>
 </Keyboard>
diff --git a/java/res/xml/popup_punctuation.xml b/java/res/xml/popup_punctuation.xml
index c429e38..76572b0 100644
--- a/java/res/xml/popup_punctuation.xml
+++ b/java/res/xml/popup_punctuation.xml
@@ -19,50 +19,50 @@
 -->
 
 <Keyboard
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    android:keyWidth="10%p"
-    android:horizontalGap="0px"
-    android:verticalGap="0px"
-    android:keyHeight="@dimen/popup_key_height"
+    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+    latin:keyWidth="10%p"
+    latin:horizontalGap="0px"
+    latin:verticalGap="0px"
+    latin:keyHeight="@dimen/popup_key_height"
 >
     <Row
-        android:rowEdgeFlags="top"
+        latin:rowEdgeFlags="top"
     >
         <Key
-            android:keyLabel=":"
-            android:keyEdgeFlags="left" />
+            latin:keyLabel=":"
+            latin:keyEdgeFlags="left" />
         <Key
-            android:keyLabel="/" />
+            latin:keyLabel="/" />
         <Key
-            android:keyLabel="&amp;" />
+            latin:keyLabel="&amp;" />
         <Key
-            android:keyLabel="(" />
+            latin:keyLabel="(" />
         <Key
-            android:keyLabel=")" />
+            latin:keyLabel=")" />
         <Key
-            android:keyLabel="-" />
+            latin:keyLabel="-" />
         <Key
-            android:keyLabel="+"
-            android:keyEdgeFlags="right" />
+            latin:keyLabel="+"
+            latin:keyEdgeFlags="right" />
     </Row>
     <Row
-        android:rowEdgeFlags="bottom"
+        latin:rowEdgeFlags="bottom"
     >
         <Key
-            android:keyLabel=";"
-            android:keyEdgeFlags="left" />
+            latin:keyLabel=";"
+            latin:keyEdgeFlags="left" />
         <Key
-            android:keyLabel="\@" />
+            latin:keyLabel="\@" />
         <Key
-            android:keyLabel="\'" />
+            latin:keyLabel="\'" />
         <Key
-            android:keyLabel="&quot;" />
+            latin:keyLabel="&quot;" />
         <Key
-            android:keyLabel="\?" />
+            latin:keyLabel="\?" />
         <Key
-            android:keyLabel="!" />
+            latin:keyLabel="!" />
         <Key
-            android:keyLabel=","
-            android:keyEdgeFlags="right" />
+            latin:keyLabel=","
+            latin:keyEdgeFlags="right" />
     </Row>
 </Keyboard>
diff --git a/java/res/xml/popup_slash.xml b/java/res/xml/popup_slash.xml
index a38fde0..1ace909 100644
--- a/java/res/xml/popup_slash.xml
+++ b/java/res/xml/popup_slash.xml
@@ -19,21 +19,21 @@
 -->
 
 <Keyboard
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    android:keyWidth="10%p"
-    android:horizontalGap="0px"
-    android:verticalGap="0px"
-    android:keyHeight="@dimen/popup_key_height"
+    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+    latin:keyWidth="10%p"
+    latin:horizontalGap="0px"
+    latin:verticalGap="0px"
+    latin:keyHeight="@dimen/popup_key_height"
 >
     <Row
-        android:rowEdgeFlags="top|bottom"
+        latin:rowEdgeFlags="top|bottom"
     >
         <Key
-            android:codes="@integer/key_settings"
-            android:keyIcon="@drawable/sym_keyboard_settings"
-            android:keyEdgeFlags="left" />
+            latin:codes="@integer/key_settings"
+            latin:keyIcon="@drawable/sym_keyboard_settings"
+            latin:keyEdgeFlags="left" />
         <Key
-            android:keyLabel="/"
-            android:keyEdgeFlags="right" />
+            latin:keyLabel="/"
+            latin:keyEdgeFlags="right" />
     </Row>
 </Keyboard>
diff --git a/java/res/xml/popup_smileys.xml b/java/res/xml/popup_smileys.xml
index 1a14e1d..2f08231 100644
--- a/java/res/xml/popup_smileys.xml
+++ b/java/res/xml/popup_smileys.xml
@@ -19,71 +19,71 @@
 -->
 
 <Keyboard
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    android:keyWidth="15%p"
-    android:horizontalGap="0px"
-    android:verticalGap="0px"
-    android:keyHeight="@dimen/popup_key_height"
+    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+    latin:keyWidth="15%p"
+    latin:horizontalGap="0px"
+    latin:verticalGap="0px"
+    latin:keyHeight="@dimen/popup_key_height"
 >
     <Row
-        android:rowEdgeFlags="top"
+        latin:rowEdgeFlags="top"
     >
         <Key
-            android:keyLabel=":-)"
-            android:keyOutputText=":-) "
-            android:keyEdgeFlags="left" />
+            latin:keyLabel=":-)"
+            latin:keyOutputText=":-) "
+            latin:keyEdgeFlags="left" />
         <Key
-            android:keyLabel=":-("
-            android:keyOutputText=":-( " />
+            latin:keyLabel=":-("
+            latin:keyOutputText=":-( " />
         <Key
-            android:keyLabel=";-)"
-            android:keyOutputText=";-) " />
+            latin:keyLabel=";-)"
+            latin:keyOutputText=";-) " />
         <Key
-            android:keyLabel=":-P"
-            android:keyOutputText=":-P " />
+            latin:keyLabel=":-P"
+            latin:keyOutputText=":-P " />
         <Key
-            android:keyLabel="=-O"
-            android:keyOutputText="=-O "
-            android:keyEdgeFlags="right" />
+            latin:keyLabel="=-O"
+            latin:keyOutputText="=-O "
+            latin:keyEdgeFlags="right" />
     </Row>
     <Row>
         <Key
-            android:keyLabel=":-*"
-            android:keyOutputText=":-* "
-            android:keyEdgeFlags="left" />
+            latin:keyLabel=":-*"
+            latin:keyOutputText=":-* "
+            latin:keyEdgeFlags="left" />
         <Key
-            android:keyLabel=":O"
-            android:keyOutputText=":O " />
+            latin:keyLabel=":O"
+            latin:keyOutputText=":O " />
         <Key
-            android:keyLabel="B-)"
-            android:keyOutputText="B-) " />
+            latin:keyLabel="B-)"
+            latin:keyOutputText="B-) " />
         <Key
-            android:keyLabel=":-$"
-            android:keyOutputText=":-$ " />
+            latin:keyLabel=":-$"
+            latin:keyOutputText=":-$ " />
         <Key
-            android:keyLabel=":-!"
-            android:keyOutputText=":-! "
-            android:keyEdgeFlags="right" />
+            latin:keyLabel=":-!"
+            latin:keyOutputText=":-! "
+            latin:keyEdgeFlags="right" />
     </Row>
     <Row
-        android:rowEdgeFlags="bottom"
+        latin:rowEdgeFlags="bottom"
     >
         <Key
-            android:keyLabel=":-["
-            android:keyOutputText=":-[ "
-            android:keyEdgeFlags="left" />
+            latin:keyLabel=":-["
+            latin:keyOutputText=":-[ "
+            latin:keyEdgeFlags="left" />
         <Key
-            android:keyLabel="O:-)"
-            android:keyOutputText="O:-) " />
+            latin:keyLabel="O:-)"
+            latin:keyOutputText="O:-) " />
         <Key
-            android:keyLabel=":-\\"
-            android:keyOutputText=":-\\ " />
+            latin:keyLabel=":-\\"
+            latin:keyOutputText=":-\\ " />
         <Key
-            android:keyLabel=":'("
-            android:keyOutputText=":'( " />
+            latin:keyLabel=":'("
+            latin:keyOutputText=":'( " />
         <Key
-            android:keyLabel=":-D"
-            android:keyOutputText=":-D "
-            android:keyEdgeFlags="right" />
+            latin:keyLabel=":-D"
+            latin:keyOutputText=":-D "
+            latin:keyEdgeFlags="right" />
     </Row>
 </Keyboard>
diff --git a/java/res/xml/prefs.xml b/java/res/xml/prefs.xml
index 9348e95..af1396c 100644
--- a/java/res/xml/prefs.xml
+++ b/java/res/xml/prefs.xml
@@ -98,13 +98,22 @@
             android:defaultValue="true"
             />
 
-        <CheckBoxPreference
-            android:key="auto_complete"
+        <ListPreference
+            android:key="auto_completion_threshold"
             android:title="@string/auto_complete"
             android:summary="@string/auto_complete_summary"
-            android:persistent="true" 
-            android:defaultValue="@bool/enable_autocorrect"
-            android:dependency="show_suggestions"
+            android:persistent="true"
+            android:entryValues="@array/auto_completion_threshold_mode_values"
+            android:entries="@array/auto_completion_threshold_modes"
+            android:defaultValue="@string/auto_completion_threshold_mode_value_modest"
+            />
+
+        <CheckBoxPreference
+            android:key="bigram_suggestion"
+            android:title="@string/bigram_suggestion"
+            android:summary="@string/bigram_suggestion_summary"
+            android:persistent="true"
+            android:defaultValue="true"
             />
     </PreferenceCategory>            
 
diff --git a/java/src/com/android/inputmethod/latin/BaseKeyboard.java b/java/src/com/android/inputmethod/latin/BaseKeyboard.java
new file mode 100644
index 0000000..cb41ad0
--- /dev/null
+++ b/java/src/com/android/inputmethod/latin/BaseKeyboard.java
@@ -0,0 +1,711 @@
+/*
+ * Copyright (C) 2010 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.latin;
+
+import org.xmlpull.v1.XmlPullParserException;
+
+import android.content.Context;
+import android.content.res.Resources;
+import android.content.res.TypedArray;
+import android.content.res.XmlResourceParser;
+import android.graphics.drawable.Drawable;
+import android.text.TextUtils;
+import android.util.DisplayMetrics;
+import android.util.Log;
+import android.util.TypedValue;
+import android.util.Xml;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.StringTokenizer;
+
+/**
+ * Loads an XML description of a keyboard and stores the attributes of the keys. A keyboard
+ * consists of rows of keys.
+ * <p>The layout file for a keyboard contains XML that looks like the following snippet:</p>
+ * <pre>
+ * &lt;Keyboard
+ *         latin:keyWidth="%10p"
+ *         latin:keyHeight="50px"
+ *         latin:horizontalGap="2px"
+ *         latin:verticalGap="2px" &gt;
+ *     &lt;Row latin:keyWidth="32px" &gt;
+ *         &lt;Key latin:keyLabel="A" /&gt;
+ *         ...
+ *     &lt;/Row&gt;
+ *     ...
+ * &lt;/Keyboard&gt;
+ * </pre>
+ */
+public class BaseKeyboard {
+
+    static final String TAG = "BaseKeyboard";
+
+    public static final int EDGE_LEFT = 0x01;
+    public static final int EDGE_RIGHT = 0x02;
+    public static final int EDGE_TOP = 0x04;
+    public static final int EDGE_BOTTOM = 0x08;
+
+    public static final int KEYCODE_SHIFT = -1;
+    public static final int KEYCODE_MODE_CHANGE = -2;
+    public static final int KEYCODE_CANCEL = -3;
+    public static final int KEYCODE_DONE = -4;
+    public static final int KEYCODE_DELETE = -5;
+    public static final int KEYCODE_ALT = -6;
+
+    /** Horizontal gap default for all rows */
+    private int mDefaultHorizontalGap;
+
+    /** Default key width */
+    private int mDefaultWidth;
+
+    /** Default key height */
+    private int mDefaultHeight;
+
+    /** Default gap between rows */
+    private int mDefaultVerticalGap;
+
+    /** Is the keyboard in the shifted state */
+    private boolean mShifted;
+
+    /** List of shift keys in this keyboard */
+    private final List<Key> mShiftKeys = new ArrayList<Key>();
+
+    /** Total height of the keyboard, including the padding and keys */
+    private int mTotalHeight;
+
+    /**
+     * Total width of the keyboard, including left side gaps and keys, but not any gaps on the
+     * right side.
+     */
+    private int mTotalWidth;
+
+    /** List of keys in this keyboard */
+    private final List<Key> mKeys = new ArrayList<Key>();
+
+    /** Width of the screen available to fit the keyboard */
+    private final int mDisplayWidth;
+
+    /** Height of the screen */
+    private final int mDisplayHeight;
+
+    /** Keyboard mode, or zero, if none.  */
+    private final int mKeyboardMode;
+
+    // Variables for pre-computing nearest keys.
+
+    private static final int GRID_WIDTH = 10;
+    private static final int GRID_HEIGHT = 5;
+    private static final int GRID_SIZE = GRID_WIDTH * GRID_HEIGHT;
+    private int mCellWidth;
+    private int mCellHeight;
+    private int[][] mGridNeighbors;
+    private int mProximityThreshold;
+    /** Number of key widths from current touch point to search for nearest keys. */
+    private static float SEARCH_DISTANCE = 1.8f;
+
+    /**
+     * Container for keys in the keyboard. All keys in a row are at the same Y-coordinate.
+     * Some of the key size defaults can be overridden per row from what the {@link BaseKeyboard}
+     * defines.
+     */
+    public static class Row {
+        /** Default width of a key in this row. */
+        public int defaultWidth;
+        /** Default height of a key in this row. */
+        public int defaultHeight;
+        /** Default horizontal gap between keys in this row. */
+        public int defaultHorizontalGap;
+        /** Vertical gap following this row. */
+        public int verticalGap;
+        /**
+         * Edge flags for this row of keys. Possible values that can be assigned are
+         * {@link BaseKeyboard#EDGE_TOP EDGE_TOP} and {@link BaseKeyboard#EDGE_BOTTOM EDGE_BOTTOM}
+         */
+        public int rowEdgeFlags;
+
+        /** The keyboard mode for this row */
+        public int mode;
+
+        private final BaseKeyboard parent;
+
+        private Row(BaseKeyboard parent) {
+            this.parent = parent;
+        }
+
+        public Row(Resources res, BaseKeyboard parent, XmlResourceParser parser) {
+            this.parent = parent;
+            TypedArray a = res.obtainAttributes(Xml.asAttributeSet(parser),
+                    R.styleable.BaseKeyboard);
+            defaultWidth = BaseKeyboardParser.getDimensionOrFraction(a,
+                    R.styleable.BaseKeyboard_keyWidth,
+                    parent.mDisplayWidth, parent.mDefaultWidth);
+            defaultHeight = BaseKeyboardParser.getDimensionOrFraction(a,
+                    R.styleable.BaseKeyboard_keyHeight,
+                    parent.mDisplayHeight, parent.mDefaultHeight);
+            defaultHorizontalGap = BaseKeyboardParser.getDimensionOrFraction(a,
+                    R.styleable.BaseKeyboard_horizontalGap,
+                    parent.mDisplayWidth, parent.mDefaultHorizontalGap);
+            verticalGap = BaseKeyboardParser.getDimensionOrFraction(a,
+                    R.styleable.BaseKeyboard_verticalGap,
+                    parent.mDisplayHeight, parent.mDefaultVerticalGap);
+            a.recycle();
+            a = res.obtainAttributes(Xml.asAttributeSet(parser),
+                    R.styleable.BaseKeyboard_Row);
+            rowEdgeFlags = a.getInt(R.styleable.BaseKeyboard_Row_rowEdgeFlags, 0);
+            mode = a.getResourceId(R.styleable.BaseKeyboard_Row_keyboardMode, 0);
+        }
+    }
+
+    /**
+     * Class for describing the position and characteristics of a single key in the keyboard.
+     */
+    public static class Key {
+        /**
+         * All the key codes (unicode or custom code) that this key could generate, zero'th
+         * being the most important.
+         */
+        public int[] codes;
+
+        /** Label to display */
+        public CharSequence label;
+        /** Label to display when keyboard is in temporary shift mode */
+        public CharSequence temporaryShiftLabel;
+
+        /** Icon to display instead of a label. Icon takes precedence over a label */
+        public Drawable icon;
+        /** Hint icon to display on the key in conjunction with the label */
+        public Drawable hintIcon;
+        /** Preview version of the icon, for the preview popup */
+        public Drawable iconPreview;
+        /** Width of the key, not including the gap */
+        public int width;
+        /** Height of the key, not including the gap */
+        public int height;
+        /** The horizontal gap before this key */
+        public int gap;
+        /** Whether this key is sticky, i.e., a toggle key */
+        public boolean sticky;
+        /** X coordinate of the key in the keyboard layout */
+        public int x;
+        /** Y coordinate of the key in the keyboard layout */
+        public int y;
+        /** The current pressed state of this key */
+        public boolean pressed;
+        /** If this is a sticky key, is it on? */
+        public boolean on;
+        /** Text to output when pressed. This can be multiple characters, like ".com" */
+        public CharSequence text;
+        /** Popup characters */
+        public CharSequence popupCharacters;
+
+        /**
+         * Flags that specify the anchoring to edges of the keyboard for detecting touch events
+         * that are just out of the boundary of the key. This is a bit mask of
+         * {@link BaseKeyboard#EDGE_LEFT}, {@link BaseKeyboard#EDGE_RIGHT},
+         * {@link BaseKeyboard#EDGE_TOP} and {@link BaseKeyboard#EDGE_BOTTOM}.
+         */
+        public int edgeFlags;
+        /** Whether this is a modifier key, such as Shift or Alt */
+        public boolean modifier;
+        /** The BaseKeyboard that this key belongs to */
+        protected final BaseKeyboard keyboard;
+        /**
+         * If this key pops up a mini keyboard, this is the resource id for the XML layout for that
+         * keyboard.
+         */
+        public int popupResId;
+        /** Whether this key repeats itself when held down */
+        public boolean repeatable;
+
+
+        private final static int[] KEY_STATE_NORMAL_ON = {
+            android.R.attr.state_checkable,
+            android.R.attr.state_checked
+        };
+
+        private final static int[] KEY_STATE_PRESSED_ON = {
+            android.R.attr.state_pressed,
+            android.R.attr.state_checkable,
+            android.R.attr.state_checked
+        };
+
+        private final static int[] KEY_STATE_NORMAL_OFF = {
+            android.R.attr.state_checkable
+        };
+
+        private final static int[] KEY_STATE_PRESSED_OFF = {
+            android.R.attr.state_pressed,
+            android.R.attr.state_checkable
+        };
+
+        private final static int[] KEY_STATE_NORMAL = {
+        };
+
+        private final static int[] KEY_STATE_PRESSED = {
+            android.R.attr.state_pressed
+        };
+
+        /** Create an empty key with no attributes. */
+        public Key(Row parent) {
+            keyboard = parent.parent;
+            height = parent.defaultHeight;
+            gap = parent.defaultHorizontalGap;
+            width = parent.defaultWidth - gap;
+            edgeFlags = parent.rowEdgeFlags;
+        }
+
+        /** Create a key with the given top-left coordinate and extract its attributes from
+         * the XML parser.
+         * @param res resources associated with the caller's context
+         * @param parent the row that this key belongs to. The row must already be attached to
+         * a {@link BaseKeyboard}.
+         * @param x the x coordinate of the top-left
+         * @param y the y coordinate of the top-left
+         * @param parser the XML parser containing the attributes for this key
+         */
+        public Key(Resources res, Row parent, int x, int y, XmlResourceParser parser) {
+            this(parent);
+
+            TypedArray a = res.obtainAttributes(Xml.asAttributeSet(parser),
+                    R.styleable.BaseKeyboard);
+            height = BaseKeyboardParser.getDimensionOrFraction(a,
+                    R.styleable.BaseKeyboard_keyHeight,
+                    keyboard.mDisplayHeight, parent.defaultHeight);
+            gap = BaseKeyboardParser.getDimensionOrFraction(a,
+                    R.styleable.BaseKeyboard_horizontalGap,
+                    keyboard.mDisplayWidth, parent.defaultHorizontalGap);
+            width = BaseKeyboardParser.getDimensionOrFraction(a,
+                    R.styleable.BaseKeyboard_keyWidth,
+                    keyboard.mDisplayWidth, parent.defaultWidth) - gap;
+            a.recycle();
+            a = res.obtainAttributes(Xml.asAttributeSet(parser), R.styleable.BaseKeyboard_Key);
+
+            // Horizontal gap is divided equally to both sides of the key.
+            this.x = x + gap / 2;
+            this.y = y;
+
+            TypedValue codesValue = new TypedValue();
+            a.getValue(R.styleable.BaseKeyboard_Key_codes, codesValue);
+            if (codesValue.type == TypedValue.TYPE_INT_DEC
+                    || codesValue.type == TypedValue.TYPE_INT_HEX) {
+                codes = new int[] { codesValue.data };
+            } else if (codesValue.type == TypedValue.TYPE_STRING) {
+                codes = parseCSV(codesValue.string.toString());
+            }
+
+            iconPreview = a.getDrawable(R.styleable.BaseKeyboard_Key_iconPreview);
+            setDefaultBounds(iconPreview);
+            popupCharacters = a.getText(R.styleable.BaseKeyboard_Key_popupCharacters);
+            popupResId = a.getResourceId(R.styleable.BaseKeyboard_Key_popupKeyboard, 0);
+            repeatable = a.getBoolean(R.styleable.BaseKeyboard_Key_isRepeatable, false);
+            modifier = a.getBoolean(R.styleable.BaseKeyboard_Key_isModifier, false);
+            sticky = a.getBoolean(R.styleable.BaseKeyboard_Key_isSticky, false);
+            edgeFlags = a.getInt(R.styleable.BaseKeyboard_Key_keyEdgeFlags, 0);
+            edgeFlags |= parent.rowEdgeFlags;
+
+            icon = a.getDrawable(R.styleable.BaseKeyboard_Key_keyIcon);
+            setDefaultBounds(icon);
+            hintIcon = a.getDrawable(R.styleable.BaseKeyboard_Key_keyHintIcon);
+            setDefaultBounds(hintIcon);
+
+            label = a.getText(R.styleable.BaseKeyboard_Key_keyLabel);
+            temporaryShiftLabel = a.getText(R.styleable.BaseKeyboard_Key_temporaryShiftKeyLabel);
+            text = a.getText(R.styleable.BaseKeyboard_Key_keyOutputText);
+
+            if (codes == null && !TextUtils.isEmpty(label)) {
+                codes = new int[] { label.charAt(0) };
+            }
+            a.recycle();
+        }
+
+        /**
+         * Informs the key that it has been pressed, in case it needs to change its appearance or
+         * state.
+         * @see #onReleased(boolean)
+         */
+        public void onPressed() {
+            pressed = !pressed;
+        }
+
+        /**
+         * 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
+         * @see #onPressed()
+         */
+        public void onReleased(boolean inside) {
+            pressed = !pressed;
+            if (sticky) {
+                on = !on;
+            }
+        }
+
+        private int[] parseCSV(String value) {
+            int count = 0;
+            int lastIndex = 0;
+            if (value.length() > 0) {
+                count++;
+                while ((lastIndex = value.indexOf(",", lastIndex + 1)) > 0) {
+                    count++;
+                }
+            }
+            int[] values = new int[count];
+            count = 0;
+            StringTokenizer st = new StringTokenizer(value, ",");
+            while (st.hasMoreTokens()) {
+                try {
+                    values[count++] = Integer.parseInt(st.nextToken());
+                } catch (NumberFormatException nfe) {
+                    Log.e(TAG, "Error parsing keycodes " + value);
+                }
+            }
+            return values;
+        }
+
+        /**
+         * Detects if a point falls inside this key.
+         * @param x the x-coordinate of the point
+         * @param y the y-coordinate of the point
+         * @return whether or not the point falls inside the key. If the key is attached to an
+         * edge, it will assume that all points between the key and the edge are considered to be
+         * inside the key.
+         */
+        public boolean isInside(int x, int y) {
+            boolean leftEdge = (edgeFlags & EDGE_LEFT) > 0;
+            boolean rightEdge = (edgeFlags & EDGE_RIGHT) > 0;
+            boolean topEdge = (edgeFlags & EDGE_TOP) > 0;
+            boolean bottomEdge = (edgeFlags & EDGE_BOTTOM) > 0;
+            if ((x >= this.x || (leftEdge && x <= this.x + this.width))
+                    && (x < this.x + this.width || (rightEdge && x >= this.x))
+                    && (y >= this.y || (topEdge && y <= this.y + this.height))
+                    && (y < this.y + this.height || (bottomEdge && y >= this.y))) {
+                return true;
+            } else {
+                return false;
+            }
+        }
+
+        /**
+         * Returns the square of the distance between the center of the key and the given point.
+         * @param x the x-coordinate of the point
+         * @param y the y-coordinate of the point
+         * @return the square of the distance of the point from the center of the key
+         */
+        public int squaredDistanceFrom(int x, int y) {
+            // We should count vertical gap between rows to calculate the center of this Key.
+            // TODO: We should re-think how we define the center of the key.
+            final int verticalGap = keyboard.getVerticalGap();
+            int xDist = this.x + width / 2 - x;
+            int yDist = this.y + (height + verticalGap) / 2 - y;
+            return xDist * xDist + yDist * yDist;
+        }
+
+        /**
+         * 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() {
+            int[] states = KEY_STATE_NORMAL;
+
+            if (on) {
+                if (pressed) {
+                    states = KEY_STATE_PRESSED_ON;
+                } else {
+                    states = KEY_STATE_NORMAL_ON;
+                }
+            } else {
+                if (sticky) {
+                    if (pressed) {
+                        states = KEY_STATE_PRESSED_OFF;
+                    } else {
+                        states = KEY_STATE_NORMAL_OFF;
+                    }
+                } else {
+                    if (pressed) {
+                        states = KEY_STATE_PRESSED;
+                    }
+                }
+            }
+            return states;
+        }
+    }
+
+    /**
+     * Creates a keyboard from the given xml key layout file.
+     * @param context the application or service context
+     * @param xmlLayoutResId the resource file that contains the keyboard layout and keys.
+     */
+    public BaseKeyboard(Context context, int xmlLayoutResId) {
+        this(context, xmlLayoutResId, 0);
+    }
+
+    /**
+     * Creates a keyboard from the given xml key layout file. Weeds out rows
+     * that have a keyboard mode defined but don't match the specified mode.
+     * @param context the application or service context
+     * @param xmlLayoutResId the resource file that contains the keyboard layout and keys.
+     * @param modeId keyboard mode identifier
+     * @param width sets width of keyboard
+     * @param height sets height of keyboard
+     */
+    public BaseKeyboard(Context context, int xmlLayoutResId, int modeId, int width, int height) {
+        mDisplayWidth = width;
+        mDisplayHeight = height;
+
+        mDefaultHorizontalGap = 0;
+        setKeyWidth(mDisplayWidth / 10);
+        mDefaultVerticalGap = 0;
+        mDefaultHeight = mDefaultWidth;
+        mKeyboardMode = modeId;
+        loadKeyboard(context, xmlLayoutResId);
+    }
+
+    /**
+     * Creates a keyboard from the given xml key layout file. Weeds out rows
+     * that have a keyboard mode defined but don't match the specified mode.
+     * @param context the application or service context
+     * @param xmlLayoutResId the resource file that contains the keyboard layout and keys.
+     * @param modeId keyboard mode identifier
+     */
+    public BaseKeyboard(Context context, int xmlLayoutResId, int modeId) {
+        DisplayMetrics dm = context.getResources().getDisplayMetrics();
+        mDisplayWidth = dm.widthPixels;
+        mDisplayHeight = dm.heightPixels;
+        //Log.v(TAG, "keyboard's display metrics:" + dm);
+
+        mDefaultHorizontalGap = 0;
+        setKeyWidth(mDisplayWidth / 10);
+        mDefaultVerticalGap = 0;
+        mDefaultHeight = mDefaultWidth;
+        mKeyboardMode = modeId;
+        loadKeyboard(context, xmlLayoutResId);
+    }
+
+    /**
+     * <p>Creates a blank keyboard from the given resource file and populates it with the specified
+     * characters in left-to-right, top-to-bottom fashion, using the specified number of columns.
+     * </p>
+     * <p>If the specified number of columns is -1, then the keyboard will fit as many keys as
+     * possible in each row.</p>
+     * @param context the application or service context
+     * @param layoutTemplateResId the layout template file, containing no keys.
+     * @param characters the list of characters to display on the keyboard. One key will be created
+     * for each character.
+     * @param columns the number of columns of keys to display. If this number is greater than the
+     * number of keys that can fit in a row, it will be ignored. If this number is -1, the
+     * keyboard will fit as many keys as possible in each row.
+     */
+    public BaseKeyboard(Context context, int layoutTemplateResId,
+            CharSequence characters, int columns, int horizontalPadding) {
+        this(context, layoutTemplateResId);
+        int x = 0;
+        int y = 0;
+        int column = 0;
+        mTotalWidth = 0;
+
+        Row row = new Row(this);
+        row.defaultHeight = mDefaultHeight;
+        row.defaultWidth = mDefaultWidth;
+        row.defaultHorizontalGap = mDefaultHorizontalGap;
+        row.verticalGap = mDefaultVerticalGap;
+        row.rowEdgeFlags = EDGE_TOP | EDGE_BOTTOM;
+        final int maxColumns = columns == -1 ? Integer.MAX_VALUE : columns;
+        for (int i = 0; i < characters.length(); i++) {
+            char c = characters.charAt(i);
+            if (column >= maxColumns
+                    || x + mDefaultWidth + horizontalPadding > mDisplayWidth) {
+                x = 0;
+                y += mDefaultVerticalGap + mDefaultHeight;
+                column = 0;
+            }
+            final Key key = new Key(row);
+            key.x = x;
+            key.y = y;
+            key.label = String.valueOf(c);
+            key.codes = new int[] { c };
+            column++;
+            x += key.width + key.gap;
+            mKeys.add(key);
+            if (x > mTotalWidth) {
+                mTotalWidth = x;
+            }
+        }
+        mTotalHeight = y + mDefaultHeight;
+    }
+
+    public List<Key> getKeys() {
+        return mKeys;
+    }
+
+    protected int getHorizontalGap() {
+        return mDefaultHorizontalGap;
+    }
+
+    protected void setHorizontalGap(int gap) {
+        mDefaultHorizontalGap = gap;
+    }
+
+    protected int getVerticalGap() {
+        return mDefaultVerticalGap;
+    }
+
+    protected void setVerticalGap(int gap) {
+        mDefaultVerticalGap = gap;
+    }
+
+    protected int getKeyHeight() {
+        return mDefaultHeight;
+    }
+
+    protected void setKeyHeight(int height) {
+        mDefaultHeight = height;
+    }
+
+    protected int getKeyWidth() {
+        return mDefaultWidth;
+    }
+
+    protected void setKeyWidth(int width) {
+        mDefaultWidth = width;
+        final int threshold = (int) (width * SEARCH_DISTANCE);
+        mProximityThreshold = threshold * threshold;
+    }
+
+    /**
+     * Returns the total height of the keyboard
+     * @return the total height of the keyboard
+     */
+    public int getHeight() {
+        return mTotalHeight;
+    }
+
+    public int getMinWidth() {
+        return mTotalWidth;
+    }
+
+    public int getKeyboardHeight() {
+        return mDisplayHeight;
+    }
+
+    public int getKeyboardWidth() {
+        return mDisplayWidth;
+    }
+
+    public int getKeyboardMode() {
+        return mKeyboardMode;
+    }
+
+    public boolean setShifted(boolean shiftState) {
+        for (final Key key : mShiftKeys) {
+            key.on = shiftState;
+        }
+        if (mShifted != shiftState) {
+            mShifted = shiftState;
+            return true;
+        }
+        return false;
+    }
+
+    public boolean isShifted() {
+        return mShifted;
+    }
+
+    public List<Key> getShiftKeys() {
+        return mShiftKeys;
+    }
+
+    private void computeNearestNeighbors() {
+        // Round-up so we don't have any pixels outside the grid
+        mCellWidth = (getMinWidth() + GRID_WIDTH - 1) / GRID_WIDTH;
+        mCellHeight = (getHeight() + GRID_HEIGHT - 1) / GRID_HEIGHT;
+        mGridNeighbors = new int[GRID_SIZE][];
+        int[] indices = new int[mKeys.size()];
+        final int gridWidth = GRID_WIDTH * mCellWidth;
+        final int gridHeight = GRID_HEIGHT * mCellHeight;
+        for (int x = 0; x < gridWidth; x += mCellWidth) {
+            for (int y = 0; y < gridHeight; y += mCellHeight) {
+                int count = 0;
+                for (int i = 0; i < mKeys.size(); i++) {
+                    final Key key = mKeys.get(i);
+                    final int threshold = mProximityThreshold;
+                    if (key.squaredDistanceFrom(x, y) < threshold ||
+                            key.squaredDistanceFrom(x + mCellWidth - 1, y) < threshold ||
+                            key.squaredDistanceFrom(x + mCellWidth - 1, y + mCellHeight - 1)
+                                < threshold ||
+                            key.squaredDistanceFrom(x, y + mCellHeight - 1) < threshold) {
+                        indices[count++] = i;
+                    }
+                }
+                int [] cell = new int[count];
+                System.arraycopy(indices, 0, cell, 0, count);
+                mGridNeighbors[(y / mCellHeight) * GRID_WIDTH + (x / mCellWidth)] = cell;
+            }
+        }
+    }
+
+    /**
+     * Returns the indices of the keys that are closest to the given point.
+     * @param x the x-coordinate of the point
+     * @param y the y-coordinate of the point
+     * @return the array of integer indices for the nearest keys to the given point. If the given
+     * point is out of range, then an array of size zero is returned.
+     */
+    public int[] getNearestKeys(int x, int y) {
+        if (mGridNeighbors == null) computeNearestNeighbors();
+        if (x >= 0 && x < getMinWidth() && y >= 0 && y < getHeight()) {
+            int index = (y / mCellHeight) * GRID_WIDTH + (x / mCellWidth);
+            if (index < GRID_SIZE) {
+                return mGridNeighbors[index];
+            }
+        }
+        return new int[0];
+    }
+
+    // TODO should be private
+    protected BaseKeyboard.Row createRowFromXml(Resources res, XmlResourceParser parser) {
+        return new BaseKeyboard.Row(res, this, parser);
+    }
+
+    // TODO should be private
+    protected BaseKeyboard.Key createKeyFromXml(Resources res, Row parent, int x, int y,
+            XmlResourceParser parser) {
+        return new BaseKeyboard.Key(res, parent, x, y, parser);
+    }
+
+    private void loadKeyboard(Context context, int xmlLayoutResId) {
+        try {
+            BaseKeyboardParser parser = new BaseKeyboardParser(this, context.getResources());
+            parser.parseKeyboard(context.getResources().getXml(xmlLayoutResId));
+            // mTotalWidth is the width of this keyboard which is maximum width of row.
+            mTotalWidth = parser.getMaxRowWidth();
+            mTotalHeight = parser.getTotalHeight();
+        } catch (XmlPullParserException e) {
+            throw new IllegalArgumentException(e);
+        } catch (IOException e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    protected static void setDefaultBounds(Drawable drawable)  {
+        if (drawable != null)
+            drawable.setBounds(0, 0, drawable.getIntrinsicWidth(),
+                    drawable.getIntrinsicHeight());
+    }
+}
diff --git a/java/src/com/android/inputmethod/latin/BaseKeyboardParser.java b/java/src/com/android/inputmethod/latin/BaseKeyboardParser.java
new file mode 100644
index 0000000..628e764
--- /dev/null
+++ b/java/src/com/android/inputmethod/latin/BaseKeyboardParser.java
@@ -0,0 +1,400 @@
+/*
+ * Copyright (C) 2010 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.latin;
+
+import com.android.inputmethod.latin.BaseKeyboard.Key;
+import com.android.inputmethod.latin.BaseKeyboard.Row;
+
+import org.xmlpull.v1.XmlPullParserException;
+
+import android.content.res.Resources;
+import android.content.res.TypedArray;
+import android.content.res.XmlResourceParser;
+import android.util.Log;
+import android.util.TypedValue;
+import android.util.Xml;
+import android.view.InflateException;
+
+import java.io.IOException;
+import java.util.List;
+
+/**
+ * Parser for BaseKeyboard.
+ *
+ * This class parses Keyboard XML file and fill out keys in BaseKeyboard.
+ * The Keyboard XML file looks like:
+ * <pre>
+ *   &gt;!-- xml/keyboard.xml --&lt;
+ *   &gt;Keyboard keyboard_attributes*&lt;
+ *     &gt;!-- Keyboard Content --&lt;
+ *     &gt;Row row_attributes*&lt;
+ *       &gt;!-- Row Content --&lt;
+ *       &gt;Key key_attributes* /&lt;
+ *       &gt;Spacer horizontalGap="0.2in" /&lt;
+ *       &gt;include keyboardLayout="@xml/other_keys"&lt;
+ *       ...
+ *     &gt;/Row&lt;
+ *     &gt;include keyboardLayout="@xml/other_rows"&lt;
+ *     ...
+ *   &gt;/Keyboard&lt;
+ * </pre>
+ * The xml file which is included in other file must have &gt;merge&lt; as root element, such as:
+ * <pre>
+ *   &gt;!-- xml/other_keys.xml --&lt;
+ *   &gt;merge&lt;
+ *     &gt;Key key_attributes* /&lt;
+ *     ...
+ *   &gt;/merge&lt;
+ * </pre>
+ * and
+ * <pre>
+ *   &gt;!-- xml/other_rows.xml --&lt;
+ *   &gt;merge&lt;
+ *     &gt;Row row_attributes*&lt;
+ *       &gt;Key key_attributes* /&lt;
+ *     &gt;/Row&lt;
+ *     ...
+ *   &gt;/merge&lt;
+ * </pre>
+ */
+public class BaseKeyboardParser {
+    private static final String TAG = "BaseKeyboardParser";
+    private static final boolean DEBUG_TAG = false;
+    private static final boolean DEBUG_PARSER = false;
+
+    // Keyboard XML Tags
+    private static final String TAG_KEYBOARD = "Keyboard";
+    private static final String TAG_ROW = "Row";
+    private static final String TAG_KEY = "Key";
+    private static final String TAG_SPACER = "Spacer";
+    private static final String TAG_INCLUDE = "include";
+    private static final String TAG_MERGE = "merge";
+
+    private final BaseKeyboard mKeyboard;
+    private final Resources mResources;
+
+    private int mCurrentX = 0;
+    private int mCurrentY = 0;
+    private int mMaxRowWidth = 0;
+    private int mTotalHeight = 0;
+    private Row mCurrentRow = null;
+
+    public BaseKeyboardParser(BaseKeyboard keyboard, Resources res) {
+        mKeyboard = keyboard;
+        mResources = res;
+    }
+
+    public int getMaxRowWidth() {
+        return mMaxRowWidth;
+    }
+
+    public int getTotalHeight() {
+        return mTotalHeight;
+    }
+
+    public void parseKeyboard(XmlResourceParser parser)
+            throws XmlPullParserException, IOException {
+        if (DEBUG_PARSER) debugEnterMethod("parseKeyboard", false);
+        int event;
+        while ((event = parser.next()) != XmlResourceParser.END_DOCUMENT) {
+            if (event == XmlResourceParser.START_TAG) {
+                final String tag = parser.getName();
+                if (DEBUG_TAG) debugStartTag("parseKeyboard", tag, false);
+                if (TAG_KEYBOARD.equals(tag)) {
+                    parseKeyboardAttributes(parser);
+                    parseKeyboardContent(parser, mKeyboard.getKeys());
+                    break;
+                } else {
+                    throw new IllegalStartTag(parser, TAG_KEYBOARD);
+                }
+            }
+        }
+        if (DEBUG_PARSER) debugLeaveMethod("parseKeyboard", false);
+    }
+
+    private void parseKeyboardAttributes(XmlResourceParser parser) {
+        final BaseKeyboard keyboard = mKeyboard;
+        final TypedArray a = mResources.obtainAttributes(Xml.asAttributeSet(parser),
+                R.styleable.BaseKeyboard);
+        final int width = keyboard.getKeyboardWidth();
+        final int height = keyboard.getKeyboardHeight();
+        keyboard.setKeyWidth(getDimensionOrFraction(a,
+                R.styleable.BaseKeyboard_keyWidth, width, width / 10));
+        keyboard.setKeyHeight(getDimensionOrFraction(a,
+                R.styleable.BaseKeyboard_keyHeight, height, 50));
+        keyboard.setHorizontalGap(getDimensionOrFraction(a,
+                R.styleable.BaseKeyboard_horizontalGap, width, 0));
+        keyboard.setVerticalGap(getDimensionOrFraction(a,
+                R.styleable.BaseKeyboard_verticalGap, height, 0));
+        a.recycle();
+    }
+
+    private void parseKeyboardContent(XmlResourceParser parser, final List<Key> keys)
+            throws XmlPullParserException, IOException {
+        if (DEBUG_PARSER) debugEnterMethod("parseKeyboardContent", keys == null);
+        int event;
+        while ((event = parser.next()) != XmlResourceParser.END_DOCUMENT) {
+            if (event == XmlResourceParser.START_TAG) {
+                final String tag = parser.getName();
+                if (DEBUG_TAG) debugStartTag("parseKeyboardContent", tag, keys == null);
+                if (TAG_ROW.equals(tag)) {
+                    Row row = mKeyboard.createRowFromXml(mResources, parser);
+                    if (keys != null && maybeStartRow(row)) {
+                        parseRowContent(parser, row, keys);
+                    } else {
+                        // Skip entire <Row></Row>
+                        parseRowContent(parser, row, null);
+                    }
+                } else if (TAG_INCLUDE.equals(tag)) {
+                    parseIncludeKeyboardContent(parser, keys);
+                } else {
+                    throw new IllegalStartTag(parser, TAG_ROW);
+                }
+            } else if (event == XmlResourceParser.END_TAG) {
+                final String tag = parser.getName();
+                if (DEBUG_TAG) debugEndTag("parseKeyboardContent", tag, keys == null);
+                if (TAG_KEYBOARD.equals(tag)) {
+                    endKeyboard(mKeyboard.getVerticalGap());
+                    break;
+                } else if (TAG_MERGE.equals(tag)) {
+                    break;
+                } else {
+                    throw new IllegalEndTag(parser, TAG_ROW);
+                }
+            }
+        }
+        if (DEBUG_PARSER) debugLeaveMethod("parseKeyboardContent", keys == null);
+    }
+
+    private void parseRowContent(XmlResourceParser parser, Row row, List<Key> keys)
+            throws XmlPullParserException, IOException {
+        if (DEBUG_PARSER) debugEnterMethod("parseRowContent", keys == null);
+        int event;
+        while ((event = parser.next()) != XmlResourceParser.END_DOCUMENT) {
+            if (event == XmlResourceParser.START_TAG) {
+                final String tag = parser.getName();
+                if (DEBUG_TAG) debugStartTag("parseRowContent", tag, keys == null);
+                if (TAG_KEY.equals(tag)) {
+                    parseKey(parser, row, keys);
+                } else if (TAG_SPACER.equals(tag)) {
+                    parseSpacer(parser, keys);
+                } else if (TAG_INCLUDE.equals(tag)) {
+                    parseIncludeRowContent(parser, row, keys);
+                } else {
+                    throw new IllegalStartTag(parser, TAG_KEY);
+                }
+            } else if (event == XmlResourceParser.END_TAG) {
+                final String tag = parser.getName();
+                if (DEBUG_TAG) debugEndTag("parseRowContent", tag, keys == null);
+                if (TAG_ROW.equals(tag)) {
+                    if (keys != null)
+                        endRow();
+                    break;
+                } else if (TAG_MERGE.equals(tag)) {
+                    break;
+                } else {
+                    throw new IllegalEndTag(parser, TAG_KEY);
+                }
+            }
+        }
+        if (DEBUG_PARSER) debugLeaveMethod("parseRowContent", keys == null);
+    }
+
+    private void parseKey(XmlResourceParser parser, Row row, List<Key> keys)
+            throws XmlPullParserException, IOException {
+        if (DEBUG_PARSER) debugEnterMethod("parseKey", keys == null);
+        if (keys == null) {
+            checkEndTag(TAG_KEY, parser);
+        } else {
+            Key key = mKeyboard.createKeyFromXml(mResources, row, mCurrentX, mCurrentY, parser);
+            checkEndTag(TAG_KEY, parser);
+            keys.add(key);
+            if (key.codes[0] == BaseKeyboard.KEYCODE_SHIFT)
+                mKeyboard.getShiftKeys().add(key);
+            endKey(key);
+        }
+    }
+
+    private void parseSpacer(XmlResourceParser parser, List<Key> keys)
+            throws XmlPullParserException, IOException {
+        if (DEBUG_PARSER) debugEnterMethod("parseSpacer", keys == null);
+        if (keys == null) {
+            checkEndTag(TAG_SPACER, parser);
+        } else {
+            final TypedArray a = mResources.obtainAttributes(Xml.asAttributeSet(parser),
+                    R.styleable.BaseKeyboard);
+            int gap = getDimensionOrFraction(a, R.styleable.BaseKeyboard_horizontalGap,
+                    mKeyboard.getKeyboardWidth(), 0);
+            a.recycle();
+            checkEndTag(TAG_SPACER, parser);
+            setSpacer(gap);
+        }
+    }
+
+    private void parseIncludeKeyboardContent(XmlResourceParser parser, List<Key> keys)
+            throws XmlPullParserException, IOException {
+        parseIncludeInternal(parser, null, keys);
+    }
+
+    private void parseIncludeRowContent(XmlResourceParser parser, Row row, List<Key> keys)
+            throws XmlPullParserException, IOException {
+        parseIncludeInternal(parser, row, keys);
+    }
+
+    private void parseIncludeInternal(XmlResourceParser parser, Row row, List<Key> keys)
+            throws XmlPullParserException, IOException {
+        if (DEBUG_PARSER) debugEnterMethod("parseInclude", keys == null);
+        if (keys == null) {
+            checkEndTag(TAG_INCLUDE, parser);
+        } else {
+            final TypedArray a = mResources.obtainAttributes(Xml.asAttributeSet(parser),
+                    R.styleable.BaseKeyboard_Include);
+            final int keyboardLayout = a.getResourceId(
+                    R.styleable.BaseKeyboard_Include_keyboardLayout, 0);
+            a.recycle();
+
+            checkEndTag(TAG_INCLUDE, parser);
+            if (keyboardLayout == 0)
+                throw new ParseException("No keyboardLayout attribute in <include/>", parser);
+            parseMerge(mResources.getLayout(keyboardLayout), row, keys);
+        }
+        if (DEBUG_PARSER) debugLeaveMethod("parseInclude", keys == null);
+    }
+
+    private void parseMerge(XmlResourceParser parser, Row row, List<Key> keys)
+            throws XmlPullParserException, IOException {
+        if (DEBUG_PARSER) debugEnterMethod("parseMerge", keys == null);
+        int event;
+        while ((event = parser.next()) != XmlResourceParser.END_DOCUMENT) {
+            if (event == XmlResourceParser.START_TAG) {
+                String tag = parser.getName();
+                if (DEBUG_TAG) debugStartTag("parseMerge", tag, keys == null);
+                if (TAG_MERGE.equals(tag)) {
+                    if (row == null) {
+                        parseKeyboardContent(parser, keys);
+                    } else {
+                        parseRowContent(parser, row, keys);
+                    }
+                    break;
+                } else {
+                    throw new ParseException(
+                            "Included keyboard layout must have <merge> root element", parser);
+                }
+            }
+        }
+        if (DEBUG_PARSER) debugLeaveMethod("parseMerge", keys == null);
+    }
+
+    private static void checkEndTag(String tag, XmlResourceParser parser)
+            throws XmlPullParserException, IOException {
+        if (parser.next() == XmlResourceParser.END_TAG && tag.equals(parser.getName()))
+            return;
+        throw new NonEmptyTag(tag, parser);
+    }
+
+    // return true if the row is valid for this keyboard mode
+    private boolean maybeStartRow(Row row) {
+        if (DEBUG_TAG)
+            Log.d(TAG, String.format("startRow: mode=0x%08x keyboardMode=0x%08x",
+                    row.mode, mKeyboard.getKeyboardMode()));
+        if (row.mode == 0 || row.mode == mKeyboard.getKeyboardMode()) {
+            mCurrentX = 0;
+            mCurrentRow = row;
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    private void endRow() {
+        if (mCurrentRow == null)
+            throw new InflateException("orphant end row tag");
+        mCurrentY += mCurrentRow.verticalGap + mCurrentRow.defaultHeight;
+        mCurrentRow = null;
+    }
+
+    private void endKey(Key key) {
+        mCurrentX += key.gap + key.width;
+        if (mCurrentX > mMaxRowWidth)
+            mMaxRowWidth = mCurrentX;
+    }
+
+    private void endKeyboard(int defaultVerticalGap) {
+        mTotalHeight = mCurrentY - defaultVerticalGap;
+    }
+
+    private void setSpacer(int gap) {
+        mCurrentX += gap;
+    }
+
+    public static int getDimensionOrFraction(TypedArray a, int index, int base, int defValue) {
+        final TypedValue value = a.peekValue(index);
+        if (value == null)
+            return defValue;
+        if (value.type == TypedValue.TYPE_DIMENSION) {
+            return a.getDimensionPixelOffset(index, defValue);
+        } else if (value.type == TypedValue.TYPE_FRACTION) {
+            // Round it to avoid values like 47.9999 from getting truncated
+            return Math.round(a.getFraction(index, base, base, defValue));
+        }
+        return defValue;
+    }
+
+    @SuppressWarnings("serial")
+    private static class ParseException extends InflateException {
+        public ParseException(String msg, XmlResourceParser parser) {
+            super(msg + " at line " + parser.getLineNumber());
+        }
+    }
+
+    @SuppressWarnings("serial")
+    private static class IllegalStartTag extends ParseException {
+        public IllegalStartTag(XmlResourceParser parser, String parent) {
+            super("Illegal start tag " + parser.getName() + " in " + parent, parser);
+        }
+    }
+
+    @SuppressWarnings("serial")
+    private static class IllegalEndTag extends ParseException {
+        public IllegalEndTag(XmlResourceParser parser, String parent) {
+            super("Illegal end tag " + parser.getName() + " in " + parent, parser);
+        }
+    }
+
+    @SuppressWarnings("serial")
+    private static class NonEmptyTag extends ParseException {
+        public NonEmptyTag(String tag, XmlResourceParser parser) {
+            super(tag + " must be empty tag", parser);
+        }
+    }
+
+    private static void debugEnterMethod(String title, boolean skip) {
+        Log.d(TAG, title + ": enter" + (skip ? " skip" : ""));
+    }
+
+    private static void debugLeaveMethod(String title, boolean skip) {
+        Log.d(TAG, title + ": leave" + (skip ? " skip" : ""));
+    }
+
+    private static void debugStartTag(String title, String tag, boolean skip) {
+        Log.d(TAG, title + ": <" + tag + ">" + (skip ? " skip" : ""));
+    }
+
+    private static void debugEndTag(String title, String tag, boolean skip) {
+        Log.d(TAG, title + ": </" + tag + ">" + (skip ? " skip" : ""));
+    }
+ }
diff --git a/java/src/com/android/inputmethod/latin/KeyDetector.java b/java/src/com/android/inputmethod/latin/KeyDetector.java
index 76fe120..3902b60 100644
--- a/java/src/com/android/inputmethod/latin/KeyDetector.java
+++ b/java/src/com/android/inputmethod/latin/KeyDetector.java
@@ -16,14 +16,13 @@
 
 package com.android.inputmethod.latin;
 
-import android.inputmethodservice.Keyboard;
-import android.inputmethodservice.Keyboard.Key;
+import com.android.inputmethod.latin.BaseKeyboard.Key;
 
 import java.util.Arrays;
 import java.util.List;
 
 abstract class KeyDetector {
-    protected Keyboard mKeyboard;
+    protected BaseKeyboard mKeyboard;
 
     private Key[] mKeys;
 
@@ -35,7 +34,7 @@
 
     protected int mProximityThresholdSquare;
 
-    public Key[] setKeyboard(Keyboard keyboard, float correctionX, float correctionY) {
+    public Key[] setKeyboard(BaseKeyboard keyboard, float correctionX, float correctionY) {
         if (keyboard == null)
             throw new NullPointerException();
         mCorrectionX = (int)correctionX;
diff --git a/java/src/com/android/inputmethod/latin/KeyboardSwitcher.java b/java/src/com/android/inputmethod/latin/KeyboardSwitcher.java
index a7b695e..3a54904 100644
--- a/java/src/com/android/inputmethod/latin/KeyboardSwitcher.java
+++ b/java/src/com/android/inputmethod/latin/KeyboardSwitcher.java
@@ -29,14 +29,14 @@
 
 public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceChangeListener {
 
-    public static final int MODE_NONE = 0;
-    public static final int MODE_TEXT = 1;
-    public static final int MODE_SYMBOLS = 2;
-    public static final int MODE_PHONE = 3;
-    public static final int MODE_URL = 4;
-    public static final int MODE_EMAIL = 5;
-    public static final int MODE_IM = 6;
-    public static final int MODE_WEB = 7;
+    public static final int MODE_TEXT = 0;
+    public static final int MODE_URL = 1;
+    public static final int MODE_EMAIL = 2;
+    public static final int MODE_IM = 3;
+    public static final int MODE_WEB = 4;
+    public static final int MODE_PHONE = 5;
+
+    public static final int MODE_NONE = -1;
 
     // Main keyboard layouts without the settings key
     public static final int KEYBOARDMODE_NORMAL = R.id.mode_normal;
@@ -44,6 +44,13 @@
     public static final int KEYBOARDMODE_EMAIL = R.id.mode_email;
     public static final int KEYBOARDMODE_IM = R.id.mode_im;
     public static final int KEYBOARDMODE_WEB = R.id.mode_webentry;
+    public static final int[] QWERTY_MODES = {
+            KEYBOARDMODE_NORMAL,
+            KEYBOARDMODE_URL,
+            KEYBOARDMODE_EMAIL,
+            KEYBOARDMODE_IM,
+            KEYBOARDMODE_WEB,
+            0 /* for MODE_PHONE */ };
     // Main keyboard layouts with the settings key
     public static final int KEYBOARDMODE_NORMAL_WITH_SETTINGS_KEY =
             R.id.mode_normal_with_settings_key;
@@ -55,12 +62,45 @@
             R.id.mode_im_with_settings_key;
     public static final int KEYBOARDMODE_WEB_WITH_SETTINGS_KEY =
             R.id.mode_webentry_with_settings_key;
+    public static final int[] QWERTY_WITH_SETTINGS_KEY_MODES = {
+            KEYBOARDMODE_NORMAL_WITH_SETTINGS_KEY,
+            KEYBOARDMODE_URL_WITH_SETTINGS_KEY,
+            KEYBOARDMODE_EMAIL_WITH_SETTINGS_KEY,
+            KEYBOARDMODE_IM_WITH_SETTINGS_KEY,
+            KEYBOARDMODE_WEB_WITH_SETTINGS_KEY,
+            0 /* for MODE_PHONE */ };
 
-    // Symbols keyboard layout without the settings key
-    public static final int KEYBOARDMODE_SYMBOLS = R.id.mode_symbols;
-    // Symbols keyboard layout with the settings key
-    public static final int KEYBOARDMODE_SYMBOLS_WITH_SETTINGS_KEY =
-            R.id.mode_symbols_with_settings_key;
+    // Symbols keyboard layouts without the settings key
+    public static final int KEYBOARDMODE_SYMBOLS_NORMAL = R.id.mode_symbols_normal;
+    public static final int KEYBOARDMODE_SYMBOLS_URL = R.id.mode_symbols_url;
+    public static final int KEYBOARDMODE_SYMBOLS_EMAIL = R.id.mode_symbols_email;
+    public static final int KEYBOARDMODE_SYMBOLS_IM = R.id.mode_symbols_im;
+    public static final int KEYBOARDMODE_SYMBOLS_WEB = R.id.mode_symbols_webentry;
+    public static final int[] SYMBOLS_MODES = {
+            KEYBOARDMODE_SYMBOLS_NORMAL,
+            KEYBOARDMODE_SYMBOLS_URL,
+            KEYBOARDMODE_SYMBOLS_EMAIL,
+            KEYBOARDMODE_SYMBOLS_IM,
+            KEYBOARDMODE_SYMBOLS_WEB,
+            0 /* for MODE_PHONE */ };
+    // Symbols keyboard layouts with the settings key
+    public static final int KEYBOARDMODE_SYMBOLS_NORMAL_WITH_SETTINGS_KEY =
+            R.id.mode_symbols_normal_with_settings_key;
+    public static final int KEYBOARDMODE_SYMBOLS_URL_WITH_SETTINGS_KEY =
+            R.id.mode_symbols_url_with_settings_key;
+    public static final int KEYBOARDMODE_SYMBOLS_EMAIL_WITH_SETTINGS_KEY =
+            R.id.mode_symbols_email_with_settings_key;
+    public static final int KEYBOARDMODE_SYMBOLS_IM_WITH_SETTINGS_KEY =
+            R.id.mode_symbols_im_with_settings_key;
+    public static final int KEYBOARDMODE_SYMBOLS_WEB_WITH_SETTINGS_KEY =
+            R.id.mode_symbols_webentry_with_settings_key;
+    public static final int[] SYMBOLS_WITH_SETTINGS_KEY_MODES = {
+            KEYBOARDMODE_SYMBOLS_NORMAL_WITH_SETTINGS_KEY,
+            KEYBOARDMODE_SYMBOLS_URL_WITH_SETTINGS_KEY,
+            KEYBOARDMODE_SYMBOLS_EMAIL_WITH_SETTINGS_KEY,
+            KEYBOARDMODE_SYMBOLS_IM_WITH_SETTINGS_KEY,
+            KEYBOARDMODE_SYMBOLS_WEB_WITH_SETTINGS_KEY,
+            0 /* for MODE_PHONE */ };
 
     public static final String DEFAULT_LAYOUT_ID = "4";
     public static final String PREF_KEYBOARD_LAYOUT = "pref_keyboard_layout_20100902";
@@ -115,17 +155,15 @@
     private boolean mIsAutoCompletionActive;
     private boolean mHasVoice;
     private boolean mVoiceOnPrimary;
-    private boolean mPreferSymbols;
     private int mSymbolsModeState = SYMBOLS_MODE_STATE_NONE;
 
     // Indicates whether or not we have the settings key
     private boolean mHasSettingsKey;
     private static final int SETTINGS_KEY_MODE_AUTO = R.string.settings_key_mode_auto;
-    private static final int SETTINGS_KEY_MODE_ALWAYS_SHOW = R.string.settings_key_mode_always_show;
-    // NOTE: No need to have SETTINGS_KEY_MODE_ALWAYS_HIDE here because it's not being referred to
-    // in the source code now.
-    // Default is SETTINGS_KEY_MODE_AUTO.
-    private static final int DEFAULT_SETTINGS_KEY_MODE = SETTINGS_KEY_MODE_AUTO;
+    private static final int SETTINGS_KEY_MODE_ALWAYS_SHOW =
+            R.string.settings_key_mode_always_show;
+    private static final int SETTINGS_KEY_MODE_ALWAYS_HIDE =
+            R.string.settings_key_mode_always_hide;
 
     private int mLastDisplayWidth;
     private LanguageSwitcher mLanguageSwitcher;
@@ -158,21 +196,26 @@
     }
 
     private KeyboardId makeSymbolsId(boolean hasVoice) {
+        final int mode = mMode == MODE_NONE ? MODE_TEXT : mMode;
         return new KeyboardId(KBD_SYMBOLS[getCharColorId()], mHasSettingsKey ?
-                KEYBOARDMODE_SYMBOLS_WITH_SETTINGS_KEY : KEYBOARDMODE_SYMBOLS,
+                SYMBOLS_WITH_SETTINGS_KEY_MODES[mode] : SYMBOLS_MODES[mode],
                 false, hasVoice);
     }
 
     private KeyboardId makeSymbolsShiftedId(boolean hasVoice) {
+        final int mode = mMode == MODE_NONE ? MODE_TEXT : mMode;
         return new KeyboardId(KBD_SYMBOLS_SHIFT[getCharColorId()], mHasSettingsKey ?
-                KEYBOARDMODE_SYMBOLS_WITH_SETTINGS_KEY : KEYBOARDMODE_SYMBOLS,
+                SYMBOLS_WITH_SETTINGS_KEY_MODES[mode] : SYMBOLS_MODES[mode],
                 false, hasVoice);
     }
 
-    public void makeKeyboards(boolean forceCreate) {
+    private void makeSymbolsKeyboardIds() {
         mSymbolsId = makeSymbolsId(mHasVoice && !mVoiceOnPrimary);
         mSymbolsShiftedId = makeSymbolsShiftedId(mHasVoice && !mVoiceOnPrimary);
+    }
 
+    public void makeKeyboards(boolean forceCreate) {
+        makeSymbolsKeyboardIds();
         if (forceCreate) mKeyboards.clear();
         // Configuration change is coming after the keyboard gets recreated. So don't rely on that.
         // If keyboards have already been made, check if we have a screen width change and 
@@ -207,10 +250,6 @@
             });
         }
 
-        public KeyboardId(int xml, boolean hasVoice) {
-            this(xml, 0, false, hasVoice);
-        }
-
         @Override
         public boolean equals(Object other) {
             return other instanceof KeyboardId && equals((KeyboardId) other);
@@ -244,14 +283,10 @@
 
     public void setKeyboardMode(int mode, int imeOptions, boolean enableVoice) {
         mSymbolsModeState = SYMBOLS_MODE_STATE_NONE;
-        mPreferSymbols = mode == MODE_SYMBOLS;
-        if (mode == MODE_SYMBOLS) {
-            mode = MODE_TEXT;
-        }
         try {
-            setKeyboardMode(mode, imeOptions, enableVoice, mPreferSymbols);
+            setKeyboardMode(mode, imeOptions, enableVoice, false);
         } catch (RuntimeException e) {
-            LatinImeLogger.logOnException(mode + "," + imeOptions + "," + mPreferSymbols, e);
+            LatinImeLogger.logOnException(mode + "," + imeOptions, e);
         }
     }
 
@@ -259,6 +294,7 @@
         if (mInputView == null) return;
         mMode = mode;
         mImeOptions = imeOptions;
+        makeSymbolsKeyboardIds();
         if (enableVoice != mHasVoice) {
             // TODO clean up this unnecessary recursive call.
             setVoiceMode(enableVoice, mVoiceOnPrimary);
@@ -278,7 +314,7 @@
         mInputView.setKeyboard(keyboard);
         keyboard.setShifted(false);
         keyboard.setShiftLocked(keyboard.isShiftLocked());
-        keyboard.setImeOptions(mInputMethodService.getResources(), mMode, imeOptions);
+        keyboard.setImeOptions(mInputMethodService.getResources(), mode, imeOptions);
         keyboard.setColorOfSymbolIcons(mIsAutoCompletionActive, isBlackSym());
         // Update the settings key state because number of enabled IMEs could have been changed
         updateSettingsKeyState(PreferenceManager.getDefaultSharedPreferences(mInputMethodService));
@@ -310,48 +346,31 @@
     }
 
     private KeyboardId getKeyboardId(int mode, int imeOptions, boolean isSymbols) {
-        boolean hasVoice = hasVoiceButton(isSymbols);
-        int charColorId = getCharColorId();
-        // TODO: generalize for any KeyboardId
-        int keyboardRowsResId = KBD_QWERTY[charColorId];
+        final boolean hasVoice = hasVoiceButton(isSymbols);
+        final int charColorId = getCharColorId();
+        final int keyboardRowsResId;
+        final boolean enableShiftLock;
+        final int keyboardMode;
+
+        if (mode == MODE_NONE) {
+            LatinImeLogger.logOnWarning(
+                    "getKeyboardId:" + mode + "," + imeOptions + "," + isSymbols);
+            mode = MODE_TEXT;
+        }
         if (isSymbols) {
-            if (mode == MODE_PHONE) {
-                return new KeyboardId(KBD_PHONE_SYMBOLS[charColorId], hasVoice);
-            } else {
-                return new KeyboardId(KBD_SYMBOLS[charColorId], mHasSettingsKey ?
-                        KEYBOARDMODE_SYMBOLS_WITH_SETTINGS_KEY : KEYBOARDMODE_SYMBOLS,
-                        false, hasVoice);
-            }
+            keyboardRowsResId = mode == MODE_PHONE
+                    ? KBD_PHONE_SYMBOLS[charColorId] : KBD_SYMBOLS[charColorId];
+            enableShiftLock = false;
+            keyboardMode = mHasSettingsKey
+                    ? SYMBOLS_WITH_SETTINGS_KEY_MODES[mode] : SYMBOLS_MODES[mode];
+        } else {  // QWERTY
+            keyboardRowsResId = mode == MODE_PHONE
+                    ? KBD_PHONE[charColorId] : KBD_QWERTY[charColorId];
+            enableShiftLock = mode == MODE_PHONE ? false : true;
+            keyboardMode = mHasSettingsKey
+                    ? QWERTY_WITH_SETTINGS_KEY_MODES[mode] : QWERTY_MODES[mode];
         }
-        switch (mode) {
-            case MODE_NONE:
-                LatinImeLogger.logOnWarning(
-                        "getKeyboardId:" + mode + "," + imeOptions + "," + isSymbols);
-                /* fall through */
-            case MODE_TEXT:
-                return new KeyboardId(keyboardRowsResId, mHasSettingsKey ?
-                        KEYBOARDMODE_NORMAL_WITH_SETTINGS_KEY : KEYBOARDMODE_NORMAL,
-                        true, hasVoice);
-            case MODE_SYMBOLS:
-                return new KeyboardId(KBD_SYMBOLS[charColorId], mHasSettingsKey ?
-                        KEYBOARDMODE_SYMBOLS_WITH_SETTINGS_KEY : KEYBOARDMODE_SYMBOLS,
-                        false, hasVoice);
-            case MODE_PHONE:
-                return new KeyboardId(KBD_PHONE[charColorId], hasVoice);
-            case MODE_URL:
-                return new KeyboardId(keyboardRowsResId, mHasSettingsKey ?
-                        KEYBOARDMODE_URL_WITH_SETTINGS_KEY : KEYBOARDMODE_URL, true, hasVoice);
-            case MODE_EMAIL:
-                return new KeyboardId(keyboardRowsResId, mHasSettingsKey ?
-                        KEYBOARDMODE_EMAIL_WITH_SETTINGS_KEY : KEYBOARDMODE_EMAIL, true, hasVoice);
-            case MODE_IM:
-                return new KeyboardId(keyboardRowsResId, mHasSettingsKey ?
-                        KEYBOARDMODE_IM_WITH_SETTINGS_KEY : KEYBOARDMODE_IM, true, hasVoice);
-            case MODE_WEB:
-                return new KeyboardId(keyboardRowsResId, mHasSettingsKey ?
-                        KEYBOARDMODE_WEB_WITH_SETTINGS_KEY : KEYBOARDMODE_WEB, true, hasVoice);
-        }
-        return null;
+        return new KeyboardId(keyboardRowsResId, keyboardMode, enableShiftLock, hasVoice);
     }
 
     public int getKeyboardMode() {
@@ -412,7 +431,7 @@
 
     public void toggleSymbols() {
         setKeyboardMode(mMode, mImeOptions, mHasVoice, !mIsSymbols);
-        if (mIsSymbols && !mPreferSymbols) {
+        if (mIsSymbols) {
             mSymbolsModeState = SYMBOLS_MODE_STATE_BEGIN;
         } else {
             mSymbolsModeState = SYMBOLS_MODE_STATE_NONE;
@@ -523,8 +542,12 @@
 
     private void updateSettingsKeyState(SharedPreferences prefs) {
         Resources resources = mInputMethodService.getResources();
+        final boolean showSettingsKeyOption = resources.getBoolean(
+                R.bool.config_enable_show_settings_key_option);
+        final int defaultSettingsKeyMode = showSettingsKeyOption
+                ? SETTINGS_KEY_MODE_AUTO : SETTINGS_KEY_MODE_ALWAYS_HIDE;
         final String settingsKeyMode = prefs.getString(LatinIMESettings.PREF_SETTINGS_KEY,
-                resources.getString(DEFAULT_SETTINGS_KEY_MODE));
+                resources.getString(defaultSettingsKeyMode));
         // We show the settings key when 1) SETTINGS_KEY_MODE_ALWAYS_SHOW or
         // 2) SETTINGS_KEY_MODE_AUTO and there are two or more enabled IMEs on the system
         if (settingsKeyMode.equals(resources.getString(SETTINGS_KEY_MODE_ALWAYS_SHOW))
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index b6fee11..bb29e63 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -34,7 +34,6 @@
 import android.content.res.Resources;
 import android.content.res.XmlResourceParser;
 import android.inputmethodservice.InputMethodService;
-import android.inputmethodservice.Keyboard;
 import android.media.AudioManager;
 import android.os.Debug;
 import android.os.Handler;
@@ -69,6 +68,7 @@
 import java.io.IOException;
 import java.io.PrintWriter;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
@@ -95,8 +95,8 @@
     private static final String PREF_AUTO_CAP = "auto_cap";
     private static final String PREF_QUICK_FIXES = "quick_fixes";
     private static final String PREF_SHOW_SUGGESTIONS = "show_suggestions";
-    private static final String PREF_AUTO_COMPLETE = "auto_complete";
-    //private static final String PREF_BIGRAM_SUGGESTIONS = "bigram_suggestion";
+    private static final String PREF_AUTO_COMPLETION_THRESHOLD = "auto_completion_threshold";
+    private static final String PREF_BIGRAM_SUGGESTIONS = "bigram_suggestion";
     private static final String PREF_VOICE_MODE = "voice_mode";
 
     // Whether or not the user has used voice input before (and thus, whether to show the
@@ -192,8 +192,7 @@
     private boolean mJustAddedAutoSpace;
     private boolean mAutoCorrectEnabled;
     private boolean mReCorrectionEnabled;
-    // Bigram Suggestion is disabled in this version.
-    private final boolean mBigramSuggestionEnabled = false;
+    private boolean mBigramSuggestionEnabled;
     private boolean mAutoCorrectOn;
     // TODO move this state variable outside LatinIME
     private boolean mCapsLock;
@@ -448,6 +447,7 @@
 
         int[] dictionaries = getDictionary(orig);
         mSuggest = new Suggest(this, dictionaries);
+        loadAndSetAutoCompletionThreshold(sp);
         updateAutoTextEnabled(saveLocale);
         if (mUserDictionary != null) mUserDictionary.close();
         mUserDictionary = new UserDictionary(this, mInputLocale);
@@ -680,6 +680,7 @@
         // If we just entered a text field, maybe it has some old text that requires correction
         checkReCorrectionOnStart();
         checkTutorial(attribute.privateImeOptions);
+        inputView.setForeground(true);
         if (TRACE) Debug.startMethodTracing("/data/trace/latinime");
     }
 
@@ -731,6 +732,9 @@
     @Override
     public void onFinishInputView(boolean finishingInput) {
         super.onFinishInputView(finishingInput);
+        LatinKeyboardBaseView inputView = mKeyboardSwitcher.getInputView();
+        if (inputView != null)
+            inputView.setForeground(false);
         // Remove penging messages related to update suggestions
         mHandler.removeMessages(MSG_UPDATE_SUGGESTIONS);
         mHandler.removeMessages(MSG_UPDATE_OLD_SUGGESTIONS);
@@ -1153,9 +1157,9 @@
         }
     }
 
-    private void showInputMethodPicker() {
+    private void showInputMethodSubtypePicker() {
         ((InputMethodManager) getSystemService(INPUT_METHOD_SERVICE))
-                .showInputMethodPicker();
+                .showInputMethodSubtypePicker();
     }
 
     private void onOptionKeyPressed() {
@@ -1171,7 +1175,7 @@
     private void onOptionKeyLongPressed() {
         if (!isShowingOptionDialog()) {
             if (LatinIMEUtil.hasMultipleEnabledIMEs(this)) {
-                showInputMethodPicker();
+                showInputMethodSubtypePicker();
             } else {
                 launchSettings();
             }
@@ -1186,29 +1190,29 @@
 
     public void onKey(int primaryCode, int[] keyCodes, int x, int y) {
         long when = SystemClock.uptimeMillis();
-        if (primaryCode != Keyboard.KEYCODE_DELETE ||
+        if (primaryCode != BaseKeyboard.KEYCODE_DELETE ||
                 when > mLastKeyTime + QUICK_PRESS) {
             mDeleteCount = 0;
         }
         mLastKeyTime = when;
         final boolean distinctMultiTouch = mKeyboardSwitcher.hasDistinctMultitouch();
         switch (primaryCode) {
-            case Keyboard.KEYCODE_DELETE:
+            case BaseKeyboard.KEYCODE_DELETE:
                 handleBackspace();
                 mDeleteCount++;
                 LatinImeLogger.logOnDelete();
                 break;
-            case Keyboard.KEYCODE_SHIFT:
+            case BaseKeyboard.KEYCODE_SHIFT:
                 // Shift key is handled in onPress() when device has distinct multi-touch panel.
                 if (!distinctMultiTouch)
                     handleShift();
                 break;
-            case Keyboard.KEYCODE_MODE_CHANGE:
+            case BaseKeyboard.KEYCODE_MODE_CHANGE:
                 // Symbol key is handled in onPress() when device has distinct multi-touch panel.
                 if (!distinctMultiTouch)
                     changeKeyboardMode();
                 break;
-            case Keyboard.KEYCODE_CANCEL:
+            case BaseKeyboard.KEYCODE_CANCEL:
                 if (!isShowingOptionDialog()) {
                     handleClose();
                 }
@@ -1864,13 +1868,13 @@
     }
 
     public void pickSuggestionManually(int index, CharSequence suggestion) {
-        if (mAfterVoiceInput && mShowingVoiceSuggestions) mVoiceInput.logNBestChoose(index);
         List<CharSequence> suggestions = mCandidateView.getSuggestions();
-
-        if (mAfterVoiceInput && !mShowingVoiceSuggestions) {
+        if (mAfterVoiceInput && mShowingVoiceSuggestions) {
             mVoiceInput.flushAllTextModificationCounters();
             // send this intent AFTER logging any prior aggregated edits.
-            mVoiceInput.logTextModifiedByChooseSuggestion(suggestion.length());
+            mVoiceInput.logTextModifiedByChooseSuggestion(suggestion.toString(), index,
+                                                          mWordSeparators,
+                                                          getCurrentInputConnection());
         }
 
         final boolean correcting = TextEntryState.isCorrecting();
@@ -2285,10 +2289,10 @@
         vibrate();
         playKeyClick(primaryCode);
         final boolean distinctMultiTouch = mKeyboardSwitcher.hasDistinctMultitouch();
-        if (distinctMultiTouch && primaryCode == Keyboard.KEYCODE_SHIFT) {
+        if (distinctMultiTouch && primaryCode == BaseKeyboard.KEYCODE_SHIFT) {
             mShiftKeyState.onPress();
             handleShift();
-        } else if (distinctMultiTouch && primaryCode == Keyboard.KEYCODE_MODE_CHANGE) {
+        } else if (distinctMultiTouch && primaryCode == BaseKeyboard.KEYCODE_MODE_CHANGE) {
             mSymbolKeyState.onPress();
             changeKeyboardMode();
         } else {
@@ -2302,11 +2306,11 @@
         ((LatinKeyboard) mKeyboardSwitcher.getInputView().getKeyboard()).keyReleased();
         //vibrate();
         final boolean distinctMultiTouch = mKeyboardSwitcher.hasDistinctMultitouch();
-        if (distinctMultiTouch && primaryCode == Keyboard.KEYCODE_SHIFT) {
+        if (distinctMultiTouch && primaryCode == BaseKeyboard.KEYCODE_SHIFT) {
             if (mShiftKeyState.isMomentary())
                 resetShift();
             mShiftKeyState.onRelease();
-        } else if (distinctMultiTouch && primaryCode == Keyboard.KEYCODE_MODE_CHANGE) {
+        } else if (distinctMultiTouch && primaryCode == BaseKeyboard.KEYCODE_MODE_CHANGE) {
             if (mSymbolKeyState.isMomentary())
                 changeKeyboardMode();
             mSymbolKeyState.onRelease();
@@ -2365,7 +2369,7 @@
             // FIXME: These should be triggered after auto-repeat logic
             int sound = AudioManager.FX_KEYPRESS_STANDARD;
             switch (primaryCode) {
-                case Keyboard.KEYCODE_DELETE:
+                case BaseKeyboard.KEYCODE_DELETE:
                     sound = AudioManager.FX_KEYPRESS_DELETE;
                     break;
                 case KEYCODE_ENTER:
@@ -2489,6 +2493,9 @@
         mLocaleSupportedForVoiceInput = voiceInputSupportedLocales.contains(mInputLocale);
 
         mShowSuggestions = sp.getBoolean(PREF_SHOW_SUGGESTIONS, true);
+        mAutoCorrectEnabled = mShowSuggestions && isAutoCorrectEnabled(sp);
+        mBigramSuggestionEnabled = mAutoCorrectEnabled && isBigramSuggestionEnabled(sp);
+        loadAndSetAutoCompletionThreshold(sp);
 
         if (VOICE_INSTALLED) {
             final String voiceMode = sp.getString(PREF_VOICE_MODE,
@@ -2503,15 +2510,61 @@
             mEnableVoice = enableVoice;
             mVoiceOnPrimary = voiceOnPrimary;
         }
-        mAutoCorrectEnabled = sp.getBoolean(PREF_AUTO_COMPLETE,
-                mResources.getBoolean(R.bool.enable_autocorrect)) & mShowSuggestions;
-        //mBigramSuggestionEnabled = sp.getBoolean(
-        //        PREF_BIGRAM_SUGGESTIONS, true) & mShowSuggestions;
         updateCorrectionMode();
         updateAutoTextEnabled(mResources.getConfiguration().locale);
         mLanguageSwitcher.loadLocales(sp);
     }
 
+    /**
+     *  load Auto completion threshold from SharedPreferences,
+     *  and modify mSuggest's threshold.
+     */
+    private void loadAndSetAutoCompletionThreshold(SharedPreferences sp) {
+        // When mSuggest is not initialized, cannnot modify mSuggest's threshold.
+        if (mSuggest == null) return;
+        // When auto completion setting is turned off, the threshold is ignored.
+        if (!isAutoCorrectEnabled(sp)) return;
+
+        final String currentAutoCompletionSetting = sp.getString(PREF_AUTO_COMPLETION_THRESHOLD,
+                mResources.getString(R.string.auto_completion_threshold_mode_value_modest));
+        final String[] autoCompletionThresholdValues = mResources.getStringArray(
+                R.array.auto_complete_threshold_values);
+        // When autoCompletionThreshold is greater than 1.0,
+        // auto completion is virtually turned off.
+        double autoCompletionThreshold = Double.MAX_VALUE;
+        try {
+            final int arrayIndex = Integer.valueOf(currentAutoCompletionSetting);
+            if (arrayIndex >= 0 && arrayIndex < autoCompletionThresholdValues.length) {
+                autoCompletionThreshold = Double.parseDouble(
+                        autoCompletionThresholdValues[arrayIndex]);
+            }
+        } catch (NumberFormatException e) {
+            // Whenever the threshold settings are correct,
+            // never come here.
+            autoCompletionThreshold = Double.MAX_VALUE;
+            Log.w(TAG, "Cannot load auto completion threshold setting."
+                    + " currentAutoCompletionSetting: " + currentAutoCompletionSetting
+                    + ", autoCompletionThresholdValues: "
+                    + Arrays.toString(autoCompletionThresholdValues));
+        }
+        // TODO: This should be refactored :
+        //           setAutoCompleteThreshold should be called outside of this method.
+        mSuggest.setAutoCompleteThreshold(autoCompletionThreshold);
+    }
+
+    private boolean isAutoCorrectEnabled(SharedPreferences sp) {
+        final String currentAutoCompletionSetting = sp.getString(PREF_AUTO_COMPLETION_THRESHOLD,
+                mResources.getString(R.string.auto_completion_threshold_mode_value_modest));
+        final String autoCompletionOff = mResources.getString(
+                R.string.auto_completion_threshold_mode_value_off);
+        return !currentAutoCompletionSetting.equals(autoCompletionOff);
+    }
+
+    private boolean isBigramSuggestionEnabled(SharedPreferences sp) {
+       // TODO: Define default value instead of 'true'.
+       return sp.getBoolean(PREF_BIGRAM_SUGGESTIONS, true);
+    }
+
     private void initSuggestPuncList() {
         mSuggestPuncList = new ArrayList<CharSequence>();
         mSuggestPuncs = mResources.getString(R.string.suggested_punctuations);
@@ -2544,8 +2597,7 @@
                         launchSettings();
                         break;
                     case POS_METHOD:
-                        ((InputMethodManager) getSystemService(INPUT_METHOD_SERVICE))
-                            .showInputMethodPicker();
+                        showInputMethodSubtypePicker();
                         break;
                 }
             }
diff --git a/java/src/com/android/inputmethod/latin/LatinIMESettings.java b/java/src/com/android/inputmethod/latin/LatinIMESettings.java
index ffff33d..4f20e9b 100644
--- a/java/src/com/android/inputmethod/latin/LatinIMESettings.java
+++ b/java/src/com/android/inputmethod/latin/LatinIMESettings.java
@@ -43,6 +43,9 @@
     private static final String QUICK_FIXES_KEY = "quick_fixes";
     private static final String PREDICTION_SETTINGS_KEY = "prediction_settings";
     private static final String VOICE_SETTINGS_KEY = "voice_mode";
+    private static final String PREF_SHOW_SUGGESTIONS = "show_suggestions";
+    private static final String PREF_AUTO_COMPLETION_THRESHOLD = "auto_completion_threshold";
+    private static final String PREF_BIGRAM_SUGGESTIONS = "bigram_suggestion";
     /* package */ static final String PREF_SETTINGS_KEY = "settings_key";
 
     private static final String TAG = "LatinIMESettings";
@@ -53,6 +56,9 @@
     private CheckBoxPreference mQuickFixes;
     private ListPreference mVoicePreference;
     private ListPreference mSettingsKeyPreference;
+    private CheckBoxPreference mShowSuggestions;
+    private ListPreference mAutoCompletionThreshold;
+    private CheckBoxPreference mBigramSuggestion;
     private boolean mVoiceOn;
 
     private VoiceInputLogger mLogger;
@@ -60,6 +66,18 @@
     private boolean mOkClicked = false;
     private String mVoiceModeOff;
 
+    private void ensureConsistencyOfAutoCompletionSettings() {
+        if (mShowSuggestions.isChecked()) {
+            mAutoCompletionThreshold.setEnabled(true);
+            final String autoCompletionOff = getResources().getString(
+                    R.string.auto_completion_threshold_mode_value_off);
+            final String currentSetting = mAutoCompletionThreshold.getValue();
+            mBigramSuggestion.setEnabled(!currentSetting.equals(autoCompletionOff));
+        } else {
+            mAutoCompletionThreshold.setEnabled(false);
+            mBigramSuggestion.setEnabled(false);
+        }
+    }
     @Override
     protected void onCreate(Bundle icicle) {
         super.onCreate(icicle);
@@ -73,6 +91,16 @@
         mVoiceModeOff = getString(R.string.voice_mode_off);
         mVoiceOn = !(prefs.getString(VOICE_SETTINGS_KEY, mVoiceModeOff).equals(mVoiceModeOff));
         mLogger = VoiceInputLogger.getLogger(this);
+
+        mShowSuggestions = (CheckBoxPreference) findPreference(PREF_SHOW_SUGGESTIONS);
+        mAutoCompletionThreshold = (ListPreference) findPreference(PREF_AUTO_COMPLETION_THRESHOLD);
+        mBigramSuggestion = (CheckBoxPreference) findPreference(PREF_BIGRAM_SUGGESTIONS);
+        ensureConsistencyOfAutoCompletionSettings();
+
+        final boolean showSettingsKeyOption = getResources().getBoolean(
+                R.bool.config_enable_show_settings_key_option);
+        if (!showSettingsKeyOption)
+            getPreferenceScreen().removePreference(mSettingsKeyPreference);
     }
 
     @Override
@@ -108,6 +136,7 @@
                 showVoiceConfirmation();
             }
         }
+        ensureConsistencyOfAutoCompletionSettings();
         mVoiceOn = !(prefs.getString(VOICE_SETTINGS_KEY, mVoiceModeOff).equals(mVoiceModeOff));
         updateVoiceModeSummary();
         updateSettingsKeySummary();
diff --git a/java/src/com/android/inputmethod/latin/LatinIMEUtil.java b/java/src/com/android/inputmethod/latin/LatinIMEUtil.java
index 85ecaee..d936390 100644
--- a/java/src/com/android/inputmethod/latin/LatinIMEUtil.java
+++ b/java/src/com/android/inputmethod/latin/LatinIMEUtil.java
@@ -168,4 +168,58 @@
             mLength = 0;
         }
     }
+
+    public static int editDistance(CharSequence s, CharSequence t) {
+        if (s == null || t == null) {
+            throw new IllegalArgumentException("editDistance: Arguments should not be null.");
+        }
+        final int sl = s.length();
+        final int tl = t.length();
+        int[][] dp = new int [sl + 1][tl + 1];
+        for (int i = 0; i <= sl; i++) {
+            dp[i][0] = i;
+        }
+        for (int j = 0; j <= tl; j++) {
+            dp[0][j] = j;
+        }
+        for (int i = 0; i < sl; ++i) {
+            for (int j = 0; j < tl; ++j) {
+                if (s.charAt(i) == t.charAt(j)) {
+                    dp[i + 1][j + 1] = dp[i][j];
+                } else {
+                    dp[i + 1][j + 1] = 1 + Math.min(dp[i][j],
+                            Math.min(dp[i + 1][j], dp[i][j + 1]));
+                }
+            }
+        }
+        return dp[sl][tl];
+    }
+
+    // In dictionary.cpp, getSuggestion() method,
+    // suggestion scores are computed using the below formula.
+    // original score (called 'frequency')
+    //  := pow(mTypedLetterMultiplier (this is defined 2),
+    //         (the number of matched characters between typed word and suggested word))
+    //     * (individual word's score which defined in the unigram dictionary,
+    //         and this score is defined in range [0, 255].)
+    //     * (when before.length() == after.length(),
+    //         mFullWordMultiplier (this is defined 2))
+    // So, maximum original score is pow(2, before.length()) * 255 * 2
+    // So, we can normalize original score by dividing this value.
+    private static final int MAX_INITIAL_SCORE = 255;
+    private static final int TYPED_LETTER_MULTIPLIER = 2;
+    private static final int FULL_WORD_MULTIPLYER = 2;
+    public static double calcNormalizedScore(CharSequence before, CharSequence after, int score) {
+        final int beforeLength = before.length();
+        final int afterLength = after.length();
+        final int distance = editDistance(before, after);
+        final double maximumScore = MAX_INITIAL_SCORE
+                * Math.pow(TYPED_LETTER_MULTIPLIER, beforeLength)
+                * FULL_WORD_MULTIPLYER;
+        // add a weight based on edit distance.
+        // distance <= max(afterLength, beforeLength) == afterLength,
+        // so, 0 <= distance / afterLength <= 1
+        final double weight = 1.0 - (double) distance / afterLength;
+        return (score / maximumScore) * weight;
+    }
 }
diff --git a/java/src/com/android/inputmethod/latin/LatinImeLogger.java b/java/src/com/android/inputmethod/latin/LatinImeLogger.java
index a8ab9cc..dd7bc8a 100644
--- a/java/src/com/android/inputmethod/latin/LatinImeLogger.java
+++ b/java/src/com/android/inputmethod/latin/LatinImeLogger.java
@@ -20,7 +20,6 @@
 
 import android.content.Context;
 import android.content.SharedPreferences;
-import android.inputmethodservice.Keyboard;
 import java.util.List;
 
 public class LatinImeLogger implements SharedPreferences.OnSharedPreferenceChangeListener {
@@ -65,7 +64,7 @@
     public static void onAddSuggestedWord(String word, int typeId, DataType dataType) {
     }
 
-    public static void onSetKeyboard(Keyboard kb) {
+    public static void onSetKeyboard(BaseKeyboard kb) {
     }
 
 }
diff --git a/java/src/com/android/inputmethod/latin/LatinKeyboard.java b/java/src/com/android/inputmethod/latin/LatinKeyboard.java
index 096f3e7..37ce1e8 100644
--- a/java/src/com/android/inputmethod/latin/LatinKeyboard.java
+++ b/java/src/com/android/inputmethod/latin/LatinKeyboard.java
@@ -30,16 +30,16 @@
 import android.graphics.Rect;
 import android.graphics.drawable.BitmapDrawable;
 import android.graphics.drawable.Drawable;
-import android.inputmethodservice.Keyboard;
 import android.text.TextPaint;
 import android.util.Log;
 import android.view.ViewConfiguration;
 import android.view.inputmethod.EditorInfo;
 
+import java.util.HashMap;
 import java.util.List;
 import java.util.Locale;
 
-public class LatinKeyboard extends Keyboard {
+public class LatinKeyboard extends BaseKeyboard {
 
     private static final boolean DEBUG_PREFERRED_LETTER = false;
     private static final String TAG = "LatinKeyboard";
@@ -48,7 +48,7 @@
 
     private Drawable mShiftLockIcon;
     private Drawable mShiftLockPreviewIcon;
-    private Drawable mOldShiftIcon;
+    private final HashMap<Key, Drawable> mOldShiftIcons = new HashMap<Key, Drawable>();
     private Drawable mSpaceIcon;
     private Drawable mSpaceAutoCompletionIndicator;
     private Drawable mSpacePreviewIcon;
@@ -58,15 +58,11 @@
     private Drawable m123MicPreviewIcon;
     private final Drawable mButtonArrowLeftIcon;
     private final Drawable mButtonArrowRightIcon;
-    private Key mShiftKey;
     private Key mEnterKey;
     private Key mF1Key;
     private final Drawable mHintIcon;
     private Key mSpaceKey;
     private Key m123Key;
-    private final int NUMBER_HINT_COUNT = 10;
-    private Key[] mNumberHintKeys;
-    private Drawable[] mNumberHintIcons = new Drawable[NUMBER_HINT_COUNT];
     private int mSpaceKeyIndex = -1;
     private int mSpaceDragStartX;
     private int mSpaceDragLastDiff;
@@ -74,7 +70,7 @@
     private LanguageSwitcher mLanguageSwitcher;
     private final Resources mRes;
     private final Context mContext;
-    private int mMode;
+    private int mMode;  // TODO: remove this and use the corresponding mode in the parent class
     // Whether this keyboard has voice icon on it
     private boolean mHasVoiceButton;
     // Whether voice icon is enabled at all
@@ -89,13 +85,15 @@
     private int mPrefLetterY;
     private int mPrefDistance;
 
+    // Default Enter key attributes
+    private final Drawable mDefaultEnterIcon;
+    private final Drawable mDefaultEnterPreview;
+    private final CharSequence mDefaultEnterLabel;
+    private final CharSequence mDefaultEnterText;
+
     // TODO: generalize for any keyboardId
     private boolean mIsBlackSym;
 
-    // TODO: remove this attribute when either Keyboard.mDefaultVerticalGap or Key.parent becomes
-    // non-private.
-    private final int mVerticalGap;
-
     private static final int SHIFT_OFF = 0;
     private static final int SHIFT_ON = 1;
     private static final int SHIFT_LOCKED = 2;
@@ -123,8 +121,8 @@
         super(context, xmlLayoutResId, mode);
         final Resources res = context.getResources();
         mContext = context;
-        mMode = mode;
         mRes = res;
+        mMode = mode;
         mShiftLockIcon = res.getDrawable(R.drawable.sym_keyboard_shift_locked);
         mShiftLockPreviewIcon = res.getDrawable(R.drawable.sym_keyboard_feedback_shift_locked);
         setDefaultBounds(mShiftLockPreviewIcon);
@@ -145,23 +143,16 @@
         mIsAlphaKeyboard = xmlLayoutResId == R.xml.kbd_qwerty
                 || xmlLayoutResId == R.xml.kbd_qwerty_black;
         mSpaceKeyIndex = indexOf(LatinIME.KEYCODE_SPACE);
-        initializeNumberHintResources(context);
-        // TODO remove this initialization after cleanup
-        mVerticalGap = super.getVerticalGap();
-    }
 
-    private void initializeNumberHintResources(Context context) {
-        final Resources res = context.getResources();
-        mNumberHintIcons[0] = res.getDrawable(R.drawable.keyboard_hint_0);
-        mNumberHintIcons[1] = res.getDrawable(R.drawable.keyboard_hint_1);
-        mNumberHintIcons[2] = res.getDrawable(R.drawable.keyboard_hint_2);
-        mNumberHintIcons[3] = res.getDrawable(R.drawable.keyboard_hint_3);
-        mNumberHintIcons[4] = res.getDrawable(R.drawable.keyboard_hint_4);
-        mNumberHintIcons[5] = res.getDrawable(R.drawable.keyboard_hint_5);
-        mNumberHintIcons[6] = res.getDrawable(R.drawable.keyboard_hint_6);
-        mNumberHintIcons[7] = res.getDrawable(R.drawable.keyboard_hint_7);
-        mNumberHintIcons[8] = res.getDrawable(R.drawable.keyboard_hint_8);
-        mNumberHintIcons[9] = res.getDrawable(R.drawable.keyboard_hint_9);
+        if (mEnterKey != null) {
+            mDefaultEnterIcon = mEnterKey.icon;
+            mDefaultEnterPreview = mEnterKey.iconPreview;
+            mDefaultEnterLabel = mEnterKey.label;
+            mDefaultEnterText = mEnterKey.text;
+        } else {
+            mDefaultEnterIcon = mDefaultEnterPreview = null;
+            mDefaultEnterLabel = mDefaultEnterText = null;
+        }
     }
 
     @Override
@@ -184,170 +175,138 @@
             break;
         }
 
-        // For number hints on the upper-right corner of key
-        if (mNumberHintKeys == null) {
-            // NOTE: This protected method is being called from the base class constructor before
-            // mNumberHintKeys gets initialized.
-            mNumberHintKeys = new Key[NUMBER_HINT_COUNT];
-        }
-        int hintNumber = -1;
-        if (LatinKeyboardBaseView.isNumberAtLeftmostPopupChar(key)) {
-            hintNumber = key.popupCharacters.charAt(0) - '0';
-        } else if (LatinKeyboardBaseView.isNumberAtRightmostPopupChar(key)) {
-            hintNumber = key.popupCharacters.charAt(key.popupCharacters.length() - 1) - '0';
-        }
-        if (hintNumber >= 0 && hintNumber <= 9) {
-            mNumberHintKeys[hintNumber] = key;
-        }
-
         return key;
     }
 
-    void setImeOptions(Resources res, int mode, int options) {
+    private static void resetKeyAttributes(Key key, CharSequence label) {
+        key.popupCharacters = null;
+        key.popupResId = 0;
+        key.text = null;
+        key.iconPreview = null;
+        key.icon = null;
+        key.hintIcon = null;
+        key.label = label;
+    }
+
+    public void setImeOptions(Resources res, int mode, int options) {
         mMode = mode;
-        // TODO should clean up this method
-        if (mEnterKey != null) {
-            // Reset some of the rarely used attributes.
-            mEnterKey.popupCharacters = null;
-            mEnterKey.popupResId = 0;
-            mEnterKey.text = null;
-            switch (options&(EditorInfo.IME_MASK_ACTION|EditorInfo.IME_FLAG_NO_ENTER_ACTION)) {
-                case EditorInfo.IME_ACTION_GO:
-                    mEnterKey.iconPreview = null;
-                    mEnterKey.icon = null;
-                    mEnterKey.label = res.getText(R.string.label_go_key);
-                    break;
-                case EditorInfo.IME_ACTION_NEXT:
-                    mEnterKey.iconPreview = null;
-                    mEnterKey.icon = null;
-                    mEnterKey.label = res.getText(R.string.label_next_key);
-                    break;
-                case EditorInfo.IME_ACTION_DONE:
-                    mEnterKey.iconPreview = null;
-                    mEnterKey.icon = null;
-                    mEnterKey.label = res.getText(R.string.label_done_key);
-                    break;
-                case EditorInfo.IME_ACTION_SEARCH:
-                    mEnterKey.iconPreview = res.getDrawable(
-                            R.drawable.sym_keyboard_feedback_search);
-                    mEnterKey.icon = res.getDrawable(mIsBlackSym ?
-                            R.drawable.sym_bkeyboard_search : R.drawable.sym_keyboard_search);
-                    mEnterKey.label = null;
-                    break;
-                case EditorInfo.IME_ACTION_SEND:
-                    mEnterKey.iconPreview = null;
-                    mEnterKey.icon = null;
-                    mEnterKey.label = res.getText(R.string.label_send_key);
-                    break;
-                default:
-                    if (mode == KeyboardSwitcher.MODE_IM) {
-                        mEnterKey.icon = mHintIcon;
-                        mEnterKey.iconPreview = null;
-                        mEnterKey.label = ":-)";
-                        mEnterKey.text = ":-) ";
-                        mEnterKey.popupResId = R.xml.popup_smileys;
-                    } else {
-                        mEnterKey.iconPreview = res.getDrawable(
-                                R.drawable.sym_keyboard_feedback_return);
-                        mEnterKey.icon = res.getDrawable(mIsBlackSym ?
-                                R.drawable.sym_bkeyboard_return : R.drawable.sym_keyboard_return);
-                        mEnterKey.label = null;
-                    }
-                    break;
-            }
-            // Set the initial size of the preview icon
-            if (mEnterKey.iconPreview != null) {
-                setDefaultBounds(mEnterKey.iconPreview);
+        if (mEnterKey == null)
+            return;
+        final boolean configDynamicKeyTopEnterKey = res.getBoolean(
+                R.bool.config_dynamic_key_top_enter_key);
+        if (configDynamicKeyTopEnterKey) {
+            switch (options & (EditorInfo.IME_MASK_ACTION | EditorInfo.IME_FLAG_NO_ENTER_ACTION)) {
+            case EditorInfo.IME_ACTION_GO:
+                resetKeyAttributes(mEnterKey, res.getText(R.string.label_go_key));
+                break;
+            case EditorInfo.IME_ACTION_NEXT:
+                resetKeyAttributes(mEnterKey, res.getText(R.string.label_next_key));
+                break;
+            case EditorInfo.IME_ACTION_DONE:
+                resetKeyAttributes(mEnterKey, res.getText(R.string.label_done_key));
+                break;
+            case EditorInfo.IME_ACTION_SEARCH:
+                resetKeyAttributes(mEnterKey, null);
+                mEnterKey.iconPreview = res.getDrawable(R.drawable.sym_keyboard_feedback_search);
+                mEnterKey.icon = res.getDrawable(mIsBlackSym ? R.drawable.sym_bkeyboard_search
+                        : R.drawable.sym_keyboard_search);
+                break;
+            case EditorInfo.IME_ACTION_SEND:
+                resetKeyAttributes(mEnterKey, res.getText(R.string.label_send_key));
+                break;
+            default:
+                resetKeyAttributes(mEnterKey, mDefaultEnterLabel);
+                mEnterKey.text = mDefaultEnterText;
+                mEnterKey.icon = mDefaultEnterIcon;
+                mEnterKey.iconPreview = mDefaultEnterPreview;
+                break;
             }
         }
+        // Set the initial size of the preview icon
+        setDefaultBounds(mEnterKey.iconPreview);
     }
-    
-    void enableShiftLock() {
-        int index = getShiftKeyIndex();
-        if (index >= 0) {
-            mShiftKey = getKeys().get(index);
-            if (mShiftKey instanceof LatinKey) {
-                ((LatinKey)mShiftKey).enableShiftLock();
+
+    public void enableShiftLock() {
+        for (final Key key : getShiftKeys()) {
+            if (key instanceof LatinKey) {
+                ((LatinKey)key).enableShiftLock();
             }
-            mOldShiftIcon = mShiftKey.icon;
+            mOldShiftIcons.put(key, key.icon);
         }
     }
 
-    void setShiftLocked(boolean shiftLocked) {
-        if (mShiftKey != null) {
-            if (shiftLocked) {
-                mShiftKey.on = true;
-                mShiftKey.icon = mShiftLockIcon;
-                mShiftState = SHIFT_LOCKED;
-            } else {
-                mShiftKey.on = false;
-                mShiftKey.icon = mShiftLockIcon;
-                mShiftState = SHIFT_ON;
-            }
+    public void setShiftLocked(boolean shiftLocked) {
+        for (final Key key : getShiftKeys()) {
+            key.on = shiftLocked;
+            key.icon = mShiftLockIcon;
         }
+        mShiftState = shiftLocked ? SHIFT_LOCKED : SHIFT_ON;
     }
 
-    boolean isShiftLocked() {
+    public boolean isShiftLocked() {
         return mShiftState == SHIFT_LOCKED;
     }
-    
+
     @Override
     public boolean setShifted(boolean shiftState) {
         boolean shiftChanged = false;
-        if (mShiftKey != null) {
+        if (getShiftKeys().size() > 0) {
+            for (final Key key : getShiftKeys()) {
+                if (shiftState == false) {
+                    key.on = false;
+                    key.icon = mOldShiftIcons.get(key);
+                } else if (mShiftState == SHIFT_OFF) {
+                    key.icon = mShiftLockIcon;
+                }
+            }
             if (shiftState == false) {
                 shiftChanged = mShiftState != SHIFT_OFF;
                 mShiftState = SHIFT_OFF;
-                mShiftKey.on = false;
-                mShiftKey.icon = mOldShiftIcon;
-            } else {
-                if (mShiftState == SHIFT_OFF) {
-                    shiftChanged = mShiftState == SHIFT_OFF;
-                    mShiftState = SHIFT_ON;
-                    mShiftKey.icon = mShiftLockIcon;
-                }
+            } else if (mShiftState == SHIFT_OFF) {
+                shiftChanged = mShiftState == SHIFT_OFF;
+                mShiftState = SHIFT_ON;
             }
+            return shiftChanged;
         } else {
             return super.setShifted(shiftState);
         }
-        return shiftChanged;
     }
 
     @Override
     public boolean isShifted() {
-        if (mShiftKey != null) {
+        if (getShiftKeys().size() > 0) {
             return mShiftState != SHIFT_OFF;
         } else {
             return super.isShifted();
         }
     }
 
-    /* package */ boolean isAlphaKeyboard() {
+    public boolean isTemporaryUpperCase() {
+        return mIsAlphaKeyboard && isShifted() && !isShiftLocked();
+    }
+
+    public boolean isAlphaKeyboard() {
         return mIsAlphaKeyboard;
     }
 
     public void setColorOfSymbolIcons(boolean isAutoCompletion, boolean isBlack) {
         mIsBlackSym = isBlack;
+        final Resources res = mRes;
         if (isBlack) {
-            mShiftLockIcon = mRes.getDrawable(R.drawable.sym_bkeyboard_shift_locked);
-            mSpaceIcon = mRes.getDrawable(R.drawable.sym_bkeyboard_space);
-            mMicIcon = mRes.getDrawable(R.drawable.sym_bkeyboard_mic);
-            m123MicIcon = mRes.getDrawable(R.drawable.sym_bkeyboard_123_mic);
+            mShiftLockIcon = res.getDrawable(R.drawable.sym_bkeyboard_shift_locked);
+            mSpaceIcon = res.getDrawable(R.drawable.sym_bkeyboard_space);
+            mMicIcon = res.getDrawable(R.drawable.sym_bkeyboard_mic);
+            m123MicIcon = res.getDrawable(R.drawable.sym_bkeyboard_123_mic);
         } else {
-            mShiftLockIcon = mRes.getDrawable(R.drawable.sym_keyboard_shift_locked);
-            mSpaceIcon = mRes.getDrawable(R.drawable.sym_keyboard_space);
-            mMicIcon = mRes.getDrawable(R.drawable.sym_keyboard_mic);
-            m123MicIcon = mRes.getDrawable(R.drawable.sym_keyboard_123_mic);
+            mShiftLockIcon = res.getDrawable(R.drawable.sym_keyboard_shift_locked);
+            mSpaceIcon = res.getDrawable(R.drawable.sym_keyboard_space);
+            mMicIcon = res.getDrawable(R.drawable.sym_keyboard_mic);
+            m123MicIcon = res.getDrawable(R.drawable.sym_keyboard_123_mic);
         }
         updateDynamicKeys();
         if (mSpaceKey != null) {
             updateSpaceBarForLocale(isAutoCompletion, isBlack);
         }
-        updateNumberHintKeys();
-    }
-
-    private void setDefaultBounds(Drawable drawable) {
-        drawable.setBounds(0, 0, drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight());
     }
 
     public void setVoiceMode(boolean hasVoiceButton, boolean hasVoice) {
@@ -362,9 +321,11 @@
     }
 
     private void update123Key() {
+        final boolean configDynamicKeyTopSymbolKey = mRes.getBoolean(
+                R.bool.config_dynamic_key_top_symbol_key);
         // Update KEYCODE_MODE_CHANGE key only on alphabet mode, not on symbol mode.
         if (m123Key != null && mIsAlphaKeyboard) {
-            if (mVoiceEnabled && !mHasVoiceButton) {
+            if (configDynamicKeyTopSymbolKey && mVoiceEnabled && !mHasVoiceButton) {
                 m123Key.icon = m123MicIcon;
                 m123Key.iconPreview = m123MicPreviewIcon;
                 m123Key.label = null;
@@ -403,14 +364,11 @@
     }
 
     private void setMicF1Key(Key key) {
-        // HACK: draw mMicIcon and mHintIcon at the same time
-        final Drawable micWithSettingsHintDrawable = new BitmapDrawable(mRes,
-                drawSynthesizedSettingsHintImage(key.width, key.height, mMicIcon, mHintIcon));
-
         key.label = null;
         key.codes = new int[] { LatinKeyboardView.KEYCODE_VOICE };
         key.popupResId = R.xml.popup_mic;
-        key.icon = micWithSettingsHintDrawable;
+        key.icon = mMicIcon;
+        key.hintIcon = mHintIcon;
         key.iconPreview = mMicPreviewIcon;
     }
 
@@ -418,18 +376,11 @@
         key.label = label;
         key.codes = new int[] { label.charAt(0) };
         key.popupResId = popupResId;
-        key.icon = mHintIcon;
+        key.icon = null;
+        key.hintIcon = mHintIcon;
         key.iconPreview = null;
     }
 
-    public boolean isF1Key(Key key) {
-        return key == mF1Key;
-    }
-
-    public static boolean hasPuncOrSmileysPopup(Key key) {
-        return key.popupResId == R.xml.popup_punctuation || key.popupResId == R.xml.popup_smileys;
-    }
-
     /**
      * @return a key which should be invalidated.
      */
@@ -438,31 +389,24 @@
         return mSpaceKey;
     }
 
-    private void updateNumberHintKeys() {
-        for (int i = 0; i < mNumberHintKeys.length; ++i) {
-            if (mNumberHintKeys[i] != null) {
-                mNumberHintKeys[i].icon = mNumberHintIcons[i];
-            }
-        }
-    }
-
     public boolean isLanguageSwitchEnabled() {
         return mLocale != null;
     }
 
     private void updateSpaceBarForLocale(boolean isAutoCompletion, boolean isBlack) {
+        final Resources res = mRes;
         // If application locales are explicitly selected.
         if (mLocale != null) {
-            mSpaceKey.icon = new BitmapDrawable(mRes,
+            mSpaceKey.icon = new BitmapDrawable(res,
                     drawSpaceBar(OPACITY_FULLY_OPAQUE, isAutoCompletion, isBlack));
         } else {
             // sym_keyboard_space_led can be shared with Black and White symbol themes.
             if (isAutoCompletion) {
-                mSpaceKey.icon = new BitmapDrawable(mRes,
+                mSpaceKey.icon = new BitmapDrawable(res,
                         drawSpaceBar(OPACITY_FULLY_OPAQUE, isAutoCompletion, isBlack));
             } else {
-                mSpaceKey.icon = isBlack ? mRes.getDrawable(R.drawable.sym_bkeyboard_space)
-                        : mRes.getDrawable(R.drawable.sym_keyboard_space);
+                mSpaceKey.icon = isBlack ? res.getDrawable(R.drawable.sym_bkeyboard_space)
+                        : res.getDrawable(R.drawable.sym_keyboard_space);
             }
         }
     }
@@ -474,34 +418,6 @@
         return bounds.width();
     }
 
-    // Overlay two images: mainIcon and hintIcon.
-    private Bitmap drawSynthesizedSettingsHintImage(
-            int width, int height, Drawable mainIcon, Drawable hintIcon) {
-        if (mainIcon == null || hintIcon == null)
-            return null;
-        Rect hintIconPadding = new Rect(0, 0, 0, 0);
-        hintIcon.getPadding(hintIconPadding);
-        final Bitmap buffer = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
-        final Canvas canvas = new Canvas(buffer);
-        canvas.drawColor(mRes.getColor(R.color.latinkeyboard_transparent), PorterDuff.Mode.CLEAR);
-
-        // Draw main icon at the center of the key visual
-        // Assuming the hintIcon shares the same padding with the key's background drawable
-        final int drawableX = (width + hintIconPadding.left - hintIconPadding.right
-                - mainIcon.getIntrinsicWidth()) / 2;
-        final int drawableY = (height + hintIconPadding.top - hintIconPadding.bottom
-                - mainIcon.getIntrinsicHeight()) / 2;
-        setDefaultBounds(mainIcon);
-        canvas.translate(drawableX, drawableY);
-        mainIcon.draw(canvas);
-        canvas.translate(-drawableX, -drawableY);
-
-        // Draw hint icon fully in the key
-        hintIcon.setBounds(0, 0, width, height);
-        hintIcon.draw(canvas);
-        return buffer;
-    }
-
     // Layout local language name and left and right arrow on space bar.
     private static String layoutSpaceBar(Paint paint, Locale locale, Drawable lArrow,
             Drawable rArrow, int width, int height, float origTextSize,
@@ -550,7 +466,8 @@
         final int height = mSpaceIcon.getIntrinsicHeight();
         final Bitmap buffer = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
         final Canvas canvas = new Canvas(buffer);
-        canvas.drawColor(mRes.getColor(R.color.latinkeyboard_transparent), PorterDuff.Mode.CLEAR);
+        final Resources res = mRes;
+        canvas.drawColor(res.getColor(R.color.latinkeyboard_transparent), PorterDuff.Mode.CLEAR);
 
         // If application locales are explicitly selected.
         if (mLocale != null) {
@@ -566,14 +483,14 @@
                     allowVariableTextSize);
 
             // Draw language text with shadow
-            final int shadowColor = mRes.getColor(isBlack
+            final int shadowColor = res.getColor(isBlack
                     ? R.color.latinkeyboard_bar_language_shadow_black
                     : R.color.latinkeyboard_bar_language_shadow_white);
             final float baseline = height * SPACEBAR_LANGUAGE_BASELINE;
             final float descent = paint.descent();
             paint.setColor(shadowColor);
             canvas.drawText(language, width / 2, baseline - descent - 1, paint);
-            paint.setColor(mRes.getColor(R.color.latinkeyboard_bar_language_text));
+            paint.setColor(res.getColor(R.color.latinkeyboard_bar_language_text));
             canvas.drawText(language, width / 2, baseline - descent, paint);
 
             // Put arrows that are already layed out on either side of the text
@@ -649,12 +566,12 @@
         return mCurrentlyInSpace;
     }
 
-    void setPreferredLetters(int[] frequencies) {
+    public void setPreferredLetters(int[] frequencies) {
         mPrefLetterFrequencies = frequencies;
         mPrefLetter = 0;
     }
 
-    void keyReleased() {
+    public void keyReleased() {
         mCurrentlyInSpace = false;
         mSpaceDragLastDiff = 0;
         mPrefLetter = 0;
@@ -670,10 +587,9 @@
      * Does the magic of locking the touch gesture into the spacebar when
      * switching input languages.
      */
-    boolean isInside(LatinKey key, int x, int y) {
+    public boolean isInside(LatinKey key, int x, int y) {
         final int code = key.codes[0];
-        if (code == KEYCODE_SHIFT ||
-                code == KEYCODE_DELETE) {
+        if (code == KEYCODE_SHIFT || code == KEYCODE_DELETE) {
             y -= key.height / 10;
             if (code == KEYCODE_SHIFT) x += key.width / 6;
             if (code == KEYCODE_DELETE) x -= key.width / 6;
@@ -817,8 +733,7 @@
         return textSize;
     }
 
-    // TODO LatinKey could be static class
-    class LatinKey extends Keyboard.Key {
+    public static class LatinKey extends BaseKeyboard.Key {
 
         // functional normal state (with properties)
         private final int[] KEY_STATE_FUNCTIONAL_NORMAL = {
@@ -833,7 +748,7 @@
 
         private boolean mShiftLockEnabled;
 
-        public LatinKey(Resources res, Keyboard.Row parent, int x, int y, 
+        public LatinKey(Resources res, BaseKeyboard.Row parent, int x, int y,
                 XmlResourceParser parser) {
             super(res, parent, x, y, parser);
             if (popupCharacters != null && popupCharacters.length() == 0) {
@@ -866,13 +781,12 @@
          */
         @Override
         public boolean isInside(int x, int y) {
-            // TODO This should be done by parent.isInside(this, x, y)
-            // if Key.parent were protected.
-            boolean result = LatinKeyboard.this.isInside(this, x, y);
+            boolean result = (keyboard instanceof LatinKeyboard)
+                    && ((LatinKeyboard)keyboard).isInside(this, x, y);
             return result;
         }
 
-        boolean isInsideSuper(int x, int y) {
+        private boolean isInsideSuper(int x, int y) {
             return super.isInside(x, y);
         }
 
@@ -887,15 +801,6 @@
             }
             return super.getCurrentDrawableState();
         }
-
-        @Override
-        public int squaredDistanceFrom(int x, int y) {
-            // We should count vertical gap between rows to calculate the center of this Key.
-            final int verticalGap = LatinKeyboard.this.mVerticalGap;
-            final int xDist = this.x + width / 2 - x;
-            final int yDist = this.y + (height + verticalGap) / 2 - y;
-            return xDist * xDist + yDist * yDist;
-        }
     }
 
     /**
@@ -903,7 +808,7 @@
      * languages by swiping the spacebar. It draws the current, previous and
      * next languages and moves them by the delta of touch movement on the spacebar.
      */
-    class SlidingLocaleDrawable extends Drawable {
+    private class SlidingLocaleDrawable extends Drawable {
 
         private final int mWidth;
         private final int mHeight;
@@ -924,17 +829,19 @@
             setDefaultBounds(mBackground);
             mWidth = width;
             mHeight = height;
-            mTextPaint = new TextPaint();
-            mTextPaint.setTextSize(getTextSizeFromTheme(android.R.style.TextAppearance_Medium, 18));
-            mTextPaint.setColor(R.color.latinkeyboard_transparent);
-            mTextPaint.setTextAlign(Align.CENTER);
-            mTextPaint.setAlpha(OPACITY_FULLY_OPAQUE);
-            mTextPaint.setAntiAlias(true);
+            final TextPaint textPaint = new TextPaint();
+            textPaint.setTextSize(getTextSizeFromTheme(android.R.style.TextAppearance_Medium, 18));
+            textPaint.setColor(R.color.latinkeyboard_transparent);
+            textPaint.setTextAlign(Align.CENTER);
+            textPaint.setAlpha(OPACITY_FULLY_OPAQUE);
+            textPaint.setAntiAlias(true);
+            mTextPaint = textPaint;
             mMiddleX = (mWidth - mBackground.getIntrinsicWidth()) / 2;
-            mLeftDrawable =
-                    mRes.getDrawable(R.drawable.sym_keyboard_feedback_language_arrows_left);
-            mRightDrawable =
-                    mRes.getDrawable(R.drawable.sym_keyboard_feedback_language_arrows_right);
+            final Resources res = mRes;
+            mLeftDrawable = res.getDrawable(
+                    R.drawable.sym_keyboard_feedback_language_arrows_left);
+            mRightDrawable = res.getDrawable(
+                    R.drawable.sym_keyboard_feedback_language_arrows_right);
             mThreshold = ViewConfiguration.get(mContext).getScaledTouchSlop();
         }
 
diff --git a/java/src/com/android/inputmethod/latin/LatinKeyboardBaseView.java b/java/src/com/android/inputmethod/latin/LatinKeyboardBaseView.java
index 5a015e9..4e264e8 100644
--- a/java/src/com/android/inputmethod/latin/LatinKeyboardBaseView.java
+++ b/java/src/com/android/inputmethod/latin/LatinKeyboardBaseView.java
@@ -16,6 +16,8 @@
 
 package com.android.inputmethod.latin;
 
+import com.android.inputmethod.latin.BaseKeyboard.Key;
+
 import android.content.Context;
 import android.content.pm.PackageManager;
 import android.content.res.Resources;
@@ -29,8 +31,6 @@
 import android.graphics.Region.Op;
 import android.graphics.Typeface;
 import android.graphics.drawable.Drawable;
-import android.inputmethodservice.Keyboard;
-import android.inputmethodservice.Keyboard.Key;
 import android.os.Handler;
 import android.os.Message;
 import android.os.SystemClock;
@@ -43,6 +43,7 @@
 import android.view.MotionEvent;
 import android.view.View;
 import android.view.ViewGroup.LayoutParams;
+import android.view.WindowManager;
 import android.widget.PopupWindow;
 import android.widget.TextView;
 
@@ -161,7 +162,7 @@
     // Miscellaneous constants
     /* package */ static final int NOT_A_KEY = -1;
     private static final int[] LONG_PRESSABLE_STATE_SET = { android.R.attr.state_long_pressable };
-    private static final int NUMBER_HINT_VERTICAL_ADJUSTMENT_PIXEL = -1;
+    private static final int HINT_ICON_VERTICAL_ADJUSTMENT_PIXEL = -1;
 
     // XML attribute
     private int mKeyTextSize;
@@ -180,12 +181,13 @@
     private int mPopupLayout;
 
     // Main keyboard
-    private Keyboard mKeyboard;
+    private BaseKeyboard mKeyboard;
     private Key[] mKeys;
     // TODO this attribute should be gotten from Keyboard.
     private int mKeyboardVerticalGap;
 
     // Key preview popup
+    private boolean mInForeground;
     private TextView mPreviewText;
     private PopupWindow mPreviewPopup;
     private int mPreviewTextSizeLarge;
@@ -226,7 +228,7 @@
     protected KeyDetector mKeyDetector = new ProximityKeyDetector();
 
     // Swipe gesture detector
-    private final GestureDetector mGestureDetector;
+    private GestureDetector mGestureDetector;
     private final SwipeTracker mSwipeTracker = new SwipeTracker();
     private final int mSwipeThreshold;
     private final boolean mDisambiguateSwipe;
@@ -575,11 +577,11 @@
     /**
      * Attaches a keyboard to this view. The keyboard can be switched at any time and the
      * view will re-layout itself to accommodate the keyboard.
-     * @see Keyboard
+     * @see BaseKeyboard
      * @see #getKeyboard()
      * @param keyboard the keyboard to display in this view
      */
-    public void setKeyboard(Keyboard keyboard) {
+    public void setKeyboard(BaseKeyboard keyboard) {
         if (mKeyboard != null) {
             dismissKeyPreview();
         }
@@ -592,7 +594,7 @@
                 -getPaddingTop() + mVerticalCorrection);
         mKeyboardVerticalGap = (int)getResources().getDimension(R.dimen.key_bottom_gap);
         for (PointerTracker tracker : mPointerTrackers) {
-            tracker.setKeyboard(mKeys, mKeyHysteresisDistance);
+            tracker.setKeyboard(keyboard, mKeys, mKeyHysteresisDistance);
         }
         requestLayout();
         // Hint to reallocate the buffer if the size changed
@@ -605,9 +607,9 @@
     /**
      * Returns the current keyboard being displayed by this view.
      * @return the currently attached keyboard
-     * @see #setKeyboard(Keyboard)
+     * @see #setKeyboard(BaseKeyboard)
      */
-    public Keyboard getKeyboard() {
+    public BaseKeyboard getKeyboard() {
         return mKeyboard;
     }
 
@@ -727,7 +729,7 @@
      * the touch distance from a key's center to avoid taking a square root.
      * @param keyboard
      */
-    private void computeProximityThreshold(Keyboard keyboard) {
+    private void computeProximityThreshold(BaseKeyboard keyboard) {
         if (keyboard == null) return;
         final Key[] keys = mKeys;
         if (keys == null) return;
@@ -816,8 +818,19 @@
             canvas.translate(key.x + kbdPaddingLeft, key.y + kbdPaddingTop);
             keyBackground.draw(canvas);
 
-            boolean shouldDrawIcon = true;
+            boolean drawHintIcon = true;
             if (label != null) {
+                // If keyboard is multi-touch capable and in temporary upper case state and key has
+                // tempoarary shift label, label should be hint character and hint icon should not
+                // be drawn.
+                if (mHasDistinctMultitouch
+                        && mKeyboard instanceof LatinKeyboard
+                        && ((LatinKeyboard)mKeyboard).isTemporaryUpperCase()
+                        && key.temporaryShiftLabel != null) {
+                    label = key.temporaryShiftLabel.toString();
+                    drawHintIcon = false;
+                }
+
                 // For characters, use large font. For labels like "Done", use small font.
                 final int labelSize;
                 if (label.length() > 1 && key.codes.length < 2) {
@@ -849,32 +862,21 @@
                 canvas.drawText(label, centerX, baseline, paint);
                 // Turn off drop shadow
                 paint.setShadowLayer(0, 0, 0, 0);
-
-                // Usually don't draw icon if label is not null, but we draw icon for the number
-                // hint and popup hint.
-                shouldDrawIcon = shouldDrawLabelAndIcon(key);
             }
-            if (key.icon != null && shouldDrawIcon) {
-                // Special handing for the upper-right number hint icons
-                final int drawableWidth;
-                final int drawableHeight;
-                final int drawableX;
-                final int drawableY;
-                if (shouldDrawIconFully(key)) {
-                    drawableWidth = key.width;
-                    drawableHeight = key.height;
-                    drawableX = 0;
-                    drawableY = NUMBER_HINT_VERTICAL_ADJUSTMENT_PIXEL;
-                } else {
-                    drawableWidth = key.icon.getIntrinsicWidth();
-                    drawableHeight = key.icon.getIntrinsicHeight();
-                    drawableX = (key.width + padding.left - padding.right - drawableWidth) / 2;
-                    drawableY = (key.height + padding.top - padding.bottom - drawableHeight) / 2;
-                }
-                canvas.translate(drawableX, drawableY);
-                key.icon.setBounds(0, 0, drawableWidth, drawableHeight);
-                key.icon.draw(canvas);
-                canvas.translate(-drawableX, -drawableY);
+            if (key.label == null && key.icon != null) {
+                int drawableWidth = key.icon.getIntrinsicWidth();
+                int drawableHeight = key.icon.getIntrinsicHeight();
+                int drawableX = (key.width + padding.left - padding.right - drawableWidth) / 2;
+                int drawableY = (key.height + padding.top - padding.bottom - drawableHeight) / 2;
+                drawIcon(canvas, key.icon, drawableX, drawableY, drawableWidth, drawableHeight);
+
+            }
+            if (key.hintIcon != null && drawHintIcon) {
+                int drawableWidth = key.width;
+                int drawableHeight = key.height;
+                int drawableX = 0;
+                int drawableY = HINT_ICON_VERTICAL_ADJUSTMENT_PIXEL;
+                drawIcon(canvas, key.hintIcon, drawableX, drawableY, drawableWidth, drawableHeight);
             }
             canvas.translate(-key.x - kbdPaddingLeft, -key.y - kbdPaddingTop);
         }
@@ -908,6 +910,17 @@
         mDirtyRect.setEmpty();
     }
 
+    private void drawIcon(Canvas canvas, Drawable icon, int x, int y, int width, int height) {
+        canvas.translate(x, y);
+        icon.setBounds(0, 0, width, height);
+        icon.draw(canvas);
+        canvas.translate(-x, -y);
+    }
+
+    public void setForeground(boolean foreground) {
+        mInForeground = foreground;
+    }
+
     // TODO: clean up this method.
     private void dismissKeyPreview() {
         for (PointerTracker tracker : mPointerTrackers)
@@ -938,16 +951,20 @@
         }
     }
 
+    // TODO Must fix popup preview on xlarge layout
     private void showKey(final int keyIndex, PointerTracker tracker) {
         Key key = tracker.getKey(keyIndex);
-        if (key == null)
+        // If keyIndex is invalid or IME is already closed, we must not show key preview.
+        // Trying to show preview PopupWindow while root window is closed causes
+        // WindowManager.BadTokenException.
+        if (key == null || !mInForeground)
             return;
-        // Should not draw hint icon in key preview
-        if (key.icon != null && !shouldDrawLabelAndIcon(key)) {
+        if (key.icon != null) {
             mPreviewText.setCompoundDrawables(null, null, null,
                     key.iconPreview != null ? key.iconPreview : key.icon);
             mPreviewText.setText(null);
         } else {
+            // TODO Should take care of temporaryShiftLabel here.
             mPreviewText.setCompoundDrawables(null, null, null, null);
             mPreviewText.setText(adjustCase(tracker.getPreviewText(key)));
             if (key.label.length() > 1 && key.codes.length < 2) {
@@ -1000,13 +1017,18 @@
             popupPreviewY += popupHeight;
         }
 
-        if (mPreviewPopup.isShowing()) {
-            mPreviewPopup.update(popupPreviewX, popupPreviewY, popupWidth, popupHeight);
-        } else {
-            mPreviewPopup.setWidth(popupWidth);
-            mPreviewPopup.setHeight(popupHeight);
-            mPreviewPopup.showAtLocation(mMiniKeyboardParent, Gravity.NO_GRAVITY,
-                    popupPreviewX, popupPreviewY);
+        try {
+            if (mPreviewPopup.isShowing()) {
+                mPreviewPopup.update(popupPreviewX, popupPreviewY, popupWidth, popupHeight);
+            } else {
+                mPreviewPopup.setWidth(popupWidth);
+                mPreviewPopup.setHeight(popupHeight);
+                mPreviewPopup.showAtLocation(mMiniKeyboardParent, Gravity.NO_GRAVITY,
+                        popupPreviewX, popupPreviewY);
+            }
+        } catch (WindowManager.BadTokenException e) {
+            // Swallow the exception which will be happened when IME is already closed.
+            Log.w(TAG, "LatinIME is already closed when tried showing key preview.");
         }
         // Record popup preview position to display mini-keyboard later at the same positon
         mPopupPreviewDisplayedY = popupPreviewY;
@@ -1029,7 +1051,7 @@
      * Invalidates a key so that it will be redrawn on the next repaint. Use this method if only
      * one key is changing it's content. Any changes that affect the position or size of the key
      * may not be honored.
-     * @param key key in the attached {@link Keyboard}.
+     * @param key key in the attached {@link BaseKeyboard}.
      * @see #invalidateAllKeys
      */
     public void invalidateKey(Key key) {
@@ -1106,13 +1128,15 @@
         });
         // Override default ProximityKeyDetector.
         miniKeyboard.mKeyDetector = new MiniKeyboardKeyDetector(mMiniKeyboardSlideAllowance);
+        // Remove gesture detector on mini-keyboard
+        miniKeyboard.mGestureDetector = null;
 
-        Keyboard keyboard;
+        BaseKeyboard keyboard;
         if (popupKey.popupCharacters != null) {
-            keyboard = new Keyboard(getContext(), popupKeyboardId, popupKey.popupCharacters,
+            keyboard = new BaseKeyboard(getContext(), popupKeyboardId, popupKey.popupCharacters,
                     -1, getPaddingLeft() + getPaddingRight());
         } else {
-            keyboard = new Keyboard(getContext(), popupKeyboardId);
+            keyboard = new BaseKeyboard(getContext(), popupKeyboardId);
         }
         miniKeyboard.setKeyboard(keyboard);
         miniKeyboard.setPopupParent(this);
@@ -1132,7 +1156,8 @@
         // and bottom edge flags on.
         // When you want to use one row mini-keyboard from xml file, make sure that the row has
         // both top and bottom edge flags set.
-        return (edgeFlags & Keyboard.EDGE_TOP) != 0 && (edgeFlags & Keyboard.EDGE_BOTTOM) != 0;
+        return (edgeFlags & BaseKeyboard.EDGE_TOP) != 0
+                && (edgeFlags & BaseKeyboard.EDGE_BOTTOM) != 0;
     }
 
     /**
@@ -1226,29 +1251,7 @@
         return false;
     }
 
-    private boolean shouldDrawIconFully(Key key) {
-        return isNumberAtEdgeOfPopupChars(key) || isLatinF1Key(key)
-                || LatinKeyboard.hasPuncOrSmileysPopup(key);
-    }
-
-    private boolean shouldDrawLabelAndIcon(Key key) {
-        return isNumberAtEdgeOfPopupChars(key) || isNonMicLatinF1Key(key)
-                || LatinKeyboard.hasPuncOrSmileysPopup(key);
-    }
-
-    private boolean isLatinF1Key(Key key) {
-        return (mKeyboard instanceof LatinKeyboard) && ((LatinKeyboard)mKeyboard).isF1Key(key);
-    }
-
-    private boolean isNonMicLatinF1Key(Key key) {
-        return isLatinF1Key(key) && key.label != null;
-    }
-
-    private static boolean isNumberAtEdgeOfPopupChars(Key key) {
-        return isNumberAtLeftmostPopupChar(key) || isNumberAtRightmostPopupChar(key);
-    }
-
-    /* package */ static boolean isNumberAtLeftmostPopupChar(Key key) {
+    private static boolean isNumberAtLeftmostPopupChar(Key key) {
         if (key.popupCharacters != null && key.popupCharacters.length() > 0
                 && isAsciiDigit(key.popupCharacters.charAt(0))) {
             return true;
@@ -1256,14 +1259,6 @@
         return false;
     }
 
-    /* package */ static boolean isNumberAtRightmostPopupChar(Key key) {
-        if (key.popupCharacters != null && key.popupCharacters.length() > 0
-                && isAsciiDigit(key.popupCharacters.charAt(key.popupCharacters.length() - 1))) {
-            return true;
-        }
-        return false;
-    }
-
     private static boolean isAsciiDigit(char c) {
         return (c < 0x80) && Character.isDigit(c);
     }
@@ -1283,7 +1278,7 @@
             final PointerTracker tracker =
                 new PointerTracker(i, mHandler, mKeyDetector, this, getResources());
             if (keys != null)
-                tracker.setKeyboard(keys, mKeyHysteresisDistance);
+                tracker.setKeyboard(mKeyboard, keys, mKeyHysteresisDistance);
             if (listener != null)
                 tracker.setOnKeyboardActionListener(listener);
             pointers.add(tracker);
@@ -1307,8 +1302,9 @@
         // Track the last few movements to look for spurious swipes.
         mSwipeTracker.addMovement(me);
 
-        // We must disable gesture detector while mini-keyboard is on the screen.
-        if (mMiniKeyboard == null && mGestureDetector.onTouchEvent(me)) {
+        // Gesture detector must be enabled only when mini-keyboard is not on the screen.
+        if (mMiniKeyboard == null
+                && mGestureDetector != null && mGestureDetector.onTouchEvent(me)) {
             dismissKeyPreview();
             mHandler.cancelKeyTimers();
             return true;
diff --git a/java/src/com/android/inputmethod/latin/LatinKeyboardView.java b/java/src/com/android/inputmethod/latin/LatinKeyboardView.java
index 22d39f7..f3d045b 100644
--- a/java/src/com/android/inputmethod/latin/LatinKeyboardView.java
+++ b/java/src/com/android/inputmethod/latin/LatinKeyboardView.java
@@ -16,11 +16,11 @@
 
 package com.android.inputmethod.latin;
 
+import com.android.inputmethod.latin.BaseKeyboard.Key;
+
 import android.content.Context;
 import android.graphics.Canvas;
 import android.graphics.Paint;
-import android.inputmethodservice.Keyboard;
-import android.inputmethodservice.Keyboard.Key;
 import android.os.Handler;
 import android.os.Message;
 import android.os.SystemClock;
@@ -39,7 +39,7 @@
     static final int KEYCODE_NEXT_LANGUAGE = -104;
     static final int KEYCODE_PREV_LANGUAGE = -105;
 
-    private Keyboard mPhoneKeyboard;
+    private BaseKeyboard mPhoneKeyboard;
 
     /** Whether we've started dropping move events because we found a big jump */
     private boolean mDroppingEvents;
@@ -61,7 +61,7 @@
         super(context, attrs, defStyle);
     }
 
-    public void setPhoneKeyboard(Keyboard phoneKeyboard) {
+    public void setPhoneKeyboard(BaseKeyboard phoneKeyboard) {
         mPhoneKeyboard = phoneKeyboard;
     }
 
@@ -76,7 +76,7 @@
     }
 
     @Override
-    public void setKeyboard(Keyboard k) {
+    public void setKeyboard(BaseKeyboard k) {
         super.setKeyboard(k);
         // One-seventh of the keyboard width seems like a reasonable threshold
         mJumpThresholdSquare = k.getMinWidth() / 7;
@@ -108,10 +108,10 @@
 
     @Override
     protected CharSequence adjustCase(CharSequence label) {
-        Keyboard keyboard = getKeyboard();
-        if (keyboard.isShifted()
-                && keyboard instanceof LatinKeyboard
+        BaseKeyboard keyboard = getKeyboard();
+        if (keyboard instanceof LatinKeyboard
                 && ((LatinKeyboard) keyboard).isAlphaKeyboard()
+                && keyboard.isShifted()
                 && !TextUtils.isEmpty(label) && label.length() < 3
                 && Character.isLowerCase(label.charAt(0))) {
             label = label.toString().toUpperCase();
@@ -120,7 +120,7 @@
     }
 
     public boolean setShiftLocked(boolean shiftLocked) {
-        Keyboard keyboard = getKeyboard();
+        BaseKeyboard keyboard = getKeyboard();
         if (keyboard instanceof LatinKeyboard) {
             ((LatinKeyboard)keyboard).setShiftLocked(shiftLocked);
             invalidateAllKeys();
@@ -257,7 +257,7 @@
     private int mLastY;
     private Paint mPaint;
 
-    private void setKeyboardLocal(Keyboard k) {
+    private void setKeyboardLocal(BaseKeyboard k) {
         if (DEBUG_AUTO_PLAY) {
             findKeys();
             if (mHandler2 == null) {
diff --git a/java/src/com/android/inputmethod/latin/MiniKeyboardKeyDetector.java b/java/src/com/android/inputmethod/latin/MiniKeyboardKeyDetector.java
index 356e62d..5f4c937 100644
--- a/java/src/com/android/inputmethod/latin/MiniKeyboardKeyDetector.java
+++ b/java/src/com/android/inputmethod/latin/MiniKeyboardKeyDetector.java
@@ -16,7 +16,7 @@
 
 package com.android.inputmethod.latin;
 
-import android.inputmethodservice.Keyboard.Key;
+import com.android.inputmethod.latin.BaseKeyboard.Key;
 
 class MiniKeyboardKeyDetector extends KeyDetector {
     private static final int MAX_NEARBY_KEYS = 1;
diff --git a/java/src/com/android/inputmethod/latin/PointerTracker.java b/java/src/com/android/inputmethod/latin/PointerTracker.java
index 448e279..d1cdbfe 100644
--- a/java/src/com/android/inputmethod/latin/PointerTracker.java
+++ b/java/src/com/android/inputmethod/latin/PointerTracker.java
@@ -16,12 +16,11 @@
 
 package com.android.inputmethod.latin;
 
+import com.android.inputmethod.latin.BaseKeyboard.Key;
 import com.android.inputmethod.latin.LatinKeyboardBaseView.OnKeyboardActionListener;
 import com.android.inputmethod.latin.LatinKeyboardBaseView.UIHandler;
 
 import android.content.res.Resources;
-import android.inputmethodservice.Keyboard;
-import android.inputmethodservice.Keyboard.Key;
 import android.util.Log;
 import android.view.MotionEvent;
 
@@ -45,7 +44,7 @@
 
     // Miscellaneous constants
     private static final int NOT_A_KEY = LatinKeyboardBaseView.NOT_A_KEY;
-    private static final int[] KEY_DELETE = { Keyboard.KEYCODE_DELETE };
+    private static final int[] KEY_DELETE = { BaseKeyboard.KEYCODE_DELETE };
 
     private final UIProxy mProxy;
     private final UIHandler mHandler;
@@ -53,6 +52,7 @@
     private OnKeyboardActionListener mListener;
     private final boolean mHasDistinctMultitouch;
 
+    private BaseKeyboard mKeyboard;
     private Key[] mKeys;
     private int mKeyHysteresisDistanceSquared = -1;
 
@@ -183,9 +183,10 @@
         mListener = listener;
     }
 
-    public void setKeyboard(Key[] keys, float keyHysteresisDistance) {
-        if (keys == null || keyHysteresisDistance < 0)
+    public void setKeyboard(BaseKeyboard keyboard, Key[] keys, float keyHysteresisDistance) {
+        if (keyboard == null || keys == null || keyHysteresisDistance < 0)
             throw new IllegalArgumentException();
+        mKeyboard = keyboard;
         mKeys = keys;
         mKeyHysteresisDistanceSquared = (int)(keyHysteresisDistance * keyHysteresisDistance);
         // Update current key index because keyboard layout has been changed.
@@ -205,8 +206,8 @@
         if (key == null)
             return false;
         int primaryCode = key.codes[0];
-        return primaryCode == Keyboard.KEYCODE_SHIFT
-                || primaryCode == Keyboard.KEYCODE_MODE_CHANGE;
+        return primaryCode == BaseKeyboard.KEYCODE_SHIFT
+                || primaryCode == BaseKeyboard.KEYCODE_MODE_CHANGE;
     }
 
     public boolean isModifier() {
@@ -284,7 +285,7 @@
                 mHandler.startKeyRepeatTimer(mDelayBeforeKeyRepeatStart, keyIndex, this);
                 mIsRepeatableKey = true;
             }
-            mHandler.startLongPressTimer(mLongPressKeyTimeout, keyIndex, this);
+            startLongPressTimer(keyIndex);
         }
         showKeyPreviewAndUpdateKey(keyIndex);
     }
@@ -296,14 +297,15 @@
             return;
         KeyState keyState = mKeyState;
         int keyIndex = keyState.onMoveKey(x, y);
-        if (isValidKeyIndex(keyIndex)) {
+        Key key = getKey(keyIndex);
+        if (key != null) {
             if (keyState.getKeyIndex() == NOT_A_KEY) {
                 keyState.onMoveToNewKey(keyIndex, x, y);
-                mHandler.startLongPressTimer(mLongPressKeyTimeout, keyIndex, this);
+                startLongPressTimer(keyIndex);
             } else if (!isMinorMoveBounce(x, y, keyIndex)) {
                 resetMultiTap();
                 keyState.onMoveToNewKey(keyIndex, x, y);
-                mHandler.startLongPressTimer(mLongPressKeyTimeout, keyIndex, this);
+                startLongPressTimer(keyIndex);
             }
         } else {
             if (keyState.getKeyIndex() != NOT_A_KEY) {
@@ -419,6 +421,20 @@
         }
     }
 
+    private void startLongPressTimer(int keyIndex) {
+        Key key = getKey(keyIndex);
+        // If keyboard is in temporary upper case state and the key has temporary shift label,
+        // long press should not be started.
+        if (isTemporaryUpperCase() && key.temporaryShiftLabel != null)
+            return;
+        mHandler.startLongPressTimer(mLongPressKeyTimeout, keyIndex, this);
+    }
+
+    private boolean isTemporaryUpperCase() {
+        return mKeyboard instanceof LatinKeyboard
+                && ((LatinKeyboard)mKeyboard).isTemporaryUpperCase();
+    }
+
     private void detectAndSendKey(int index, int x, int y, long eventTime) {
         final OnKeyboardActionListener listener = mListener;
         final Key key = getKey(index);
@@ -440,12 +456,20 @@
                 // Multi-tap
                 if (mInMultiTap) {
                     if (mTapCount != -1) {
-                        mListener.onKey(Keyboard.KEYCODE_DELETE, KEY_DELETE, x, y);
+                        mListener.onKey(BaseKeyboard.KEYCODE_DELETE, KEY_DELETE, x, y);
                     } else {
                         mTapCount = 0;
                     }
                     code = key.codes[mTapCount];
                 }
+
+                // If keyboard is in temporary upper case state and key has temporary shift label,
+                // alternate character code should be sent.
+                if (isTemporaryUpperCase() && key.temporaryShiftLabel != null) {
+                    code = key.temporaryShiftLabel.charAt(0);
+                    codes[0] = code;
+                }
+
                 /*
                  * Swap the first and second values in the codes array if the primary code is not
                  * the first value but the second value in the array. This happens when key
diff --git a/java/src/com/android/inputmethod/latin/ProximityKeyDetector.java b/java/src/com/android/inputmethod/latin/ProximityKeyDetector.java
index d17bedb..a6ff8cf 100644
--- a/java/src/com/android/inputmethod/latin/ProximityKeyDetector.java
+++ b/java/src/com/android/inputmethod/latin/ProximityKeyDetector.java
@@ -16,7 +16,7 @@
 
 package com.android.inputmethod.latin;
 
-import android.inputmethodservice.Keyboard.Key;
+import com.android.inputmethod.latin.BaseKeyboard.Key;
 
 import java.util.Arrays;
 
diff --git a/java/src/com/android/inputmethod/latin/Suggest.java b/java/src/com/android/inputmethod/latin/Suggest.java
index 3b89894..0178233 100755
--- a/java/src/com/android/inputmethod/latin/Suggest.java
+++ b/java/src/com/android/inputmethod/latin/Suggest.java
@@ -81,6 +81,7 @@
 
     private boolean mAutoTextEnabled;
 
+    private double mAutoCompleteThreshold;
     private int[] mPriorities = new int[mPrefMaxSuggestions];
     private int[] mBigramPriorities = new int[PREF_MAX_BIGRAMS];
 
@@ -163,6 +164,10 @@
         mUserBigramDictionary = userBigramDictionary;
     }
 
+    public void setAutoCompleteThreshold(double threshold) {
+        mAutoCompleteThreshold = threshold;
+    }
+
     /**
      * Number of suggestions to generate from the input key sequence. This has
      * to be a number between 1 and 100 (inclusive).
@@ -301,8 +306,14 @@
             }
             mMainDict.getWords(wordComposer, this, mNextLettersFrequencies);
             if ((mCorrectionMode == CORRECTION_FULL || mCorrectionMode == CORRECTION_FULL_BIGRAM)
-                    && mSuggestions.size() > 0) {
-                mHaveCorrection = true;
+                    && mSuggestions.size() > 0 && mPriorities.length > 0) {
+                // TODO: when the normalized score of the first suggestion is nearly equals to
+                //       the normalized score of the second suggestion, behave less aggressive.
+                final double normalizedScore = LatinIMEUtil.calcNormalizedScore(
+                        mOriginalWord, mSuggestions.get(0), mPriorities[0]);
+                if (normalizedScore >= mAutoCompleteThreshold) {
+                    mHaveCorrection = true;
+                }
             }
         }
         if (mOriginalWord != null) {
diff --git a/java/src/com/android/inputmethod/latin/TextEntryState.java b/java/src/com/android/inputmethod/latin/TextEntryState.java
index 9011191..1d7659c 100644
--- a/java/src/com/android/inputmethod/latin/TextEntryState.java
+++ b/java/src/com/android/inputmethod/latin/TextEntryState.java
@@ -16,8 +16,9 @@
 
 package com.android.inputmethod.latin;
 
+import com.android.inputmethod.latin.BaseKeyboard.Key;
+
 import android.content.Context;
-import android.inputmethodservice.Keyboard.Key;
 import android.text.format.DateFormat;
 import android.util.Log;
 
diff --git a/java/src/com/android/inputmethod/voice/VoiceInput.java b/java/src/com/android/inputmethod/voice/VoiceInput.java
index f24c180..4c54dd3 100644
--- a/java/src/com/android/inputmethod/voice/VoiceInput.java
+++ b/java/src/com/android/inputmethod/voice/VoiceInput.java
@@ -16,6 +16,7 @@
 
 package com.android.inputmethod.voice;
 
+import com.android.inputmethod.latin.EditingUtil;
 import com.android.inputmethod.latin.R;
 
 import android.content.ContentResolver;
@@ -30,6 +31,7 @@
 import android.speech.SpeechRecognizer;
 import android.speech.RecognizerIntent;
 import android.util.Log;
+import android.view.inputmethod.InputConnection;
 import android.view.View;
 import android.view.View.OnClickListener;
 
@@ -423,8 +425,14 @@
         mLogger.textModifiedByTypingDeletion(length);
     }
 
-    public void logTextModifiedByChooseSuggestion(int length) {
-        mLogger.textModifiedByChooseSuggestion(length);
+    public void logTextModifiedByChooseSuggestion(String suggestion, int index,
+                                                  String wordSeparators, InputConnection ic) {
+        EditingUtil.Range range = new EditingUtil.Range();
+        String wordToBeReplaced = EditingUtil.getWordAtCursor(ic, wordSeparators, range);
+        // If we enable phrase-based alternatives, only send up the first word
+        // in suggestion and wordToBeReplaced.
+        mLogger.textModifiedByChooseSuggestion(suggestion.length(), wordToBeReplaced.length(),
+                                               index, wordToBeReplaced, suggestion);
     }
 
     public void logKeyboardWarningDialogShown() {
@@ -455,10 +463,6 @@
         mLogger.voiceInputDelivered(length);
     }
 
-    public void logNBestChoose(int index) {
-        mLogger.nBestChoose(index);
-    }
-
     public void logInputEnded() {
         mLogger.inputEnded();
     }
diff --git a/java/src/com/android/inputmethod/voice/VoiceInputLogger.java b/java/src/com/android/inputmethod/voice/VoiceInputLogger.java
index 188d137..ec0ae64 100644
--- a/java/src/com/android/inputmethod/voice/VoiceInputLogger.java
+++ b/java/src/com/android/inputmethod/voice/VoiceInputLogger.java
@@ -205,22 +205,22 @@
         mContext.sendBroadcast(i);
     }
 
-    public void textModifiedByChooseSuggestion(int length) {
+
+    public void textModifiedByChooseSuggestion(int suggestionLength, int replacedPhraseLength,
+                                               int index, String before, String after) {
         setHasLoggingInfo(true);
         Intent i = newLoggingBroadcast(LoggingEvents.VoiceIme.TEXT_MODIFIED);
-        i.putExtra(LoggingEvents.VoiceIme.EXTRA_TEXT_MODIFIED_LENGTH, length);
+        i.putExtra(LoggingEvents.VoiceIme.EXTRA_TEXT_MODIFIED_LENGTH, suggestionLength);
+        i.putExtra(LoggingEvents.VoiceIme.EXTRA_TEXT_REPLACED_LENGTH, replacedPhraseLength);
         i.putExtra(LoggingEvents.VoiceIme.EXTRA_TEXT_MODIFIED_TYPE,
                 LoggingEvents.VoiceIme.TEXT_MODIFIED_TYPE_CHOOSE_SUGGESTION);
+
+        i.putExtra(LoggingEvents.VoiceIme.EXTRA_N_BEST_CHOOSE_INDEX, index);
+        i.putExtra(LoggingEvents.VoiceIme.EXTRA_BEFORE_N_BEST_CHOOSE, before);
+        i.putExtra(LoggingEvents.VoiceIme.EXTRA_AFTER_N_BEST_CHOOSE, after);
         mContext.sendBroadcast(i);
     }
 
-    public void nBestChoose(int index) {
-        setHasLoggingInfo(true);
-        Intent i = newLoggingBroadcast(LoggingEvents.VoiceIme.N_BEST_CHOOSE);
-        i.putExtra(LoggingEvents.VoiceIme.EXTRA_N_BEST_CHOOSE_INDEX, index);
-        mContext.sendBroadcast(i);
-    }
-    
     public void inputEnded() {
         setHasLoggingInfo(true);
         mContext.sendBroadcast(newLoggingBroadcast(LoggingEvents.VoiceIme.INPUT_ENDED));
diff --git a/tests/src/com/android/inputmethod/latin/EditDistanceTests.java b/tests/src/com/android/inputmethod/latin/EditDistanceTests.java
new file mode 100644
index 0000000..a9ed89d
--- /dev/null
+++ b/tests/src/com/android/inputmethod/latin/EditDistanceTests.java
@@ -0,0 +1,107 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.inputmethod.latin;
+
+import android.test.AndroidTestCase;
+
+public class EditDistanceTests extends AndroidTestCase {
+    @Override
+    protected void setUp() throws Exception {
+        super.setUp();
+    }
+
+    @Override
+    protected void tearDown() throws Exception {
+        super.tearDown();
+    }
+
+    /*
+     * dist(kitten, sitting) == 3
+     *
+     * kitten-
+     * .|||.|
+     * sitting
+     */
+    public void testExample1() {
+        final int dist = LatinIMEUtil.editDistance("kitten", "sitting");
+        assertEquals("edit distance between 'kitten' and 'sitting' is 3",
+                3, dist);
+    }
+
+    /*
+     * dist(Sunday, Saturday) == 3
+     *
+     * Saturday
+     * |  |.|||
+     * S--unday
+     */
+    public void testExample2() {
+        final int dist = LatinIMEUtil.editDistance("Saturday", "Sunday");
+        assertEquals("edit distance between 'Saturday' and 'Sunday' is 3",
+                3, dist);
+    }
+
+    public void testBothEmpty() {
+        final int dist = LatinIMEUtil.editDistance("", "");
+        assertEquals("when both string are empty, no edits are needed",
+                0, dist);
+    }
+
+    public void testFirstArgIsEmpty() {
+        final int dist = LatinIMEUtil.editDistance("", "aaaa");
+        assertEquals("when only one string of the arguments is empty,"
+                 + " the edit distance is the length of the other.",
+                 4, dist);
+    }
+
+    public void testSecoondArgIsEmpty() {
+        final int dist = LatinIMEUtil.editDistance("aaaa", "");
+        assertEquals("when only one string of the arguments is empty,"
+                 + " the edit distance is the length of the other.",
+                 4, dist);
+    }
+
+    public void testSameStrings() {
+        final String arg1 = "The quick brown fox jumps over the lazy dog.";
+        final String arg2 = "The quick brown fox jumps over the lazy dog.";
+        final int dist = LatinIMEUtil.editDistance(arg1, arg2);
+        assertEquals("when same strings are passed, distance equals 0.",
+                0, dist);
+    }
+
+    public void testSameReference() {
+        final String arg = "The quick brown fox jumps over the lazy dog.";
+        final int dist = LatinIMEUtil.editDistance(arg, arg);
+        assertEquals("when same string references are passed, the distance equals 0.",
+                0, dist);
+    }
+
+    public void testNullArg() {
+        try {
+            LatinIMEUtil.editDistance(null, "aaa");
+            fail("IllegalArgumentException should be thrown.");
+        } catch (Exception e) {
+            assertTrue(e instanceof IllegalArgumentException);
+        }
+        try {
+            LatinIMEUtil.editDistance("aaa", null);
+            fail("IllegalArgumentException should be thrown.");
+        } catch (Exception e) {
+            assertTrue(e instanceof IllegalArgumentException);
+        }
+    }
+}