diff options
Diffstat (limited to 'java/src/com/android/inputmethod/latin/Settings.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/Settings.java | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/java/src/com/android/inputmethod/latin/Settings.java b/java/src/com/android/inputmethod/latin/Settings.java index 1e2ef4824..e99bb7016 100644 --- a/java/src/com/android/inputmethod/latin/Settings.java +++ b/java/src/com/android/inputmethod/latin/Settings.java @@ -82,6 +82,8 @@ public class Settings extends InputMethodSettingsActivity "pref_key_preview_popup_dismiss_delay"; public static final String PREF_KEY_USE_CONTACTS_DICT = "pref_key_use_contacts_dict"; + public static final String PREF_KEY_ENABLE_SPAN_INSERT = + "enable_span_insert"; public static final String PREF_USABILITY_STUDY_MODE = "usability_study_mode"; @@ -117,6 +119,7 @@ public class Settings extends InputMethodSettingsActivity // Prediction: use bigrams to predict the next word when there is no input for it yet public final boolean mBigramPredictionEnabled; public final boolean mUseContactsDict; + public final boolean mEnableSuggestionSpanInsertion; private final boolean mShowSettingsKey; private final boolean mVoiceKeyEnabled; @@ -179,6 +182,8 @@ public class Settings extends InputMethodSettingsActivity && isBigramPredictionEnabled(prefs, res); mAutoCorrectionThreshold = getAutoCorrectionThreshold(prefs, res); mUseContactsDict = prefs.getBoolean(Settings.PREF_KEY_USE_CONTACTS_DICT, true); + mEnableSuggestionSpanInsertion = + prefs.getBoolean(Settings.PREF_KEY_ENABLE_SPAN_INSERT, true); final boolean defaultShowSettingsKey = res.getBoolean( R.bool.config_default_show_settings_key); mShowSettingsKey = isShowSettingsKeyOption(res) @@ -426,8 +431,10 @@ public class Settings extends InputMethodSettingsActivity final boolean showBigramSuggestionsOption = res.getBoolean( R.bool.config_enable_bigram_suggestions_option); if (!showBigramSuggestionsOption) { - textCorrectionGroup.removePreference(findPreference(PREF_BIGRAM_SUGGESTIONS)); - textCorrectionGroup.removePreference(findPreference(PREF_BIGRAM_PREDICTIONS)); + textCorrectionGroup.removePreference(mBigramSuggestion); + if (null != mBigramPrediction) { + textCorrectionGroup.removePreference(mBigramPrediction); + } } final boolean showUsabilityModeStudyOption = res.getBoolean( |