NoPaginate icon indicating copy to clipboard operation
NoPaginate copied to clipboard

forget to calculate loadmore item count

Open HelloVass opened this issue 6 years ago • 3 comments

when I add code in your MianActivitylike :

 @Override
    protected void onPostCreate(@Nullable Bundle savedInstanceState) {
        super.onPostCreate(savedInstanceState);

        new Handler().postDelayed(() -> mainActivityPresenter.addItems(), 500);
    }

notice,it‘s a async action,now recyclerview only have one child(loadmore item), so it will cause load more twice,becase your code didn't calculcate loadmore item count(1)

HelloVass avatar Jul 08 '18 06:07 HelloVass

Hi @HelloVass thank you for this issue and sorry for late answer.

Yes, I have made a mistake in sample. Will fix it, thank you. For this situation, it is very important to don't forget call a method showLoading(true); It's block method onLoadMore();, until you call showLoading(false);

NoNews avatar Aug 02 '18 18:08 NoNews

@NoNews thanks for your response,I have refacrored your NoPaginate with kotlin.I hope you don't mind.If you are interested, here is the link.I use it for my project,and it solved my problem,thanks again.

HelloVass avatar Aug 05 '18 03:08 HelloVass

@HelloVass Sure, I don't mind. I also thinking about Kotlin, your repo will be very useful, thank you!

NoNews avatar Aug 05 '18 10:08 NoNews