LatinIME: Add number row option

Includes I00c2d57755dbac2fad7b53cc6d6164159247e757.

Co-authored-by: LuK1337 <priv.luk@gmail.com>
Change-Id: I6227cd517fb1d56e4b3daf1c03f03fa0e6ed736f
diff --git a/java/res/values/attrs.xml b/java/res/values/attrs.xml
index 69a5d59..a41427e 100644
--- a/java/res/values/attrs.xml
+++ b/java/res/values/attrs.xml
@@ -502,6 +502,7 @@
         <attr name="passwordInput" format="boolean" />
         <attr name="clobberSettingsKey" format="boolean" />
         <attr name="hasShortcutKey" format="boolean" />
+        <attr name="numberRowEnabled" format="boolean" />
         <attr name="languageSwitchKeyEnabled" format="boolean" />
         <attr name="isMultiLine" format="boolean" />
         <attr name="imeAction" format="enum">
diff --git a/java/res/values/cm_strings.xml b/java/res/values/cm_strings.xml
index 1efd430..d3044ad 100644
--- a/java/res/values/cm_strings.xml
+++ b/java/res/values/cm_strings.xml
@@ -31,4 +31,8 @@
 
     <!-- Title of the settings for setting keyboard height -->
     <string name="prefs_keyboard_height_scale">Keyboard height scale</string>
+
+    <!-- Preference item for enabling the number row -->
+    <string name="number_row">Number row</string>
+    <string name="number_row_summary">Always show a number row for all layouts that feature 4 rows of keys</string>
 </resources>
diff --git a/java/res/xml-sw600dp-land/rows_qwerty.xml b/java/res/xml-sw600dp-land/rows_qwerty.xml
index b580dcf..84013b8 100644
--- a/java/res/xml-sw600dp-land/rows_qwerty.xml
+++ b/java/res/xml-sw600dp-land/rows_qwerty.xml
@@ -23,6 +23,7 @@
 >
     <include
         latin:keyboardLayout="@xml/key_styles_common" />
+    <include latin:keyboardLayout="@xml/row_number_keys" />
     <!-- First row -->
     <Row>
         <switch>
diff --git a/java/res/xml-sw600dp/rows_arabic.xml b/java/res/xml-sw600dp/rows_arabic.xml
index 1b7b416..3d67b54 100644
--- a/java/res/xml-sw600dp/rows_arabic.xml
+++ b/java/res/xml-sw600dp/rows_arabic.xml
@@ -20,6 +20,7 @@
 
 <merge xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin">
     <include latin:keyboardLayout="@xml/key_styles_common" />
+    <include latin:keyboardLayout="@xml/row_number_keys" />
     <Row
         latin:keyWidth="8.182%p"
         latin:keyLabelFlags="fontNormal"
diff --git a/java/res/xml-sw600dp/rows_azerty.xml b/java/res/xml-sw600dp/rows_azerty.xml
index cdc9185..3b3a1e4 100644
--- a/java/res/xml-sw600dp/rows_azerty.xml
+++ b/java/res/xml-sw600dp/rows_azerty.xml
@@ -23,6 +23,7 @@
 >
     <include
         latin:keyboardLayout="@xml/key_styles_common" />
+    <include latin:keyboardLayout="@xml/row_number_keys" />
     <Row
         latin:keyWidth="9.0%p"
     >
diff --git a/java/res/xml-sw600dp/rows_bengali.xml b/java/res/xml-sw600dp/rows_bengali.xml
index 10b3e4f..77caa2a 100644
--- a/java/res/xml-sw600dp/rows_bengali.xml
+++ b/java/res/xml-sw600dp/rows_bengali.xml
@@ -20,6 +20,7 @@
 
 <merge xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin">
     <include latin:keyboardLayout="@xml/key_styles_common" />
+    <include latin:keyboardLayout="@xml/row_number_keys" />
     <Row
         latin:keyWidth="8.182%p"
         latin:keyLabelFlags="fontNormal"
diff --git a/java/res/xml-sw600dp/rows_bengali_akkhor.xml b/java/res/xml-sw600dp/rows_bengali_akkhor.xml
index 3e81a14..139340c 100644
--- a/java/res/xml-sw600dp/rows_bengali_akkhor.xml
+++ b/java/res/xml-sw600dp/rows_bengali_akkhor.xml
@@ -20,6 +20,7 @@
 
 <merge xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin" >
     <include latin:keyboardLayout="@xml/key_styles_common" />
+    <include latin:keyboardLayout="@xml/row_number_keys" />
     <Row
         latin:keyLabelFlags="fontNormal"
         latin:keyWidth="8.182%p" >
diff --git a/java/res/xml-sw600dp/rows_bepo.xml b/java/res/xml-sw600dp/rows_bepo.xml
index 9916561..66689de 100644
--- a/java/res/xml-sw600dp/rows_bepo.xml
+++ b/java/res/xml-sw600dp/rows_bepo.xml
@@ -18,6 +18,7 @@
 >
     <include
         latin:keyboardLayout="@xml/key_styles_common" />
+    <include latin:keyboardLayout="@xml/row_number_keys" />
     <Row
         latin:keyWidth="9.0%p"
     >
diff --git a/java/res/xml-sw600dp/rows_bulgarian.xml b/java/res/xml-sw600dp/rows_bulgarian.xml
index c73aa1c..3d43998 100644
--- a/java/res/xml-sw600dp/rows_bulgarian.xml
+++ b/java/res/xml-sw600dp/rows_bulgarian.xml
@@ -23,6 +23,7 @@
 >
     <include
         latin:keyboardLayout="@xml/key_styles_common" />
+    <include latin:keyboardLayout="@xml/row_number_keys" />
     <Row
         latin:keyWidth="8.182%p"
     >
diff --git a/java/res/xml-sw600dp/rows_bulgarian_bds.xml b/java/res/xml-sw600dp/rows_bulgarian_bds.xml
index bc773ee..c3ff43a 100644
--- a/java/res/xml-sw600dp/rows_bulgarian_bds.xml
+++ b/java/res/xml-sw600dp/rows_bulgarian_bds.xml
@@ -23,6 +23,7 @@
 >
     <include
         latin:keyboardLayout="@xml/key_styles_common" />
+    <include latin:keyboardLayout="@xml/row_number_keys" />
     <Row
         latin:keyWidth="8.182%p"
     >
diff --git a/java/res/xml-sw600dp/rows_bulgarian_bekl.xml b/java/res/xml-sw600dp/rows_bulgarian_bekl.xml
index af2a9a1..4e1fd68 100644
--- a/java/res/xml-sw600dp/rows_bulgarian_bekl.xml
+++ b/java/res/xml-sw600dp/rows_bulgarian_bekl.xml
@@ -23,6 +23,7 @@
 >
     <include
         latin:keyboardLayout="@xml/key_styles_common" />
+    <include latin:keyboardLayout="@xml/row_number_keys" />
     <Row
         latin:keyWidth="8.182%p"
     >
