I\'d like to disable all the animations for the transitions in my custom ViewPager
.
This view pager contains four tabs -and each tab loads a Fragment
In the tabselected listener, just set the second argument of the setCurrentItem to false to disable the smooth scrolling.
mBottomNavigation.setOnTabSelectedListener((position, wasSelected) -> {
switch (position) {
case 0:
viewPager.setCurrentItem(0, false);
return true;
case 1:
viewPager.setCurrentItem(1, false);
return true;
case 2:
viewPager.setCurrentItem(2, false);
return true;
}
return false;
});