public void init() { mRowsAdapter = new ArrayObjectAdapter(new ListRowPresenter()); setAdapter(mRowsAdapter); setBrandColor(ContextCompat.getColor(getContext(), R.color.primary)); setBadgeDrawable(ContextCompat.getDrawable(getContext(), R.drawable.filmi)); for (int position = 0; position < HEADERS.length; position++) { ObjectAdapter rowContents = new CursorObjectAdapter((new SinglePresenterSelector(new CardPresenter()))); VideoDataManager manager = new VideoDataManager(getActivity(), getLoaderManager(), VideoItemContract.VideoItem.buildDirUri(), rowContents); manager.startDataLoading(); HeaderItem headerItem = new HeaderItem(position, HEADERS[position]); mRowsAdapter.add(new ListRow(headerItem, manager.getItemList())); } setOnItemViewClickedListener(getDefaultItemViewClickedListener()); setOnItemViewSelectedListener(getDefaultItemSelectedListener()); bgHelper = new BackgroundHelper(getActivity()); bgHelper.prepareBackgroundManager(); }
public void init() { mRowsAdapter = new ArrayObjectAdapter(new ListRowPresenter()); setAdapter(mRowsAdapter); setBrandColor(ContextCompat.getColor(getContext(), R.color.primary)); setBadgeDrawable(ContextCompat.getDrawable(getContext(), R.drawable.filmi)); for (int position = 0; position < HEADERS.length; position++) { ObjectAdapter rowContents = new CursorObjectAdapter((new SinglePresenterSelector(new CardPresenter()))); VideoDataManager manager = new VideoDataManager(getActivity(), getLoaderManager(), VideoItemContract.VideoItem.buildDirUri(), rowContents); manager.startDataLoading(); HeaderItem headerItem = new HeaderItem(position, HEADERS[position]); mRowsAdapter.add(new ListRow(headerItem, manager.getItemList())); } setOnItemViewClickedListener(getDefaultItemViewClickedListener()); }
public void init() { mRowsAdapter = new ArrayObjectAdapter(new ListRowPresenter()); setAdapter(mRowsAdapter); setBrandColor(ContextCompat.getColor(getContext(), R.color.primary)); setBadgeDrawable(ContextCompat.getDrawable(getContext(), R.drawable.filmi)); for (int position = 0; position < HEADERS.length; position++) { ObjectAdapter rowContents = new CursorObjectAdapter((new SinglePresenterSelector(new CardPresenter()))); VideoDataManager manager = new VideoDataManager(getActivity(), getLoaderManager(), VideoItemContract.VideoItem.buildDirUri(), rowContents); manager.startDataLoading(); HeaderItem headerItem = new HeaderItem(position, HEADERS[position]); mRowsAdapter.add(new ListRow(headerItem, manager.getItemList())); } }
private void initUi() { rows = new ArrayObjectAdapter(new ListRowPresenter()); setAdapter(rows); setTitle(getString(R.string.app_name)); setHeaderPresenterSelector(new SinglePresenterSelector(new IconHeaderItemPresenter())); enableRowScaling(false); }
private void addOtherRows() { ObjectAdapter rowContents = new CursorObjectAdapter((new SinglePresenterSelector(new CardPresenter()))); VideoDataManager manager = new VideoDataManager(getActivity(), getLoaderManager(), VideoItemContract.VideoItem.buildDirUri(), rowContents); manager.startDataLoading(); HeaderItem headerItem = new HeaderItem(0, "You may also like"); mRowsAdapter.add(new ListRow(headerItem, manager.getItemList())); }
RelatedRecordingsAdapter(DvrPlaybackCardPresenter presenter) { super(new SinglePresenterSelector(presenter), BaseProgram.EPISODE_COMPARATOR); }
@Override protected void onPostExecute(DetailsOverviewRow detailRow) { ClassPresenterSelector ps = new ClassPresenterSelector(); FullWidthDetailsOverviewRowPresenter detailsPresenter = new FullWidthDetailsOverviewRowPresenter(new DetailsDescriptionPresenter(getContext())); detailsPresenter.setBackgroundColor(ContextCompat.getColor(getContext(), R.color.primary)); detailsPresenter.setInitialState(FullWidthDetailsOverviewRowPresenter.STATE_FULL); detailsPresenter.setOnActionClickedListener(new OnActionClickedListener() { @Override public void onActionClicked(Action action) { if (action.getId() == ACTION_PLAY) { Intent intent = new Intent(getActivity(), PlayerActivity.class); intent.putExtra(Video.INTENT_EXTRA_VIDEO, selectedVideo); startActivity(intent); } else { Toast.makeText(getActivity(), action.toString(), Toast.LENGTH_SHORT).show(); } } }); ps.addClassPresenter(DetailsOverviewRow.class, detailsPresenter); ps.addClassPresenter(ListRow.class, new ListRowPresenter()); /** bonus code for adding related items to details fragment **/ // <START> ArrayObjectAdapter adapter = new ArrayObjectAdapter(ps); adapter.add(detailRow); String subcategories[] = { "You may also like" }; CursorObjectAdapter rowAdapter = new CursorObjectAdapter(new SinglePresenterSelector(new CardPresenter())); VideoDataManager manager = new VideoDataManager(getActivity(), getLoaderManager(), VideoItemContract.VideoItem.buildDirUri(), rowAdapter); manager.startDataLoading(); HeaderItem header = new HeaderItem(0, subcategories[0]); adapter.add(new ListRow(header, rowAdapter)); setAdapter(adapter); // <END> }