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


Java ToolbarDefault類代碼示例

本文整理匯總了Java中com.blunderer.materialdesignlibrary.views.ToolbarDefault的典型用法代碼示例。如果您正苦於以下問題:Java ToolbarDefault類的具體用法?Java ToolbarDefault怎麽用?Java ToolbarDefault使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


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

示例1: onCreate

import com.blunderer.materialdesignlibrary.views.ToolbarDefault; //導入依賴的package包/類
public void onCreate(Bundle savedInstanceState, int contentView) {
    super.onCreate(savedInstanceState);

    setContentView(contentView);

    ActionBarHandler actionBarHandler = getActionBarHandler();
    if (actionBarHandler == null) mCustomToolbar = new ToolbarDefault(this);
    else mCustomToolbar = actionBarHandler.build();

    if (mCustomToolbar instanceof ToolbarSearch) {
        ToolbarSearch toolbarSearch = (ToolbarSearch) mCustomToolbar;
        toolbarSearch.setActivity(this);

        if (savedInstanceState != null) {
            toolbarSearch
                    .setConstraint(savedInstanceState.getString(TOOLBAR_SEARCH_CONSTRAINT_KEY));
            if (savedInstanceState.getBoolean(TOOLBAR_SEARCH_IS_SHOWN)) {
                toolbarSearch.showSearchBar();
            }
        }
    }

    ViewGroup rootView = (ViewGroup) ((ViewGroup) findViewById(android.R.id.content))
            .getChildAt(0);
    if (this instanceof NavigationDrawerActivity) rootView.addView(mCustomToolbar, 1);
    else rootView.addView(mCustomToolbar);

    mCustomToolbar.getToolbar()
            .setTitleTextColor(getResources().getColor(android.R.color.white));
    setSupportActionBar(mCustomToolbar.getToolbar());
    getSupportActionBar().setDisplayShowHomeEnabled(true);
}
 
開發者ID:alessandrogurgel,項目名稱:pedefacil,代碼行數:33,代碼來源:AActivity.java

示例2: onCreate

import com.blunderer.materialdesignlibrary.views.ToolbarDefault; //導入依賴的package包/類
public void onCreate(Bundle savedInstanceState, int contentView) {
    super.onCreate(savedInstanceState);

    setContentView(contentView);

    // Toolbar Shadow View
    mShadowView = findViewById(R.id.toolbar_shadow);
    if (mShadowView != null && (this instanceof ViewPagerWithTabsActivity)) {
        FrameLayout.LayoutParams params = (FrameLayout.LayoutParams) mShadowView
                .getLayoutParams();
        params.topMargin = (int) getResources()
                .getDimension(R.dimen.mdl_viewpager_with_tabs_height);
    }
    if (enableActionBarShadow()) showActionBarShadow();

    mActionBarHandler = getActionBarHandler();
    if (mActionBarHandler == null) mCustomToolbar = new ToolbarDefault(this);
    else mCustomToolbar = mActionBarHandler.build();

    // Toolbar Search
    if (mCustomToolbar instanceof ToolbarSearch) {
        ToolbarSearch toolbarSearch = (ToolbarSearch) mCustomToolbar;
        toolbarSearch.setActivity(this);

        if (savedInstanceState != null) {
            toolbarSearch
                    .setConstraint(savedInstanceState.getString(TOOLBAR_SEARCH_CONSTRAINT_KEY));
            if (savedInstanceState.getBoolean(TOOLBAR_SEARCH_IS_SHOWN)) {
                toolbarSearch.showSearchBar();
                hideActionBarShadow();
            }
        }
    }

    ViewGroup rootView = (ViewGroup) ((ViewGroup) findViewById(android.R.id.content))
            .getChildAt(0);
    if (this instanceof NavigationDrawerActivity) rootView.addView(mCustomToolbar, 1);
    else rootView.addView(mCustomToolbar);

    mCustomToolbar.getToolbar()
            .setTitleTextColor(getResources().getColor(android.R.color.white));
    setSupportActionBar(mCustomToolbar.getToolbar());
    if (getSupportActionBar() != null) getSupportActionBar().setDisplayShowHomeEnabled(true);
}
 
開發者ID:andreister,項目名稱:hasty,代碼行數:45,代碼來源:AActivity.java

示例3: build

import com.blunderer.materialdesignlibrary.views.ToolbarDefault; //導入依賴的package包/類
/**
 * Build the Toolbar to be the Default Toolbar.
 *
 * @return The Toolbar.
 */
@Override
public Toolbar build() {
    return new ToolbarDefault(mContext);
}
 
開發者ID:alessandrogurgel,項目名稱:pedefacil,代碼行數:10,代碼來源:ActionBarDefaultHandler.java


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