Search in sources :

Example 1 with TvShowViewModel

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);
}
Also used : PlaceRenderer(com.github.pedrovgs.sample.renderer.PlaceRenderer) Renderer(com.pedrogomez.renderers.Renderer) TvShowRenderer(com.github.pedrovgs.sample.renderer.TvShowRenderer) TvShowViewModel(com.github.pedrovgs.sample.viewmodel.TvShowViewModel) TvShowCollectionRendererBuilder(com.github.pedrovgs.sample.renderer.rendererbuilder.TvShowCollectionRendererBuilder) TvShowRenderer(com.github.pedrovgs.sample.renderer.TvShowRenderer) LinkedList(java.util.LinkedList) Provides(dagger.Provides)

Example 2 with TvShowViewModel

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");
}
Also used : TvShowViewModel(com.github.pedrovgs.sample.viewmodel.TvShowViewModel)

Aggregations

TvShowViewModel (com.github.pedrovgs.sample.viewmodel.TvShowViewModel)2 PlaceRenderer (com.github.pedrovgs.sample.renderer.PlaceRenderer)1 TvShowRenderer (com.github.pedrovgs.sample.renderer.TvShowRenderer)1 TvShowCollectionRendererBuilder (com.github.pedrovgs.sample.renderer.rendererbuilder.TvShowCollectionRendererBuilder)1 Renderer (com.pedrogomez.renderers.Renderer)1 Provides (dagger.Provides)1 LinkedList (java.util.LinkedList)1