Merge "Change the formula of the missing character."
diff --git a/java/res/values-de/strings.xml b/java/res/values-de/strings.xml
index f4ec4d0..74c1041 100644
--- a/java/res/values-de/strings.xml
+++ b/java/res/values-de/strings.xml
@@ -40,11 +40,11 @@
     <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>
-    <string name="auto_correction" msgid="4979925752001319458">"Auto-Korrektur"</string>
+    <string name="auto_correction" msgid="4979925752001319458">"Autokorrektur"</string>
     <string name="auto_correction_summary" msgid="5625751551134658006">"Korrektur fehlerhafter Wörter durch Leertaste und Satzzeichen"</string>
     <string name="auto_correction_threshold_mode_off" msgid="8470882665417944026">"Aus"</string>
     <string name="auto_correction_threshold_mode_modest" msgid="8788366690620799097">"Mäßig"</string>
-    <string name="auto_correction_threshold_mode_aggeressive" msgid="3524029103734923819">"Aggressiv"</string>
+    <string name="auto_correction_threshold_mode_aggeressive" msgid="3524029103734923819">"Stark"</string>
     <string name="bigram_suggestion" msgid="1323347224043514969">"Bigramm-Vorschläge"</string>
     <string name="bigram_suggestion_summary" msgid="4383845146070101531">"Zur Verbesserung des Vorschlags vorheriges Wort verwenden"</string>
     <string name="added_word" msgid="8993883354622484372">"<xliff:g id="WORD">%s</xliff:g>: gespeichert"</string>
@@ -94,7 +94,7 @@
     <string name="voice_input_modes_off" msgid="3745699748218082014">"Aus"</string>
     <string name="voice_input_modes_summary_main_keyboard" msgid="6586544292900314339">"Mikro auf Haupttastatur"</string>
     <string name="voice_input_modes_summary_symbols_keyboard" msgid="5233725927281932391">"Mikro auf Symboltastatur"</string>
-    <string name="voice_input_modes_summary_off" msgid="63875609591897607">"Spracheing. deaktiviert"</string>
+    <string name="voice_input_modes_summary_off" msgid="63875609591897607">"Spracheingabe deaktiviert"</string>
     <string name="selectInputMethod" msgid="315076553378705821">"Eingabemethode auswählen"</string>
     <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>
diff --git a/java/res/values-uk/strings.xml b/java/res/values-uk/strings.xml
index bdfddaf..5306339 100644
--- a/java/res/values-uk/strings.xml
+++ b/java/res/values-uk/strings.xml
@@ -106,7 +106,7 @@
     <string name="prefs_enable_recorrection_summary" msgid="5082041365862396329">"Торкніться введених слів, щоб виправити їх, лише коли ввімкнено пропозиції"</string>
     <string name="keyboard_layout" msgid="437433231038683666">"Тема клавіатури"</string>
     <string name="subtype_mode_cs_keyboard" msgid="1141718931112377586">"Чеська розкладка"</string>
-    <string name="subtype_mode_ar_keyboard" msgid="2655338636329774995">"Розкладка для арабських мов"</string>
+    <string name="subtype_mode_ar_keyboard" msgid="2655338636329774995">"Розкладка для арабської мови"</string>
     <string name="subtype_mode_da_keyboard" msgid="1243570804427922104">"Данська розкладка"</string>
     <string name="subtype_mode_de_keyboard" msgid="1990979135959462145">"Німецька розкладка"</string>
     <string name="subtype_mode_en_GB_keyboard" msgid="7945856548410373708">"Англ. розкладка (Великобританія)"</string>
diff --git a/java/res/values/attrs.xml b/java/res/values/attrs.xml
index 28c948b..9b38139 100644
--- a/java/res/values/attrs.xml
+++ b/java/res/values/attrs.xml
@@ -142,6 +142,9 @@
         <attr name="shiftedIcon" format="reference" />
         <!-- The key is enabled and responds on press. -->
         <attr name="enabled" format="boolean" />
+        <!-- Visual insets -->
+        <attr name="visualInsetsLeft" format="dimension|fraction" />
+        <attr name="visualInsetsRight" format="dimension|fraction" />
     </declare-styleable>
 
     <declare-styleable name="Keyboard_Row">
