luizgrp / SectionedRecyclerViewAdapter

An Adapter that allows a RecyclerView to be split into Sections with headers and/or footers. Each Section can have its state controlled individually.
MIT License
1.68k stars 372 forks source link

Is it possible to support Paging concept introduced in recent year? #176

Closed yccheok closed 3 years ago

yccheok commented 5 years ago

I really like the addSection concept provided by this library.

In recent year, Google introduced Paging concept. Instead of having to load entire data from database into memory, then present it in RecyclerView. User can now choose to only load a very small subset of data, during RecyclerView scrolling.

Google achieves so by introducing

The key concept, is to call submitList in PagedListAdapter, whenever the new subset of data is available, during scrolling.

A nice introduction video during Google I/O 2018 is available - https://www.youtube.com/watch?v=BE5bsyGGLf4

Currently, I cannot see a direct way, how we can fit such submitList paging concept, into SectionedRecyclerViewAdapter.

I was wondering, do you have any idea how we can achieve Section concept, yet able to provide paging capability?

Thank you.

yccheok commented 5 years ago

After reading https://medium.com/@chibatching/how-to-connect-paging-library-with-groupie-f8b4102d59b0 and look at her example project (She is using a class called Group, which I believe is analogue to Section)

https://github.com/chibatching/paging-retrofit-sample/blob/master/app/src/main/java/com/chibatching/pagedlistgroup/PagedListGroup.java

I believe we can achieve similar effect, by having PagedListSection

I was wondering, whether you are interested to incorporate paging capability into your library? If yes, I'm more than happy, to spend some time to R&D, and provide proper implementation for such capability.

(Note, this may introduce androidx.paging dependency into your library)

Thank you!

luizgrp commented 5 years ago

Hey @yccheok , happy to have this introduced in the library, but please do any R&D on top of branch 3.0.0 as I'm planning to have a new release soon.

yccheok commented 5 years ago

Thank you @luizgrp I will kick start the R&D when time permits.

ahmadmssm commented 4 years ago

@luizgrp Any thing new regarding this feature/request ?

yccheok commented 4 years ago

Sorry. I haven't look into this. This month and next month, I will kick start a new project which requires me to employ paging concept. Hopefully I can learn something new, and provide some useful input to this ticket.

ahmadmssm commented 4 years ago

@yccheok Thanks for your reply, I tired to implement it but no luck until now, I also need it in a project too.