Skip to content

Commit 8b9348b

Browse files
author
teach
committed
代码优化
1 parent f76530a commit 8b9348b

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

consecutivescroller/src/main/java/com/donkingliang/consecutivescroller/ConsecutiveScrollerLayout.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1379,10 +1379,12 @@ private void recycleAdjustVelocityTracker() {
13791379
* 停止滑动
13801380
*/
13811381
public void stopScroll() {
1382-
mScroller.abortAnimation();
1383-
stopNestedScroll(ViewCompat.TYPE_NON_TOUCH);
1384-
if (mScrollToIndex == -1) {
1385-
setScrollState(SCROLL_STATE_IDLE);
1382+
if (!mScroller.isFinished()) {
1383+
mScroller.abortAnimation();
1384+
stopNestedScroll(ViewCompat.TYPE_NON_TOUCH);
1385+
if (mScrollToIndex == -1) {
1386+
setScrollState(SCROLL_STATE_IDLE);
1387+
}
13861388
}
13871389
}
13881390

0 commit comments

Comments
 (0)