当前位置: 首页>>代码示例>>Java>>正文


Java BackgroundManager.attach方法代码示例

本文整理汇总了Java中android.support.v17.leanback.app.BackgroundManager.attach方法的典型用法代码示例。如果您正苦于以下问题:Java BackgroundManager.attach方法的具体用法?Java BackgroundManager.attach怎么用?Java BackgroundManager.attach使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.support.v17.leanback.app.BackgroundManager的用法示例。


在下文中一共展示了BackgroundManager.attach方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onCreate

import android.support.v17.leanback.app.BackgroundManager; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    Log.d(TAG, "onCreate " + savedInstanceState);
    super.onCreate(savedInstanceState);

    mPrefs = PreferenceManager.getDefaultSharedPreferences(getActivity());
    mDisplayMode = readDisplayModePref(mPrefs);

    BackgroundManager bgMngr = BackgroundManager.getInstance(getActivity());
    if(!bgMngr.isAttached())
        bgMngr.attach(getActivity().getWindow());
    bgMngr.setColor(getResources().getColor(R.color.leanback_background));

    setTitle(getArguments().getString(ARG_TITLE));
    mUri = getArguments().getParcelable(ARG_URI);
    mIsRoot = getArguments().getBoolean(ARG_IS_ROOT, false);

    setupEventListeners();

    // NOTE: onCreate is called only when the fragment is first created, not when it is back from backstack
    initGridOrList();

    mRefreshOnNextResume = true;
}
 
开发者ID:archos-sa,项目名称:aos-Video,代码行数:25,代码来源:ListingFragment.java

示例2: onCreate

import android.support.v17.leanback.app.BackgroundManager; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    BackgroundManager bgMngr = BackgroundManager.getInstance(getActivity());
    bgMngr.attach(getActivity().getWindow());
    bgMngr.setColor(getResources().getColor(R.color.leanback_background));

    mShortcut = (Shortcut)getActivity().getIntent().getSerializableExtra(EXTRA_SHORTCUT);

    DetailsOverviewRow detailRow = new DetailsOverviewRow(mShortcut);
    detailRow.setImageScaleUpAllowed(false);
    addActions(detailRow);
    mDetailsRowPresenter = new FullWidthDetailsOverviewRowPresenter(new ShortcutDetailsPresenter());

    mDetailsRowPresenter.setBackgroundColor(getResources().getColor(R.color.lightblue900));
    mDetailsRowPresenter.setOnActionClickedListener(this);

    ArrayObjectAdapter adapter = new ArrayObjectAdapter(mDetailsRowPresenter);
    adapter.add(detailRow);
    setAdapter(adapter);
}
 
开发者ID:archos-sa,项目名称:aos-Video,代码行数:23,代码来源:NetworkShortcutDetailsFragment.java

示例3: onActivityCreated

import android.support.v17.leanback.app.BackgroundManager; //导入方法依赖的package包/类
@Override
public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);

    BackgroundManager bgMngr = BackgroundManager.getInstance(getActivity());
    bgMngr.attach(getActivity().getWindow());
    bgMngr.setColor(getResources().getColor(R.color.leanback_background));

    setTitle(getString(R.string.network_storage));
    setHeadersState(HEADERS_DISABLED);
    setHeadersTransitionOnBackEnabled(false);

    loadRows();

    // Launch the shortcuts loading async task
    mShortcutsLoaderTask = new ShortcutsLoaderTask();
    mShortcutsLoaderTask.execute();
    mFtpShortcutsLoaderTask = new FtpShortcutsLoaderTask(); //not in the same task because this isn't using the same cursor
    mFtpShortcutsLoaderTask.execute();
}
 
开发者ID:archos-sa,项目名称:aos-Video,代码行数:21,代码来源:NetworkRootFragment.java

示例4: onActivityCreated

import android.support.v17.leanback.app.BackgroundManager; //导入方法依赖的package包/类
@Override
public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);

    // Just need to attach the background manager to keep the background of the parent activity
    BackgroundManager bm = BackgroundManager.getInstance(getActivity());
    bm.attach(getActivity().getWindow());
    // Adding a very dark dim to increase the difference with TvShowFragment + to improve the visibility of the row header (it contains a short how-to)
    bm.setDimLayer(getActivity().getResources().getDrawable(R.color.leanback_very_dark_dim_for_background_manager));

    setTitle(mTvshowName);
    setHeadersState(HEADERS_DISABLED);
    setHeadersTransitionOnBackEnabled(false);

    loadRows();

    setOnItemViewClickedListener(mOnItemViewClickedListener);
}
 
开发者ID:archos-sa,项目名称:aos-Video,代码行数:19,代码来源:MarkAsWatchedFragment.java

示例5: onCreate

