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


Java BackgroundManager.setDrawable方法代码示例

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


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

示例1: 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

示例2: updateBackground

import android.support.v17.leanback.app.BackgroundManager; //导入方法依赖的package包/类
private void updateBackground(BackgroundManager bgMngr) {
    Resources r = getResources();
    if (PrivateMode.isActive()) {
        bgMngr.setDrawable(r.getDrawable(R.drawable.private_background));
    } else {
        bgMngr.setDrawable(new ColorDrawable(r.getColor(R.color.leanback_background)));
    }
    bgMngr.setDimLayer(r.getDrawable(android.R.color.transparent));
}
 
开发者ID:archos-sa,项目名称:aos-Video,代码行数:10,代码来源:MainFragment.java

示例3: onCreate

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

    mFragmentManager = getFragmentManager();
    mBrowseFragment = (BrowseFragment) mFragmentManager.findFragmentById(R.id.id_frag_TVMainActivity);

    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);

    mLibrary = Library.getInstance();
    mLibrary.init(this);

    mFitnessLibrary = FitnessLibrary.getInstance();
    mFitnessLibrary.init(this);

    updateUI();
}
 
开发者ID:mklschreiber,项目名称:Crowdi,代码行数:28,代码来源:MainActivity.java

示例4: onCreate

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

    mActivity = this;

    mWearNotificationServiceSenderConnection = new WearNotificationServiceSenderConnection();
    mHeartRateDataServiceReceiverConnection = new HeartRateDataServiceReceiverConnection();

    initializeButtons();
    mProgressBar = (ProgressBar) findViewById(R.id.id_SinglePollActivity_ProgressBar);

    mPollUrl = checkStartingIntent();

    mLibrary = Library.getInstance();
    mLibrary.registerListener(this);

    if(mPollUrl != null
            && mPollUrl.compareTo("") != 0
            && mLibrary != null
            && mLibrary.accountAvailable()) {

        mLibrary.loadPoll(mPollUrl, sClassName);
        changeButtonEnableStatus(true);
    } else {
        Toast.makeText(this, R.string.SinglePollActivity_Toast_Error, Toast.LENGTH_SHORT).show();
        changeButtonEnableStatus(false);
    }

    BackgroundManager backgroundManager = BackgroundManager.getInstance(this);
    backgroundManager.attach(this.getWindow());
    backgroundManager.setDrawable(getResources().getDrawable(R.drawable.background, null));
}
 
开发者ID:mklschreiber,项目名称:Crowdi,代码行数:35,代码来源:SinglePollActivity.java

示例5: initUIs

import android.support.v17.leanback.app.BackgroundManager; //导入方法依赖的package包/类
private void initUIs(Bitmap bitmap) {
    DetailsOverviewRowPresenter dorPresenter =
            new DetailsOverviewRowPresenter(new DetailsDescriptionPresenter());
    dorPresenter.setSharedElementEnterTransition(getActivity(), "SetUpFragment");

    mAddChannelAction = new Action(ACTION_ADD_CHANNELS,
            getResources().getString(R.string.rich_setup_add_channel));
    Action cancelAction = new Action(ACTION_CANCEL,
            getResources().getString(R.string.rich_setup_cancel));
    mInProgressAction = new Action(ACTION_IN_PROGRESS,
            getResources().getString(R.string.rich_setup_in_progress));

    DetailsOverviewRow row = new DetailsOverviewRow(mTvListing);
    if (bitmap != null) {
        int length = Math.min(bitmap.getWidth(), bitmap.getHeight());
        Bitmap croppedBitmap = Bitmap.createBitmap(bitmap,
                (bitmap.getWidth() - length) / 2,
                (bitmap.getHeight() - length) / 2,
                length, length);
        row.setImageBitmap(getActivity(), croppedBitmap);
    }
    row.addAction(mAddChannelAction);
    row.addAction(cancelAction);

    ClassPresenterSelector presenterSelector = new ClassPresenterSelector();
    // set detail background and style
    dorPresenter.setBackgroundColor(getResources().getColor(R.color.detail_background));
    dorPresenter.setStyleLarge(true);

    dorPresenter.setOnActionClickedListener(new OnActionClickedListener() {
        @Override
        public void onActionClicked(Action action) {
            if (action.getId() == ACTION_ADD_CHANNELS) {
                setupChannels(mInputId);
            } else if (action.getId() == ACTION_CANCEL) {
                getActivity().finish();
            }
        }
    });

    presenterSelector.addClassPresenter(DetailsOverviewRow.class, dorPresenter);
    presenterSelector.addClassPresenter(ListRow.class, new ListRowPresenter());
    mAdapter = new ArrayObjectAdapter(presenterSelector);
    mAdapter.add(row);

    setAdapter(mAdapter);

    BackgroundManager backgroundManager = BackgroundManager.getInstance(getActivity());
    backgroundManager.attach(getActivity().getWindow());
    if (bitmap != null) {
        backgroundManager.setBitmap(bitmap);
    } else {
        backgroundManager.setDrawable(
                getActivity().getDrawable(R.drawable.default_background));
    }
}
 
开发者ID:nejtv,项目名称:androidtv-sample,代码行数:57,代码来源:RichSetupFragment.java

示例6: setBackground

import android.support.v17.leanback.app.BackgroundManager; //导入方法依赖的package包/类
private void setBackground() {

        BackgroundManager backgroundManager = BackgroundManager.getInstance( getActivity() );
        backgroundManager.attach( getActivity().getWindow() );
        backgroundManager.setDrawable( getResources().getDrawable( R.drawable.default_background ) );
    }
 
开发者ID:Lakkichand,项目名称:AndroidDemoProjects,代码行数:7,代码来源:MainFragment.java


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