Skip to content

Commit b479d18

Browse files
committed
添加无限左滑动
1 parent e94e2a6 commit b479d18

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lbannerview/src/main/java/json/xxl/com/lbannerview/BannerViewPager.java

+2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ public class BannerViewPager extends ViewPager {
2525
private long SCROLL_DELAY = 5 * 1000;
2626
private BannerScroller mBannerScroller;
2727
private List<View> mConvertViews;//界面复用
28+
private static final int START_INDEX = 214748; // 2147483647
2829

2930

3031
private Handler mHandler = new Handler() {
@@ -64,6 +65,7 @@ public void setAdapter(BannerAdapter adapter) {
6465
this.mAdapter = adapter;//对象Adapter设计模式
6566
mConvertViews = new ArrayList<>();
6667
setAdapter(new BannerViewAdapter());
68+
setCurrentItem(START_INDEX);
6769
}
6870

6971
/**

0 commit comments

Comments
 (0)