import android.support.v17.leanback.app.BackgroundManager; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    mPrefs = PreferenceManager.getDefaultSharedPreferences(getActivity());
    int displayModeIndex = mPrefs.getInt(PREF_ALL_MOVIES_DISPLAY_MODE, -1);
    if (displayModeIndex<0) {
        mDisplayMode = DisplayMode.GRID; // default
    } else {
        mDisplayMode = DisplayMode.values()[displayModeIndex];
    }
    mSortOrder = mPrefs.getString(SORT_PARAM_KEY, MoviesLoader.DEFAULT_SORT);
    mSortOrderEntries = MoviesSortOrderEntry.getSortOrderEntries(getActivity(), sortOrderIndexer);

    BackgroundManager bgMngr = BackgroundManager.getInstance(getActivity());
    bgMngr.attach(getActivity().getWindow());
    bgMngr.setColor(getResources().getColor(R.color.leanback_background));

    setTitle(getString(R.string.all_movies));
    setEmptyTextMessage(getString(R.string.you_have_no_movies));
    setOnItemViewClickedListener(new VideoViewClickedListener(getActivity()));
    setOnItemViewSelectedListener(new ItemViewSelectedListener());

    initGridOrList();
}
 
开发者ID:archos-sa,项目名称:aos-Video,代码行数:26,代码来源:AllMoviesGridFragment.java

示例6: onCreate

import android.support.v17.leanback.app.BackgroundManager; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    mPrefs = PreferenceManager.getDefaultSharedPreferences(getActivity());
    int displayModeIndex = mPrefs.getInt(PREF_NON_SCRAPED_VIDEOS_DISPLAY_MODE, -1);
    if (displayModeIndex < 0) {
        mDisplayMode = DisplayMode.GRID; // default
    } else {
        mDisplayMode = DisplayMode.values()[displayModeIndex];
    }
    mSortOrder = mPrefs.getString(SORT_PARAM_KEY, NonScrapedVideosLoader.DEFAULT_SORT);
    mSortOrderEntries = NonScrapedSortOrderEntry.getSortOrderEntries(getActivity(), sortOrderIndexer);

    BackgroundManager bgMngr = BackgroundManager.getInstance(getActivity());
    bgMngr.attach(getActivity().getWindow());
    bgMngr.setColor(getResources().getColor(R.color.leanback_background));

    setTitle(getString(R.string.non_scraped_videos));
    setEmptyTextMessage(getString(R.string.you_have_no_non_scraped_videos));
    setOnItemViewClickedListener(new VideoViewClickedListener(getActivity()));
    setOnItemViewSelectedListener(new ItemViewSelectedListener());

    initGridOrList();
}
 
开发者ID:archos-sa,项目名称:aos-Video,代码行数:26,代码来源:NonScrapedVideosFragment.java

示例7: onCreate

import android.support.v17.leanback.app.BackgroundManager; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    Log.i(TAG, "onCreate DetailsFragment");
    super.onCreate(savedInstanceState);

    mDorPresenter =
            new DetailsOverviewRowPresenter(new DetailsDescriptionPresenter());

    BackgroundManager backgroundManager = BackgroundManager.getInstance(getActivity());
    backgroundManager.attach(getActivity().getWindow());
    mBackgroundTarget = new PicassoBackgroundManagerTarget(backgroundManager);

    mDefaultBackground = getResources().getDrawable(R.drawable.default_background);

    mMetrics = new DisplayMetrics();
    getActivity().getWindowManager().getDefaultDisplay().getMetrics(mMetrics);

    mSelectedMovie = (Movie) getActivity().getIntent().getSerializableExtra(MOVIE);
    mDetailRowBuilderTask = (DetailRowBuilderTask) new DetailRowBuilderTask().execute(mSelectedMovie);
    mDorPresenter.setSharedElementEnterTransition(getActivity(),
            DetailsActivity.SHARED_ELEMENT_NAME);

    updateBackground(mSelectedMovie.getBackgroundImageURI());
    setOnItemViewClickedListener(new ItemViewClickedListener());

}
 
开发者ID:CesarValiente,项目名称:tldrlegal,代码行数:27,代码来源:VideoDetailsFragment.java

示例8: onCreate

import android.support.v17.leanback.app.BackgroundManager; //导入方法依赖的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();
}
 
开发者ID:mklschreiber,项目名称:Crowdi,代码行数:27,代码来源:ManageAccountsActivity.java

示例9: prepareBackgroundManager

import android.support.v17.leanback.app.BackgroundManager; //导入方法依赖的package包/类
private void prepareBackgroundManager() {
    BackgroundManager backgroundManager = BackgroundManager.getInstance(getActivity());
    backgroundManager.attach(getActivity().getWindow());
    mBackgroundTarget = new PicassoBackgroundManagerTarget(backgroundManager);

    mDefaultBackground = getResources().getDrawable(R.drawable.amphitheatre);

    mMetrics = new DisplayMetrics();
    getActivity().getWindowManager().getDefaultDisplay().getMetrics(mMetrics);

    Picasso.with(getActivity())
            .load(R.drawable.amphitheatre)
            .resize(mMetrics.widthPixels, mMetrics.heightPixels)
            .centerCrop()
            .skipMemoryCache()
            .into(mBackgroundTarget);
}
 
