This commit is contained in:
Thomas 2020-09-24 07:27:41 +02:00
parent ce7b0d4d7d
commit d946451b27
2 changed files with 27 additions and 10 deletions

2
.gitignore vendored
View File

@ -9,3 +9,5 @@
.cxx .cxx
/app/release/ /app/release/
/app/fdroid_full/release/ /app/fdroid_full/release/
/app/google_full/
/app/google_acad/

View File

@ -170,6 +170,7 @@ public class DisplayStatusFragment extends Fragment implements AccountsHorizonta
viewModelSearch.getVideos("0", search_peertube).observe(DisplayStatusFragment.this.requireActivity(), this::manageVIewVideos); viewModelSearch.getVideos("0", search_peertube).observe(DisplayStatusFragment.this.requireActivity(), this::manageVIewVideos);
} }
if (mLayoutManager != null) {
lv_accounts.addOnScrollListener(new RecyclerView.OnScrollListener() { lv_accounts.addOnScrollListener(new RecyclerView.OnScrollListener() {
public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) { public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) {
int firstVisibleItem = mLayoutManager.findFirstVisibleItemPosition(); int firstVisibleItem = mLayoutManager.findFirstVisibleItemPosition();
@ -182,6 +183,20 @@ public class DisplayStatusFragment extends Fragment implements AccountsHorizonta
} }
} }
}); });
} else {
lv_accounts.addOnScrollListener(new RecyclerView.OnScrollListener() {
public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) {
int firstVisibleItem = gLayoutManager.findFirstVisibleItemPosition();
if (dy > 0) {
int visibleItemCount = gLayoutManager.getChildCount();
int totalItemCount = gLayoutManager.getItemCount();
if (firstVisibleItem + visibleItemCount == totalItemCount && context != null) {
viewModelAccounts.getAccounts(max_id_accounts, null, AccountsVM.accountFetch.SUBSCRIPTION).observe(DisplayStatusFragment.this.requireActivity(), apiResponse -> manageViewAccounts(apiResponse));
}
}
}
});
}
if (type != POVERVIEW) { if (type != POVERVIEW) {