Microphone key on 7-inch tablet on the far right vs where it is on phones

Bug: 6568834
Change-Id: If48635ead60dc119656f1b10c9b05a1918ebd668
diff --git a/java/res/xml-sw600dp/key_apostrophe.xml b/java/res/xml-sw600dp/key_apostrophe.xml
index 7da4b62..0c838db 100644
--- a/java/res/xml-sw600dp/key_apostrophe.xml
+++ b/java/res/xml-sw600dp/key_apostrophe.xml
@@ -23,20 +23,11 @@
 >
     <switch>
         <case
-            latin:mode="email"
+            latin:mode="email|url"
         >
             <Key
                 latin:keyLabel="-" />
         </case>
-        <case
-            latin:mode="url"
-        >
-            <Key
-                latin:keyLabel="/"
-                latin:keyHintLabel=":"
-                latin:moreKeys=":"
-                latin:keyStyle="hasShiftedLetterHintStyle" />
-        </case>
         <default>
             <Key
                 latin:keyLabel="!text/keylabel_for_apostrophe"
diff --git a/java/res/xml-sw600dp/key_dash.xml b/java/res/xml-sw600dp/key_dash.xml
index f7e0b34..8f91eff 100644
--- a/java/res/xml-sw600dp/key_dash.xml
+++ b/java/res/xml-sw600dp/key_dash.xml
@@ -23,7 +23,7 @@
 >
     <switch>
         <case
-            latin:mode="email"
+            latin:mode="email|url"
         >
             <Key
                 latin:keyLabel="_" />
diff --git a/java/res/xml-sw600dp/key_f1.xml b/java/res/xml-sw600dp/key_f1.xml
new file mode 100644
index 0000000..77afe4e
--- /dev/null
+++ b/java/res/xml-sw600dp/key_f1.xml
@@ -0,0 +1,62 @@
+<?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"
+>
+    <switch>
+        <case
+            latin:keyboardLayoutSetElement="symbols"
+            latin:mode="url"
+        >
+            <Key
+                latin:keyLabel=":" />
+        </case>
+        <case
+            latin:keyboardLayoutSetElement="symbols"
+        >
+            <Key
+                latin:keyLabel="\@" />
+        </case>
+        <!-- keyboardLayoutSetElement != "symbols" -->
+        <case
+            latin:mode="email"
+        >
+            <Key
+                latin:keyLabel="\@" />
+        </case>
+        <case
+            latin:mode="url"
+        >
+            <Key
+                latin:keyLabel="/"
+                latin:keyHintLabel=":"
+                latin:moreKeys=":"
+                latin:keyStyle="hasShiftedLetterHintStyle" />
+        </case>
+        <default>
+            <Key
+                latin:keyLabel="/"
+                latin:keyHintLabel="\@"
+                latin:moreKeys="\@"
+                latin:keyStyle="hasShiftedLetterHintStyle" />
+        </default>
+    </switch>
+</merge>
diff --git a/java/res/xml-sw600dp/key_f2.xml b/java/res/xml-sw600dp/key_f2.xml
new file mode 100644
index 0000000..ca3b30b
--- /dev/null
+++ b/java/res/xml-sw600dp/key_f2.xml
@@ -0,0 +1,45 @@
+<?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"
+>
+    <switch>
+        <case
+            latin:mode="email|url"
+        >
+            <Key
+                latin:keyStyle="comKeyStyle" />
+        </case>
+        <case
+            latin:imeAction="actionSearch"
+        >
+            <Key
+                latin:keyLabel=":"
+                latin:keyHintLabel="+"
+                latin:moreKeys="+"
+                latin:keyStyle="hasShiftedLetterHintStyle" />
+        </case>
+        <default>
+            <Key
+                latin:keyStyle="smileyKeyStyle" />
+        </default>
+    </switch>
+</merge>
diff --git a/java/res/xml-sw600dp/key_question_exclamation.xml b/java/res/xml-sw600dp/key_question_exclamation.xml
index f1495de..860a0be 100644
--- a/java/res/xml-sw600dp/key_question_exclamation.xml
+++ b/java/res/xml-sw600dp/key_question_exclamation.xml
@@ -23,20 +23,11 @@
 >
     <switch>
         <case
