本文整理匯總了Java中android.support.v17.leanback.app.BackgroundManager.getInstance方法的典型用法代碼示例。如果您正苦於以下問題:Java BackgroundManager.getInstance方法的具體用法?Java BackgroundManager.getInstance怎麽用?Java BackgroundManager.getInstance使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.support.v17.leanback.app.BackgroundManager
的用法示例。
在下文中一共展示了BackgroundManager.getInstance方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: 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();
}
示例2: 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);
}
示例3: 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();
}
示例4: 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;
}
示例5: 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());
}
示例6: 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();
}
示例7: 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);
}
示例8: 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());
}
示例9: 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);
}
示例10: prepareBackgroundManager
import android.support.v17.leanback.app.BackgroundManager; //導入方法依賴的package包/類
private void prepareBackgroundManager() {
mBackgroundManager = BackgroundManager.getInstance(getActivity());
mBackgroundManager.attach(getActivity().getWindow());
mDefaultBackground = getResources().getDrawable(R.drawable.default_background, null);
mMetrics = new DisplayMetrics();
getActivity().getWindowManager().getDefaultDisplay().getMetrics(mMetrics);
}
示例11: prepareBackgroundManager
import android.support.v17.leanback.app.BackgroundManager; //導入方法依賴的package包/類
private void prepareBackgroundManager() {
mBackgroundManager = BackgroundManager.getInstance(getActivity());
mBackgroundManager.attach(getActivity().getWindow());
mMetrics = new DisplayMetrics();
getActivity().getWindowManager().getDefaultDisplay().getMetrics(mMetrics);
mImageLoader = new DebouncedImageLoader(getActivity(), mBackgroundManager, mMetrics.widthPixels, mMetrics.heightPixels);
}
示例12: 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));
}
示例13: prepareBackgroundManager
import android.support.v17.leanback.app.BackgroundManager; //導入方法依賴的package包/類
private void prepareBackgroundManager() {
mBackgroundManager = BackgroundManager.getInstance(this);
mBackgroundManager.attach(this.getWindow());
mMetrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(mMetrics);
//設置背景圖
setBingImg();
}
示例14: prepareBackgroundManager
import android.support.v17.leanback.app.BackgroundManager; //導入方法依賴的package包/類
private void prepareBackgroundManager() {
mBackgroundManager = BackgroundManager.getInstance(getActivity());
mBackgroundManager.attach(getActivity().getWindow());
mDefaultBackground = getResources().getDrawable(R.drawable.default_background);
mMetrics = new DisplayMetrics();
getActivity().getWindowManager().getDefaultDisplay().getMetrics(mMetrics);
}
示例15: prepareBackgroundManager
import android.support.v17.leanback.app.BackgroundManager; //導入方法依賴的package包/類
private void prepareBackgroundManager() {
mBackgroundManager = BackgroundManager.getInstance(getActivity());
mBackgroundManager.attach(getActivity().getWindow());
mDefaultBackground = getResources().getDrawable(R.drawable.default_background);
mMetrics = new DisplayMetrics();
getActivity().getWindowManager().getDefaultDisplay().getMetrics(mMetrics);
}