本文整理匯總了Java中android.support.v17.leanback.widget.ListRowPresenter類的典型用法代碼示例。如果您正苦於以下問題:Java ListRowPresenter類的具體用法?Java ListRowPresenter怎麽用?Java ListRowPresenter使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
ListRowPresenter類屬於android.support.v17.leanback.widget包,在下文中一共展示了ListRowPresenter類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onActivityCreated
import android.support.v17.leanback.widget.ListRowPresenter; //導入依賴的package包/類
@Override
public void onActivityCreated(Bundle savedInstanceState) {
// Final initialization, modifying UI elements.
super.onActivityCreated(savedInstanceState);
// Prepare the manager that maintains the same background image between activities.
prepareBackgroundManager();
setupUIElements();
setupEventListeners();
prepareEntranceTransition();
// Map category results from the database to ListRow objects.
// This Adapter is used to render the MainFragment sidebar labels.
mCategoryRowAdapter = new ArrayObjectAdapter(new ListRowPresenter());
setAdapter(mCategoryRowAdapter);
updateRecommendations();
}
示例2: onPostExecute
import android.support.v17.leanback.widget.ListRowPresenter; //導入依賴的package包/類
@Override
protected void onPostExecute(Void avoid) {
ClassPresenterSelector ps = new ClassPresenterSelector();
ps.addClassPresenter(DetailsOverviewRow.class, mOverviewRowPresenter);
ps.addClassPresenter(PlotAndGenresRow.class, new PlotAndGenresRowPresenter(16,mColor)); // 16 lines max to fit on screen
ps.addClassPresenter(FullTextRow.class, new FullTextRowPresenter(18,mColor)); // 18 lines max to fit on screen
ps.addClassPresenter(ListRow.class, new ListRowPresenter());
mOverviewRowPresenter.setBackgroundColor(mColor);
mRowsAdapter = new ArrayObjectAdapter(ps);
mRowsAdapter.clear();
// Add all the non-null rows
for (Row row : new Row[] {mDetailsRow, mPlotAndGenresRow, mCastRow, mPostersRow, mBackdropsRow, mWebLinksRow}) {
if (row!=null) {
mRowsAdapter.add(row);
}
}
setAdapter(mRowsAdapter);
}
示例3: onActivityCreated
import android.support.v17.leanback.widget.ListRowPresenter; //導入依賴的package包/類
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
prepareBackgroundManager();
setupUIElements();
setupEventListeners();
prepareEntranceTransition();
mCategoryRowAdapter = new ArrayObjectAdapter(new ListRowPresenter());
loadRows();
setAdapter(mCategoryRowAdapter);
updateRecommendations();
}
示例4: loadRows
import android.support.v17.leanback.widget.ListRowPresenter; //導入依賴的package包/類
private void loadRows() {
mRowsAdapter = new ArrayObjectAdapter(new ListRowPresenter());
mApkDownloadHelper = new ApkDownloadHelper(getActivity());
// Setup the package installer for the session
mApkDownloadHelper.addListener(mDownloadListener);
HeaderItem header = null;
if (getResources().getBoolean(R.bool.ENABLE_APP_REPO)) {
createRowApkDownloads();
}
if (getResources().getBoolean(R.bool.ENABLE_DOWNLOADS_ROW)) {
createRowDownloadedApks();
}
createRowShortcutGenerator();
createRowCustomShortcuts();
createRowMisc();
setAdapter(mRowsAdapter);
}
示例5: onActivityCreated
import android.support.v17.leanback.widget.ListRowPresenter; //導入依賴的package包/類
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
//setup background updater
mBackgroundUpdater = new BackgroundUpdater();
mBackgroundUpdater.initialise(getActivity(), R.color.black);
//setup main adapter
ListRowPresenter mainMenuRowPresenter = new ListRowPresenter();
mainMenuRowPresenter.setShadowEnabled(false);
mRowsAdapter = new ArrayObjectAdapter(mainMenuRowPresenter);
setAdapter(mRowsAdapter);
setupUIElements();
setupEventListeners();
setupAdapters();
loadData();
}
示例6: init
import android.support.v17.leanback.widget.ListRowPresenter; //導入依賴的package包/類
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();
}
示例7: init
import android.support.v17.leanback.widget.ListRowPresenter; //導入依賴的package包/類
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());
}
示例8: init
import android.support.v17.leanback.widget.ListRowPresenter; //導入依賴的package包/類
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()));
}
}
示例9: onCreate
import android.support.v17.leanback.widget.ListRowPresenter; //導入依賴的package包/類
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mRowsAdapter = new ArrayObjectAdapter(new ListRowPresenter());
setSearchResultProvider(this);
setOnItemViewClickedListener(new OnItemViewClickedListener() {
@Override
public void onItemClicked(Presenter.ViewHolder itemViewHolder, Object item, RowPresenter.ViewHolder rowViewHolder, Row row) {
if (!(item instanceof BaseRowItem)) return;
ItemLauncher.launch((BaseRowItem) item, TvApp.getApplication(), getActivity(), itemViewHolder);
}
});
mDelayedLoad = new SearchRunnable();
prepareBackgroundManager();
}
示例10: onCreate
import android.support.v17.leanback.widget.ListRowPresenter; //導入依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_manageaccounts);
mLibrary = Library.getInstance();
mLibrary.registerListener(this);
mFitnessLibrary = FitnessLibrary.getInstance();
mFitnessLibrary.registerListener(this);
mFragmentManager = getFragmentManager();
mBrowseFragment = (BrowseFragment) mFragmentManager.findFragmentById(R.id.id_Fragment_ManageAccountActivity);
mBrowseFragment.setHeadersState(BrowseFragment.HEADERS_ENABLED);
mBrowseFragment.setBadgeDrawable(getDrawable(R.drawable.browse_logo));
mBrowseFragment.setOnItemViewClickedListener(this);
BackgroundManager backgroundManager = BackgroundManager.getInstance(this);
backgroundManager.attach(this.getWindow());
backgroundManager.setDrawable(getResources().getDrawable(R.drawable.background, null));
mArrayObjectAdapter = new ArrayObjectAdapter(new ListRowPresenter());
mBrowseFragment.setAdapter(mArrayObjectAdapter);
updateUI();
}
示例11: onActivityCreated
import android.support.v17.leanback.widget.ListRowPresenter; //導入依賴的package包/類
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
((BaseActivity) getActivity()).getActivityComponent().inject(this);
mPreferencesHelper =
VineyardApplication.get(getActivity()).getComponent().preferencesHelper();
mRowsAdapter = new ArrayObjectAdapter(new ListRowPresenter());
mHandler = new Handler();
mPopularText = getString(R.string.header_text_popular);
mEditorsPicksText = getString(R.string.header_text_editors_picks);
mEventBus.register(this);
loadPosts();
setAdapter(mRowsAdapter);
prepareBackgroundManager();
setupUIElements();
setupListeners();
}
示例12: showMainInformation
import android.support.v17.leanback.widget.ListRowPresenter; //導入依賴的package包/類
@Override public void showMainInformation(List<CardInfo> favorites, List<CardInfo> conversations,
List<CardInfo> contacts, List<ImageInfo> mediaElements, List<IconInfo> preferences) {
ArrayObjectAdapter rowsAdapter = new ArrayObjectAdapter(new ListRowPresenter());
CardPresenter bigCardPresenter = new CardPresenter(CARD_WIDTH_IN_DP, CARD_HEIGHT_IN_DP);
CardPresenter smallCarPresenter = new CardPresenter();
addCardInfoElementsToRowsAdapter(R.string.favorites_item_title, favorites, rowsAdapter,
smallCarPresenter, FAVORITES_ROW);
addCardInfoElementsToRowsAdapter(R.string.recent_conversation_item_title, conversations,
rowsAdapter, bigCardPresenter, CONVERSATIONS_ROW);
addCardInfoElementsToRowsAdapter(R.string.contacts_item_title, contacts, rowsAdapter,
smallCarPresenter, CONTACTS_ROW);
addImageInfoElementsToRowAdapter(R.string.media_elements_item_title, mediaElements, rowsAdapter,
new ImagePresenter(), MEDIA_ROW);
addIconInfoElementsToRowAdapter(getResources().getString(R.string.preferences), preferences,
rowsAdapter, new IconPresenter(), PREFERENCES_ROW);
setAdapter(rowsAdapter);
}
示例13: loadRows
import android.support.v17.leanback.widget.ListRowPresenter; //導入依賴的package包/類
private void loadRows() {
ArrayObjectAdapter rowsAdapter = new ArrayObjectAdapter( new ListRowPresenter() );
CardPresenter cardPresenter = new CardPresenter();
List<String> categories = getCategories();
if( categories == null || categories.isEmpty() )
return;
for( String category : categories ) {
ArrayObjectAdapter listRowAdapter = new ArrayObjectAdapter( cardPresenter );
for( Movie movie : mMovies ) {
if( category.equalsIgnoreCase( movie.getCategory() ) )
listRowAdapter.add( movie );
}
if( listRowAdapter.size() > 0 ) {
HeaderItem header = new HeaderItem( rowsAdapter.size() - 1, category, null );
rowsAdapter.add( new ListRow( header, listRowAdapter ) );
}
}
setupPreferences( rowsAdapter );
setAdapter( rowsAdapter );
}
示例14: setupSharedViewPool
import android.support.v17.leanback.widget.ListRowPresenter; //導入依賴的package包/類
private void setupSharedViewPool(ItemBridgeAdapter.ViewHolder bridgeVh) {
RowPresenter rowPresenter = (RowPresenter) bridgeVh.getPresenter();
RowPresenter.ViewHolder rowVh = rowPresenter.getRowViewHolder(bridgeVh.getViewHolder());
if (rowVh instanceof ListRowPresenter.ViewHolder) {
HorizontalGridView view = ((ListRowPresenter.ViewHolder) rowVh).getGridView();
// Recycled view pool is shared between all list rows
if (mRecycledViewPool == null) {
mRecycledViewPool = view.getRecycledViewPool();
} else {
view.setRecycledViewPool(mRecycledViewPool);
}
ItemBridgeAdapter bridgeAdapter =
((ListRowPresenter.ViewHolder) rowVh).getBridgeAdapter();
if (mPresenterMapper == null) {
mPresenterMapper = bridgeAdapter.getPresenterMapper();
} else {
bridgeAdapter.setPresenterMapper(mPresenterMapper);
}
}
}
示例15: initializeRelatedVideosRow
import android.support.v17.leanback.widget.ListRowPresenter; //導入依賴的package包/類
private ArrayObjectAdapter initializeRelatedVideosRow() {
/*
* To add a new row to the mPlayerAdapter and not lose the controls row that is provided by the
* glue, we need to compose a new row with the controls row and our related videos row.
*
* We start by creating a new {@link ClassPresenterSelector}. Then add the controls row from
* the media player glue, then add the related videos row.
*/
ClassPresenterSelector presenterSelector = new ClassPresenterSelector();
presenterSelector.addClassPresenter(
mPlayerGlue.getControlsRow().getClass(), mPlayerGlue.getPlaybackRowPresenter());
presenterSelector.addClassPresenter(ListRow.class, new ListRowPresenter());
ArrayObjectAdapter rowsAdapter = new ArrayObjectAdapter(presenterSelector);
rowsAdapter.add(mPlayerGlue.getControlsRow());
HeaderItem header = new HeaderItem(getString(R.string.related_movies));
ListRow row = new ListRow(header, mVideoCursorAdapter);
rowsAdapter.add(row);
setOnItemViewClickedListener(new ItemViewClickedListener());
return rowsAdapter;
}