gesture

Gesture in listview android

99封情书 提交于 2019-11-27 06:38:42
hi i have to add a gesture to my listview,i want to implement the same functionality of contact application. when i left swipe it should send a message,right swipe it should call. can anyone help me how to do those gesture detection... i have implemented it in various other views... but i couldn't do for listView... i don't what going worng... my code is` /** Called when the activity is first created. */ public void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView(R.layout.main); // Create an array of Strings, that will be put to our ListActivity String[] names = new String[] {

How can a service listen for touch gestures/events?

假装没事ソ 提交于 2019-11-27 06:02:13
I'm wondering how apps like SwipePad and Wave Launcher are able to detect touch gestures/events simply through a service. These apps are able to detect a touch gestures even though it is not in their own Activity. I've looked all over the Internet and haven't found how they can do that. My main question is how a service can listen in on touch guestures/events just as a regular Activity may receive MotionEvents even though it may not be in the original Activity or context. I'm essentially trying a build an app that will recongize a particular touch gesture from a user regardless which Activity

How to recognize swipe gesture in UIScrollView

房东的猫 提交于 2019-11-27 02:53:10
I'm trying to recognize left/right swipe gesture in a UIScrollView . I've tried to create UISwipeGestureRecognizers and associate them with the scroll view. It works but very rarely. Most of the time I do not get called. Why? How can I reliably get swiping left/right to work? Can I use the gesture recognizers or do I have to somehow handle it myself in touchesBegan/Ended Thanks David Figured it out. In my case, my UIScrollView contained a UIImage that I allowed zooming. Apparently that meant that scrolling is enabled and the UIScrollView had trouble distinguishing between gestures intended to

Is there a way to trigger gesture events on Mac OS X?

懵懂的女人 提交于 2019-11-27 02:52:42
问题 I want to trigger multitouch gesture events on Mac OS X. Is there a way to do this? Mouse or keyboard events can be triggered with CGEventCreateMouseEvent and CGEventCreateKeyboardEvent. Is there similar low level function for multitouch events? Rok Your suggestion is not working. I've tried this code: - (void)rotateWithEvent:(NSEvent *)event { NSLog(@"ROTATE"); } -(IBAction)button:(id)sender { CGEventSourceRef eventSource = CGEventSourceCreate(kCGEventSourceStateCombinedSessionState);

iOS - Double tap on uibutton

旧时模样 提交于 2019-11-27 02:38:44
问题 I have a button and I'm testing the taps on it, with one tap it change a background color, with two taps another color and with three taps another color again. The code is: - (IBAction) button { UITapGestureRecognizer *tapOnce = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapOnce:)]; UITapGestureRecognizer *tapTwice = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapTwice:)]; UITapGestureRecognizer *tapTrice = [[UITapGestureRecognizer alloc]

Passing MotionEvents from RecyclerView.OnItemTouchListener to GestureDetectorCompat

 ̄綄美尐妖づ 提交于 2019-11-27 02:01:14
问题 I have a Fragment that implemets RecyclerView.OnItemTouchListener. How do I pass click and long-click motion events only from the RecyclerView to the GestureDetectorCompat. That is I mean I only want to handle clicks and long-clicks, rest of the events should be handled by the RecyclerView as it would happen normally. How can I set this up? public class MyFragment extends Fragment implements RecyclerView.OnItemTouchListener, GestureDetector.OnGestureListener { protected RecyclerView

Get swipe direction in Cocoa Touch

二次信任 提交于 2019-11-27 01:48:43
问题 I am trying to catch a gesture but it does not work. Here is my code: UISwipeGestureRecognizer *recognizer; recognizer = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(handleSwipeFrom:)]; [recognizer setDirection:(UISwipeGestureRecognizerDirectionRight | UISwipeGestureRecognizerDirectionLeft)]; [[self view] addGestureRecognizer:recognizer]; [recognizer release]; and -(void)handleSwipeFrom:(UISwipeGestureRecognizer *)recognizer { NSLog(@"get gesture"); if (recognizer

Comparing a saved movement with other movement with Kinect

隐身守侯 提交于 2019-11-27 01:25:20
问题 I need to develop an application where a user (physiotherapist) will perform a movement in front of the Kinect, I'll write the data movement in the database and then the patient will try to imitate this motion. The system will calculate the similarity between the movement recorded and executed. My first idea is, during recording (each 5 second, by example), to store the position (x, y, z) of the points and then compare them in the execution time(by patient). I know that this approach is too

Detect shake gesture IOS Swift

帅比萌擦擦* 提交于 2019-11-27 00:45:25
问题 I'm developing a app with a gesture system, basically if I turn the iPhone to left my app will do a function, if I turn the iPhone to Right, other function, with others gestures. I don't have idea how to work with that, i'm trying search in google but not work, the result is only touch gesture and not motion gesture. someone have a tutorial to help me? 回答1: Swift3 ios10: override func viewDidLoad() { super.viewDidLoad() self.becomeFirstResponder() // To get shake gesture } // We are willing

How to make an Android view that flips between views on swipe/fling

﹥>﹥吖頭↗ 提交于 2019-11-27 00:09:44
I'd like to make a view in my Android app that flips between multiple views on a swipe/fling. I'd like it to behave more or less like the Android Launcher behaves when flipping between views. In particular, It should flip views on swipe. Generally a swipe will flip between one view and the next. It should not fling across all of the views. If you swipe slowly, you should see the views dragging as you're swiping, eg. the way the Launcher does it. I tried using a ViewFlipper with a GestureOverlayView as per Romain Guy's blog post here , but there's no indicator to the user as they're swiping.