Add next/prev navigate action more keys and remove tab key

Bug: 6037537
Bug: 5961814
Change-Id: I9c6dedf953452a180fcd5bce7bfadfd3c821f224
diff --git a/java/res/xml/key_f1.xml b/java/res/xml/key_f1.xml
deleted file mode 100644
index 6068d25..0000000
--- a/java/res/xml/key_f1.xml
+++ /dev/null
@@ -1,97 +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"
->
-    <switch>
-        <case
-            latin:navigateAction="false"
-        >
-            <switch>
-                <case
-                    latin:mode="url"
-                >
-                    <Key
-                        latin:keyLabel="/"
-                        latin:keyStyle="f1PopupStyle" />
-                </case>
-                <case
-                    latin:mode="email"
-                >
-                    <Key
-                        latin:keyLabel="\@"
-                        latin:keyStyle="f1PopupStyle" />
-                </case>
-                <case
-                    latin:hasShortcutKey="true"
-                >
-                    <Key
-                        latin:keyStyle="shortcutKeyStyle" />
-                </case>
-                <!-- latin:hasShortcutKey="false" -->
-                <default>
-                    <Key
-                        latin:keyLabel="@string/keylabel_for_comma"
-                        latin:keyLabelFlags="hasPopupHint"
-                        latin:additionalMoreKeys="@string/more_keys_for_comma"
-                        latin:keyStyle="f1PopupStyle" />
-                </default>
-            </switch>
-        </case>
-        <!-- TODO: Remove dedicated navigation tab key. -->
-        <!-- navigateAction="true" -->
-        <default>
-            <switch>
-                <case
-                    latin:mode="url"
-                >
-                    <Key
-                        latin:keyLabel="/"
-                        latin:keyWidth="9.2%p"
-                        latin:keyStyle="f1PopupStyle" />
-                </case>
-                <case
-                    latin:mode="email"
-                >
-                    <Key
-                        latin:keyLabel="\@"
-                        latin:keyWidth="9.2%p"
-                        latin:keyStyle="f1PopupStyle" />
-                </case>
-                <case
-                    latin:hasShortcutKey="true"
-                >
-                    <Key
-                        latin:keyStyle="shortcutKeyStyle"
-                        latin:keyWidth="9.2%p" />
-                </case>
-                <!-- hasShortcutKey="false" -->
-                <default>
-                    <Key
-                        latin:keyLabel="@string/keylabel_for_comma"
-                        latin:additionalMoreKeys="@string/more_keys_for_comma"
-                        latin:keyStyle="f1PopupStyle"
-                        latin:keyWidth="9.2%p" />
-                    </default>
-            </switch>
-        </default>
-    </switch>
-</merge>
diff --git a/java/res/xml/key_navigation_tab.xml b/java/res/xml/key_navigation_tab.xml
deleted file mode 100644
index c77189f..0000000
--- a/java/res/xml/key_navigation_tab.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
-**
-** Copyright 2011, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-**     http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
--->
-
-<merge
-    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
->
-    <switch>
-        <case
-            latin:navigateAction="true"
-        >
-            <Key
-                latin:keyStyle="tabKeyStyle"
-                latin:keyWidth="9.2%p" />
-        </case>
-        <!-- hasSettingsKey="false" and navigateAction="false" -->
-        <default>
-            <!-- No key. -->
-        </default>
-    </switch>
-</merge>
diff --git a/java/res/xml/key_styles_common.xml b/java/res/xml/key_styles_common.xml
index eabbdb3..f0ea8ce 100644
--- a/java/res/xml/key_styles_common.xml
+++ b/java/res/xml/key_styles_common.xml
@@ -27,13 +27,13 @@
             latin:clobberSettingsKey="true"
         >
             <key-style
-                latin:styleName="f1PopupStyle"
+                latin:styleName="f1MoreKeysStyle"
                 latin:backgroundType="functional" />
         </case>
         <!-- clobberSettingsKey="false" -->
         <default>
             <key-style
-                latin:styleName="f1PopupStyle"
+                latin:styleName="f1MoreKeysStyle"
                 latin:keyLabelFlags="hasPopupHint"
                 latin:moreKeys="@string/settings_as_more_key"
                 latin:backgroundType="functional" />
