summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Webster <miketwebster@gmail.com>2010-11-28 20:03:12 -0500
committerMichael Webster <miketwebster@gmail.com>2010-11-28 20:10:02 -0500
commita814ad7ab5d915224f54e5cd2c89b755414547a8 (patch)
tree3592fc199937b9dd741d52edb9193b73b8a91dbc
parentd98418db26a3af03d3c981efe3c4d5f6215327be (diff)
downloadframeworks_base-a814ad7ab5d915224f54e5cd2c89b755414547a8.zip
frameworks_base-a814ad7ab5d915224f54e5cd2c89b755414547a8.tar.gz
frameworks_base-a814ad7ab5d915224f54e5cd2c89b755414547a8.tar.bz2
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.
-rwxr-xr-xcore/java/android/gesture/GestureOverlayView.java3
-rw-r--r--core/res/res/layout/keyguard_screen_tab_unlock.xml2
-rw-r--r--core/res/res/layout/keyguard_screen_tab_unlock_land.xml2
-rw-r--r--core/res/res/values/attrs.xml2
4 files changed, 6 insertions, 3 deletions
diff --git a/core/java/android/gesture/GestureOverlayView.java b/core/java/android/gesture/GestureOverlayView.java
index b6c260f..9f26ac3 100755
--- a/core/java/android/gesture/GestureOverlayView.java
+++ b/core/java/android/gesture/GestureOverlayView.java
@@ -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)) {
diff --git a/core/res/res/layout/keyguard_screen_tab_unlock.xml b/core/res/res/layout/keyguard_screen_tab_unlock.xml
index 4dffb6c..365e829 100644
--- a/core/res/res/layout/keyguard_screen_tab_unlock.xml
+++ b/core/res/res/layout/keyguard_screen_tab_unlock.xml
@@ -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"
diff --git a/core/res/res/layout/keyguard_screen_tab_unlock_land.xml b/core/res/res/layout/keyguard_screen_tab_unlock_land.xml
index 2aacb99..9e37e9f 100644
--- a/core/res/res/layout/keyguard_screen_tab_unlock_land.xml
+++ b/core/res/res/layout/keyguard_screen_tab_unlock_land.xml
@@ -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"
diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml
index 42961de..f6716ea 100644
--- a/core/res/res/values/attrs.xml
+++ b/core/res/res/values/attrs.xml
@@ -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>
<!-- ========================== -->