當前位置: 首頁>>代碼示例>>Java>>正文


Java BrowseFragment.setHeadersState方法代碼示例

本文整理匯總了Java中android.support.v17.leanback.app.BrowseFragment.setHeadersState方法的典型用法代碼示例。如果您正苦於以下問題:Java BrowseFragment.setHeadersState方法的具體用法?Java BrowseFragment.setHeadersState怎麽用?Java BrowseFragment.setHeadersState使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.support.v17.leanback.app.BrowseFragment的用法示例。


在下文中一共展示了BrowseFragment.setHeadersState方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onCreate

import android.support.v17.leanback.app.BrowseFragment; //導入方法依賴的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: onCreate

import android.support.v17.leanback.app.BrowseFragment; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    mContext = this;
    mBrowseFragment = (BrowseFragment) getFragmentManager().findFragmentById(R.id.browse_fragment);
    mBrowseFragment.setHeadersState(BrowseFragment.HEADERS_DISABLED);

    getLoaderManager().initLoader(ITEM_LOADER_ID, null, new MainFragmentLoaderCallbacks());

    mBrowseFragment.setTitle(getString(R.string.app_name));
    prepareBackgroundManager();
}
 
開發者ID:TAnsz,項目名稱:MyTvLauncher,代碼行數:14,代碼來源:MainActivity.java

示例3: onCreate

import android.support.v17.leanback.app.BrowseFragment; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    mContext = this;
    mBrowseFragment = (BrowseFragment) getFragmentManager().findFragmentById(R.id.browse_fragment);

    mBrowseFragment.setHeadersState(BrowseFragment.HEADERS_DISABLED);
    mBrowseFragment.setTitle(getString(R.string.app_name));

    prepareBackgroundManager();
    buildRowsAdapter();
}
 
開發者ID:JackyAndroid,項目名稱:AndroidTVLauncher,代碼行數:15,代碼來源:MainActivity.java

示例4: onCreate

import android.support.v17.leanback.app.BrowseFragment; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    if (mMediaLibrary.getMediaItems().isEmpty()) {
        if (mSettings.getBoolean(PreferencesActivity.AUTO_RESCAN, true))
            mMediaLibrary.scanMediaItems(false);
        else
            mMediaLibrary.loadMedaItems();
    }

    if (!VLCInstance.testCompatibleCPU(this)) {
        finish();
        return;
    }

    mContext = this;
    setContentView(R.layout.tv_main_fragment);

    mDefaultBackground = getResources().getDrawable(R.drawable.background);
    final FragmentManager fragmentManager = getFragmentManager();
    mBrowseFragment = (BrowseFragment) fragmentManager.findFragmentById(
            R.id.browse_fragment);
    mProgressBar = (ProgressBar) findViewById(R.id.tv_main_progress);

    // Set display parameters for the BrowseFragment
    mBrowseFragment.setHeadersState(BrowseFragment.HEADERS_ENABLED);
    mBrowseFragment.setTitle(getString(R.string.app_name));
    mBrowseFragment.setBadgeDrawable(getResources().getDrawable(R.drawable.icon));

    // add a listener for selected items
    mBrowseFragment.setOnItemViewClickedListener(this);
    mBrowseFragment.setOnItemViewSelectedListener(this);

    if (!Build.MANUFACTURER.equalsIgnoreCase("amazon")) { //Hide search for Amazon Fire TVs
        mBrowseFragment.setOnSearchClickedListener(this);
        // set search icon color
        mBrowseFragment.setSearchAffordanceColor(getResources().getColor(R.color.orange500));
    }
    mRootContainer = mBrowseFragment.getView();
}
 
開發者ID:hanhailong,項目名稱:VCL-Android,代碼行數:41,代碼來源:MainTvActivity.java

示例5: onCreate

import android.support.v17.leanback.app.BrowseFragment; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mMediaLibrary.loadMediaItems(false);

    if (!VLCInstance.testCompatibleCPU(this)) {
        finish();
        return;
    }

    mContext = this;
    setContentView(R.layout.tv_main_fragment);

    mDefaultBackground = getResources().getDrawable(R.drawable.background);
    final FragmentManager fragmentManager = getFragmentManager();
    mBrowseFragment = (BrowseFragment) fragmentManager.findFragmentById(
            R.id.browse_fragment);
    mProgressBar = (ProgressBar) findViewById(R.id.tv_main_progress);

    // Set display parameters for the BrowseFragment
    mBrowseFragment.setHeadersState(BrowseFragment.HEADERS_ENABLED);
    mBrowseFragment.setTitle(getString(R.string.app_name));
    mBrowseFragment.setBadgeDrawable(getResources().getDrawable(R.drawable.icon));

    // add a listener for selected items
    mBrowseFragment.setOnItemViewClickedListener(this);
    mBrowseFragment.setOnItemViewSelectedListener(this);

    if (!Build.MANUFACTURER.equalsIgnoreCase("amazon")) { //Hide search for Amazon Fire TVs
        mBrowseFragment.setOnSearchClickedListener(this);
        // set search icon color
        mBrowseFragment.setSearchAffordanceColor(getResources().getColor(R.color.orange500));
    }
    mRootContainer = mBrowseFragment.getView();
}
 
開發者ID:xuie0000,項目名稱:vlc-android,代碼行數:36,代碼來源:MainTvActivity.java

示例6: onCreate

import android.support.v17.leanback.app.BrowseFragment; //導入方法依賴的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


注:本文中的android.support.v17.leanback.app.BrowseFragment.setHeadersState方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。