diff --git a/app/src/main/java/org/mian/gitnex/fragments/IssuesFragment.java b/app/src/main/java/org/mian/gitnex/fragments/IssuesFragment.java index 091408b2..f2615a16 100644 --- a/app/src/main/java/org/mian/gitnex/fragments/IssuesFragment.java +++ b/app/src/main/java/org/mian/gitnex/fragments/IssuesFragment.java @@ -120,10 +120,24 @@ public class IssuesFragment extends Fragment { } issuesList.clear(); + 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); + mProgressBar.setVisibility(View.VISIBLE); noDataIssues.setVisibility(View.GONE); + loadInitial(Authorization.returnAuthentication(getContext(), loginUid, instanceToken), repoOwner, repoName, resultLimit, requestType, issueState); recyclerView.setAdapter(adapter); diff --git a/app/src/main/java/org/mian/gitnex/fragments/PullRequestsFragment.java b/app/src/main/java/org/mian/gitnex/fragments/PullRequestsFragment.java index ab50d096..e94560ad 100644 --- a/app/src/main/java/org/mian/gitnex/fragments/PullRequestsFragment.java +++ b/app/src/main/java/org/mian/gitnex/fragments/PullRequestsFragment.java @@ -122,10 +122,24 @@ public class PullRequestsFragment extends Fragment { } prList.clear(); + 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); + mProgressBar.setVisibility(View.VISIBLE); noData.setVisibility(View.GONE); + loadInitial(Authorization.returnAuthentication(context, loginUid, instanceToken), repoOwner, repoName, pageSize, prState, resultLimit); recyclerView.setAdapter(adapter);