Add popupKeyboardTemplate attribute to Keyboard

This change
- introduces the popupKeyboardTemplate attribute of Keyboard to
  specify XML Keyboard file for popup mini keyboard.
- introduces the maxPopupKeyboardColumn attribute of Keyboard to
  specify the maximum column of popup mini keyboard.
- changes the content format of the popupCharacters attribute of Key.
  It now represents keyLabel, codes and keyTextOutput of each key of
  popup mini keyboard using CSV format.

Bug: 2214959
Change-Id: I539e310f7e38a049ee193de0b4ad5d7afdce37b1
diff --git a/java/res/xml/kbd_azerty_rows.xml b/java/res/xml/kbd_azerty_rows.xml
index c06724c..71109ab 100644
--- a/java/res/xml/kbd_azerty_rows.xml
+++ b/java/res/xml/kbd_azerty_rows.xml
@@ -30,53 +30,43 @@
         <Key
             latin:keyLabel="a"
             latin:keyHintIcon="@drawable/keyboard_hint_1"
-            latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="@string/alternates_for_a"
             latin:keyEdgeFlags="left" />
         <Key
             latin:keyLabel="z"
             latin:keyHintIcon="@drawable/keyboard_hint_2"
-            latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="@string/alternates_for_z" />
         <Key
             latin:keyLabel="e"
             latin:keyHintIcon="@drawable/keyboard_hint_3"
-            latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="@string/alternates_for_e" />
         <Key
             latin:keyLabel="r"
             latin:keyHintIcon="@drawable/keyboard_hint_4"
-            latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="@string/alternates_for_r" />
         <Key
             latin:keyLabel="t"
             latin:keyHintIcon="@drawable/keyboard_hint_5"
-            latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="@string/alternates_for_t" />
         <Key
             latin:keyLabel="y"
             latin:keyHintIcon="@drawable/keyboard_hint_6"
-            latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="@string/alternates_for_y" />
         <Key
             latin:keyLabel="u"
             latin:keyHintIcon="@drawable/keyboard_hint_7"
-            latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="@string/alternates_for_u" />
         <Key
             latin:keyLabel="i"
             latin:keyHintIcon="@drawable/keyboard_hint_8"
-            latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="@string/alternates_for_i" />
         <Key
             latin:keyLabel="o"
             latin:keyHintIcon="@drawable/keyboard_hint_9"
-            latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="@string/alternates_for_o" />
         <Key
             latin:keyLabel="p"
             latin:keyHintIcon="@drawable/keyboard_hint_0"
-            latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="@string/alternates_for_p"
             latin:keyEdgeFlags="right" />
     </Row>
@@ -85,22 +75,18 @@
     >
         <Key
             latin:keyLabel="q"
-            latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="@string/alternates_for_q"
             latin:keyEdgeFlags="left" />
         <Key
             latin:keyLabel="s"
-            latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="@string/alternates_for_s" />
         <Key
             latin:keyLabel="d"
-            latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="@string/alternates_for_d" />
         <Key
             latin:keyLabel="f" />
         <Key
             latin:keyLabel="g"
-            latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="@string/alternates_for_g" />
         <Key
             latin:keyLabel="h" />
@@ -110,7 +96,6 @@
             latin:keyLabel="k" />
         <Key
             latin:keyLabel="l"
-            latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="@string/alternates_for_l" />
         <Key
             latin:keyLabel="m"
@@ -125,23 +110,20 @@
             latin:keyEdgeFlags="left" />
         <Key
             latin:keyLabel="w"
-            latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="@string/alternates_for_w" />
         <Key
             latin:keyLabel="x" />
         <Key
             latin:keyLabel="c"
-            latin:popupKeyboard="@xml/kbd_popup_template"
+
             latin:popupCharacters="@string/alternates_for_c" />
         <Key
             latin:keyLabel="v"
-            latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="@string/alternates_for_v" />
         <Key
             latin:keyLabel="b" />
         <Key
             latin:keyLabel="n"
-            latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="@string/alternates_for_n" />
         <Key
             latin:keyLabel="\'" />
diff --git a/java/res/xml/kbd_key_styles.xml b/java/res/xml/kbd_key_styles.xml
index 9dd166a..3b6df73 100644
--- a/java/res/xml/kbd_key_styles.xml
+++ b/java/res/xml/kbd_key_styles.xml
@@ -88,10 +88,10 @@
             <key-style
                 latin:styleName="micKeyStyle"
                 latin:codes="@integer/key_voice"
-                latin:popupKeyboard="@xml/popup_mic"
                 latin:keyIcon="@drawable/sym_keyboard_mic"
                 latin:iconPreview="@drawable/sym_keyboard_feedback_mic"
                 latin:keyHintIcon="@drawable/hint_popup"
