Smooth cross RecyclingViews Swipe

Elye
Elye
Dec 31, 2018 · 3 min read
Image for post
Image for post
Image for post
Image for post

But that is not what I experience…

Image for post
Image for post

Solution

Using addOnItemTouchListener

recycler_view.addOnItemTouchListener(
object: RecyclerView.OnItemTouchListener {
override fun onTouchEvent(rv: RecyclerView, e: MotionEvent) {}
override fun onInterceptTouchEvent(rv: RecyclerView, e:
MotionEvent): Boolean {
if (e.action == MotionEvent.ACTION_DOWN &&
rv.scrollState == RecyclerView.SCROLL_STATE_SETTLING) {
rv.stopScroll()
}
return false
}

override fun onRequestDisallowInterceptTouchEvent(
disallowIntercept: Boolean) {}
})
Image for post
Image for post

Mobile App Development Publication

Sharing Mobile App Development and Learning

Sign up for Update from Mobile App Development Publication

By Mobile App Development Publication

A place where we learn and share our mobile app development experience on Medium Take a look

Create a free Medium account to get Update from Mobile App Development Publication in your inbox.

Elye

Written by

Elye

Passionate about learning, and sharing mobile development and others https://twitter.com/elye_project https://www.facebook.com/elye.proj

Mobile App Development Publication

Sharing iOS, Android and relevant Mobile App Development Technology and Learning

Elye

Written by

Elye

Passionate about learning, and sharing mobile development and others https://twitter.com/elye_project https://www.facebook.com/elye.proj

Mobile App Development Publication

Sharing iOS, Android and relevant Mobile App Development Technology and Learning

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store