Keyboard XML supports switch-case-default tags to select rows and keys

Change-Id: I0d92e513757e765d9de98561205754af5a143650
diff --git a/java/res/xml/kbd_qwerty_black_row4.xml b/java/res/xml/kbd_qwerty_black_row4.xml
index 330ddda..2b9ef7f 100644
--- a/java/res/xml/kbd_qwerty_black_row4.xml
+++ b/java/res/xml/kbd_qwerty_black_row4.xml
@@ -22,314 +22,141 @@
     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" />
+        <switch>
+            <case
+                latin:settingsKey="false"
+            >
+                <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" />
+                <switch>
+                    <case
+                        latin:mode="web"
+                    >
+                        <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" />
+                    </case>
+                    <default>
+                        <Key
+                            latin:codes="@integer/key_space"
+                            latin:keyIcon="@drawable/sym_bkeyboard_space"
+                            latin:iconPreview="@drawable/sym_keyboard_feedback_space"
+                            latin:keyWidth="40%p" />
+                    </default>
+                </switch>
+                <Key
+                    latin:keyLabel="."
+                    latin:keyHintIcon="@drawable/hint_popup"
+                    latin:popupKeyboard="@xml/popup_punctuation" />
+                <switch>
+                    <case
+                        latin:mode="im"
+                    >
+                        <Key
+                            latin:keyLabel=":-)"
+                            latin:keyOutputText=":-) "
+                            latin:keyHintIcon="@drawable/hint_popup"
+                            latin:popupKeyboard="@xml/popup_smileys"
+                            latin:keyWidth="20%p"
+                            latin:keyEdgeFlags="right" />
+                    </case>
+                    <default>
+                        <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" />
+                    </default>
+                </switch>
+            </case>
+            <case
+                latin:settingsKey="true"
+            >
+                <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" />
+                <switch>
+                    <case
+                        latin:mode="web"
+                    >
+                        <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" />
+                    </case>
+                    <default>
+                        <Key
+                            latin:codes="@integer/key_space"
+                            latin:keyIcon="@drawable/sym_bkeyboard_space"
+                            latin:iconPreview="@drawable/sym_keyboard_feedback_space"
+                            latin:keyWidth="30%p" />
+                    </default>
+                </switch>
+                <Key
+                    latin:keyLabel="."
+                    latin:keyHintIcon="@drawable/hint_popup"
+                    latin:popupKeyboard="@xml/popup_punctuation" />
+                <switch>
+                    <case
+                        latin:mode="im"
+                    >
+                        <Key
+                            latin:keyLabel=":-)"
+                            latin:keyOutputText=":-) "
+                            latin:keyHintIcon="@drawable/hint_popup"
+                            latin:popupKeyboard="@xml/popup_smileys"
+                            latin:keyWidth="25%p"
+                            latin:keyEdgeFlags="right" />
+                    </case>
+                    <case
+                        latin:mode="web"
+                    >
+                        <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" />
+                    </case>
+                    <default>
+                        <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" />
+                    </default>
+                </switch>
+            </case>
+        </switch>
     </Row>
 </merge>
diff --git a/java/res/xml/kbd_qwerty_row4.xml b/java/res/xml/kbd_qwerty_row4.xml
index 17b7c52..2e2b32e 100644
--- a/java/res/xml/kbd_qwerty_row4.xml
+++ b/java/res/xml/kbd_qwerty_row4.xml
@@ -22,371 +22,159 @@
     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" />
+        <switch>
+            <case
+                latin:settingsKey="false"
+            >
+                <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" />
+                <switch>
+                    <case
+                        latin:mode="web"
+                    >
+                        <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" />
+                    </case>
+                    <default>
+                        <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" />
+                    </default>
+                </switch>
+                <Key
+                    latin:keyLabel="."
+                    latin:keyHintIcon="@drawable/hint_popup"
+                    latin:popupKeyboard="@xml/popup_punctuation"
+                    latin:isModifier="true" />
+                <switch>
+                    <case
+                        latin:mode="im"
+                    >
+                        <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" />
+                    </case>
+                    <default>
+                        <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" />
+                    </default>
+                </switch>
+            </case>
+            <case
+                latin:settingsKey="true"
+            >
+                <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" />
+                <switch>
+                    <case
+                        latin:mode="web"
+                    >
+                        <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" />
+                    </case>
+                    <default>
+                        <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" />
+                    </default>
+                </switch>
+                <Key
+                    latin:keyLabel="."
+                    latin:keyHintIcon="@drawable/hint_popup"
+                    latin:popupKeyboard="@xml/popup_punctuation"
+                    latin:isModifier="true" />
+                <switch>
+                    <case
+                        latin:mode="im"
+                    >
+                        <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" />
+                    </case>
+                    <case
+                        latin:mode="web"
+                    >
+                        <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" />
+                     </case>
+                    <default>
+                        <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" />
+                    </default>
+                </switch>
+            </case>
+        </switch>
     </Row>
 </merge>
diff --git a/java/res/xml/kbd_symbols.xml b/java/res/xml/kbd_symbols.xml
index 608ddda..55b7681 100644
--- a/java/res/xml/kbd_symbols.xml
+++ b/java/res/xml/kbd_symbols.xml
@@ -142,64 +142,5 @@
             latin:isRepeatable="true"
             latin:keyEdgeFlags="right" />
     </Row>
-    <Row
-        latin:keyboardMode="@+id/mode_symbols_normal"
-        latin:rowEdgeFlags="bottom"
-    >
-        <include latin:keyboardLayout="@xml/kbd_symbols_row4_common" />
-    </Row>
-    <Row
-        latin:keyboardMode="@+id/mode_symbols_url"
-        latin:rowEdgeFlags="bottom"
-    >
-        <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>
+    <include latin:keyboardLayout="@xml/kbd_symbols_row4" />
 </Keyboard>
diff --git a/java/res/xml/kbd_symbols_black.xml b/java/res/xml/kbd_symbols_black.xml
index 9e401a1..ea021fb 100644
--- a/java/res/xml/kbd_symbols_black.xml
+++ b/java/res/xml/kbd_symbols_black.xml
@@ -141,64 +141,5 @@
             latin:isRepeatable="true"
             latin:keyEdgeFlags="right" />
     </Row>
-    <Row
-        latin:keyboardMode="@+id/mode_symbols_normal"
-        latin:rowEdgeFlags="bottom"
-    >
-        <include latin:keyboardLayout="@xml/kbd_symbols_black_row4_common" />
-    </Row>
-    <Row
-        latin:keyboardMode="@+id/mode_symbols_url"
-        latin:rowEdgeFlags="bottom"
-    >
-        <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>
+    <include latin:keyboardLayout="@xml/kbd_symbols_black_row4" />
 </Keyboard>
