Merge "Remove experimental settings"

main
satok 2011-09-14 02:57:58 -07:00 committed by Android (Google) Code Review
commit fa52a09f21
2 changed files with 54 additions and 67 deletions

View File

@ -93,66 +93,46 @@
<PreferenceCategory
android:title="@string/misc_category"
android:key="misc_settings">
<CheckBoxPreference
android:key="usability_study_mode"
android:title="@string/prefs_usability_study_mode"
android:persistent="true"
android:defaultValue="false" />
<CheckBoxPreference
android:key="enable_logging"
android:title="@string/prefs_enable_log"
android:summary="@string/prefs_description_log"
android:persistent="true"
android:defaultValue="true" />
<ListPreference
android:key="pref_keyboard_layout_20100902"
android:title="@string/keyboard_layout"
android:persistent="true"
android:entryValues="@array/keyboard_layout_modes_values"
android:entries="@array/keyboard_layout_modes"
android:defaultValue="@string/config_default_keyboard_theme_id" />
<CheckBoxPreference
android:key="usability_study_mode"
android:title="@string/prefs_usability_study_mode"
android:persistent="true"
android:defaultValue="false" />
<PreferenceScreen
android:key="pref_advanced_settings"
android:title="@string/advanced_settings"
android:summary="@string/advanced_settings_summary">
<!-- Values for popup dismiss delay are added programatically -->
<ListPreference
android:key="pref_key_preview_popup_dismiss_delay"
android:title="@string/key_preview_popup_dismiss_delay" />
<CheckBoxPreference
android:key="pref_key_use_contacts_dict"
android:title="@string/use_contacts_dict"
android:summary="@string/use_contacts_dict_summary"
android:persistent="true"
android:defaultValue="true" />
<CheckBoxPreference
android:key="bigram_suggestion"
android:title="@string/bigram_suggestion"
android:summary="@string/bigram_suggestion_summary"
android:persistent="true"
android:defaultValue="true" />
<CheckBoxPreference
android:key="enable_span_insert"
android:title="@string/enable_span_insert"
android:summary="@string/enable_span_insert_summary"
android:persistent="true"
android:defaultValue="true" />
<!-- TODO: evaluate results and revive this option. The code
already supports it. -->
<!-- <CheckBoxPreference -->
<!-- android:key="bigram_prediction" -->
<!-- android:dependency="bigram_suggestion" -->
<!-- android:title="@string/bigram_prediction" -->
<!-- android:summary="@string/bigram_prediction_summary" -->
<!-- android:persistent="true" -->
<!-- android:defaultValue="false" /> -->
</PreferenceScreen>
</PreferenceCategory>
<PreferenceScreen
android:key="pref_advanced_settings"
android:title="@string/advanced_settings"
android:summary="@string/advanced_settings_summary">
<!-- Values for popup dismiss delay are added programatically -->
<ListPreference
android:key="pref_key_preview_popup_dismiss_delay"
android:title="@string/key_preview_popup_dismiss_delay" />
<CheckBoxPreference
android:key="pref_key_use_contacts_dict"
android:title="@string/use_contacts_dict"
android:summary="@string/use_contacts_dict_summary"
android:persistent="true"
android:defaultValue="true" />
<CheckBoxPreference
android:key="bigram_suggestion"
android:title="@string/bigram_suggestion"
android:summary="@string/bigram_suggestion_summary"
android:persistent="true"
android:defaultValue="true" />
<CheckBoxPreference
android:key="enable_span_insert"
android:title="@string/enable_span_insert"
android:summary="@string/enable_span_insert_summary"
android:persistent="true"
android:defaultValue="true" />
<!-- TODO: evaluate results and revive this option. The code already supports it. -->
<!-- <CheckBoxPreference -->
<!-- android:key="bigram_prediction" -->
<!-- android:dependency="bigram_suggestion" -->
<!-- android:title="@string/bigram_prediction" -->
<!-- android:summary="@string/bigram_prediction_summary" -->
<!-- android:persistent="true" -->
<!-- android:defaultValue="false" /> -->
</PreferenceScreen>
<!-- <Preference
android:title="Debug Settings"
android:key="debug_settings">
<intent
android:action="android.intent.action.MAIN"
android:targetPackage="com.android.inputmethod.latin"
android:targetClass="com.android.inputmethod.latin.DebugSettings" />
</Preference>-->
</PreferenceScreen>

View File

@ -55,6 +55,8 @@ public class Settings extends InputMethodSettingsActivity
DialogInterface.OnDismissListener, OnPreferenceClickListener {
private static final String TAG = Settings.class.getSimpleName();
public static final boolean ENABLE_EXPERIMENTAL_SETTINGS = false;
public static final String PREF_GENERAL_SETTINGS_KEY = "general_settings";
public static final String PREF_VIBRATE_ON = "vibrate_on";
public static final String PREF_SOUND_ON = "sound_on";
@ -397,6 +399,8 @@ public class Settings extends InputMethodSettingsActivity
(PreferenceGroup) findPreference(PREF_GENERAL_SETTINGS_KEY);
final PreferenceGroup textCorrectionGroup =
(PreferenceGroup) findPreference(PREF_CORRECTION_SETTINGS_KEY);
final PreferenceGroup miscSettings =
(PreferenceGroup) findPreference(PREF_MISC_SETTINGS_KEY);
if (!Values.isShowSettingsKeyOption(res)) {
generalSettings.removePreference(mShowSettingsKeyPreference);
@ -437,12 +441,6 @@ public class Settings extends InputMethodSettingsActivity
}
}
final boolean showUsabilityModeStudyOption = res.getBoolean(
R.bool.config_enable_usability_study_mode_option);
if (!showUsabilityModeStudyOption) {
getPreferenceScreen().removePreference(findPreference(PREF_USABILITY_STUDY_MODE));
}
mKeyPreviewPopupDismissDelay =
(ListPreference)findPreference(PREF_KEY_PREVIEW_POPUP_DISMISS_DELAY);
final String[] entries = new String[] {
@ -467,6 +465,15 @@ public class Settings extends InputMethodSettingsActivity
if (0 >= number) {
textCorrectionGroup.removePreference(dictionaryLink);
}
final boolean showUsabilityModeStudyOption = res.getBoolean(
R.bool.config_enable_usability_study_mode_option);
if (!showUsabilityModeStudyOption || !ENABLE_EXPERIMENTAL_SETTINGS) {
final Preference pref = findPreference(PREF_USABILITY_STUDY_MODE);
if (pref != null) {
miscSettings.removePreference(pref);
}
}
}
@SuppressWarnings("unused")