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


Java ActionBar.setDisplayOptions方法代码示例

本文整理汇总了Java中android.support.v7.app.ActionBar.setDisplayOptions方法的典型用法代码示例。如果您正苦于以下问题:Java ActionBar.setDisplayOptions方法的具体用法?Java ActionBar.setDisplayOptions怎么用?Java ActionBar.setDisplayOptions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.support.v7.app.ActionBar的用法示例。


在下文中一共展示了ActionBar.setDisplayOptions方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onResume

import android.support.v7.app.ActionBar; //导入方法依赖的package包/类
@Override
protected void onResume() {
    super.onResume();

    ActionBar actionBar = getSupportActionBar();

    if (actionBar != null && !resumed) {

        // add the custom view to the action bar
        actionBar.setCustomView(R.layout.search_actionbar);

        searchField = (EditText) actionBar.getCustomView().findViewById(R.id.searchField);
        searchField.addTextChangedListener(this);

        actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM | ActionBar.DISPLAY_SHOW_HOME);
        actionBar.setDisplayHomeAsUpEnabled(true);

        resumed = true;
    }
}
 
开发者ID:AbyxBelgium,项目名称:Loyalty,代码行数:21,代码来源:SearchResultsActivity.java

示例2: onCreate

import android.support.v7.app.ActionBar; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    mAdapter = new CheesesAdapter();

    final ListView listView = (ListView) findViewById(android.R.id.list);
    listView.setAdapter(mAdapter);

    final ActionBar actionBar = getSupportActionBar();
    actionBar.setCustomView(R.layout.search_view);
    actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);

    final EditText editText = (EditText) actionBar.getCustomView();
    editText.addTextChangedListener(mTextWatcher);
    editText.requestFocus();
}
 
开发者ID:cyrilmottier,项目名称:QueryHighlighter,代码行数:19,代码来源:MainActivity.java

示例3: onCreate

import android.support.v7.app.ActionBar; //导入方法依赖的package包/类
/**
 * On creation of the activity, set up the action bar title
 * and check that the user has granted permissions for reading
 * external storage.
 * @param savedInstanceState - Bundle
 */
@Override
final protected void onCreate(final Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);

  setContentView(R.layout.activity_main);
  mLayout = findViewById(R.id.coordinator_layout);

  final Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
  if (toolbar != null){
    final ActionBar actionBar = (this).getSupportActionBar();
    if (actionBar != null){

      actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM | ActionBar.DISPLAY_SHOW_HOME);
      actionBar.setTitle(R.string.title);
      actionBar.setCustomView(R.layout.logged_in_user);
    }
    toolbar.setNavigationIcon(null);
  }

}
 
开发者ID:Esri,项目名称:mapbook-android,代码行数:27,代码来源:MapbookActivity.java

示例4: onCreate

import android.support.v7.app.ActionBar; //导入方法依赖的package包/类
@Override
protected void onCreate(final Bundle savedInstanceState)
{
	super.onCreate(savedInstanceState);

	// widget
	this.widget = new Widget(this, this);

	// content view
	setContentView(R.layout.activity_treebolic);
	final ViewGroup container = findViewById(R.id.container);
	final LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT, 1.F);
	container.addView(this.widget, params);

	// toolbar
	final Toolbar toolbar = findViewById(R.id.toolbar);

	// action bar
	setSupportActionBar(toolbar);
	final ActionBar actionBar = getSupportActionBar();
	if (actionBar != null)
	{
		actionBar.setElevation(0);
		actionBar.setDisplayOptions(ActionBar.DISPLAY_USE_LOGO | ActionBar.DISPLAY_SHOW_TITLE | ActionBar.DISPLAY_SHOW_HOME | ActionBar.DISPLAY_HOME_AS_UP);
	}
}
 
开发者ID:1313ou,项目名称:Treebolic,代码行数:27,代码来源:TreebolicBasicActivity.java

示例5: onCreate

import android.support.v7.app.ActionBar; //导入方法依赖的package包/类
@Override
protected void onCreate(final Bundle savedInstanceState)
{
	super.onCreate(savedInstanceState);

	// layout
	setContentView(R.layout.activity_services);

	// toolbar
	final Toolbar toolbar = findViewById(R.id.toolbar);
	setSupportActionBar(toolbar);

	// set up the action bar
	final ActionBar actionBar = getSupportActionBar();
	if (actionBar != null)
	{
		actionBar.setDisplayOptions(ActionBar.DISPLAY_USE_LOGO | ActionBar.DISPLAY_SHOW_TITLE | ActionBar.DISPLAY_SHOW_HOME | ActionBar.DISPLAY_HOME_AS_UP);
	}

	// adapter
	final SimpleAdapter adapter = Services.makeAdapter(this, R.layout.item_services, from, to, true);
	final ListView listView = findViewById(R.id.services);
	listView.setAdapter(adapter);
}
 
开发者ID:1313ou,项目名称:Treebolic,代码行数:25,代码来源:ServicesActivity.java

示例6: onCreate

import android.support.v7.app.ActionBar; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Override
protected void onCreate(final Bundle savedInstanceState)
{
	// super
	super.onCreate(savedInstanceState);

	// toolbar
	setupToolbar(R.layout.toolbar, R.id.toolbar);

	// set up the action bar
	final ActionBar actionBar = getSupportActionBar();
	if (actionBar != null)
	{
		actionBar.setDisplayOptions(ActionBar.DISPLAY_USE_LOGO | ActionBar.DISPLAY_SHOW_TITLE | ActionBar.DISPLAY_SHOW_HOME | ActionBar.DISPLAY_HOME_AS_UP);
	}

	// read args
	final String action = getIntent().getAction();
	if (action == null)
	{
		SettingsActivity.provider = (HashMap<String, Object>) getIntent().getSerializableExtra(SettingsActivity.ARG_PROVIDER_SELECTED);
	}
}
 
开发者ID:1313ou,项目名称:Treebolic,代码行数:25,代码来源:SettingsActivity.java

示例7: onCreate

import android.support.v7.app.ActionBar; //导入方法依赖的package包/类
@Override
protected void onCreate(final Bundle savedInstanceState)
{
	super.onCreate(savedInstanceState);

	// layout
	setContentView(R.layout.activity_providers);

	// toolbar
	final Toolbar toolbar = findViewById(R.id.toolbar);
	setSupportActionBar(toolbar);

	// set up the action bar
	final ActionBar actionBar = getSupportActionBar();
	if (actionBar != null)
	{
		actionBar.setDisplayOptions(ActionBar.DISPLAY_USE_LOGO | ActionBar.DISPLAY_SHOW_TITLE | ActionBar.DISPLAY_SHOW_HOME | ActionBar.DISPLAY_HOME_AS_UP);
	}

	// adapter
	final BaseAdapter adapter = Providers.makeAdapter(this, R.layout.item_providers, from, to, true);
	final ListView listView = findViewById(R.id.providers);
	listView.setAdapter(adapter);
}
 
开发者ID:1313ou,项目名称:Treebolic,代码行数:25,代码来源:ProvidersActivity.java

示例8: onCreate

import android.support.v7.app.ActionBar; //导入方法依赖的package包/类
@Override
protected void onCreate(final Bundle savedInstanceState)
{
	// super
	super.onCreate(savedInstanceState);

	// toolbar
	setupToolbar(R.layout.toolbar, R.id.toolbar);

	// set up the action bar
	final ActionBar actionBar = getSupportActionBar();
	if (actionBar != null)
	{
		actionBar.setDisplayOptions(ActionBar.DISPLAY_USE_LOGO | ActionBar.DISPLAY_SHOW_TITLE | ActionBar.DISPLAY_SHOW_HOME | ActionBar.DISPLAY_HOME_AS_UP);
	}
}
 
开发者ID:1313ou,项目名称:TreebolicPlugins,代码行数:17,代码来源:SettingsActivity.java

示例9: initActionBar