@@ -77,7 +77,22 @@
         latin:keyActionFlags="isRepeatable|noKeyPreview"
         latin:backgroundType="functional" />
     <include
-        latin:keyboardLayout="@xml/key_styles_enter_phone" />
+        latin:keyboardLayout="@xml/key_styles_enter" />
+    <switch>
+        <!-- Smiley in textShortMessage field.
+             Overrides common enter key style. -->
+        <case
+            latin:mode="im"
+        >
+            <key-style
+                latin:styleName="enterKeyStyle"
+                latin:keyLabel=":-)"
+                latin:keyOutputText=":-) "
+                latin:keyLabelFlags="hasPopupHint"
+                latin:moreKeys="@string/more_keys_for_smiley"
+                latin:backgroundType="functional" />
+        </case>
+    </switch>
     <key-style
         latin:styleName="spaceKeyStyle"
         latin:code="@integer/key_space"
@@ -91,7 +106,7 @@
         latin:keyLabelFlags="preserveCase"
         latin:keyActionFlags="noKeyPreview|altCodeWhileTyping"
         latin:altCode="@integer/key_space"
-        latin:parentStyle="f1PopupStyle" />
+        latin:parentStyle="f1MoreKeysStyle" />
     <key-style
         latin:styleName="settingsKeyStyle"
         latin:code="@integer/key_settings"
diff --git a/java/res/xml/key_styles_enter_phone.xml b/java/res/xml/key_styles_enter.xml
similarity index 64%
rename from java/res/xml/key_styles_enter_phone.xml
rename to java/res/xml/key_styles_enter.xml
index af34cb8..4c31c3e 100644
--- a/java/res/xml/key_styles_enter_phone.xml
+++ b/java/res/xml/key_styles_enter.xml
@@ -21,6 +21,60 @@
 <merge
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
 >
+    <!-- Navigate more keys style -->
+    <switch>
+        <case
+            latin:imeAction="actionNext"
+            latin:navigatePrevious="true"
+        >
+            <key-style
+                latin:styleName="navigateMoreKeysStyle"
+                latin:keyLabelFlags="hasPopupHint|preserveCase"
+                latin:moreKeys="@string/action_previous_as_more_key" />
+        </case>
+        <case
+            latin:imeAction="actionPrevious"
+            latin:navigateNext="true"
+        >
+            <key-style
+                latin:styleName="navigateMoreKeysStyle"
+                latin:keyLabelFlags="hasPopupHint|preserveCase"
+                latin:moreKeys="@string/action_next_as_more_key" />
+        </case>
+        <!-- imeAction!="actionNext" and imeAction!="actionPrevious" -->
+        <case
+            latin:navigateNext="true"
+            latin:navigatePrevious="true"
+        >
+            <key-style
+                latin:styleName="navigateMoreKeysStyle"
+                latin:keyLabelFlags="hasPopupHint|preserveCase"
+                latin:moreKeys="!fixedColumnOrder!2,\@string/action_previous_as_more_key,\@string/action_next_as_more_key" />
+        </case>
+        <case
+            latin:navigateNext="true"
+            latin:navigatePrevious="false"
+        >
+            <key-style
+                latin:styleName="navigateMoreKeysStyle"
+                latin:keyLabelFlags="hasPopupHint|preserveCase"
+                latin:moreKeys="@string/action_next_as_more_key" />
+        </case>
+        <case
+            latin:navigateNext="false"
+            latin:navigatePrevious="true"
+        >
+            <key-style
+                latin:styleName="navigateMoreKeysStyle"
+                latin:keyLabelFlags="hasPopupHint|preserveCase"
+                latin:moreKeys="@string/action_previous_as_more_key" />
+        </case>
+        <!-- naviagteNext="false" and navigatePrevious="false" -->
+        <default>
+            <key-style
+                latin:styleName="navigateMoreKeysStyle" />
+        </default>
+    </switch>
     <!-- Enter key style -->
     <key-style
         latin:styleName="defaultEnterKeyStyle"
@@ -28,7 +82,8 @@
         latin:keyIcon="iconReturnKey"
         latin:keyLabelFlags="autoXScale|preserveCase"
         latin:keyActionFlags="noKeyPreview"
-        latin:backgroundType="functional" />
+        latin:backgroundType="functional"
+        latin:parentStyle="navigateMoreKeysStyle" />
     <key-style
         latin:styleName="defaultActionKeyStyle"
         latin:code="@integer/key_action_enter"
