Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7074307b authored by Jean Chalard's avatar Jean Chalard Committed by Android Git Automerger
Browse files

am 73d607fb: Merge "[AC5] Introduce the setting for phrase gesture."

* commit '73d607fb':
  [AC5] Introduce the setting for phrase gesture.
parents 9320451f 73d607fb
Loading
Loading
Loading
Loading
+24 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
**
** Copyright 2013, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
**     http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
-->

<resources>
    <!-- Whether phrase gestures are enabled by default -->
    <bool name="config_default_phrase_gesture_enabled">false</bool>
</resources>
+7 −0
Original line number Diff line number Diff line
@@ -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";
@@ -220,6 +221,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);
+3 −0
Original line number Diff line number Diff line
@@ -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;