diff --git a/java/res/xml-sw600dp/rows_colemak.xml b/java/res/xml-sw600dp/rows_colemak.xml
index 7559bfb..5269aa1 100644
--- a/java/res/xml-sw600dp/rows_colemak.xml
+++ b/java/res/xml-sw600dp/rows_colemak.xml
@@ -23,6 +23,7 @@
 >
     <include
         latin:keyboardLayout="@xml/key_styles_common" />
+    <include latin:keyboardLayout="@xml/row_number_keys" />
     <Row
         latin:keyWidth="9.0%p"
     >
diff --git a/java/res/xml-sw600dp/rows_dvorak.xml b/java/res/xml-sw600dp/rows_dvorak.xml
index c8f5e3a..7906e99 100644
--- a/java/res/xml-sw600dp/rows_dvorak.xml
+++ b/java/res/xml-sw600dp/rows_dvorak.xml
@@ -23,6 +23,7 @@
 >
     <include
         latin:keyboardLayout="@xml/key_styles_common" />
+    <include latin:keyboardLayout="@xml/row_number_keys" />
     <Row
         latin:keyWidth="9.0%p"
     >
diff --git a/java/res/xml-sw600dp/rows_east_slavic.xml b/java/res/xml-sw600dp/rows_east_slavic.xml
index c5045ff..fda4770 100644
--- a/java/res/xml-sw600dp/rows_east_slavic.xml
+++ b/java/res/xml-sw600dp/rows_east_slavic.xml
@@ -23,6 +23,7 @@
 >
     <include
         latin:keyboardLayout="@xml/key_styles_common" />
+    <include latin:keyboardLayout="@xml/row_number_keys" />
     <Row
         latin:keyWidth="8.182%p"
     >
diff --git a/java/res/xml-sw600dp/rows_farsi.xml b/java/res/xml-sw600dp/rows_farsi.xml
index 1d098df..26b54ea 100644
--- a/java/res/xml-sw600dp/rows_farsi.xml
+++ b/java/res/xml-sw600dp/rows_farsi.xml
@@ -20,6 +20,7 @@
 
 <merge xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin">
     <include latin:keyboardLayout="@xml/key_styles_common" />
+    <include latin:keyboardLayout="@xml/row_number_keys" />
     <Row
         latin:keyWidth="8.182%p"
         latin:keyLabelFlags="fontNormal"
diff --git a/java/res/xml-sw600dp/rows_georgian.xml b/java/res/xml-sw600dp/rows_georgian.xml
index 891cbc1..7ec671c 100644
--- a/java/res/xml-sw600dp/rows_georgian.xml
+++ b/java/res/xml-sw600dp/rows_georgian.xml
@@ -23,6 +23,7 @@
 >
     <include
         latin:keyboardLayout="@xml/key_styles_common" />
+    <include latin:keyboardLayout="@xml/row_number_keys" />
     <Row
         latin:keyWidth="9.0%p"
     >
diff --git a/java/res/xml-sw600dp/rows_greek.xml b/java/res/xml-sw600dp/rows_greek.xml
index 60ee478..460f5af 100644
--- a/java/res/xml-sw600dp/rows_greek.xml
+++ b/java/res/xml-sw600dp/rows_greek.xml
@@ -23,6 +23,7 @@
 >
     <include
         latin:keyboardLayout="@xml/key_styles_common" />
+    <include latin:keyboardLayout="@xml/row_number_keys" />
     <Row
         latin:keyWidth="9.0%p"
     >
diff --git a/java/res/xml-sw600dp/rows_hebrew.xml b/java/res/xml-sw600dp/rows_hebrew.xml
index 86b3420..c42758b 100644
--- a/java/res/xml-sw600dp/rows_hebrew.xml
+++ b/java/res/xml-sw600dp/rows_hebrew.xml
@@ -23,6 +23,7 @@
 >
     <include
         latin:keyboardLayout="@xml/key_styles_common" />
+    <include latin:keyboardLayout="@xml/row_number_keys" />
     <Row
         latin:keyWidth="9.0%p"
     >
diff --git a/java/res/xml-sw600dp/rows_hindi.xml b/java/res/xml-sw600dp/rows_hindi.xml
index 42b92a7..a2a2940 100644
--- a/java/res/xml-sw600dp/rows_hindi.xml
+++ b/java/res/xml-sw600dp/rows_hindi.xml
@@ -20,6 +20,7 @@
 
 <merge xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin">
     <include latin:keyboardLayout="@xml/key_styles_common" />
+    <include latin:keyboardLayout="@xml/row_number_keys" />
     <Row
         latin:keyWidth="8.182%p"
         latin:keyLabelFlags="fontNormal"
diff --git a/java/res/xml-sw600dp/rows_hindi_compact.xml b/java/res/xml-sw600dp/rows_hindi_compact.xml
index 6493451..9459c6f 100644
--- a/java/res/xml-sw600dp/rows_hindi_compact.xml
+++ b/java/res/xml-sw600dp/rows_hindi_compact.xml
@@ -20,6 +20,7 @@
 
 <merge xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin">
     <include latin:keyboardLayout="@xml/key_styles_common" />
+    <include latin:keyboardLayout="@xml/row_number_keys" />
     <Row
         latin:keyWidth="8.182%p"
         latin:keyLabelFlags="fontNormal"
diff --git a/java/res/xml-sw600dp/rows_kannada.xml b/java/res/xml-sw600dp/rows_kannada.xml
index 55eedc5..53c1769 100644
--- a/java/res/xml-sw600dp/rows_kannada.xml
+++ b/java/res/xml-sw600dp/rows_kannada.xml
@@ -20,6 +20,7 @@
 
 <merge xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin">
     <include latin:keyboardLayout="@xml/key_styles_common" />
+    <include latin:keyboardLayout="@xml/row_number_keys" />
     <Row
         latin:keyWidth="8.182%p"
         latin:keyLabelFlags="fontNormal|autoXScale"
diff --git a/java/res/xml-sw600dp/rows_malayalam.xml b/java/res/xml-sw600dp/rows_malayalam.xml
index 1df7e6e..9cd6cf5 100644
--- a/java/res/xml-sw600dp/rows_malayalam.xml
+++ b/java/res/xml-sw600dp/rows_malayalam.xml
@@ -20,6 +20,7 @@
 
 <merge xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin">
     <include latin:keyboardLayout="@xml/key_styles_common" />
+    <include latin:keyboardLayout="@xml/row_number_keys" />
     <Row
         latin:keyWidth="8.182%p"
         latin:keyLabelFlags="fontNormal|autoXScale"
diff --git a/java/res/xml-sw600dp/rows_marathi.xml b/java/res/xml-sw600dp/rows_marathi.xml
index c77bea5..f0ef4de 100644
--- a/java/res/xml-sw600dp/rows_marathi.xml
+++ b/java/res/xml-sw600dp/rows_marathi.xml
@@ -20,6 +20,7 @@
 
 <merge xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin">
     <include latin:keyboardLayout="@xml/key_styles_common" />
