Skip to content

Commit f88cfbb

Browse files
committed
Merge pull request daimajia#87 from audiebantzhan/patch-1
Update PagerIndicator.java
2 parents 2de6f9f + 5880308 commit f88cfbb

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

library/src/main/java/com/daimajia/slider/library/Indicators/PagerIndicator.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -444,11 +444,6 @@ private void setItemAsSelected(int position){
444444

445445
@Override
446446
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
447-
if(mItemCount == 0){
448-
return;
449-
}
450-
int n = position % mItemCount;
451-
setItemAsSelected(n - 1);
452447
}
453448

454449
public IndicatorVisibility getIndicatorVisibility(){
@@ -457,7 +452,11 @@ public IndicatorVisibility getIndicatorVisibility(){
457452

458453
@Override
459454
public void onPageSelected(int position) {
460-
455+
if(mItemCount == 0){
456+
return;
457+
}
458+
int n = position % mItemCount;
459+
setItemAsSelected(n - 1);
461460
}
462461
@Override
463462
public void onPageScrollStateChanged(int state) {

0 commit comments

Comments
 (0)