ECN>> red>> 返回
项目作者: torrentcome

项目描述 :
MVVM, Coroutine, RoomDB, Koin
高级语言: Kotlin
项目地址: git://github.com/torrentcome/red.git
创建时间: 2017-01-09T21:02:43Z
项目社区:https://github.com/torrentcome/red

开源协议:

下载


MyRed

A sample android app that shows how to use MVVM with Coroutine & Room database with the Koin dependencies injection, in Kotlin by “Clean Architecture”.

Gradle is convert to Kotlin, every build.gradle are build.gradle.kts

The Goal is to get all the Audios from the device’s Provider and show it up.

Implemented by

The structure of this project with 3 layers:

  • ui
  • domain
  • data

Communication between layers

  1. UI calls method from ViewModel.
  2. ViewModel executes internal logic.
  3. Internal logic receive/save/give data from/with Repo.
  4. The Repo is tied with the data (Room database here).
  5. Information flows back to the UI by LiveData.

Dependencies (in Kotlin, find it on /buildSrc)

  1. // kotlin
  2. implementation(Libs.Kotlin.stdlib)
  3. implementation(Libs.Kotlinx.coroutineCore)
  4. implementation(Libs.Kotlinx.coroutineAndroid)
  5. // androidx
  6. implementation(Libs.AndroidX.coreKtx)
  7. implementation(Libs.AndroidX.appCompat)
  8. implementation(Libs.AndroidX.constraintLayout)
  9. implementation(Libs.AndroidX.media)
  10. // google
  11. implementation(Libs.Google.material)
  12. // koin
  13. implementation(Libs.Koin.core)
  14. implementation(Libs.Koin.android)
  15. implementation(Libs.Koin.viewmodel)
  16. implementation(Libs.Koin.architecture)
  17. // room
  18. implementation(Libs.Room.ktx)
  19. implementation(Libs.Room.runtime)
  20. kapt(Libs.Room.compiler)
  21. // test
  22. implementation(Libs.Test.junit)
  23. implementation(Libs.Test.testng)