use of com.github.pedrovgs.sample.viewmodel.TvShowViewModel in project DraggablePanel by pedrovgs.
the class MainModule method provideTvShowCollectionRendererBuilder.
/**
* Provisioning of a RendererBuilder implementation to work with tv shows ListView. More
* information in this library: {@link https://github.com/pedrovgs/Renderers}
*/
@Provides
protected TvShowCollectionRendererBuilder provideTvShowCollectionRendererBuilder(Context context) {
List<Renderer<TvShowViewModel>> prototypes = new LinkedList<Renderer<TvShowViewModel>>();
prototypes.add(new TvShowRenderer(context));
return new TvShowCollectionRendererBuilder(prototypes);
}
use of com.github.pedrovgs.sample.viewmodel.TvShowViewModel in project DraggablePanel by pedrovgs.
the class TvShowRenderer method render.
/**
* Render the TvShowViewModel information.
*/
@Override
protected void render() {
TvShowViewModel tvShow = getContent();
Picasso.with(context).load(tvShow.getPoster()).placeholder(R.drawable.tv_show_placeholder).into(thumbnailImageView);
titleTextView.setText(tvShow.getTitle().toUpperCase());
seasonsCounterTextView.setText(tvShow.getNumberOfSeasons() + " seasons");
}
Aggregations