diff --git a/java/res/values-sw600dp-land/dimens.xml b/java/res/values-sw600dp-land/dimens.xml
index beb5263f6310ed396b4d9d552cdb5c6ef795ed7f..a7167af7643f733b74f0aa8417192c4f57bcd069 100644
--- a/java/res/values-sw600dp-land/dimens.xml
+++ b/java/res/values-sw600dp-land/dimens.xml
@@ -21,6 +21,7 @@
 <resources>
     <!-- keyboardHeight = key_height*4 + key_bottom_gap*3 -->
     <dimen name="keyboardHeight">45.0mm</dimen>
+    <fraction name="minKeyboardHeight">45%p</fraction>
     <!-- key_height + key_bottom_gap = popup_key_height -->
     <!-- <dimen name="key_height">14.5mm</dimen> -->
     <dimen name="key_bottom_gap">1.3mm</dimen>
@@ -31,10 +32,10 @@
     <!-- key_height x 1.0 -->
     <dimen name="key_preview_height">13.0mm</dimen>
 
-    <fraction name="key_letter_ratio">30.7%</fraction>
-    <fraction name="key_label_ratio">21.9%</fraction>
+    <fraction name="key_letter_ratio">45%</fraction>
+    <fraction name="key_label_ratio">32%</fraction>
     <fraction name="key_hint_letter_ratio">23%</fraction>
-    <fraction name="key_uppercase_letter_ratio">25%</fraction>
+    <fraction name="key_uppercase_letter_ratio">29%</fraction>
     <!-- left or right padding of label alignment -->
     <dimen name="key_label_horizontal_alignment_padding">18dip</dimen>
     <dimen name="candidate_strip_padding">40.0mm</dimen>
diff --git a/java/res/values-sw600dp/dimens.xml b/java/res/values-sw600dp/dimens.xml
index 62ab0d286c618c617a6833af60214ab8f187bdb1..8ecf542ebf53c3cf689531a438df0b9895006062 100644
--- a/java/res/values-sw600dp/dimens.xml
+++ b/java/res/values-sw600dp/dimens.xml
@@ -22,7 +22,7 @@
     <!-- keyboardHeight = key_height*4 + key_bottom_gap*3 -->
     <dimen name="keyboardHeight">48.0mm</dimen>
     <fraction name="maxKeyboardHeight">50%p</fraction>
-    <fraction name="minKeyboardHeight">-61.8%p</fraction>
+    <fraction name="minKeyboardHeight">-35.0%p</fraction>
     <!-- key_height + key_bottom_gap = popup_key_height -->
     <!-- <dimen name="key_height">14.5mm</dimen> -->
     <dimen name="key_bottom_gap">1.0mm</dimen>
@@ -39,10 +39,10 @@
     <!-- popup_key_height x -1.0 -->
     <dimen name="mini_keyboard_vertical_correction">-13.0mm</dimen>
 
-    <fraction name="key_letter_ratio">45%</fraction>
-    <fraction name="key_label_ratio">29%</fraction>
+    <fraction name="key_letter_ratio">37%</fraction>
+    <fraction name="key_label_ratio">22%</fraction>
     <fraction name="key_hint_letter_ratio">23%</fraction>
-    <fraction name="key_uppercase_letter_ratio">35%</fraction>
+    <fraction name="key_uppercase_letter_ratio">25%</fraction>
     <fraction name="key_preview_text_ratio">82%</fraction>
     <!-- left or right padding of label alignment -->
     <dimen name="key_label_horizontal_alignment_padding">6dip</dimen>
diff --git a/java/res/values-sw768dp-land/dimens.xml b/java/res/values-sw768dp-land/dimens.xml
index 81d91cebfb3c3295a8d056edea5d088710e4ec81..73885c2aff845017384c406bb27b809752670ea6 100644
--- a/java/res/values-sw768dp-land/dimens.xml
+++ b/java/res/values-sw768dp-land/dimens.xml
@@ -31,10 +31,10 @@
     <dimen name="keyboard_bottom_padding">0.0mm</dimen>
     <dimen name="keyboard_horizontal_edges_padding">0.0mm</dimen>
 
-    <fraction name="key_letter_ratio">30.7%</fraction>
-    <fraction name="key_label_ratio">21.9%</fraction>
+    <fraction name="key_letter_ratio">38%</fraction>
+    <fraction name="key_label_ratio">26%</fraction>
     <fraction name="key_hint_letter_ratio">23%</fraction>
-    <fraction name="key_uppercase_letter_ratio">25%</fraction>
+    <fraction name="key_uppercase_letter_ratio">24%</fraction>
     <!-- left or right padding of label alignment -->
     <dimen name="key_label_horizontal_alignment_padding">18dip</dimen>
     <dimen name="key_preview_height_holo">26.5mm</dimen>
diff --git a/java/res/values-sw768dp/dimens.xml b/java/res/values-sw768dp/dimens.xml
index 74eab5f281ef3a4b51292ae507a93d42a4b9f98d..d8d133264bf655d08620ef722bda616e2afa1756 100644
--- a/java/res/values-sw768dp/dimens.xml
+++ b/java/res/values-sw768dp/dimens.xml
@@ -21,6 +21,7 @@
 <resources>
     <!-- keyboardHeight = key_height*4 + key_bottom_gap*3, key_height=12mm -->
     <dimen name="keyboardHeight">48.0mm</dimen>
+    <fraction name="maxKeyboardHeight">50%p</fraction>
     <fraction name="minKeyboardHeight">-35.0%p</fraction>
     <!-- key_height + key_bottom_gap = popup_key_height -->
     <!-- <dimen name="key_height">14.5mm</dimen> -->
@@ -38,10 +39,10 @@
     <!-- popup_key_height x -1.0 -->
     <dimen name="mini_keyboard_vertical_correction">-13.0mm</dimen>
 
-    <fraction name="key_letter_ratio">34.4%</fraction>
-    <fraction name="key_label_ratio">21.2%</fraction>
+    <fraction name="key_letter_ratio">38%</fraction>
+    <fraction name="key_label_ratio">26%</fraction>
     <fraction name="key_hint_letter_ratio">23%</fraction>
-    <fraction name="key_uppercase_letter_ratio">28%</fraction>
+    <fraction name="key_uppercase_letter_ratio">25%</fraction>
     <!-- left or right padding of label alignment -->
     <dimen name="key_label_horizontal_alignment_padding">6dip</dimen>
     <fraction name="key_preview_text_ratio">26.3%</fraction>
