class CharacterDetailViewModel : ViewModel
View model responsible for preparing and managing the data for CharacterDetailFragment.
See Also
<init> |
View model responsible for preparing and managing the data for CharacterDetailFragment. CharacterDetailViewModel(marvelRepository: MarvelRepository, characterFavoriteRepository: CharacterFavoriteRepository, characterDetailMapper: CharacterDetailMapper) |
characterDetailMapper |
val characterDetailMapper: CharacterDetailMapper |
characterFavoriteRepository |
val characterFavoriteRepository: CharacterFavoriteRepository |
data |
val data: LiveData<CharacterDetail> |
marvelRepository |
val marvelRepository: MarvelRepository |
state |
val state: LiveData<CharacterDetailViewState> |
addCharacterToFavorite |
Store selected character to database favorite list. fun addCharacterToFavorite(): Unit |
dismissCharacterDetail |
Send interaction event for dismiss character detail view. fun dismissCharacterDetail(): Unit |
loadCharacterDetail |
Fetch selected character detail info. fun loadCharacterDetail(characterId: Long): Unit |