-
- All Implemented Interfaces:
-
tds.androidx.recyclerview.widget.RecyclerView.OnItemTouchListener
public class RecyclerView.SimpleOnItemTouchListener implements RecyclerView.OnItemTouchListener
An implementation of OnItemTouchListener that has empty method bodiesand default return values.
You may prefer to extend this class if you don't need to override all methods. Anotherbenefit of using this class is future compatibility. As the interface may change, we'llalways provide a default implementation on this class so that your code won't break whenyou update to a new version of the support library.
-
-
Method Summary
Modifier and Type Method Description 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. void
onTouchEvent(@NonNull() RecyclerView rv, @NonNull() MotionEvent e)
Process a touch event as part of a gesture that was claimed by returning true froma previous call to onInterceptTouchEvent. void
onRequestDisallowInterceptTouchEvent(boolean disallowIntercept)
Called when a child of RecyclerView does not want RecyclerView and its ancestors tointercept touch events with onInterceptTouchEvent. -
-
Method Detail
-
onInterceptTouchEvent
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.
-
onTouchEvent
void onTouchEvent(@NonNull() RecyclerView rv, @NonNull() MotionEvent e)
Process a touch event as part of a gesture that was claimed by returning true froma previous call to onInterceptTouchEvent.
- Parameters:
e
- MotionEvent describing the touch event.
-
onRequestDisallowInterceptTouchEvent
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.
-
-
-
-