本文整理匯總了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);
}
示例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);
}
示例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);
}