My way to MVVM using KotlinX Coroutines and Android data-binding
Remove rx-java dependency and replace it with KotlinX-Coroutines
This release tackle some update migrations like moving from kotlintest to kotest and arrow Option deprecations.
Apart from that, just minor changes in order to be up to date with other libraries.
Key layers have been unit tested using multiple tecniques
Simplify ViewModel in order to only have one LiveData<Input> (aka query property) and one LiveData<Output> (aka state property).
Move handling state logic to subscriber layer, aka the UI, simplify binding with only one state_change
binding per required view
This change tries to simplify the testing effort
Migrate support library to AndroidX, this introduces breaking changes but not add nothing so only increase minor version.
Also, update other libs and tools to their last stable version.
Create a new property on QueryViewModel error to describe an error on UI Create a new QueryViewState error to model the state To not duplicate code on data sources, errors are handled on ComicRepository Model error using Either<ComicError, List<T>> Empty results on ComicLocalDataSource produce EmptyResultsError Any network error produce NetworkError Suggestions will display error as a single suggestion A search will display error as text on the screen, hiding result list Error suggestions do not propagate search results
create ComicLocalDataSource & ComicRemoteDataSource polymorphic on T refactor ComicRepository to use ComicLocalDataSource & ComicRemoteDataSource and polymorphic on T create specific datasources & repository for Suggestion create specific datasources & repository for Search
reorganise packages to reflect data common feature.
create QueryViewModel as base ViewModel class for suggestion and search. create QueryViewState to handle QueryViewModel states. SuggestionViewModel, only defines how to go from Flowable<String> to Flowable<List<String>> SuggestionViewModel, only defines how to go from Flowable<String> to Flowable<List<Volume>>
reorganise packages to reflect query common feature.
Keep into a ViewState all possible state of a ViewModel.
Fix LiveData nullability on BindingAdapters