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
0
votes
1 answer
Android just like gallery, how to fling fast to change image fast in single Imageview
My requirement is on touch move I have to change image in image view.If user fling fast based on velocity I want to get fling speed interval and change image.
I am able to get X and Y velocity, but based on velocity how to find timer interval to…

AbiAndroid
- 89
- 2
- 4
- 14
0
votes
1 answer
OnFling is not called on the last listview Item
I have implemented a gesture detector for my listview items, where onfling gesture is detected, two buttons will be shown. The first few list items worked fine.
However when I scroll to the bottom of my listview, onfling will not work for the last…

XXX
- 333
- 1
- 2
- 9
0
votes
0 answers
How can I filling progressbar by scroll?
I want to fill progressbar when I swipe my hand on the phone.
I think I should use scroll method or onfling method. But how can I understand how much I swipe?
I use this code :
@Override
public boolean onScroll (MotionEvent e1,…

user3086226
- 93
- 1
- 7
- 18
0
votes
1 answer
OnFling method not functioning in app
I implemented an onFling() in each of my activities which was supposed to navigate between the previous and next activity using intents.
But when I run the app it doesn't work and it won't show up in my log cat.Is there another way I should be…

Brian Var
- 6,029
- 25
- 114
- 212
0
votes
2 answers
ListView stopped accepting basic gestures after setting custom GestureListener
I have created a GestureListener with a customized onFling method. I didn't override onScroll or onSingleTapConfirmed.
I created the listener like this:
ListView listView=(ListView)findViewById(android.R.id.list);
final GestureDetector…

Nestor
- 8,194
- 7
- 77
- 156
0
votes
1 answer
How do detect onfling inside onscroll in android?
The problem is I would like to call some function when onscroll is firing but not onfling. However, I found that if the onfling is trigger , it comes with the onscroll. I notice the difference between them is onscroll + tapUp = onfling.
So I would…

user782104
- 13,233
- 55
- 172
- 312
0
votes
1 answer
Bouncing back on the edges
I am trying to make a small game where you can fling a coin on the screen. while i was searching for that kind of animation i found this page
http://mobile.tutsplus.com/tutorials/android/android-gesture/
I managed to customise the events according…

koraxis
- 801
- 2
- 12
- 22
0
votes
1 answer
When onFling is performed?
I don't understand when onfling (from OnGestureListener) is performed.
Only works when I shake the mouse through the emulator screen. Thanks!

user2383054
- 175
- 1
- 1
- 10
0
votes
1 answer
Horizontal Fling starts only on offset 0
I am trying to implement fling. Problem is that I get it only when the X is on offset 0 (which means on the edge of the screen). When I try to have a fling in the middle of the screen nothing happens. This happens only on X. Y behaves OK.
Here is…

Nicky Pappo
- 21
- 5
0
votes
2 answers
OnFling is not detected in low velocities
I am implementing OnFling. It works only when the velocity is very high. Which means i need to move my finger very very fast so that the Fling will take place.
this is the code:
SimpleOnGestureListener simpleOnGestureListener = new…

Nicky Pappo
- 21
- 5
0
votes
1 answer
onFling() gestures not being accurate
So, I have the following body for my onFling() method:
public boolean onFling(MotionEvent e1, MotionEvent e2,
float velocityX, float velocityY) {
try {
// Left swipe
if ( velocityX <…

Jon
- 55
- 9
0
votes
1 answer
Galleryview-Differentiate touch and swipe
I have a gallery with imageviews. I have set a ontouch event on gallery where i can drag the image from gallery and place it some where else. I am able to drag it, but as i am doing it in onTouch event, my gallery dosent scroll hoizontally…

user1618970
- 15
- 2
- 7
0
votes
1 answer
Java: Breakout game, move player as I swipe?
I'm making a simple Breakout game, and so far I have created the ball and the player. I made the ball so that it moves to the position you touch, but I'd rather have it moving towards the direction I swipe. As in, the player moves along with my…

Misoxeny
- 93
- 2
- 3
- 10
0
votes
1 answer
How to get a screen switch be fling in android?
I am creating an Android app and would like to provide several layouts that can be switched by flinging (like Android home screens). I got the layouts to switch be flinging using this code:
public boolean onFling(MotionEvent e1, MotionEvent e2,…
user1545072
0
votes
1 answer
Scrolling child views in gallery
I need help with enable scrolling the child views (That are not image View) in my gallery.
I understand overriding on Fling() is the solution, but I don’t know how to implement it.
Thank you!

user1787773
- 888
- 1
- 11
- 19