Skip to content

Commit

Permalink
Update SliderView.java
Browse files Browse the repository at this point in the history
  • Loading branch information
smarteist authored Feb 24, 2020
1 parent 4194d52 commit 248be7d
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,8 @@ public void setSliderAnimationDuration(int duration, Interpolator interpolator)
public void setCurrentPagePosition(int position) {

if (getSliderAdapter() != null) {
mSliderPager.setCurrentItem(position, true);
int midpoint = (getAdapterItemsCount() - 1) * (InfinitePagerAdapter.INFINITE_SCROLL_LIMIT / 2);
mSliderPager.setCurrentItem(midpoint + position, true);
} else {
throw new NullPointerException("Adapter not set");
}
Expand Down

0 comments on commit 248be7d

Please sign in to comment.