akai-org / akai-org/Mobile-learning-pokemons
Pokemon List Pagination
- Lingua principale
- Kotlin
- Stelle
- 0
- Fork
- 1
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
As you can see we specify query parameters of every request: offset and limit. and we always use them with values 0 and 20.
With this, we always get only responses with 20 first pokemon from API. However, we'd like to get all of them. We could just get rid of those query parameters but it would me our application call for above 1000 pokemons. It could be a bad performance. What we can do is request another 20 pokemons when user scrolls the list so every time we actually want to see more pokemons - we call the api to fetch them.
If you'd like to learn more about pagination in android here are some useful links:
- https://en.wikipedia.org/wiki/Pagination
- https://developer.android.com/topic/libraries/architecture/paging (an android library)
- https://www.youtube.com/watch?v=D6Eus3f6U9I
- https://www.youtube.com/watch?v=ejSY4WobG58
If you'd like to implement a pagination in our app - good luck and feel free to ask for help or any extra materials.
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Valutazione
Questa issue non è ancora stata valutata.