diff --git a/java/res/xml/kbd_symbols_black_row4.xml b/java/res/xml/kbd_symbols_black_row4.xml
new file mode 100644
index 0000000..d1ed527
--- /dev/null
+++ b/java/res/xml/kbd_symbols_black_row4.xml
@@ -0,0 +1,116 @@
+<?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:rowEdgeFlags="bottom"
+    >
+        <switch>
+            <case
+                latin:settingsKey="false"
+            >
+                <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" />
+                <switch>
+                    <case
+                        latin:mode="im"
+                    >
+                        <Key
+                            latin:keyLabel=":-)"
+                            latin:keyOutputText=":-) "
+                            latin:keyHintIcon="@drawable/hint_popup"
+                            latin:popupKeyboard="@xml/popup_smileys"
+                            latin:keyWidth="20%p"
+                            latin:keyEdgeFlags="right" />
+                    </case>
+                    <default>
+                        <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" />
+                    </default>
+                </switch>
+            </case>
+            <case
+                latin:settingsKey="true"
+            >
+                <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" />
+                <switch>
+                    <case
+                        latin:mode="im"
+                    >
+                        <Key
+                            latin:keyLabel=":-)"
+                            latin:keyOutputText=":-) "
+                            latin:keyHintIcon="@drawable/hint_popup"
+                            latin:popupKeyboard="@xml/popup_smileys"
+                            latin:keyWidth="25%p"
+                            latin:keyEdgeFlags="right" />
+                    </case>
+                    <default>
+                        <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" />
+                    </default>
+                </switch>
+            </case>
+        </switch>
+    </Row>
+</merge>
diff --git a/java/res/xml/kbd_symbols_black_row4_common.xml b/java/res/xml/kbd_symbols_black_row4_common.xml
deleted file mode 100644
index 7433eca..0000000
--- a/java/res/xml/kbd_symbols_black_row4_common.xml
+++ /dev/null
@@ -1,46 +0,0 @@
-<?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
deleted file mode 100644
index bbb1699..0000000
--- a/java/res/xml/kbd_symbols_black_row4_common_with_settings_key.xml
+++ /dev/null
@@ -1,50 +0,0 @@
-<?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
deleted file mode 100644
index a1546b7..0000000
--- a/java/res/xml/kbd_symbols_black_row4_im.xml
+++ /dev/null
@@ -1,47 +0,0 @@
-<?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
deleted file mode 100644
index 4cab461..0000000
--- a/java/res/xml/kbd_symbols_black_row4_im_with_settings_key.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-<?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.xml b/java/res/xml/kbd_symbols_row4.xml
new file mode 100644
index 0000000..4b3dd90
--- /dev/null
+++ b/java/res/xml/kbd_symbols_row4.xml
@@ -0,0 +1,129 @@
+<?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:rowEdgeFlags="bottom"
+    >
+        <switch>
+            <case
+                latin:settingsKey="false"
+            >
+                <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" />
+                <switch>
+                    <case
+                        latin:mode="im"
+                    >
+                        <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" />
+                    </case>
+                    <default>
+                        <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" />
+                    </default>
+                </switch>
+            </case>
+            <case
+                latin:settingsKey="true"
+            >
+                <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" />
+                <switch>
+                    <case
+                        latin:mode="im"
+                    >
+                        <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" />
+                    </case>
+                    <default>
+                        <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" />
+                    </default>
+                </switch>
+            </case>
+        </switch>
+    </Row>
+</merge>
diff --git a/java/res/xml/kbd_symbols_row4_common.xml b/java/res/xml/kbd_symbols_row4_common.xml
deleted file mode 100644
index ef7cdca..0000000
--- a/java/res/xml/kbd_symbols_row4_common.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-<?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
deleted file mode 100644
index 54b8542..0000000
--- a/java/res/xml/kbd_symbols_row4_common_with_settings_key.xml
+++ /dev/null
@@ -1,56 +0,0 @@
-<?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
deleted file mode 100644
index c7d679b..0000000
--- a/java/res/xml/kbd_symbols_row4_im.xml
+++ /dev/null
@@ -1,52 +0,0 @@
-<?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
deleted file mode 100644
index 7cc209b..0000000
--- a/java/res/xml/kbd_symbols_row4_im_with_settings_key.xml
+++ /dev/null
@@ -1,57 +0,0 @@
-<?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 b8f8fae..5279656 100644
--- a/java/res/xml/kbd_symbols_shift.xml
+++ b/java/res/xml/kbd_symbols_shift.xml
@@ -121,64 +121,5 @@
             latin:isRepeatable="true"
             latin:keyEdgeFlags="right" />
     </Row>
-    <Row
-        latin:keyboardMode="@+id/mode_symbols_normal"
-        latin:rowEdgeFlags="bottom"
-    >
-        <include latin:keyboardLayout="@xml/kbd_symbols_shift_row4_common" />
-    </Row>
-    <Row
-        latin:keyboardMode="@+id/mode_symbols_url"
-        latin:rowEdgeFlags="bottom"
-    >
-        <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>
+    <include latin:keyboardLayout="@xml/kbd_symbols_shift_row4" />
 </Keyboard>
diff --git a/java/res/xml/kbd_symbols_shift_black.xml b/java/res/xml/kbd_symbols_shift_black.xml
index 34684a6..895bcef 100644
--- a/java/res/xml/kbd_symbols_shift_black.xml
+++ b/java/res/xml/kbd_symbols_shift_black.xml
@@ -120,64 +120,5 @@
             latin:isRepeatable="true"
             latin:keyEdgeFlags="right" />
     </Row>
-    <Row
-        latin:keyboardMode="@+id/mode_symbols_normal"
-        latin:rowEdgeFlags="bottom"
-    >
-        <include latin:keyboardLayout="@xml/kbd_symbols_shift_black_row4_common" />
-    </Row>
-    <Row
-        latin:keyboardMode="@+id/mode_symbols_url"
-        latin:rowEdgeFlags="bottom"
-    >
-        <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>
+    <include latin:keyboardLayout="@xml/kbd_symbols_shift_black_row4" />
 </Keyboard>
