Skip to content

Commit

Permalink
Merge pull request #234 from xxxifan/pr
Browse files Browse the repository at this point in the history
add startLoopNow() function
  • Loading branch information
zhpanvip authored Oct 26, 2021
2 parents f2ff183 + 45ac649 commit 116ecb4
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions bannerview/src/main/java/com/zhpan/bannerview/BannerViewPager.java
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,17 @@ public void startLoop() {
}
}

/**
* Start loop immediately
*/
public void startLoopNow() {
if (!isLooping && isAutoPlay() && mBannerPagerAdapter != null &&
mBannerPagerAdapter.getListSize() > 1) {
mHandler.post(mRunnable);
isLooping = true;
}
}

/**
* Stop loop
*/
Expand Down

0 comments on commit 116ecb4

Please sign in to comment.