+                latin:popupCharacters="@string/alternates_for_mic"
                 latin:parentStyle="functionalKeyStyle" />
             <!-- Note: This key style is not for functional tab key. This is used for the tab key
                  which is laid out as normal letter key. -->
@@ -165,10 +165,10 @@
             <key-style
                 latin:styleName="micKeyStyle"
                 latin:codes="@integer/key_voice"
-                latin:popupKeyboard="@xml/popup_mic"
                 latin:keyIcon="@drawable/sym_bkeyboard_mic"
                 latin:iconPreview="@drawable/sym_keyboard_feedback_mic"
                 latin:keyHintIcon="@drawable/hint_popup"
+                latin:popupCharacters="@string/alternates_for_mic"
                 latin:parentStyle="functionalKeyStyle" />
             <!-- Note: This key style is not for functional tab key. This is used for the tab key
                  which is laid out as normal letter key. -->
@@ -284,6 +284,7 @@
         latin:keyLabel=":-)"
         latin:keyOutputText=":-) "
         latin:keyHintIcon="@drawable/hint_popup"
-        latin:popupKeyboard="@xml/popup_smileys"
+        latin:popupCharacters="@string/alternates_for_smiley"
+        latin:maxPopupKeyboardColumn="5"
         latin:parentStyle="functionalKeyStyle" />
 </merge>
\ No newline at end of file
diff --git a/java/res/xml/kbd_number.xml b/java/res/xml/kbd_number.xml
index f09da86..f4a5def 100644
--- a/java/res/xml/kbd_number.xml
+++ b/java/res/xml/kbd_number.xml
@@ -26,10 +26,12 @@
     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" />
-   <switch>
+    <switch>
         <case
             latin:colorScheme="white"
         >
diff --git a/java/res/xml/kbd_phone.xml b/java/res/xml/kbd_phone.xml
index fb0e6d7..62fbdee 100644
--- a/java/res/xml/kbd_phone.xml
+++ b/java/res/xml/kbd_phone.xml
@@ -26,6 +26,8 @@
     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 5f75ecb..1997a75 100644
--- a/java/res/xml/kbd_phone_symbols.xml
+++ b/java/res/xml/kbd_phone_symbols.xml
@@ -26,6 +26,8 @@
     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 b102eb6..92d92f0 100644
--- a/java/res/xml/kbd_qwerty.xml
+++ b/java/res/xml/kbd_qwerty.xml
@@ -26,6 +26,8 @@
     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" />
diff --git a/java/res/xml/kbd_qwerty_f1.xml b/java/res/xml/kbd_qwerty_f1.xml
index 1f0ccfb..cbdb8c0 100644
--- a/java/res/xml/kbd_qwerty_f1.xml
+++ b/java/res/xml/kbd_qwerty_f1.xml
@@ -27,8 +27,8 @@
         >
             <Key
                 latin:keyLabel="/"
-                latin:popupKeyboard="@xml/popup_slash"
                 latin:keyHintIcon="@drawable/hint_popup"
+                latin:popupCharacters="@string/alternates_for_settings_slash"
                 latin:isModifier="true" />
         </case>
         <case
@@ -36,8 +36,8 @@
         >
             <Key
                 latin:keyLabel="\@"
-                latin:popupKeyboard="@xml/popup_at"
                 latin:keyHintIcon="@drawable/hint_popup"
+                latin:popupCharacters="@string/alternates_for_settings_at"
                 latin:isModifier="true" />
         </case>
         <default>
@@ -53,8 +53,8 @@
                 >
                     <Key
                         latin:keyLabel=","
-                        latin:popupKeyboard="@xml/popup_comma"
                         latin:keyHintIcon="@drawable/hint_popup"
+                        latin:popupCharacters="@string/alternates_for_settings_comma"
                         latin:isModifier="true" />
                 </case>
             </switch>
diff --git a/java/res/xml/kbd_qwerty_row1.xml b/java/res/xml/kbd_qwerty_row1.xml
index e4356a8..d924965 100644
--- a/java/res/xml/kbd_qwerty_row1.xml
+++ b/java/res/xml/kbd_qwerty_row1.xml
@@ -28,53 +28,43 @@
         <Key
             latin:keyLabel="q"
             latin:keyHintIcon="@drawable/keyboard_hint_1"
-            latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="@string/alternates_for_q"
             latin:keyEdgeFlags="left" />
         <Key
             latin:keyLabel="w"
             latin:keyHintIcon="@drawable/keyboard_hint_2"
-            latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="@string/alternates_for_w" />
         <Key
             latin:keyLabel="e"
             latin:keyHintIcon="@drawable/keyboard_hint_3"
