1

Please note this is not about nested scrolling. Recently i switched to ViewPager2. I have setup viewpager2 with a tabview (viewpager2 is horizontal). So on one of the fragment has a recyclerview. So when I scroll down on the recyclerview, some times the viepager2 switches tabs. This was not happening on the old viewpager. So if I need to scroll the recyclerview without changing the viewpager2 tabs, I need to carefully touch and drag 100% vertically like a straight line. if the touch is not a straight line, the viewpager2 switches tabs. If anyone can point me towards a fix, I would be glad. Thanks

I did try the NestedScrollableHost wrapper and it did not help.

Yasiru Nayanajith
  • 1,647
  • 17
  • 20
  • @Кирон Плэй is right. also this answer can help you too. (https://stackoverflow.com/questions/54978846/how-to-disable-swiping-in-viewpager2). If you like to permanent disable the swiping of ViewPager and only want to change using tab then only the one line `pager.setUserInputEnabled(false);` is enough – Chandresh 204 Apr 16 '22 at 07:50

0 Answers0