Skip to content

Instantly share code, notes, and snippets.

@MrCrambo
Created August 8, 2020 05:22
Show Gist options
  • Save MrCrambo/502a0e7974d29306a768d27f143b6157 to your computer and use it in GitHub Desktop.
Save MrCrambo/502a0e7974d29306a768d27f143b6157 to your computer and use it in GitHub Desktop.
class GestureListener implements GestureDetector.OnGestureListener, GestureDetector.OnDoubleTapListener
{
@Override
public boolean onSingleTapConfirmed(MotionEvent e)
{
// Do smth with single tap
}
@Override
public boolean onDoubleTapEvent(MotionEvent e)
{
// Do smth with double tap
}
@Override
public boolean onDown(MotionEvent e)
{
// Do smth when the users finger is down
}
@Override
public boolean onSingleTapUp(MotionEvent e)
{
// Do smth when the single tap is finished
}
@Override
public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY)
{
// Do smth when the scroll on screen happens
}
@Override
public void onLongPress(MotionEvent e)
{
// Do smth when the long press happens
}
@Override
public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY)
{
// Do smth when the fling happens
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment