Я выполняю нумерацию страниц в recyclerView. Мои данные успешно загружаются, и проблема в том, как мне запросить на сервере следующую страницу. Как я могу выполнить нумерацию страниц и как найти номер прокручиваемой страницы.
Мой код:
rvLatestProduct.addOnScrollListener(new RecyclerView.OnScrollListener() {
@Override
public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
//super.onScrolled(recyclerView, dx, dy);
visibleItemCount = rvLatestProduct.getChildCount();
totalItemCount = linearLayoutManager.getItemCount();
firstVisibleItem = linearLayoutManager.findFirstVisibleItemPosition();
Log.e("totalItemCount",String.valueOf(totalItemCount));
if (loading) {
if (totalItemCount > previousTotal) {
loading = false;
// currentPage += 1;
previousTotal = totalItemCount;
Log.e("previousTotal",String.valueOf(previousTotal));
}
}
if (!loading && (totalItemCount - visibleItemCount)
Подробнее здесь: https://stackoverflow.com/questions/515 ... cyclerview