diff --git a/java/res/values/attrs.xml b/java/res/values/attrs.xml
index 2afef4f55..8ec3b4030 100644
--- a/java/res/values/attrs.xml
+++ b/java/res/values/attrs.xml
@@ -522,6 +522,7 @@
+
diff --git a/java/res/xml-sw600dp-land/rows_qwerty.xml b/java/res/xml-sw600dp-land/rows_qwerty.xml
index c5264feca..27e8ae92e 100644
--- a/java/res/xml-sw600dp-land/rows_qwerty.xml
+++ b/java/res/xml-sw600dp-land/rows_qwerty.xml
@@ -23,6 +23,19 @@
>
+
+
+
+
+
+
+
+
+
+
diff --git a/java/res/xml-sw600dp/rows_qwerty.xml b/java/res/xml-sw600dp/rows_qwerty.xml
index 259a6f003..53ac2887a 100644
--- a/java/res/xml-sw600dp/rows_qwerty.xml
+++ b/java/res/xml-sw600dp/rows_qwerty.xml
@@ -23,6 +23,19 @@
>
+
+
+
+
+
+
+
+
+
+
diff --git a/java/res/xml/rowkeys_numbers.xml b/java/res/xml/rowkeys_numbers.xml
new file mode 100644
index 000000000..db3cf1d1d
--- /dev/null
+++ b/java/res/xml/rowkeys_numbers.xml
@@ -0,0 +1,97 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/java/res/xml/rows_qwerty.xml b/java/res/xml/rows_qwerty.xml
index 41e410fa4..29f902d17 100644
--- a/java/res/xml/rows_qwerty.xml
+++ b/java/res/xml/rows_qwerty.xml
@@ -23,6 +23,19 @@
>
+
+
+
+
+
+
+
+
+
+
diff --git a/java/src/org/futo/inputmethod/keyboard/KeyboardId.java b/java/src/org/futo/inputmethod/keyboard/KeyboardId.java
index 55f8d80b3..c4c1d0bf3 100644
--- a/java/src/org/futo/inputmethod/keyboard/KeyboardId.java
+++ b/java/src/org/futo/inputmethod/keyboard/KeyboardId.java
@@ -82,6 +82,7 @@ public final class KeyboardId {
public final String mCustomActionLabel;
public final boolean mHasShortcutKey;
public final boolean mIsSplitLayout;
+ public final boolean mNumberRow;
private final int mHashCode;
@@ -98,6 +99,7 @@ public final class KeyboardId {
? mEditorInfo.actionLabel.toString() : null;
mHasShortcutKey = params.mVoiceInputKeyEnabled;
mIsSplitLayout = params.mIsSplitLayoutEnabled;
+ mNumberRow = params.mNumberRow;
mHashCode = computeHashCode(this);
}
@@ -118,7 +120,8 @@ public final class KeyboardId {
id.navigateNext(),
id.navigatePrevious(),
id.mSubtype,
- id.mIsSplitLayout
+ id.mIsSplitLayout,
+ id.mNumberRow
});
}
@@ -139,7 +142,8 @@ public final class KeyboardId {
&& other.navigateNext() == navigateNext()
&& other.navigatePrevious() == navigatePrevious()
&& other.mSubtype.equals(mSubtype)
- && other.mIsSplitLayout == mIsSplitLayout;
+ && other.mIsSplitLayout == mIsSplitLayout
+ && other.mNumberRow == mNumberRow;
}
private static boolean isAlphabetKeyboard(final int elementId) {
diff --git a/java/src/org/futo/inputmethod/keyboard/KeyboardLayoutSet.java b/java/src/org/futo/inputmethod/keyboard/KeyboardLayoutSet.java
index ec8cdab75..66091c0a6 100644
--- a/java/src/org/futo/inputmethod/keyboard/KeyboardLayoutSet.java
+++ b/java/src/org/futo/inputmethod/keyboard/KeyboardLayoutSet.java
@@ -133,6 +133,8 @@ public final class KeyboardLayoutSet {
// Sparse array of KeyboardLayoutSet element parameters indexed by element's id.
final SparseArray mKeyboardLayoutSetElementIdToParamsMap =
new SparseArray<>();
+
+ boolean mNumberRow;
}
public static void onSystemLocaleChanged() {
@@ -337,6 +339,11 @@ public final class KeyboardLayoutSet {
return this;
}
+ public Builder setNumberRow(final boolean enabled) {
+ mParams.mNumberRow = enabled;
+ return this;
+ }
+
// Super redux version of reading the script ID for some subtype from Xml.
static int readScriptId(final Resources resources, final InputMethodSubtype subtype) {
final String layoutSetName = KEYBOARD_LAYOUT_SET_RESOURCE_PREFIX
diff --git a/java/src/org/futo/inputmethod/keyboard/KeyboardSwitcher.java b/java/src/org/futo/inputmethod/keyboard/KeyboardSwitcher.java
index f63c29549..148fe03bb 100644
--- a/java/src/org/futo/inputmethod/keyboard/KeyboardSwitcher.java
+++ b/java/src/org/futo/inputmethod/keyboard/KeyboardSwitcher.java
@@ -130,6 +130,8 @@ public final class KeyboardSwitcher implements KeyboardState.SwitchActions {
builder.setBottomEmojiKeyEnabled(mLatinIMELegacy.shouldShowEmojiKey());
builder.setSplitLayoutEnabledByUser(ProductionFlags.IS_SPLIT_KEYBOARD_SUPPORTED
&& settingsValues.mIsSplitKeyboardEnabled);
+ builder.setNumberRow(settingsValues.mIsNumberRowEnabled);
+
mKeyboardLayoutSet = builder.build();
try {
mState.onLoadKeyboard(currentAutoCapsState, currentRecapitalizeState);
diff --git a/java/src/org/futo/inputmethod/keyboard/internal/KeyboardBuilder.java b/java/src/org/futo/inputmethod/keyboard/internal/KeyboardBuilder.java
index c9f56df78..60d57a77d 100644
--- a/java/src/org/futo/inputmethod/keyboard/internal/KeyboardBuilder.java
+++ b/java/src/org/futo/inputmethod/keyboard/internal/KeyboardBuilder.java
@@ -696,13 +696,15 @@ public class KeyboardBuilder {
final boolean countryCodeMatched = matchCountryCodes(caseAttr, locale);
final boolean splitLayoutMatched = matchBoolean(caseAttr,
R.styleable.Keyboard_Case_isSplitLayout, id.mIsSplitLayout);
+ final boolean numberRowMatched = matchBoolean(caseAttr,
+ R.styleable.Keyboard_Case_numberRow, id.mNumberRow);
final boolean selected = keyboardLayoutSetMatched && keyboardLayoutSetElementMatched
&& keyboardThemeMacthed && modeMatched && navigateNextMatched
&& navigatePreviousMatched && passwordInputMatched && clobberSettingsKeyMatched
&& hasShortcutKeyMatched && languageSwitchKeyEnabledMatched
&& isMultiLineMatched && imeActionMatched && isIconDefinedMatched
&& localeCodeMatched && languageCodeMatched && countryCodeMatched
- && splitLayoutMatched;
+ && splitLayoutMatched && numberRowMatched;
if (DEBUG) {
startTag("<%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s>%s", TAG_CASE,
diff --git a/java/src/org/futo/inputmethod/latin/settings/Settings.java b/java/src/org/futo/inputmethod/latin/settings/Settings.java
index 6d125f399..5d3975fa3 100644
--- a/java/src/org/futo/inputmethod/latin/settings/Settings.java
+++ b/java/src/org/futo/inputmethod/latin/settings/Settings.java
@@ -103,6 +103,9 @@ public final class Settings implements SharedPreferences.OnSharedPreferenceChang
public static final String PREF_SHOW_EMOJI_KEY =
"pref_show_emoji_key";
+
+ public static final String PREF_ENABLE_NUMBER_ROW = "pref_enable_number_row";
+
private static final String PREF_LAST_USED_PERSONALIZATION_TOKEN =
"pref_last_used_personalization_token";
private static final String PREF_LAST_PERSONALIZATION_DICT_WIPED_TIME =
diff --git a/java/src/org/futo/inputmethod/latin/settings/SettingsValues.java b/java/src/org/futo/inputmethod/latin/settings/SettingsValues.java
index 39b4b2281..c6b624928 100644
--- a/java/src/org/futo/inputmethod/latin/settings/SettingsValues.java
+++ b/java/src/org/futo/inputmethod/latin/settings/SettingsValues.java
@@ -88,6 +88,7 @@ public class SettingsValues {
public final boolean mShouldShowLxxSuggestionUi;
// Use split layout for keyboard.
public final boolean mIsSplitKeyboardEnabled;
+ public final boolean mIsNumberRowEnabled;
public final int mScreenMetrics;
// From the input box
@@ -142,6 +143,7 @@ public class SettingsValues {
? prefs.getBoolean(Settings.PREF_INCLUDE_OTHER_IMES_IN_LANGUAGE_SWITCH_LIST, false)
: true /* forcibly */;
mShowsEmojiKey = Settings.readShowsEmojiKey(prefs);
+ mIsNumberRowEnabled = prefs.getBoolean(Settings.PREF_ENABLE_NUMBER_ROW, false);
mUseContactsDict = prefs.getBoolean(Settings.PREF_KEY_USE_CONTACTS_DICT, true);
mUsePersonalizedDicts = prefs.getBoolean(Settings.PREF_KEY_USE_PERSONALIZED_DICTS, true);
mUseDoubleSpacePeriod = prefs.getBoolean(Settings.PREF_KEY_USE_DOUBLE_SPACE_PERIOD, true)
diff --git a/java/src/org/futo/inputmethod/latin/uix/settings/pages/Typing.kt b/java/src/org/futo/inputmethod/latin/uix/settings/pages/Typing.kt
index 8b30f4d58..866d40c43 100644
--- a/java/src/org/futo/inputmethod/latin/uix/settings/pages/Typing.kt
+++ b/java/src/org/futo/inputmethod/latin/uix/settings/pages/Typing.kt
@@ -54,6 +54,11 @@ fun TypingScreen(navController: NavHostController = rememberNavController()) {
subtitle = "Suggest emojis while you're typing",
setting = SHOW_EMOJI_SUGGESTIONS
)
+ SettingToggleSharedPrefs(
+ title = "Number row",
+ key = Settings.PREF_ENABLE_NUMBER_ROW,
+ default = false
+ )
SettingToggleSharedPrefs(
title = "Emoji key",
subtitle = "Show the emoji key on the bottom row",