Questions tagged [gesture]

A gesture is a specific pattern of touch, cursor, or physical movement that may be recognized by an application to perform a specific task.

A gesture is a specific pattern of touch, cursor, or physical movement (Recognized through a camera or other sensor such as or ) that may be recognized by an application to perform a specific task. See also .

2187 questions
21
votes
3 answers

How to generate zoom/pinch gesture for testing for Android

I'm trying to generate zoom/pinch gesture for testing, I have tried to use the Android API MotionEvent.obtain(), but found it is hard to implement the zoom/pinch events. I referenced the API from MotionEvent.obtain. Can you tell me the correct…
longchuan
  • 581
  • 1
  • 4
  • 12
21
votes
3 answers

Android: swipe screen to open another activity?

i'm a n00b programmer and need a lot of help. Just for tutorial purpose, I want to make simple flora & fauna (plant & animal) encyclopedia I want to make my home screen drag-able just like the Android's home screen. Swipe right to open Plant page…
hrsetyono
  • 4,474
  • 13
  • 46
  • 80
19
votes
4 answers

Disable drag down to close showModalBottomSheet

How do I disable / escape drag down gesture within the Bottom Sheet Modal so the user can interact within the modal without accidentally closing the modal? Updated below with the actual modal bottom sheet. return showModalBottomSheet( context:…
Jesse
  • 2,690
  • 9
  • 15
  • 28
19
votes
1 answer

ItemTouchHelper : Limit swipe width of ItemTouchHelper.SimpleCallBack on RecyclerView

I have successfully implemented swipe behavior and performed some actions with it. The problem now I have is I want to limit the swipe width when I swipe the item. Currently this is what is happening But I want to limit the swipe behaviour width…
viper
  • 1,836
  • 4
  • 25
  • 41
19
votes
2 answers

Difference between onSingleTapConfirmed and onSingleTapUp

What is the difference between onSingleTapConfirmed and onSingleTapUp in GestureDetector.SimpleOnGestureListener? Which one of these is similar to onClick methods?
Binoy Babu
  • 16,699
  • 17
  • 91
  • 134
19
votes
1 answer

Detect swipe gesture in fragment

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…
Siddhpura Amit
  • 14,534
  • 16
  • 91
  • 150
18
votes
4 answers

Get speed of a onTouch ACTION_MOVE event in Android

This should be a pretty simple thing to do. The user puts his finger on the screen and drags it around the screen. There are two events firing on onTouch: MotionEvent.ACTION_DOWN MotionEvent.ACTION_MOVE Now, how can I calculate the speed of the…
Alin
  • 14,809
  • 40
  • 129
  • 218
18
votes
4 answers

Make ViewPager snap with shorter drag

Is there any way to make the support package ViewPager snap to the next page with a shorter drag? The default behaviour seems to be that even if I drag almost 75% the page still snaps back to the previous page when I let go. I'd like to make the…
Juhani
  • 5,076
  • 5
  • 33
  • 35
18
votes
1 answer

iOS - Double tap on uibutton

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 =…
Kerberos
  • 4,036
  • 3
  • 36
  • 55
17
votes
3 answers

In Flutter, how can a child widget prevent the scrolling of its scrollable parent?

I have a scrollable widget, say a ListView, which contains some special widget. How can I prevent the scrollable to scroll when the user tries to scroll by starting to scroll on top of that widget? In other words, I want that widget to be like a…
Marcelo Glasberg
  • 29,013
  • 23
  • 109
  • 133
17
votes
1 answer

Is it possible to get "contextual" gestures in Monogame/XNA?

I am working on a multi-touch app using Monogame, where multiple users can work on a larger multi-touch screen with separate documents/images/videos simultaneously, and I was wondering if it's possible to make gestures "context-aware", i.e. two…
Lou
  • 4,244
  • 3
  • 33
  • 72
16
votes
2 answers

Detect DragGesture cancelation in SwiftUI

So I have a Rectangle with an added DragGesture and want to track gesture start, change and ending. The issue is when I put another finger on the Rectangle while performing the gesture, the first gesture stop calling onChange handler and does not…
whn
  • 321
  • 3
  • 11
16
votes
7 answers

How to make long press gesture in Xamarin Forms?

Could you please let me know how can I recognize long press gesture in Xamarin Forms application? A few days before I used TapGestureRecognizer TapGestureRecognizer imageTap = new TapGestureRecognizer(); imageTap.Tapped += (sender, args) =>…
Joseph Katzman
  • 1,959
  • 6
  • 21
  • 47
16
votes
2 answers

how to implement both ontouch and also onfling in a same listview?

i have a listview and implemented onclick and also onfling.problem is when i do fling(swipe left to right), onclick event of listview is also getting executed.How to overCome this problem? how to differentiate touch(tap) and fling(swipe) in…
Ads
  • 6,681
  • 12
  • 47
  • 72
16
votes
3 answers

Drag and Drop Layout in android 2.2

Is it possible to add a layout in a gestureOverlay view and Drag Drop it in a desired position in android. I am able to add a layout but not able to drag and drop it..I want to know is it possible to do this in version 2.2?
Droid_Dev
  • 1,162
  • 1
  • 8
  • 25