Remove language settings from preference activity
Bug: 3268561
Change-Id: Ia910f0a090dc66c7dd9176999930d8cb763203b0
diff --git a/java/res/values-xlarge/bools.xml b/java/res/values-xlarge/bools.xml
index abacfa1..9fb670c 100644
--- a/java/res/values-xlarge/bools.xml
+++ b/java/res/values-xlarge/bools.xml
@@ -21,6 +21,7 @@
<!-- Whether or not Popup on key press is enabled by default -->
<bool name="default_popup_preview">false</bool>
<bool name="config_enable_show_settings_key_option">false</bool>
+ <bool name="config_enable_show_subtype_settings">false</bool>
<bool name="config_enable_show_voice_key_option">false</bool>
<bool name="config_candidate_highlight_font_color_enabled">false</bool>
</resources>
diff --git a/java/res/values/bools.xml b/java/res/values/bools.xml
index 84b0fe1..8742676 100644
--- a/java/res/values/bools.xml
+++ b/java/res/values/bools.xml
@@ -31,6 +31,7 @@
<bool name="default_recorrection_enabled">true</bool>
<bool name="config_long_press_comma_for_settings_enabled">true</bool>
<bool name="config_enable_show_settings_key_option">true</bool>
+ <bool name="config_enable_show_subtype_settings">true</bool>
<bool name="config_enable_show_voice_key_option">true</bool>
<bool name="config_candidate_highlight_font_color_enabled">true</bool>
</resources>
diff --git a/java/res/xml/prefs.xml b/java/res/xml/prefs.xml
index 0eee060..47b3b45 100644
--- a/java/res/xml/prefs.xml
+++ b/java/res/xml/prefs.xml
@@ -73,6 +73,7 @@
<!-- TODO: Filter subtypes by IME in SubtypeEnabler -->
<!-- TODO: Maybe use this only for phone? -->
<PreferenceScreen
+ android:key="subtype_settings"
android:title="@string/language_selection_title"
android:summary="@string/language_selection_summary">
<intent
diff --git a/java/src/com/android/inputmethod/latin/Settings.java b/java/src/com/android/inputmethod/latin/Settings.java
index b8590a7..3f604a3 100644
--- a/java/src/com/android/inputmethod/latin/Settings.java
+++ b/java/src/com/android/inputmethod/latin/Settings.java
@@ -53,6 +53,7 @@
public static final String PREF_VOICE_SETTINGS_KEY = "voice_mode";
public static final String PREF_INPUT_LANGUAGE = "input_language";
public static final String PREF_SELECTED_LANGUAGES = "selected_languages";
+ public static final String PREF_SUBTYPES = "subtype_settings";
public static final String PREF_PREDICTION_SETTINGS_KEY = "prediction_settings";
public static final String PREF_QUICK_FIXES = "quick_fixes";
@@ -119,6 +120,12 @@
getPreferenceScreen().removePreference(
getPreferenceScreen().findPreference(PREF_VIBRATE_ON));
}
+
+ final boolean showSubtypeSettings = getResources().getBoolean(
+ R.bool.config_enable_show_subtype_settings);
+ if (!showSubtypeSettings) {
+ getPreferenceScreen().removePreference(findPreference(PREF_SUBTYPES));
+ }
}
@Override