当前位置: 首页>>代码示例>>Java>>正文


Java ActionBar.setDisplayShowTitleEnabled方法代码示例

本文整理汇总了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();
        }
    });
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:20,代码来源:BaseActivity.java

示例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));
}
 
开发者ID:zhao-mingjian,项目名称:qvod,代码行数:20,代码来源:BaseTitleActivity.java

示例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);
}
 
开发者ID:StableChen,项目名称:easynote,代码行数:20,代码来源:SettingsActivity.java

示例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);
    }
}
 
开发者ID:BrandonVargas,项目名称:AndroidOCRFforID,代码行数:28,代码来源:UCropActivity.java

示例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();
        }
    });
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:23,代码来源:SlideShadeViewActivity.java

示例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);
  }
}
 
开发者ID:Elias33,项目名称:Quran,代码行数:12,代码来源:PagerActivity.java

示例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;
        }
    });
}
 
开发者ID:joelan,项目名称:ClouldReader,代码行数:36,代码来源:BaseHeaderActivity.java

示例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);
    }
 
开发者ID:Vinetos,项目名称:Hello-Music-droid,代码行数:9,代码来源:ArtistDetailFragment.java

示例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);
        }
    }
}
 
开发者ID:guiying712,项目名称:AndroidModulePattern,代码行数:20,代码来源:BaseActivity.java

示例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());
}
 
开发者ID:mvescovo,项目名称:item-reaper,代码行数:11,代码来源:ItemsActivity.java

示例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);
  }
}
 
开发者ID:Elias33,项目名称:Quran,代码行数:37,代码来源:PagerActivity.java

示例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();
}
 
开发者ID:mvescovo,项目名称:item-reaper,代码行数:31,代码来源:AuthActivity.java

示例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());
    }
}
 
开发者ID:Axe-Ishmael,项目名称:Blockly,代码行数:13,代码来源:AbstractBlocklyActivity.java

示例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;
}
 
开发者ID:rafjordao,项目名称:Nird2,代码行数:21,代码来源:BriarActivity.java

示例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);
        }

    }
 
开发者ID:adib2149,项目名称:FormMaster,代码行数:12,代码来源:FormListenerActivity.java


注:本文中的android.support.v7.app.ActionBar.setDisplayShowTitleEnabled方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。