@@ -45,18 +100,6 @@
                 latin:styleName="enterKeyStyle"
                 latin:parentStyle="defaultEnterKeyStyle" />
         </case>
-        <!-- Smiley in textShortMessage field. -->
-        <case
-            latin:mode="im"
-        >
-            <key-style
-                latin:styleName="enterKeyStyle"
-                latin:keyLabel=":-)"
-                latin:keyOutputText=":-) "
-                latin:keyLabelFlags="hasPopupHint"
-                latin:moreKeys="@string/more_keys_for_smiley"
-                latin:backgroundType="functional" />
-        </case>
         <case
             latin:imeAction="actionGo"
         >
diff --git a/java/res/xml/key_styles_enter_tablet.xml b/java/res/xml/key_styles_enter_tablet.xml
deleted file mode 100644
index 7020891..0000000
--- a/java/res/xml/key_styles_enter_tablet.xml
+++ /dev/null
@@ -1,111 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
-**
-** Copyright 2012, 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"
->
-    <!-- Enter key style -->
-    <key-style
-        latin:styleName="defaultEnterKeyStyle"
-        latin:code="@integer/key_enter"
-        latin:keyIcon="iconReturnKey"
-        latin:keyLabelFlags="autoXScale|preserveCase"
-        latin:keyActionFlags="noKeyPreview"
-        latin:backgroundType="functional" />
-    <key-style
-        latin:styleName="defaultActionKeyStyle"
-        latin:code="@integer/key_action_enter"
-        latin:keyIcon="iconUndefined"
-        latin:backgroundType="action"
-        latin:parentStyle="defaultEnterKeyStyle" />
-    <switch>
-        <!-- Shift + Enter in textMultiLine field. -->
-        <case
-            latin:isMultiLine="true"
-            latin:keyboardSetElement="alphabetManualShifted|alphabetShiftLockShifted"
-        >
-            <key-style
-                latin:styleName="enterKeyStyle"
-                latin:parentStyle="defaultEnterKeyStyle" />
-        </case>
-        <case
-            latin:imeAction="actionGo"
-        >
-            <key-style
-                latin:styleName="enterKeyStyle"
-                latin:keyLabel="@string/label_go_key"
-                latin:parentStyle="defaultActionKeyStyle" />
-        </case>
-        <case
-            latin:imeAction="actionNext"
-        >
-            <key-style
-                latin:styleName="enterKeyStyle"
-                latin:keyLabel="@string/label_next_key"
-                latin:parentStyle="defaultActionKeyStyle" />
-        </case>
-        <case
-            latin:imeAction="actionPrevious"
-        >
-            <key-style
-                latin:styleName="enterKeyStyle"
-                latin:keyLabel="@string/label_previous_key"
-                latin:parentStyle="defaultActionKeyStyle" />
-        </case>
-        <case
-            latin:imeAction="actionDone"
-        >
-            <key-style
-                latin:styleName="enterKeyStyle"
-                latin:keyLabel="@string/label_done_key"
-                latin:parentStyle="defaultActionKeyStyle" />
-        </case>
-        <case
-            latin:imeAction="actionSend"
-        >
-            <key-style
-                latin:styleName="enterKeyStyle"
-                latin:keyLabel="@string/label_send_key"
-                latin:parentStyle="defaultActionKeyStyle" />
-        </case>
-        <case
-            latin:imeAction="actionSearch"
-        >
-            <key-style
-                latin:styleName="enterKeyStyle"
-                latin:keyIcon="iconSearchKey"
-                latin:parentStyle="defaultActionKeyStyle" />
-        </case>
-        <case
-            latin:imeAction="actionCustomLabel"
-        >
-            <key-style
-                latin:styleName="enterKeyStyle"
-                latin:keyLabelFlags="fromCustomActionLabel"
-                latin:parentStyle="defaultActionKeyStyle" />
-        </case>
-        <!-- imeAction is either actionNone or actionUnspecified. -->
-        <default>
-            <key-style
-                latin:styleName="enterKeyStyle"
-                latin:parentStyle="defaultEnterKeyStyle" />
-        </default>
-    </switch>
-</merge>
diff --git a/java/res/xml/key_symbols_f1.xml b/java/res/xml/key_symbols_f1.xml
deleted file mode 100644
index ac4031f..0000000
--- a/java/res/xml/key_symbols_f1.xml
+++ /dev/null
@@ -1,67 +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"
->
-    <switch>
-        <case
-            latin:navigateAction="false"
-        >
-            <switch>
-                <case
-                    latin:hasShortcutKey="true"
-                >
-                    <Key
-                        latin:keyStyle="shortcutKeyStyle" />
-                </case>
-                <!-- latin:hasShortcutKey="false" -->
-                <default>
-                    <Key
-                        latin:keyLabel="@string/keylabel_for_comma"
-                        latin:keyLabelFlags="hasPopupHint"
-                        latin:additionalMoreKeys="@string/more_keys_for_comma"
-                        latin:keyStyle="f1PopupStyle" />
-                </default>
-            </switch>
-        </case>
-        <!-- navigateAction="true" -->
-        <default>
-            <switch>
-                <case
-                    latin:hasShortcutKey="true"
-                >
-                    <Key
-                        latin:keyStyle="shortcutKeyStyle"
-                        latin:keyWidth="9.2%p" />
-                </case>
-                <!-- latin:hasShortcutKey="false" -->
-                <default>
-                    <Key
-                        latin:keyLabel="@string/keylabel_for_comma"
-                        latin:keyLabelFlags="hasPopupHint"
-                        latin:additionalMoreKeys="@string/more_keys_for_comma"
-                        latin:keyStyle="f1PopupStyle"
-                        latin:keyWidth="9.2%p" />
-                    </default>
-            </switch>
-        </default>
-    </switch>
-</merge>
diff --git a/java/res/xml/row_qwerty4.xml b/java/res/xml/row_qwerty4.xml
index 2f8b82c..df9c8fe 100644
--- a/java/res/xml/row_qwerty4.xml
+++ b/java/res/xml/row_qwerty4.xml
@@ -24,44 +24,46 @@
     <Row
         latin:keyWidth="10%p"
     >
