Package 

Interface RecyclerView.OnItemTouchListener


  • 
    public interface RecyclerView.OnItemTouchListener
    
                        

    An OnItemTouchListener allows the application to intercept touch events in progress at theview hierarchy level of the RecyclerView before those touch events are considered forRecyclerView's own scrolling behavior.

    This can be useful for applications that wish to implement various forms of gesturalmanipulation of item views within the RecyclerView. OnItemTouchListeners may intercepta touch interaction already in progress even if the RecyclerView is already handling thatgesture stream itself for the purposes of scrolling.

    • Method Detail

      • onInterceptTouchEvent

         abstract boolean onInterceptTouchEvent(@NonNull() RecyclerView rv, @NonNull() MotionEvent e)

        Silently observe and/or take over touch events sent to the RecyclerViewbefore they are handled by either the RecyclerView itself or its child views.

        The onInterceptTouchEvent methods of each attached OnItemTouchListener will be runin the order in which each listener was added, before any other touch processingby the RecyclerView itself or child views occurs.

        Parameters:
        e - MotionEvent describing the touch event.
      • onRequestDisallowInterceptTouchEvent

         abstract void onRequestDisallowInterceptTouchEvent(boolean disallowIntercept)

        Called when a child of RecyclerView does not want RecyclerView and its ancestors tointercept touch events with onInterceptTouchEvent.

        Parameters:
        disallowIntercept - True if the child does not want the parent tointercept touch events.