UILongPressGestureRecognizer gets called twice when pressing down

I am detecting if the user has pressed down for 2 seconds: UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(handleLongPress:)]; longPress.minimumPressDuration = 2.0; [self addGestureRecognizer:longPress]; [longPress release]; This is how I handle the long press: -(void)handleLongPress:(UILongPressGestureRecognizer*)recognizer{ NSLog(@”double oo”); } The text “double oo” gets printed twice when I press down for longer than 2 seconds. Why … Read more

Android: How to handle right to left swipe gestures

I want my app to recognize when a user swipes from right to left on the phone screen. How to do this? 22 s 22 OnSwipeTouchListener.java: import android.content.Context; import android.view.GestureDetector; import android.view.GestureDetector.SimpleOnGestureListener; import android.view.MotionEvent; import android.view.View; import android.view.View.OnTouchListener; public class OnSwipeTouchListener implements OnTouchListener { private final GestureDetector gestureDetector; public OnSwipeTouchListener (Context ctx){ gestureDetector = new … Read more

Fling gesture detection on grid layout

I want to get fling gesture detection working in my Android application. What I have is a GridLayout that contains 9 ImageViews. The source can be found here: Romain Guys’s Grid Layout. That file I take is from Romain Guy’s Photostream application and has only been slightly adapted. For the simple click situation I need … Read more