From 21177c1afed4c04f436acbd1116568051167c899 Mon Sep 17 00:00:00 2001 From: "Tadashi G. Takaoka" Date: Fri, 9 Nov 2012 12:44:40 +0900 Subject: [PATCH] Remove gesture typing settings when disabled by configuration Bug: 7506408 Change-Id: I4de53ace170d5ddc9779f42ac344c4190c80a019 --- .../com/android/inputmethod/latin/Settings.java | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/java/src/com/android/inputmethod/latin/Settings.java b/java/src/com/android/inputmethod/latin/Settings.java index 238724610..348928df8 100644 --- a/java/src/com/android/inputmethod/latin/Settings.java +++ b/java/src/com/android/inputmethod/latin/Settings.java @@ -68,6 +68,7 @@ public final class Settings extends InputMethodSettingsFragment public static final String PREF_KEY_PREVIEW_POPUP_DISMISS_DELAY = "pref_key_preview_popup_dismiss_delay"; public static final String PREF_BIGRAM_PREDICTIONS = "next_word_prediction"; + public static final String PREF_GESTURE_SETTINGS = "gesture_typing_settings"; public static final String PREF_GESTURE_INPUT = "gesture_input"; public static final String PREF_VIBRATION_DURATION_SETTINGS = "pref_vibration_duration_settings"; @@ -136,6 +137,8 @@ public final class Settings extends InputMethodSettingsFragment (PreferenceGroup) findPreference(PREF_GENERAL_SETTINGS); final PreferenceGroup textCorrectionGroup = (PreferenceGroup) findPreference(PREF_CORRECTION_SETTINGS); + final PreferenceGroup gestureTypingSettings = + (PreferenceGroup) findPreference(PREF_GESTURE_SETTINGS); final PreferenceGroup miscSettings = (PreferenceGroup) findPreference(PREF_MISC_SETTINGS); @@ -206,17 +209,8 @@ public final class Settings extends InputMethodSettingsFragment final boolean gestureInputEnabledByBuildConfig = res.getBoolean( R.bool.config_gesture_input_enabled_by_build_config); - final Preference gesturePreviewTrail = findPreference(PREF_GESTURE_PREVIEW_TRAIL); - final Preference gestureFloatingPreviewText = findPreference( - PREF_GESTURE_FLOATING_PREVIEW_TEXT); if (!gestureInputEnabledByBuildConfig) { - miscSettings.removePreference(findPreference(PREF_GESTURE_INPUT)); - miscSettings.removePreference(gesturePreviewTrail); - miscSettings.removePreference(gestureFloatingPreviewText); - } else { - final boolean gestureInputEnabledByUser = prefs.getBoolean(PREF_GESTURE_INPUT, true); - setPreferenceEnabled(gesturePreviewTrail, gestureInputEnabledByUser); - setPreferenceEnabled(gestureFloatingPreviewText, gestureInputEnabledByUser); + getPreferenceScreen().removePreference(gestureTypingSettings); } mKeypressVibrationDurationSettingsPref =