Make NestedScrollView and RecyclerView pleasant together by adding android:fillViewport="true"
to recycler
When you start dragging your item or when you reach the edge of the screen, you can also disable the recycler nested behavior with mRecyclerView.setNestedScrollingEnabled(false)
. This will cause the nested view to scroll so that the user continues to use recyclerview.
Once you're done, set the nested scroll to true again.
Alternatively, you will need to look at the delegation that receives touch events, as I set out for another question here . For your sample, this could be simple:
- When dragging, a call to
nestedScrollView.requestDisallowInterceptTouchEvent(true);
begins nestedScrollView.requestDisallowInterceptTouchEvent(true);
- When drag ends
requestDisallowInterceptTouchEvent(false)
to re-view scrollview
If requestDisallowInterceptTouchEvent does not work, you can subclass NestedScrollView and override onInterceptTouchEvent
as in my related answer
source share