use of com.karumi.rosie.sample.characters.view.viewmodel.CharacterViewModel in project Rosie by Karumi.
the class CharacterRenderer method render.
@Override
public void render() {
super.render();
CharacterViewModel character = getContent();
nameView.setText(character.getName());
Picasso.with(getRootView().getContext()).load(character.getThumbnailUrl()).fit().centerCrop().into(avatarView);
}
use of com.karumi.rosie.sample.characters.view.viewmodel.CharacterViewModel in project Rosie by Karumi.
the class CharactersFragment method initializeAdapter.
private void initializeAdapter() {
RendererBuilder<CharacterViewModel> rendererBuilder = new CharacterRendererBuilder(presenter);
charactersCollection = new CharactersAdapteeCollection();
charactersAdapter = new RVRendererAdapter<>(rendererBuilder, charactersCollection);
}
use of com.karumi.rosie.sample.characters.view.viewmodel.CharacterViewModel in project Rosie by Karumi.
the class CharacterRenderer method onItemClicked.
@OnClick(R.id.ll_root)
public void onItemClicked() {
CharacterViewModel character = getContent();
presenter.onCharacterClicked(character);
}
use of com.karumi.rosie.sample.characters.view.viewmodel.CharacterViewModel in project Rosie by Karumi.
the class CharacterToCharacterViewModelMapper method mapCharactersToCharacterViewModels.
public List<CharacterViewModel> mapCharactersToCharacterViewModels(PaginatedCollection<Character> characters) {
List<CharacterViewModel> characterViewModels = new LinkedList<>();
for (Character character : characters.getItems()) {
CharacterViewModel characterViewModel = new CharacterViewModel();
characterViewModel.setKey(character.getKey());
characterViewModel.setName(character.getName());
characterViewModel.setThumbnailUrl(character.getThumbnailUrl());
characterViewModels.add(characterViewModel);
}
return characterViewModels;
}
Aggregations