diff --git a/java/res/xml/kbd_ar_rows.xml b/java/res/xml/kbd_ar_rows.xml
new file mode 100644
index 0000000..4b490f1
--- /dev/null
+++ b/java/res/xml/kbd_ar_rows.xml
@@ -0,0 +1,119 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2011, 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.
+*/
+-->
+
+<!-- This file for Arabic layout is an alpha version. It allows to enter   -->
+<!-- some right-to-left text, but it has gone through no study whatsoever, -->
+<!-- and needs to be run through UX.                                       -->
+<merge
+    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+>
+    <include
+        latin:keyboardLayout="@xml/kbd_key_styles" />
+    <Row
+        latin:keyWidth="10%p"
+    >
+        <Key
+            latin:keyLabel="ض"
+            latin:keyEdgeFlags="left" />
+        <Key
+            latin:keyLabel="ص" />
+        <Key
+            latin:keyLabel="ق" />
+        <Key
+            latin:keyLabel="ف"
+            latin:popupCharacters="ڤ" />
+        <Key
+            latin:keyLabel="غ" />
+        <Key
+            latin:keyLabel="ع" />
+        <Key
+            latin:keyLabel="ه"
+            latin:popupCharacters="هـ" />
+        <Key
+            latin:keyLabel="خ" />
+        <Key
+            latin:keyLabel="ح" />
+        <Key
+            latin:keyLabel="چ"
+            latin:popupCharacters="ج"
+            latin:keyEdgeFlags="right" />
+    </Row>
+    <Row
+        latin:keyWidth="10%p"
+    >
+        <Key
+            latin:keyLabel="ش"
+            latin:keyEdgeFlags="left" />
+        <Key
+            latin:keyLabel="س" />
+        <Key
+            latin:keyLabel="ي"
+            latin:popupCharacters="ئ,ى" />
+        <Key
+            latin:keyLabel="ب"
+            latin:popupCharacters="پ" />
+        <Key
+            latin:keyLabel="ل"
+            latin:popupCharacters="لا" />
+        <Key
+            latin:keyLabel="ا"
+            latin:popupCharacters="ء,آ,إ,أ" />
+        <Key
+            latin:keyLabel="ت" />
+        <Key
+            latin:keyLabel="ن" />
+        <Key
+            latin:keyLabel="م" />
+        <Key
+            latin:keyLabel="ك"
+            latin:popupCharacters="گ"
+            latin:keyEdgeFlags="right" />
+    </Row>
+    <Row
+        latin:keyWidth="10%p"
+    >
+        <Key
+            latin:keyLabel="ظ"
+            latin:keyEdgeFlags="left" />
+        <Key
+            latin:keyLabel="ط" />
+        <Key
+            latin:keyLabel="ذ" />
+        <Key
+            latin:keyLabel="د" />
+        <Key
+            latin:keyLabel="ز"
+            latin:popupCharacters="ژ" />
+        <Key
+            latin:keyLabel="ر" />
+        <Key
+            latin:keyLabel="و"
+            latin:popupCharacters="ؤ" />
+        <Key
+            latin:keyLabel="ة" />
+        <Key
+            latin:keyLabel="ث" />
+        <Key
+            latin:keyStyle="deleteKeyStyle"
+            latin:visualInsetsLeft="2%p"
+            latin:keyEdgeFlags="right" />
+    </Row>
+    <include latin:keyboardLayout="@xml/kbd_qwerty_row4" />
+</merge>
diff --git a/java/res/xml/kbd_azerty_rows.xml b/java/res/xml/kbd_azerty_rows.xml
index 9eeb22e..ab3e1a0 100644
--- a/java/res/xml/kbd_azerty_rows.xml
+++ b/java/res/xml/kbd_azerty_rows.xml
@@ -108,6 +108,7 @@
         <Key
             latin:keyStyle="shiftKeyStyle"
             latin:keyWidth="15%p"
+            latin:visualInsetsRight="1%p"
             latin:keyEdgeFlags="left" />
         <Key
             latin:keyLabel="w"
@@ -131,6 +132,7 @@
         <Key
             latin:keyStyle="deleteKeyStyle"
             latin:keyWidth="15%p"
+            latin:visualInsetsLeft="1%p"
             latin:keyEdgeFlags="right" />
     </Row>
     <include
diff --git a/java/res/xml/kbd_iw_rows.xml b/java/res/xml/kbd_iw_rows.xml
index db49ad7..fb0c2a9 100644
--- a/java/res/xml/kbd_iw_rows.xml
+++ b/java/res/xml/kbd_iw_rows.xml
@@ -48,11 +48,10 @@
             latin:keyLabel="ם" />
         <Key
             latin:keyLabel="פ" />