-            latin:mode="email"
+            latin:mode="email|url"
         >
             <Key
                 latin:keyLabel="-" />
         </case>
-        <case
-            latin:mode="url"
-        >
-            <Key
-                latin:keyLabel="/"
-                latin:keyHintLabel=":"
-                latin:moreKeys=":"
-                latin:keyStyle="hasShiftedLetterHintStyle" />
-        </case>
         <default>
             <Key
                 latin:keyLabel="\?"
diff --git a/java/res/xml-sw600dp/keys_f1f2.xml b/java/res/xml-sw600dp/keys_f1f2.xml
deleted file mode 100644
index 721bfc7..0000000
--- a/java/res/xml-sw600dp/keys_f1f2.xml
+++ /dev/null
@@ -1,71 +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"
->
-    <switch>
-        <case
-            latin:mode="url"
-        >
-            <Key
-                latin:keyStyle="comKeyStyle"
-                latin:keyWidth="18.0%p" />
-        </case>
-        <default>
-            <switch>
-                <case
-                    latin:mode="email"
-                >
-                    <Key
-                        latin:keyStyle="comKeyStyle" />
-                </case>
-                <case
-                    latin:imeAction="actionSearch"
-                >
-                    <Key
-                        latin:keyLabel=":"
-                        latin:keyHintLabel="+"
-                        latin:moreKeys="+"
-                        latin:keyStyle="hasShiftedLetterHintStyle" />
-                </case>
-                <default>
-                    <Key
-                        latin:keyStyle="smileyKeyStyle" />
-                </default>
-            </switch>
-            <switch>
-                <case
-                    latin:mode="email"
-                >
-                    <Key
-                        latin:keyLabel="\@" />
-                </case>
-                <default>
-                    <Key
-                        latin:keyLabel="/"
-                        latin:keyHintLabel="\@"
-                        latin:moreKeys="\@"
-                        latin:keyStyle="hasShiftedLetterHintStyle" />
-                </default>
-            </switch>
-        </default>
-    </switch>
-</merge>
diff --git a/java/res/xml-sw600dp/row_dvorak4.xml b/java/res/xml-sw600dp/row_dvorak4.xml
index ffc3427..47cee45 100644
--- a/java/res/xml-sw600dp/row_dvorak4.xml
+++ b/java/res/xml-sw600dp/row_dvorak4.xml
@@ -23,22 +23,24 @@
 >
     <Row
         latin:keyWidth="9.0%p"
+        backgroundType="functional"
     >
         <Key
             latin:keyStyle="toSymbolKeyStyle"
             latin:keyWidth="10.0%p" />
         <include
-            latin:keyboardLayout="@xml/keys_f1f2" />
+            latin:keyboardLayout="@xml/key_shortcut" />
+        <include
+            latin:keyboardLayout="@xml/key_f1" />
         <include
             latin:keyXPos="28.0%p"
-            latin:keyboardLayout="@xml/key_space" />
+            latin:keyboardLayout="@xml/key_space"
+            latin:backgroundType="normal" />
         <include
             latin:keyboardLayout="@xml/key_question_exclamation" />
         <include
             latin:keyboardLayout="@xml/key_dash" />
         <include
-            latin:keyXPos="-9.0%p"
-            latin:keyWidth="fillRight"
-            latin:keyboardLayout="@xml/key_shortcut" />
+            latin:keyboardLayout="@xml/key_f2" />
     </Row>
 </merge>
diff --git a/java/res/xml-sw600dp/row_hebrew4.xml b/java/res/xml-sw600dp/row_hebrew4.xml
index 114a5cc..f429f97 100644
--- a/java/res/xml-sw600dp/row_hebrew4.xml
+++ b/java/res/xml-sw600dp/row_hebrew4.xml
@@ -23,20 +23,22 @@
 >
     <Row
         latin:keyWidth="9.0%p"
