use of com.github.pedrovgs.sample.viewmodel.EpisodeViewModel in project DraggablePanel by pedrovgs.
the class EpisodeRenderer method render.
/**
* Render the EpisodeViewModel information.
*/
@Override
protected void render() {
EpisodeViewModel episode = getContent();
episodeNumberTextView.setText(String.format("%02d", position + 1));
episodeTitleTextView.setText(episode.getTitle());
episodeDateTextView.setText(episode.getPublishDate());
}
use of com.github.pedrovgs.sample.viewmodel.EpisodeViewModel in project DraggablePanel by pedrovgs.
the class TvShowsActivity method renderEpisodes.
/**
* Render a list of episodes using a tv show view model with the information. This method create
* an adapter with the episodes information to be inserted in the ListView.
*
* @param tvShow to render
*/
private void renderEpisodes(final TvShowViewModel tvShow) {
List<Renderer<EpisodeViewModel>> episodeRenderers = new LinkedList<Renderer<EpisodeViewModel>>();
episodeRenderers.add(new EpisodeRenderer());
EpisodeRendererBuilder episodeRendererBuilder = new EpisodeRendererBuilder(episodeRenderers);
EpisodeRendererAdapter episodesAdapter = new EpisodeRendererAdapter(getLayoutInflater(), episodeRendererBuilder, tvShow.getEpisodes());
episodesListView.setAdapter(episodesAdapter);
}
Aggregations