-        <Spacer
-            latin:horizontalGap="1.25%p" />
         <Key
             latin:keyStyle="deleteKeyStyle"
-            latin:keyWidth="13.75%p"
+            latin:keyWidth="15%p"
+            latin:visualInsetsLeft="1%p"
             latin:keyEdgeFlags="right" />
     </Row>
     <Row>
diff --git a/java/res/xml/kbd_qwerty_row3.xml b/java/res/xml/kbd_qwerty_row3.xml
index 27016af..3d106e6 100644
--- a/java/res/xml/kbd_qwerty_row3.xml
+++ b/java/res/xml/kbd_qwerty_row3.xml
@@ -26,10 +26,9 @@
     >
         <Key
             latin:keyStyle="shiftKeyStyle"
-            latin:keyWidth="13%p"
+            latin:keyWidth="15%p"
+            latin:visualInsetsRight="1%p"
             latin:keyEdgeFlags="left" />
-        <Spacer
-            latin:horizontalGap="2%p" />
         <Key
             latin:keyLabel="z"
             latin:popupCharacters="@string/alternates_for_z" />
@@ -48,11 +47,10 @@
             latin:popupCharacters="@string/alternates_for_n" />
         <Key
             latin:keyLabel="m" />
-        <Spacer
-            latin:horizontalGap="2%p" />
         <Key
             latin:keyStyle="deleteKeyStyle"
-            latin:keyWidth="13%p"
+            latin:keyWidth="15%p"
+            latin:visualInsetsLeft="1%p"
             latin:keyEdgeFlags="right" />
     </Row>
 </merge>
diff --git a/java/res/xml/kbd_qwertz_rows.xml b/java/res/xml/kbd_qwertz_rows.xml
index 375f123..bb41f06 100644
--- a/java/res/xml/kbd_qwertz_rows.xml
+++ b/java/res/xml/kbd_qwertz_rows.xml
@@ -78,6 +78,7 @@
         <Key
             latin:keyStyle="shiftKeyStyle"
             latin:keyWidth="15%p"
+            latin:visualInsetsRight="1%p"
             latin:keyEdgeFlags="left" />
         <Key
             latin:keyLabel="y"
@@ -100,6 +101,7 @@
         <Key
             latin:keyStyle="deleteKeyStyle"
             latin:keyWidth="15%p"
+            latin:visualInsetsLeft="1%p"
             latin:keyEdgeFlags="right" />
     </Row>
    <include
diff --git a/java/res/xml/kbd_symbols.xml b/java/res/xml/kbd_symbols.xml
index b3b3f4e..0b8b899 100644
--- a/java/res/xml/kbd_symbols.xml
+++ b/java/res/xml/kbd_symbols.xml
@@ -100,6 +100,7 @@
         <Key
             latin:keyStyle="altKeyStyle"
             latin:keyWidth="15%p"
+            latin:visualInsetsRight="1%p"
             latin:keyEdgeFlags="left" />
         <Key
             latin:keyLabel="!"
@@ -122,6 +123,7 @@
         <Key
             latin:keyStyle="deleteKeyStyle"
             latin:keyWidth="15%p"
+            latin:visualInsetsLeft="1%p"
             latin:keyEdgeFlags="right" />
     </Row>
     <include latin:keyboardLayout="@xml/kbd_symbols_row4" />
diff --git a/java/res/xml/kbd_symbols_shift.xml b/java/res/xml/kbd_symbols_shift.xml
index 368ee80..36f0c64 100644
--- a/java/res/xml/kbd_symbols_shift.xml
+++ b/java/res/xml/kbd_symbols_shift.xml
@@ -89,6 +89,7 @@
         <Key
             latin:keyStyle="shiftKeyStyle"
             latin:keyWidth="15%p"
+            latin:visualInsetsRight="1%p"
             latin:keyEdgeFlags="left" />
         <Key
             latin:keyLabel="™" />
@@ -110,6 +111,7 @@
         <Key
             latin:keyStyle="deleteKeyStyle"
             latin:keyWidth="15%p"
+            latin:visualInsetsLeft="1%p"
             latin:keyEdgeFlags="right" />
     </Row>
     <include latin:keyboardLayout="@xml/kbd_symbols_shift_row4" />
