From c2bc05dee408c23222049057ba465a8b1fa1df6c Mon Sep 17 00:00:00 2001 From: teach Date: Sun, 26 Apr 2020 11:36:27 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=87=AA=E5=8A=A8=E6=BB=91?= =?UTF-8?q?=E5=8A=A8=E7=9A=84=E8=BE=B9=E7=95=8C=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../consecutivescroller/ConsecutiveScrollerLayout.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/consecutivescroller/src/main/java/com/donkingliang/consecutivescroller/ConsecutiveScrollerLayout.java b/consecutivescroller/src/main/java/com/donkingliang/consecutivescroller/ConsecutiveScrollerLayout.java index 4bde464..2a00922 100644 --- a/consecutivescroller/src/main/java/com/donkingliang/consecutivescroller/ConsecutiveScrollerLayout.java +++ b/consecutivescroller/src/main/java/com/donkingliang/consecutivescroller/ConsecutiveScrollerLayout.java @@ -618,7 +618,7 @@ private void scrollUp(int offset) { // 如果是要滑动到指定的View,判断滑动到目标位置,就停止滑动 if (mScrollToIndex != -1) { View view = getChildAt(mScrollToIndex); - if (getScrollY() + getPaddingTop() >= view.getTop()) { + if (getScrollY() + getPaddingTop() >= view.getTop() || isScrollBottom()) { mScrollToIndex = -1; mSmoothScrollOffset = 0; break; @@ -669,8 +669,8 @@ private void scrollDown(int offset) { // 如果是要滑动到指定的View,判断滑动到目标位置,就停止滑动 if (mScrollToIndex != -1) { View view = getChildAt(mScrollToIndex); - if (getScrollY() + getPaddingTop() <= view.getTop() - && ScrollUtils.getScrollTopOffset(view) >= 0) { + if ((getScrollY() + getPaddingTop() <= view.getTop() + && ScrollUtils.getScrollTopOffset(view) >= 0) || isScrollTop()) { mScrollToIndex = -1; mSmoothScrollOffset = 0; break;