I'm using a ViewPager2 with two fragments in a vertical orientation. When the user swipes down to the second fragment, there is a RecyclerView that scrolls content in the same vertical direction.
The issue is that when I scroll the contents of the RecyclerView, sometimes the ViewPager2 catches the scroll events and sometimes the RecyclerView catches the scroll events.
I would like it so that when the user is scrolling to the top of the RecyclerView, the ViewPager only swipes back up to the first fragment when the user has reached the top of the contents in the RecyclerView.
I've tried using recyclerView.isNestedScrollingEnabled = false
without much luck. I also tried putting the RecyclerView into a NestedScrollView, but that is not recommended because the RecyclerView then creates every single ViewHolder it needs for the dataset and that is obviously not efficient.