# RecyclerView.SimpleOnItemTouchListener

# RecyclerView.SimpleOnItemTouchListener

Artifact:[androidx.recyclerview:recyclerview](https://developer.android.com/jetpack/androidx/releases/recyclerview)  
[View Source](https://cs.android.com/search?q=file:androidx/recyclerview/widget/RecyclerView.java+class:androidx.recyclerview.widget.RecyclerView.SimpleOnItemTouchListener)  
Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/recyclerview#1.0.0)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView.SimpleOnItemTouchListener "View this page in Java")

<br />

```
class RecyclerView.SimpleOnItemTouchListener : RecyclerView.OnItemTouchListener
```

<br />

*** ** * ** ***

An implementation of[RecyclerView.OnItemTouchListener](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/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.

## Summary

|                                                                             ### Public constructors                                                                             |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [SimpleOnItemTouchListener](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/RecyclerView.SimpleOnItemTouchListener#SimpleOnItemTouchListener())`()` |

|                                ### Public functions                                 |
|-------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | [onInterceptTouchEvent](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/RecyclerView.SimpleOnItemTouchListener#onInterceptTouchEvent(androidx.recyclerview.widget.RecyclerView,android.view.MotionEvent))`(rv: `[RecyclerView](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/RecyclerView)`, e: `[MotionEvent](https://developer.android.com/reference/android/view/MotionEvent.html)`)` 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. |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)       | [onRequestDisallowInterceptTouchEvent](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/RecyclerView.SimpleOnItemTouchListener#onRequestDisallowInterceptTouchEvent(boolean))`(disallowIntercept: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`)` Called when a child of RecyclerView does not want RecyclerView and its ancestors to intercept touch events with ViewGroup#onInterceptTouchEvent(MotionEvent).                                                                                                                       |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)       | [onTouchEvent](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/RecyclerView.SimpleOnItemTouchListener#onTouchEvent(androidx.recyclerview.widget.RecyclerView,android.view.MotionEvent))`(rv: `[RecyclerView](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/RecyclerView)`, e: `[MotionEvent](https://developer.android.com/reference/android/view/MotionEvent.html)`)` Process a touch event as part of a gesture that was claimed by returning true from a previous call to #onInterceptTouchEvent.                                           |

## Public constructors

### SimpleOnItemTouchListener

Added in 1.0.0  

```
SimpleOnItemTouchListener()
```  

## Public functions

### onInterceptTouchEvent

Added in[1.4.0](https://developer.android.com/jetpack/androidx/releases/recyclerview#1.4.0)  

```
fun onInterceptTouchEvent(rv: RecyclerView, e: MotionEvent): Boolean
```

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.

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.  

### onRequestDisallowInterceptTouchEvent

Added in[1.4.0](https://developer.android.com/jetpack/androidx/releases/recyclerview#1.4.0)  

```
fun onRequestDisallowInterceptTouchEvent(disallowIntercept: Boolean): Unit
```

Called when a child of RecyclerView does not want RecyclerView and its ancestors to intercept touch events with ViewGroup#onInterceptTouchEvent(MotionEvent).  

### onTouchEvent

Added in[1.4.0](https://developer.android.com/jetpack/androidx/releases/recyclerview#1.4.0)  

```
fun onTouchEvent(rv: RecyclerView, e: MotionEvent): Unit
```

Process a touch event as part of a gesture that was claimed by returning true from a previous call to #onInterceptTouchEvent.