android10 / Android-CleanArchitecture-Kotlin

This is a movies sample app in Kotlin, which is part of a serie of blog posts I have written about architecting android application using different approaches.
https://fernandocejas.com/2018/05/07/architecting-android-reloaded/
4.68k stars 928 forks source link

Please implement Paging library Using latest Jetpack #77

Open viratshukla opened 5 years ago

viratshukla commented 5 years ago

Please implement Paging library Using latest Jetpack

nikhilbansal97 commented 5 years ago

@viratshukla I would like to work on this! ✋

viratshukla commented 5 years ago

@nikhilbansal97 Good, then you can create a PR. Also include Room DB to cache the response. Current Code is not storing json response.

Zhuinden commented 5 years ago

The current "use-case" setup and repository of Singles (uh, I mean "coroutines that return eithers") is not actually suitable for proper offline-first app. You'll run into trouble when you start saving things to disk, because you'll need to observe disk instead of hacking the responses back to your ui per each single.

nikhilbansal97 commented 5 years ago

Hey @viratshukla I am unable to work on this one due the problem stated by @Zhuinden If you'd like to assign this issue to someone else, you can.

nikhilbansal97 commented 5 years ago

@Zhuinden you were right. The current architecture does not seem to be suitable for an offline-first app.

nikhilbansal97 commented 5 years ago

Currently the app is dependent on the network source for the data, but when implementing paging with database, the source of data will become the database which will propagate changes via LiveData and hence, it will break the UseCase class implementation. We could set the data source as the retrofit call, but the API is not paginated.