private void addStreams(CardPresenter cardPresenter, List<LiveConference> liveConferences) { if (liveConferences.size() > 0) { HeaderItem streamingHeader = new HeaderItem(getString(R.string.livestreams)); mStreamingSection = new SectionRow(streamingHeader); mRowsAdapter.add(0, mStreamingSection); for (LiveConference con : liveConferences) { if(!con.getConference().equals("Sendeschleife")){ int i = -1; for (i = 0; i < con.getGroups().size(); i++) { Group g = con.getGroups().get(i); // setup header String group = g.getGroup().length() > 0 ? g.getGroup() : con.getConference(); HeaderItem header = new HeaderItem(group); header.setDescription(con.getConference() + " - " + con.getDescription()); header.setContentDescription(group); // setup list ArrayObjectAdapter listRowAdapter = new ArrayObjectAdapter(cardPresenter); listRowAdapter.addAll(listRowAdapter.size(), g.getRooms()); mRowsAdapter.add(i + 1, new ListRow(header, listRowAdapter)); } } // mRowsAdapter.add(i + 1, new DividerRow()); } } }
private Row createCardRow(final CardRow cardRow) { switch (cardRow.getType()) { case CardRow.TYPE_SECTION_HEADER: return new SectionRow(new HeaderItem(cardRow.getTitle())); case CardRow.TYPE_DIVIDER: return new DividerRow(); case CardRow.TYPE_DEFAULT: default: // Build main row using the ImageCardViewPresenter. PresenterSelector presenterSelector = new CardPresenterSelector(getActivity()); ArrayObjectAdapter listRowAdapter = new ArrayObjectAdapter(presenterSelector); for (Card card : cardRow.getCards()) { listRowAdapter.add(card); } return new CardListRow(new HeaderItem(cardRow.getTitle()), listRowAdapter, cardRow); } }
private void addStreams(CardPresenter cardPresenter, List<LiveConference> liveConferences) { if (liveConferences.size() > 0) { HeaderItem streamingHeader = new HeaderItem(getString(R.string.livestreams)); mStreamingSection = new SectionRow(streamingHeader); mRowsAdapter.add(0, mStreamingSection); for (LiveConference con : liveConferences) { if(!con.getConference().equals("Sendeschleife") || BuildConfig.DEBUG){ int i = -1; for (i = 0; i < con.getGroups().size(); i++) { Group g = con.getGroups().get(i); // setup header String group = g.getGroup().length() > 0 ? g.getGroup() : con.getConference(); HeaderItem header = new HeaderItem(group); header.setDescription(con.getConference() + " - " + con.getDescription()); header.setContentDescription(group); // setup list ArrayObjectAdapter listRowAdapter = new ArrayObjectAdapter(cardPresenter); listRowAdapter.addAll(listRowAdapter.size(), g.getRooms()); mRowsAdapter.add(i + 1, new ListRow(header, listRowAdapter)); } } // mRowsAdapter.add(i + 1, new DividerRow()); } } }