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

Commit 31575054 authored by Michael Webster's avatar Michael Webster Committed by Steve Kondik
Browse files

Lockscreen Gestures -

System settings component.
Adds settings for gestures active, traces active, sensitivity.
Adds gesture overlay to lockscreen layouts.

Depends on change 540 and 565

Change-Id: Icf1b1614e05ef4383d53d97813bf698325ff1408

Gesture updates:

- User can now define unlock and sound toggle gestures.
- Lockscreen tabs can now be fully disabled, but ONLY if there is
  some other method of unlocking the device enabled.  This includes:
  Trackball unlock, menu key unlock, and gesture unlock.
- Changed default gesture sensitivity to 3

Gestures fix

- added 'none' to xml attributes for 'orientation' -
- Updated GestureOverlayView to allow an orientation of 'none.

This allows the lockscreen to recognize gestures in any direction,
and of any complexity.

Fix gesture api properly.

Change-Id: I863f7cfcd4c5d27d9a1c3e080dccff0671fdf587

Lockscreen gestures color setting

Allow user to choose the color for gestures on the lockscreen

Change-Id: I588620e2f5110119b9f04a9ebb66357fbbe93c96

Lockscreen gestures

Allows the user to use custom gestures to launch activities
and shortcuts directly from the lockscreen.

These gestures can be programmed from the CMParts app under:
Input Settings-> Lockscreen Gestures