-            latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="@string/alternates_for_e" />
         <Key
             latin:keyLabel="r"
             latin:keyHintIcon="@drawable/keyboard_hint_4"
-            latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="@string/alternates_for_r" />
         <Key
             latin:keyLabel="t"
             latin:keyHintIcon="@drawable/keyboard_hint_5"
-            latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="@string/alternates_for_t" />
         <Key
             latin:keyLabel="y"
             latin:keyHintIcon="@drawable/keyboard_hint_6"
-            latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="@string/alternates_for_y" />
         <Key
             latin:keyLabel="u"
             latin:keyHintIcon="@drawable/keyboard_hint_7"
-            latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="@string/alternates_for_u" />
         <Key
             latin:keyLabel="i"
             latin:keyHintIcon="@drawable/keyboard_hint_8"
-            latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="@string/alternates_for_i" />
         <Key
             latin:keyLabel="o"
             latin:keyHintIcon="@drawable/keyboard_hint_9"
-            latin:popupKeyboard="@xml/kbd_popup_narrow_template"
             latin:popupCharacters="@string/alternates_for_o" />
         <Key
             latin:keyLabel="p"
             latin:keyHintIcon="@drawable/keyboard_hint_0"
-            latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="@string/alternates_for_p"
             latin:keyEdgeFlags="right" />
     </Row>
diff --git a/java/res/xml/kbd_qwerty_row2.xml b/java/res/xml/kbd_qwerty_row2.xml
index d518495..dd0035d 100644
--- a/java/res/xml/kbd_qwerty_row2.xml
+++ b/java/res/xml/kbd_qwerty_row2.xml
@@ -28,22 +28,18 @@
             latin:horizontalGap="5%p" />
         <Key
             latin:keyLabel="a"
-            latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="@string/alternates_for_a"
             latin:keyEdgeFlags="left" />
         <Key
             latin:keyLabel="s"
-            latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="@string/alternates_for_s" />
         <Key
             latin:keyLabel="d"
-            latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="@string/alternates_for_d" />
         <Key
             latin:keyLabel="f" />
         <Key
             latin:keyLabel="g"
-            latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="@string/alternates_for_g" />
         <Key
             latin:keyLabel="h" />
@@ -53,7 +49,6 @@
             latin:keyLabel="k" />
         <Key
             latin:keyLabel="l"
-            latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="@string/alternates_for_l"
             latin:keyEdgeFlags="right" />
     </Row>
diff --git a/java/res/xml/kbd_qwerty_row3.xml b/java/res/xml/kbd_qwerty_row3.xml
index 71a5f9c..26608fd 100644
--- a/java/res/xml/kbd_qwerty_row3.xml
+++ b/java/res/xml/kbd_qwerty_row3.xml
@@ -30,23 +30,19 @@
             latin:keyEdgeFlags="left" />
         <Key
             latin:keyLabel="z"
-            latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="@string/alternates_for_z" />
         <Key
             latin:keyLabel="x" />
         <Key
             latin:keyLabel="c"
-            latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="@string/alternates_for_c" />
         <Key
             latin:keyLabel="v"
-            latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="@string/alternates_for_v" />
         <Key
             latin:keyLabel="b" />
         <Key
             latin:keyLabel="n"
-            latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="@string/alternates_for_n" />
         <Key
             latin:keyLabel="m" />
diff --git a/java/res/xml/kbd_qwerty_row4.xml b/java/res/xml/kbd_qwerty_row4.xml
index cd03c51..0db0116 100644
--- a/java/res/xml/kbd_qwerty_row4.xml
+++ b/java/res/xml/kbd_qwerty_row4.xml
@@ -55,7 +55,8 @@
                 <Key
                     latin:keyLabel="."
                     latin:keyHintIcon="@drawable/hint_popup"
-                    latin:popupKeyboard="@xml/popup_punctuation"
+                    latin:popupCharacters="@string/alternates_for_punctuation"
+                    latin:maxPopupKeyboardColumn="7"
                     latin:keyStyle="functionalKeyStyle" />
                 <switch>
                     <case
@@ -104,7 +105,8 @@
                 <Key
                     latin:keyLabel="."
                     latin:keyHintIcon="@drawable/hint_popup"
-                    latin:popupKeyboard="@xml/popup_punctuation"
+                    latin:popupCharacters="@string/alternates_for_punctuation"
+                    latin:maxPopupKeyboardColumn="7"
                     latin:keyStyle="functionalKeyStyle" />
                 <switch>
                     <case
