cymcsg / UltimateRecyclerView

A RecyclerView(advanced and flexible version of ListView in Android) with refreshing,loading more,animation and many other features.
Apache License 2.0
7.22k stars 1.43k forks source link

Can LoadMore preload the data? #354

Open OVERSKY2003 opened 8 years ago

OVERSKY2003 commented 8 years ago

I finds when itemsCount-1=maxLastVisiblePosition, it calls loadMore() to load more data. I don't know why CustomLoadMoreView don't show and it stuck the scroll view util the more data loading is completed.

Can this to be set? such as itemsCount-5=maxLastVisiblePosition, then it calls loadmore().

image

one suggestion, the new way to enable loadmore is to extend easyRegularAdapter. But easyRegularAdapter is the way which is not like RecyclerView.Adapter. It is hard for us to learn a new way to write the adapter. We also have many existing code writing in the way in old way and we don't want to rewrite the code.

mRecyclerView.reenableLoadmore(); mAdapter.setCustomLoadMoreView(LayoutInflater.from(mActivity).inflate(R.layout.recycle_bottom_progressbar, null)); mRecyclerView.setOnLoadMoreListener(new UltimateRecyclerView.OnLoadMoreListener() { @Override public void loadMore(int itemsCount, final int maxLastVisiblePosition) { loadMoreData(); } });

jjhesk commented 8 years ago

the easyRegularAdapter has been reconfigured to solve most of the problem when it comes to load more dynamics. That takes care of the situation like adding new items and remove the items from the the existing list. This also welcome for new input but it needs to support the other layoutmanagers.