Change-Id: Icc5722213939d63f15761a644db9f43ca2ebe9e1
parent 37e1d8c9
Loading
Loading
Loading
Loading
+3 −1
Original line number Original line Diff line number Diff line
@@ -58,6 +58,8 @@ public class GestureOverlayView extends FrameLayout {


    public static final int ORIENTATION_HORIZONTAL = 0;
    public static final int ORIENTATION_HORIZONTAL = 0;
    public static final int ORIENTATION_VERTICAL = 1;
    public static final int ORIENTATION_VERTICAL = 1;
    /** @hide */
    public static final int ORIENTATION_NONE = 2;


    private static final int FADE_ANIMATION_RATE = 16;
    private static final int FADE_ANIMATION_RATE = 16;
    private static final boolean GESTURE_RENDERING_ANTIALIAS = true;
    private static final boolean GESTURE_RENDERING_ANTIALIAS = true;
@@ -645,7 +647,7 @@ public class GestureOverlayView extends FrameLayout {
                        angle = 180 - angle;
                        angle = 180 - angle;
                    }
                    }


                    if (box.squareness > mGestureStrokeSquarenessTreshold ||
                    if (mOrientation == ORIENTATION_NONE || box.squareness > mGestureStrokeSquarenessTreshold ||
                            (mOrientation == ORIENTATION_VERTICAL ?
                            (mOrientation == ORIENTATION_VERTICAL ?
                                    angle < mGestureStrokeAngleThreshold :
                                    angle < mGestureStrokeAngleThreshold :
                                    angle > mGestureStrokeAngleThreshold)) {
                                    angle > mGestureStrokeAngleThreshold)) {
+33 −1
Original line number Original line Diff line number Diff line
@@ -2190,6 +2190,30 @@ public final class Settings {
         */
         */
        public static final String LOCKSCREEN_ALWAYS_MUSIC_CONTROLS = "lockscreen_always_music_controls";
        public static final String LOCKSCREEN_ALWAYS_MUSIC_CONTROLS = "lockscreen_always_music_controls";
        
        
        /**
         * Whether to listen for gestures on the lockscreen
         * @hide
         */
        public static final String LOCKSCREEN_GESTURES_ENABLED = "lockscreen_gestures_enabled";

        /**
         * Whether to show the gesture trail on the lockscreen
         * @hide
         */
        public static final String LOCKSCREEN_GESTURES_TRAIL = "lockscreen_gestures_trail";

        /**
         * Sensitivity for parsing gestures on the lockscreen
         * @hide
         */
        public static final String LOCKSCREEN_GESTURES_SENSITIVITY = "lockscreen_gestures_sensitivity";

        /**
         * Color value for gestures on lockscreen
         * @hide
         */
        public static final String LOCKSCREEN_GESTURES_COLOR = "lockscreen_gestures_color";

        /**
        /**
         * Settings to backup. This is here so that it's in the same place as the settings
         * Settings to backup. This is here so that it's in the same place as the settings
         * keys and easy to update.
         * keys and easy to update.
@@ -2271,7 +2295,9 @@ public final class Settings {
            HAPTIC_UP_ARRAY_DEFAULT,
            HAPTIC_UP_ARRAY_DEFAULT,
            HAPTIC_LONG_ARRAY_DEFAULT,
            HAPTIC_LONG_ARRAY_DEFAULT,
            HAPTIC_TAP_ARRAY,
            HAPTIC_TAP_ARRAY,
            HAPTIC_TAP_ARRAY_DEFAULT
            HAPTIC_TAP_ARRAY_DEFAULT,
            LOCKSCREEN_GESTURES_SENSITIVITY,
            LOCKSCREEN_GESTURES_COLOR
        };
        };


        // Settings moved to Settings.Secure
        // Settings moved to Settings.Secure
@@ -3995,6 +4021,12 @@ public final class Settings {
         */
         */
        public static final String KILL_APP_LONGPRESS_BACK = "kill_app_on_longpress_back";
        public static final String KILL_APP_LONGPRESS_BACK = "kill_app_on_longpress_back";
        
        
        /**
         * Whether to disable the lockscreen unlock tab
         * @hide
         */
        public static final String LOCKSCREEN_GESTURES_DISABLE_UNLOCK = "lockscreen_gestures_disable_unlock";

        /**
        /**
         * @hide
         * @hide
         */
         */
+203 −198
Original line number Original line Diff line number Diff line
@@ -21,7 +21,15 @@
  state of the device, as well as instructions on how to get past it
  state of the device, as well as instructions on how to get past it
  depending on the state of the device.  It is the same for landscape
  depending on the state of the device.  It is the same for landscape
  and portrait.-->
  and portrait.-->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
<android.gesture.GestureOverlayView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/gestures"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:gestureStrokeType="multiple"
    android:eventsInterceptionEnabled="false"
    android:orientation="none">
    <RelativeLayout
        xmlns:tabunlock="http://schemas.android.com/apk/res/com.android.tabunlock"
        xmlns:tabunlock="http://schemas.android.com/apk/res/com.android.tabunlock"
        android:layout_width="match_parent"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_height="match_parent"
@@ -41,6 +49,7 @@
            android:ellipsize="marquee"
            android:ellipsize="marquee"
            android:gravity="right|bottom"
            android:gravity="right|bottom"
            android:textAppearance="?android:attr/textAppearanceMedium"
            android:textAppearance="?android:attr/textAppearanceMedium"
            android:textSize="22sp"
            />
            />


        <!-- "emergency calls only" shown when sim is missing or PUKd -->
        <!-- "emergency calls only" shown when sim is missing or PUKd -->
@@ -64,7 +73,7 @@
            android:layout_below="@id/carrier"
            android:layout_below="@id/carrier"
            android:layout_marginTop="32dip"
            android:layout_marginTop="32dip"
            android:layout_marginLeft="20dip"
            android:layout_marginLeft="20dip"
        android:layout_marginBottom="8dip"
            android:paddingBottom="8dip"
            >
            >


            <TextView android:id="@+id/timeDisplay"
            <TextView android:id="@+id/timeDisplay"
@@ -81,7 +90,6 @@
                android:layout_marginBottom="10dip"
                android:layout_marginBottom="10dip"
                />
                />



            <TextView android:id="@+id/am_pm"
            <TextView android:id="@+id/am_pm"
                android:layout_width="wrap_content"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_height="wrap_content"
@@ -97,7 +105,6 @@
                android:shadowDy="0"
                android:shadowDy="0"
                android:shadowRadius="3.0"
                android:shadowRadius="3.0"
                />
                />

        </com.android.internal.widget.DigitalClock>
        </com.android.internal.widget.DigitalClock>


        <TextView
        <TextView
@@ -235,7 +242,5 @@
            android:background="@color/transparent"
            android:background="@color/transparent"
            android:visibility="gone"
            android:visibility="gone"
            />
            />
        

    </RelativeLayout>
    </RelativeLayout>
</android.gesture.GestureOverlayView>
+17 −6
Original line number Original line Diff line number Diff line
@@ -20,6 +20,16 @@
<!-- This is the general lock screen which shows information about the
<!-- This is the general lock screen which shows information about the
  state of the device, as well as instructions on how to get past it
  state of the device, as well as instructions on how to get past it
  depending on the state of the device.-->
  depending on the state of the device.-->

<android.gesture.GestureOverlayView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/gestures"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:gestureStrokeType="multiple"
    android:eventsInterceptionEnabled="false"
    android:orientation="none">

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tabunlock="http://schemas.android.com/apk/res/com.android.tabunlock"
    xmlns:tabunlock="http://schemas.android.com/apk/res/com.android.tabunlock"
    android:layout_width="match_parent"
    android:layout_width="match_parent"
@@ -231,3 +241,4 @@
        />
        />


</LinearLayout>
</LinearLayout>
</android.gesture.GestureOverlayView>
+2 −0
Original line number Original line Diff line number Diff line
@@ -832,6 +832,8 @@
        <enum name="horizontal" value="0" />
        <enum name="horizontal" value="0" />
        <!-- Defines a vertical widget. -->
        <!-- Defines a vertical widget. -->
        <enum name="vertical" value="1" />
        <enum name="vertical" value="1" />
        <!-- no orientation (lockscreen hack only for gestures.) -->
        <enum name="none" value="2" />
    </attr>
    </attr>


    <!-- ========================== -->
    <!-- ========================== -->
Loading