+    <include latin:keyboardLayout="@xml/row_number_keys" />
     <Row
         latin:keyWidth="8.182%p"
         latin:keyLabelFlags="fontNormal"
diff --git a/java/res/xml-sw600dp/rows_mongolian.xml b/java/res/xml-sw600dp/rows_mongolian.xml
index 8e39e62..e941c7f 100644
--- a/java/res/xml-sw600dp/rows_mongolian.xml
+++ b/java/res/xml-sw600dp/rows_mongolian.xml
@@ -23,6 +23,7 @@
 >
     <include
         latin:keyboardLayout="@xml/key_styles_common" />
+    <include latin:keyboardLayout="@xml/row_number_keys" />
     <Row
         latin:keyWidth="8.182%p"
     >
diff --git a/java/res/xml-sw600dp/rows_nepali_romanized.xml b/java/res/xml-sw600dp/rows_nepali_romanized.xml
index 41cd2f9..559cde4 100644
--- a/java/res/xml-sw600dp/rows_nepali_romanized.xml
+++ b/java/res/xml-sw600dp/rows_nepali_romanized.xml
@@ -20,6 +20,7 @@
 
 <merge xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin">
     <include latin:keyboardLayout="@xml/key_styles_common" />
+    <include latin:keyboardLayout="@xml/row_number_keys" />
     <Row
         latin:keyWidth="8.182%p"
         latin:keyLabelFlags="fontNormal"
diff --git a/java/res/xml-sw600dp/rows_nepali_traditional.xml b/java/res/xml-sw600dp/rows_nepali_traditional.xml
index d23ca24..d75113f 100644
--- a/java/res/xml-sw600dp/rows_nepali_traditional.xml
+++ b/java/res/xml-sw600dp/rows_nepali_traditional.xml
@@ -20,6 +20,7 @@
 
 <merge xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin">
     <include latin:keyboardLayout="@xml/key_styles_common" />
+    <include latin:keyboardLayout="@xml/row_number_keys" />
     <Row
         latin:keyWidth="8.182%p"
         latin:keyLabelFlags="fontNormal"
diff --git a/java/res/xml-sw600dp/rows_nordic.xml b/java/res/xml-sw600dp/rows_nordic.xml
index 56fa406..bebbb1f 100644
--- a/java/res/xml-sw600dp/rows_nordic.xml
+++ b/java/res/xml-sw600dp/rows_nordic.xml
@@ -23,6 +23,7 @@
 >
     <include
         latin:keyboardLayout="@xml/key_styles_common" />
+    <include latin:keyboardLayout="@xml/row_number_keys" />
     <Row
         latin:keyWidth="8.182%p"
     >
diff --git a/java/res/xml-sw600dp/rows_qwerty.xml b/java/res/xml-sw600dp/rows_qwerty.xml
index 51df4b0..0750d63 100644
--- a/java/res/xml-sw600dp/rows_qwerty.xml
+++ b/java/res/xml-sw600dp/rows_qwerty.xml
@@ -23,6 +23,7 @@
 >
     <include
         latin:keyboardLayout="@xml/key_styles_common" />
+    <include latin:keyboardLayout="@xml/row_number_keys" />
     <!-- TODO: Consolidate the layout specification between protrait and landscape.
          Ideally just the keyWidth should be different and the spacer should adjust to fill
          the available space. -->
diff --git a/java/res/xml-sw600dp/rows_qwertz.xml b/java/res/xml-sw600dp/rows_qwertz.xml
index 747dafd..60dfd44 100644
--- a/java/res/xml-sw600dp/rows_qwertz.xml
+++ b/java/res/xml-sw600dp/rows_qwertz.xml
@@ -23,6 +23,7 @@
 >
     <include
         latin:keyboardLayout="@xml/key_styles_common" />
+    <include latin:keyboardLayout="@xml/row_number_keys" />
     <Row
         latin:keyWidth="9.0%p"
     >
diff --git a/java/res/xml-sw600dp/rows_serbian_qwertz.xml b/java/res/xml-sw600dp/rows_serbian_qwertz.xml
index a3fb625..ff16d66 100644
--- a/java/res/xml-sw600dp/rows_serbian_qwertz.xml
+++ b/java/res/xml-sw600dp/rows_serbian_qwertz.xml
@@ -20,6 +20,7 @@
 
 <merge xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin" >
     <include latin:keyboardLayout="@xml/key_styles_common" />
+    <include latin:keyboardLayout="@xml/row_number_keys" />
     <Row latin:keyWidth="8.182%p" >
         <include latin:keyboardLayout="@xml/rowkeys_serbian_qwertz1" />
         <Key
diff --git a/java/res/xml-sw600dp/rows_sinhala.xml b/java/res/xml-sw600dp/rows_sinhala.xml
index 2786028..7cd1004 100644
--- a/java/res/xml-sw600dp/rows_sinhala.xml
+++ b/java/res/xml-sw600dp/rows_sinhala.xml
@@ -20,6 +20,7 @@
 
 <merge xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin">
     <include latin:keyboardLayout="@xml/key_styles_common" />
+    <include latin:keyboardLayout="@xml/row_number_keys" />
     <Row
         latin:keyWidth="8.182%p"
         latin:keyLabelFlags="fontNormal|autoXScale"
diff --git a/java/res/xml-sw600dp/rows_south_slavic.xml b/java/res/xml-sw600dp/rows_south_slavic.xml
index 5053988..09d8c90 100644
--- a/java/res/xml-sw600dp/rows_south_slavic.xml
+++ b/java/res/xml-sw600dp/rows_south_slavic.xml
@@ -23,6 +23,7 @@
 >
     <include
         latin:keyboardLayout="@xml/key_styles_common" />
+    <include latin:keyboardLayout="@xml/row_number_keys" />
     <Row
         latin:keyWidth="8.182%p"
     >
diff --git a/java/res/xml-sw600dp/rows_spanish.xml b/java/res/xml-sw600dp/rows_spanish.xml
index 1092c26..55c66cd 100644
--- a/java/res/xml-sw600dp/rows_spanish.xml
+++ b/java/res/xml-sw600dp/rows_spanish.xml
@@ -23,6 +23,7 @@
 >
     <include
         latin:keyboardLayout="@xml/key_styles_common" />
+    <include latin:keyboardLayout="@xml/row_number_keys" />
     <Row
         latin:keyWidth="9.0%p"
     >
diff --git a/java/res/xml-sw600dp/rows_swiss.xml b/java/res/xml-sw600dp/rows_swiss.xml
index 4f4ca85..8c647fc 100644
--- a/java/res/xml-sw600dp/rows_swiss.xml
+++ b/java/res/xml-sw600dp/rows_swiss.xml
@@ -23,6 +23,7 @@
 >
     <include
         latin:keyboardLayout="@xml/key_styles_common" />
