From fd7d814c81132bdd59146a39dd668532f9514cd1 Mon Sep 17 00:00:00 2001 From: Jean Chalard Date: Tue, 18 Jan 2011 17:45:22 +0900 Subject: Simplify latin IME settings page. Do not show the recorrection option on xlarge terminals, and make it true by default. Also, bring the Auto-capitalization at the top of the settings page. Issue: 3282448 Change-Id: I51a9ae6c7e496be2970107277f0a4ac65b12821e --- java/src/com/android/inputmethod/latin/LatinIME.java | 12 ++++++++++-- java/src/com/android/inputmethod/latin/Settings.java | 6 ++++++ 2 files changed, 16 insertions(+), 2 deletions(-) (limited to 'java/src') diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index cd4143e78..d5844b51c 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -353,8 +353,16 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen final Resources res = getResources(); mResources = res; - mReCorrectionEnabled = prefs.getBoolean(Settings.PREF_RECORRECTION_ENABLED, - res.getBoolean(R.bool.default_recorrection_enabled)); + + // If the option should not be shown, do not read the recorrection preference + // but always use the default setting defined in the resources. + if (res.getBoolean(R.bool.config_enable_show_recorrection_option)) { + mReCorrectionEnabled = prefs.getBoolean(Settings.PREF_RECORRECTION_ENABLED, + res.getBoolean(R.bool.default_recorrection_enabled)); + } else { + mReCorrectionEnabled = res.getBoolean(R.bool.default_recorrection_enabled); + } + mConfigSwipeDownDismissKeyboardEnabled = res.getBoolean( R.bool.config_swipe_down_dismiss_keyboard_enabled); mConfigDelayBeforeFadeoutLanguageOnSpacebar = res.getInteger( diff --git a/java/src/com/android/inputmethod/latin/Settings.java b/java/src/com/android/inputmethod/latin/Settings.java index 5db63b719..75ebbe7e5 100644 --- a/java/src/com/android/inputmethod/latin/Settings.java +++ b/java/src/com/android/inputmethod/latin/Settings.java @@ -140,6 +140,12 @@ public class Settings extends PreferenceActivity if (!showPopupOption) { getPreferenceScreen().removePreference(findPreference(PREF_POPUP_ON)); } + + final boolean showRecorrectionOption = getResources().getBoolean( + R.bool.config_enable_show_recorrection_option); + if (!showRecorrectionOption) { + getPreferenceScreen().removePreference(findPreference(PREF_RECORRECTION_ENABLED)); + } } @Override -- cgit v1.2.3-83-g751a