diff --git a/java/res/values/styles.xml b/java/res/values/styles.xml
index 6f973d9e5b01879f61da6bb6b8f49a16205af01c..e3ee36116209f3de208f0e8ff891c77f3723b42d 100644
--- a/java/res/values/styles.xml
+++ b/java/res/values/styles.xml
@@ -17,6 +17,14 @@
 <resources>
     <!-- Theme "Basic" -->
     <style name="Keyboard">
+        <item name="rowHeight">25%p</item>
+        <item name="keyboardHeight">@dimen/keyboardHeight</item>
+        <item name="maxKeyboardHeight">@fraction/maxKeyboardHeight</item>
+        <item name="minKeyboardHeight">@fraction/minKeyboardHeight</item>
+        <item name="popupKeyboardTemplate">@xml/kbd_popup_template</item>
+        <item name="horizontalGap">@dimen/key_horizontal_gap</item>
+        <item name="verticalGap">@dimen/key_bottom_gap</item>
+        <item name="maxPopupKeyboardColumn">@integer/config_max_popup_keyboard_column</item>
     </style>
     <style name="LatinKeyboard">
         <item name="autoCorrectionSpacebarLedIcon">@drawable/sym_keyboard_space_led</item>
diff --git a/java/res/xml-ar/kbd_qwerty.xml b/java/res/xml-ar/kbd_qwerty.xml
index 57823c9ac9c8960bd44cf3f843e57b5c26935fe5..06448dbbd1484349c9c5db5cd431e65d82fbea24 100644
--- a/java/res/xml-ar/kbd_qwerty.xml
+++ b/java/res/xml-ar/kbd_qwerty.xml
@@ -20,14 +20,6 @@
 
 <Keyboard
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
-    latin:keyboardHeight="@dimen/keyboardHeight"
-    latin:maxKeyboardHeight="@fraction/maxKeyboardHeight"
-    latin:minKeyboardHeight="@fraction/minKeyboardHeight"
-    latin:rowHeight="25%p"
-    latin:horizontalGap="@dimen/key_horizontal_gap"
-    latin:verticalGap="@dimen/key_bottom_gap"
-    latin:popupKeyboardTemplate="@xml/kbd_popup_template"
-    latin:maxPopupKeyboardColumn="@integer/config_max_popup_keyboard_column"
     latin:keyboardLocale="ar"
 >
     <include
diff --git a/java/res/xml-cs/kbd_qwerty.xml b/java/res/xml-cs/kbd_qwerty.xml
index 9ead49c3bc47334bb6f8ca3715a3db9e9c413098..57401d4ad5f68b97ecafe032ebb135b830c86102 100644
--- a/java/res/xml-cs/kbd_qwerty.xml
+++ b/java/res/xml-cs/kbd_qwerty.xml
@@ -20,14 +20,6 @@
 
 <Keyboard
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
-    latin:keyboardHeight="@dimen/keyboardHeight"
-    latin:maxKeyboardHeight="@fraction/maxKeyboardHeight"
-    latin:minKeyboardHeight="@fraction/minKeyboardHeight"
-    latin:rowHeight="25%p"
-    latin:horizontalGap="@dimen/key_horizontal_gap"
-    latin:verticalGap="@dimen/key_bottom_gap"
-    latin:popupKeyboardTemplate="@xml/kbd_popup_template"
-    latin:maxPopupKeyboardColumn="@integer/config_max_popup_keyboard_column"
     latin:keyboardLocale="cs"
 >
     <include
diff --git a/java/res/xml-da/kbd_qwerty.xml b/java/res/xml-da/kbd_qwerty.xml
index 12ea33c13c8a0634e49403ce0c57bfbc5ae26f7a..34d75f72f969c280d9b01d210d91101e275d7d5a 100644
--- a/java/res/xml-da/kbd_qwerty.xml
+++ b/java/res/xml-da/kbd_qwerty.xml
@@ -20,14 +20,6 @@
 
 <Keyboard
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
-    latin:keyboardHeight="@dimen/keyboardHeight"
-    latin:maxKeyboardHeight="@fraction/maxKeyboardHeight"
-    latin:minKeyboardHeight="@fraction/minKeyboardHeight"
-    latin:rowHeight="25%p"
-    latin:horizontalGap="@dimen/key_horizontal_gap"
-    latin:verticalGap="@dimen/key_bottom_gap"
-    latin:popupKeyboardTemplate="@xml/kbd_popup_template"
-    latin:maxPopupKeyboardColumn="@integer/config_max_popup_keyboard_column"
     latin:keyboardLocale="da"
 >
     <include
diff --git a/java/res/xml-de/kbd_qwerty.xml b/java/res/xml-de/kbd_qwerty.xml
index 5c51bbdae182623f97f25f1d4ad85a07e050b489..3eec54dd000a1b265ec33df6d29c68ff01cdb61b 100644
--- a/java/res/xml-de/kbd_qwerty.xml
+++ b/java/res/xml-de/kbd_qwerty.xml
@@ -20,14 +20,6 @@
 
 <Keyboard
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
-    latin:keyboardHeight="@dimen/keyboardHeight"
-    latin:maxKeyboardHeight="@fraction/maxKeyboardHeight"
-    latin:minKeyboardHeight="@fraction/minKeyboardHeight"
-    latin:rowHeight="25%p"
-    latin:horizontalGap="@dimen/key_horizontal_gap"
-    latin:verticalGap="@dimen/key_bottom_gap"
-    latin:popupKeyboardTemplate="@xml/kbd_popup_template"
-    latin:maxPopupKeyboardColumn="@integer/config_max_popup_keyboard_column"
     latin:keyboardLocale="de"
 >
     <include
