I am working on an Android Launcher Application, but I am stuck with the Swipe Up & Down Gesture on the Home Screen. I am using RecyclerView to show the applications in Grid-Layout.
On Home Screen if I Swipe Up it should open the "All Application Fragment" and on All Application Screen if I Swipe down it should close it. I am not able to get any listener to achieve this behavior.
I want to implement this behavior on the whole screen not on recyclerView. So kindly the solution where swipe gesture works irrespective of the recyclerView.
I have tried onTouchListner but due to the RecyclerView, it is not working.
Swipe gestures should work on the whole home screen.

To achieve this behaviour, what you can do is make a new class which implements View.OnTouchListener, add GestureDetector and override the onFling method to detect swipe-up and swipe-down gestures. After that, you can add this new touchListener to your fragment view in onCreate and override the onSwipeUp() and onSwipeDows() methods as per your need. The touchListener class should look like this
and then add this to your view in the onCreate method of the fragments