+    <include latin:keyboardLayout="@xml/row_number_keys" />
     <Row
         latin:keyWidth="8.182%p"
     >
diff --git a/java/res/xml-sw600dp/rows_symbols.xml b/java/res/xml-sw600dp/rows_symbols.xml
index 05e7c68..42e31f1 100644
--- a/java/res/xml-sw600dp/rows_symbols.xml
+++ b/java/res/xml-sw600dp/rows_symbols.xml
@@ -34,6 +34,18 @@
             latin:keyStyle="deleteKeyStyle"
             latin:keyWidth="fillRight" />
     </Row>
+    <switch>
+        <case
+            latin:numberRowEnabled="true"
+            >
+            <Row
+                latin:keyWidth="10%p"
+                >
+                <include
+                    latin:keyboardLayout="@xml/rowkeys_symbols_shift1" />
+            </Row>
+        </case>
+    </switch>
     <Row
         latin:keyWidth="9.0%p"
     >
diff --git a/java/res/xml-sw600dp/rows_symbols_shift.xml b/java/res/xml-sw600dp/rows_symbols_shift.xml
index 70ac42e..cc1a392 100644
--- a/java/res/xml-sw600dp/rows_symbols_shift.xml
+++ b/java/res/xml-sw600dp/rows_symbols_shift.xml
@@ -25,6 +25,7 @@
         latin:keyboardLayout="@xml/key_styles_common" />
     <include
         latin:keyboardLayout="@xml/key_styles_currency" />
+    <include latin:keyboardLayout="@xml/row_number_keys" />
     <Row
         latin:keyWidth="9.0%p"
     >
diff --git a/java/res/xml-sw600dp/rows_tamil.xml b/java/res/xml-sw600dp/rows_tamil.xml
index 785e751..8b377f8 100644
--- a/java/res/xml-sw600dp/rows_tamil.xml
+++ b/java/res/xml-sw600dp/rows_tamil.xml
@@ -20,6 +20,7 @@
 
 <merge xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin">
     <include latin:keyboardLayout="@xml/key_styles_common" />
+    <include latin:keyboardLayout="@xml/row_number_keys" />
     <Row
         latin:keyWidth="8.182%p"
         latin:keyLabelFlags="fontNormal|autoXScale"
diff --git a/java/res/xml-sw600dp/rows_telugu.xml b/java/res/xml-sw600dp/rows_telugu.xml
index c9aeb7e..0eb339d 100644
--- a/java/res/xml-sw600dp/rows_telugu.xml
+++ b/java/res/xml-sw600dp/rows_telugu.xml
@@ -20,6 +20,7 @@
 
 <merge xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin">
     <include latin:keyboardLayout="@xml/key_styles_common" />
+    <include latin:keyboardLayout="@xml/row_number_keys" />
     <Row
         latin:keyWidth="8.182%p"
         latin:keyLabelFlags="fontNormal|autoXScale"
diff --git a/java/res/xml-sw600dp/rows_uzbek.xml b/java/res/xml-sw600dp/rows_uzbek.xml
index 3cd9940..4cb3ed2 100644
--- a/java/res/xml-sw600dp/rows_uzbek.xml
+++ b/java/res/xml-sw600dp/rows_uzbek.xml
@@ -20,6 +20,7 @@
 
 <merge xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin" >
     <include latin:keyboardLayout="@xml/key_styles_common" />
+    <include latin:keyboardLayout="@xml/row_number_keys" />
     <Row latin:keyWidth="8.182%p" >
         <include latin:keyboardLayout="@xml/rowkeys_uzbek1" />
         <Key
diff --git a/java/res/xml/prefs_screen_preferences.xml b/java/res/xml/prefs_screen_preferences.xml
index 101edc8..b35719d 100644
--- a/java/res/xml/prefs_screen_preferences.xml
+++ b/java/res/xml/prefs_screen_preferences.xml
@@ -25,6 +25,12 @@
         android:defaultValue="true"
         android:persistent="true" />
     <CheckBoxPreference
+        android:key="pref_show_number_row"
+        android:title="@string/number_row"
+        android:summary="@string/number_row_summary"
+        android:defaultValue="false"
+        android:persistent="true" />
+    <CheckBoxPreference
         android:key="pref_key_use_double_space_period"
         android:title="@string/use_double_space_period"
         android:summary="@string/use_double_space_period_summary"
diff --git a/java/res/xml/row_number_keys.xml b/java/res/xml/row_number_keys.xml
new file mode 100644
index 0000000..81d8f30
--- /dev/null
+++ b/java/res/xml/row_number_keys.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+     Copyright (C) 2023 The LineageOS Project
+     SPDX-License-Identifier: Apache-2.0
+-->
+<merge
+    xmlns:latin="http://schemas.android.com/apk/res-auto">
+    <switch>
+        <case
+            latin:numberRowEnabled="true"
+            >
+            <Row
+                latin:keyWidth="10%p"
+                >
+                <include
+                    latin:keyboardLayout="@xml/rowkeys_symbols1" />
+            </Row>
+        </case>
+    </switch>
+</merge>
diff --git a/java/res/xml/rows_arabic.xml b/java/res/xml/rows_arabic.xml
index 3f765f3..7ccb737 100644
--- a/java/res/xml/rows_arabic.xml
+++ b/java/res/xml/rows_arabic.xml
@@ -20,6 +20,7 @@
 
 <merge xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin">
     <include latin:keyboardLayout="@xml/key_styles_common" />
+    <include latin:keyboardLayout="@xml/row_number_keys" />
     <Row
         latin:keyWidth="9.091%p"
         latin:keyLabelFlags="fontNormal"
diff --git a/java/res/xml/rows_azerty.xml b/java/res/xml/rows_azerty.xml
index a52504c..56af006 100644
--- a/java/res/xml/rows_azerty.xml
+++ b/java/res/xml/rows_azerty.xml
@@ -23,6 +23,7 @@
 >
     <include
         latin:keyboardLayout="@xml/key_styles_common" />
+    <include latin:keyboardLayout="@xml/row_number_keys" />
     <Row
         latin:keyWidth="10%p"
     >
diff --git a/java/res/xml/rows_bengali.xml b/java/res/xml/rows_bengali.xml
index 4e4223b..f51d5ae 100644
--- a/java/res/xml/rows_bengali.xml
+++ b/java/res/xml/rows_bengali.xml
@@ -20,6 +20,7 @@
 
 <merge xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin">
     <include latin:keyboardLayout="@xml/key_styles_common" />
+    <include latin:keyboardLayout="@xml/row_number_keys" />
     <Row
         latin:keyWidth="9.091%p"
         latin:keyLabelFlags="fontNormal"
diff --git a/java/res/xml/rows_bengali_akkhor.xml b/java/res/xml/rows_bengali_akkhor.xml
index 1c7e772..73f6355 100644
--- a/java/res/xml/rows_bengali_akkhor.xml
+++ b/java/res/xml/rows_bengali_akkhor.xml
@@ -20,6 +20,7 @@
 
 <merge xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin" >
     <include latin:keyboardLayout="@xml/key_styles_common" />
+    <include latin:keyboardLayout="@xml/row_number_keys" />
     <Row
         latin:keyLabelFlags="fontNormal"
         latin:keyWidth="9.091%p" >
diff --git a/java/res/xml/rows_bepo.xml b/java/res/xml/rows_bepo.xml
index 91bc4ba..a5fe06e 100644
--- a/java/res/xml/rows_bepo.xml
+++ b/java/res/xml/rows_bepo.xml
@@ -18,6 +18,7 @@
 >
     <include
         latin:keyboardLayout="@xml/key_styles_common" />
+    <include latin:keyboardLayout="@xml/row_number_keys" />
     <Row
         latin:keyWidth="10%p"
     >
diff --git a/java/res/xml/rows_bulgarian.xml b/java/res/xml/rows_bulgarian.xml
index 883c283..6e521d6 100644
--- a/java/res/xml/rows_bulgarian.xml
+++ b/java/res/xml/rows_bulgarian.xml
@@ -23,6 +23,7 @@
 >
     <include
         latin:keyboardLayout="@xml/key_styles_common" />
+    <include latin:keyboardLayout="@xml/row_number_keys" />
     <Row
         latin:keyWidth="9.091%p"
     >
diff --git a/java/res/xml/rows_bulgarian_bds.xml b/java/res/xml/rows_bulgarian_bds.xml
index b4f3f12..79a5d39 100644
--- a/java/res/xml/rows_bulgarian_bds.xml
+++ b/java/res/xml/rows_bulgarian_bds.xml
@@ -23,6 +23,7 @@
 >
     <include
         latin:keyboardLayout="@xml/key_styles_common" />
+    <include latin:keyboardLayout="@xml/row_number_keys" />
     <Row
         latin:keyWidth="9.091%p"
     >
diff --git a/java/res/xml/rows_bulgarian_bekl.xml b/java/res/xml/rows_bulgarian_bekl.xml
index 21c89f7..5e3c728 100644
--- a/java/res/xml/rows_bulgarian_bekl.xml
+++ b/java/res/xml/rows_bulgarian_bekl.xml
@@ -23,6 +23,7 @@
 >
     <include
         latin:keyboardLayout="@xml/key_styles_common" />
+    <include latin:keyboardLayout="@xml/row_number_keys" />
     <Row
         latin:keyWidth="9.091%p"
     >
diff --git a/java/res/xml/rows_colemak.xml b/java/res/xml/rows_colemak.xml
index ec553c2..fd1a008 100644
--- a/java/res/xml/rows_colemak.xml
+++ b/java/res/xml/rows_colemak.xml
@@ -23,6 +23,7 @@
 >
     <include
         latin:keyboardLayout="@xml/key_styles_common" />
+    <include latin:keyboardLayout="@xml/row_number_keys" />
     <Row
         latin:keyWidth="10%p"
     >
diff --git a/java/res/xml/rows_dvorak.xml b/java/res/xml/rows_dvorak.xml
index f656613..fcc84e9 100644
--- a/java/res/xml/rows_dvorak.xml
+++ b/java/res/xml/rows_dvorak.xml
@@ -23,6 +23,7 @@
 >
     <include
         latin:keyboardLayout="@xml/key_styles_common" />
+    <include latin:keyboardLayout="@xml/row_number_keys" />
     <Row
         latin:keyWidth="10%p"
     >
diff --git a/java/res/xml/rows_east_slavic.xml b/java/res/xml/rows_east_slavic.xml
index 5d3d768..e63a722 100644
--- a/java/res/xml/rows_east_slavic.xml
+++ b/java/res/xml/rows_east_slavic.xml
@@ -23,6 +23,7 @@
 >
     <include
         latin:keyboardLayout="@xml/key_styles_common" />
+    <include latin:keyboardLayout="@xml/row_number_keys" />
     <Row
         latin:keyWidth="9.091%p"
     >
diff --git a/java/res/xml/rows_farsi.xml b/java/res/xml/rows_farsi.xml
index b78048c..9c57ed0 100644
--- a/java/res/xml/rows_farsi.xml
+++ b/java/res/xml/rows_farsi.xml
@@ -20,6 +20,7 @@
 
 <merge xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin">
     <include latin:keyboardLayout="@xml/key_styles_common" />
+    <include latin:keyboardLayout="@xml/row_number_keys" />
     <Row
         latin:keyWidth="9.091%p"
         latin:keyLabelFlags="fontNormal"
diff --git a/java/res/xml/rows_georgian.xml b/java/res/xml/rows_georgian.xml
index 8c81dd0..c7859af 100644
--- a/java/res/xml/rows_georgian.xml
+++ b/java/res/xml/rows_georgian.xml
@@ -23,6 +23,7 @@
 >
     <include
         latin:keyboardLayout="@xml/key_styles_common" />
+    <include latin:keyboardLayout="@xml/row_number_keys" />
     <Row
         latin:keyWidth="10%p"
     >
diff --git a/java/res/xml/rows_greek.xml b/java/res/xml/rows_greek.xml
index e00b927..04937c1 100644
--- a/java/res/xml/rows_greek.xml
+++ b/java/res/xml/rows_greek.xml
@@ -23,6 +23,7 @@
 >
     <include
         latin:keyboardLayout="@xml/key_styles_common" />
+    <include latin:keyboardLayout="@xml/row_number_keys" />
     <Row
         latin:keyWidth="10%p"
     >
diff --git a/java/res/xml/rows_hebrew.xml b/java/res/xml/rows_hebrew.xml
index f12380a..c062b89 100644
--- a/java/res/xml/rows_hebrew.xml
+++ b/java/res/xml/rows_hebrew.xml
@@ -23,6 +23,7 @@
 >
     <include
         latin:keyboardLayout="@xml/key_styles_common" />
+    <include latin:keyboardLayout="@xml/row_number_keys" />
     <Row
         latin:keyWidth="10%p"
     >
diff --git a/java/res/xml/rows_hindi.xml b/java/res/xml/rows_hindi.xml
index da869b1..0637aed 100644
--- a/java/res/xml/rows_hindi.xml
+++ b/java/res/xml/rows_hindi.xml
@@ -20,6 +20,7 @@
 
 <merge xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin">
     <include latin:keyboardLayout="@xml/key_styles_common" />
+    <include latin:keyboardLayout="@xml/row_number_keys" />
     <Row
         latin:keyWidth="9.091%p"
         latin:keyLabelFlags="fontNormal"
diff --git a/java/res/xml/rows_hindi_compact.xml b/java/res/xml/rows_hindi_compact.xml
index d21fada..ef97cb9 100644
--- a/java/res/xml/rows_hindi_compact.xml
+++ b/java/res/xml/rows_hindi_compact.xml
@@ -20,6 +20,7 @@
 
 <merge xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin">
     <include latin:keyboardLayout="@xml/key_styles_common" />
+    <include latin:keyboardLayout="@xml/row_number_keys" />
     <Row
         latin:keyWidth="9.091%p"
         latin:keyLabelFlags="fontNormal"
diff --git a/java/res/xml/rows_kannada.xml b/java/res/xml/rows_kannada.xml
index 5dc6271..a6dfc4c 100644
--- a/java/res/xml/rows_kannada.xml
+++ b/java/res/xml/rows_kannada.xml
@@ -20,6 +20,7 @@
 
 <merge xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin">
     <include latin:keyboardLayout="@xml/key_styles_common" />
+    <include latin:keyboardLayout="@xml/row_number_keys" />
     <Row
         latin:keyWidth="9.091%p"
         latin:keyLabelFlags="fontNormal|autoXScale"
diff --git a/java/res/xml/rows_malayalam.xml b/java/res/xml/rows_malayalam.xml
index 5e7a491..c8c5986 100644
--- a/java/res/xml/rows_malayalam.xml
+++ b/java/res/xml/rows_malayalam.xml
@@ -20,6 +20,7 @@
 
 <merge xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin">
     <include latin:keyboardLayout="@xml/key_styles_common" />
+    <include latin:keyboardLayout="@xml/row_number_keys" />
     <Row
         latin:keyWidth="9.091%p"
         latin:keyLabelFlags="fontNormal|autoXScale"
diff --git a/java/res/xml/rows_marathi.xml b/java/res/xml/rows_marathi.xml
index ff11adb..6bdbd87 100644
--- a/java/res/xml/rows_marathi.xml
+++ b/java/res/xml/rows_marathi.xml
@@ -20,6 +20,7 @@
 
 <merge xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin">
     <include latin:keyboardLayout="@xml/key_styles_common" />
+    <include latin:keyboardLayout="@xml/row_number_keys" />
     <Row
         latin:keyWidth="9.091%p"
         latin:keyLabelFlags="fontNormal"
diff --git a/java/res/xml/rows_mongolian.xml b/java/res/xml/rows_mongolian.xml
index a6a890a..696509d 100644
--- a/java/res/xml/rows_mongolian.xml
+++ b/java/res/xml/rows_mongolian.xml
@@ -23,6 +23,7 @@
 >
     <include
         latin:keyboardLayout="@xml/key_styles_common" />
+    <include latin:keyboardLayout="@xml/row_number_keys" />
     <Row
         latin:keyWidth="9.091%p"
     >
diff --git a/java/res/xml/rows_nepali_romanized.xml b/java/res/xml/rows_nepali_romanized.xml
index 26737ec..d948301 100644
--- a/java/res/xml/rows_nepali_romanized.xml
+++ b/java/res/xml/rows_nepali_romanized.xml
@@ -20,6 +20,7 @@
 
 <merge xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin">
     <include latin:keyboardLayout="@xml/key_styles_common" />
+    <include latin:keyboardLayout="@xml/row_number_keys" />
     <Row
         latin:keyWidth="9.091%p"
         latin:keyLabelFlags="fontNormal"
diff --git a/java/res/xml/rows_nepali_traditional.xml b/java/res/xml/rows_nepali_traditional.xml
index e2e710c..7057dac 100644
--- a/java/res/xml/rows_nepali_traditional.xml
+++ b/java/res/xml/rows_nepali_traditional.xml
@@ -21,6 +21,7 @@
 <merge xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin">
     <include latin:keyboardLayout="@xml/key_styles_common" />
     <include latin:keyboardLayout="@xml/key_styles_currency" />
+    <include latin:keyboardLayout="@xml/row_number_keys" />
     <Row
         latin:keyWidth="9.091%p"
         latin:keyLabelFlags="fontNormal"
diff --git a/java/res/xml/rows_nordic.xml b/java/res/xml/rows_nordic.xml
index 3068917..ef3f438 100644
--- a/java/res/xml/rows_nordic.xml
+++ b/java/res/xml/rows_nordic.xml
@@ -23,6 +23,7 @@
 >
     <include
         latin:keyboardLayout="@xml/key_styles_common" />
+    <include latin:keyboardLayout="@xml/row_number_keys" />
     <Row
         latin:keyWidth="9.091%p"
     >
diff --git a/java/res/xml/rows_qwerty.xml b/java/res/xml/rows_qwerty.xml
index cdd4203..7a554d4 100644
--- a/java/res/xml/rows_qwerty.xml
+++ b/java/res/xml/rows_qwerty.xml
@@ -23,6 +23,7 @@
 >
     <include
         latin:keyboardLayout="@xml/key_styles_common" />
+    <include latin:keyboardLayout="@xml/row_number_keys" />
     <Row
         latin:keyWidth="10%p"
     >
diff --git a/java/res/xml/rows_qwertz.xml b/java/res/xml/rows_qwertz.xml
index e4ba99f..4ec43a3 100644
--- a/java/res/xml/rows_qwertz.xml
+++ b/java/res/xml/rows_qwertz.xml
@@ -23,6 +23,7 @@
 >
     <include
         latin:keyboardLayout="@xml/key_styles_common" />
+    <include latin:keyboardLayout="@xml/row_number_keys" />
     <Row
         latin:keyWidth="10%p"
     >
diff --git a/java/res/xml/rows_serbian_qwertz.xml b/java/res/xml/rows_serbian_qwertz.xml
index 4be2abf..dd477b4 100644
--- a/java/res/xml/rows_serbian_qwertz.xml
+++ b/java/res/xml/rows_serbian_qwertz.xml
@@ -20,6 +20,7 @@
 
 <merge xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin" >
     <include latin:keyboardLayout="@xml/key_styles_common" />
+    <include latin:keyboardLayout="@xml/row_number_keys" />
     <Row latin:keyWidth="9.091%p" >
         <include latin:keyboardLayout="@xml/rowkeys_serbian_qwertz1" />
     </Row>
diff --git a/java/res/xml/rows_sinhala.xml b/java/res/xml/rows_sinhala.xml
index a2ba0bb..48b8398 100644
--- a/java/res/xml/rows_sinhala.xml
+++ b/java/res/xml/rows_sinhala.xml
@@ -20,6 +20,7 @@
 
 <merge xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin">
     <include latin:keyboardLayout="@xml/key_styles_common" />
+    <include latin:keyboardLayout="@xml/row_number_keys" />
     <Row
         latin:keyWidth="9.091%p"
         latin:keyLabelFlags="fontNormal|autoXScale"
diff --git a/java/res/xml/rows_south_slavic.xml b/java/res/xml/rows_south_slavic.xml
index 0544284..f8f1016 100644
--- a/java/res/xml/rows_south_slavic.xml
+++ b/java/res/xml/rows_south_slavic.xml
@@ -23,6 +23,7 @@
 >
     <include
         latin:keyboardLayout="@xml/key_styles_common" />
