use of com.karumi.rosie.domain.usecase.annotation.Success in project Rosie by Karumi.
the class CharacterDetailsPresenter method loadCharacterDetails.
private void loadCharacterDetails() {
getView().hideCharacterDetail();
createUseCaseCall(getCharacterDetails).args(characterKey).onSuccess(new OnSuccessCallback() {
@Success
public void onCharacterDetailsLoaded(Character character) {
hideLoading();
CharacterDetailViewModel characterDetailViewModel = mapper.mapCharacterToCharacterDetailViewModel(character);
getView().showCharacterDetail(characterDetailViewModel);
}
}).onError(new OnErrorCallback() {
@Override
public boolean onError(Error error) {
getView().hideLoading();
return false;
}
}).execute();
}
Aggregations