本文整理汇总了Java中android.support.v7.widget.Toolbar.setTitleTextAppearance方法的典型用法代码示例。如果您正苦于以下问题:Java Toolbar.setTitleTextAppearance方法的具体用法?Java Toolbar.setTitleTextAppearance怎么用?Java Toolbar.setTitleTextAppearance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.support.v7.widget.Toolbar
的用法示例。
在下文中一共展示了Toolbar.setTitleTextAppearance方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import android.support.v7.widget.Toolbar; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// The server should not be doing anything or occupying any (noticeable) resources
// until we actually ask it to enable swapping. Therefore, we will start it nice and
// early so we don't have to wait until it is connected later.
Intent service = new Intent(this, SwapService.class);
if (bindService(service, serviceConnection, Context.BIND_AUTO_CREATE)) {
startService(service);
}
setContentView(R.layout.swap_activity);
toolbar = (Toolbar) findViewById(R.id.toolbar);
toolbar.setTitleTextAppearance(getApplicationContext(), R.style.SwapTheme_Wizard_Text_Toolbar);
setSupportActionBar(toolbar);
container = (ViewGroup) findViewById(R.id.fragment_container);
localBroadcastManager = LocalBroadcastManager.getInstance(this);
new SwapDebug().logStatus();
}
示例2: onCreate
import android.support.v7.widget.Toolbar; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if(Utils.hasKitKat() && !Utils.hasLollipop()){
setTheme(R.style.Theme_Document_Translucent);
}
setContentView(R.layout.activity_about);
Toolbar mToolbar = (Toolbar) findViewById(R.id.toolbar);
mToolbar.setTitleTextAppearance(this, R.style.TextAppearance_AppCompat_Widget_ActionBar_Title);
if(Utils.hasKitKat() && !Utils.hasLollipop()) {
//((LinearLayout.LayoutParams) mToolbar.getLayoutParams()).setMargins(0, getStatusBarHeight(this), 0, 0);
mToolbar.setPadding(0, getStatusBarHeight(this), 0, 0);
}
int color = SettingsActivity.getPrimaryColor();
mToolbar.setBackgroundColor(color);
setSupportActionBar(mToolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setTitle(null);
setUpDefaultStatusBar();
initControls();
}
示例3: initToolBar
import android.support.v7.widget.Toolbar; //导入方法依赖的package包/类
protected void initToolBar() {
mToolbar = (Toolbar) findViewById(R.id.toolbar);
mToolBarButton = (TextView) findViewById(R.id.toolbar_button);
if (mToolbar != null) {
mToolbar.setTitleTextAppearance(this, R.style.ToolbarTitleAppearance);
mToolbar.setTitle(getToolbarTitle());
mToolbar.setNavigationIcon(R.drawable.ic_arrow_left_navbar);
mToolbar.setNavigationOnClickListener(this);
mToolbar.setSubtitleTextAppearance(this, R.style.ToolbarSubTitleAppearance);
mToolbar.setSubtitleTextColor(getResources().getColor(R.color.label_grey));
if(getToolBarMenu() != 0){
mToolbar.inflateMenu(getToolBarMenu());
}
mToolbar.setTitleTextColor(getResources().getColor(R.color.white));
}
}
示例4: initToolBar
import android.support.v7.widget.Toolbar; //导入方法依赖的package包/类
/**
* 初始化ToolBar
*/
public void initToolBar() {
toolbar = (Toolbar) findViewById(R.id.tb_toolbar);
if (toolbar != null) {
// toolbar.setLogo(R.mipmap.ic_top);
toolbar.setBackgroundColor(getResources().getColor(R.color.theme_color));
toolbar.setTitleTextAppearance(this, R.style.ToolBarTitleTextApperance);
setSupportActionBar(toolbar);
}
}
示例5: initToolBar
import android.support.v7.widget.Toolbar; //导入方法依赖的package包/类
private void initToolBar(Toolbar toolbarDoubanDetail, String title) {
setSupportActionBar(toolbarDoubanDetail);
toolbarDoubanDetail.setTitle(title);
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
//去除默认Title显示
actionBar.setDisplayShowTitleEnabled(false);
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setHomeAsUpIndicator(R.mipmap.icon_back);
}
toolbarDoubanDetail.setTitleTextColor(Color.WHITE);
toolbarDoubanDetail.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
onBackPressed();
}
});
toolbarDoubanDetail.setTitleTextAppearance(this, R.style.ToolBar_Title);
toolbarDoubanDetail.setSubtitleTextAppearance(this, R.style.Toolbar_SubTitle);
toolbarDoubanDetail.inflateMenu(R.menu.base_header_menu);
toolbarDoubanDetail.setOverflowIcon(getDrawable(R.mipmap.actionbar_more));
toolbarDoubanDetail.setOnMenuItemClickListener(new Toolbar.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
switch (item.getItemId()) {
case R.id.actionbar_more:// 更多信息
setTitleClickMore();
break;
}
return true;
}
});
}
示例6: onCreate
import android.support.v7.widget.Toolbar; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle icicle) {
if(Utils.hasLollipop()){
getWindow().addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
}
else if(Utils.hasKitKat()){
setTheme(R.style.Theme_Document_Translucent);
}
setUpStatusBar();
// Debug.waitForDebugger();
super.onCreate(icicle);
mRoots = DocumentsApplication.getRootsCache(this);
setResult(Activity.RESULT_CANCELED);
setContentView(R.layout.activity);
final Context context = this;
final Resources res = getResources();
// Strongly define our horizontal dimension; we leave vertical as
final WindowManager.LayoutParams a = getWindow().getAttributes();
final Point size = new Point();
getWindowManager().getDefaultDisplay().getSize(size);
// a.width = (int) res.getFraction(R.dimen.dialog_width, size.x, size.x);
getWindow().setAttributes(a);
mDirectoryContainer = (DirectoryContainerView) findViewById(R.id.container_directory);
if (icicle != null) {
mState = icicle.getParcelable(EXTRA_STATE);
} else {
buildDefaultState();
}
mToolbar = (Toolbar) findViewById(R.id.toolbar);
mToolbar.setTitleTextAppearance(context,
android.R.style.TextAppearance_DeviceDefault_Widget_ActionBar_Title);
mToolbarStack = (Spinner) findViewById(R.id.stack);
mToolbarStack.setOnItemSelectedListener(mStackListener);
mRootsToolbar = (Toolbar) findViewById(R.id.roots_toolbar);
if (mRootsToolbar != null) {
mRootsToolbar.setTitleTextAppearance(context,
android.R.style.TextAppearance_DeviceDefault_Widget_ActionBar_Title);
}
setSupportActionBar(mToolbar);
RootsFragment.show(getFragmentManager(), null);
if (!mState.restored) {
new RestoreStackTask().execute();
} else {
onCurrentDirectoryChanged(ANIM_NONE);
}
}