Android-PullToRefreshRecyclerView
Android-PullToRefreshRecyclerView copied to clipboard
11楼说的问题!
@Override public void onFinishLoading(boolean hasMoreItems, boolean needSetSelection) {
if (getLayoutManager() == null) {
return;
}
if (!hasMoreItems && mLoadMoreFooter != null) {
//if it's last line, minus the extra height of loadmore
// mCurScroll = mCurScroll - mLoadMoreFooter.getLoadMorePadding(); // @2016/6/23 // 上拉再下拉再上拉,始终没有出现加载更多view的话,会多减一个rootview的高度,暂时先注释,或者是该方法onFinishLoading(true,false)第一个参数始终传值true }
// if items is too short, don't show loadingview
if (getLayoutManager().getItemCount() < mLoadMoreCount) {
hasMoreItems = false;
}
setHasMoreItems(hasMoreItems);
isLoading = false;
if (needSetSelection) {
int first = findFirstVisibleItemPosition();
mRecyclerView.scrollToPosition(--first);
}
}