From 1e55626531c1c020e84c5668a418110e561c5b0a Mon Sep 17 00:00:00 2001 From: BoldFruit <49558310+BoldFruit@users.noreply.github.com> Date: Fri, 21 Feb 2020 17:48:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=80=E4=B8=AA=E5=B0=8Fbu?= =?UTF-8?q?g?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复当banner从第一个item直接移动到最后一个item后,再次自动切换时,直接跳到第二个item. --- banner/src/main/java/com/youth/banner/Banner.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/banner/src/main/java/com/youth/banner/Banner.java b/banner/src/main/java/com/youth/banner/Banner.java index 16fac48..17b937e 100644 --- a/banner/src/main/java/com/youth/banner/Banner.java +++ b/banner/src/main/java/com/youth/banner/Banner.java @@ -245,7 +245,7 @@ public void run() { int count = banner.getItemCount(); if (count <= 1) return; int next = banner.getCurrentItem() % (count - 1) + 1; - if (next == 1) { + if (banner.getCurrentItem() == count - 1) { banner.setCurrentItem(next, false); banner.post(banner.mLoopTask); } else {