mirror of
https://codeberg.org/gitnex/GitNex.git
synced 2024-12-26 16:04:07 +08:00
Fix load more after using filter (#463)
Fix load more after using filter Reviewed-on: https://gitea.com/gitnex/GitNex/pulls/463 Reviewed-by: opyale <opyale@noreply.gitea.io>
This commit is contained in:
parent
48abe71645
commit
2e89fb0054
@ -120,10 +120,24 @@ public class IssuesFragment extends Fragment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
issuesList.clear();
|
issuesList.clear();
|
||||||
|
|
||||||
adapter = new IssuesAdapter(getContext(), issuesList);
|
adapter = new IssuesAdapter(getContext(), issuesList);
|
||||||
|
adapter.setLoadMoreListener(() -> recyclerView.post(() -> {
|
||||||
|
|
||||||
|
if(issuesList.size() == resultLimit || pageSize == resultLimit) {
|
||||||
|
|
||||||
|
int page = (issuesList.size() + resultLimit) / resultLimit;
|
||||||
|
loadMore(Authorization.returnAuthentication(getContext(), loginUid, instanceToken), repoOwner, repoName, page, resultLimit, requestType, tinyDb.getString("repoIssuesState"));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}));
|
||||||
|
|
||||||
tinyDb.putString("repoIssuesState", issueState);
|
tinyDb.putString("repoIssuesState", issueState);
|
||||||
|
|
||||||
mProgressBar.setVisibility(View.VISIBLE);
|
mProgressBar.setVisibility(View.VISIBLE);
|
||||||
noDataIssues.setVisibility(View.GONE);
|
noDataIssues.setVisibility(View.GONE);
|
||||||
|
|
||||||
loadInitial(Authorization.returnAuthentication(getContext(), loginUid, instanceToken), repoOwner, repoName, resultLimit, requestType, issueState);
|
loadInitial(Authorization.returnAuthentication(getContext(), loginUid, instanceToken), repoOwner, repoName, resultLimit, requestType, issueState);
|
||||||
recyclerView.setAdapter(adapter);
|
recyclerView.setAdapter(adapter);
|
||||||
|
|
||||||
|
@ -122,10 +122,24 @@ public class PullRequestsFragment extends Fragment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
prList.clear();
|
prList.clear();
|
||||||
|
|
||||||
adapter = new PullRequestsAdapter(context, prList);
|
adapter = new PullRequestsAdapter(context, prList);
|
||||||
|
adapter.setLoadMoreListener(() -> recyclerView.post(() -> {
|
||||||
|
|
||||||
|
if(prList.size() == 10 || pageSize == resultLimit) {
|
||||||
|
|
||||||
|
int page = (prList.size() + resultLimit) / resultLimit;
|
||||||
|
loadMore(Authorization.returnAuthentication(getContext(), loginUid, instanceToken), repoOwner, repoName, page, tinyDb.getString("repoPrState"), resultLimit);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}));
|
||||||
|
|
||||||
tinyDb.putString("repoPrState", prState);
|
tinyDb.putString("repoPrState", prState);
|
||||||
|
|
||||||
mProgressBar.setVisibility(View.VISIBLE);
|
mProgressBar.setVisibility(View.VISIBLE);
|
||||||
noData.setVisibility(View.GONE);
|
noData.setVisibility(View.GONE);
|
||||||
|
|
||||||
loadInitial(Authorization.returnAuthentication(context, loginUid, instanceToken), repoOwner, repoName, pageSize, prState, resultLimit);
|
loadInitial(Authorization.returnAuthentication(context, loginUid, instanceToken), repoOwner, repoName, pageSize, prState, resultLimit);
|
||||||
recyclerView.setAdapter(adapter);
|
recyclerView.setAdapter(adapter);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user