diff --git a/java/res/xml/method.xml b/java/res/xml/method.xml
index 1374338..1b122be 100644
--- a/java/res/xml/method.xml
+++ b/java/res/xml/method.xml
@@ -24,6 +24,7 @@
 <!-- Voice: af, cs, da, de, en, es, fr, it, ja, ko, nl, pl, pt, ru, tr, yue, zh, zu -->
 <!-- TODO: use <lang>_keyboard icon instead of a common keyboard icon. -->
 <!-- TODO: use <lang>_mic icon instead of a common mic icon. -->
+<!-- TODO: remove all comment outed voice subtypes -->
 <!-- If IME doesn't have an applicable subtype, the first subtype will be used as a default
      subtype.-->
 <input-method xmlns:android="http://schemas.android.com/apk/res/android"
@@ -34,12 +35,12 @@
             android:imeSubtypeLocale="en_US"
             android:imeSubtypeMode="keyboard"
     />
-    <subtype android:icon="@drawable/ic_subtype_mic"
-            android:label="@string/subtype_mode_en_voice"
-            android:imeSubtypeLocale="en"
-            android:imeSubtypeMode="voice"
-            android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity"
-    />
+<!--     <subtype android:icon="@drawable/ic_subtype_mic" -->
+<!--             android:label="@string/subtype_mode_en_voice" -->
+<!--             android:imeSubtypeLocale="en" -->
+<!--             android:imeSubtypeMode="voice" -->
+<!--             android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity" -->
+<!--     /> -->
     <subtype android:icon="@drawable/ic_subtype_keyboard"
             android:label="@string/subtype_mode_en_GB_keyboard"
             android:imeSubtypeLocale="en_GB"
@@ -56,12 +57,12 @@
             android:imeSubtypeLocale="cs"
             android:imeSubtypeMode="keyboard"
     />
-    <subtype android:icon="@drawable/ic_subtype_mic"
-            android:label="@string/subtype_mode_cs_voice"
-            android:imeSubtypeLocale="cs"
-            android:imeSubtypeMode="voice"
-            android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity"
-    />
+<!--     <subtype android:icon="@drawable/ic_subtype_mic" -->
+<!--             android:label="@string/subtype_mode_cs_voice" -->
+<!--             android:imeSubtypeLocale="cs" -->
+<!--             android:imeSubtypeMode="voice" -->
+<!--             android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity" -->
+<!--     /> -->
     <subtype android:icon="@drawable/ic_subtype_keyboard"
             android:label="@string/subtype_mode_da_keyboard"
             android:imeSubtypeLocale="da"
@@ -73,34 +74,34 @@
             android:imeSubtypeMode="keyboard"
             android:imeSubtypeExtraValue="requiresGermanUmlautProcessing"
     />
-    <subtype android:icon="@drawable/ic_subtype_mic"
-            android:label="@string/subtype_mode_de_voice"
-            android:imeSubtypeLocale="de"
-            android:imeSubtypeMode="voice"
-            android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity"
-    />
+<!--     <subtype android:icon="@drawable/ic_subtype_mic" -->
+<!--             android:label="@string/subtype_mode_de_voice" -->
+<!--             android:imeSubtypeLocale="de" -->
+<!--             android:imeSubtypeMode="voice" -->
+<!--             android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity" -->
+<!--     /> -->
     <subtype android:icon="@drawable/ic_subtype_keyboard"
             android:label="@string/subtype_mode_es_keyboard"
             android:imeSubtypeLocale="es"
             android:imeSubtypeMode="keyboard"
     />
-    <subtype android:icon="@drawable/ic_subtype_mic"
-            android:label="@string/subtype_mode_es_voice"
-            android:imeSubtypeLocale="es"
-            android:imeSubtypeMode="voice"
-            android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity"
-    />
+<!--     <subtype android:icon="@drawable/ic_subtype_mic" -->
+<!--             android:label="@string/subtype_mode_es_voice" -->
+<!--             android:imeSubtypeLocale="es" -->
+<!--             android:imeSubtypeMode="voice" -->
+<!--             android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity" -->
+<!--     /> -->
     <subtype android:icon="@drawable/ic_subtype_keyboard"
             android:label="@string/subtype_mode_fr_keyboard"
             android:imeSubtypeLocale="fr"
             android:imeSubtypeMode="keyboard"
     />