+        latin:backgroundType="functional"
     >
         <Key
             latin:keyStyle="toSymbolKeyStyle"
             latin:keyWidth="10.0%p" />
         <include
-            latin:keyboardLayout="@xml/keys_f1f2" />
+            latin:keyboardLayout="@xml/key_shortcut" />
+        <include
+            latin:keyboardLayout="@xml/key_f1" />
         <include
             latin:keyXPos="28.0%p"
-            latin:keyboardLayout="@xml/key_space" />
+            latin:keyboardLayout="@xml/key_space"
+            latin:backgroundType="normal" />
         <include
             latin:keyboardLayout="@xml/keys_comma_period" />
         <include
-            latin:keyXPos="-9.0%p"
-            latin:keyWidth="fillRight"
-            latin:keyboardLayout="@xml/key_shortcut" />
+            latin:keyboardLayout="@xml/key_f2" />
     </Row>
 </merge>
diff --git a/java/res/xml-sw600dp/row_qwerty4.xml b/java/res/xml-sw600dp/row_qwerty4.xml
index a4ba8a4..fa43363 100644
--- a/java/res/xml-sw600dp/row_qwerty4.xml
+++ b/java/res/xml-sw600dp/row_qwerty4.xml
@@ -23,22 +23,24 @@
 >
     <Row
         latin:keyWidth="9.0%p"
+        latin:backgroundType="functional"
     >
         <Key
             latin:keyStyle="toSymbolKeyStyle"
             latin:keyWidth="10.0%p" />
         <include
-            latin:keyboardLayout="@xml/keys_f1f2" />
+            latin:keyboardLayout="@xml/key_shortcut" />
+        <include
+            latin:keyboardLayout="@xml/key_f1" />
         <include
             latin:keyXPos="28.0%p"
-            latin:keyboardLayout="@xml/key_space" />
+            latin:keyboardLayout="@xml/key_space"
+            latin:backgroundType="normal" />
         <include
             latin:keyboardLayout="@xml/key_apostrophe" />
         <include
             latin:keyboardLayout="@xml/key_dash" />
         <include
-            latin:keyXPos="-9.0%p"
-            latin:keyWidth="fillRight"
-            latin:keyboardLayout="@xml/key_shortcut" />
+            latin:keyboardLayout="@xml/key_f2" />
     </Row>
 </merge>
diff --git a/java/res/xml-sw600dp/row_symbols4.xml b/java/res/xml-sw600dp/row_symbols4.xml
index 20d1a7d..73a5b17 100644
--- a/java/res/xml-sw600dp/row_symbols4.xml
+++ b/java/res/xml-sw600dp/row_symbols4.xml
@@ -23,25 +23,24 @@
 >
     <Row
         latin:keyWidth="9.0%p"
+        latin:backgroundType="functional"
     >
         <Key
             latin:keyStyle="toAlphaKeyStyle"
             latin:keyWidth="10.0%p" />
         <Key
             latin:keyLabel="/" />
-        <Key
-            latin:keyLabel="\@" />
+        <include
+            latin:keyboardLayout="@xml/key_f1" />
         <include
             latin:keyXPos="28.0%p"
-            latin:keyboardLayout="@xml/key_space" />
+            latin:keyboardLayout="@xml/key_space"
+            latin:backgroundType="normal" />
         <Key
             latin:keyLabel="&quot;"
             latin:moreKeys="!text/more_keys_for_tablet_double_quote" />
         <Key
             latin:keyLabel="_" />
-        <include
-            latin:keyXPos="-9.0%p"
-            latin:keyWidth="fillRight"
-            latin:keyboardLayout="@xml/key_shortcut" />
+        <!-- Here is empty space. -->
     </Row>
 </merge>
diff --git a/java/res/xml-sw600dp/row_symbols_shift4.xml b/java/res/xml-sw600dp/row_symbols_shift4.xml
index fd7b370..6f3aac7 100644
--- a/java/res/xml-sw600dp/row_symbols_shift4.xml
+++ b/java/res/xml-sw600dp/row_symbols_shift4.xml
@@ -23,16 +23,16 @@
 >
     <Row
         latin:keyWidth="9.0%p"