diff --git a/java/res/xml/kbd_qwerty_rows_scandinavia.xml b/java/res/xml/kbd_qwerty_rows_scandinavia.xml
index 4fa2e6e..4906526 100644
--- a/java/res/xml/kbd_qwerty_rows_scandinavia.xml
+++ b/java/res/xml/kbd_qwerty_rows_scandinavia.xml
@@ -30,54 +30,44 @@
         <Key
             latin:keyLabel="q"
             latin:keyHintIcon="@drawable/keyboard_hint_1"
-            latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="@string/alternates_for_q"
             latin:keyWidth="8.75%p"
             latin:keyEdgeFlags="left" />
         <Key
             latin:keyLabel="w"
             latin:keyHintIcon="@drawable/keyboard_hint_2"
-            latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="@string/alternates_for_w" />
         <Key
             latin:keyLabel="e"
             latin:keyHintIcon="@drawable/keyboard_hint_3"
-            latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="@string/alternates_for_e" />
         <Key
             latin:keyLabel="r"
             latin:keyHintIcon="@drawable/keyboard_hint_4"
-            latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="@string/alternates_for_r" />
         <Key
             latin:keyLabel="t"
             latin:keyHintIcon="@drawable/keyboard_hint_5"
-            latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="@string/alternates_for_t" />
         <Key
             latin:keyLabel="y"
             latin:keyHintIcon="@drawable/keyboard_hint_6"
-            latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="@string/alternates_for_y" />
         <Key
             latin:keyLabel="u"
             latin:keyHintIcon="@drawable/keyboard_hint_7"
-            latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="@string/alternates_for_u" />
         <Key
             latin:keyLabel="i"
             latin:keyHintIcon="@drawable/keyboard_hint_8"
-            latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="@string/alternates_for_i" />
         <Key
             latin:keyLabel="o"
             latin:keyHintIcon="@drawable/keyboard_hint_9"
-            latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="@string/alternates_for_o" />
         <Key
             latin:keyLabel="p"
             latin:keyHintIcon="@drawable/keyboard_hint_0"
-            latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="@string/alternates_for_p" />
         <Key
             latin:keyLabel="å"
@@ -89,23 +79,19 @@
     >
         <Key
             latin:keyLabel="a"
-            latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="@string/alternates_for_a"
             latin:keyWidth="8.75%p"
             latin:keyEdgeFlags="left" />
         <Key
             latin:keyLabel="s"
-            latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="@string/alternates_for_s" />
         <Key
             latin:keyLabel="d"
-            latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="@string/alternates_for_d" />
         <Key
             latin:keyLabel="f" />
         <Key
             latin:keyLabel="g"
-            latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="@string/alternates_for_g" />
         <Key
             latin:keyLabel="h" />
@@ -115,15 +101,12 @@
             latin:keyLabel="k" />
         <Key
             latin:keyLabel="l"
-            latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="@string/alternates_for_l" />
         <Key
             latin:keyLabel="@string/keylabel_for_scandinavia_row2_10"
-            latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="@string/alternates_for_scandinavia_row2_10" />
         <Key
             latin:keyLabel="@string/keylabel_for_scandinavia_row2_11"
-            latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="@string/alternates_for_scandinavia_row2_11"
             latin:keyWidth="8.75%p"
             latin:keyEdgeFlags="right" />
diff --git a/java/res/xml/kbd_qwertz_rows.xml b/java/res/xml/kbd_qwertz_rows.xml
index 4dbb641..375f123 100644
--- a/java/res/xml/kbd_qwertz_rows.xml
+++ b/java/res/xml/kbd_qwertz_rows.xml
@@ -30,53 +30,43 @@
         <Key
             latin:keyLabel="q"
             latin:keyHintIcon="@drawable/keyboard_hint_1"
-            latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="@string/alternates_for_q"
             latin:keyEdgeFlags="left" />
         <Key
             latin:keyLabel="w"
             latin:keyHintIcon="@drawable/keyboard_hint_2"
-            latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="@string/alternates_for_w" />
         <Key
             latin:keyLabel="e"
             latin:keyHintIcon="@drawable/keyboard_hint_3"
-            latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="@string/alternates_for_e" />
         <Key
             latin:keyLabel="r"
             latin:keyHintIcon="@drawable/keyboard_hint_4"
-            latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="@string/alternates_for_r" />
         <Key
             latin:keyLabel="t"
             latin:keyHintIcon="@drawable/keyboard_hint_5"
-            latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="@string/alternates_for_t" />
         <Key
             latin:keyLabel="z"
             latin:keyHintIcon="@drawable/keyboard_hint_6"
-            latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="@string/alternates_for_z" />
         <Key
             latin:keyLabel="u"
             latin:keyHintIcon="@drawable/keyboard_hint_7"