diff --git a/java/res/xml/kbd_symbols_shift_black_row4.xml b/java/res/xml/kbd_symbols_shift_black_row4.xml
new file mode 100644
index 0000000..e18ab21
--- /dev/null
+++ b/java/res/xml/kbd_symbols_shift_black_row4.xml
@@ -0,0 +1,112 @@
+<?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:rowEdgeFlags="bottom"
+    >
+        <switch>
+            <case
+                latin:settingsKey="false"
+            >
+                <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="…" />
+                <switch>
+                    <case
+                        latin:mode="im"
+                    >
+                        <Key
+                            latin:keyLabel=":-)"
+                            latin:keyOutputText=":-) "
+                            latin:keyHintIcon="@drawable/hint_popup"
+                            latin:popupKeyboard="@xml/popup_smileys"
+                            latin:keyWidth="20%p"
+                            latin:keyEdgeFlags="right" />
+                    </case>
+                    <default>
+                        <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" />
+                    </default>
+                </switch>
+            </case>
+            <case
+                latin:settingsKey="true"
+            >
+                <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="…" />
+                <switch>
+                    <case
+                        latin:mode="im"
+                    >
+                        <Key
+                            latin:keyLabel=":-)"
+                            latin:keyOutputText=":-) "
+                            latin:keyHintIcon="@drawable/hint_popup"
+                            latin:popupKeyboard="@xml/popup_smileys"
+                            latin:keyWidth="25%p"
+                            latin:keyEdgeFlags="right" />
+                    </case>
+                    <default>
+                        <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" />
+                    </default>
+                </switch>
+            </case>
+        </switch>
+    </Row>
+</merge>
diff --git a/java/res/xml/kbd_symbols_shift_black_row4_common.xml b/java/res/xml/kbd_symbols_shift_black_row4_common.xml
deleted file mode 100644
index beb5b3d..0000000
--- a/java/res/xml/kbd_symbols_shift_black_row4_common.xml
+++ /dev/null
@@ -1,44 +0,0 @@
-<?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
deleted file mode 100644
index 97f882a..0000000
--- a/java/res/xml/kbd_symbols_shift_black_row4_common_with_settings_key.xml
+++ /dev/null
@@ -1,48 +0,0 @@
-<?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
deleted file mode 100644
index c0263c2..0000000
--- a/java/res/xml/kbd_symbols_shift_black_row4_im.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-<?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
deleted file mode 100644
index 14d6a0b..0000000
--- a/java/res/xml/kbd_symbols_shift_black_row4_im_with_settings_key.xml
+++ /dev/null
@@ -1,49 +0,0 @@
-<?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.xml b/java/res/xml/kbd_symbols_shift_row4.xml
new file mode 100644
index 0000000..f0df130
--- /dev/null
+++ b/java/res/xml/kbd_symbols_shift_row4.xml
@@ -0,0 +1,125 @@
+<?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:rowEdgeFlags="bottom"
+    >
+        <switch>
+            <case
+                latin:settingsKey="false"
+            >
+                <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" />
+                <switch>
+                    <case
+                        latin:mode="im"
+                    >
+                        <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" />
+                    </case>
+                    <default>
+                        <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" />
+                    </default>
+                </switch>
+            </case>
+            <case
+                latin:settingsKey="true"
+            >
+                <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" />
+                <switch>
+                    <case
+                        latin:mode="im"
+                    >
+                        <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" />
+                    </case>
+                    <default>
+                        <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" />
+                    </default>
+                </switch>
+            </case>
+        </switch>
+    </Row>
+</merge>
diff --git a/java/res/xml/kbd_symbols_shift_row4_common.xml b/java/res/xml/kbd_symbols_shift_row4_common.xml
deleted file mode 100644
index 4d5199e..0000000
--- a/java/res/xml/kbd_symbols_shift_row4_common.xml
+++ /dev/null
@@ -1,49 +0,0 @@
-<?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
deleted file mode 100644
index df570ea..0000000
--- a/java/res/xml/kbd_symbols_shift_row4_common_with_settings_key.xml
+++ /dev/null
@@ -1,54 +0,0 @@
-<?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
deleted file mode 100644
index 69c6092..0000000
--- a/java/res/xml/kbd_symbols_shift_row4_im.xml
+++ /dev/null
@@ -1,50 +0,0 @@
-<?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
deleted file mode 100644
index aad6e40..0000000
--- a/java/res/xml/kbd_symbols_shift_row4_im_with_settings_key.xml
+++ /dev/null
@@ -1,55 +0,0 @@
-<?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>