use of butter.droid.tv.presenters.LoadingCardPresenter in project butter-android by butterproject.
the class TVSearchFragment method createLoadingRow.
private ListRow createLoadingRow() {
final HeaderItem loadingHeader = new HeaderItem(getString(R.string.search_results));
ClassPresenterSelector presenterSelector = new ClassPresenterSelector();
presenterSelector.addClassPresenter(MediaCardItem.class, new MediaCardPresenter(getActivity(), picasso));
presenterSelector.addClassPresenter(LoadingCardItem.class, new LoadingCardPresenter(getActivity()));
ArrayObjectAdapter loadingRowAdapter = new ArrayObjectAdapter(presenterSelector);
loadingRowAdapter.add(new LoadingCardItem());
return new ListRow(loadingHeader, loadingRowAdapter);
}
use of butter.droid.tv.presenters.LoadingCardPresenter 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);
}
use of butter.droid.tv.presenters.LoadingCardPresenter in project butter-android by butterproject.
the class TVOverviewFragment method addNewMediaListAdapter.
private ArrayObjectAdapter addNewMediaListAdapter() {
Context context = requireContext();
ClassPresenterSelector presenterSelector = new ClassPresenterSelector();
presenterSelector.addClassPresenter(MediaCardItem.class, new MediaCardPresenter(context, picasso));
presenterSelector.addClassPresenter(LoadingCardItem.class, new LoadingCardPresenter(context));
ArrayObjectAdapter mediaAdapter = new ArrayObjectAdapter(presenterSelector);
mediaAdapter.add(new LoadingCardItem());
// TODO: 6/17/17 Define title
HeaderItem moviesHeader = new HeaderItem(getString(R.string.top_movies));
rowsAdapter.add(new ListRow(moviesHeader, mediaAdapter));
return mediaAdapter;
}
Aggregations