-            latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="@string/alternates_for_u" />
         <Key
             latin:keyLabel="i"
             latin:keyHintIcon="@drawable/keyboard_hint_8"
-            latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="@string/alternates_for_i" />
         <Key
             latin:keyLabel="o"
             latin:keyHintIcon="@drawable/keyboard_hint_9"
-            latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="@string/alternates_for_o" />
         <Key
             latin:keyLabel="p"
             latin:keyHintIcon="@drawable/keyboard_hint_0"
-            latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="@string/alternates_for_p"
             latin:keyEdgeFlags="right" />
     </Row>
@@ -91,23 +81,19 @@
             latin:keyEdgeFlags="left" />
         <Key
             latin:keyLabel="y"
-            latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="@string/alternates_for_y" />
         <Key
             latin:keyLabel="x" />
         <Key
             latin:keyLabel="c"
-            latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="@string/alternates_for_c" />
         <Key
             latin:keyLabel="v"
-            latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="@string/alternates_for_v" />
         <Key
             latin:keyLabel="b" />
         <Key
             latin:keyLabel="n"
-            latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="@string/alternates_for_n" />
         <Key
             latin:keyLabel="m" />
diff --git a/java/res/xml/kbd_symbols.xml b/java/res/xml/kbd_symbols.xml
index a7da011..5d62dea 100644
--- a/java/res/xml/kbd_symbols.xml
+++ b/java/res/xml/kbd_symbols.xml
@@ -26,6 +26,8 @@
     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" />
@@ -34,30 +36,24 @@
     >
         <Key
             latin:keyLabel="1"
-            latin:popupKeyboard="@xml/kbd_popup_template"
-            latin:popupCharacters="¹½⅓¼⅛"
+            latin:popupCharacters="¹,½,⅓,¼,⅛"
             latin:keyEdgeFlags="left" />
         <Key
             latin:keyLabel="2"
-            latin:popupKeyboard="@xml/kbd_popup_template"
-            latin:popupCharacters="²⅔" />
+            latin:popupCharacters="²,⅔" />
         <Key
             latin:keyLabel="3"
-            latin:popupKeyboard="@xml/kbd_popup_template"
-            latin:popupCharacters="³¾⅜" />
+            latin:popupCharacters="³,¾,⅜" />
         <Key
             latin:keyLabel="4"
-            latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="⁴" />
         <Key
             latin:keyLabel="5"
-            latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="⅝" />
         <Key
             latin:keyLabel="6" />
         <Key
             latin:keyLabel="7"
-            latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="⅞" />
         <Key
             latin:keyLabel="8" />
@@ -65,8 +61,7 @@
             latin:keyLabel="9" />
         <Key
             latin:keyLabel="0"
-            latin:popupKeyboard="@xml/kbd_popup_template"
-            latin:popupCharacters="ⁿ∅"
+            latin:popupCharacters="ⁿ,∅"
             latin:keyEdgeFlags="right" />
     </Row>
     <Row>
@@ -77,34 +72,27 @@
             latin:keyLabel="\#" />
         <Key
             latin:keyLabel="$"
-            latin:popupKeyboard="@xml/kbd_popup_template"
-            latin:popupCharacters="¢£€¥₣₤₱" />
+            latin:popupCharacters="¢,£,€,¥,₣,₤,₱" />
         <Key
             latin:keyLabel="%"
-            latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="‰" />
         <Key
             latin:keyLabel="&amp;" />
         <Key
             latin:keyLabel="*"
-            latin:popupKeyboard="@xml/kbd_popup_template"
-            latin:popupCharacters="†‡★" />
+            latin:popupCharacters="†,‡,★" />
         <Key
             latin:keyLabel="-"
-            latin:popupKeyboard="@xml/kbd_popup_template"
-            latin:popupCharacters="_–—" />
+            latin:popupCharacters="_,–,—" />
         <Key
             latin:keyLabel="+"
-            latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="±" />
         <Key
             latin:keyLabel="("
-            latin:popupKeyboard="@xml/kbd_popup_template"
-            latin:popupCharacters="[{&lt;" />
+            latin:popupCharacters="[,{,&lt;" />
         <Key
             latin:keyLabel=")"
-            latin:popupKeyboard="@xml/kbd_popup_template"
-            latin:popupCharacters="]}&gt;"
+            latin:popupCharacters="],},&gt;"
             latin:keyEdgeFlags="right" />
     </Row>
     <Row>
@@ -114,16 +102,13 @@
             latin:keyEdgeFlags="left" />
         <Key
             latin:keyLabel="!"
-            latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="¡" />
         <Key
             latin:keyLabel="&quot;"
