Closed tinybright closed 8 years ago
I won't make this a ViewPager indicator for now.
What you want can easily be implemented (but the guidelines discourage doing it) by adding OnPageChangeListener to your ViewPager and selecting tabs manually:
ViewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
@Override
public void onPageSelected(int position) {
// select a new tab and animate the selection.
bottomBar.selectTabAtPosition(position, true);
}
});
Avoid recursion by adding condition check.
mViewer.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
@Override
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
}
@Override
public void onPageSelected(int position) {
// select a new tab and animate the selection.
if(position != mBottomBar.getCurrentTabPosition())
mBottomBar.selectTabAtPosition(position, true);
}
@Override
public void onPageScrollStateChanged(int state) {
}
});
It doesn't at this time. I'll look into it and see if it should / can be done.
It seems that this is not meant to be an indicator for ViewPager though: