Example usage for android.app ActionBar DISPLAY_SHOW_TITLE

List of usage examples for android.app ActionBar DISPLAY_SHOW_TITLE

Introduction

In this page you can find the example usage for android.app ActionBar DISPLAY_SHOW_TITLE.

Prototype

int DISPLAY_SHOW_TITLE

To view the source code for android.app ActionBar DISPLAY_SHOW_TITLE.

Click Source Link

Document

Show the activity title and subtitle, if present.

Usage

From source file:com.example.android.supportv13.app.ActionBarTabsPager.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    mViewPager = new ViewPager(this);
    mViewPager.setId(R.id.pager);//  ww w  .  j  a v a2  s  .co  m
    setContentView(mViewPager);

    final ActionBar bar = getActionBar();
    bar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
    bar.setDisplayOptions(0, ActionBar.DISPLAY_SHOW_TITLE);

    mTabsAdapter = new TabsAdapter(this, mViewPager);
    mTabsAdapter.addTab(bar.newTab().setText("Simple"), CountingFragment.class, null);
    mTabsAdapter.addTab(bar.newTab().setText("List"), FragmentPagerSupport.ArrayListFragment.class, null);
    mTabsAdapter.addTab(bar.newTab().setText("Cursor"), CursorFragment.class, null);

    if (savedInstanceState != null) {
        bar.setSelectedNavigationItem(savedInstanceState.getInt("tab", 0));
    }
}

From source file:com.vandalsoftware.filter.PhotoPagerActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    final ViewPager viewPager = new ViewPager(this);
    viewPager.setId(R.id.pager);/*  w ww.  j  a  va2s.c o m*/
    viewPager.setPageMargin((int) (getResources().getDisplayMetrics().density * 10));
    setContentView(viewPager);
    setTitle(R.string.app_name);

    final ActionBar bar = getActionBar();
    bar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
    bar.setDisplayOptions(0, ActionBar.DISPLAY_SHOW_TITLE);

    final TabsAdapter tabsAdapter = new TabsAdapter(this, viewPager);
    Bundle bundle;

    bundle = Bundle.EMPTY;
    tabsAdapter.addTab(bar.newTab().setText(R.string.no_filter), PhotoFragment.class, bundle);

    bundle = new Bundle();
    bundle.putInt(PhotoFragment.ARG_FILTER, PhotoFragment.FILTER_BW);
    tabsAdapter.addTab(bar.newTab().setText(R.string.bw_filter), PhotoFragment.class, bundle);

    bundle = new Bundle();
    bundle.putInt(PhotoFragment.ARG_FILTER, PhotoFragment.FILTER_CHILL);
    tabsAdapter.addTab(bar.newTab().setText(R.string.chill_filter), PhotoFragment.class, bundle);

    bundle = new Bundle();
    bundle.putInt(PhotoFragment.ARG_FILTER, PhotoFragment.FILTER_ROSE);
    tabsAdapter.addTab(bar.newTab().setText(R.string.rose_filter), PhotoFragment.class, bundle);

    bundle = new Bundle();
    bundle.putInt(PhotoFragment.ARG_FILTER, PhotoFragment.FILTER_INVERT);
    tabsAdapter.addTab(bar.newTab().setText(R.string.invert_filter), PhotoFragment.class, bundle);

    if (savedInstanceState != null) {
        bar.setSelectedNavigationItem(savedInstanceState.getInt("tab", 0));
    }
}

From source file:com.commonsware.android.feedfrags.FeedsNavActivity.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main_nav);/*from  w ww  .j  a v a2  s. c  om*/

    ActionBar bar = getActionBar();

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
        adapter = new ArrayAdapter<Feed>(bar.getThemedContext(), R.layout.row, Feed.getFeeds());
    } else {
        adapter = new ArrayAdapter<Feed>(this, R.layout.row, Feed.getFeeds());
    }

    bar.setListNavigationCallbacks(adapter, new NavListener());
    bar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
    bar.setDisplayOptions(ActionBar.DISPLAY_SHOW_TITLE, ActionBar.DISPLAY_SHOW_TITLE);
    bar.setDisplayHomeAsUpEnabled(true);
}

