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

Commit a814ad7a authored by Michael Webster's avatar Michael Webster
Browse files

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.
parent d98418db
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -58,6 +58,7 @@ public class GestureOverlayView extends FrameLayout {

    public static final int ORIENTATION_HORIZONTAL = 0;
    public static final int ORIENTATION_VERTICAL = 1;
    public static final int ORIENTATION_NONE = 2;

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

                    if (box.squareness > mGestureStrokeSquarenessTreshold ||
                    if (mOrientation == ORIENTATION_NONE || box.squareness > mGestureStrokeSquarenessTreshold ||
                            (mOrientation == ORIENTATION_VERTICAL ?
                                    angle < mGestureStrokeAngleThreshold :
                                    angle > mGestureStrokeAngleThreshold)) {
+1 −1
Original line number Diff line number Diff line
@@ -29,7 +29,7 @@
    android:layout_height="fill_parent"
    android:gestureStrokeType="multiple"
    android:eventsInterceptionEnabled="false"
    android:orientation="vertical">
    android:orientation="none">
    <RelativeLayout
        xmlns:tabunlock="http://schemas.android.com/apk/res/com.android.tabunlock"
        android:layout_width="match_parent"
+1 −1
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@
    android:layout_height="fill_parent"
    android:gestureStrokeType="multiple"
    android:eventsInterceptionEnabled="false"
    android:orientation="horizontal">
    android:orientation="none">

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tabunlock="http://schemas.android.com/apk/res/com.android.tabunlock"
+2 −0
Original line number Diff line number Diff line
@@ -814,6 +814,8 @@
        <enum name="horizontal" value="0" />
        <!-- Defines a vertical widget. -->
        <enum name="vertical" value="1" />
        <!-- no orientation (lockscreen hack only for gestures.) -->
        <enum name="none" value="2" />
    </attr>

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