Skip to content
This repository has been archived by the owner on Aug 26, 2019. It is now read-only.

Commit

Permalink
Use mEndPage to restrict mPages instead of mPages itself
Browse files Browse the repository at this point in the history
  • Loading branch information
seven332 committed Mar 22, 2019
1 parent da9940d commit a739300
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/src/main/java/com/hippo/widget/ContentLayout.java
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ public void onGetPageData(int taskId, int pages, int nextPage, List<E> data) {
}
mPageDivider.add(0, dataSize);
mStartPage--;
mPages = Math.max(mPages, pages);
mPages = Math.max(mEndPage, pages);
// assert mStartPage >= 0

if (data.isEmpty()) {
Expand Down Expand Up @@ -586,7 +586,7 @@ public void onGetPageData(int taskId, int pages, int nextPage, List<E> data) {
mPageDivider.add(oldDataSize + dataSize);
mEndPage++;
mNextPage = nextPage;
mPages = Math.max(mPages, pages);
mPages = Math.max(mEndPage, pages);

if (data.isEmpty()) {
if (true || mEndPage >= mPages) { // OK, that's all
Expand Down Expand Up @@ -700,7 +700,7 @@ public void onGetPageData(int taskId, int pages, int nextPage, List<E> data) {
mNextPage = nextPage;
}

mPages = Math.max(mPages, pages);
mPages = Math.max(mEndPage, pages);

int oldIndexStart = mCurrentTaskPage == mStartPage ? 0 : mPageDivider.get(mCurrentTaskPage - mStartPage - 1);
int oldIndexEnd = mPageDivider.get(mCurrentTaskPage - mStartPage);
Expand Down

0 comments on commit a739300

Please sign in to comment.