[WORK-IN-PROGRESS]
- Less boilerplate code
- Easy to read
- Testable (Unit and Instrumantation)
- Modularized by layer (Feature modules coming soon)
- JetPack ViewModel/LiveData
- Coroutines
- Koin
- DataBinding
- Unit Tests
- Instrumentation Tests
- Jacoco test coverage
MainViewModel.kt
fun fetchItems() {
callService({ repo.getAlbums() }, {
albumsLive.postValue(it)
})
}
MainRepositoryImpl.kt
override suspend fun getAlbums() = apiWrapper { api.getAlbums() }}
fun fetchItems() {
callService({ repo.getAlbums() },
success = {
albumsLive.postValue(it)
},
failure = {
if (it is AError.Authorization) {
// clear token
} else {
postError(it)
}
}
)
}
- All business logic is kept in ViewModels. Trying to keep ViewModel coverages near 100%.
- All network cases also tested with ApiWrapperTest
- Ui bound cases and view classes are tested with Espresso.
- At least 2 screens with more interaction
- Navigation
- Feature modules
- Easy and readeble Espresso tests with Robot pattern
- Github actions