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
5
votes
0 answers
OnTouch and OnClick Conflict : Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkNotNullParameter, parameter e1
I have a Recyclerview and that allow user to change scale by swipping up, I use the gestureDetector and onFling for this, this works fine, but then the user should able to click on an Item of recyclerView, i did that by creating an interface from…

Mohamed Rimshad
- 360
- 2
- 13
5
votes
2 answers
onFling for a TextView not working
I'm trying to detect an onFling event for a TextView object. The code below works perfectly for the onDown event, however it fails to get the onScroll or onFling events. Any pointers?
Thanks
package rob.testapp;
import android.app.Activity;
import…

Sandy
- 2,572
- 7
- 40
- 61
5
votes
1 answer
Onfling and OnTouch does not work together
I have an Expandable Listview. I am implementing a deletion of the listItem on Swipe Left of each item.
I am using custom adapter for populating listview items.
public class InsightsListAdapter extends BaseExpandableListAdapter {
@Override
public…

John
- 8,846
- 8
- 50
- 85
5
votes
0 answers
Using onFling and ViewPager
I'm try to implement a ViewPager for a horizontal navegation and onFling from GestureDetector for a vertical navegation. The ViewPager it's OK, but onFling doesn't work. The code:
@Override
public void onCreate(Bundle savedInstanceState) {
…

Alano
- 81
- 6
5
votes
0 answers
Android Swipe Gesture Not Reliable
I have swiping working to some extent but I have a series of textviews and spinners that are on the screen and it seems like if I don't swipe straight across one of them and go just a little across two of them it doesn't pick it up that well. In…

Fencer04
- 1,084
- 1
- 11
- 17
5
votes
2 answers
Android - Trouble with swipe gesture
I'm trying to implement a swipe gesture in my app. I've made almost all code but it doesn't work.
Here is the code I have in my Activity:
// Swipe detector
gestureDetector = new GestureDetector(new SwipeGesture(this));
gestureListener = new…

Manitoba
- 8,522
- 11
- 60
- 122
4
votes
1 answer
SimpleOnGestureListener onFling velocity direction issue
I implemented a SimpleOnGestureListener on this Android app and it's the basic implementation and it's all working as it should:
the class implements OnTouchListener and I set it as TouchListener for the correct View, on the touch event I call my…

Budius
- 39,391
- 16
- 102
- 144
4
votes
0 answers
How to capture the current "fling" velocity on a scroll view and then trigger a new fling animation that looks continuous to the previous one?
What I'm trying to do is make a horizontal scroll view go circular.
Specifically, when the scrolling hits an edge the child view at the opposite end is moved there. My problem is continuing the fling animation after that.
I'm trying to capture the…

Victor Basso
- 5,556
- 5
- 42
- 60
4
votes
2 answers
Android left to right swipe only
I am a beginner in Android. I need to swipe only from left to right and to do not swipe from right to left. For this what I want to do? All the examples are showing both left to right and right to left?

RIJO R V
- 367
- 3
- 13
3
votes
2 answers
Android onTouchListener for entire dialog
I have a dialog to choose files from. This dialog contains a listview to show directories and files and has an onItemClickListener for navigation purposes.
How can I react to fling events to go up in the directory structure? I tried setting an…

Oliver
- 1,530
- 1
- 12
- 9
3
votes
1 answer
Android How to call OnFling when Swiping anywhere in the Activity not only in the ViewFlipper
In my viewFlipper some TextViews are loaded dynamically. The size may differ which means that under the viewFlipper there could be some space left (see the green part in the screenshot)
screenshot
I want the onFling method to be called not only when…

JoachimR
- 5,150
- 7
- 45
- 50
3
votes
1 answer
How do you make a fling gesture in the Android Emulator
I know this is not strictly a programming question, but even with all the "how to implement fling" questions I don't see the answer to this.
In the emulator how do you generate the actual fling?
I've tried LeftMouseDown + rapid mouse movement, but…

Noah
- 15,080
- 13
- 104
- 148
3
votes
2 answers
HorizontalScrollView - calculate stop position after fling
With HorizontalScrollView, how do I detect when the scrolling stops after user has flinged the view ? Or alternatively, how do I know at what position the scroll will be when it stops (then I could use it with onScrollChanged).
I have inherited…

jouj
- 31
- 1
- 2
3
votes
1 answer
Android - Paged ListActivity that pages on horizontal swipe
I have a list activity that implements Runnable so that my data fetch is done with a progress bar. The data is pulled from a web service. Right now, I go get all of the users, but I would like to change it so it retrieves the users one page at a…

Josh
- 16,286
- 25
- 113
- 158
3
votes
0 answers
How to implement Fling gesture in viewpager
Im developing one android app, in that application swipe is working fine,i want implement FLING gesture also for making swipe effective, i got sample code for horizontal fling, i need to change this into vertical fling gesture, can anyone help in…

developer
- 319
- 1
- 4
- 15