This is an Android App demo which is going to apply all sorts of state-of-the-art technologies, including those are still in Alpha & Beta tests.
- Android Jetpack: Compose
- Jetpack Compose dynamic theming
- Android Jetpack: Navigation
- Android Jetpack: Navigation Animation
- Android Jetpack Compose accompanist: Material placeholder
- Android Jetpack: Room
- Hilt
- OkHttp + Retrofit
- Kotlin Coroutines
- View
- View Model
- Data(Repository/Data Source)
In this project, I am experimenting a new way which separating data flows and control flows.
In data layer, repository creates a kotlin channels, all control flows are sent via this channel. Events include load success, error, data is update to date, or data is old etc.
All other data sources flow to Room database. Room acts as the single source of truth.
Any changes made to Room database would trigger a Kotlin flows emission to ViewModel and then to ui layer.
This project choose not using resource wrapper, and instead, it uses NULL to tell ui the data is not ready.
Benefits are:
-
Easily organised single source of truth hierarchy.
-
It decouple control flows from data. Therefore, technically any type of control signals could be sent freely. A wide range of status can be conveyed not only limited to loading, success, error etc. For those information not that important, we could auto-dismiss them with a delay.
-
The ui looks really reactive and smooth!
Downsides:
-
It doesn't looks very structured. Further it creates some confusions inevitably.
-
Since control flows are independent, you may need extra effort for align what is going on especially when data is not available.
This structure is still under experiments and I will update my thoughts continuously.
Please leave your comments thoughts in the issues tab.
Thanks for following the project!
Team picker:
GSW theme:
Lakers theme:
Nets theme:
backend project repository: hongwei-bai/application-service-sports
Authentication service(backend) repository: hongwei-bai/application-service-authentication