Search in sources :

Example 1 with EpisodeCardPresenter

use of butter.droid.tv.ui.detail.show.presenter.EpisodeCardPresenter in project butter-android by butterproject.

the class TVShowDetailsFragment method populatePresenterSelector.

@Override
protected void populatePresenterSelector(ClassPresenterSelector selector) {
    EpisodeCardPresenter presenter = new EpisodeCardPresenter(getActivity());
    selector.addClassPresenter(DetailsOverviewRow.class, presenter);
}
Also used : EpisodeCardPresenter(butter.droid.tv.ui.detail.show.presenter.EpisodeCardPresenter)

Example 2 with EpisodeCardPresenter

use of butter.droid.tv.ui.detail.show.presenter.EpisodeCardPresenter in project butter-android by butterproject.

the class TVShowDetailsFragment method showSeasons.

@Override
public void showSeasons(final Season[] seasons) {
    ArrayObjectAdapter objectAdapter = getObjectArrayAdapter();
    for (int i = 0; i < seasons.length; i++) {
        Season season = seasons[i];
        HeaderItem header = new HeaderItem(i, season.getTitle());
        EpisodeCardPresenter presenter = new EpisodeCardPresenter(getActivity());
        presenter.setOnClickListener(this);
        ArrayObjectAdapter episodes = new ArrayObjectAdapter(presenter);
        for (final Episode episode : season.getEpisodes()) {
            episodes.add(episode);
        }
        objectAdapter.add(new ListRow(header, episodes));
    }
    objectAdapter.notifyArrayItemRangeChanged(1, objectAdapter.size());
}
Also used : Episode(butter.droid.provider.base.model.Episode) ArrayObjectAdapter(android.support.v17.leanback.widget.ArrayObjectAdapter) HeaderItem(android.support.v17.leanback.widget.HeaderItem) Season(butter.droid.provider.base.model.Season) ListRow(android.support.v17.leanback.widget.ListRow) EpisodeCardPresenter(butter.droid.tv.ui.detail.show.presenter.EpisodeCardPresenter)

Aggregations

EpisodeCardPresenter (butter.droid.tv.ui.detail.show.presenter.EpisodeCardPresenter)2 ArrayObjectAdapter (android.support.v17.leanback.widget.ArrayObjectAdapter)1 HeaderItem (android.support.v17.leanback.widget.HeaderItem)1 ListRow (android.support.v17.leanback.widget.ListRow)1 Episode (butter.droid.provider.base.model.Episode)1 Season (butter.droid.provider.base.model.Season)1