From a37bee2805dc1533092a25f1ee6633b78bff0070 Mon Sep 17 00:00:00 2001 From: Jean Chalard Date: Fri, 13 Sep 2013 15:50:38 +0900 Subject: [PATCH] [AC5] Introduce the setting for phrase gesture. Bug: 9059617 Change-Id: I6fa0f675f4edac10bd19228cd2f0c8fca97cebd6 --- .../res/values/config-additional-features.xml | 24 +++++++++++++++++++ .../inputmethod/latin/settings/Settings.java | 7 ++++++ .../latin/settings/SettingsValues.java | 3 +++ 3 files changed, 34 insertions(+) create mode 100644 java/res/values/config-additional-features.xml diff --git a/java/res/values/config-additional-features.xml b/java/res/values/config-additional-features.xml new file mode 100644 index 000000000..47eb7724c --- /dev/null +++ b/java/res/values/config-additional-features.xml @@ -0,0 +1,24 @@ + + + + + + false + diff --git a/java/src/com/android/inputmethod/latin/settings/Settings.java b/java/src/com/android/inputmethod/latin/settings/Settings.java index 8732a59f8..686c8d5f5 100644 --- a/java/src/com/android/inputmethod/latin/settings/Settings.java +++ b/java/src/com/android/inputmethod/latin/settings/Settings.java @@ -81,6 +81,7 @@ public final class Settings implements SharedPreferences.OnSharedPreferenceChang public static final String PREF_GESTURE_FLOATING_PREVIEW_TEXT = "pref_gesture_floating_preview_text"; public static final String PREF_SHOW_SETUP_WIZARD_ICON = "pref_show_setup_wizard_icon"; + public static final String PREF_PHRASE_GESTURE_ENABLED = "pref_gesture_space_aware"; public static final String PREF_INPUT_LANGUAGE = "input_language"; public static final String PREF_SELECTED_LANGUAGES = "selected_languages"; @@ -216,6 +217,12 @@ public final class Settings implements SharedPreferences.OnSharedPreferenceChang && prefs.getBoolean(Settings.PREF_GESTURE_INPUT, true); } + public static boolean readPhraseGestureEnabled(final SharedPreferences prefs, + final Resources res) { + return prefs.getBoolean(Settings.PREF_PHRASE_GESTURE_ENABLED, + res.getBoolean(R.bool.config_default_phrase_gesture_enabled)); + } + public static boolean readFromBuildConfigIfToShowKeyPreviewPopupSettingsOption( final Resources res) { return res.getBoolean(R.bool.config_enable_show_option_of_key_preview_popup); diff --git a/java/src/com/android/inputmethod/latin/settings/SettingsValues.java b/java/src/com/android/inputmethod/latin/settings/SettingsValues.java index fc2d19298..ee322e91b 100644 --- a/java/src/com/android/inputmethod/latin/settings/SettingsValues.java +++ b/java/src/com/android/inputmethod/latin/settings/SettingsValues.java @@ -76,6 +76,7 @@ public final class SettingsValues { public final boolean mGestureTrailEnabled; public final boolean mGestureFloatingPreviewTextEnabled; public final boolean mSlidingKeyInputPreviewEnabled; + public final boolean mPhraseGestureEnabled; public final int mKeyLongpressTimeout; public final Locale mLocale; @@ -159,6 +160,7 @@ public final class SettingsValues { mGestureTrailEnabled = prefs.getBoolean(Settings.PREF_GESTURE_PREVIEW_TRAIL, true); mGestureFloatingPreviewTextEnabled = prefs.getBoolean( Settings.PREF_GESTURE_FLOATING_PREVIEW_TEXT, true); + mPhraseGestureEnabled = Settings.readPhraseGestureEnabled(prefs, res); mCorrectionEnabled = mAutoCorrectEnabled && !mInputAttributes.mInputTypeNoAutoCorrect; final String showSuggestionsSetting = prefs.getString( Settings.PREF_SHOW_SUGGESTIONS_SETTING, @@ -211,6 +213,7 @@ public final class SettingsValues { mGestureInputEnabled = true; mGestureTrailEnabled = true; mGestureFloatingPreviewTextEnabled = true; + mPhraseGestureEnabled = true; mCorrectionEnabled = mAutoCorrectEnabled && !mInputAttributes.mInputTypeNoAutoCorrect; mSuggestionVisibility = 0; mIsInternal = false;