Android-CleanArchitecture-Kotlin icon indicating copy to clipboard operation
Android-CleanArchitecture-Kotlin copied to clipboard

Please implement Paging library Using latest Jetpack

Open viratshukla opened this issue 6 years ago • 6 comments

Please implement Paging library Using latest Jetpack

viratshukla avatar Mar 01 '19 12:03 viratshukla

@viratshukla I would like to work on this! ✋

nikhilbansal97 avatar Mar 29 '19 06:03 nikhilbansal97

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

viratshukla avatar Mar 29 '19 14:03 viratshukla

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.

Zhuinden avatar Mar 29 '19 15:03 Zhuinden

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 avatar Apr 03 '19 18:04 nikhilbansal97

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

nikhilbansal97 avatar Apr 03 '19 18:04 nikhilbansal97

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.

nikhilbansal97 avatar Apr 04 '19 16:04 nikhilbansal97