This is a sample project which demonstrates how to create infinite lists ππ with Paging 3 library in Jetpack Compose using modern Android Architecture Components(Kotlin, MVVM, Flow, Jetpack Compose, Paging 3 Library, Android Jetpack).
This sample application loads a list of movies from the Tmdb Api.
It loads the data from the internet with Retofit
library as a Movie
object, then the Paging
3 library converts the fetched data into Flow<PagingData<Movie>>
and updates the flow with new data when the end of the page is reached. The application then collects the flow of data then displays it into a list.
The sample application uses the Tmdb Api to load the list of movies. To successfully build the application you need to create a api key.
Then you need to add the api key in local.properties
file in your project root folder as shown below:
TMDB_API_KEY = "your-api-key"
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
MIT License
Copyright (c) 2020 Vivek Singh
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.