Skip to content

Instantly share code, notes, and snippets.

@FarshadTahmasbi
Created April 3, 2020 20:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FarshadTahmasbi/af6c7165f0a53e6d23182f2a41370fd3 to your computer and use it in GitHub Desktop.
Save FarshadTahmasbi/af6c7165f0a53e6d23182f2a41370fd3 to your computer and use it in GitHub Desktop.
class ItemTouchInterceptor : RecyclerView.OnItemTouchListener {
private var intercept = false
override fun onTouchEvent(rv: RecyclerView, e: MotionEvent) {
}
override fun onInterceptTouchEvent(rv: RecyclerView, e: MotionEvent): Boolean {
return intercept
}
override fun onRequestDisallowInterceptTouchEvent(disallowIntercept: Boolean) {
}
fun enable() {
intercept = true
}
fun disable(){
intercept = false
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment