Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recycler view Endless Scroll for pagination, How should I do? #80

Open
J-0-Min opened this issue Aug 17, 2018 · 1 comment
Open

Recycler view Endless Scroll for pagination, How should I do? #80

J-0-Min opened this issue Aug 17, 2018 · 1 comment

Comments

@J-0-Min
Copy link

J-0-Min commented Aug 17, 2018

Help me..

Made from (Asymmetric in Grid form).

however,
It is difficult to add an RecyclerView Endless Scroll Paging function.

I long for help. please.

@AlirezaGoodarzi8002
Copy link

in AsymmetricRecyclerview the layout manager is linearLayoutManager and you must solve pagination problem like this:

if (isLastItem()) {
// your call api and page handling must be here.
}

private fun isLastItem(): Boolean {
val layoutManager = yourRecyclerview.layoutManager as LinearLayoutManager
val pos = layoutManager.findLastCompletelyVisibleItemPosition()
val itemsCount: Int = layoutManager.findLastVisibleItemPosition()
return pos >= itemsCount
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants