Skip to content

Commit

Permalink
Fix a bug
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangpan-alo7 committed Nov 6, 2019
1 parent 5b85015 commit 0186b3a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ private void setupBanner() {
mBannerViewPager
.setPageMargin(DpUtils.dp2px(20))
.setRevealWidth(DpUtils.dp2px(20))
.setPageStyle(PageStyle.MULTI_PAGE)
.setHolderCreator(() -> new ImageResourceViewHolder(DpUtils.dp2px(5)))
.setIndicatorColor(Color.parseColor("#935656"), Color.parseColor("#FF4C39"))
.setPageStyle(PageStyle.MULTI_PAGE)
.setOnPageClickListener(position -> ToastUtils.show("position:" + position))
.create(mDrawableList);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ private void setupViewPager() {
}
}

private void initPageStyle(){
private void initPageStyle() {
switch (mPageStyle) {
case PageStyle.MULTI_PAGE:
setMultiPageStyle();
Expand Down Expand Up @@ -717,6 +717,8 @@ public BannerViewPager<T, VH> setPageStyle(@APageStyle int pageStyle) {
}

private void setMultiPageStyle() {
mPageMargin=mPageMargin==0?DpUtils.dp2px(20):mPageMargin;
mRevealWidth=mRevealWidth==0?DpUtils.dp2px(20):mRevealWidth;
setClipChildren(false);
RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) mViewPager.getLayoutParams();
params.leftMargin = mPageMargin + mRevealWidth;
Expand Down

0 comments on commit 0186b3a

Please sign in to comment.