am c225d2e2: Add setting boolean for showing UI to accept typed word

* commit 'c225d2e29cfd85fb416952daa4bcebd4df48b57c':
  Add setting boolean for showing UI to accept typed word
This commit is contained in:
Tadashi G. Takaoka 2014-08-13 09:14:39 +00:00 committed by Android Git Automerger
commit 43b8646a31
6 changed files with 17 additions and 0 deletions

View file

@ -27,6 +27,7 @@
<string name="prefs_debug_mode">Debug Mode</string> <string name="prefs_debug_mode">Debug Mode</string>
<string name="prefs_force_non_distinct_multitouch">Force non-distinct multitouch</string> <string name="prefs_force_non_distinct_multitouch">Force non-distinct multitouch</string>
<string name="prefs_force_physical_keyboard_special_key">Force physical keyboard special key</string> <string name="prefs_force_physical_keyboard_special_key">Force physical keyboard special key</string>
<string name="prefs_show_ui_to_accept_typed_word">Show UI to accept typed word</string>
<!-- Subtype locale display name exceptions. <!-- Subtype locale display name exceptions.
For each exception, there should be related string resources for display name that may have For each exception, there should be related string resources for display name that may have

View file

@ -35,6 +35,11 @@
android:title="@string/prefs_force_physical_keyboard_special_key" android:title="@string/prefs_force_physical_keyboard_special_key"
android:defaultValue="false" android:defaultValue="false"
android:persistent="true" /> android:persistent="true" />
<CheckBoxPreference
android:key="pref_show_ui_to_accept_typed_word"
android:title="@string/prefs_show_ui_to_accept_typed_word"
android:defaultValue="true"
android:persistent="true" />
<CheckBoxPreference <CheckBoxPreference
android:key="pref_sliding_key_input_preview" android:key="pref_sliding_key_input_preview"
android:title="@string/sliding_key_input_preview" android:title="@string/sliding_key_input_preview"

View file

@ -21,6 +21,8 @@ public final class DebugSettings {
public static final String PREF_FORCE_NON_DISTINCT_MULTITOUCH = "force_non_distinct_multitouch"; public static final String PREF_FORCE_NON_DISTINCT_MULTITOUCH = "force_non_distinct_multitouch";
public static final String PREF_FORCE_PHYSICAL_KEYBOARD_SPECIAL_KEY = public static final String PREF_FORCE_PHYSICAL_KEYBOARD_SPECIAL_KEY =
"force_physical_keyboard_special_key"; "force_physical_keyboard_special_key";
public static final String PREF_SHOW_UI_TO_ACCEPT_TYPED_WORD =
"pref_show_ui_to_accept_typed_word";
public static final String PREF_KEY_PREVIEW_SHOW_UP_START_SCALE = public static final String PREF_KEY_PREVIEW_SHOW_UP_START_SCALE =
"pref_key_preview_show_up_start_scale"; "pref_key_preview_show_up_start_scale";
public static final String PREF_KEY_PREVIEW_DISMISS_END_SCALE = public static final String PREF_KEY_PREVIEW_DISMISS_END_SCALE =

View file

@ -56,6 +56,10 @@ public final class DebugSettingsFragment extends SubScreenFragment
super.onCreate(icicle); super.onCreate(icicle);
addPreferencesFromResource(R.xml.prefs_screen_debug); addPreferencesFromResource(R.xml.prefs_screen_debug);
if (!Settings.HAS_UI_TO_ACCEPT_TYPED_WORD) {
removePreference(DebugSettings.PREF_SHOW_UI_TO_ACCEPT_TYPED_WORD);
}
mReadExternalDictionaryPref = findPreference(PREF_READ_EXTERNAL_DICTIONARY); mReadExternalDictionaryPref = findPreference(PREF_READ_EXTERNAL_DICTIONARY);
if (mReadExternalDictionaryPref != null) { if (mReadExternalDictionaryPref != null) {
mReadExternalDictionaryPref.setOnPreferenceClickListener(this); mReadExternalDictionaryPref.setOnPreferenceClickListener(this);

View file

@ -70,6 +70,8 @@ public final class Settings implements SharedPreferences.OnSharedPreferenceChang
"pref_key_block_potentially_offensive"; "pref_key_block_potentially_offensive";
public static final boolean ENABLE_SHOW_LANGUAGE_SWITCH_KEY_SETTINGS = public static final boolean ENABLE_SHOW_LANGUAGE_SWITCH_KEY_SETTINGS =
BuildCompatUtils.EFFECTIVE_SDK_INT <= Build.VERSION_CODES.KITKAT; BuildCompatUtils.EFFECTIVE_SDK_INT <= Build.VERSION_CODES.KITKAT;
public static final boolean HAS_UI_TO_ACCEPT_TYPED_WORD =
BuildCompatUtils.EFFECTIVE_SDK_INT >= BuildCompatUtils.VERSION_CODES_LXX;
public static final String PREF_SHOW_LANGUAGE_SWITCH_KEY = public static final String PREF_SHOW_LANGUAGE_SWITCH_KEY =
"pref_show_language_switch_key"; "pref_show_language_switch_key";
public static final String PREF_INCLUDE_OTHER_IMES_IN_LANGUAGE_SWITCH_LIST = public static final String PREF_INCLUDE_OTHER_IMES_IN_LANGUAGE_SWITCH_LIST =

View file

@ -75,6 +75,7 @@ public final class SettingsValues {
public final int mKeyLongpressTimeout; public final int mKeyLongpressTimeout;
public final Locale mLocale; public final Locale mLocale;
public final boolean mEnableMetricsLogging; public final boolean mEnableMetricsLogging;
public final boolean mShouldShowUiToAcceptTypedWord;
// From the input box // From the input box
public final InputAttributes mInputAttributes; public final InputAttributes mInputAttributes;
@ -142,6 +143,8 @@ public final class SettingsValues {
mBigramPredictionEnabled = readBigramPredictionEnabled(prefs, res); mBigramPredictionEnabled = readBigramPredictionEnabled(prefs, res);
mDoubleSpacePeriodTimeout = res.getInteger(R.integer.config_double_space_period_timeout); mDoubleSpacePeriodTimeout = res.getInteger(R.integer.config_double_space_period_timeout);
mEnableMetricsLogging = prefs.getBoolean(Settings.PREF_ENABLE_METRICS_LOGGING, true); mEnableMetricsLogging = prefs.getBoolean(Settings.PREF_ENABLE_METRICS_LOGGING, true);
mShouldShowUiToAcceptTypedWord = Settings.HAS_UI_TO_ACCEPT_TYPED_WORD
&& prefs.getBoolean(DebugSettings.PREF_SHOW_UI_TO_ACCEPT_TYPED_WORD, true);
// Compute other readable settings // Compute other readable settings
mKeyLongpressTimeout = Settings.readKeyLongpressTimeout(prefs, res); mKeyLongpressTimeout = Settings.readKeyLongpressTimeout(prefs, res);
mKeypressVibrationDuration = Settings.readKeypressVibrationDuration(prefs, res); mKeypressVibrationDuration = Settings.readKeypressVibrationDuration(prefs, res);