-    <subtype android:icon="@drawable/ic_subtype_mic"
-            android:label="@string/subtype_mode_fr_voice"
-            android:imeSubtypeLocale="fr"
-            android:imeSubtypeMode="voice"
-            android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity"
-    />
+<!--     <subtype android:icon="@drawable/ic_subtype_mic" -->
+<!--             android:label="@string/subtype_mode_fr_voice" -->
+<!--             android:imeSubtypeLocale="fr" -->
+<!--             android:imeSubtypeMode="voice" -->
+<!--             android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity" -->
+<!--     /> -->
     <subtype android:icon="@drawable/ic_subtype_keyboard"
             android:label="@string/subtype_mode_fr_CA_keyboard"
             android:imeSubtypeLocale="fr_CA"
@@ -123,12 +124,12 @@
             android:imeSubtypeLocale="iw"
             android:imeSubtypeMode="keyboard"
     />
-    <subtype android:icon="@drawable/ic_subtype_mic"
-            android:label="@string/subtype_mode_it_voice"
-            android:imeSubtypeLocale="it"
-            android:imeSubtypeMode="voice"
-            android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity"
-    />
+<!--     <subtype android:icon="@drawable/ic_subtype_mic" -->
+<!--             android:label="@string/subtype_mode_it_voice" -->
+<!--             android:imeSubtypeLocale="it" -->
+<!--             android:imeSubtypeMode="voice" -->
+<!--             android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity" -->
+<!--     /> -->
     <subtype android:icon="@drawable/ic_subtype_keyboard"
             android:label="@string/subtype_mode_nb_keyboard"
             android:imeSubtypeLocale="nb"
@@ -139,12 +140,12 @@
             android:imeSubtypeLocale="nl"
             android:imeSubtypeMode="keyboard"
     />
-    <subtype android:icon="@drawable/ic_subtype_mic"
-            android:label="@string/subtype_mode_nl_voice"
-            android:imeSubtypeLocale="nl"
-            android:imeSubtypeMode="voice"
-            android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity"
-    />
+<!--     <subtype android:icon="@drawable/ic_subtype_mic" -->
+<!--             android:label="@string/subtype_mode_nl_voice" -->
+<!--             android:imeSubtypeLocale="nl" -->
+<!--             android:imeSubtypeMode="voice" -->
+<!--             android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity" -->
+<!--     /> -->
     <subtype android:icon="@drawable/ic_subtype_keyboard"
             android:label="@string/subtype_mode_ru_keyboard"
             android:imeSubtypeLocale="ru"
@@ -160,64 +161,64 @@
             android:imeSubtypeLocale="sv"
             android:imeSubtypeMode="keyboard"
     />
