Open tosslife opened 9 years ago
@Override public void onScrolled(RecyclerView recyclerView, int dx, int dy) { super.onScrolled(recyclerView, dx, dy); LinearLayoutManager layoutManager = (LinearLayoutManager) recyclerView.getLayoutManager(); visibleItemCount = recyclerView.getChildCount(); totalItemCount = recyclerView.getLayoutManager().getItemCount(); firstVisibleItem = layoutManager.findFirstVisibleItemPosition(); if (loading) { if (totalItemCount > previousTotal) { previousTotal = totalItemCount; loading = false; } } if (!loading && (totalItemCount - visibleItemCount) <= (firstVisibleItem + visibleThreshold)) { loadMoreCallBack.onLoadMore(); loading = true; } }
@tosslife 不懂你意思,再者你这部分代码跟 adapter 没多大关系吧?