A package in the Android SDK that provides classes to create, recognize, load and save gestures. Gestures are patterns on the touch screen that map to specific functions.
Questions tagged [android-gesture]
271 questions
4
votes
1 answer
How to implement horizontal swipe inside a fragment?
I have two fragments with-in an activity. I want to implement swipe in one of those fragments. My layout is:

Jainendra
- 24,713
- 30
- 122
- 169
4
votes
1 answer
Android canvas - Drawing arc between to points and removing arc from path
In my android application, i want to provide tracing letter feature as shown in following image :
Here i want to provide tracing of letter-D and for that i need to draw arc between two points when user starts moving finger on arc. Here, if user…

Zankhna
- 4,570
- 9
- 62
- 103
4
votes
1 answer
How to properly set fixTransX & fixTransY of TouchImageView to implement doubleTap to ZoomOut?
I am using TouchImageView from here.
I am trying to implement ZoomOut for double tap. I have done it partially. But, I am facing some issues when zoomed out. If I zoom the Image & if I give a double tap, then image is not getting rendered…

Bharath
- 3,001
- 6
- 32
- 65
4
votes
1 answer
Why motionEvent.getX() return inconsistent values, when using setScaleX()?
I've child view resides in a ViewGroup.
I'd like to scale (zoom) the child with a pinch.
I'm using setScaleX/Y() to scale the child. The scale is calculated form distance between 2 pointers, in OnTouch().
But when I set the scale of the child it…

RonenD
- 53
- 4
4
votes
1 answer
How to get the position of the list item in onGesturePerformed method?
Here is a good tutorial in Android documentation with source code explaining GestureListview. But I cannot find how to get the list item position in onGesturePerformed(GestureOverlayView overlay, Gesture gesture) method?
Please see the comment in…

Imon
- 3,905
- 4
- 25
- 25
3
votes
2 answers
2 Finger Rotation gesture listener in android
I'm trying to figure out the best way to make an image rotate along with a user's finger dragging it left or right, and the angle of rotation.
float x1 = lastEvent[0] - lastEvent[1];
float y1 = lastEvent[2] - lastEvent[3];
float degrees1 =…

user430926
- 4,017
- 13
- 53
- 77
3
votes
2 answers
Pinch-zoom on a ListView
I have a ListView which contains a few TextView's arranged using a custom adapter.
What I would like to do, is implement pinch-to-zoom on this ListView, so that when the user pinches, they can increase or decrease the size of the text.
Does anyone…

howettl
- 12,419
- 13
- 56
- 91
3
votes
1 answer
Adding multiple gestures on a view, not working
I'm trying to add multiple gestures onto a view. I have successfully got them to work separately, but when I combine, only one ends up working, what am I doing incorrectly?
The first gesture I'm adding is a Scale Gesture:
public class…

DIRTY DAVE
- 2,523
- 2
- 20
- 83
3
votes
2 answers
Is fling gesture not supported by the Frame Layout?
I have included the Java and XML files for your ready reference.
I was aiming to put a keypad into a fragment into a frame layout. The frame Layout would then have a fling-able feature across the entire available screen.
In my experiment I found…

Varun Khanna
- 85
- 12
3
votes
1 answer
How to implement Touch listener and pinch zoom on the same view?
I want to implement touch listener for moving the view and pinch zoom for zoom it, but when I touch the view with fingers for pinch zoom, only touch listener works. I can't handle pinch zoom properly.
Please help me as I have no clue how to…

Ashraful Haque
- 1,588
- 1
- 13
- 13
3
votes
1 answer
How to make swipe with recycler view item?
I am working on floating Keyboard using Recycler view which would appear on screen when a button is clicked and dismisses when Right / Left swipe is done. As I am doing so I observed the swiping the keyboard is not smoother (Some times swipe…

Nithya
- 1,029
- 2
- 14
- 27
3
votes
3 answers
Continue onScroll event after onLongPress
Does anyone know how to combine onLongPress(MotionEvent e) and onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY)? Idea is to start with onLongPress but continue with sliding across some view.
Current code i have:
private…

RadoVidjen
- 432
- 7
- 17
3
votes
2 answers
The sensitivity of the finger swipe on the screen
I'm using GestureDetector.OnGestureListener to invoke method when user moves finger across the screen in the specified direction.
My problem - just move slightly and the method is called, I would like the user to move his finger a little more on the…
user8338451
3
votes
2 answers
How to distinguish between drag and click in onTouchEvent()?
I have a custom layout pinch zoom code as a parent and a child layout that handle the click feature. Therefore I use on touch intercept, but the problem is that with this it would not know when to click or drag.
@Override
public boolean…

Zheng Xian
- 310
- 1
- 3
- 13
3
votes
2 answers
Android Development - GestureDetector.OnGestureListener or GestureDetector.SimpleOnGestureListener
I'm working on simple code to detect all the gesture like fling, scroll, etc and was going to implement the interface GestureDetector.OnGestureListener for overriding its methods but I got to know that same could be done with…

Eddy
- 344
- 5
- 16