-            latin:popupKeyboard="@xml/kbd_popup_template"
-            latin:popupCharacters="“”«»˝" />
+            latin:popupCharacters="“,”,«,»,˝" />
         <Key
             latin:keyLabel="\'"
-            latin:popupKeyboard="@xml/kbd_popup_template"
-            latin:popupCharacters="‘’" />
+            latin:popupCharacters="‘,’" />
         <Key
             latin:keyLabel=":" />
         <Key
@@ -132,7 +117,6 @@
             latin:keyLabel="/" />
         <Key
             latin:keyLabel="\?"
-            latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="¿" />
         <Key
             latin:keyStyle="deleteKeyStyle"
diff --git a/java/res/xml/kbd_symbols_f1.xml b/java/res/xml/kbd_symbols_f1.xml
index 07ee4ed..8487b61 100644
--- a/java/res/xml/kbd_symbols_f1.xml
+++ b/java/res/xml/kbd_symbols_f1.xml
@@ -33,8 +33,8 @@
         >
             <Key
                 latin:keyLabel=","
-                latin:popupKeyboard="@xml/popup_comma"
                 latin:keyHintIcon="@drawable/hint_popup"
+                latin:popupCharacters="@string/alternates_for_settings_comma"
                 latin:keyStyle="functionalKeyStyle" />
         </case>
     </switch>
diff --git a/java/res/xml/kbd_symbols_row4.xml b/java/res/xml/kbd_symbols_row4.xml
index 1a5417d..b330095 100644
--- a/java/res/xml/kbd_symbols_row4.xml
+++ b/java/res/xml/kbd_symbols_row4.xml
@@ -40,7 +40,8 @@
                 <Key
                     latin:keyLabel="."
                     latin:keyHintIcon="@drawable/hint_popup"
-                    latin:popupKeyboard="@xml/popup_punctuation"
+                    latin:popupCharacters="@string/alternates_for_punctuation"
+                    latin:maxPopupKeyboardColumn="7"
                     latin:keyStyle="functionalKeyStyle" />
                 <switch>
                     <case
@@ -76,7 +77,8 @@
                 <Key
                     latin:keyLabel="."
                     latin:keyHintIcon="@drawable/hint_popup"
-                    latin:popupKeyboard="@xml/popup_punctuation"
+                    latin:popupCharacters="@string/alternates_for_punctuation"
+                    latin:maxPopupKeyboardColumn="7"
                     latin:keyStyle="functionalKeyStyle" />
                 <switch>
                     <case
diff --git a/java/res/xml/kbd_symbols_shift.xml b/java/res/xml/kbd_symbols_shift.xml
index ee8d882..368ee80 100644
--- a/java/res/xml/kbd_symbols_shift.xml
+++ b/java/res/xml/kbd_symbols_shift.xml
@@ -26,6 +26,8 @@
     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" />
@@ -41,13 +43,11 @@
             latin:keyLabel="|" />
         <Key
             latin:keyLabel="•"
-            latin:popupKeyboard="@xml/kbd_popup_template"
-            latin:popupCharacters="♪♥♠♦♣" />
+            latin:popupCharacters="♪,♥,♠,♦,♣" />
         <Key
             latin:keyLabel="√" />
         <Key
             latin:keyLabel="π"
-            latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="Π" />
         <Key
             latin:keyLabel="÷" />
@@ -73,14 +73,12 @@
             latin:keyLabel="°" />
         <Key
             latin:keyLabel="^"
-            latin:popupKeyboard="@xml/kbd_popup_template"
-            latin:popupCharacters="↑↓←→" />
+            latin:popupCharacters="↑,↓,←,→" />
         <Key
             latin:keyLabel="_" />
         <Key
             latin:keyLabel="="
-            latin:popupKeyboard="@xml/kbd_popup_template"
-            latin:popupCharacters="≠≈∞" />
+            latin:popupCharacters="≠,≈,∞" />
         <Key
             latin:keyLabel="[" />
         <Key
@@ -100,18 +98,15 @@
             latin:keyLabel="©" />
         <Key
             latin:keyLabel="¶"
-            latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="§" />
         <Key
             latin:keyLabel="\\" />
         <Key
             latin:keyLabel="&lt;"
-            latin:popupKeyboard="@xml/kbd_popup_template"
-            latin:popupCharacters="≤«‹" />
+            latin:popupCharacters="≤,«,‹" />
         <Key
             latin:keyLabel="&gt;"
-            latin:popupKeyboard="@xml/kbd_popup_template"
-            latin:popupCharacters="≥»›" />
+            latin:popupCharacters="≥,»,›" />
         <Key
             latin:keyStyle="deleteKeyStyle"
             latin:keyWidth="15%p"
