shlogg · Early preview
Kiolk @kiolk

Designing A Pure Kotlin Pagination Class For Android Apps

I designed a simple Pagination class in Kotlin to handle pagination logic, making it easier to integrate into my project. The class is generic and can be used on other screens.

I really enjoy it when I can design a class that should keep logic. It feels like pure engineering. You can't do this perfectly from the first time; you have to iterate, step by step.
What I did:
I worked on the implementation of the pagination for articles. In the Android world, Google provides the Pagination Library to solve this kind of task. Every time I tried to integrate it, I had a lot of trouble. It's always a pain. So, for this project, I decided to make it simpler. 
The idea of pagination is very simple: you have a data source, and at some point, you need to load a new portion of dat...