项目作者: sheraz-nadeem
项目描述 :
Android app based on Architecture components(LiveData, PagedList, Room), Dagger 2, Retrofit 2, Kotlin & Kotlin Coroutines
高级语言: Kotlin
项目地址: git://github.com/sheraz-nadeem/ListGitHubRepos.git
List GitHub Repos using Paging Library
This application is created to show how paging library can be used to load infinite lists
and used in conjunction with Network fetch & Room Database.
Tech Stack Used
- Android Architecture Components (Room Database, LiveData, Paging Library(PagedList, PagedListAdapter)).
- Application Architecture is MVVM.
- Networking using Retrofit 2.
- Used Kotlin.
- Used Kotlin Coroutines for Async Operations.
- Used Retrofit 2 Adapter for Kotlin Coroutine’s Deferred type.
- Whole project is based on AndroidX.
- Used Dagger 2 for Dependency Injection.
- Picasso for Image handling.
Steps
- Request the GitHub API to show public repositories and parse the JSON
response. - Display a list of repositories, each entry shows
- full repo name
- description
- login of the owner
- forked or not
- repo owner’s avatar image
- Requesting 15 repos at a time over the netwokr. Using an endless list with a load more mechanism. The
load more is triggered when the scrolling is 5-items near to reaching the end of the
list. - Cache the repos in room database storage.
- Show a light green background if the
fork
flag is false or missing, a white one
otherwise. - On a long click on a list item showing a bottom sheet to ask user if go to repository
html_url
or
owner html_url
which is then opened in the browser.
TODOs
- Implement a mechanism to download and store the repos on a regular interval also if the app is closed.