diff --git a/java/res/xml-en/kbd_qwerty.xml b/java/res/xml-en/kbd_qwerty.xml
deleted file mode 100644
index 33e24d373880295f3309f82acd873f7d4f18288a..0000000000000000000000000000000000000000
--- a/java/res/xml-en/kbd_qwerty.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.
-*/
--->
-
-<!-- TODO: This is work around to avoid resource selection issue. This file must be removed when the
-     issue is sorted out. -->
-<Keyboard
-    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
-    latin:keyboardHeight="@dimen/keyboardHeight"
-    latin:maxKeyboardHeight="@fraction/maxKeyboardHeight"
-    latin:minKeyboardHeight="@fraction/minKeyboardHeight"
-    latin:rowHeight="25%p"
-    latin:horizontalGap="@dimen/key_horizontal_gap"
-    latin:verticalGap="@dimen/key_bottom_gap"
-    latin:popupKeyboardTemplate="@xml/kbd_popup_template"
-    latin:maxPopupKeyboardColumn="@integer/config_max_popup_keyboard_column"
-    latin:keyboardLocale="en,en_US,en_GB"
->
-    <include
-        latin:keyboardLayout="@xml/kbd_qwerty_rows" />
-</Keyboard>
diff --git a/java/res/xml-es/kbd_qwerty.xml b/java/res/xml-es/kbd_qwerty.xml
index f98649177b33d5dc5f1db54289471c00c441c794..fc394f72c9d49da9445d9e21c1322236634ae31d 100644
--- a/java/res/xml-es/kbd_qwerty.xml
+++ b/java/res/xml-es/kbd_qwerty.xml
@@ -20,14 +20,6 @@
 
 <Keyboard
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
-    latin:keyboardHeight="@dimen/keyboardHeight"
-    latin:maxKeyboardHeight="@fraction/maxKeyboardHeight"
-    latin:minKeyboardHeight="@fraction/minKeyboardHeight"
-    latin:rowHeight="25%p"
-    latin:horizontalGap="@dimen/key_horizontal_gap"
-    latin:verticalGap="@dimen/key_bottom_gap"
-    latin:popupKeyboardTemplate="@xml/kbd_popup_template"
-    latin:maxPopupKeyboardColumn="@integer/config_max_popup_keyboard_column"
     latin:keyboardLocale="es,es_US"
 >
     <include
diff --git a/java/res/xml-fi/kbd_qwerty.xml b/java/res/xml-fi/kbd_qwerty.xml
index e35ab2b41860ecc175c40e2e2e1e866e83a36ad4..2c152e95c0be3ceec002bd4ac768f8b6f5c5d4e7 100644
--- a/java/res/xml-fi/kbd_qwerty.xml
+++ b/java/res/xml-fi/kbd_qwerty.xml
@@ -20,14 +20,6 @@
 
 <Keyboard
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
-    latin:keyboardHeight="@dimen/keyboardHeight"
-    latin:maxKeyboardHeight="@fraction/maxKeyboardHeight"
-    latin:minKeyboardHeight="@fraction/minKeyboardHeight"
-    latin:rowHeight="25%p"
-    latin:horizontalGap="@dimen/key_horizontal_gap"
-    latin:verticalGap="@dimen/key_bottom_gap"
-    latin:popupKeyboardTemplate="@xml/kbd_popup_template"
-    latin:maxPopupKeyboardColumn="@integer/config_max_popup_keyboard_column"
     latin:keyboardLocale="fi"
 >
     <include
diff --git a/java/res/xml-fr-rCA/kbd_qwerty.xml b/java/res/xml-fr-rCA/kbd_qwerty.xml
index 7f25848e21da86785155fe71b133ceeb98566553..9d232dd797af469f6f5c8a3b9bcfc5abdb008b64 100644
--- a/java/res/xml-fr-rCA/kbd_qwerty.xml
+++ b/java/res/xml-fr-rCA/kbd_qwerty.xml
@@ -20,14 +20,6 @@
 
 <Keyboard
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
-    latin:keyboardHeight="@dimen/keyboardHeight"
-    latin:maxKeyboardHeight="@fraction/maxKeyboardHeight"
-    latin:minKeyboardHeight="@fraction/minKeyboardHeight"
-    latin:rowHeight="25%p"
-    latin:horizontalGap="@dimen/key_horizontal_gap"
-    latin:verticalGap="@dimen/key_bottom_gap"
-    latin:popupKeyboardTemplate="@xml/kbd_popup_template"
-    latin:maxPopupKeyboardColumn="@integer/config_max_popup_keyboard_column"
     latin:keyboardLocale="fr_CA"
 >
     <include
diff --git a/java/res/xml-fr-rCH/kbd_qwerty.xml b/java/res/xml-fr-rCH/kbd_qwerty.xml
index 2baed3ce52c9262c6afc939d4b3c01959a08491d..1ab8cf593f4edaed04843407a15eabfa37ca8d10 100644
--- a/java/res/xml-fr-rCH/kbd_qwerty.xml
+++ b/java/res/xml-fr-rCH/kbd_qwerty.xml
@@ -20,14 +20,6 @@
 
 <Keyboard
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
-    latin:keyboardHeight="@dimen/keyboardHeight"
-    latin:maxKeyboardHeight="@fraction/maxKeyboardHeight"
-    latin:minKeyboardHeight="@fraction/minKeyboardHeight"
-    latin:rowHeight="25%p"
-    latin:horizontalGap="@dimen/key_horizontal_gap"
-    latin:verticalGap="@dimen/key_bottom_gap"
-    latin:popupKeyboardTemplate="@xml/kbd_popup_template"
-    latin:maxPopupKeyboardColumn="@integer/config_max_popup_keyboard_column"
     latin:keyboardLocale="fr_CH"
 >
     <include
diff --git a/java/res/xml-fr/kbd_qwerty.xml b/java/res/xml-fr/kbd_qwerty.xml
index 1b106551628bafdba768c9e4b82a97aa8d5618b8..0feed4174055148629b41e03d40311c93b039fec 100644
--- a/java/res/xml-fr/kbd_qwerty.xml
+++ b/java/res/xml-fr/kbd_qwerty.xml
@@ -20,14 +20,6 @@
 
 <Keyboard
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
-    latin:keyboardHeight="@dimen/keyboardHeight"
-    latin:maxKeyboardHeight="@fraction/maxKeyboardHeight"
-    latin:minKeyboardHeight="@fraction/minKeyboardHeight"
-    latin:rowHeight="25%p"
-    latin:horizontalGap="@dimen/key_horizontal_gap"
-    latin:verticalGap="@dimen/key_bottom_gap"
-    latin:popupKeyboardTemplate="@xml/kbd_popup_template"
-    latin:maxPopupKeyboardColumn="@integer/config_max_popup_keyboard_column"
     latin:keyboardLocale="fr"
 >
     <include