-    <subtype android:icon="@drawable/ic_subtype_mic"
-            android:label="@string/subtype_mode_af_voice"
-            android:imeSubtypeLocale="af"
-            android:imeSubtypeMode="voice"
-            android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity"
-    />
-    <subtype android:icon="@drawable/ic_subtype_mic"
-            android:label="@string/subtype_mode_ja_voice"
-            android:imeSubtypeLocale="ja"
-            android:imeSubtypeMode="voice"
-            android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity"
-    />
-    <subtype android:icon="@drawable/ic_subtype_mic"
-            android:label="@string/subtype_mode_ko_voice"
-            android:imeSubtypeLocale="ko"
-            android:imeSubtypeMode="voice"
-            android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity"
-    />
-    <subtype android:icon="@drawable/ic_subtype_mic"
-            android:label="@string/subtype_mode_pl_voice"
-            android:imeSubtypeLocale="pl"
-            android:imeSubtypeMode="voice"
-            android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity"
-    />
-    <subtype android:icon="@drawable/ic_subtype_mic"
-            android:label="@string/subtype_mode_pt_voice"
-            android:imeSubtypeLocale="pt"
-            android:imeSubtypeMode="voice"
-            android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity"
-    />
-    <subtype android:icon="@drawable/ic_subtype_mic"
-            android:label="@string/subtype_mode_ru_voice"
-            android:imeSubtypeLocale="ru"
-            android:imeSubtypeMode="voice"
-            android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity"
-    />
-    <subtype android:icon="@drawable/ic_subtype_mic"
-            android:label="@string/subtype_mode_tr_voice"
-            android:imeSubtypeLocale="tr"
-            android:imeSubtypeMode="voice"
-            android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity"
-    />
-    <subtype android:icon="@drawable/ic_subtype_mic"
-            android:label="@string/subtype_mode_yue_voice"
-            android:imeSubtypeLocale="yue"
-            android:imeSubtypeMode="voice"
-            android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity"
-    />
-    <subtype android:icon="@drawable/ic_subtype_mic"
-            android:label="@string/subtype_mode_zh_voice"
-            android:imeSubtypeLocale="zh"
-            android:imeSubtypeMode="voice"
-            android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity"
-    />
-    <subtype android:icon="@drawable/ic_subtype_mic"
-            android:label="@string/subtype_mode_zu_voice"
-            android:imeSubtypeLocale="zu"
-            android:imeSubtypeMode="voice"
-            android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity"
-    />
+<!--     <subtype android:icon="@drawable/ic_subtype_mic" -->
+<!--             android:label="@string/subtype_mode_af_voice" -->
+<!--             android:imeSubtypeLocale="af" -->
+<!--             android:imeSubtypeMode="voice" -->
+<!--             android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity" -->
+<!--     /> -->
+<!--     <subtype android:icon="@drawable/ic_subtype_mic" -->
+<!--             android:label="@string/subtype_mode_ja_voice" -->
+<!--             android:imeSubtypeLocale="ja" -->
+<!--             android:imeSubtypeMode="voice" -->
+<!--             android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity" -->
+<!--     /> -->
+<!--     <subtype android:icon="@drawable/ic_subtype_mic" -->
+<!--             android:label="@string/subtype_mode_ko_voice" -->
+<!--             android:imeSubtypeLocale="ko" -->
+<!--             android:imeSubtypeMode="voice" -->
+<!--             android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity" -->
+<!--     /> -->
+<!--     <subtype android:icon="@drawable/ic_subtype_mic" -->
+<!--             android:label="@string/subtype_mode_pl_voice" -->
+<!--             android:imeSubtypeLocale="pl" -->
+<!--             android:imeSubtypeMode="voice" -->
+<!--             android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity" -->
+<!--     /> -->
+<!--     <subtype android:icon="@drawable/ic_subtype_mic" -->
+<!--             android:label="@string/subtype_mode_pt_voice" -->
+<!--             android:imeSubtypeLocale="pt" -->
+<!--             android:imeSubtypeMode="voice" -->
+<!--             android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity" -->
+<!--     /> -->
+<!--     <subtype android:icon="@drawable/ic_subtype_mic" -->
+<!--             android:label="@string/subtype_mode_ru_voice" -->
+<!--             android:imeSubtypeLocale="ru" -->
+<!--             android:imeSubtypeMode="voice" -->
+<!--             android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity" -->
+<!--     /> -->
+<!--     <subtype android:icon="@drawable/ic_subtype_mic" -->
+<!--             android:label="@string/subtype_mode_tr_voice" -->
+<!--             android:imeSubtypeLocale="tr" -->
+<!--             android:imeSubtypeMode="voice" -->
+<!--             android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity" -->
+<!--     /> -->
+<!--     <subtype android:icon="@drawable/ic_subtype_mic" -->
+<!--             android:label="@string/subtype_mode_yue_voice" -->
+<!--             android:imeSubtypeLocale="yue" -->
+<!--             android:imeSubtypeMode="voice" -->
+<!--             android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity" -->
+<!--     /> -->
+<!--     <subtype android:icon="@drawable/ic_subtype_mic" -->
+<!--             android:label="@string/subtype_mode_zh_voice" -->
+<!--             android:imeSubtypeLocale="zh" -->
+<!--             android:imeSubtypeMode="voice" -->
+<!--             android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity" -->
+<!--     /> -->
+<!--     <subtype android:icon="@drawable/ic_subtype_mic" -->
+<!--             android:label="@string/subtype_mode_zu_voice" -->
+<!--             android:imeSubtypeLocale="zu" -->
+<!--             android:imeSubtypeMode="voice" -->
+<!--             android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity" -->
+<!--     /> -->
 </input-method>
diff --git a/java/src/com/android/inputmethod/keyboard/Key.java b/java/src/com/android/inputmethod/keyboard/Key.java
index 59c132e..1b7e8ef 100644
--- a/java/src/com/android/inputmethod/keyboard/Key.java
+++ b/java/src/com/android/inputmethod/keyboard/Key.java
@@ -61,8 +61,11 @@
     public final int mWidth;
     /** Height of the key, not including the gap */
     public final int mHeight;
-    /** The horizontal gap before this key */
+    /** The horizontal gap around this key */
     public final int mGap;
+    /** The visual insets */
+    public final int mVisualInsetsLeft;
+    public final int mVisualInsetsRight;
     /** Whether this key is sticky, i.e., a toggle key */
     public final boolean mSticky;
     /** X coordinate of the key in the keyboard layout */
