diff --git a/consecutivescroller/src/main/java/com/donkingliang/consecutivescroller/ConsecutiveScrollerLayout.java b/consecutivescroller/src/main/java/com/donkingliang/consecutivescroller/ConsecutiveScrollerLayout.java index 0881fea..e280415 100644 --- a/consecutivescroller/src/main/java/com/donkingliang/consecutivescroller/ConsecutiveScrollerLayout.java +++ b/consecutivescroller/src/main/java/com/donkingliang/consecutivescroller/ConsecutiveScrollerLayout.java @@ -1128,6 +1128,13 @@ private void scrollUp(int offset) { } } + if (mScrollToIndex != -1 && scrollOffset == 0) { + mScrollToIndex = -1; + mSmoothScrollOffset = 0; + mScrollToIndexWithOffset = 0; + setScrollState(SCROLL_STATE_IDLE); + } + } while (scrollOffset > 0 && remainder > 0); int newScrollY = computeVerticalScrollOffset(); @@ -1191,6 +1198,13 @@ private void scrollDown(int offset) { } } + if (mScrollToIndex != -1 && scrollOffset == 0) { + mScrollToIndex = -1; + mSmoothScrollOffset = 0; + mScrollToIndexWithOffset = 0; + setScrollState(SCROLL_STATE_IDLE); + } + } while (scrollOffset < 0 && remainder < 0); int newScrollY = computeVerticalScrollOffset();