diff --git a/java/res/xml-hu/kbd_qwerty.xml b/java/res/xml-hu/kbd_qwerty.xml
index 250b4553f729496bb5c7353dfeb2bfdcd9282572..8c684b71369b9b2b88b11d0fbdc0bb69f662f70e 100644
--- a/java/res/xml-hu/kbd_qwerty.xml
+++ b/java/res/xml-hu/kbd_qwerty.xml
@@ -20,14 +20,6 @@
 
 <Keyboard
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
-    latin:keyboardHeight="@dimen/keyboardHeight"
-    latin:maxKeyboardHeight="@fraction/maxKeyboardHeight"
-    latin:minKeyboardHeight="@fraction/minKeyboardHeight"
-    latin:rowHeight="25%p"
-    latin:horizontalGap="@dimen/key_horizontal_gap"
-    latin:verticalGap="@dimen/key_bottom_gap"
-    latin:popupKeyboardTemplate="@xml/kbd_popup_template"
-    latin:maxPopupKeyboardColumn="@integer/config_max_popup_keyboard_column"
     latin:keyboardLocale="hu"
 >
     <include
diff --git a/java/res/xml-iw/kbd_qwerty.xml b/java/res/xml-iw/kbd_qwerty.xml
index e93927f1a5f995ebd2f207c322513f4fe4457d4d..430bd9463140dc11ac25168014c0c5030aafeff5 100644
--- a/java/res/xml-iw/kbd_qwerty.xml
+++ b/java/res/xml-iw/kbd_qwerty.xml
@@ -20,14 +20,6 @@
 
 <Keyboard
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
-    latin:keyboardHeight="@dimen/keyboardHeight"
-    latin:maxKeyboardHeight="@fraction/maxKeyboardHeight"
-    latin:minKeyboardHeight="@fraction/minKeyboardHeight"
-    latin:rowHeight="25%p"
-    latin:horizontalGap="@dimen/key_horizontal_gap"
-    latin:verticalGap="@dimen/key_bottom_gap"
-    latin:popupKeyboardTemplate="@xml/kbd_popup_template"
-    latin:maxPopupKeyboardColumn="@integer/config_max_popup_keyboard_column"
     latin:keyboardLocale="iw"
 >
     <include
diff --git a/java/res/xml-nb/kbd_qwerty.xml b/java/res/xml-nb/kbd_qwerty.xml
index e7a743ca9c1ee02bf3f9c6346a432fa5bb6ab218..7dd6d6c877505782201f75cd54591cc62c01f986 100644
--- a/java/res/xml-nb/kbd_qwerty.xml
+++ b/java/res/xml-nb/kbd_qwerty.xml
@@ -20,14 +20,6 @@
 
 <Keyboard
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
-    latin:keyboardHeight="@dimen/keyboardHeight"
-    latin:maxKeyboardHeight="@fraction/maxKeyboardHeight"
-    latin:minKeyboardHeight="@fraction/minKeyboardHeight"
-    latin:rowHeight="25%p"
-    latin:horizontalGap="@dimen/key_horizontal_gap"
-    latin:verticalGap="@dimen/key_bottom_gap"
-    latin:popupKeyboardTemplate="@xml/kbd_popup_template"
-    latin:maxPopupKeyboardColumn="@integer/config_max_popup_keyboard_column"
     latin:keyboardLocale="nb"
 >
     <include
diff --git a/java/res/xml-pl/kbd_qwerty.xml b/java/res/xml-pl/kbd_qwerty.xml
index 7d9476d7b9da2976f176d4afbdb098d46d6f9dec..33315da59812980913d6b247de3fad5b73ecef67 100644
--- a/java/res/xml-pl/kbd_qwerty.xml
+++ b/java/res/xml-pl/kbd_qwerty.xml
@@ -20,14 +20,6 @@
 
 <Keyboard
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
-    latin:keyboardHeight="@dimen/keyboardHeight"
-    latin:maxKeyboardHeight="@fraction/maxKeyboardHeight"
-    latin:minKeyboardHeight="@fraction/minKeyboardHeight"
-    latin:rowHeight="25%p"
-    latin:horizontalGap="@dimen/key_horizontal_gap"
-    latin:verticalGap="@dimen/key_bottom_gap"
-    latin:popupKeyboardTemplate="@xml/kbd_popup_template"
-    latin:maxPopupKeyboardColumn="@integer/config_max_popup_keyboard_column"
     latin:keyboardLocale="pl"
 >
     <include
diff --git a/java/res/xml-pt/kbd_qwerty.xml b/java/res/xml-pt/kbd_qwerty.xml
index 1a8995510bedd1633c5ff2fa3606804b4a35b8f4..7da75d4140bb49bf4add447c4e216abe00c32bc8 100644
--- a/java/res/xml-pt/kbd_qwerty.xml
+++ b/java/res/xml-pt/kbd_qwerty.xml
@@ -20,14 +20,6 @@
 
 <Keyboard
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
-    latin:keyboardHeight="@dimen/keyboardHeight"
-    latin:maxKeyboardHeight="@fraction/maxKeyboardHeight"
-    latin:minKeyboardHeight="@fraction/minKeyboardHeight"
-    latin:rowHeight="25%p"
-    latin:horizontalGap="@dimen/key_horizontal_gap"
-    latin:verticalGap="@dimen/key_bottom_gap"
-    latin:popupKeyboardTemplate="@xml/kbd_popup_template"
-    latin:maxPopupKeyboardColumn="@integer/config_max_popup_keyboard_column"
     latin:keyboardLocale="pt"
 >
     <include
diff --git a/java/res/xml-ru/kbd_qwerty.xml b/java/res/xml-ru/kbd_qwerty.xml
index 826818c469312d33a2a6049aa6918d0bc0a57fcb..258caf18c1a8a1895a955b0141b803a075bed751 100644
--- a/java/res/xml-ru/kbd_qwerty.xml
+++ b/java/res/xml-ru/kbd_qwerty.xml
@@ -20,14 +20,6 @@
 
 <Keyboard
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
-    latin:keyboardHeight="@dimen/keyboardHeight"
-    latin:maxKeyboardHeight="@fraction/maxKeyboardHeight"
-    latin:minKeyboardHeight="@fraction/minKeyboardHeight"
-    latin:rowHeight="25%p"
-    latin:horizontalGap="@dimen/key_horizontal_gap"
-    latin:verticalGap="@dimen/key_bottom_gap"
-    latin:popupKeyboardTemplate="@xml/kbd_popup_template"
-    latin:maxPopupKeyboardColumn="@integer/config_max_popup_keyboard_column"
     latin:keyboardLocale="ru"
 >
     <include
