lisawray / groupie

Groupie helps you display and manage complex RecyclerView layouts.
MIT License
3.67k stars 293 forks source link

Feature Request: Android Paging Library support #282

Open utwyko opened 5 years ago

utwyko commented 5 years ago

Is your feature request related to a problem? Please describe The Android Paging library is becoming the standard way to handle paging on Android. As far as I know, it currently does not work with Groupie yet. It would be great to add support for the library to Groupie.

@chibatching has written an article on how to connect the Paging library with Groupie. This is a great start, I'm not sure it's the ideal solution:

Describe the solution you'd like First-class support for the paging library in the main groupie library or perhaps an additional module.

Option 1

Add a update(p pagedList<T>, t TransformFunction) function to GroupAdapter.

This function takes a PagedList of any raw data, and a transform function that maps the data to groupie items.

Option 2

Add a update(p PagedList<T: Item>) function to GroupAdapter.

This still requires that the PagedList is mapped to groupie items by the consumer first.

Additional context If this is something you would consider adding to the library, I'd be happy to give it a shot and see if I can come up with a PR.

ValCanBuild commented 5 years ago

Hi, @utwyko I agree that Groupie needs to have some support for Pagination. I'd be happy to take PRs for this. It sounds like a problem that would require a few iterations to get right.

khatv911 commented 5 years ago

maybe we can take a look on how Epoxy is handling Paging now.

koji-1009 commented 5 years ago

Hi! I tried to write PagedGroupAdapter. If it looks good, create a PR and make some corrections!

https://github.com/koji-1009/paging-retrofit-sample/blob/feature/paged_group_adapter/app/src/main/java/com/dr1009/app/PagedGroupAdapter.java

NitroG42 commented 4 years ago

Does anybody could make Groupie works with Paging 3.0?

Zhuinden commented 3 years ago

Technically, Groupie should only provide first-party support for Paging 3 if it becomes stable, and not alpha.

TylerMcCraw commented 3 years ago

Paging 3 is api stable now. They have reached beta as of ~February 10. Could we start looking into this now? https://developer.android.com/jetpack/androidx/releases/paging#3.0.0-beta01

SergeyMilevskiy commented 3 years ago

It's ready for production, it would be nice to have with groupie. https://developer.android.com/jetpack/androidx/releases/paging#version_300_5

HashirLabs commented 2 years ago

Any update by anyone on this please to support paging 3? If anyone has any fork for this, please message here

MuhammedBekir commented 1 week ago

hey guys Is there any progress or plans to work on this? I'm currently building a project that HEAVILY relies on Groupie, and Android Paging Library support would be incredibly helpful.