@@ -144,6 +147,7 @@
         mKeyboard = keyboard;
         mHeight = keyboard.getRowHeight() - keyboard.getVerticalGap();
         mGap = keyboard.getHorizontalGap();
+        mVisualInsetsLeft = mVisualInsetsRight = 0;
         mWidth = width - mGap;
         mEdgeFlags = edgeFlags;
         mHintIcon = null;
@@ -230,6 +234,10 @@
             mEdgeFlags = style.getFlag(keyAttr, R.styleable.Keyboard_Key_keyEdgeFlags, 0)
                     | row.mRowEdgeFlags;
 
+            mVisualInsetsLeft = KeyboardParser.getDimensionOrFraction(keyAttr,
+                    R.styleable.Keyboard_Key_visualInsetsLeft, mKeyboard.getDisplayHeight(), 0);
+            mVisualInsetsRight = KeyboardParser.getDimensionOrFraction(keyAttr,
+                    R.styleable.Keyboard_Key_visualInsetsRight, mKeyboard.getDisplayHeight(), 0);
             mPreviewIcon = style.getDrawable(keyAttr, R.styleable.Keyboard_Key_iconPreview);
             Keyboard.setDefaultBounds(mPreviewIcon);
             mIcon = style.getDrawable(keyAttr, R.styleable.Keyboard_Key_keyIcon);
diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardView.java b/java/src/com/android/inputmethod/keyboard/KeyboardView.java
index e82796b..7b570d7 100644
--- a/java/src/com/android/inputmethod/keyboard/KeyboardView.java
+++ b/java/src/com/android/inputmethod/keyboard/KeyboardView.java
@@ -677,11 +677,13 @@
             // Switch the character to uppercase if shift is pressed
             String label = key.mLabel == null? null : adjustCase(key.mLabel).toString();
 
+            final int keyDrawX = key.mX + key.mVisualInsetsLeft;
+            final int keyDrawWidth = key.mWidth - key.mVisualInsetsLeft - key.mVisualInsetsRight;
             final Rect bounds = keyBackground.getBounds();
-            if (key.mWidth != bounds.right || key.mHeight != bounds.bottom) {
-                keyBackground.setBounds(0, 0, key.mWidth, key.mHeight);
+            if (keyDrawWidth != bounds.right || key.mHeight != bounds.bottom) {
+                keyBackground.setBounds(0, 0, keyDrawWidth, key.mHeight);
             }
-            canvas.translate(key.mX + kbdPaddingLeft, key.mY + kbdPaddingTop);
+            canvas.translate(keyDrawX + kbdPaddingLeft, key.mY + kbdPaddingTop);
             keyBackground.draw(canvas);
 
             final int rowHeight = padding.top + key.mHeight;
@@ -697,14 +699,14 @@
                     baseline = key.mHeight -
                             + labelCharHeight * KEY_LABEL_VERTICAL_PADDING_FACTOR;
                     if (DEBUG_SHOW_ALIGN)
-                        drawHorizontalLine(canvas, (int)baseline, key.mWidth, 0xc0008000,
+                        drawHorizontalLine(canvas, (int)baseline, keyDrawWidth, 0xc0008000,
                                 new Paint());
                 } else { // Align center
                     final float centerY = (key.mHeight + padding.top - padding.bottom) / 2;
                     baseline = centerY
                             + labelCharHeight * KEY_LABEL_VERTICAL_ADJUSTMENT_FACTOR_CENTER;
                     if (DEBUG_SHOW_ALIGN)
-                        drawHorizontalLine(canvas, (int)baseline, key.mWidth, 0xc0008000,
+                        drawHorizontalLine(canvas, (int)baseline, keyDrawWidth, 0xc0008000,
                                 new Paint());
                 }
                 // Horizontal label text alignment
@@ -715,12 +717,12 @@
                     if (DEBUG_SHOW_ALIGN)
                         drawVerticalLine(canvas, positionX, rowHeight, 0xc0800080, new Paint());
                 } else if ((key.mLabelOption & KEY_LABEL_OPTION_ALIGN_RIGHT) != 0) {
-                    positionX = key.mWidth - mKeyLabelHorizontalPadding - padding.right;
+                    positionX = keyDrawWidth - mKeyLabelHorizontalPadding - padding.right;
                     paint.setTextAlign(Align.RIGHT);
                     if (DEBUG_SHOW_ALIGN)
                         drawVerticalLine(canvas, positionX, rowHeight, 0xc0808000, new Paint());
                 } else {
-                    positionX = (key.mWidth + padding.left - padding.right) / 2;
+                    positionX = (keyDrawWidth + padding.left - padding.right) / 2;
                     paint.setTextAlign(Align.CENTER);
                     if (DEBUG_SHOW_ALIGN) {
                         if (label.length() > 1)
@@ -756,13 +758,13 @@
                     if (DEBUG_SHOW_ALIGN)
                         drawVerticalLine(canvas, drawableX, rowHeight, 0xc0800080, new Paint());
                 } else if ((key.mLabelOption & KEY_LABEL_OPTION_ALIGN_RIGHT) != 0) {
-                    drawableX = key.mWidth - padding.right - mKeyLabelHorizontalPadding
+                    drawableX = keyDrawWidth - padding.right - mKeyLabelHorizontalPadding
                             - drawableWidth;
                     if (DEBUG_SHOW_ALIGN)
                         drawVerticalLine(canvas, drawableX + drawableWidth, rowHeight,
                                 0xc0808000, new Paint());
                 } else { // Align center
-                    drawableX = (key.mWidth + padding.left - padding.right - drawableWidth) / 2;
+                    drawableX = (keyDrawWidth + padding.left - padding.right - drawableWidth) / 2;
                     if (DEBUG_SHOW_ALIGN)
                         drawVerticalLine(canvas, drawableX + drawableWidth / 2, rowHeight,
                                 0xc0008080, new Paint());
@@ -773,7 +775,7 @@
                             0x80c00000, new Paint());
             }
             if (key.mHintIcon != null) {
-                final int drawableWidth = key.mWidth;
+                final int drawableWidth = keyDrawWidth;
                 final int drawableHeight = key.mHeight;
                 final int drawableX = 0;
                 final int drawableY = HINT_ICON_VERTICAL_ADJUSTMENT_PIXEL;
@@ -785,7 +787,7 @@
                     drawRectangle(canvas, drawableX, drawableY, drawableWidth, drawableHeight,
                             0x80c0c000, new Paint());
             }
-            canvas.translate(-key.mX - kbdPaddingLeft, -key.mY - kbdPaddingTop);
+            canvas.translate(-keyDrawX - kbdPaddingLeft, -key.mY - kbdPaddingTop);
         }
 
         // TODO: Move this function to ProximityInfo for getting rid of public declarations for