diff --git a/java/res/xml-sr/kbd_qwerty.xml b/java/res/xml-sr/kbd_qwerty.xml
index 6116c7536ec2ba955c6a4ba4b01bcf6442a0b5c5..89c4700b945807f2c4fe9a450f44b0c8c5c9dcfb 100644
--- a/java/res/xml-sr/kbd_qwerty.xml
+++ b/java/res/xml-sr/kbd_qwerty.xml
@@ -20,14 +20,6 @@
 
 <Keyboard
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
-    latin:keyboardHeight="@dimen/keyboardHeight"
-    latin:maxKeyboardHeight="@fraction/maxKeyboardHeight"
-    latin:minKeyboardHeight="@fraction/minKeyboardHeight"
-    latin:rowHeight="25%p"
-    latin:horizontalGap="@dimen/key_horizontal_gap"
-    latin:verticalGap="@dimen/key_bottom_gap"
-    latin:popupKeyboardTemplate="@xml/kbd_popup_template"
-    latin:maxPopupKeyboardColumn="@integer/config_max_popup_keyboard_column"
     latin:keyboardLocale="sr"
 >
     <include
diff --git a/java/res/xml-sv/kbd_qwerty.xml b/java/res/xml-sv/kbd_qwerty.xml
index 69f0b3fa090c291fbc346413ef66832553f3321c..d3baf2d28b9657685de905d5bd981fe640afe616 100644
--- a/java/res/xml-sv/kbd_qwerty.xml
+++ b/java/res/xml-sv/kbd_qwerty.xml
@@ -20,14 +20,6 @@
 
 <Keyboard
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
-    latin:keyboardHeight="@dimen/keyboardHeight"
-    latin:maxKeyboardHeight="@fraction/maxKeyboardHeight"
-    latin:minKeyboardHeight="@fraction/minKeyboardHeight"
-    latin:rowHeight="25%p"
-    latin:horizontalGap="@dimen/key_horizontal_gap"
-    latin:verticalGap="@dimen/key_bottom_gap"
-    latin:popupKeyboardTemplate="@xml/kbd_popup_template"
-    latin:maxPopupKeyboardColumn="@integer/config_max_popup_keyboard_column"
     latin:keyboardLocale="sv"
 >
     <include
diff --git a/java/res/xml-sw600dp/kbd_number.xml b/java/res/xml-sw600dp/kbd_number.xml
index f9096fc2c64e49f8de44367c78b415fb391709ad..0ff1da9bc0b1845f8d5faa68ab42ec5483ca0067 100644
--- a/java/res/xml-sw600dp/kbd_number.xml
+++ b/java/res/xml-sw600dp/kbd_number.xml
@@ -20,14 +20,7 @@
 
 <Keyboard
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
-    latin:keyboardHeight="@dimen/keyboardHeight"
-    latin:maxKeyboardHeight="50%p"
-    latin:rowHeight="25%p"
     latin:keyWidth="16.75%p"
-    latin:horizontalGap="@dimen/key_horizontal_gap"
-    latin:verticalGap="@dimen/key_bottom_gap"
-    latin:popupKeyboardTemplate="@xml/kbd_popup_template"
-    latin:maxPopupKeyboardColumn="@integer/config_max_popup_keyboard_column"
 >
     <include
         latin:keyboardLayout="@xml/kbd_key_styles" />
diff --git a/java/res/xml-sw600dp/kbd_phone.xml b/java/res/xml-sw600dp/kbd_phone.xml
index cf0e5236c69e4a698f65fcee59adb08271b6df6d..20b284923f0921328e057e3b2ae9bedf08e7c2d0 100644
--- a/java/res/xml-sw600dp/kbd_phone.xml
+++ b/java/res/xml-sw600dp/kbd_phone.xml
@@ -20,14 +20,7 @@
 
 <Keyboard
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
-    latin:keyboardHeight="@dimen/keyboardHeight"
-    latin:maxKeyboardHeight="50%p"
-    latin:rowHeight="25%p"
     latin:keyWidth="16.75%p"
-    latin:horizontalGap="@dimen/key_horizontal_gap"
-    latin:verticalGap="@dimen/key_bottom_gap"
-    latin:popupKeyboardTemplate="@xml/kbd_popup_template"
-    latin:maxPopupKeyboardColumn="@integer/config_max_popup_keyboard_column"
 >
     <include
         latin:keyboardLayout="@xml/kbd_key_styles" />
diff --git a/java/res/xml-sw600dp/kbd_phone_symbols.xml b/java/res/xml-sw600dp/kbd_phone_symbols.xml
index 356528538598eb1453d2b347bb1e178b5ad71277..a5ae9456cbff1443caa9d5b975d2b2ac395afd85 100644
--- a/java/res/xml-sw600dp/kbd_phone_symbols.xml
+++ b/java/res/xml-sw600dp/kbd_phone_symbols.xml
@@ -20,14 +20,7 @@
 
 <Keyboard
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
-    latin:keyboardHeight="@dimen/keyboardHeight"
-    latin:maxKeyboardHeight="50%p"
-    latin:rowHeight="25%p"
     latin:keyWidth="16.75%p"
-    latin:horizontalGap="@dimen/key_horizontal_gap"
-    latin:verticalGap="@dimen/key_bottom_gap"
-    latin:popupKeyboardTemplate="@xml/kbd_popup_template"
-    latin:maxPopupKeyboardColumn="@integer/config_max_popup_keyboard_column"
 >
     <include
         latin:keyboardLayout="@xml/kbd_key_styles" />
