gesture

Android onTouchListener for entire dialog

假装没事ソ 提交于 2019-11-29 11:59:53
I have a dialog to choose files from. This dialog contains a listview to show directories and files and has an onItemClickListener for navigation purposes. How can I react to fling events to go up in the directory structure? I tried setting an OnTouchListener on the root RelativeLayout to dispatches touch events to my GestureListener: final GestureDetector detector = new GestureDetector(new MyGestureDetector(tvCurrentPath)); dialog.findViewById(R.id.rlFilelist).setOnTouchListener(new OnTouchListener() { public boolean onTouch(View view, MotionEvent e) { detector.onTouchEvent(e); return false;

How to implement a two-finger double-click in Android?

北战南征 提交于 2019-11-29 09:37:02
问题 I know how to detect a double-click and a two-finger touch event, but how can I combine these to react so somebody needs to double click with two fingers? By default, Android has the long press to act as a second form of clicking, but I'm specifically looking for a two-finger double-click. 回答1: I wanted a simple and reusable interface that listens for two finger double taps and behaves like GestureDetector. So that you could use it like this (all cut & paste runnable code): public class

How to disable back gesture in iOS 7 for only one view

自古美人都是妖i 提交于 2019-11-29 07:34:47
I am trying to disable the back gesture for my view controller using the following set of code. In FirstViewController.m , I'm setting the delegate of interactivePopGestureRecognizer - (void) viewWillLoad { // Other stuff.. self.navigationController.interactivePopGestureRecognizer.delegate = self; } And then implementing the <UIGestureRecognizerDelegate> method and returning NO . - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch { return NO; } And in dealloc I'm setting the delegate to nil. (I have read somewhere that in iOS 7, you have to

iOS Advanced Gestures: Getting Swipe Direction Vector

柔情痞子 提交于 2019-11-29 05:59:55
Looking through the documentation , it seems that the new advanced gestures API doesn't determine the direction of a swipe beyond the basic { left, right, up, down }. I need the start point of the swipe and the direction. Is there anyway to retrieve this other than coding my own advanced gesture library from scratch out the basic gestures? And if this is my only option, could anyone point me to some open source code that does this? P i Got it! Documentation is here , under ' Creating Custom Gesture Recognizers ' at the bottom. Basically the six gestures Apple provides all derive from

Jquery Tools Touch horizontal only disable vertical touch

纵然是瞬间 提交于 2019-11-29 04:47:53
I have jquery tools scroller... I like it to have touch option implemented for swipeLeft swipeRight only. When I use touch: true, it does rotates when swipeUp/Down as well.. I followed instructions here: jQuery Tools Scrollable on touch disable vertical scroll and here: http://awardwinningfjords.com/2010/09/22/handling-touch-events-in-jquery-tools-scrollable.html but none seem to work.. any ideas? my Fiddle/demo is below for reference fiddle: http://jsfiddle.net/mmp2m/7/ demo: http://jsfiddle.net/mmp2m/7/show Thanks If the only control you are using is Scrollable then you could edit the source

Adding GestureOverlayView to my SurfaceView class, how to add to view hierarchy?

泪湿孤枕 提交于 2019-11-29 04:12:44
问题 I was informed in a later answer that I have to add the GestureOverlayView I create in code to my view hierarchy, and I am not 100% how to do that. Below is the original question for completeness. I want my game to be able to recognize gestures. I have this nice SurfaceView class that I do an onDraw to draw my sprites, and I have a thread thats running it to call the onDraw etc . This all works great. I am trying to add the GestureOverlayView to this and it just isn't working. Finally hacked

Swipe to switch tab selection

陌路散爱 提交于 2019-11-29 02:33:50
I have an application that is a Tab activity with various tabs that load an Activity. I would like to add swipe gesturing to switch between tabs, on both the tab control itself and each activity loaded in a tab. Is something like this possible? I'm not sure at what "depth" the gesture is listened to when you're making gestures on an Activity hosted in the tab control, or if the inner activities would have to pass data to the Tab Host. It's certainly possible; you'll need to write a custom layout and override onTouchEvent and onInterceptTouchEvent to decide whether to dispatch gestures through

swipe some part of the screen

坚强是说给别人听的谎言 提交于 2019-11-29 01:35:54
问题 I am trying to design one screen which contain some swipe part. I have one screen with mapview, listview and some text. My Mapview is main part of swipe, if i swipe at left then contact will shown and if i swipe right then address will be display. Here is my image. i am showing rounded part which i need to swipe. How can i implement this functionality in my app. I go through with one tutorial but it didn't help me. This tutorial teach how to swipe full screen but i need to swipe some part of

Detect swipe gesture in fragment

点点圈 提交于 2019-11-29 00:28:22
问题 Hi I have implemented a Fragment , and I want to detect touch event on my fragment. But I am unable to detect that event, as a matter of fact, no event is beign detected at all. It works well in Activity , but it's not working on fragments. Following is my code: public class Swipe_Fragment extends Fragment implements GestureDetector.OnGestureListener, GestureDetector.OnDoubleTapListener { private SimpleGestureFilter detector; private LinearLayout swipLinear; private static int DEFAULT = 50;

Detecting Tap & Hold in UITableView cells

不羁岁月 提交于 2019-11-29 00:03:24
How do we detect a tap & hold on a UITableViewCell ? In iOS 3.2 or later you can use UILongPressGestureRecognizer Here's the code lifted straight from my app. You should add these methods (and a boolean _cancelTouches member) to a class you derive from UITableViewCell. -(void) tapNHoldFired { self->_cancelTouches = YES; // DO WHATEVER YOU LIKE HERE!!! } -(void) cancelTapNHold { [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(tapNHoldFired) object:nil]; } - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { self->_cancelTouches = NO; [super touchesBegan