public boolean isVisBottom(RecyclerView recyclerView) {
LinearLayoutManager layoutManager = (LinearLayoutManager) recyclerView.getLayoutManager();
int lastVisibleItemPosition = layoutManager.findLastVisibleItemPosition();
int visibleItemCount = layoutManager.getChildCount();
int totalItemCount = layoutManager.getItemCount();
int state = recyclerView.getScrollState();
if (visibleItemCount >0 && lastVisibleItemPosition == totalItemCount -1 && state == recyclerView.SCROLL_STATE_IDLE) {
return true;
}else {
return false;
}
}
网友评论