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

Commit 283a1d35 authored by masiullah's avatar masiullah Committed by Gerrit Code Review
Browse files

Stylus gestures features (2/2)

Forward-port of https://github.com/CyanogenMod/android_packages_apps_Settings/commit/b3d850521e0042b85422903c70130f350f57b87a
to CM-10.1

Change-Id: I0ab78f1129d2d04b0af21e9b38da027dfe3d1295
parent 84447952
Loading
Loading
Loading
Loading
+19 −0
Original line number Diff line number Diff line
@@ -1282,5 +1282,24 @@
        <item>2</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>

    <!-- **** CYANOGENMOD ADDITIONS END **** -->
</resources>
+31 −0
Original line number Diff line number Diff line
@@ -5216,5 +5216,36 @@
    <string name="pie_control_trigger_top">Top screen border</string>
    <string name="pie_control_trigger_top_summary">Only navigation will be displayed at top</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 stylus gestures</string>
    <string name="enable_spen_summary_head">Launch custom actions with stylus button swipe gestures. Warning: apps will not be able to receive input fired by holding the stylus button</string>
    <string name="gestures_subcat_title">Gestures</string>
    <string name="gestures_left_spen_title_head">Left swipe</string>
    <string name="gestures_left_spen_summary_head">Launch custom action on left swipe</string>
    <string name="gestures_right_spen_title_head">Right swipe</string>
    <string name="gestures_right_spen_summary_head">Launch custom action on right swipe</string>
    <string name="gestures_up_spen_title_head">Up swipe</string>
    <string name="gestures_up_spen_summary_head">Launch custom action on up swipe</string>
    <string name="gestures_down_spen_title_head">Down swipe</string>
    <string name="gestures_down_spen_summary_head">Launch custom action on down swipe</string>
    <string name="gestures_long_spen_title_head">Long press</string>
    <string name="gestures_long_spen_summary_head">Launch custom action on long press</string>
    <string name="gestures_double_spen_title_head">Double tap</string>
    <string name="gestures_double_spen_summary_head">Launch custom action on double tap</string>

    <!-- Gestures Options -->
    <string name="gestures_action_empty">No action</string>
    <string name="gestures_action_home">Emulate home key</string>
    <string name="gestures_action_back">Emulate back key</string>
    <string name="gestures_action_menu">Emulate menu key</string>
    <string name="gestures_action_search">Invoke search</string>
    <string name="gestures_action_recent">Recent apps</string>

    <!-- stylus gestures support -->
    <string name="stylus_app_not_installed">%s is not installed</string>

    <!-- **** CYANOGENMOD ADDITIONS END **** -->
</resources>
+72 −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 -->
        <CheckBoxPreference
            android:key="enable_spen"
            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_spen"
            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_spen"
            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_spen"
            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_spen"
            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_spen"
            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_spen"
            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>
 No newline at end of file
+5 −0
Original line number Diff line number Diff line
@@ -101,6 +101,11 @@

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

        <com.android.settings.PointerSpeedPreference
                android:key="pointer_speed"
                android:title="@string/pointer_speed"
+8 −0
Original line number Diff line number Diff line
@@ -63,6 +63,9 @@ public class InputMethodAndLanguageSettings extends SettingsPreferenceFragment
    private static final String KEY_IME_SWITCHER = "status_bar_ime_switcher";
    private static final String KEY_VOLUME_KEY_CURSOR_CONTROL = "volume_key_cursor_control";
    private static final String KEY_STYLUS_ICON_ENABLED = "stylus_icon_enabled";
    private static final String VOLUME_KEY_CURSOR_CONTROL = "volume_key_cursor_control";
    private static final String KEY_STYLUS_GESTURES = "stylus_gestures";

    // false: on ICS or later
    private static final boolean SHOW_INPUT_METHOD_SWITCHER_SETTINGS = false;

@@ -186,6 +189,11 @@ public class InputMethodAndLanguageSettings extends SettingsPreferenceFragment
        }

        mStylusIconEnabled = (CheckBoxPreference) findPreference(KEY_STYLUS_ICON_ENABLED);
        // remove stylus preference for non stylus devices
        if (!getResources().getBoolean(com.android.internal.R.bool.config_stylusGestures)) {
            getPreferenceScreen().removePreference(findPreference(KEY_STYLUS_GESTURES));
            mStylusIconEnabled = null;
        }

        // Spell Checker
        final Intent intent = new Intent(Intent.ACTION_MAIN);
Loading