Skip to content

Commit

Permalink
增加API 控制indicator是否显示
Browse files Browse the repository at this point in the history
  • Loading branch information
zhouwei committed Jun 2, 2017
1 parent 5cfbc41 commit b5c7549
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public void onPageClick(View view, int position) {
for(int i=0;i<RES.length;i++){
list.add(RES[i]);
}
mMZBanner.setIndicatorVisible(false);
mMZBanner.setPages(list, new MZHolderCreator<BannerViewHolder>() {
@Override
public BannerViewHolder createViewHolder() {
Expand Down
12 changes: 12 additions & 0 deletions mzbanner/src/main/java/com/zhouwei/mzbanner/MZBannerView.java
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,18 @@ public void setBannerPageClickListener(BannerPageClickListener bannerPageClickLi
mBannerPageClickListener = bannerPageClickListener;
}

/**
* 是否显示Indicator
* @param visible true 显示Indicator,否则不显示
*/
public void setIndicatorVisible(boolean visible){
if(visible){
mIndicatorContainer.setVisibility(VISIBLE);
}else{
mIndicatorContainer.setVisibility(GONE);
}
}

/**
* 返回ViewPager
* @return {@link ViewPager}
Expand Down

0 comments on commit b5c7549

Please sign in to comment.