diff --git a/java/res/xml-sw600dp/kbd_qwerty.xml b/java/res/xml-sw600dp/kbd_qwerty.xml
deleted file mode 100644
index 9541e13fd1cec2e03e4e567aa0c036991a6d747b..0000000000000000000000000000000000000000
--- a/java/res/xml-sw600dp/kbd_qwerty.xml
+++ /dev/null
@@ -1,34 +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.
-*/
--->
-
-<Keyboard
-    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
-    latin:keyboardHeight="@dimen/keyboardHeight"
-    latin:maxKeyboardHeight="50%p"
-    latin:rowHeight="25%p"
-    latin:keyWidth="10%p"
-    latin:horizontalGap="@dimen/key_horizontal_gap"
-    latin:verticalGap="@dimen/key_bottom_gap"
-    latin:popupKeyboardTemplate="@xml/kbd_popup_template"
-    latin:maxPopupKeyboardColumn="@integer/config_max_popup_keyboard_column"
->
-    <include
-        latin:keyboardLayout="@xml/kbd_qwerty_rows" />
-</Keyboard>
diff --git a/java/res/xml-sw600dp/kbd_symbols.xml b/java/res/xml-sw600dp/kbd_symbols.xml
index 3593c7788d0b6d1cd5ca627faa4882019fd5b276..4d3e7d3a27bf5418f8da06b68268d767eca0ca8b 100644
--- a/java/res/xml-sw600dp/kbd_symbols.xml
+++ b/java/res/xml-sw600dp/kbd_symbols.xml
@@ -20,13 +20,6 @@
 
 <Keyboard
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
-    latin:keyboardHeight="@dimen/keyboardHeight"
-    latin:maxKeyboardHeight="50%p"
-    latin:rowHeight="25%p"
-    latin:horizontalGap="@dimen/key_horizontal_gap"
-    latin:verticalGap="@dimen/key_bottom_gap"
-    latin:popupKeyboardTemplate="@xml/kbd_popup_template"
-    latin:maxPopupKeyboardColumn="@integer/config_max_popup_keyboard_column"
 >
     <include
         latin:keyboardLayout="@xml/kbd_key_styles" />
diff --git a/java/res/xml-sw600dp/kbd_symbols_shift.xml b/java/res/xml-sw600dp/kbd_symbols_shift.xml
index 4cef3a78f58a0fe243a98bfa52c58c8556f9f231..1743c0ff229dd79a280917d354cb4b2f3516111d 100644
--- a/java/res/xml-sw600dp/kbd_symbols_shift.xml
+++ b/java/res/xml-sw600dp/kbd_symbols_shift.xml
@@ -20,13 +20,6 @@
 
 <Keyboard
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
-    latin:keyboardHeight="@dimen/keyboardHeight"
-    latin:maxKeyboardHeight="50%p"
-    latin:rowHeight="25%p"
-    latin:horizontalGap="@dimen/key_horizontal_gap"
-    latin:verticalGap="@dimen/key_bottom_gap"
-    latin:popupKeyboardTemplate="@xml/kbd_popup_template"
-    latin:maxPopupKeyboardColumn="@integer/config_max_popup_keyboard_column"
 >
     <include
         latin:keyboardLayout="@xml/kbd_key_styles" />
diff --git a/java/res/xml-sw768dp/kbd_number.xml b/java/res/xml-sw768dp/kbd_number.xml
index faab38ade69e2a2058a466de9cb5fd42d3baa519..4f33e41542b4a27ad64060979a9571bca131f32b 100644
--- a/java/res/xml-sw768dp/kbd_number.xml
+++ b/java/res/xml-sw768dp/kbd_number.xml
@@ -20,15 +20,7 @@
 
 <Keyboard
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
-    latin:keyboardHeight="@dimen/keyboardHeight"
-    latin:maxKeyboardHeight="@fraction/maxKeyboardHeight"
-    latin:minKeyboardHeight="@fraction/minKeyboardHeight"
-    latin:rowHeight="25%p"
     latin:keyWidth="13.250%p"
-    latin:horizontalGap="@dimen/key_horizontal_gap"
-    latin:verticalGap="@dimen/key_bottom_gap"
-    latin:popupKeyboardTemplate="@xml/kbd_popup_template"
-    latin:maxPopupKeyboardColumn="@integer/config_max_popup_keyboard_column"
 >
     <include
         latin:keyboardLayout="@xml/kbd_key_styles" />
diff --git a/java/res/xml-sw768dp/kbd_phone.xml b/java/res/xml-sw768dp/kbd_phone.xml
index 0c65233833c6bfb1e7261cb0af5685260638ac56..69169ffd1a8efc8247360832c5e45d1a150ad768 100644
--- a/java/res/xml-sw768dp/kbd_phone.xml
+++ b/java/res/xml-sw768dp/kbd_phone.xml
@@ -20,15 +20,7 @@
 
 <Keyboard
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
-    latin:keyboardHeight="@dimen/keyboardHeight"
-    latin:maxKeyboardHeight="@fraction/maxKeyboardHeight"
-    latin:minKeyboardHeight="@fraction/minKeyboardHeight"
-    latin:rowHeight="25%p"
     latin:keyWidth="13.250%p"
-    latin:horizontalGap="@dimen/key_horizontal_gap"
-    latin:verticalGap="@dimen/key_bottom_gap"
-    latin:popupKeyboardTemplate="@xml/kbd_popup_template"
-    latin:maxPopupKeyboardColumn="@integer/config_max_popup_keyboard_column"
 >
     <include
         latin:keyboardLayout="@xml/kbd_key_styles" />
diff --git a/java/res/xml-sw768dp/kbd_phone_symbols.xml b/java/res/xml-sw768dp/kbd_phone_symbols.xml
index da2ac6552d97957a1af636810c2bbe875f0d121e..e95579c0ade3510ad5200add012084813a64f9dd 100644
--- a/java/res/xml-sw768dp/kbd_phone_symbols.xml
+++ b/java/res/xml-sw768dp/kbd_phone_symbols.xml
@@ -20,15 +20,7 @@
 
 <Keyboard
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
-    latin:keyboardHeight="@dimen/keyboardHeight"
-    latin:maxKeyboardHeight="@fraction/maxKeyboardHeight"
-    latin:minKeyboardHeight="@fraction/minKeyboardHeight"
-    latin:rowHeight="25%p"
     latin:keyWidth="13.250%p"
-    latin:horizontalGap="@dimen/key_horizontal_gap"
-    latin:verticalGap="@dimen/key_bottom_gap"
-    latin:popupKeyboardTemplate="@xml/kbd_popup_template"
-    latin:maxPopupKeyboardColumn="@integer/config_max_popup_keyboard_column"
 >
     <include
         latin:keyboardLayout="@xml/kbd_key_styles" />
