use of butter.droid.provider.base.model.Episode in project butter-android by butterproject.
the class EpisodeCardPresenter method onBindViewHolder.
@Override
public void onBindViewHolder(Presenter.ViewHolder viewHolder, Object item) {
final Episode episode = (Episode) item;
ViewHolder vh = (ViewHolder) viewHolder;
vh.setEpisode(episode);
ImageCardView cardView = vh.getCardView();
cardView.setTitleText(episode.getTitle());
cardView.setContentText(String.format(context.getString(R.string.episode_number_format), episode.getEpisode()));
cardView.setMainImageDimensions(cardWidth, cardHeight);
vh.updateCardViewImage(episode.getBackdrop());
cardView.setOnClickListener(view -> {
if (null != clickListener) {
clickListener.onEpisodeClicked(episode);
}
});
}
use of butter.droid.provider.base.model.Episode in project butter-android by butterproject.
the class MockMediaProvider method mapEpisodes.
private Episode[] mapEpisodes(MockEpisode[] mockEpisodes) {
Episode[] episodes = new Episode[mockEpisodes.length];
for (int i = 0; i < mockEpisodes.length; i++) {
MockEpisode episode = mockEpisodes[i];
episodes[i] = new Episode(String.valueOf(episode.getId()), episode.getTitle(), episode.getYear(), new Genre[0], -1, episode.getPoster(), episode.getBackdrop(), episode.getSynopsis(), new Torrent[] { new Torrent(episode.getTorrent(), new Format(episode.getQuality(), Format.FORMAT_NORMAL), 0) }, episode.getEpisdoe());
}
return episodes;
}
Aggregations