+    <include latin:keyboardLayout="@xml/row_number_keys" />
     <Row
         latin:keyWidth="9.091%p"
     >
diff --git a/java/res/xml/rows_spanish.xml b/java/res/xml/rows_spanish.xml
index ecda4a4..940fb56 100644
--- a/java/res/xml/rows_spanish.xml
+++ b/java/res/xml/rows_spanish.xml
@@ -23,6 +23,7 @@
 >
     <include
         latin:keyboardLayout="@xml/key_styles_common" />
+    <include latin:keyboardLayout="@xml/row_number_keys" />
     <Row
         latin:keyWidth="10%p"
     >
diff --git a/java/res/xml/rows_swiss.xml b/java/res/xml/rows_swiss.xml
index 03e4129..b41a76c 100644
--- a/java/res/xml/rows_swiss.xml
+++ b/java/res/xml/rows_swiss.xml
@@ -23,6 +23,7 @@
 >
     <include
         latin:keyboardLayout="@xml/key_styles_common" />
+    <include latin:keyboardLayout="@xml/row_number_keys" />
     <Row
         latin:keyWidth="9.091%p"
     >
diff --git a/java/res/xml/rows_symbols.xml b/java/res/xml/rows_symbols.xml
index 6fd876f..828d111 100644
--- a/java/res/xml/rows_symbols.xml
+++ b/java/res/xml/rows_symbols.xml
@@ -31,6 +31,18 @@
         <include
             latin:keyboardLayout="@xml/rowkeys_symbols1" />
     </Row>
+    <switch>
+        <case
+            latin:numberRowEnabled="true"
+            >
+            <Row
+                latin:keyWidth="10%p"
+                >
+                <include
+                    latin:keyboardLayout="@xml/rowkeys_symbols_shift1" />
+            </Row>
+        </case>
+    </switch>
     <Row
         latin:keyWidth="10%p"
     >
diff --git a/java/res/xml/rows_symbols_shift.xml b/java/res/xml/rows_symbols_shift.xml
index 64f6e61..6adc3cc 100644
--- a/java/res/xml/rows_symbols_shift.xml
+++ b/java/res/xml/rows_symbols_shift.xml
@@ -25,6 +25,7 @@
         latin:keyboardLayout="@xml/key_styles_common" />
     <include
         latin:keyboardLayout="@xml/key_styles_currency" />
+    <include latin:keyboardLayout="@xml/row_number_keys" />
     <Row
         latin:keyWidth="10%p"
     >
diff --git a/java/res/xml/rows_tamil.xml b/java/res/xml/rows_tamil.xml
index 3aa2c8d..201ea1a 100644
--- a/java/res/xml/rows_tamil.xml
+++ b/java/res/xml/rows_tamil.xml
@@ -20,6 +20,7 @@
 
 <merge xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin">
     <include latin:keyboardLayout="@xml/key_styles_common" />
+    <include latin:keyboardLayout="@xml/row_number_keys" />
     <Row
         latin:keyWidth="9.091%p"
         latin:keyLabelFlags="fontNormal|autoXScale"
diff --git a/java/res/xml/rows_telugu.xml b/java/res/xml/rows_telugu.xml
index 4a31d5d..08f2f67 100644
--- a/java/res/xml/rows_telugu.xml
+++ b/java/res/xml/rows_telugu.xml
@@ -20,6 +20,7 @@
 
 <merge xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin">
     <include latin:keyboardLayout="@xml/key_styles_common" />
+    <include latin:keyboardLayout="@xml/row_number_keys" />
     <Row
         latin:keyWidth="9.091%p"
         latin:keyLabelFlags="fontNormal|autoXScale"
diff --git a/java/res/xml/rows_uzbek.xml b/java/res/xml/rows_uzbek.xml
index ae655d8..c29c738 100644
--- a/java/res/xml/rows_uzbek.xml
+++ b/java/res/xml/rows_uzbek.xml
@@ -20,6 +20,7 @@
 
 <merge xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin" >
     <include latin:keyboardLayout="@xml/key_styles_common" />
+    <include latin:keyboardLayout="@xml/row_number_keys" />
     <Row latin:keyWidth="9.091%p" >
         <include latin:keyboardLayout="@xml/rowkeys_uzbek1" />
     </Row>
diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardId.java b/java/src/com/android/inputmethod/keyboard/KeyboardId.java
index 7352f91..c9d3073 100644
--- a/java/src/com/android/inputmethod/keyboard/KeyboardId.java
+++ b/java/src/com/android/inputmethod/keyboard/KeyboardId.java
@@ -78,6 +78,7 @@
     public final int mElementId;
     public final EditorInfo mEditorInfo;
     public final boolean mClobberSettingsKey;
+    public final boolean mNumberRowEnabled;
     public final boolean mLanguageSwitchKeyEnabled;
     public final String mCustomActionLabel;
     public final boolean mHasShortcutKey;
@@ -93,6 +94,7 @@
         mElementId = elementId;
         mEditorInfo = params.mEditorInfo;
         mClobberSettingsKey = params.mNoSettingsKey;
+        mNumberRowEnabled = params.mNumberRowEnabled;
         mLanguageSwitchKeyEnabled = params.mLanguageSwitchKeyEnabled;
         mCustomActionLabel = (mEditorInfo.actionLabel != null)
                 ? mEditorInfo.actionLabel.toString() : null;
@@ -110,6 +112,7 @@
                 id.mHeight,
                 id.passwordInput(),
                 id.mClobberSettingsKey,
+                id.mNumberRowEnabled,
                 id.mHasShortcutKey,
                 id.mLanguageSwitchKeyEnabled,
                 id.isMultiLine(),
@@ -131,6 +134,7 @@
                 && other.mHeight == mHeight
                 && other.passwordInput() == passwordInput()
                 && other.mClobberSettingsKey == mClobberSettingsKey
+                && other.mNumberRowEnabled == mNumberRowEnabled
                 && other.mHasShortcutKey == mHasShortcutKey
                 && other.mLanguageSwitchKeyEnabled == mLanguageSwitchKeyEnabled
                 && other.isMultiLine() == isMultiLine()
@@ -200,6 +204,7 @@
                 (navigateNext() ? " navigateNext" : ""),
                 (navigatePrevious() ? " navigatePrevious" : ""),
                 (mClobberSettingsKey ? " clobberSettingsKey" : ""),
+                (mNumberRowEnabled ? " numberRowEnabled" : ""),
                 (passwordInput() ? " passwordInput" : ""),
                 (mHasShortcutKey ? " hasShortcutKey" : ""),
                 (mLanguageSwitchKeyEnabled ? " languageSwitchKeyEnabled" : ""),
diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardLayoutSet.java b/java/src/com/android/inputmethod/keyboard/KeyboardLayoutSet.java
index 26ff051..a97e5f6 100644
--- a/java/src/com/android/inputmethod/keyboard/KeyboardLayoutSet.java
+++ b/java/src/com/android/inputmethod/keyboard/KeyboardLayoutSet.java
@@ -118,6 +118,7 @@
         boolean mIsPasswordField;
         boolean mVoiceInputKeyEnabled;
         boolean mNoSettingsKey;
+        boolean mNumberRowEnabled;
         boolean mLanguageSwitchKeyEnabled;
         RichInputMethodSubtype mSubtype;
         boolean mIsSpellChecker;
@@ -322,6 +323,11 @@
             return this;
         }
 
+        public Builder setNumberRowEnabled(final boolean enabled) {
+            mParams.mNumberRowEnabled = enabled;
+            return this;
+        }
+
         public Builder setLanguageSwitchKeyEnabled(final boolean enabled) {
             mParams.mLanguageSwitchKeyEnabled = enabled;
             return this;
diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java b/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java
index 91295c7..9578b4b 100644
--- a/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java
+++ b/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java
@@ -121,6 +121,7 @@
         builder.setKeyboardGeometry(keyboardWidth, keyboardHeight);
         builder.setSubtype(mRichImm.getCurrentSubtype());
         builder.setVoiceInputKeyEnabled(settingsValues.mShowsVoiceInputKey);
+        builder.setNumberRowEnabled(settingsValues.mShowNumberRow);
         builder.setLanguageSwitchKeyEnabled(mLatinIME.shouldShowLanguageSwitchKey());
         builder.setSplitLayoutEnabledByUser(ProductionFlags.IS_SPLIT_KEYBOARD_SUPPORTED
                 && settingsValues.mIsSplitKeyboardEnabled);
diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeyboardBuilder.java b/java/src/com/android/inputmethod/keyboard/internal/KeyboardBuilder.java
index 0eabf6c..d5e8753 100644
--- a/java/src/com/android/inputmethod/keyboard/internal/KeyboardBuilder.java
+++ b/java/src/com/android/inputmethod/keyboard/internal/KeyboardBuilder.java
@@ -663,6 +663,8 @@
                     R.styleable.Keyboard_Case_clobberSettingsKey, id.mClobberSettingsKey);
             final boolean hasShortcutKeyMatched = matchBoolean(caseAttr,
                     R.styleable.Keyboard_Case_hasShortcutKey, id.mHasShortcutKey);
+            final boolean numberRowEnabledMatched = matchBoolean(caseAttr,
+                    R.styleable.Keyboard_Case_numberRowEnabled, id.mNumberRowEnabled);
             final boolean languageSwitchKeyEnabledMatched = matchBoolean(caseAttr,
                     R.styleable.Keyboard_Case_languageSwitchKeyEnabled,
                     id.mLanguageSwitchKeyEnabled);
@@ -681,7 +683,8 @@
             final boolean selected = keyboardLayoutSetMatched && keyboardLayoutSetElementMatched
                     && keyboardThemeMacthed && modeMatched && navigateNextMatched
                     && navigatePreviousMatched && passwordInputMatched && clobberSettingsKeyMatched
-                    && hasShortcutKeyMatched  && languageSwitchKeyEnabledMatched
+                    && hasShortcutKeyMatched  && numberRowEnabledMatched
+                    && languageSwitchKeyEnabledMatched
                     && isMultiLineMatched && imeActionMatched && isIconDefinedMatched
                     && localeCodeMatched && languageCodeMatched && countryCodeMatched
                     && splitLayoutMatched;
@@ -708,6 +711,8 @@
                                 "passwordInput"),
                         booleanAttr(caseAttr, R.styleable.Keyboard_Case_hasShortcutKey,
                                 "hasShortcutKey"),
+                        booleanAttr(caseAttr, R.styleable.Keyboard_Case_numberRowEnabled,
+                                "numberRowEnabled"),
                         booleanAttr(caseAttr, R.styleable.Keyboard_Case_languageSwitchKeyEnabled,
                                 "languageSwitchKeyEnabled"),
                         booleanAttr(caseAttr, R.styleable.Keyboard_Case_isMultiLine,
diff --git a/java/src/com/android/inputmethod/latin/settings/Settings.java b/java/src/com/android/inputmethod/latin/settings/Settings.java
index 8a1a8a3..ac47ba4 100644
--- a/java/src/com/android/inputmethod/latin/settings/Settings.java
+++ b/java/src/com/android/inputmethod/latin/settings/Settings.java
@@ -102,6 +102,7 @@
     public static final String PREF_KEY_IS_INTERNAL = "pref_key_is_internal";
 
     public static final String PREF_ENABLE_METRICS_LOGGING = "pref_enable_metrics_logging";
+    public static final String PREF_SHOW_NUMBER_ROW = "pref_show_number_row";
     // This preference key is deprecated. Use {@link #PREF_SHOW_LANGUAGE_SWITCH_KEY} instead.
     // This is being used only for the backward compatibility.
     private static final String PREF_SUPPRESS_LANGUAGE_SWITCH_KEY =
@@ -350,6 +351,10 @@
         return (milliseconds != UNDEFINED_PREFERENCE_VALUE_INT) ? milliseconds : defaultValue;
     }
 
+    public static boolean readShowNumberRow(final SharedPreferences prefs) {
+        return prefs.getBoolean(PREF_SHOW_NUMBER_ROW, false);
+    }
+
     public static float readKeyboardHeight(final SharedPreferences prefs,
             final float defaultValue) {
         final float percentage = prefs.getFloat(
diff --git a/java/src/com/android/inputmethod/latin/settings/SettingsValues.java b/java/src/com/android/inputmethod/latin/settings/SettingsValues.java
index 7a276a6..b670b91 100644
--- a/java/src/com/android/inputmethod/latin/settings/SettingsValues.java
+++ b/java/src/com/android/inputmethod/latin/settings/SettingsValues.java
@@ -67,6 +67,7 @@
     public final boolean mSoundOn;
     public final boolean mKeyPreviewPopupOn;
     public final boolean mShowsVoiceInputKey;
+    public final boolean mShowNumberRow;
     public final boolean mIncludesOtherImesInLanguageSwitchList;
     public final boolean mShowsLanguageSwitchKey;
     public final boolean mUseContactsDict;
@@ -139,6 +140,7 @@
         mShowsVoiceInputKey = needsToShowVoiceInputKey(prefs, res)
                 && mInputAttributes.mShouldShowVoiceInputKey
                 && Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN;
+        mShowNumberRow = prefs.getBoolean(Settings.PREF_SHOW_NUMBER_ROW, false);
         mIncludesOtherImesInLanguageSwitchList = Settings.ENABLE_SHOW_LANGUAGE_SWITCH_KEY_SETTINGS
                 ? prefs.getBoolean(Settings.PREF_INCLUDE_OTHER_IMES_IN_LANGUAGE_SWITCH_LIST, false)
                 : true /* forcibly */;