+        <Key
+            latin:keyStyle="toSymbolKeyStyle"
+            latin:keyWidth="15%p" />
         <switch>
             <case
-                latin:navigateAction="false"
+                latin:mode="url"
             >
                 <Key
-                    latin:keyStyle="toSymbolKeyStyle"
-                    latin:keyWidth="15%p" />
-                <include
-                    latin:keyboardLayout="@xml/key_f1" />
-                <Key
-                    latin:keyStyle="spaceKeyStyle"
-                    latin:keyWidth="50%p" />
-                <Key
-                    latin:keyStyle="punctuationKeyStyle" />
-                <Key
-                    latin:keyStyle="enterKeyStyle"
-                    latin:keyWidth="fillRight" />
+                    latin:keyLabel="/"
+                    latin:keyStyle="f1MoreKeysStyle" />
             </case>
-            <!-- TODO: Remove dedicated navigation tab key. -->
-            <!-- navigateAction="true" -->
+            <case
+                latin:mode="email"
+            >
+                <Key
+                    latin:keyLabel="\@"
+                    latin:keyStyle="f1MoreKeysStyle" />
+            </case>
+            <case
+                latin:hasShortcutKey="true"
+            >
+                <Key
+                    latin:keyStyle="shortcutKeyStyle" />
+            </case>
+            <!-- latin:hasShortcutKey="false" -->
             <default>
                 <Key
-                    latin:keyStyle="toSymbolKeyStyle"
-                    latin:keyWidth="13.75%p" />
-                <include
-                    latin:keyboardLayout="@xml/key_navigation_tab" />
-                <include
-                    latin:keyboardLayout="@xml/key_f1" />
-                <Key
-                    latin:keyStyle="spaceKeyStyle"
-                    latin:keyWidth="35.83%p" />
-                <Key
-                    latin:keyStyle="punctuationKeyStyle"
-                    latin:keyWidth="9.2%p" />
-                <Key
-                    latin:keyStyle="enterKeyStyle"
-                    latin:keyWidth="fillRight" />
+                    latin:keyLabel="@string/keylabel_for_comma"
+                    latin:keyLabelFlags="hasPopupHint"
+                    latin:additionalMoreKeys="@string/more_keys_for_comma"
+                    latin:keyStyle="f1MoreKeysStyle" />
             </default>
         </switch>
+        <Key
+            latin:keyStyle="spaceKeyStyle"
+            latin:keyWidth="50%p" />
+        <Key
+            latin:keyStyle="punctuationKeyStyle" />
+        <Key
+            latin:keyStyle="enterKeyStyle"
+            latin:keyWidth="fillRight" />
     </Row>
 </merge>
diff --git a/java/res/xml/row_symbols4.xml b/java/res/xml/row_symbols4.xml
deleted file mode 100644
index ef77bc3..0000000
--- a/java/res/xml/row_symbols4.xml
+++ /dev/null
@@ -1,67 +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"
->
-    <Row
-        latin:keyWidth="10%p"
-    >
-        <switch>
-            <case
-                latin:navigateAction="false"
-            >
-                <Key
-                    latin:keyStyle="toAlphaKeyStyle"
-                    latin:keyWidth="15%p" />
-                <include
-                    latin:keyboardLayout="@xml/key_symbols_f1" />
-                <Key
-                    latin:keyStyle="spaceKeyStyle"
-                    latin:keyWidth="50%p" />
-                <Key
-                    latin:keyStyle="punctuationKeyStyle" />
-                <Key
-                    latin:keyStyle="enterKeyStyle"
-                    latin:keyWidth="fillRight" />
-            </case>
-            <!-- TODO: Remove dedicated navigation tab key. -->
-            <!-- navigateAction="true" -->
-            <default>
-                <Key
-                    latin:keyStyle="toAlphaKeyStyle"
-                    latin:keyWidth="13.75%p" />
-                <include
-                    latin:keyboardLayout="@xml/key_navigation_tab" />
-                <include
-                    latin:keyboardLayout="@xml/key_f1" />
-                <Key
-                    latin:keyStyle="spaceKeyStyle"
-                    latin:keyWidth="35.83%p" />
-                <Key
-                    latin:keyStyle="punctuationKeyStyle"
-                    latin:keyWidth="9.2%p" />
-                <Key
-                    latin:keyStyle="enterKeyStyle"
-                    latin:keyWidth="fillRight" />
-            </default>
-        </switch>
-    </Row>
-</merge>
diff --git a/java/res/xml/row_symbols_shift4.xml b/java/res/xml/row_symbols_shift4.xml
deleted file mode 100644
index 632aafc..0000000
--- a/java/res/xml/row_symbols_shift4.xml
+++ /dev/null
@@ -1,84 +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"
->
-    <Row
-        latin:keyWidth="10%p"
-    >
-        <switch>
-            <case
-                latin:navigateAction="false"
-            >
-                <Key
-                    latin:keyStyle="toAlphaKeyStyle"
-                    latin:keyWidth="15%p" />
-                <!-- U+201F: "‟" DOUBLE HIGH-REVERSED-9 QUOTATION MARK -->
-                <!-- TODO: Neither DroidSans nor Roboto have the glyph for U+201F DOUBLE HIGH-REVERSED-9 QUOTATION MARK. -->
-                    <!-- latin:keyLabelFlags="hasPopupHint" -->
-                    <!-- latin:moreKeys="&#x201F;" -->
-                <!-- U+201E: "„" DOUBLE LOW-9 QUOTATION MARK -->
-                <Key
-                    latin:keyLabel="&#x201E;"
-                    latin:backgroundType="functional" />
-                <Key
-                    latin:keyStyle="spaceKeyStyle"
-                    latin:keyWidth="50%p" />
-                <!-- U+2026: "…" HORIZONTAL ELLIPSIS -->
-                <Key
-                    latin:keyLabel="&#x2026;"
-                    latin:backgroundType="functional" />
-                <Key
-                    latin:keyStyle="enterKeyStyle"
-                    latin:keyWidth="fillRight" />
-            </case>
-            <!-- TODO: Remove dedicated navigation tab key. -->
-            <!-- navigateAction="true" -->
-            <default>
-                <Key
-                    latin:keyStyle="toAlphaKeyStyle"
-                    latin:keyWidth="13.75%p" />
-                <include
-                    latin:keyboardLayout="@xml/key_navigation_tab" />
-                <!-- U+201F: "‟" DOUBLE HIGH-REVERSED-9 QUOTATION MARK -->
-                <!-- TODO: Neither DroidSans nor Roboto have the glyph for U+201F DOUBLE HIGH-REVERSED-9 QUOTATION MARK. -->
-                    <!-- latin:keyLabelFlags="hasPopupHint" -->
-                    <!-- latin:moreKeys="&#x201F;" -->
-                <!-- U+201E: "„" DOUBLE LOW-9 QUOTATION MARK -->
-                <Key
-                    latin:keyLabel="&#x201E;"
-                    latin:keyWidth="9.2%p"
-                    latin:backgroundType="functional" />
-                <Key
-                    latin:keyStyle="spaceKeyStyle"
-                    latin:keyWidth="35.83%p" />
-                <!-- U+2026: "…" HORIZONTAL ELLIPSIS -->
-                <Key
-                    latin:keyLabel="&#x2026;"
-                    latin:keyWidth="9.2%p"
-                    latin:backgroundType="functional" />
-                <Key
-                    latin:keyStyle="enterKeyStyle"
-                    latin:keyWidth="fillRight" />
-            </default>
-        </switch>
-    </Row>
-</merge>
diff --git a/java/res/xml/rows_symbols.xml b/java/res/xml/rows_symbols.xml
index 27f75b5..21f7d1d 100644
--- a/java/res/xml/rows_symbols.xml
+++ b/java/res/xml/rows_symbols.xml
@@ -128,6 +128,35 @@
             latin:keyWidth="fillRight"
             latin:visualInsetsLeft="1%p" />
     </Row>
