Example usage for android.app ActionBar setNavigationMode

List of usage examples for android.app ActionBar setNavigationMode

Introduction

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

Prototype

@Deprecated
public abstract void setNavigationMode(@NavigationMode int mode);

Source Link

Document

Set the current navigation mode.

Usage

From source file:Main.java

public static boolean setNavigationMode(ActionBar actionBar, int mode) {

    if (actionBar != null) {
        actionBar.setNavigationMode(mode);
        return true;
    } else {/* w  ww . j  a v a  2 s .  c  o m*/
        return false;
    }
}

From source file:run.ace.TabBar.java

public static void remove(android.app.Activity activity) {
    //if (!(activity instanceof ActionBarActivity)) {
    android.app.ActionBar mainActionBar = activity.getActionBar();
    mainActionBar.removeAllTabs();/*from  w w  w  .  j a v  a 2  s .com*/
    mainActionBar.setNavigationMode(android.app.ActionBar.NAVIGATION_MODE_STANDARD);
    /*
    if (mainActionBar != null) {
        mainActionBar.hide();
        mainActionBar.setTitle(null);
        mainActionBar.removeAllTabs();
        return;
    }
    */
    //}
    //else {
    //    ActionBar actionBar = ((ActionBarActivity)activity).getSupportActionBar();
    //    if (actionBar != null) {
    //        actionBar.hide();
    //        actionBar.setTitle(null);
    //        actionBar.removeAllTabs();
    //        return;
    //    }
    //}
}

From source file:name.gumartinm.weather.information.activity.SpecificActivity.java

@Override
protected void onCreate(final Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    this.setContentView(R.layout.weather_specific);

    final ActionBar actionBar = this.getActionBar();

    actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
    actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_TITLE, ActionBar.DISPLAY_SHOW_TITLE);
    actionBar.setDisplayHomeAsUpEnabled(true);

}

From source file:com.Candy.ota.settings.About.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.about);//w  w w . j a va 2 s  .  c  o m

    mHomeURL = (TextView) findViewById(ID_HOME_URL);
    mContact = (TextView) findViewById(ID_CONTACT);
    mLicense = (TextView) findViewById(ID_LICENSE);

    mHomeURL.setMovementMethod(LinkMovementMethod.getInstance());
    mContact.setMovementMethod(LinkMovementMethod.getInstance());
    mLicense.setMovementMethod(LinkMovementMethod.getInstance());

    final ActionBar actionBar = getActionBar();
    actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
    actionBar.setDisplayHomeAsUpEnabled(true);

}

From source file:com.example.android.pm.shortcutlauncherdemo.ShortcutLauncherMain.java

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

    setContentView(R.layout.main);/*from   w  w w  .j a v a  2  s. c o m*/

    mPager = (ViewPager) findViewById(R.id.pager);
    mPager.setOffscreenPageLimit(2);
    mPagerAdapter = new MyPagerAdapter(getFragmentManager());
    mPager.setAdapter(mPagerAdapter);

    final ActionBar ab = getActionBar();
    ab.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
    ab.addTab(ab.newTab().setText("App list").setTabListener(mTabListener));
    ab.addTab(ab.newTab().setText("Pinned shortcuts").setTabListener(mTabListener));
}

From source file:net.sakuramilk.kbcupdater.MainFragmentActivity.java

/** Called when the activity is first created. */
@Override//  w ww . ja  va 2s . com
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    mViewPager = new ViewPager(this);
    mViewPager.setId(R.id.viewpager);
    setContentView(mViewPager);

    final ActionBar bar = getActionBar();
    bar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
    bar.setDisplayOptions(ActionBar.DISPLAY_SHOW_TITLE, ActionBar.DISPLAY_SHOW_TITLE);
    bar.setTitle(R.string.app_name);

    mPagerAdapter = new TabsFragmentAdapter(this, mViewPager);

    Bundle args = new Bundle();
    args.putString("url", Constant.LIST_URL_SC06D);
    mPagerAdapter.addTab(bar.newTab().setText("SC-06D"), DeviceFragmentActivity.class, args);

    /*
    args = new Bundle();
    args.putString("url", "https://github.com/kbc-developers/release/wiki/sc04d");
    mPagerAdapter.addTab(bar.newTab().setText("SC-04D"),
        DeviceFragmentActivity.class, args);
    */

    args = new Bundle();
    args.putString("url", Constant.LIST_URL_SC02C);
    mPagerAdapter.addTab(bar.newTab().setText("SC-02C"), DeviceFragmentActivity.class, args);

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

From source file:com.normalexception.neobd.NeobdActivity.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_neobd);

    appContext = this;

    // Set up the action bar.
    final ActionBar actionBar = getActionBar();
    actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);

    // For each of the sections in the app, add a tab to the action bar.
    actionBar.addTab(actionBar.newTab().setText(R.string.title_section_welcome)
            .setTabListener(new TabListener(new WelcomeTab())));
    actionBar.addTab(actionBar.newTab().setText(R.string.title_section_obd2)
            .setTabListener(new TabListener(new OBDTab())));
    actionBar.addTab(actionBar.newTab().setText(R.string.title_section_dtc)
            .setTabListener(new TabListener(new DTCTab())));

    // Initialize the database
    neod = NEODatabase.getInstance();/*ww w  . j  a v a  2s.co  m*/
}

From source file:in.ac.iitb.intulearn.DetailsActivity.java

/**
 * Initialise the fragments to be paged/*from   w w w  . j av  a2 s.  co  m*/
 */
private void initialisePaging() {

    // Set up the action bar.
    ActionBar actionBar = getActionBar();
    actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
    // Show the Up button in the action bar.
    actionBar.setDisplayHomeAsUpEnabled(true);

    // REF: http://android-er.blogspot.in/2012/06/create-actionbar-in-tab-navigation-mode.html
    actionBar.addTab(actionBar.newTab().setText(R.string.title_fragment_description)
            .setTabListener(new CustomTabListener(this, DescriptionFragment.class.getName())));
    actionBar.addTab(actionBar.newTab().setText(R.string.title_fragment_experiment)
            .setTabListener(new CustomTabListener(this, ExperimentFragment.class.getName())));
    actionBar.addTab(actionBar.newTab().setText(R.string.title_fragment_evaluate)
            .setTabListener(new CustomTabListener(this, EvaluateFragment.class.getName())));

}

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

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main_nav);/*from  w  w w . j a va  2 s .  c o  m*/

    for (final Feed feed : Feed.getFeeds()) {
        addNewFeed(feed);
    }

    ActionBar bar = getActionBar();

    bar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
    bar.setDisplayOptions(0, ActionBar.DISPLAY_SHOW_TITLE);
    bar.setDisplayHomeAsUpEnabled(true);

    int screenLayout = getResources().getConfiguration().screenLayout;

    if (((screenLayout & Configuration.SCREENLAYOUT_SIZE_NORMAL) == Configuration.SCREENLAYOUT_SIZE_NORMAL)
            || ((screenLayout
                    & Configuration.SCREENLAYOUT_SIZE_SMALL) == Configuration.SCREENLAYOUT_SIZE_SMALL)) {
        bar.setDisplayShowHomeEnabled(false);
    }

    if (savedInstanceState != null) {
        cleanUpFragments();
    }
}

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);//  w  w w . j  av  a  2 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);

}