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

Commit bd58149b authored by masiullah's avatar masiullah Committed by Steve Kondik
Browse files

Stylus gestures features (2/2)

*Forward-port to CM-12.0

Change-Id: I0ab78f1129d2d04b0af21e9b38da027dfe3d1295
parent 02a60a62
Loading
Loading
Loading
Loading
+19 −0
Original line number Diff line number Diff line
@@ -433,4 +433,23 @@
        <item>users</item>
        <item>bugreport</item>
    </string-array>

    <!-- Stylus Gestures -->
    <string-array name="gestures_entries" translatable="false">
        <item>@string/gestures_action_empty</item>
        <item>@string/gestures_action_home</item>
        <item>@string/gestures_action_back</item>
        <item>@string/gestures_action_menu</item>
        <item>@string/gestures_action_search</item>
        <item>@string/gestures_action_recent</item>
    </string-array>

    <string-array name="gestures_values" translatable="false">
        <item>1000</item>
        <item>1001</item>
        <item>1002</item>
        <item>1003</item>
        <item>1004</item>
        <item>1005</item>
    </string-array>
</resources>
+25 −0
Original line number Diff line number Diff line
@@ -1022,4 +1022,29 @@

    <string name="navigation_ring_title">Navigation ring targets</string>
    <string name="navigation_ring_message">Tap the edit icon to open the navigation ring for editing.\n\nSelect a target to configure its behavior.\n\nTap the check mark icon to save your changes, or restore to reset the settings to defaults.</string>

    <!-- Stylus Gestures -->
    <string name="gestures_settings_title">Stylus gestures</string>
    <string name="category_spen_title">Stylus gestures</string>
    <string name="enable_subcat_title">Stylus</string>
    <string name="enable_spen_title_head">Enable gestures</string>
    <string name="enable_spen_summary_head">Use swipe gestures by holding down the stylus button</string>
    <string name="gestures_subcat_title">Gestures</string>
    <string name="gestures_left_spen_title_head">Left swipe</string>
    <string name="gestures_right_spen_title_head">Right swipe</string>
    <string name="gestures_up_spen_title_head">Up swipe</string>
    <string name="gestures_down_spen_title_head">Down swipe</string>
    <string name="gestures_long_spen_title_head">Long press</string>
    <string name="gestures_double_spen_title_head">Double tap</string>

    <!-- Gestures Options -->
    <string name="gestures_action_empty">No action</string>
    <string name="gestures_action_home">Home</string>
    <string name="gestures_action_back">Back</string>
    <string name="gestures_action_menu">Menu</string>
    <string name="gestures_action_search">Invoke search</string>
    <string name="gestures_action_recent">Recent apps</string>

    <!-- Stylus gestures -->
    <string name="stylus_app_not_installed">%s is not installed</string>
</resources>
+74 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2012 The CyanogenMod 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.
-->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" >

    <PreferenceCategory android:title="@string/enable_subcat_title" >

        <!-- Enable -->
        <com.android.settings.cyanogenmod.SystemSettingSwitchPreference
            android:key="enable_stylus_gestures"
            android:summary="@string/enable_spen_summary_head"
            android:title="@string/enable_spen_title_head" />

    </PreferenceCategory>

    <!-- Gesture Actions -->
    <PreferenceCategory android:title="@string/gestures_subcat_title" >
        <ListPreference
            android:dependency="enable_stylus_gestures"
            android:entries="@array/gestures_entries"
            android:entryValues="@array/gestures_values"
            android:key="gestures_left"
            android:persistent="false"
            android:title="@string/gestures_left_spen_title_head" />
        <ListPreference
            android:dependency="enable_stylus_gestures"
            android:entries="@array/gestures_entries"
            android:entryValues="@array/gestures_values"
            android:key="gestures_right"
            android:persistent="false"
            android:title="@string/gestures_right_spen_title_head" />
        <ListPreference
            android:dependency="enable_stylus_gestures"
            android:entries="@array/gestures_entries"
            android:entryValues="@array/gestures_values"
            android:key="gestures_up"
            android:persistent="false"
            android:title="@string/gestures_up_spen_title_head" />
        <ListPreference
            android:dependency="enable_stylus_gestures"
            android:entries="@array/gestures_entries"
            android:entryValues="@array/gestures_values"
            android:key="gestures_down"
            android:persistent="false"
            android:title="@string/gestures_down_spen_title_head" />
        <ListPreference
            android:dependency="enable_stylus_gestures"
            android:entries="@array/gestures_entries"
            android:entryValues="@array/gestures_values"
            android:key="gestures_long"
            android:persistent="false"
            android:title="@string/gestures_long_spen_title_head" />
        <ListPreference
            android:dependency="enable_stylus_gestures"
            android:entries="@array/gestures_entries"
            android:entryValues="@array/gestures_values"
            android:key="gestures_double"
            android:persistent="false"
            android:title="@string/gestures_double_spen_title_head" />
    </PreferenceCategory>

</PreferenceScreen>
+5 −0
Original line number Diff line number Diff line
@@ -93,6 +93,11 @@
                android:dialogTitle="@string/pointer_speed"
                />

        <PreferenceScreen
                android:fragment="com.android.settings.inputmethod.StylusGestures"
                android:key="stylus_gestures"
                android:title="@string/gestures_settings_title" />

        <SwitchPreference
                android:key="high_touch_sensitivity"
                android:title="@string/high_touch_sensitivity_title"
+7 −0
Original line number Diff line number Diff line
@@ -88,6 +88,7 @@ public class InputMethodAndLanguageSettings extends SettingsPreferenceFragment
    private static final String KEY_PREVIOUSLY_ENABLED_SUBTYPES = "previously_enabled_subtypes";
    private static final String KEY_HIGH_TOUCH_SENSITIVITY = "high_touch_sensitivity";
    private static final String KEY_TRACKPAD_SETTINGS = "gesture_pad_settings";
    private static final String KEY_STYLUS_GESTURES = "stylus_gestures";

    // false: on ICS or later
    private static final boolean SHOW_INPUT_METHOD_SWITCHER_SETTINGS = false;
@@ -99,6 +100,7 @@ public class InputMethodAndLanguageSettings extends SettingsPreferenceFragment
    private PreferenceCategory mHardKeyboardCategory;
    private PreferenceCategory mGameControllerCategory;
    private Preference mLanguagePref;
    private PreferenceScreen mStylusGestures;
    private final ArrayList<InputMethodPreference> mInputMethodPreferenceList = new ArrayList<>();
    private final ArrayList<PreferenceScreen> mHardKeyboardPreferenceList = new ArrayList<>();
    private InputManager mIm;
@@ -170,9 +172,14 @@ public class InputMethodAndLanguageSettings extends SettingsPreferenceFragment
        PreferenceCategory pointerSettingsCategory = (PreferenceCategory)
                        findPreference(KEY_POINTER_SETTINGS_CATEGORY);

        mStylusGestures = (PreferenceScreen) findPreference(KEY_STYLUS_GESTURES);
        mHighTouchSensitivity = (SwitchPreference) findPreference(KEY_HIGH_TOUCH_SENSITIVITY);

        if (pointerSettingsCategory != null) {
            if (!getResources().getBoolean(com.android.internal.R.bool.config_stylusGestures)) {
                pointerSettingsCategory.removePreference(mStylusGestures);
            }

            if (!isHighTouchSensitivitySupported()) {
                pointerSettingsCategory.removePreference(mHighTouchSensitivity);
                mHighTouchSensitivity = null;
Loading