Skip to content

Commit

Permalink
优化
Browse files Browse the repository at this point in the history
  • Loading branch information
teach committed Jul 15, 2021
1 parent f820723 commit 7cb24e1
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 7cb24e1

Please sign in to comment.