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:Main.java

public static void initialize(Activity activity, int layout) {
    // Do all sorts of common task for your activities here including:
    activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE);
    activity.setContentView(layout);/*w  w  w  .ja  va 2  s .  c o  m*/
    activity.getWindow().addFlags(LayoutParams.FLAG_KEEP_SCREEN_ON);
    activity.getActionBar().setDisplayOptions(
            ActionBar.DISPLAY_SHOW_HOME | ActionBar.DISPLAY_SHOW_TITLE | ActionBar.DISPLAY_SHOW_CUSTOM);
    activity.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
}

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:net.sakuramilk.kbcupdater.MainFragmentActivity.java

/** Called when the activity is first created. */
@Override//from   ww w  . ja v  a 2s .  c  o m
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.docd.purefm.settings.SettingsActivity.java

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

    final ActionBar actionBar = getActionBar();
    if (actionBar == null) {
        throw new RuntimeException("Should have ActionBar");
    }/*from   w w w .ja va  2s .c om*/
    actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_HOME | ActionBar.DISPLAY_HOME_AS_UP
            | ActionBar.DISPLAY_SHOW_TITLE | ActionBar.DISPLAY_USE_LOGO);
}

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

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

    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:pack_generic.Act_NSPS.java

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

    mViewPager = new ViewPager(this);
    mViewPager.setId(R.id.pager);/*from  w ww  . java  2 s . com*/
    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("Frag_Page"), Frag_Page.class, null);
    mTabsAdapter.addTab(bar.newTab().setText("Frag_List_Contacts"), Frag_List_Contacts.class, null);
    mTabsAdapter.addTab(bar.newTab().setText("Frag_Tabs"), Frag_Tabs.class, null);

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

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

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

    mViewPager = new ViewPager(this);
    mViewPager.setId(R.id.pager);// w ww  . j  a  va 2 s. c o 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);
    mTabsAdapter.addTab(bar.newTab().setText("Tabs"), FragmentTabsFragment.class, null);

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

From source file:pack_generic.Act_NPS.java

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

    mViewPager = new ViewPager(this);
    mViewPager.setId(R.id.pager);//from   w w  w  .  j a va  2  s. c om
    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("Frag_Page"), Frag_Page.class, null);
    mTabsAdapter.addTab(bar.newTab().setText("Fish list"), Act_ButtonList_Fish.ArrayListFragment.class, null);
    mTabsAdapter.addTab(bar.newTab().setText("Frag_List_Contacts"), Frag_List_Contacts.class, null);
    mTabsAdapter.addTab(bar.newTab().setText("Frag_Tabs"), Frag_Tabs.class, null);

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

From source file:com.michellgaby.advsettings.DeviceSettings.java

@TargetApi(11)
@Override//from ww w.  j  av  a  2 s  . co  m
protected 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);

    // Remove title and icon
    bar.setDisplayShowHomeEnabled(false);
    bar.setDisplayShowTitleEnabled(false);

    mTabsAdapter = new TabsAdapter(this, mViewPager);
    mTabsAdapter.addTab(bar.newTab().setText(R.string.general_settings_title), GeneralSettings.class, null);
    /**
     * mTabsAdapter.addTab(
     * bar.newTab().setText(R.string.category_mdnie_title),
     * mDNIeFragmentActivity.class, null); mTabsAdapter.addTab(
     * bar.newTab().setText(R.string.category_sensors_title),
     * SensorsFragmentActivity.class, null);
     */

    mTabsAdapter.addTab(bar.newTab().setText(R.string.system_settings_title), SystemSettings.class, null);

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

From source file:com.evervolv.toolbox2.Toolbox.java

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

    mViewPager = new ViewPager(this);
    mViewPager.setId(R.id.pager);/* w w w.  j  a  v  a 2  s  .c o m*/
    setContentView(mViewPager);

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

    mTabsAdapter = new TabsAdapter(this, mViewPager);
    mTabsAdapter.addTab(bar.newTab().setText(R.string.interface_title), Interface.class, null);
    mTabsAdapter.addTab(bar.newTab().setText(R.string.performance_title), Performance.class, null);
    mTabsAdapter.addTab(bar.newTab().setText(R.string.updates_title), Updates.class, null);

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