felipecsl / AsymmetricGridView

Android ListView that mimics a GridView with asymmetric items. Supports items with row span and column span
http://felipecsl.com/AsymmetricGridView
MIT License
1.84k stars 431 forks source link

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

Open J-0-Min opened 6 years ago

J-0-Min commented 6 years ago

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 commented 3 years ago

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 }