當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。