Browse Source

fixed gesture bug :-)

Alexander Brakowski 10 years ago
parent
commit
fd9efb5798

+ 2 - 1
AndroidManifest.xml

@@ -24,7 +24,8 @@
         android:icon="@drawable/ic_launcher"
         android:label="@string/app_name"
         android:theme="@style/AppTheme"
-        android:debuggable="true" >
+        android:debuggable="true"
+        android:installLocation="preferExternal">
         <activity
             android:name="de.tudarmstadt.informatik.hostage.ui2.activity.MainActivity"
             android:configChanges="keyboardHidden|orientation|screenSize"

+ 6 - 2
src/de/tudarmstadt/informatik/hostage/ui2/listeners/OnSwipeTouchListener.java

@@ -22,8 +22,8 @@ public class OnSwipeTouchListener implements OnTouchListener {
 
 	private final class GestureListener extends SimpleOnGestureListener {
 
-		private static final int SWIPE_THRESHOLD = 250;
-		private static final int SWIPE_VELOCITY_THRESHOLD = 70; //or 60
+		private static final int SWIPE_THRESHOLD = 100;
+		private static final int SWIPE_VELOCITY_THRESHOLD = 100; //or 60
 
 		@Override
 		public boolean onDown(MotionEvent e) {
@@ -40,16 +40,20 @@ public class OnSwipeTouchListener implements OnTouchListener {
 					if (Math.abs(diffX) > SWIPE_THRESHOLD && Math.abs(velocityX) > SWIPE_VELOCITY_THRESHOLD) {
 						if (diffX > 0) {
 							onSwipeRight();
+							result = true;
 						} else {
 							onSwipeLeft();
+							result = true;
 						}
 					}
 				} else {
 					if (Math.abs(diffY) > SWIPE_THRESHOLD && Math.abs(velocityY) > SWIPE_VELOCITY_THRESHOLD) {
 						if (diffY > 0) {
 							onSwipeBottom();
+							result = true;
 						} else {
 							onSwipeTop();
+							result = true;
 						}
 					}
 				}