InfiniteViewPager not working at the left side
InfiniteViewPager should work as circular in both left and right side. Currently you make it infinite scroll in right side only not at left side.
Regards, Akhil
I got this too. The reason is actually that returning 0 in the getCurrentItem leads to this case and because this implementation does the modulo-thing also at getCurrentItem this happens.
When you replace like this, it will work, at least from my side, because it's just about moving your real 0 somewhere into the middle of the virtual values. More precisely would be an offset, that is half of the Adapter's getCount(). Doesnt matter, at least I reached a fluent behaviour of saying setCurrentItem(getCurrentItem +/- 1) in both directions.
@Override
public void setCurrentItem(int item, boolean smoothScroll) {
super.setCurrentItem(item + getOffset(), smoothScroll);
}
@Override
public int getCurrentItem() {
return super.getCurrentItem() - getOffset();
}
private int getOffset(){
return MULT_OFFSET*getAdapter().getRealCount(); // equals 0 if count is null
}