Remove irrelevant options.
Bug: 6667355 Change-Id: I39b6db17fb52e80f510cf6462f41d9cb1f8e0341main
parent
5caaf1b9e9
commit
15121cff37
|
@ -122,7 +122,6 @@
|
||||||
android:defaultValue="true" />
|
android:defaultValue="true" />
|
||||||
<CheckBoxPreference
|
<CheckBoxPreference
|
||||||
android:key="next_word_prediction"
|
android:key="next_word_prediction"
|
||||||
android:dependency="next_word_suggestion"
|
|
||||||
android:title="@string/bigram_prediction"
|
android:title="@string/bigram_prediction"
|
||||||
android:summary="@string/bigram_prediction_summary"
|
android:summary="@string/bigram_prediction_summary"
|
||||||
android:persistent="true"
|
android:persistent="true"
|
||||||
|
|
|
@ -149,10 +149,13 @@ public class Settings extends InputMethodSettingsFragment
|
||||||
generalSettings.removePreference(mVoicePreference);
|
generalSettings.removePreference(mVoicePreference);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final PreferenceGroup advancedSettings =
|
||||||
|
(PreferenceGroup) findPreference(PREF_ADVANCED_SETTINGS);
|
||||||
|
// Remove those meaningless options for now. TODO: delete them for good
|
||||||
|
advancedSettings.removePreference(findPreference(PREF_BIGRAM_SUGGESTION));
|
||||||
|
advancedSettings.removePreference(findPreference(PREF_KEY_ENABLE_SPAN_INSERT));
|
||||||
if (!VibratorUtils.getInstance(context).hasVibrator()) {
|
if (!VibratorUtils.getInstance(context).hasVibrator()) {
|
||||||
generalSettings.removePreference(findPreference(PREF_VIBRATE_ON));
|
generalSettings.removePreference(findPreference(PREF_VIBRATE_ON));
|
||||||
final PreferenceGroup advancedSettings =
|
|
||||||
(PreferenceGroup) findPreference(PREF_ADVANCED_SETTINGS);
|
|
||||||
if (null != advancedSettings) { // Theoretically advancedSettings cannot be null
|
if (null != advancedSettings) { // Theoretically advancedSettings cannot be null
|
||||||
advancedSettings.removePreference(findPreference(PREF_VIBRATION_DURATION_SETTINGS));
|
advancedSettings.removePreference(findPreference(PREF_VIBRATION_DURATION_SETTINGS));
|
||||||
}
|
}
|
||||||
|
|
|
@ -135,8 +135,8 @@ public class SettingsValues {
|
||||||
&& isBigramSuggestionEnabled(prefs, res, mAutoCorrectEnabled);
|
&& isBigramSuggestionEnabled(prefs, res, mAutoCorrectEnabled);
|
||||||
mBigramPredictionEnabled = mBigramSuggestionEnabled
|
mBigramPredictionEnabled = mBigramSuggestionEnabled
|
||||||
&& isBigramPredictionEnabled(prefs, res);
|
&& isBigramPredictionEnabled(prefs, res);
|
||||||
mEnableSuggestionSpanInsertion =
|
// TODO: remove mEnableSuggestionSpanInsertion. It's always true.
|
||||||
prefs.getBoolean(Settings.PREF_KEY_ENABLE_SPAN_INSERT, true);
|
mEnableSuggestionSpanInsertion = true;
|
||||||
mVibrationDurationSettingsRawValue =
|
mVibrationDurationSettingsRawValue =
|
||||||
prefs.getInt(Settings.PREF_VIBRATION_DURATION_SETTINGS, -1);
|
prefs.getInt(Settings.PREF_VIBRATION_DURATION_SETTINGS, -1);
|
||||||
mKeypressSoundVolumeRawValue = prefs.getFloat(Settings.PREF_KEYPRESS_SOUND_VOLUME, -1.0f);
|
mKeypressSoundVolumeRawValue = prefs.getFloat(Settings.PREF_KEYPRESS_SOUND_VOLUME, -1.0f);
|
||||||
|
@ -242,13 +242,8 @@ public class SettingsValues {
|
||||||
|
|
||||||
private static boolean isBigramSuggestionEnabled(final SharedPreferences sp,
|
private static boolean isBigramSuggestionEnabled(final SharedPreferences sp,
|
||||||
final Resources resources, final boolean autoCorrectEnabled) {
|
final Resources resources, final boolean autoCorrectEnabled) {
|
||||||
final boolean showBigramSuggestionsOption = resources.getBoolean(
|
// TODO: remove this method. Bigram suggestion is always true.
|
||||||
R.bool.config_enable_next_word_suggestions_option);
|
return true;
|
||||||
if (!showBigramSuggestionsOption) {
|
|
||||||
return autoCorrectEnabled;
|
|
||||||
}
|
|
||||||
return sp.getBoolean(Settings.PREF_BIGRAM_SUGGESTION, resources.getBoolean(
|
|
||||||
R.bool.config_default_next_word_suggestions));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean isBigramPredictionEnabled(final SharedPreferences sp,
|
private static boolean isBigramPredictionEnabled(final SharedPreferences sp,
|
||||||
|
|
Loading…
Reference in New Issue