Merge "Simplify latin IME settings page." into honeycomb

main
Jean Chalard 2011-01-18 19:08:15 -08:00 committed by Android (Google) Code Review
commit 8b0febc6f0
5 changed files with 25 additions and 9 deletions

View File

@ -23,6 +23,7 @@
<bool name="config_enable_show_subtype_settings">false</bool>
<bool name="config_enable_show_voice_key_option">false</bool>
<bool name="config_enable_show_popup_on_keypress_option">false</bool>
<bool name="config_enable_show_recorrection_option">false</bool>
<bool name="config_candidate_highlight_font_color_enabled">false</bool>
<bool name="config_swipe_down_dismiss_keyboard_enabled">false</bool>
<bool name="config_sliding_key_input_enabled">false</bool>

View File

@ -26,6 +26,7 @@
<bool name="config_enable_show_subtype_settings">true</bool>
<bool name="config_enable_show_voice_key_option">true</bool>
<bool name="config_enable_show_popup_on_keypress_option">true</bool>
<bool name="config_enable_show_recorrection_option">true</bool>
<bool name="config_candidate_highlight_font_color_enabled">true</bool>
<bool name="config_swipe_down_dismiss_keyboard_enabled">true</bool>
<bool name="config_sliding_key_input_enabled">true</bool>

View File

@ -18,6 +18,13 @@
android:title="@string/english_ime_settings"
android:key="english_ime_settings">
<CheckBoxPreference
android:key="auto_cap"
android:title="@string/auto_cap"
android:persistent="true"
android:defaultValue="true"
/>
<CheckBoxPreference
android:key="vibrate_on"
android:title="@string/vibrate_on_keypress"
@ -45,13 +52,6 @@
android:defaultValue="@bool/default_recorrection_enabled"
/>
<CheckBoxPreference
android:key="auto_cap"
android:title="@string/auto_cap"
android:persistent="true"
android:defaultValue="true"
/>
<ListPreference
android:key="settings_key"
android:title="@string/prefs_settings_key"

View File

@ -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(

View File

@ -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