diff --git a/java/res/xml/popup_at.xml b/java/res/xml/popup_at.xml
deleted file mode 100644
index 92ad816..0000000
--- a/java/res/xml/popup_at.xml
+++ /dev/null
@@ -1,39 +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.
-*/
--->
-
-<Keyboard
-    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
-    latin:keyWidth="10%p"
-    latin:horizontalGap="0px"
-    latin:verticalGap="0px"
-    latin:rowHeight="@dimen/popup_key_height"
->
-    <Row
-        latin:rowEdgeFlags="top|bottom"
-    >
-        <Key
-            latin:codes="@integer/key_settings"
-            latin:keyIcon="@drawable/sym_keyboard_settings"
-            latin:keyEdgeFlags="left" />
-        <Key
-            latin:keyLabel="\@"
-            latin:keyEdgeFlags="right" />
-    </Row>
-</Keyboard>
diff --git a/java/res/xml/popup_comma.xml b/java/res/xml/popup_comma.xml
deleted file mode 100644
index 9ef49df..0000000
--- a/java/res/xml/popup_comma.xml
+++ /dev/null
@@ -1,39 +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.
-*/
--->
-
-<Keyboard
-    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
-    latin:keyWidth="10%p"
-    latin:horizontalGap="0px"
-    latin:verticalGap="0px"
-    latin:rowHeight="@dimen/popup_key_height"
->
-    <Row
-        latin:rowEdgeFlags="top|bottom"
-    >
-        <Key
-            latin:codes="@integer/key_settings"
-            latin:keyIcon="@drawable/sym_keyboard_settings"
-            latin:keyEdgeFlags="left" />
-        <Key
-            latin:keyLabel=","
-            latin:keyEdgeFlags="right" />
-    </Row>
-</Keyboard>
diff --git a/java/res/xml/popup_domains.xml b/java/res/xml/popup_domains.xml
deleted file mode 100644
index 9fbbdec..0000000
--- a/java/res/xml/popup_domains.xml
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/* 
-**
-** Copyright 2008, 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:keyWidth="15%p"
-    latin:horizontalGap="0px"
-    latin:verticalGap="0px"
-    latin:rowHeight="@dimen/popup_key_height"
->
-    <Row
-        latin:rowEdgeFlags="top|bottom"
-    >
-        <Key
-            latin:keyLabel="@string/popular_domain_1"
-            latin:keyOutputText="@string/popular_domain_1"
-            latin:keyEdgeFlags="left" />
-        <Key
-            latin:keyLabel="@string/popular_domain_2"
-            latin:keyOutputText="@string/popular_domain_2" />
-        <Key
-            latin:keyLabel="@string/popular_domain_3"
-            latin:keyOutputText="@string/popular_domain_3" />
-        <Key
-            latin:keyLabel="@string/popular_domain_4"
-            latin:keyOutputText="@string/popular_domain_4"
-            latin:keyEdgeFlags="right" />
-    </Row>
-</Keyboard>
diff --git a/java/res/xml/popup_mic.xml b/java/res/xml/popup_mic.xml
deleted file mode 100644
index 1851eba..0000000
--- a/java/res/xml/popup_mic.xml
+++ /dev/null
@@ -1,40 +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.
-*/
--->
-
-<Keyboard
-    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
-    latin:keyWidth="10%p"
-    latin:horizontalGap="0px"
-    latin:verticalGap="0px"
-    latin:rowHeight="@dimen/popup_key_height"
->
-    <Row
-        latin:rowEdgeFlags="top|bottom"
-    >
-        <Key
-            latin:codes="@integer/key_settings"
-            latin:keyIcon="@drawable/sym_keyboard_settings"
-            latin:keyEdgeFlags="left" />
-        <Key
-            latin:codes="@integer/key_voice"
-            latin:keyIcon="@drawable/sym_keyboard_mic"
-            latin:keyEdgeFlags="right" />
-    </Row>
-</Keyboard>
diff --git a/java/res/xml/popup_punctuation.xml b/java/res/xml/popup_punctuation.xml
deleted file mode 100644
index 6c778c7..0000000
--- a/java/res/xml/popup_punctuation.xml
+++ /dev/null
@@ -1,68 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/* 
-**
-** Copyright 2008, 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:keyWidth="10%p"
-    latin:horizontalGap="0px"
-    latin:verticalGap="0px"
-    latin:rowHeight="@dimen/popup_key_height"
->
-    <Row
-        latin:rowEdgeFlags="top"
-    >
-        <Key
-            latin:keyLabel=":"
-            latin:keyEdgeFlags="left" />
-        <Key
-            latin:keyLabel="/" />
-        <Key
-            latin:keyLabel="&amp;" />
-        <Key
-            latin:keyLabel="(" />
-        <Key
-            latin:keyLabel=")" />
-        <Key
-            latin:keyLabel="-" />
-        <Key
-            latin:keyLabel="+"
-            latin:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        latin:rowEdgeFlags="bottom"
-    >
-        <Key
-            latin:keyLabel=";"
-            latin:keyEdgeFlags="left" />
-        <Key
-            latin:keyLabel="\@" />
-        <Key
-            latin:keyLabel="\'" />
-        <Key
-            latin:keyLabel="&quot;" />
-        <Key
-            latin:keyLabel="\?" />
-        <Key
-            latin:keyLabel="!" />
-        <Key
-            latin:keyLabel=","
-            latin:keyEdgeFlags="right" />
-    </Row>
-</Keyboard>
diff --git a/java/res/xml/popup_slash.xml b/java/res/xml/popup_slash.xml
deleted file mode 100644
index 611500c..0000000
--- a/java/res/xml/popup_slash.xml
+++ /dev/null
@@ -1,39 +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.
-*/
--->
-
-<Keyboard
-    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
-    latin:keyWidth="10%p"
-    latin:horizontalGap="0px"
-    latin:verticalGap="0px"
-    latin:rowHeight="@dimen/popup_key_height"
->
-    <Row
-        latin:rowEdgeFlags="top|bottom"
-    >
-        <Key
-            latin:codes="@integer/key_settings"
-            latin:keyIcon="@drawable/sym_keyboard_settings"
-            latin:keyEdgeFlags="left" />
-        <Key
-            latin:keyLabel="/"
-            latin:keyEdgeFlags="right" />
-    </Row>
-</Keyboard>
diff --git a/java/res/xml/popup_smileys.xml b/java/res/xml/popup_smileys.xml
deleted file mode 100644
index b876672..0000000
--- a/java/res/xml/popup_smileys.xml
+++ /dev/null
@@ -1,89 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/* 
-**
-** Copyright 2008, 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:keyWidth="15%p"
-    latin:horizontalGap="0px"
-    latin:verticalGap="0px"
-    latin:rowHeight="@dimen/popup_key_height"
->
-    <Row
-        latin:rowEdgeFlags="top"
-    >
-        <Key
-            latin:keyLabel=":-)"
-            latin:keyOutputText=":-) "
-            latin:keyEdgeFlags="left" />
-        <Key
-            latin:keyLabel=":-("
-            latin:keyOutputText=":-( " />
-        <Key
-            latin:keyLabel=";-)"
-            latin:keyOutputText=";-) " />
-        <Key
-            latin:keyLabel=":-P"
-            latin:keyOutputText=":-P " />
-        <Key
-            latin:keyLabel="=-O"
-            latin:keyOutputText="=-O "
-            latin:keyEdgeFlags="right" />
-    </Row>
-    <Row>
-        <Key
-            latin:keyLabel=":-*"
-            latin:keyOutputText=":-* "
-            latin:keyEdgeFlags="left" />
-        <Key
-            latin:keyLabel=":O"
-            latin:keyOutputText=":O " />
-        <Key
-            latin:keyLabel="B-)"
-            latin:keyOutputText="B-) " />
-        <Key
-            latin:keyLabel=":-$"
-            latin:keyOutputText=":-$ " />
-        <Key
-            latin:keyLabel=":-!"
-            latin:keyOutputText=":-! "
-            latin:keyEdgeFlags="right" />
-    </Row>
-    <Row
-        latin:rowEdgeFlags="bottom"
-    >
-        <Key
-            latin:keyLabel=":-["
-            latin:keyOutputText=":-[ "
-            latin:keyEdgeFlags="left" />
-        <Key
-            latin:keyLabel="O:-)"
-            latin:keyOutputText="O:-) " />
-        <Key
-            latin:keyLabel=":-\\"
-            latin:keyOutputText=":-\\ " />
-        <Key
-            latin:keyLabel=":'("
-            latin:keyOutputText=":'( " />
-        <Key
-            latin:keyLabel=":-D"
-            latin:keyOutputText=":-D "
-            latin:keyEdgeFlags="right" />
-    </Row>
-</Keyboard>
diff --git a/java/res/xml/prefs.xml b/java/res/xml/prefs.xml
index 47b3b45..3b20298 100644
--- a/java/res/xml/prefs.xml
+++ b/java/res/xml/prefs.xml
@@ -34,7 +34,7 @@
             android:key="popup_on"
             android:title="@string/popup_on_keypress"
             android:persistent="true"
-            android:defaultValue="@bool/default_popup_preview"
+            android:defaultValue="@bool/config_default_popup_preview"
             />
 
     <CheckBoxPreference