use of com.karumi.rosie.sample.comics.view.viewmodel.ComicSeriesViewModel in project Rosie by Karumi.
the class ComicSeriesFragment method initializeAdapter.
private void initializeAdapter() {
RendererBuilder<ComicSeriesViewModel> rendererBuilder = new ComicSeriesRendererBuilder(presenter);
comicsCollection = new ComicsSeriesAdapteeCollection();
comicSeriesAdapter = new RVRendererAdapter<>(rendererBuilder, comicsCollection);
}
use of com.karumi.rosie.sample.comics.view.viewmodel.ComicSeriesViewModel in project Rosie by Karumi.
the class ComicSeriesRenderer method render.
@Override
public void render() {
super.render();
ComicSeriesViewModel comicSeries = getContent();
nameView.setText(comicSeries.getTitle());
}
use of com.karumi.rosie.sample.comics.view.viewmodel.ComicSeriesViewModel in project Rosie by Karumi.
the class ComicSeriesRenderer method onItemClicked.
@OnClick(R.id.ll_root)
public void onItemClicked() {
ComicSeriesViewModel comicSeries = getContent();
presenter.onComicSeriesClicked(comicSeries);
}
use of com.karumi.rosie.sample.comics.view.viewmodel.ComicSeriesViewModel in project Rosie by Karumi.
the class ComicSeriesToComicSeriesViewModelMapper method mapComicSeriesToComicSeriesViewModels.
public List<ComicSeriesViewModel> mapComicSeriesToComicSeriesViewModels(PaginatedCollection<ComicSeries> comics) {
List<ComicSeriesViewModel> comicSeriesViewModels = new LinkedList<>();
for (ComicSeries comicSeries : comics.getItems()) {
ComicSeriesViewModel comicSeriesViewModel = new ComicSeriesViewModel();
comicSeriesViewModel.setKey(comicSeries.getKey());
String titleFormatted = String.format("%1$s (%2$s)", comicSeries.getName(), comicSeries.getReleaseYear());
comicSeriesViewModel.setTitle(titleFormatted);
comicSeriesViewModel.setCoverUrl(comicSeries.getCoverUrl());
comicSeriesViewModels.add(comicSeriesViewModel);
}
return comicSeriesViewModels;
}
Aggregations