Skip to content

Commit

Permalink
fix LinePageIndicator #3
Browse files Browse the repository at this point in the history
  • Loading branch information
cpacm committed Sep 22, 2016
1 parent d24b9e3 commit 104eb72
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,10 @@ private int measureWidth(int measureSpec) {
result = specSize;
} else {
//Calculate the width according the views count
final int count = mViewPager.getAdapter().getCount();
int count = mViewPager.getAdapter().getCount();
if (mViewPager.getAdapter() instanceof InfinitePagerAdapter) {
count = ((InfinitePagerAdapter) mViewPager.getAdapter()).getRealCount();
}
result = getPaddingLeft() + getPaddingRight() + (count * mLineWidth) + ((count - 1) * mGapWidth);
//Respect AT_MOST value if that was what is called for by measureSpec
if (specMode == MeasureSpec.AT_MOST) {
Expand Down

0 comments on commit 104eb72

Please sign in to comment.