public static class RecyclerView.SimpleOnItemTouchListener extends Object implements RecyclerView.OnItemTouchListener
RecyclerView.OnItemTouchListener
that has empty method bodies and
default return values.
You may prefer to extend this class if you don't need to override all methods. Another benefit of using this class is future compatibility. As the interface may change, we'll always provide a default implementation on this class so that your code won't break when you update to a new version of the support library.
Constructor and Description |
---|
SimpleOnItemTouchListener() |
Modifier and Type | Method and Description |
---|---|
boolean |
onInterceptTouchEvent(RecyclerView rv,
MotionEvent e)
Silently observe and/or take over touch events sent to the RecyclerView
before they are handled by either the RecyclerView itself or its child views.
|
void |
onRequestDisallowInterceptTouchEvent(boolean disallowIntercept)
Called when a child of RecyclerView does not want RecyclerView and its ancestors to
intercept touch events with
ViewGroup.onInterceptTouchEvent(MotionEvent) . |
void |
onTouchEvent(RecyclerView rv,
MotionEvent e)
Process a touch event as part of a gesture that was claimed by returning true from
a previous call to
RecyclerView.OnItemTouchListener.onInterceptTouchEvent(android.support.v7.widget.RecyclerView, android.view.MotionEvent) . |
public boolean onInterceptTouchEvent(RecyclerView rv, MotionEvent e)
RecyclerView.OnItemTouchListener
The onInterceptTouchEvent methods of each attached OnItemTouchListener will be run in the order in which each listener was added, before any other touch processing by the RecyclerView itself or child views occurs.
onInterceptTouchEvent
in interface RecyclerView.OnItemTouchListener
e
- MotionEvent describing the touch event. All coordinates are in
the RecyclerView's coordinate system.public void onTouchEvent(RecyclerView rv, MotionEvent e)
RecyclerView.OnItemTouchListener
RecyclerView.OnItemTouchListener.onInterceptTouchEvent(android.support.v7.widget.RecyclerView, android.view.MotionEvent)
.onTouchEvent
in interface RecyclerView.OnItemTouchListener
e
- MotionEvent describing the touch event. All coordinates are in
the RecyclerView's coordinate system.public void onRequestDisallowInterceptTouchEvent(boolean disallowIntercept)
RecyclerView.OnItemTouchListener
ViewGroup.onInterceptTouchEvent(MotionEvent)
.onRequestDisallowInterceptTouchEvent
in interface RecyclerView.OnItemTouchListener
disallowIntercept
- True if the child does not want the parent to
intercept touch events.ViewParent.requestDisallowInterceptTouchEvent(boolean)