-    <include
-        latin:keyboardLayout="@xml/row_symbols4" />
+    <Row
+        latin:keyWidth="10%p"
+    >
+        <Key
+            latin:keyStyle="toAlphaKeyStyle"
+            latin:keyWidth="15%p" />
+        <switch>
+            <case
+                latin:hasShortcutKey="true"
+            >
+                <Key
+                    latin:keyStyle="shortcutKeyStyle" />
+            </case>
+            <!-- latin:hasShortcutKey="false" -->
+            <default>
+                <Key
+                    latin:keyLabel="@string/keylabel_for_comma"
+                    latin:keyLabelFlags="hasPopupHint"
+                    latin:additionalMoreKeys="@string/more_keys_for_comma"
+                    latin:keyStyle="f1MoreKeysStyle" />
+            </default>
+        </switch>
+        <Key
+            latin:keyStyle="spaceKeyStyle"
+            latin:keyWidth="50%p" />
+        <Key
+            latin:keyStyle="punctuationKeyStyle" />
+        <Key
+            latin:keyStyle="enterKeyStyle"
+            latin:keyWidth="fillRight" />
+    </Row>
 </merge>
diff --git a/java/res/xml/rows_symbols_shift.xml b/java/res/xml/rows_symbols_shift.xml
index 3fb8214..a7d0499 100644
--- a/java/res/xml/rows_symbols_shift.xml
+++ b/java/res/xml/rows_symbols_shift.xml
@@ -119,6 +119,29 @@
             latin:keyWidth="fillRight"
             latin:visualInsetsLeft="1%p" />
     </Row>
-    <include
-        latin:keyboardLayout="@xml/row_symbols_shift4" />
+    <Row
+        latin:keyWidth="10%p"
+    >
+        <Key
+            latin:keyStyle="toAlphaKeyStyle"
+            latin:keyWidth="15%p" />
+        <!-- U+201F: "‟" DOUBLE HIGH-REVERSED-9 QUOTATION MARK -->
+        <!-- TODO: Neither DroidSans nor Roboto have the glyph for U+201F DOUBLE HIGH-REVERSED-9 QUOTATION MARK. -->
+        <!-- latin:keyLabelFlags="hasPopupHint" -->
+        <!-- latin:moreKeys="&#x201F;" -->
+        <!-- U+201E: "„" DOUBLE LOW-9 QUOTATION MARK -->
+        <Key
+            latin:keyLabel="&#x201E;"
+            latin:backgroundType="functional" />
+        <Key
+            latin:keyStyle="spaceKeyStyle"
+            latin:keyWidth="50%p" />
+        <!-- U+2026: "…" HORIZONTAL ELLIPSIS -->
+        <Key
+            latin:keyLabel="&#x2026;"
+            latin:backgroundType="functional" />
+        <Key
+            latin:keyStyle="enterKeyStyle"
+            latin:keyWidth="fillRight" />
+    </Row>
 </merge>