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);
}
Aggregations