@@ -921,6 +923,8 @@
         // WindowManager.BadTokenException.
         if (key == null || !mInForeground)
             return;
+        final int keyDrawX = key.mX + key.mVisualInsetsLeft;
+        final int keyDrawWidth = key.mWidth - key.mVisualInsetsLeft - key.mVisualInsetsRight;
         // What we show as preview should match what we show on key top in onBufferDraw(). 
         if (key.mLabel != null) {
             // TODO Should take care of temporaryShiftLabel here.
@@ -941,7 +945,7 @@
         }
         mPreviewText.measure(MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED),
                 MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED));
-        int popupWidth = Math.max(mPreviewText.getMeasuredWidth(), key.mWidth
+        int popupWidth = Math.max(mPreviewText.getMeasuredWidth(), keyDrawWidth
                 + mPreviewText.getPaddingLeft() + mPreviewText.getPaddingRight());
         final int popupHeight = mPreviewHeight;
         LayoutParams lp = mPreviewText.getLayoutParams();
@@ -950,7 +954,7 @@
             lp.height = popupHeight;
         }
 
-        int popupPreviewX = key.mX - (popupWidth - key.mWidth) / 2;
+        int popupPreviewX = keyDrawX - (popupWidth - keyDrawWidth) / 2;
         int popupPreviewY = key.mY - popupHeight + mPreviewOffset;
 
         mHandler.cancelDismissPreview();
@@ -973,10 +977,10 @@
         if (popupPreviewY + mWindowY < 0) {
             // If the key you're pressing is on the left side of the keyboard, show the popup on
             // the right, offset by enough to see at least one key to the left/right.
-            if (key.mX + key.mWidth <= getWidth() / 2) {
-                popupPreviewX += (int) (key.mWidth * 2.5);
+            if (keyDrawX + keyDrawWidth <= getWidth() / 2) {
+                popupPreviewX += (int) (keyDrawWidth * 2.5);
             } else {
-                popupPreviewX -= (int) (key.mWidth * 2.5);
+                popupPreviewX -= (int) (keyDrawWidth * 2.5);
             }
             popupPreviewY += popupHeight;
         }