diff --git a/java/res/xml-sw768dp/kbd_symbols.xml b/java/res/xml-sw768dp/kbd_symbols.xml
index 5b359bfbfa5cbf9d66b0544874ed01202d3f79d9..d1a83c479c657d489fb9422972cc32cf5499364d 100644
--- a/java/res/xml-sw768dp/kbd_symbols.xml
+++ b/java/res/xml-sw768dp/kbd_symbols.xml
@@ -20,14 +20,6 @@
 
 <Keyboard
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
-    latin:keyboardHeight="@dimen/keyboardHeight"
-    latin:maxKeyboardHeight="@fraction/maxKeyboardHeight"
-    latin:minKeyboardHeight="@fraction/minKeyboardHeight"
-    latin:rowHeight="25%p"
-    latin:horizontalGap="@dimen/key_horizontal_gap"
-    latin:verticalGap="@dimen/key_bottom_gap"
-    latin:popupKeyboardTemplate="@xml/kbd_popup_template"
-    latin:maxPopupKeyboardColumn="@integer/config_max_popup_keyboard_column"
 >
     <include
         latin:keyboardLayout="@xml/kbd_key_styles" />
diff --git a/java/res/xml-sw768dp/kbd_symbols_shift.xml b/java/res/xml-sw768dp/kbd_symbols_shift.xml
index 94bd761ba918dfaf383436314b4ccf11208fff95..dde144fdf4c178febd61512d69660195f4c01c9e 100644
--- a/java/res/xml-sw768dp/kbd_symbols_shift.xml
+++ b/java/res/xml-sw768dp/kbd_symbols_shift.xml
@@ -20,14 +20,6 @@
 
 <Keyboard
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
-    latin:keyboardHeight="@dimen/keyboardHeight"
-    latin:maxKeyboardHeight="@fraction/maxKeyboardHeight"
-    latin:minKeyboardHeight="@fraction/minKeyboardHeight"
-    latin:rowHeight="25%p"
-    latin:horizontalGap="@dimen/key_horizontal_gap"
-    latin:verticalGap="@dimen/key_bottom_gap"
-    latin:popupKeyboardTemplate="@xml/kbd_popup_template"
-    latin:maxPopupKeyboardColumn="@integer/config_max_popup_keyboard_column"
 >
     <include
         latin:keyboardLayout="@xml/kbd_key_styles" />
diff --git a/java/res/xml/kbd_number.xml b/java/res/xml/kbd_number.xml
index 23b88a5bdc3549dc411d2ba22937fbe36b28789d..429b818460ac5e885a26ee33bcc29e390eba5461 100644
--- a/java/res/xml/kbd_number.xml
+++ b/java/res/xml/kbd_number.xml
@@ -20,15 +20,7 @@
 
 <Keyboard
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
-    latin:keyboardHeight="@dimen/keyboardHeight"
-    latin:maxKeyboardHeight="@fraction/maxKeyboardHeight"
-    latin:minKeyboardHeight="@fraction/minKeyboardHeight"
-    latin:rowHeight="25%p"
     latin:keyWidth="26.67%p"
-    latin:horizontalGap="@dimen/key_horizontal_gap"
-    latin:verticalGap="@dimen/key_bottom_gap"
-    latin:popupKeyboardTemplate="@xml/kbd_popup_template"
-    latin:maxPopupKeyboardColumn="@integer/config_max_popup_keyboard_column"
 >
     <include
         latin:keyboardLayout="@xml/kbd_key_styles" />
diff --git a/java/res/xml/kbd_phone.xml b/java/res/xml/kbd_phone.xml
index e1d1ee8d0d72856c50c19ea23b29cf350e1ad87f..211f7b7f79a88f90bf5f0ab320bca677de636761 100644
--- a/java/res/xml/kbd_phone.xml
+++ b/java/res/xml/kbd_phone.xml
@@ -20,15 +20,7 @@
 
 <Keyboard
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
-    latin:keyboardHeight="@dimen/keyboardHeight"
-    latin:maxKeyboardHeight="@fraction/maxKeyboardHeight"
-    latin:minKeyboardHeight="@fraction/minKeyboardHeight"
-    latin:rowHeight="25%p"
     latin:keyWidth="26.67%p"
-    latin:horizontalGap="@dimen/key_horizontal_gap"
-    latin:verticalGap="@dimen/key_bottom_gap"
-    latin:popupKeyboardTemplate="@xml/kbd_popup_template"
-    latin:maxPopupKeyboardColumn="@integer/config_max_popup_keyboard_column"
 >
     <include
         latin:keyboardLayout="@xml/kbd_key_styles" />
diff --git a/java/res/xml/kbd_phone_symbols.xml b/java/res/xml/kbd_phone_symbols.xml
index 2af218cfe24c272ec9ee0ea598e75440ec518519..c6513632cbdb93e8daf7f834d0849ff7cbe46af3 100644
--- a/java/res/xml/kbd_phone_symbols.xml
+++ b/java/res/xml/kbd_phone_symbols.xml
@@ -20,15 +20,7 @@
 
 <Keyboard
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
-    latin:keyboardHeight="@dimen/keyboardHeight"
-    latin:maxKeyboardHeight="@fraction/maxKeyboardHeight"
-    latin:minKeyboardHeight="@fraction/minKeyboardHeight"
-    latin:rowHeight="25%p"
     latin:keyWidth="26.67%p"
-    latin:horizontalGap="@dimen/key_horizontal_gap"
-    latin:verticalGap="@dimen/key_bottom_gap"
-    latin:popupKeyboardTemplate="@xml/kbd_popup_template"
-    latin:maxPopupKeyboardColumn="@integer/config_max_popup_keyboard_column"
 >
     <include
         latin:keyboardLayout="@xml/kbd_key_styles" />
diff --git a/java/res/xml/kbd_qwerty.xml b/java/res/xml/kbd_qwerty.xml
index f0c1fa7fc39d8fe7a4eae4c11fc47895525e30a9..c0061ce333a0f570312d9cbee2cbe1484ca35074 100644
--- a/java/res/xml/kbd_qwerty.xml
+++ b/java/res/xml/kbd_qwerty.xml
@@ -20,14 +20,6 @@
 
 <Keyboard
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
-    latin:keyboardHeight="@dimen/keyboardHeight"
-    latin:maxKeyboardHeight="@fraction/maxKeyboardHeight"
-    latin:minKeyboardHeight="@fraction/minKeyboardHeight"
-    latin:rowHeight="25%p"
-    latin:horizontalGap="@dimen/key_horizontal_gap"
-    latin:verticalGap="@dimen/key_bottom_gap"
-    latin:popupKeyboardTemplate="@xml/kbd_popup_template"
-    latin:maxPopupKeyboardColumn="@integer/config_max_popup_keyboard_column"
     latin:keyboardLocale="en_GB,en_US"
 >
     <include
