本文整理汇总了Java中android.support.v7.app.ActionBar.setDisplayShowTitleEnabled方法的典型用法代码示例。如果您正苦于以下问题:Java ActionBar.setDisplayShowTitleEnabled方法的具体用法?Java ActionBar.setDisplayShowTitleEnabled怎么用?Java ActionBar.setDisplayShowTitleEnabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.support.v7.app.ActionBar
的用法示例。
在下文中一共展示了ActionBar.setDisplayShowTitleEnabled方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setToolBar
import android.support.v7.app.ActionBar; //导入方法依赖的package包/类
/**
* 设置titlebar
*/
protected void setToolBar() {
setSupportActionBar(mBaseBinding.toolBar);
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
//去除默认Title显示
actionBar.setDisplayShowTitleEnabled(false);
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setHomeAsUpIndicator(R.drawable.icon_back);
}
mBaseBinding.toolBar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onBackPressed();
}
});
}
示例2: setContentView
import android.support.v7.app.ActionBar; //导入方法依赖的package包/类
@Override
public void setContentView(int layoutResID) {
super.setContentView(R.layout.activity_top);
//
llTitleMenu = $(R.id.ll_title_menu);
llTitleMenu.setOnClickListener(this);
toolbar = $(R.id.toolbar);
svContent = $(R.id.sv_content);
getLayoutInflater().inflate(layoutResID, svContent);
//ActionBar
setSupportActionBar(toolbar);
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
//去除默认Title显示
actionBar.setDisplayShowTitleEnabled(false);
}
//
StatusBarUtil.setColor(this,ContextCompat.getColor(this, R.color.colorTheme));
}
示例3: initView
import android.support.v7.app.ActionBar; //导入方法依赖的package包/类
private void initView() {
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
View sortOrder = findViewById(R.id.sort_order);
View chooseDefaultImage = findViewById(R.id.choose_default_image);
View secretNotePassword = findViewById(R.id.secret_note_password);
View about = findViewById(R.id.about);
setSupportActionBar(toolbar);
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setDisplayShowTitleEnabled(false);
}
sortOrder.setOnClickListener(this);
chooseDefaultImage.setOnClickListener(this);
secretNotePassword.setOnClickListener(this);
about.setOnClickListener(this);
}
示例4: setupAppBar
import android.support.v7.app.ActionBar; //导入方法依赖的package包/类
/**
* Configures and styles both status bar and toolbar.
*/
private void setupAppBar() {
setStatusBarColor(mStatusBarColor);
final Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
// Set all of the Toolbar coloring
toolbar.setBackgroundColor(mToolbarColor);
toolbar.setTitleTextColor(mToolbarWidgetColor);
/*final TextView toolbarTitle = (TextView) toolbar.findViewById(R.id.toolbar_title);
toolbarTitle.setTextColor(mToolbarWidgetColor);
toolbarTitle.setText(mToolbarTitle);*/
// Color buttons inside the Toolbar
Drawable stateButtonDrawable = ContextCompat.getDrawable(this, R.drawable.ucrop_ic_cross).mutate();
stateButtonDrawable.setColorFilter(mToolbarWidgetColor, PorterDuff.Mode.SRC_ATOP);
toolbar.setNavigationIcon(stateButtonDrawable);
setSupportActionBar(toolbar);
final ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
actionBar.setDisplayShowTitleEnabled(false);
}
}
示例5: setTitleBar
import android.support.v7.app.ActionBar; //导入方法依赖的package包/类
private void setTitleBar() {
setSupportActionBar(binding.titleToolBar);
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
//去除默认Title显示
actionBar.setDisplayShowTitleEnabled(false);
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setHomeAsUpIndicator(R.drawable.icon_back);
}
// title
binding.tvTitle.setText(subjectsBean.getTitle());
// 副标题
binding.tvSubtitle.setText("主演:" + StringFormatUtil.formatName(subjectsBean.getCasts()));
binding.titleToolBar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onBackPressed();
}
});
}
示例6: updateActionBarTitle
import android.support.v7.app.ActionBar; //导入方法依赖的package包/类
private void updateActionBarTitle(int page) {
String sura = QuranInfo.getSuraNameFromPage(this, page, true);
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
translationsSpinner.setVisibility(View.GONE);
actionBar.setDisplayShowTitleEnabled(true);
actionBar.setTitle(sura);
String desc = QuranInfo.getPageSubtitle(this, page);
actionBar.setSubtitle(desc);
}
}
示例7: setToolBar
import android.support.v7.app.ActionBar; //导入方法依赖的package包/类
/**
* 设置toolbar
*/
protected void setToolBar() {
setSupportActionBar(bindingTitleView.tbBaseTitle);
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
//去除默认Title显示
actionBar.setDisplayShowTitleEnabled(false);
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setHomeAsUpIndicator(R.drawable.icon_back);
}
// 手动设置才有效果
bindingTitleView.tbBaseTitle.setTitleTextAppearance(this, R.style.ToolBar_Title);
bindingTitleView.tbBaseTitle.setSubtitleTextAppearance(this, R.style.Toolbar_SubTitle);
bindingTitleView.tbBaseTitle.inflateMenu(R.menu.base_header_menu);
bindingTitleView.tbBaseTitle.setOverflowIcon(ContextCompat.getDrawable(this, R.drawable.actionbar_more));
bindingTitleView.tbBaseTitle.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onBackPressed();
}
});
bindingTitleView.tbBaseTitle.setOnMenuItemClickListener(new Toolbar.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
switch (item.getItemId()) {
case R.id.actionbar_more:// 更多信息
setTitleClickMore();
break;
}
return false;
}
});
}
示例8: setupToolbar
import android.support.v7.app.ActionBar; //导入方法依赖的package包/类
private void setupToolbar() {
((AppCompatActivity) getActivity()).setSupportActionBar(toolbar);
final ActionBar ab = ((AppCompatActivity) getActivity()).getSupportActionBar();
ab.setDisplayShowTitleEnabled(false);
ab.setDisplayHomeAsUpEnabled(true);
}
示例9: setupToolBar
import android.support.v7.app.ActionBar; //导入方法依赖的package包/类
/**
* Setup the toolbar.
*
* @param toolbar toolbar
* @param hideTitle 是否隐藏Title
*/
protected void setupToolBar(Toolbar toolbar, boolean hideTitle) {
setSupportActionBar(toolbar);
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
actionBar.setHomeAsUpIndicator(R.drawable.ic_arrow_back);
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setDisplayShowHomeEnabled(true);
if (hideTitle) {
//隐藏Title
actionBar.setDisplayShowTitleEnabled(false);
}
}
}
示例10: onDialogDismissed
import android.support.v7.app.ActionBar; //导入方法依赖的package包/类
@Override
public void onDialogDismissed() {
mDialogOpen = false;
setSupportActionBar(mToolbar);
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
actionBar.setDisplayShowTitleEnabled(false);
}
onCreateOptionsMenu(mToolbar.getMenu());
}
示例11: updateActionBarSpinner
import android.support.v7.app.ActionBar; //导入方法依赖的package包/类
private void updateActionBarSpinner() {
if (translationItems == null || translationItems.length == 0) {
int page = getCurrentPage();
updateActionBarTitle(page);
return;
}
if (translationsSpinnerAdapter == null) {
translationsSpinnerAdapter = new TranslationsSpinnerAdapter(this,
R.layout.translation_ab_spinner_item, translationItems, translations,
quranSettings.getActiveTranslations(),
translationItemChangedListener) {
@NonNull
@Override
public View getView(int position, View convertView, @NonNull ViewGroup parent) {
convertView = super.getView(position, convertView, parent);
SpinnerHolder holder = (SpinnerHolder) convertView.getTag();
int page = getCurrentPage();
String sura = QuranInfo.getSuraNameFromPage(PagerActivity.this, page, true);
holder.title.setText(sura);
String desc = QuranInfo.getPageSubtitle(PagerActivity.this, page);
holder.subtitle.setText(desc);
holder.subtitle.setVisibility(View.VISIBLE);
return convertView;
}
};
translationsSpinner.setAdapter(translationsSpinnerAdapter);
}
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
actionBar.setDisplayShowTitleEnabled(false);
translationsSpinner.setVisibility(View.VISIBLE);
}
}
示例12: onCreate
import android.support.v7.app.ActionBar; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_auth);
ButterKnife.bind(this);
setSupportActionBar(mToolbar);
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
actionBar.setDisplayShowTitleEnabled(false);
}
Typeface appbarTitle = Typeface.createFromAsset(getAssets(), "Nosifer-Regular.ttf");
mAppbarTitle.setTypeface(appbarTitle);
// Create the View
AuthFragment authFragment = (AuthFragment) getSupportFragmentManager()
.findFragmentById(R.id.contentFrame);
if (authFragment == null) {
authFragment = AuthFragment.newInstance();
initFragment(authFragment);
}
// Create the Presenter which does the following:
// Sets authFragment as the View for authPresenter.
// Sets authPresenter as the presenter for authFragment.
AuthComponent authComponent = DaggerAuthComponent.builder()
.authModule(new AuthModule(authFragment))
.applicationComponent(((ItemReaperApplication)getApplication()).getApplicationComponent())
.build();
authComponent.getAuthPresenter();
}
示例13: restoreActionBar
import android.support.v7.app.ActionBar; //导入方法依赖的package包/类
/**
* Restores the {@link ActionBar} contents when the navigation window closes, per <a
* href="http://developer.android.com/design/material/index.html">Material design
* guidelines</a>.
*/
protected void restoreActionBar() {
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
actionBar.setDisplayShowTitleEnabled(true);
actionBar.setTitle(getWorkspaceTitle());
}
}
示例14: setUpCustomToolbar
import android.support.v7.app.ActionBar; //导入方法依赖的package包/类
/**
* This should be called after the content view has been added in onCreate()
*
* @param ownLayout true if the custom toolbar brings its own layout
* @return the Toolbar object or null if content view did not contain one
*/
@Nullable
protected Toolbar setUpCustomToolbar(boolean ownLayout) {
// Custom Toolbar
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
ActionBar ab = getSupportActionBar();
if (ab != null) {
ab.setDisplayShowHomeEnabled(true);
ab.setDisplayHomeAsUpEnabled(true);
ab.setDisplayShowCustomEnabled(ownLayout);
ab.setDisplayShowTitleEnabled(!ownLayout);
}
return toolbar;
}
示例15: setupToolBar
import android.support.v7.app.ActionBar; //导入方法依赖的package包/类
private void setupToolBar() {
final ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
actionBar.setDisplayShowTitleEnabled(false);
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setHomeButtonEnabled(true);
}
}