Add setting boolean for showing UI to accept typed word

Change-Id: Iedd90d07b904362d9debc9994ce86cd78a0303b9
main
Tadashi G. Takaoka 2014-08-13 15:24:14 +09:00
parent a696c92477
commit c225d2e29c
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_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_show_ui_to_accept_typed_word">Show UI to accept typed word</string>
<!-- Subtype locale display name exceptions.
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:defaultValue="false"
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
android:key="pref_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_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 =
"pref_key_preview_show_up_start_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);
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);
if (mReadExternalDictionaryPref != null) {
mReadExternalDictionaryPref.setOnPreferenceClickListener(this);

View File

@ -70,6 +70,8 @@ public final class Settings implements SharedPreferences.OnSharedPreferenceChang
"pref_key_block_potentially_offensive";
public static final boolean ENABLE_SHOW_LANGUAGE_SWITCH_KEY_SETTINGS =
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 =
"pref_show_language_switch_key";
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 Locale mLocale;
public final boolean mEnableMetricsLogging;
public final boolean mShouldShowUiToAcceptTypedWord;
// From the input box
public final InputAttributes mInputAttributes;
@ -142,6 +143,8 @@ public final class SettingsValues {
mBigramPredictionEnabled = readBigramPredictionEnabled(prefs, res);
mDoubleSpacePeriodTimeout = res.getInteger(R.integer.config_double_space_period_timeout);
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
mKeyLongpressTimeout = Settings.readKeyLongpressTimeout(prefs, res);
mKeypressVibrationDuration = Settings.readKeypressVibrationDuration(prefs, res);