Search in sources :

Example 6 with Episode

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);
        }
    });
}
Also used : Episode(butter.droid.provider.base.model.Episode) ImageCardView(android.support.v17.leanback.widget.ImageCardView)

Example 7 with 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;
}
Also used : MockEpisode(butter.droid.provider.mock.model.MockEpisode) Episode(butter.droid.provider.base.model.Episode) MockEpisode(butter.droid.provider.mock.model.MockEpisode) Torrent(butter.droid.provider.base.model.Torrent) Format(butter.droid.provider.base.model.Format) Genre(butter.droid.provider.base.filter.Genre)

Aggregations

Episode (butter.droid.provider.base.model.Episode)7 Torrent (butter.droid.provider.base.model.Torrent)3 Bundle (android.os.Bundle)2 ArrayObjectAdapter (android.support.v17.leanback.widget.ArrayObjectAdapter)2 HeaderItem (android.support.v17.leanback.widget.HeaderItem)2 ListRow (android.support.v17.leanback.widget.ListRow)2 MediaDisplayManager (butter.droid.base.manager.internal.media.MediaDisplayManager)2 MediaWrapper (butter.droid.base.providers.media.model.MediaWrapper)2 StreamInfo (butter.droid.base.providers.media.model.StreamInfo)2 Format (butter.droid.provider.base.model.Format)2 Season (butter.droid.provider.base.model.Season)2 Inject (javax.inject.Inject)2 Activity (android.app.Activity)1 AlertDialog (android.app.AlertDialog)1 Dialog (android.app.Dialog)1 Context (android.content.Context)1 DialogInterface (android.content.DialogInterface)1 NonNull (android.support.annotation.NonNull)1 Nullable (android.support.annotation.Nullable)1 ClassPresenterSelector (android.support.v17.leanback.widget.ClassPresenterSelector)1