From source file:com.yuya.routerecorder.FragmentTabs.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    instance = this;

    final ActionBar bar = getActionBar();
    bar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
    bar.setDisplayOptions(0, ActionBar.DISPLAY_SHOW_TITLE);
    //bar.setDisplayShowCustomEnabled(true);

    //bar.setDisplayShowTitleEnabled(false);
    //bar.setDisplayShowHomeEnabled(false);
    bar.setDisplayShowCustomEnabled(false);

    bar.addTab(bar.newTab().setIcon(R.drawable.world_white)
            .setTabListener(new TabListener<RouteMapFragment>(this, "Show Map", RouteMapFragment.class)));

    bar.addTab(bar.newTab().setIcon(R.drawable.pen_white_frame)
            .setTabListener(new TabListener<AddRouteFragment>(this, "Add Trip", AddRouteFragment.class)));

    bar.addTab(bar.newTab().setIcon(R.drawable.list_new)
            .setTabListener(new TabListener<MyListFragment>(this, "Show List", MyListFragment.class)));

    if (savedInstanceState != null) {
        bar.setSelectedNavigationItem(savedInstanceState.getInt("tab", 0));
    }//  w w  w .  jav a 2 s.  c  o  m

    //FragmentManager manager = getSupportFragmentManager();
    //fragmentA = (RouteMapFragment) manager.findFragmentById(R.id.map);
    //fragmentB = (AddRouteFragment) manager.findFragmentById(R.id.fragment_container);

}

From source file:com.example.routerecorder.FragmentTabs.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    instance = this;

    final ActionBar bar = getActionBar();
    bar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
    bar.setDisplayOptions(0, ActionBar.DISPLAY_SHOW_TITLE);
    //bar.setDisplayShowCustomEnabled(true);

    //bar.setDisplayShowTitleEnabled(false);
    //bar.setDisplayShowHomeEnabled(false);
    bar.setDisplayShowCustomEnabled(false);

    bar.addTab(bar.newTab().setText("Show Map")
            .setTabListener(new TabListener<RouteMapFragment>(this, "Show Map", RouteMapFragment.class)));

    bar.addTab(bar.newTab().setText("Add Trip")
            .setTabListener(new TabListener<AddRouteFragment>(this, "Add Trip", AddRouteFragment.class)));

    bar.addTab(bar.newTab().setText("Show List")
            .setTabListener(new TabListener<MyListFragment>(this, "Show List", MyListFragment.class)));

    if (savedInstanceState != null) {
        bar.setSelectedNavigationItem(savedInstanceState.getInt("tab", 0));
    }/*  w w w  .  j  a  v  a2 s.c  o m*/

    //FragmentManager manager = getSupportFragmentManager();
    //fragmentA = (RouteMapFragment) manager.findFragmentById(R.id.map);
    //fragmentB = (AddRouteFragment) manager.findFragmentById(R.id.fragment_container);

}

From source file:com.little.ibooks.file.FileExplorerTabActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.file_fragment_pager);
    mViewPager = (ViewPager) findViewById(R.id.pager);

    final ActionBar bar = getActionBar();
    bar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
    bar.setDisplayOptions(0, ActionBar.DISPLAY_SHOW_TITLE | ActionBar.DISPLAY_SHOW_HOME);

    mTabsAdapter = new TabsAdapter(this, mViewPager);
    mTabsAdapter.addTab(bar.newTab().setText(R.string.tab_sd), FileViewActivity.class, null);
    mTabsAdapter.addTab(bar.newTab().setText(R.string.tab_remote), ServerControlActivity.class, null);
    if (savedInstanceState != null) {
        bar.setSelectedNavigationItem(savedInstanceState.getInt(INSTANCESTATE_TAB, 0));
    }// www .j  a  v  a 2s . c  o  m

    // ?"WIFI"
    Intent intent = getIntent();
    if (intent != null) {
        String fileMode = intent.getStringExtra("mode");
        if (fileMode != null && "wifi".equals(fileMode)) {
            mViewPager.setCurrentItem(1);
        }
    }

}

From source file:com.geenk.fileexplorer.FileExplorerTabActivity.java

protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_ACTION_BAR);

    setContentView(R.layout.fragment_pager);
    mViewPager = (ViewPager) findViewById(R.id.pager);

    final ActionBar bar = getActionBar();
    bar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
    bar.setDisplayOptions(0, ActionBar.DISPLAY_SHOW_TITLE | ActionBar.DISPLAY_SHOW_HOME);

    mTabsAdapter = new TabsAdapter(this, mViewPager);
    //        mTabsAdapter.addTab(bar.newTab().setText(R.string.tab_sd),
    //                FileViewActivity.class, null);
    mTabsAdapter.addTab(bar.newTab().setText(R.string.tab_remote), ServerControlActivity.class, null);
    if (savedInstanceState != null) {
        bar.setSelectedNavigationItem(savedInstanceState.getInt(INSTANCESTATE_TAB, 0));
    }/* ww  w.  j  a  v  a 2  s.c o m*/
}

From source file:id.ridon.fileexplorer.FileExplorerTabActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.fragment_pager);
    mViewPager = (ViewPager) findViewById(R.id.pager);
    mViewPager.setOffscreenPageLimit(DEFAULT_OFFSCREEN_PAGES);

    final ActionBar bar = getActionBar();
    bar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
    bar.setDisplayOptions(0, ActionBar.DISPLAY_SHOW_TITLE | ActionBar.DISPLAY_SHOW_HOME);

    mTabsAdapter = new TabsAdapter(this, mViewPager);
    mTabsAdapter.addTab(bar.newTab().setText(R.string.tab_category), FileCategoryActivity.class, null);
    mTabsAdapter.addTab(bar.newTab().setText(R.string.tab_sd), FileViewActivity.class, null);
    mTabsAdapter.addTab(bar.newTab().setText(R.string.tab_remote), ServerControlActivity.class, null);
    bar.setSelectedNavigationItem(PreferenceManager.getDefaultSharedPreferences(this).getInt(INSTANCESTATE_TAB,
            Util.CATEGORY_TAB_INDEX));
}

From source file:se.chalmers.watchme.activity.MainActivity.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    // Setup view pager
    this.viewPager = new ViewPager(this);
    this.viewPager.setId(R.id.vPager);
    setContentView(viewPager);//  ww w. j  av  a  2s  . com

    // Setup action bar
    actionBar = getActionBar();
    actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
    actionBar.setDisplayOptions(0, ActionBar.DISPLAY_SHOW_TITLE);

    // Setup tabs
    tabsAdapter = new TabsAdapter(this, viewPager);
    tabsAdapter.addTab(actionBar.newTab().setText(R.string.tab_movies), MovieListFragment.class, null);
    tabsAdapter.addTab(actionBar.newTab().setText(R.string.tab_tags), TagListFragment.class, null);
    if (savedInstanceState != null) {
        actionBar.setSelectedNavigationItem(savedInstanceState.getInt("tab", 0));
    }
}

From source file:com.lj.fileexplorer.FileExplorerTabActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.fragment_pager);
    mViewPager = (ViewPager) findViewById(R.id.pager);
    //????/*from  w w w .  j a v  a 2s . c  o m*/
    mViewPager.setOffscreenPageLimit(DEFAULT_OFFSCREEN_PAGES);

    final ActionBar bar = getActionBar();
    bar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
    bar.setDisplayOptions(0, ActionBar.DISPLAY_SHOW_TITLE | ActionBar.DISPLAY_SHOW_HOME);

    mTabsAdapter = new TabsAdapter(this, mViewPager);
    mTabsAdapter.addTab(bar.newTab().setText(R.string.tab_category), FileCategoryActivity.class, null);
    mTabsAdapter.addTab(bar.newTab().setText(R.string.tab_sd), FileViewActivity.class, null);
    mTabsAdapter.addTab(bar.newTab().setText(R.string.tab_remote), ServerControlActivity.class, null);

    //
    bar.setSelectedNavigationItem(PreferenceManager.getDefaultSharedPreferences(this).getInt(INSTANCESTATE_TAB,
            Util.CATEGORY_TAB_INDEX));
}