razeware / emitron-Android

Android version of emitron
Apache License 2.0
55 stars 30 forks source link

Library Screen Performance #289

Open orionthewake opened 4 years ago

orionthewake commented 4 years ago

Each time it is brought to the foreground, the Library screen seems to wait for the completion of a network call to the /content endpoint before showing any data, even when courses are present in the local database.

We need to ensure that the Library screen is using a Repository pattern, with the local DB serving as a single-source-of-truth. When the Library screen is opened, we should be kicking off an asynchronous network call to fetch new course data, but concurrently showing course data available in the local DB. When the network call completes, we can refresh the Library list data with any new content available in the local DB. This should all be done with some kind of observable stream, e.g. Rx or Kotlin Flow.