Hello everyone, I'm happy to share that I have pub...
# feed
a
Hello everyone, I'm happy to share that I have published my first Compose Multiplatform library: lazy-pagination-compose! A pagination solution built on top of lazy components (currently LazyColumn) and handles pagination states automatically as you scroll. There were 2 things in mind while developing this library: - Should have a simple and intuitive APIs with an easy learning curve. - Can be placed in your Presentation/UI layer ONLY. The library is guarded by UI tests that cover many scenarios too! Check it out on GitHub: https://github.com/Ahmad-Hamwi/lazy-pagination-compose/ Let me know what you think!
👍🏾 1
K 4
👍 3
K 9
h
@ahmadhamwi999 does this library you will maintain in the future?
a
Yes and I'll try my best to do so 🙏
h
@ahmadhamwi999 can customize load image at bottom of the page? secondly, if let say didn't know how much page total, how?
a
you can render your loading image at the bottom using the
newPageProgressIndicator
composable parameter.
As for the page total, the backend that you're dealing with should either tell you if it was the last page, or the total number of pages and you do the math. Otherwise you will be scrolling infinitely.
h
i see infinite. there is no like boolean flag can use? let say for example for calling api for next page if given result error meaning that finish scroll. can do like that?
a
This isn't the typical way to end your pagination but yes you can you can catch such error and append an empty page with the flag
isLastPage = true
but this is a workaround more than being a straight forward solution
h
owh i seee