-1

I am trying to make a button that will execute when we swipe over it. (using java in android studio). just like we can do it on the keys of a piano app. How can I do that?

parker
  • 41
  • 2
  • 13

1 Answers1

1

You might be looking to implement the onFling() method:

  • Drag: Fine gesture, slower, more controlled, typically has an on-screen target
  • Swipe: Gross gesture, faster, typically has no on-screen target
  • Fling: Gross gesture, with no on-screen target

(source)

This might also be of some help to you: Swipe listeners in Android

alex
  • 26
  • 2