I have a listview that displays entries for a given date. There are buttons above the listview that allow you to increase/decrease the date. Everything works. What I’m looking to do is replace those buttons and have the user swipe right/left to increase/decrease the date.
What’s the best way to go about this? I don’t care what item is swiped, often there will be no items in the listview for a given date, just as long as it happens on the listview area. I do have click and longclick listeners on the items already.
Just implement the OnGestureListener.
Use a GestureDetector
Pass the touch event of the list to the GestureDetector
And finally use the fling method to detect a gesture. You can use the velocity values to detect the direction of the movement.