File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
library/src/main/java/net/cpacm/library/indicator/ViewpagerIndicator Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -368,7 +368,10 @@ private int measureWidth(int measureSpec) {
368368 result = specSize ;
369369 } else {
370370 //Calculate the width according the views count
371- final int count = mViewPager .getAdapter ().getCount ();
371+ int count = mViewPager .getAdapter ().getCount ();
372+ if (mViewPager .getAdapter () instanceof InfinitePagerAdapter ) {
373+ count = ((InfinitePagerAdapter ) mViewPager .getAdapter ()).getRealCount ();
374+ }
372375 result = getPaddingLeft () + getPaddingRight () + (count * mLineWidth ) + ((count - 1 ) * mGapWidth );
373376 //Respect AT_MOST value if that was what is called for by measureSpec
374377 if (specMode == MeasureSpec .AT_MOST ) {
You can’t perform that action at this time.
0 commit comments