import android.support.v7.app.ActionBar; //导入方法依赖的package包/类
protected void initActionBar(ActionBar actionBar) {
    if (actionBar == null)
        return;
    if (hasBackButton()) {
        mActionBar.setDisplayHomeAsUpEnabled(true);
        mActionBar.setHomeButtonEnabled(true);
    } else {
        actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_TITLE);
        actionBar.setDisplayUseLogoEnabled(false);
        int titleRes = getActionBarTitle();
        if (titleRes != 0) {
            actionBar.setTitle(titleRes);
        }
    }
}
 
开发者ID:hsj-xiaokang,项目名称:OSchina_resources_android,代码行数:16,代码来源:BaseActivity.java

示例10: onCreate

import android.support.v7.app.ActionBar; //导入方法依赖的package包/类
@Override
protected void onCreate(final Bundle savedInstanceState)
{
	super.onCreate(savedInstanceState);

	// widget
	this.widget = new Widget(this, this);

	// content view
	setContentView(R.layout.activity_treebolic);
	final ViewGroup container = findViewById(R.id.container);
	container.addView(this.widget);

	// toolbar
	final Toolbar toolbar = findViewById(R.id.toolbar);

	// action bar
	setSupportActionBar(toolbar);
	final ActionBar actionBar = getSupportActionBar();
	if (actionBar != null)
	{
		actionBar.setElevation(0);
		actionBar.setDisplayOptions(ActionBar.DISPLAY_USE_LOGO | ActionBar.DISPLAY_SHOW_TITLE | ActionBar.DISPLAY_SHOW_HOME | ActionBar.DISPLAY_HOME_AS_UP);
	}

	// init widget with model is asynchronous
}
 
开发者ID:1313ou,项目名称:Treebolic,代码行数:28,代码来源:TreebolicClientActivity.java

示例11: onCreate

import android.support.v7.app.ActionBar; //导入方法依赖的package包/类
@Override
protected void onCreate(@Nullable final Bundle savedInstanceState)
{
	super.onCreate(savedInstanceState);

	// layout
	setContentView(R.layout.activity_main);

	// toolbar
	final Toolbar toolbar = findViewById(org.treebolic.download.R.id.toolbar);
	setSupportActionBar(toolbar);

	// set up the action bar
	final ActionBar actionBar = getSupportActionBar();
	if (actionBar != null)
	{
		actionBar.setDisplayOptions(ActionBar.DISPLAY_USE_LOGO | ActionBar.DISPLAY_SHOW_TITLE);
	}

	// initialize
	initialize();

	// check
	Checker.check(this);

	// fragment
	if (savedInstanceState == null)
	{
		PlaceholderFragment fragment = new PlaceholderFragment();
		getSupportFragmentManager().beginTransaction().add(R.id.container, fragment).commit();
	}
}
 
开发者ID:1313ou,项目名称:TreebolicPlugins,代码行数:33,代码来源:MainActivity.java

示例12: onCreate

import android.support.v7.app.ActionBar; //导入方法依赖的package包/类
@Override
protected void onCreate(@Nullable final Bundle savedInstanceState)
{
	super.onCreate(savedInstanceState);

	// layout
	setContentView(R.layout.activity_main);

	// toolbar
	final Toolbar toolbar = findViewById(R.id.toolbar);
	setSupportActionBar(toolbar);

	// set up the action bar
	final ActionBar actionBar = getSupportActionBar();
	if (actionBar != null)
	{
		actionBar.setDisplayOptions(ActionBar.DISPLAY_USE_LOGO | ActionBar.DISPLAY_SHOW_TITLE);
	}

	// initialize
	initialize();

	// check
	Checker.check(this);

	// fragment
	if (savedInstanceState == null)
	{
		PlaceholderFragment fragment = new PlaceholderFragment();
		getSupportFragmentManager().beginTransaction().add(R.id.container, fragment).commit();
	}
}
 
开发者ID:1313ou,项目名称:TreebolicPlugins,代码行数:33,代码来源:MainActivity.java


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