Search in sources :

Example 1 with GridPagingAdapter

use of butter.droid.tv.manager.internal.paging.GridPagingAdapter in project butter-android by butterproject.

the class TVMediaGridFragment method setupUi.

private void setupUi() {
    VerticalGridPresenter gridPresenter = new VerticalGridPresenter();
    gridPresenter.setNumberOfColumns(NUM_COLUMNS);
    setGridPresenter(gridPresenter);
    ClassPresenterSelector presenterSelector = new ClassPresenterSelector();
    presenterSelector.addClassPresenter(MediaCardItem.class, new MediaCardPresenter(getActivity(), picasso));
    presenterSelector.addClassPresenter(LoadingCardItem.class, new LoadingCardPresenter(getActivity()));
    adapter = new GridPagingAdapter(presenterSelector);
    setAdapter(adapter);
    pagingManager = new GridPagingManager<>();
    pagingManager.init(NUM_COLUMNS, adapter, this);
    setOnItemViewClickedListener(this);
    setOnItemViewSelectedListener(this);
}
Also used : GridPagingAdapter(butter.droid.tv.manager.internal.paging.GridPagingAdapter) VerticalGridPresenter(android.support.v17.leanback.widget.VerticalGridPresenter) LoadingCardPresenter(butter.droid.tv.presenters.LoadingCardPresenter) ClassPresenterSelector(android.support.v17.leanback.widget.ClassPresenterSelector) MediaCardPresenter(butter.droid.tv.presenters.MediaCardPresenter)

Aggregations

ClassPresenterSelector (android.support.v17.leanback.widget.ClassPresenterSelector)1 VerticalGridPresenter (android.support.v17.leanback.widget.VerticalGridPresenter)1 GridPagingAdapter (butter.droid.tv.manager.internal.paging.GridPagingAdapter)1 LoadingCardPresenter (butter.droid.tv.presenters.LoadingCardPresenter)1 MediaCardPresenter (butter.droid.tv.presenters.MediaCardPresenter)1