开发者ID:jerrellmardis,项目名称:Amphitheatre,代码行数:18,代码来源:BrowseFragment.java

示例10: onCreate

import android.support.v17.leanback.app.BackgroundManager; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    Log.i(TAG, "onCreate DetailsFragment");
    super.onCreate(savedInstanceState);

    BackgroundManager backgroundManager = BackgroundManager.getInstance(getActivity());
    backgroundManager.attach(getActivity().getWindow());
    mBackgroundTarget = new PicassoBackgroundManagerTarget(backgroundManager);

    mDefaultBackground = getResources().getDrawable(R.drawable.default_background);

    mMetrics = new DisplayMetrics();
    getActivity().getWindowManager().getDefaultDisplay().getMetrics(mMetrics);

    selectedMovie = (Movie) getActivity().getIntent().getSerializableExtra(MOVIE);
    new DetailRowBuilderTask().execute(selectedMovie);

    setOnItemClickedListener(getDefaultItemClickedListener());
    updateBackground(selectedMovie.getBackgroundImageURI());

}
 
开发者ID:dextorer,项目名称:BuildingForAndroidTV,代码行数:22,代码来源:TVVideoDetailsFragment.java

示例11: onActivityCreated

import android.support.v17.leanback.app.BackgroundManager; //导入方法依赖的package包/类
@Override
public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);

    Resources r = getResources();
    BackgroundManager bgMngr = BackgroundManager.getInstance(getActivity());
    bgMngr.attach(getActivity().getWindow());
    bgMngr.setColor(r.getColor(R.color.leanback_background));
    mNfoTask = new NfoTask();
    mNfoTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
 
开发者ID:archos-sa,项目名称:aos-Video,代码行数:12,代码来源:ManualScrappingSearchFragment.java

示例12: onActivityCreated

import android.support.v17.leanback.app.BackgroundManager; //导入方法依赖的package包/类
@Override
public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);

    mPrefs = PreferenceManager.getDefaultSharedPreferences(getActivity());
    mTvShowSortOrder = mPrefs.getString(VideoPreferencesFragment.KEY_TV_SHOW_SORT_ORDER, TvshowSortOrderEntries.DEFAULT_SORT);

    BackgroundManager bgMngr = BackgroundManager.getInstance(getActivity());
    bgMngr.attach(getActivity().getWindow());
    updateBackground(bgMngr);

    Resources r = getResources();
    setBadgeDrawable(r.getDrawable(R.drawable.leanback_title));
    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();

    loadRows();
    getLoaderManager().initLoader(LOADER_ID_LAST_ADDED, null, this);
    getLoaderManager().initLoader(LOADER_ID_LAST_PLAYED, null, this);
    Bundle args = new Bundle();
    args.putString("sort", mTvShowSortOrder);
    getLoaderManager().initLoader(LOADER_ID_ALL_TV_SHOWS, args, this);
    getLoaderManager().initLoader(LOADER_ID_NON_SCRAPED_VIDEOS_COUNT, null, this);
}
 
开发者ID:archos-sa,项目名称:aos-Video,代码行数:33,代码来源:MainFragment.java

示例13: onActivityCreated

import android.support.v17.leanback.app.BackgroundManager; //导入方法依赖的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

示例14: onActivityCreated

import android.support.v17.leanback.app.BackgroundManager; //导入方法依赖的package包/类
@Override
public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);

    Resources r = getResources();
    BackgroundManager bgMngr = BackgroundManager.getInstance(getActivity());
    bgMngr.attach(getActivity().getWindow());
    bgMngr.setColor(r.getColor(R.color.leanback_background));
}
 
开发者ID:archos-sa,项目名称:aos-Video,代码行数:10,代码来源:VideoSearchFragment.java

示例15: BackdropTask

import android.support.v17.leanback.app.BackgroundManager; //导入方法依赖的package包/类
public BackdropTask(Activity activity, int backgroundDefaultColor) {
    super();
    mContext = activity;
    mMetrics = new DisplayMetrics();
    mDefaultBackground = new ColorDrawable(backgroundDefaultColor);
    activity.getWindowManager().getDefaultDisplay().getMetrics(mMetrics);
    BackgroundManager backgroundManager = BackgroundManager.getInstance(activity);
    if(!backgroundManager.isAttached())
    backgroundManager.attach(activity.getWindow());
    mBackgroundTarget = new PicassoBackgroundManagerTarget(backgroundManager);
}
 
开发者ID:archos-sa,项目名称:aos-Video,代码行数:12,代码来源:BackdropTask.java


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