本文整理汇总了Java中android.support.v17.leanback.widget.RowHeaderPresenter类的典型用法代码示例。如果您正苦于以下问题:Java RowHeaderPresenter类的具体用法?Java RowHeaderPresenter怎么用?Java RowHeaderPresenter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RowHeaderPresenter类属于android.support.v17.leanback.widget包,在下文中一共展示了RowHeaderPresenter类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onActivityCreated
import android.support.v17.leanback.widget.RowHeaderPresenter; //导入依赖的package包/类
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
mPrefs = PreferenceManager.getDefaultSharedPreferences(getActivity());
mSortOrder = mPrefs.getString(getSortOrderParamKey(), MoviesLoader.DEFAULT_SORT);
Resources r = getResources();
BackgroundManager bgMngr = BackgroundManager.getInstance(getActivity());
bgMngr.attach(getActivity().getWindow());
bgMngr.setColor(r.getColor(R.color.leanback_background));
setHeadersState(HEADERS_ENABLED);
setHeadersTransitionOnBackEnabled(true);
// set fastLane (or headers) background color
setBrandColor(r.getColor(R.color.leanback_side));
// set search icon color
setSearchAffordanceColor(r.getColor(R.color.lightblueA200));
setupEventListeners();
RowPresenter rowPresenter = new ListRowPresenter();
rowPresenter.setHeaderPresenter(new RowHeaderPresenter());
mRowsAdapter = new ArrayObjectAdapter(rowPresenter);
setAdapter(mRowsAdapter);
mVideoPresenter = new PosterImageCardPresenter(getActivity());
mVideoMapper = new CompatibleCursorMapperConverter(new VideoCursorMapper());
getLoaderManager().initLoader(-1, null, this);
}
示例2: onSelectLevelChanged
import android.support.v17.leanback.widget.RowHeaderPresenter; //导入依赖的package包/类
@Override
protected void onSelectLevelChanged(RowHeaderPresenter.ViewHolder holder) {
holder.view.setAlpha(mUnselectedAlpha + holder.getSelectLevel() *
(1.0f - mUnselectedAlpha));
}
示例3: loadRows
import android.support.v17.leanback.widget.RowHeaderPresenter; //导入依赖的package包/类
private void loadRows() {
Log.d(TAG,"loadRows()");
// Two different row presenters, one standard for regular cards, one special for the icon items
ListRowPresenter listRowPresenter = new ListRowPresenter();
IconItemRowPresenter iconItemRowPresenter = new IconItemRowPresenter();
// Only way I found to use two different presenter is using a ClassPresenterSelector, hence i needed
// to create a dummy IconListRow that does nothing more than a regular ListRow
ClassPresenterSelector rowsPresenterSelector = new ClassPresenterSelector();
rowsPresenterSelector.addClassPresenter(ListRow.class, listRowPresenter);
rowsPresenterSelector.addClassPresenter(IconListRow.class, iconItemRowPresenter);
// Basic header presenter for both row presenters
listRowPresenter.setHeaderPresenter(new RowHeaderPresenter());
iconItemRowPresenter.setHeaderPresenter(new RowHeaderPresenter());
mRowsAdapter = new ArrayObjectAdapter(rowsPresenterSelector);
mLastAddedAdapter = new CursorObjectAdapter(new PosterImageCardPresenter(getActivity()));
mLastAddedAdapter.setMapper(new CompatibleCursorMapperConverter(new VideoCursorMapper()));
mLastAddedRow = new ListRow(ROW_ID_LAST_ADDED, new HeaderItem(getString(R.string.recently_added)), mLastAddedAdapter);
mRowsAdapter.add(mLastAddedRow);
mLastPlayedAdapter = new CursorObjectAdapter(new PosterImageCardPresenter(getActivity()));
mLastPlayedAdapter.setMapper(new CompatibleCursorMapperConverter(new VideoCursorMapper()));
mLastPlayedRow = new ListRow(ROW_ID_LAST_PLAYED, new HeaderItem(getString(R.string.recently_played)), mLastPlayedAdapter);
mRowsAdapter.add(mLastPlayedRow);
ArrayObjectAdapter movieRowAdapter = new ArrayObjectAdapter(new BoxItemPresenter());
movieRowAdapter.add(buildAllMoviesBox());
movieRowAdapter.add(new Box(Box.ID.MOVIES_BY_GENRE, getString(R.string.movies_by_genre), R.drawable.genres_banner));
movieRowAdapter.add(new Box(Box.ID.MOVIES_BY_YEAR, getString(R.string.movies_by_year), R.drawable.years_banner));
mRowsAdapter.add(new ListRow(ROW_ID_MOVIES,
new HeaderItem(getString(R.string.movies)),
movieRowAdapter));
mTvshowsAdapter = new CursorObjectAdapter(new PosterImageCardPresenter(getActivity()));
mTvshowsAdapter.setMapper(new CompatibleCursorMapperConverter(new TvshowCursorMapper()));
mTvshowsRow = new ListRow(ROW_ID_TVSHOWS, new HeaderItem(getString(R.string.all_tv_shows)), mTvshowsAdapter);
mRowsAdapter.add(mTvshowsRow);
mFileBrowsingRowAdapter = new ArrayObjectAdapter(new BoxItemPresenter());
mFileBrowsingRowAdapter.add(new Box(Box.ID.NETWORK, getString(R.string.network_storage), R.drawable.filetype_new_server));
mFileBrowsingRowAdapter.add(new Box(Box.ID.FOLDERS, getString(R.string.internal_storage), R.drawable.filetype_new_folder));
mFileBrowsingRowAdapter.add(new Box(Box.ID.VIDEOS_BY_LISTS, getString(R.string.video_lists), R.drawable.filetype_new_playlist));
mNonScrapedVideosItem = new Box(Box.ID.NON_SCRAPED_VIDEOS, getString(R.string.non_scraped_videos), R.drawable.filetype_new_unscraped_video);
// Add USB and SDcard items at init ?depending of their availability
updateUsbAndSdcardVisibility();
mRowsAdapter.add(new ListRow(ROW_ID_FILES,
new HeaderItem(getString(R.string.leanback_browsing)),
mFileBrowsingRowAdapter));
mPreferencesRowAdapter = new ArrayObjectAdapter(new IconItemPresenter());
mPreferencesRowAdapter.add(new Icon(Icon.ID.PREFERENCES, getString(R.string.preferences), R.drawable.lollipop_settings));
mPreferencesRowAdapter.add(new Icon(Icon.ID.PRIVATE_MODE, getString(R.string.private_mode_is_on), getString(R.string.private_mode_is_off),
R.drawable.private_mode, R.drawable.private_mode_off, PrivateMode.isActive()));
mPreferencesRowAdapter.add(new Icon(Icon.ID.LEGACY_UI, getString(R.string.leanback_legacy_ui), R.drawable.legacy_ui_icon));
mPreferencesRowAdapter.add(new Icon(Icon.ID.HELP_FAQ, getString(R.string.help_faq), R.drawable.lollipop_help));
// Must use an IconListRow to have the dedicated presenter used (see ClassPresenterSelector above)
mRowsAdapter.add(new IconListRow(ROW_ID_PREFERENCES,
new HeaderItem(getString(R.string.preferences)),
mPreferencesRowAdapter));
setAdapter(mRowsAdapter);
}
示例4: FullTextRowPresenter
import android.support.v17.leanback.widget.RowHeaderPresenter; //导入依赖的package包/类
public FullTextRowPresenter() {
super();
mMaxLines = -1;
setHeaderPresenter(new RowHeaderPresenter());
}
示例5: SubtitlesDetailsRowPresenter
import android.support.v17.leanback.widget.RowHeaderPresenter; //导入依赖的package包/类
public SubtitlesDetailsRowPresenter(SubtitleDownloadInterface subtitleDownloadInterface, int color) {
super();
mColor = color;
mSubtitleDownloadInterface = subtitleDownloadInterface;
setHeaderPresenter(new RowHeaderPresenter());
}
示例6: FileDetailsRowPresenter
import android.support.v17.leanback.widget.RowHeaderPresenter; //导入依赖的package包/类
public FileDetailsRowPresenter(int color) {
super();
mColor = color;
setHeaderPresenter(new RowHeaderPresenter());
}
示例7: PlotAndGenresRowPresenter
import android.support.v17.leanback.widget.RowHeaderPresenter; //导入依赖的package包/类
public PlotAndGenresRowPresenter() {
super();
mMaxLines = -1;
setHeaderPresenter(new RowHeaderPresenter());
}
示例8: CastRowPresenter
import android.support.v17.leanback.widget.RowHeaderPresenter; //导入依赖的package包/类
public CastRowPresenter() {
super();
mMaxLines = -1;
setHeaderPresenter(new RowHeaderPresenter());
}
示例9: onSelectLevelChanged
import android.support.v17.leanback.widget.RowHeaderPresenter; //导入依赖的package包/类
@Override
protected void onSelectLevelChanged(RowHeaderPresenter.ViewHolder holder) {
// this is a temporary fix
holder.view.setAlpha(mUnselectedAlpha + holder.getSelectLevel() *
(1.0f - mUnselectedAlpha));
}