use of android.support.v17.leanback.widget.ArrayObjectAdapter in project butter-android by butterproject.
the class TVSearchFragment method replaceRow.
@Override
public void replaceRow(int index, @StringRes int title, List<MediaCardItem> items) {
rowsAdapter.remove(loadingRow);
HeaderItem header = new HeaderItem(getString(title));
ArrayObjectAdapter listRowAdapter = new ArrayObjectAdapter(new MediaCardPresenter(getActivity(), picasso));
listRowAdapter.addAll(0, items);
ListRow row = new ListRow(header, listRowAdapter);
if (rowsAdapter.size() > index) {
rowsAdapter.replace(index, row);
} else {
rowsAdapter.add(index, row);
}
}
use of android.support.v17.leanback.widget.ArrayObjectAdapter in project butter-android by butterproject.
the class TVOverviewFragment method setupMoreRow.
@Override
public void setupMoreRow() {
HeaderItem gridHeader = new HeaderItem(getString(R.string.more));
MorePresenter gridPresenter = new MorePresenter(requireContext());
ArrayObjectAdapter gridRowAdapter = new ArrayObjectAdapter(gridPresenter);
gridRowAdapter.add(new MorePresenter.MoreItem(R.id.more_item_settings, R.string.preferences, R.drawable.ic_settings));
rowsAdapter.add(new ListRow(gridHeader, gridRowAdapter));
}
use of android.support.v17.leanback.widget.ArrayObjectAdapter in project ring-client-android by savoirfairelinux.
the class MainFragment method createRow.
private Row createRow(String titleSection, List<Card> cards, boolean shadow) {
CardRow row = new CardRow(CardRow.TYPE_DEFAULT, shadow, titleSection, cards);
PresenterSelector presenterSelector = new CardPresenterSelector(getActivity());
ArrayObjectAdapter listRowAdapter = new ArrayObjectAdapter(presenterSelector);
for (Card card : cards) {
listRowAdapter.add(card);
}
return new CardListRow(new HeaderItem(HEADER_MISC, titleSection), listRowAdapter, row);
}
use of android.support.v17.leanback.widget.ArrayObjectAdapter in project ring-client-android by savoirfairelinux.
the class RingSearchFragment method displayContact.
@Override
public void displayContact(final CallContact contact) {
getActivity().runOnUiThread(() -> {
mRowsAdapter.clear();
ArrayObjectAdapter listRowAdapter = new ArrayObjectAdapter(new CardPresenterSelector(getActivity()));
listRowAdapter.add(new ContactCard(contact, Card.Type.SEARCH_RESULT));
HeaderItem header = new HeaderItem(getActivity().getResources().getString(R.string.search_results));
mRowsAdapter.add(new ListRow(header, listRowAdapter));
});
}
use of android.support.v17.leanback.widget.ArrayObjectAdapter in project cw-omnibus by commonsguy.
the class VideosFragment method onLoadFinished.
@Override
public void onLoadFinished(Loader<Cursor> loader, Cursor c) {
mapCursorToModels(c);
setHeadersState(BrowseFragment.HEADERS_ENABLED);
setTitle(getString(R.string.app_name));
ArrayObjectAdapter rows = new ArrayObjectAdapter(new ListRowPresenter());
ArrayObjectAdapter listRowAdapter = new ArrayObjectAdapter(new VideoPresenter(getActivity()));
for (Video v : videos) {
listRowAdapter.add(v);
}
HeaderItem header = new HeaderItem(0, "Videos", null);
rows.add(new ListRow(header, listRowAdapter));
setAdapter(rows);
}
Aggregations