hongwei-bai / android-nba-assist

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Hami-sports-assistant.android

CircleCI Unit Tests Instrumented Tests UI Tests GitHub repo size GitHub last commit GitHub commit activity GitHub Repo stars GitHub forks YouTube Video Views

Get it on Google Play

GitHub top language Coroutines Jetpack Compose Dynamic Theming Navigation Navigation Animation Compose Accompanist Accompanist Placeholder Room Hilt OkHttp Retrofit MVVM Design Patterns SOLID

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.

Interest points in terms of Modern Android Development(MAD) skills:

  • 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

The architecture of the App would use MVVM, with layers:

  • View
  • View Model
  • Data(Repository/Data Source)

How data flows to ui?

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:

  1. Easily organised single source of truth hierarchy.

  2. 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.

  3. The ui looks really reactive and smooth!

Downsides:

  1. It doesn't looks very structured. Further it creates some confusions inevitably.

  2. 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!

Screenshots:

Team picker:

GSW theme:

Lakers theme:

Nets theme:

Related projects

backend project repository: hongwei-bai/application-service-sports

Authentication service(backend) repository: hongwei-bai/application-service-authentication

About

License:Apache License 2.0


Languages

Language:Kotlin 100.0%