In my app, I have a ViewPager that has different tabs. Each tab is composed only of a RecyclerView which can be scrolled vertically.
My problem is that when I try to navigate to other tab and swipe left or right, the RecyclerView's scroll is detected first and instead of going to another tab the RecyclerView gets scrolled.
I tried following property of recycler view:
rv_home.setNestedScrollingEnabled(false);
that time ViewPager swipe works as expected But vertical scrolling of recycler view disabled. What should I do?
rv_home.setHasFixedSize(true);
RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(getApplicationContext(),
LinearLayoutManager.VERTICAL, false);
layoutManager.setAutoMeasureEnabled(true);
rv_home.setNestedScrollingEnabled(false);
rv_home.setLayoutManager(layoutManager);
try this
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With