diff --git a/java/res/xml/kbd_symbols.xml b/java/res/xml/kbd_symbols.xml
index a58a51874ef3489b247819417be81f6d85995916..8e9124f74254b07ed98d372a065cd8a024a2e4c7 100644
--- a/java/res/xml/kbd_symbols.xml
+++ b/java/res/xml/kbd_symbols.xml
@@ -20,15 +20,7 @@
 
 <Keyboard
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
-    latin:keyboardHeight="@dimen/keyboardHeight"
-    latin:maxKeyboardHeight="@fraction/maxKeyboardHeight"
-    latin:minKeyboardHeight="@fraction/minKeyboardHeight"
-    latin:rowHeight="25%p"
     latin:keyWidth="10%p"
-    latin:horizontalGap="@dimen/key_horizontal_gap"
-    latin:verticalGap="@dimen/key_bottom_gap"
-    latin:popupKeyboardTemplate="@xml/kbd_popup_template"
-    latin:maxPopupKeyboardColumn="@integer/config_max_popup_keyboard_column"
 >
     <include
         latin:keyboardLayout="@xml/kbd_key_styles" />
diff --git a/java/res/xml/kbd_symbols_shift.xml b/java/res/xml/kbd_symbols_shift.xml
index 96e741bbc3b2f73c7331ef6e42901408d36d9acf..f22d45aff06a751f90d85c674ba84772eb4aa3b8 100644
--- a/java/res/xml/kbd_symbols_shift.xml
+++ b/java/res/xml/kbd_symbols_shift.xml
@@ -20,15 +20,7 @@
 
 <Keyboard
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
-    latin:keyboardHeight="@dimen/keyboardHeight"
-    latin:maxKeyboardHeight="@fraction/maxKeyboardHeight"
-    latin:minKeyboardHeight="@fraction/minKeyboardHeight"
-    latin:rowHeight="25%p"
     latin:keyWidth="10%p"
-    latin:horizontalGap="@dimen/key_horizontal_gap"
-    latin:verticalGap="@dimen/key_bottom_gap"
-    latin:popupKeyboardTemplate="@xml/kbd_popup_template"
-    latin:maxPopupKeyboardColumn="@integer/config_max_popup_keyboard_column"
 >
     <include
         latin:keyboardLayout="@xml/kbd_key_styles" />
diff --git a/java/src/com/android/inputmethod/keyboard/Keyboard.java b/java/src/com/android/inputmethod/keyboard/Keyboard.java
index 3db214ec9dfee1f00abe38e762b55541fa9ee15e..58629ba5189c2c8a0fe2f34482ea5bfe6fb8c05c 100644
--- a/java/src/com/android/inputmethod/keyboard/Keyboard.java
+++ b/java/src/com/android/inputmethod/keyboard/Keyboard.java
@@ -18,7 +18,6 @@ package com.android.inputmethod.keyboard;
 
 import android.content.Context;
 import android.content.res.Resources;
-import android.content.res.TypedArray;
 import android.graphics.drawable.Drawable;
 import android.util.Log;
 
@@ -173,11 +172,6 @@ public class Keyboard {
         mDefaultHeight = mDefaultWidth;
         mId = id;
         mProximityInfo = new ProximityInfo(GRID_WIDTH, GRID_HEIGHT);
-
-        final TypedArray attrs = context.obtainStyledAttributes(
-                null, R.styleable.Keyboard, R.attr.keyboardStyle, R.style.Keyboard);
-        attrs.recycle();
-
         loadKeyboard(context, xmlLayoutResId);
     }
 
@@ -440,7 +434,7 @@ public class Keyboard {
 
     private void loadKeyboard(Context context, int xmlLayoutResId) {
         try {
-            KeyboardParser parser = new KeyboardParser(this, context.getResources());
+            KeyboardParser parser = new KeyboardParser(this, context);
             parser.parseKeyboard(xmlLayoutResId);
             // mMinWidth is the width of this keyboard which is maximum width of row.
             mMinWidth = parser.getMaxRowWidth();
diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardParser.java b/java/src/com/android/inputmethod/keyboard/KeyboardParser.java
index 07166b1dba02e5a2324e63797b42bf595205a0c6..a6158d0ad0fcf555b7b493ad860122e642a431c5 100644
--- a/java/src/com/android/inputmethod/keyboard/KeyboardParser.java
+++ b/java/src/com/android/inputmethod/keyboard/KeyboardParser.java
@@ -121,6 +121,7 @@ public class KeyboardParser {
     public static final String TAG_KEY_STYLE = "key-style";
 
     private final Keyboard mKeyboard;
+    private final Context mContext;
     private final Resources mResources;
 
     private int mHorizontalEdgesPadding;
@@ -131,8 +132,10 @@ public class KeyboardParser {
     private Row mCurrentRow = null;
     private final KeyStyles mKeyStyles = new KeyStyles();
 
-    public KeyboardParser(Keyboard keyboard, Resources res) {
+    public KeyboardParser(Keyboard keyboard, Context context) {
         mKeyboard = keyboard;
+        mContext = context;
+        final Resources res = context.getResources();
         mResources = res;
         mHorizontalEdgesPadding = (int)res.getDimension(R.dimen.keyboard_horizontal_edges_padding);
     }
@@ -187,8 +190,9 @@ public class KeyboardParser {
 
     private void parseKeyboardAttributes(XmlResourceParser parser) {
         final Keyboard keyboard = mKeyboard;
-        final TypedArray keyboardAttr = mResources.obtainAttributes(Xml.asAttributeSet(parser),
-                R.styleable.Keyboard);
+        final TypedArray keyboardAttr = mContext.obtainStyledAttributes(
+                Xml.asAttributeSet(parser), R.styleable.Keyboard, R.attr.keyboardStyle,
+                R.style.Keyboard);
         final TypedArray keyAttr = mResources.obtainAttributes(Xml.asAttributeSet(parser),
                 R.styleable.Keyboard_Key);
         try {