androidandroid-recyclerviewandroid-custom-viewandroid-scroll

Scroll inside RecyclerView item


I have a vertical RecyclerView and inside every item a custom view with own horizontal scroll and scale. When I try to scroll view inside item I get scroll conflict RecyclerView interrupts touch event and tries to move the list.

How can I restrict RecyclerView to handle horizontal swipe event?

I tried to interrupt event via RecyclerView.OnItemTouchListener and pass them directly to my custom view. That almost works but sometimes I get wrong events and scroll in the custom view does not work.

Has someone else faced this problem?


Solution

  • Try use simple OnTouchListener instead OnItemTouchListener