Created
April 3, 2020 20:57
-
-
Save FarshadTahmasbi/af6c7165f0a53e6d23182f2a41370fd3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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