+        latin:backgroundType="functional"
     >
         <Key
             latin:keyStyle="toAlphaKeyStyle"
             latin:keyWidth="10.0%p" />
+        <!-- Here is empty space. -->
         <include
             latin:keyXPos="28.0%p"
-            latin:keyboardLayout="@xml/key_space" />
-        <include
-            latin:keyXPos="-9.0%p"
-            latin:keyWidth="fillRight"
-            latin:keyboardLayout="@xml/key_shortcut" />
+            latin:keyboardLayout="@xml/key_space"
+            latin:backgroundType="normal" />
+        <!-- Here is empty space. -->
     </Row>
 </merge>
diff --git a/java/res/xml-sw600dp/rows_number_normal.xml b/java/res/xml-sw600dp/rows_number_normal.xml
index 3954b00..48b3040 100644
--- a/java/res/xml-sw600dp/rows_number_normal.xml
+++ b/java/res/xml-sw600dp/rows_number_normal.xml
@@ -25,15 +25,18 @@
         <Key
             latin:keyLabel="-"
             latin:keyStyle="numKeyStyle"
-            latin:keyWidth="10%p" />
+            latin:keyWidth="10%p"
+            latin:backgroundType="functional" />
         <Key
             latin:keyLabel="+"
             latin:keyStyle="numKeyStyle"
-            latin:keyWidth="10%p" />
+            latin:keyWidth="10%p"
+            latin:backgroundType="functional" />
         <Key
             latin:keyLabel="."
             latin:keyStyle="numKeyStyle"
-            latin:keyWidth="10%p" />
+            latin:keyWidth="10%p"
+            latin:backgroundType="functional" />
         <Key
             latin:keyLabel="1"
             latin:keyStyle="numKeyStyle"
@@ -52,11 +55,13 @@
     <Row>
         <Key
             latin:keyStyle="numStarKeyStyle"
-            latin:keyWidth="10%p" />
+            latin:keyWidth="10%p"
+            latin:backgroundType="functional" />
         <Key
             latin:keyLabel="/"
             latin:keyStyle="numKeyStyle"
-            latin:keyWidth="10%p" />
+            latin:keyWidth="10%p"
+            latin:backgroundType="functional" />
         <switch>
             <case
                 latin:mode="time|datetime"
@@ -66,13 +71,15 @@
                     latin:keyLabelFlags="hasPopupHint"
                     latin:moreKeys="!text/more_keys_for_am_pm"
                     latin:keyStyle="numKeyStyle"
-                    latin:keyWidth="10%p" />
+                    latin:keyWidth="10%p"
+                    latin:backgroundType="functional" />
             </case>
             <default>
                 <Key
                     latin:keyLabel=","
                     latin:keyStyle="numKeyStyle"
-                    latin:keyWidth="10%p" />
+                    latin:keyWidth="10%p"
+                    latin:backgroundType="functional" />
             </default>
         </switch>
         <Key
@@ -94,11 +101,13 @@
         <Key
             latin:keyLabel="("
             latin:keyStyle="numKeyStyle"
-            latin:keyWidth="10%p" />
+            latin:keyWidth="10%p"
+            latin:backgroundType="functional" />
         <Key
             latin:keyLabel=")"
             latin:keyStyle="numKeyStyle"
-            latin:keyWidth="10%p" />
+            latin:keyWidth="10%p"
+            latin:backgroundType="functional" />
         <switch>
             <case
                 latin:mode="time|datetime"
@@ -106,13 +115,15 @@
                 <Key
                     latin:keyLabel=":"
                     latin:keyStyle="numKeyStyle"
-                    latin:keyWidth="10%p" />
+                    latin:keyWidth="10%p"
+                    latin:backgroundType="functional" />
             </case>
             <default>
                 <Key
                     latin:keyLabel="="
                     latin:keyStyle="numKeyStyle"
-                    latin:keyWidth="10%p" />
+                    latin:keyWidth="10%p"
+                    latin:backgroundType="functional" />
             </default>
         </switch>
         <Key
@@ -131,7 +142,8 @@
     <Row>
         <Key
             latin:keyStyle="spaceKeyStyle"
-            latin:keyWidth="30%p" />
+            latin:keyWidth="30%p"
+            latin:backgroundType="functional" />
         <Key
             latin:keyStyle="numStarKeyStyle"
             latin:keyXPos="31%p" />
@@ -141,9 +153,5 @@
         <Key
             latin:keyLabel="#"
             latin:keyStyle="numKeyStyle" />
-        <include
-            latin:keyXPos="-10%p"
-            latin:keyWidth="fillRight"
-            latin:keyboardLayout="@xml/key_shortcut" />
     </Row>
 </merge>
diff --git a/java/res/xml-sw600dp/rows_phone.xml b/java/res/xml-sw600dp/rows_phone.xml
index 113ce1f..dcc4fde 100644
--- a/java/res/xml-sw600dp/rows_phone.xml
+++ b/java/res/xml-sw600dp/rows_phone.xml
@@ -29,14 +29,17 @@
         <Key
             latin:keyLabel="-"
             latin:keyStyle="numKeyStyle"
-            latin:keyWidth="10%p" />
+            latin:keyWidth="10%p"
+            latin:backgroundType="functional" />
         <Key
             latin:keyLabel="+"
             latin:keyStyle="numKeyStyle"
-            latin:keyWidth="10%p" />
+            latin:keyWidth="10%p"
+            latin:backgroundType="functional" />
         <Key
             latin:keyStyle="numPauseKeyStyle"
-            latin:keyWidth="10%p" />
+            latin:keyWidth="10%p"
+            latin:backgroundType="functional" />
         <Key
             latin:keyStyle="num1KeyStyle"
             latin:keyXPos="31%p" />
@@ -53,14 +56,17 @@
         <Key
             latin:keyLabel=","
             latin:keyStyle="numKeyStyle"
-            latin:keyWidth="10%p" />
+            latin:keyWidth="10%p"
+            latin:backgroundType="functional" />
         <Key
             latin:keyLabel="."
             latin:keyStyle="numKeyStyle"
-            latin:keyWidth="10%p" />
+            latin:keyWidth="10%p"
+            latin:backgroundType="functional" />
         <Key
             latin:keyStyle="numWaitKeyStyle"
-            latin:keyWidth="10%p" />
+            latin:keyWidth="10%p"
+            latin:backgroundType="functional" />
         <Key
             latin:keyStyle="num4KeyStyle"
             latin:keyXPos="31%p" />
@@ -77,15 +83,18 @@
         <Key
             latin:keyLabel="("
             latin:keyStyle="numKeyStyle"
-            latin:keyWidth="10%p" />
+            latin:keyWidth="10%p"
+            latin:backgroundType="functional" />
         <Key
             latin:keyLabel=")"
             latin:keyStyle="numKeyStyle"
-            latin:keyWidth="10%p" />
+            latin:keyWidth="10%p"
+            latin:backgroundType="functional" />
         <Key
             latin:keyLabel="N"
             latin:keyStyle="numKeyStyle"
-            latin:keyWidth="10%p" />
+            latin:keyWidth="10%p"
+            latin:backgroundType="functional" />
         <Key
             latin:keyStyle="num7KeyStyle"
             latin:keyXPos="31%p" />
@@ -99,7 +108,8 @@
     <Row>
         <Key
             latin:keyStyle="spaceKeyStyle"
-            latin:keyWidth="30%p" />
+            latin:keyWidth="30%p"
+            latin:backgroundType="functional" />
         <Key
             latin:keyStyle="numStarKeyStyle"
             latin:keyXPos="31%p" />
@@ -108,9 +118,5 @@
         <Key
             latin:keyLabel="#"
             latin:keyStyle="numKeyStyle" />
-        <include
-            latin:keyXPos="-10%p"
-            latin:keyWidth="fillRight"
-            latin:keyboardLayout="@xml/key_shortcut" />
     </Row>
 </merge>