ItemTouchHelper with RecyclerView in NestedScrollView: Drag scrolling not work

I have implemented ItemTouchHelper like descriped in this articel: https://medium.com/@ipaulpro/drag-and-swipe-with-recyclerview-b9456d2b1aaf#.k7xm7amxi

All works fine if the RecyclerView is a child of the CoordinatorLayout.

But if the RecyclerView is a child of NestedScrollView in CoordinatorLayout, the drag scrolling not working anymore. Draging an item and move it to the top or bottom of the screen, the RecyclerView not scrolling like it do if its not a child of NestedScrollView.

Any ideas?


Solution 1:

You have to disable the nestedScrolling for the recyclerView:

recyclerView.setIsNestedScrollingEnabled(false);