From 9715b6d99d89ea44ab814a997bf2ae32b917c3f5 Mon Sep 17 00:00:00 2001 From: fafuyuxing <644978225@qq.com> Date: Fri, 17 May 2019 15:35:44 +0800 Subject: [PATCH] Update ConvenientBanner.java MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1.增加判断如果只有一个图片的话就不显示底部指示器和不进行轮播图片 --- .../bigkoo/convenientbanner/ConvenientBanner.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/convenientbanner/src/main/java/com/bigkoo/convenientbanner/ConvenientBanner.java b/convenientbanner/src/main/java/com/bigkoo/convenientbanner/ConvenientBanner.java index 1284533..9f09ba5 100755 --- a/convenientbanner/src/main/java/com/bigkoo/convenientbanner/ConvenientBanner.java +++ b/convenientbanner/src/main/java/com/bigkoo/convenientbanner/ConvenientBanner.java @@ -143,6 +143,13 @@ public ConvenientBanner setPageIndicator(int[] page_indicatorId) { mPointViews.clear(); this.page_indicatorId = page_indicatorId; if (mDatas == null) return this; + + //modify by yuxing begin 只有一张图片的话就不设置指示器 + if(mDatas!=null&&mDatas.size()==1){ + return this; + } + //modify by yuxing end + for (int count = 0; count < mDatas.size(); count++) { // 翻页指示的点 ImageView pointView = new ImageView(getContext()); @@ -250,6 +257,13 @@ public boolean isTurning() { * @return */ public ConvenientBanner startTurning(long autoTurningTime) { + + //modify by yuxing begin 只有一张图片的话就不滚动翻页 + if(mDatas!=null&&mDatas.size()==1){ + return this; + } + //modify by yuxing end + if (autoTurningTime < 0) return this; //如果是正在翻页的话先停掉 if (turning) {