List of usage examples for android.app ActionBar setDisplayShowTitleEnabled
public abstract void setDisplayShowTitleEnabled(boolean showTitle);
From source file:it.polimi.spf.app.MainActivity.java
public void restoreActionBar() { ActionBar actionBar = getActionBar(); //actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD); actionBar.setDisplayShowTitleEnabled(true); actionBar.setTitle(mTitle);/*from w w w.j a v a2 s . co m*/ }
From source file:com.lugia.timetable.MasterActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_master); // Set up preferences value of this app if we run it on first time PreferenceManager.setDefaultValues(MasterActivity.this, R.xml.setting_preference, false); // Set up the action bar to show a dropdown list. final ActionBar actionBar = getActionBar(); actionBar.setDisplayShowTitleEnabled(false); actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST); mFilename = null;/*from w w w . j ava2s . c om*/ mTimeTableFragment = new TimeTableFragment(); mSubjectListFragment = new SubjectListFragment(); getSupportFragmentManager().beginTransaction().add(R.id.container, mTimeTableFragment, "TimeTable") .add(R.id.container, mSubjectListFragment, "SubjectList").hide(mSubjectListFragment).commit(); mSpinnerAdapter = new TimeTableSpinnerAdapter(MasterActivity.this, actionBar.getSelectedNavigationIndex()); mSpinnerAdapter.setViewType(NAV_DAY); // Set up the dropdown list navigation in the action bar. actionBar.setListNavigationCallbacks(mSpinnerAdapter, this); }
From source file:org.noorganization.shoppinglist.view.MainActivity.java
@Override public void onCreate(Bundle savedInstanceState) { m_presenter = ShoppingListPresenter.getInstance(this); if (m_presenter.needsToCreateAList()) { m_presenter.createList("Test List"); }//from www.j a v a 2 s .co m getWindow().requestFeature(Window.FEATURE_ACTION_BAR); super.onCreate(savedInstanceState); setContentView(R.layout.activity_shoppinglist); m_listSelector = new Spinner(this); m_listSelector.setAdapter(new ListSpinnerAdapter(m_presenter.getLists())); ActionBar actionBar = getActionBar(); actionBar.setDisplayShowTitleEnabled(false); actionBar.setDisplayShowCustomEnabled(true); actionBar.setCustomView(m_listSelector); updateListDropDown(); m_listSelector.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { @Override public void onItemSelected(AdapterView<?> _parent, View _view, int _position, long _selectedId) { m_presenter.selectList((int) _selectedId); // TODO refresh listfragments } @Override public void onNothingSelected(AdapterView<?> _parent) { } }); }
From source file:com.mastercard.masterpasswallet.fragments.NavigationDrawerFragment.java
/** * Per the navigation drawer design guidelines, updates the action bar to show the global app * 'context', rather than just what's in the current screen. *//*from w ww .j a v a 2s .c o m*/ private void showGlobalContextActionBar() { ActionBar actionBar = getActionBar(); actionBar.setDisplayShowTitleEnabled(true); actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD); }
From source file:com.witmob.nocollapsetabs.MainActivity.java
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); // Create the adapter that will return a fragment for each of the three primary sections // of the app. mAppSectionsPagerAdapter = new AppSectionsPagerAdapter(getSupportFragmentManager()); // Set up the action bar. final ActionBar actionBar = getActionBar(); actionBar.setDisplayShowHomeEnabled(false); actionBar.setDisplayShowTitleEnabled(false); // Specify that the Home/Up button should not be enabled, since there is no hierarchical // parent./*from w ww. j a v a 2 s . c om*/ actionBar.setHomeButtonEnabled(false); // Specify that we will be displaying tabs in the action bar. // Set up the ViewPager, attaching the adapter and setting up a listener for when the // user swipes between sections. mViewPager = (ViewPager) findViewById(R.id.pager); mViewPager.setAdapter(mAppSectionsPagerAdapter); mViewPager.setOnPageChangeListener(new ViewPager.SimpleOnPageChangeListener() { @Override public void onPageSelected(int position) { // When swiping between different app sections, select the corresponding tab. // We can also use ActionBar.Tab#select() to do this if we have a reference to the // Tab. actionBar.setSelectedNavigationItem(position); } }); // For each of the sections in the app, add a tab to the action bar. for (int i = 0; i < mAppSectionsPagerAdapter.getCount(); i++) { // Create a tab with text corresponding to the page title defined by the adapter. // Also specify this Activity object, which implements the TabListener interface, as the // listener for when this tab is selected. actionBar.addTab( actionBar.newTab().setText(mAppSectionsPagerAdapter.getPageTitle(i)).setTabListener(this)); } actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS); }
From source file:com.balch.android.app.framework.TemplateActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); application = (BaseApplication) this.getApplicationContext(); ActionBar actionBar = getActionBar(); actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD); actionBar.setDisplayShowTitleEnabled(true); setContentView(R.layout.template_view); this.navBar = (NavBar) findViewById(R.id.nav_bar_main); this.rootLayout = (LinearLayout) findViewById(R.id.template_layout); this.frameLayout = (FrameLayout) findViewById(R.id.template_place_holder); application.configureActivity(this, this.navBar, savedInstanceState); if (savedInstanceState == null) { }/*w w w . ja v a 2 s. com*/ getSupportFragmentManager().addOnBackStackChangedListener(new FragmentManager.OnBackStackChangedListener() { @Override public void onBackStackChanged() { int backStackCount = getSupportFragmentManager().getBackStackEntryCount(); if (backStackCount > 0) { int selectedIndex = Integer.parseInt( getSupportFragmentManager().getBackStackEntryAt(backStackCount - 1).getName()); if (selectedIndex != TemplateActivity.this.navBar.getSelectedIndex()) { TemplateActivity.this.navBar.setSelectedIndex(selectedIndex); } } else { // required b/c the first stack frame has an empty fragment finish(); } } }); this.navBar.completeConfiguration(); }
From source file:com.hkm.oc.wv.supportwebview.webviewSupports.java
protected void extra_action_bar_settings() { ActionBar ab = getActionBar(); ab.setDisplayShowTitleEnabled(false); ab.setIcon(null); }
From source file:com.tweetlanes.android.view.SearchActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { mSearchTerm = getIntent().getStringExtra("query"); if (mSearchTerm == null) { Uri data = getIntent().getData(); if (data != null) { mSearchTerm = data.toString().replace("com.tweetlanes.android.search://", ""); }//from w ww .ja v a 2 s . com } super.onCreate(savedInstanceState); // This could be true if loading back into the app from Multitasking if (mSearchTerm == null) { restartApp(); return; } ActionBar actionBar = getActionBar(); actionBar.setDisplayUseLogoEnabled(true); actionBar.setDisplayShowTitleEnabled(true); actionBar.setTitle(getString(R.string.action_bar_search_title) + " \"" + mSearchTerm + "\""); actionBar.setDisplayHomeAsUpEnabled(true); mViewSwitcher = (ViewSwitcher) findViewById(R.id.rootViewSwitcher); updateViewVisibility(); }
From source file:com.shafiq.mytwittle.view.SearchActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { mSearchTerm = getIntent().getStringExtra("query"); if (mSearchTerm == null) { Uri data = getIntent().getData(); if (data != null) { mSearchTerm = data.toString().replace("com.shafiq.mytwittle.search://", ""); }/*from ww w . j a v a2 s.com*/ } super.onCreate(savedInstanceState); // This could be true if loading back into the app from Multitasking if (mSearchTerm == null) { restartApp(); return; } ActionBar actionBar = getActionBar(); actionBar.setDisplayUseLogoEnabled(true); actionBar.setDisplayShowTitleEnabled(true); actionBar.setTitle(getString(R.string.action_bar_search_title) + " \"" + mSearchTerm + "\""); actionBar.setDisplayHomeAsUpEnabled(true); mViewSwitcher = (ViewSwitcher) findViewById(R.id.rootViewSwitcher); updateViewVisibility(); }
From source file:com.dirtyunicorns.hfm.MainActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Set up the ViewPager with the sections adapter. mViewPager = new ViewPager(this); mViewPager.setId(R.id.pager);/*from w w w .j a v a2 s . c om*/ setContentView(mViewPager); ActionBar actionbar = getActionBar(); actionbar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS); actionbar.setDisplayShowHomeEnabled(false); actionbar.setDisplayShowTitleEnabled(false); mTabsAdapter = new TabsAdapter(this, mViewPager); mTabsAdapter.addTab(actionbar.newTab().setText(R.string.title_section1), mainFragment.class, null); //mTabsAdapter.addTab(actionbar.newTab().setText(R.string.title_section2),customFragment.class, null); }