本文整理匯總了Java中android.support.v17.leanback.widget.HeaderItem.setDescription方法的典型用法代碼示例。如果您正苦於以下問題:Java HeaderItem.setDescription方法的具體用法?Java HeaderItem.setDescription怎麽用?Java HeaderItem.setDescription使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.support.v17.leanback.widget.HeaderItem
的用法示例。
在下文中一共展示了HeaderItem.setDescription方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: addStreams
import android.support.v17.leanback.widget.HeaderItem; //導入方法依賴的package包/類
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());
}
}
}
示例2: addStreams
import android.support.v17.leanback.widget.HeaderItem; //導入方法依賴的package包/類
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());
}
}
}
示例3: getRow
import android.support.v17.leanback.widget.HeaderItem; //導入方法依賴的package包/類
private ListRow getRow(Map<String, List<Conference>> conferences, CardPresenter cardPresenter, String tag, String description) {
ArrayObjectAdapter listRowAdapter = new ArrayObjectAdapter(cardPresenter);
listRowAdapter.addAll(0, conferences.get(tag));
HeaderItem header = new HeaderItem(ConferencesWrapper.getStringForTag(tag));
header.setDescription(description);
return new ListRow(header, listRowAdapter);
}