Merge pull request #5891 from ByteHamster/fix-load-next-page
Fix 'load more' not detecting next page
This commit is contained in:
commit
e63c8f8125
|
@ -163,8 +163,11 @@ public class FeedItemlistFragment extends Fragment implements AdapterView.OnItem
|
|||
public void onScrolled(@NonNull RecyclerView view, int deltaX, int deltaY) {
|
||||
super.onScrolled(view, deltaX, deltaY);
|
||||
boolean hasMorePages = feed != null && feed.isPaged() && feed.getNextPageLink() != null;
|
||||
nextPageLoader.getRoot().setVisibility(
|
||||
(viewBinding.recyclerView.isScrolledToBottom() && hasMorePages) ? View.VISIBLE : View.GONE);
|
||||
boolean pageLoaderVisible = viewBinding.recyclerView.isScrolledToBottom() && hasMorePages;
|
||||
nextPageLoader.getRoot().setVisibility(pageLoaderVisible ? View.VISIBLE : View.GONE);
|
||||
viewBinding.recyclerView.setPadding(
|
||||
viewBinding.recyclerView.getPaddingLeft(), 0, viewBinding.recyclerView.getPaddingRight(),
|
||||
pageLoaderVisible ? nextPageLoader.getRoot().getMeasuredHeight() : 0);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -271,7 +271,7 @@ public class DownloadRequest implements Parcelable {
|
|||
private boolean deleteOnFailure = false;
|
||||
private final long feedfileId;
|
||||
private final int feedfileType;
|
||||
private Bundle arguments = new Bundle();
|
||||
private final Bundle arguments = new Bundle();
|
||||
private boolean initiatedByUser = true;
|
||||
|
||||
public Builder(@NonNull String destination, @NonNull FeedMedia media) {
|
||||
|
@ -288,6 +288,7 @@ public class DownloadRequest implements Parcelable {
|
|||
this.title = feed.getHumanReadableIdentifier();
|
||||
this.feedfileId = feed.getId();
|
||||
this.feedfileType = feed.getTypeAsInt();
|
||||
arguments.putInt(REQUEST_ARG_PAGE_NR, feed.getPageNr());
|
||||
}
|
||||
|
||||
public Builder withInitiatedByUser(boolean initiatedByUser) {
|
||||
|
|
Loading…
Reference in New Issue