Hello, guys. does anyone use/love `Android Paging ...
# android
q
Hello, guys. does anyone use/love
Android Paging Library
? Personally I think that mostly people wish to get rid of boilerplate code and get simpler solution. And now it looks kinda overhead because you need to write more that just
DiffUtil
+`LoadMorelistener`. Any thoughts about it, does it really worth it?
c
Internally we had a simpeler solution, its simpeler but has less features. Their solution covers more cases but I prefer less code.
q
Could you please tell me what features of this library do you use now?
c
It just emits the next page. We post it on the rx stream. The activity then refreshes the list with an adapter that has a diffutil impl
q
I see. Because now I don't see a really big reason to use it.
w
Same, I implemented it and then migrated away because it was pretty inflexible when it came to things like mapping the resulting list into anything else. To me it’s only worth it for prototyping, when connecting Room directly to the UI, which is not that great of an idea anyway
q
@wasyl Could you please more detailed share what to what you tried to map?
w
I have two sources that merge to one list on the screen. For simplicity: a list comes from the API and I want to modify each element to also have some status from local persistence for example. Some items I want to remove from the list based on this local persistence, too
I think at some point
map
was added to the paged list, but no
flatMap
, so my second requirement was difficult to meet
q
Maybe
MediatorLiveData
could be a solution in your case?
w
Well I use RxJava and I’ve already solved my problem, but with PagingLibrary it was impossible. Since I was given a
PagedList
which didn’t support flatMapping, no matter how I’d want to merge the data, I wasn’t able to modify the list I was given from the paging library
q
Got it, thank you for the feedback.
Also I think that deal with errors more complicated with paging library.
c
If you ask yourself if you really need to use one of the components (that goes for the list of AAC) AND you can write simpeler code. Then I think you know that you don’t need it. All those things are fancy and new, but judge for yourself if they are usefull. Using all the components doesn’t make quality code. I’ve seen a lot of shit code, just cause people refuse to divert from the latest google libs 🤦‍♂️
👍 2