Questions tagged [onfling]

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.

147 questions
52
votes
8 answers

Adding Fling Gesture to an image view - Android

Okay I have been referencing the code here: Fling gesture detection on grid layout but just can not get it to work. In my main activity I have a simple image defined. I want to detect a fling on the image. Here is my code below. The onclick method…
Ryan
  • 521
  • 1
  • 5
  • 3
44
votes
5 answers

Android: velocity-based ViewPager scrolling

The way the ViewPager scrolls right now is by one item per gesture. It treats flinging gesture the same way no matter if it's full screen fast fling or slow dragging; at the end page advances one step only. Is there any projects perhaps or examples…
Bostone
  • 34,822
  • 38
  • 158
  • 216
37
votes
2 answers

Android "swipe" vs "fling"

In the Android Developers gesture design section, the term "swipe" is used. In the developer section, the term "fling" is used. Are these terms synonymous? From what I have found, I believe they are, but nowhere is it explicitly said one way or the…
Sean Beach
  • 1,888
  • 3
  • 23
  • 35
25
votes
3 answers

Android - Gesture Detection (Swipe up/down) on particular view

I am trying to implement the OnGestureListener in Android. I have three TextViews in my layout. What i am trying to achieve is to set Gesture Listener for two of the textViews . Here is the layout -
Anukool
  • 4,741
  • 8
  • 25
  • 41
14
votes
6 answers

stop scrollView in the middle of the scroll

I have a scrollview with a lot of content. Now when user do a fling or scroll down, I want the scrollview to stop at a particular view location, where I am doing some animation, and then user can again fling or scroll down. I have tried the…
Deepak Senapati
  • 1,063
  • 1
  • 11
  • 29
12
votes
2 answers

onfling() not being called for some reason

I'm trying to implement gesture in my app and for some reason the the onfling() is not being called. I tried reading numerous posts regarding this and tried fixing my code but it's not working . The below is my code. Please have a look: public class…
Azhar92
  • 753
  • 1
  • 6
  • 16
10
votes
3 answers

Android OnGestureListener Fling is not detecting

I want to detect fling motion in a block of the screen. I am using the following code for that. public class MyinfoActivity extends Activity implements OnGestureListener { @Override public void onCreate(Bundle savedInstanceState) { …
dev_android
  • 7,874
  • 21
  • 84
  • 143
10
votes
2 answers

Detect end of fling on ScrollView

I've overridden ScrollView to pass MotionEvents to a GestureDetector to detect fling events on the ScrollView. I need to be able to detect when the scrolling stops. This doesn't coincide with the MotionEvent.ACTION_UP event because this usually…
Christopher Perry
  • 36,832
  • 42
  • 136
  • 182
9
votes
1 answer

Set GestureDetector to all child views

I would like to add a GestureDetector to all views (view groups) of an activity without assigning it manually to every single view. Right now onFling() is only activated when swiping over the background but not when swiping on e.g. button1. package…
Paradiesstaub
  • 2,010
  • 2
  • 15
  • 28
8
votes
3 answers

OnFling in a ListView, Get the swiped Item info

I'd like to have in my app the same behaviour of native contacts app. Specifically I'd like to implement the swipe right for call and the swipe left for the textmsg. I've a ListView, I setted the arrayAdapter and i'va implemented the gesture…
Frank.paletta
  • 83
  • 1
  • 6
7
votes
3 answers

Use ScaleGestureDetector with GestureDetector?

In my Android app I have an ImageView where I'd like the user to be able to fling it left/right/up/down to change the image (static maps) to the adjacent one. But in addition, I'd like pinch-zoom abilities and a map itself. I can get either flinging…
mraviator
  • 3,954
  • 8
  • 36
  • 51
6
votes
2 answers

SimpleOnGestureListener code not working in Android 2.2

I have some code that I wrote to implement a vertical swipe on a Gallery widget. It works great in Android 1.5 and 1.6 but does not work in Android 2.2 (I have yet to try it with 2.1). public class SwipeUpDetector extends…
Justin
  • 6,344
  • 6
  • 35
  • 34
6
votes
1 answer

Drag and Drop + Fling Detector not working

I'm trying to implement a draggable button that should also be flingable. Unfortunately the system stops sending MotionEvents after the drag is started. Therefore the GestureDetector.OnGestureListener.onFling() method is never called. Is there a…
timoschloesser
  • 2,679
  • 4
  • 22
  • 32
6
votes
1 answer

Showing a delete button on swipe in a listview for Android

Expanding on another Stackoverflow question, I've implemented some gesture detection code so that I can detect when a row in my listview (which is in a FrameLayout) has been swiped. I followed the question/answer by Damian here about how to get the…
Andy
  • 1,717
  • 2
  • 21
  • 46
6
votes
1 answer

Fling implementation on android canvas

I have the usual gesture detector for detecting fling , It is an instance attribute of a SurfaceView GestureDetector flingDetector = new GestureDetector(getContext(),new SimpleOnGestureListener() { @Override public boolean…
Gautam
  • 7,444
  • 9
  • 61
  • 102
1
2 3
9 10