Fix the bottom row of tablet keyboard layout

This CL eliminates "_" and "/" keys from the bottom row of tablet
keyboard.  This CL also reorganizes the bottom row of tablet Dvorak
keyboard.

Bug: 16603887
Change-Id: Ic1570836dea1a475bed5d43aeb6a351507bf5428
diff --git a/java/res/xml/key_f1.xml b/java/res/xml/key_comma.xml
similarity index 82%
rename from java/res/xml/key_f1.xml
rename to java/res/xml/key_comma.xml
index 7bd7385..cf919a8 100644
--- a/java/res/xml/key_f1.xml
+++ b/java/res/xml/key_comma.xml
@@ -23,6 +23,15 @@
 >
     <switch>
         <case
+            latin:keyboardLayoutSet="dvorak"
+        >
+            <Key
+                latin:keySpec="q"
+                latin:moreKeys="!text/morekeys_q,%"
+                latin:backgroundType="normal"
+                latin:keyStyle="settingsMoreKeysStyle" />
+        </case>
+        <case
             latin:mode="url"
         >
             <Key
diff --git a/java/res/xml/key_f2.xml b/java/res/xml/key_emoji.xml
similarity index 100%
rename from java/res/xml/key_f2.xml
rename to java/res/xml/key_emoji.xml
diff --git a/java/res/xml/key_period.xml b/java/res/xml/key_period.xml
index e1d4bbd..fc27c02 100644
--- a/java/res/xml/key_period.xml
+++ b/java/res/xml/key_period.xml
@@ -48,6 +48,14 @@
                 latin:moreKeys="!text/morekeys_punctuation"
                 latin:backgroundType="functional" />
         </case>
+        <case
+            latin:keyboardLayoutSet="dvorak"
+        >
+            <Key
+                latin:keySpec="z"
+                latin:keyLabelFlags="hasPopupHint"
+                latin:moreKeys="!text/morekeys_punctuation,!text/morekeys_z" />
+        </case>
         <default>
             <Key
                 latin:keySpec="!text/keyspec_period"
diff --git a/java/res/xml/key_styles_common.xml b/java/res/xml/key_styles_common.xml
index 2d006c9..167e6f8 100644
--- a/java/res/xml/key_styles_common.xml
+++ b/java/res/xml/key_styles_common.xml
@@ -36,6 +36,8 @@
         </default>
     </switch>
     <!-- Base key style for the key which may have settings key as more keys. -->
+    <key-style
+        latin:styleName="baseSettingsMoreKeysStyle" />
     <include
         latin:keyboardLayout="@xml/key_styles_settings" />
     <!-- Functional key styles -->
diff --git a/java/res/xml/key_styles_settings.xml b/java/res/xml/key_styles_settings.xml
index 956b402..a504bed 100644
--- a/java/res/xml/key_styles_settings.xml
+++ b/java/res/xml/key_styles_settings.xml
@@ -29,15 +29,17 @@
         >
             <key-style
                 latin:styleName="settingsMoreKeysStyle"
-                latin:backgroundType="functional" />
+                latin:backgroundType="functional"
+                latin:parentStyle="baseSettingsMoreKeysStyle" />
         </case>
         <!-- clobberSettingsKey="false" -->
         <default>
             <key-style
                 latin:styleName="settingsMoreKeysStyle"
                 latin:keyLabelFlags="hasPopupHint"
-                latin:moreKeys="!text/keyspec_settings"
-                latin:backgroundType="functional" />
+                latin:additionalMoreKeys="!text/keyspec_settings"
+                latin:backgroundType="functional"
+                latin:parentStyle="baseSettingsMoreKeysStyle" />
         </default>
     </switch>
 </merge>
diff --git a/java/res/xml/row_dvorak4.xml b/java/res/xml/row_dvorak4.xml
deleted file mode 100644
index e7a3ee7..0000000
--- a/java/res/xml/row_dvorak4.xml
+++ /dev/null
@@ -1,45 +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"
->
-    <Row
-        latin:keyWidth="10%p"
-    >
-        <Key
-            latin:keyStyle="toSymbolKeyStyle"
-            latin:keyWidth="15%p" />
-        <Key
-            latin:keySpec="q"
-            latin:backgroundType="normal"
-            latin:keyStyle="settingsMoreKeysStyle" />
-        <include
-            latin:keyXPos="25%p"
-            latin:keyboardLayout="@xml/key_space_5kw" />
-        <Key
-            latin:keySpec="z"
-            latin:keyLabelFlags="hasPopupHint"
-            latin:moreKeys="!text/morekeys_punctuation,!text/morekeys_z" />
-        <Key
-            latin:keyStyle="enterKeyStyle"
-            latin:keyWidth="fillRight" />
-    </Row>
-</merge>
diff --git a/java/res/xml/row_qwerty4.xml b/java/res/xml/row_qwerty4.xml
index 509092d..5bc104f 100644
--- a/java/res/xml/row_qwerty4.xml
+++ b/java/res/xml/row_qwerty4.xml
@@ -28,7 +28,7 @@
             latin:keyStyle="toSymbolKeyStyle"
             latin:keyWidth="15%p" />
         <include
-            latin:keyboardLayout="@xml/key_f1" />
+            latin:keyboardLayout="@xml/key_comma" />
         <include
             latin:keyXPos="25%p"
             latin:keyboardLayout="@xml/key_space_5kw" />
diff --git a/java/res/xml/rows_dvorak.xml b/java/res/xml/rows_dvorak.xml
index 13d7021..f656613 100644
--- a/java/res/xml/rows_dvorak.xml
+++ b/java/res/xml/rows_dvorak.xml
@@ -49,6 +49,8 @@
             latin:keyWidth="fillRight"
             latin:visualInsetsLeft="1%p" />
     </Row>
+    <!-- Dvorak layout shares almost the same row with Qwerty layout.
+         The difference is defined in xml/row_qwerty4.xml. -->
     <include
-        latin:keyboardLayout="@xml/row_dvorak4" />
+        latin:keyboardLayout="@xml/row_qwerty4" />
 </merge>