The onFling method is the method detecting the Fling motion will catch a horizontal swipe, either from left to right, or from right to left. It is called when the user swipe on the screen and must return either true or false.
Questions tagged [onfling]
143 questions
3
votes
1 answer
onFling not working
I have a ViewPager which holds a RecyclerView I add a OnTouchListener to an image view inside the RecyclerView's item, trying to detect touches using GestureDetector.SimpleOnGestureListener but I can't get the onFling events. I suspect it's…

RCB
- 2,253
- 2
- 25
- 49
3
votes
2 answers
Why Motionevent e1 in onFling method always null at first time swipe?
private final class SwipeGesture extends SimpleOnGestureListener {
private final int swipeMinDistance;
private final int swipeThresholdVelocity;
private MotionEvent mLastOnDownEvent = null;
public…

ning
- 31
- 3
3
votes
1 answer
Swipe right display button in android custom list view
I am trying to implement, show the button on swipe right in the custom list view. Problem i am facing right now is, i implemented the onSwipeTouchListener which i found online. I could able to see the swipe button. But its not consistent, i mean if…

dhiku
- 1,818
- 2
- 22
- 38
3
votes
3 answers
2 finger swipe in android
I tried implementing 2 finger swipe using onFling method of SimpleOnGestureListener. However,I found that SimpleOnGestureListener doesn't support two finger touch.
How can I work it out ?

Gaurav Arora
- 17,124
- 5
- 33
- 44
3
votes
1 answer
android SimpleOnGestureListener only triggered onscroll event
My Layout xml file like this

Csyr Peng
- 31
- 2
2
votes
1 answer
Catch onFling on ListView
I'd like to catch the event onFling on a ListView. My goal is to load images from the internet in my listview adapter only if I'm not on an onFling event. I found a snippet few months ago but I'm not able to find it today...
Do you have any…

Jul
- 1,039
- 3
- 12
- 20
2
votes
1 answer
How can I determine motion direction in an Android Gallery?
I have been creating a Gallery derivative that uses a limited number of Views and, as such, the Adapter needs to be able to populate these Views ahead of time during a scroll or a fling. To do this, I need to get the direction of motion from the…

Andrew Wyld
- 7,133
- 7
- 54
- 96
2
votes
2 answers
How do you implement an onFling event in TouchImageView so it acts like the galleries you see in Facebook or Google+
There are a handful of questions out there, but none really provided a clear solution to this problem. Android does not have anything built in to do so, so Mike Ortiz implemented TouchImageView which is awesome. It works perfectly for what it is…

Nick
- 925
- 1
- 8
- 13
2
votes
1 answer
OnClick ImageView with OnFling ViewFlipper
I have a ViewFlipper which holds a single ImageView. i want to be able to swipe to change the image / view, and click the image to play a sound.
I have a GestureDetector which is handling OnFling to change the view. I tried to put an onClickListener…

Tony
- 2,335
- 21
- 25
2
votes
2 answers
Trouble with onFling and SimpleOnGestureListener
I'm implementing a onFling detector much like the following question:
Fling gesture detection on grid layout
However, I just cannot get it to work.
In case some way I've set up my app is causing this issue (maybe the asynctask?), here's how my app…

Jeff Lamb
- 5,755
- 4
- 37
- 54
2
votes
2 answers
how to disable fling in android gallery
I have a custom gallery in my app and after doing some testing I've decided that I don't want the gallery to navigate with finger swipes. I've set up a left and right button to control it instead. Now I want to figure out how to disable the…

Emma Assin
- 851
- 2
- 12
- 23
2
votes
2 answers
Why is onFling() not working in ListView?
My app
schows a ListView. When swiping right or left the ListView for a the next or previous day should be loaded.
My solution
I tried to use the onFling() methode to detect a left or right swipe. It works fine if I swipe on the TextView above the…

Jan Meyer
- 214
- 3
- 10
2
votes
1 answer
Detecting clicks to different areas of Android Gallery items
Hey guys, I've been at this for a while, and I haven't found the solution that works 100% just yet.
The Issue
I have an Android Gallery which cycles through items, each consisting of an ImageView (let's call it Thumbnail) and another View below it…

Artem Russakovskii
- 21,516
- 18
- 92
- 115
2
votes
2 answers
how to implement gesture detector onfling in webview in android
can anybody give example how to implement gesture detector onfling in webview in android
Thanks

mohan
- 13,035
- 29
- 108
- 178
2
votes
0 answers
android listview - onfling inconsistent
Based on the code from Android: How to handle right to left swipe gestures, I've created the following GestureDetector for my ListView in order to handle swipes.
public ListEntryViewHolder(View view) {
ButterKnife.bind(this, view);
…

Gaurav
- 21
- 1
- 3