• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java RowHeaderPresenter类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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);
}
 
开发者ID:archos-sa,项目名称:aos-Video,代码行数:34,代码来源:MoviesByFragment.java


示例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));
}
 
开发者ID:nejtv,项目名称:androidtv-sample,代码行数:6,代码来源:IconHeaderItemPresenter.java


示例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);
}
 
开发者ID:archos-sa,项目名称:aos-Video,代码行数:69,代码来源:MainFragment.java


示例4: FullTextRowPresenter

import android.support.v17.leanback.widget.RowHeaderPresenter; //导入依赖的package包/类
public FullTextRowPresenter() {
    super();
    mMaxLines = -1;
    setHeaderPresenter(new RowHeaderPresenter());
}
 
开发者ID:archos-sa,项目名称:aos-Video,代码行数:6,代码来源:FullTextRowPresenter.java


示例5: SubtitlesDetailsRowPresenter

import android.support.v17.leanback.widget.RowHeaderPresenter; //导入依赖的package包/类
public SubtitlesDetailsRowPresenter(SubtitleDownloadInterface subtitleDownloadInterface, int color) {
    super();
    mColor = color;
    mSubtitleDownloadInterface = subtitleDownloadInterface;
    setHeaderPresenter(new RowHeaderPresenter());
}
 
开发者ID:archos-sa,项目名称:aos-Video,代码行数:7,代码来源:SubtitlesDetailsRowPresenter.java


示例6: FileDetailsRowPresenter

import android.support.v17.leanback.widget.RowHeaderPresenter; //导入依赖的package包/类
public FileDetailsRowPresenter(int color) {
    super();
    mColor = color;
    setHeaderPresenter(new RowHeaderPresenter());
}
 
开发者ID:archos-sa,项目名称:aos-Video,代码行数:6,代码来源:FileDetailsRowPresenter.java


示例7: PlotAndGenresRowPresenter

import android.support.v17.leanback.widget.RowHeaderPresenter; //导入依赖的package包/类
public PlotAndGenresRowPresenter() {
    super();
    mMaxLines = -1;
    setHeaderPresenter(new RowHeaderPresenter());
}
 
开发者ID:archos-sa,项目名称:aos-Video,代码行数:6,代码来源:PlotAndGenresRowPresenter.java


示例8: CastRowPresenter

import android.support.v17.leanback.widget.RowHeaderPresenter; //导入依赖的package包/类
public CastRowPresenter() {
    super();
    mMaxLines = -1;
    setHeaderPresenter(new RowHeaderPresenter());
}
 
开发者ID:archos-sa,项目名称:aos-Video,代码行数:6,代码来源:CastRowPresenter.java


示例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));
}
 
开发者ID:hitherejoe,项目名称:LeanbackCards,代码行数:7,代码来源:HeaderItemPresenter.java



注:本文中的android.support.v17.leanback.widget.RowHeaderPresenter类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Field类代码示例发布时间:2022-05-22
下一篇:
Java CorruptFileBlockIterator类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap