Search in sources :

Example 16 with ActionBar

use of com.actionbarsherlock.app.ActionBar in project ActionBarSherlock by JakeWharton.

the class Issue379 method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    ActionBar ab = getSupportActionBar();
    ab.setNavigationMode(NAVIGATION_MODE_TABS);
    ab.addTab(ab.newTab().setTabListener(this).setText("Test"));
    TextView tv = new TextView(this);
    tv.setText("ColorDrawable ignores bounds on pre-HC. Make sure you see three colors.");
    setContentView(tv);
}
Also used : TextView(android.widget.TextView) ActionBar(com.actionbarsherlock.app.ActionBar)

Example 17 with ActionBar

use of com.actionbarsherlock.app.ActionBar in project ActionBarSherlock by JakeWharton.

the class SampleList method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    final ActionBar actionBar = getSupportActionBar();
    actionBar.setNavigationMode(NAVIGATION_MODE_TABS);
    actionBar.addTab(actionBar.newTab().setText("Open").setTabListener(this));
    actionBar.addTab(actionBar.newTab().setText("Closed").setTabListener(this));
    setListAdapter(mAdapter);
}
Also used : ActionBar(com.actionbarsherlock.app.ActionBar)

Example 18 with ActionBar

use of com.actionbarsherlock.app.ActionBar in project PlayView by GadgetCheck.

the class MainActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.content_frame);
    ActionBar bar = getSupportActionBar();
    bar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
    bar.setDisplayHomeAsUpEnabled(true);
    ActionBar.Tab tab1 = bar.newTab();
    ActionBar.Tab tab2 = bar.newTab();
    ActionBar.Tab tab3 = bar.newTab();
    tab1.setText("TAB1");
    tab2.setText("TAB2");
    tab3.setText("TAB3");
    tab1.setTabListener(new MyTabListener());
    tab2.setTabListener(new MyTabListener());
    tab3.setTabListener(new MyTabListener());
    bar.addTab(tab1);
    bar.addTab(tab2);
    bar.addTab(tab3);
}
Also used : Tab(com.actionbarsherlock.app.ActionBar.Tab) ActionBar(com.actionbarsherlock.app.ActionBar)

Example 19 with ActionBar

use of com.actionbarsherlock.app.ActionBar in project ActionBar-PullToRefresh by chrisbanes.

the class FragmentTabsActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_fragment);
    // Add 3 tabs which will switch fragments
    ActionBar ab = getSupportActionBar();
    ab.addTab(ab.newTab().setText("Tab 1").setTabListener(this));
    ab.addTab(ab.newTab().setText("Tab 2").setTabListener(this));
    ab.addTab(ab.newTab().setText("Tab 3").setTabListener(this));
    ab.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
}
Also used : ActionBar(com.actionbarsherlock.app.ActionBar)

Example 20 with ActionBar

use of com.actionbarsherlock.app.ActionBar in project ActionBar-PullToRefresh by chrisbanes.

the class FragmentTabsViewPagerActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_fragment_tabs_vp);
    ViewPager vp = (ViewPager) findViewById(R.id.ptr_viewpager);
    mFragmentTabPager = new FragmentTabPager(this, vp);
    // Add 3 tabs which will switch fragments
    ActionBar ab = getSupportActionBar();
    ab.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
    Bundle b = new Bundle();
    b.putString(EXTRA_TITLE, "Tab 1");
    mFragmentTabPager.addTab(ab.newTab().setText("Tab 1"), SampleFragment.class, b);
    b = new Bundle();
    b.putString(EXTRA_TITLE, "Tab 2");
    mFragmentTabPager.addTab(ab.newTab().setText("Tab 2"), SampleFragment.class, b);
    b = new Bundle();
    b.putString(EXTRA_TITLE, "Tab 3");
    mFragmentTabPager.addTab(ab.newTab().setText("Tab 3"), SampleFragment.class, b);
}
Also used : Bundle(android.os.Bundle) ViewPager(android.support.v4.view.ViewPager) ActionBar(com.actionbarsherlock.app.ActionBar)

Aggregations

ActionBar (com.actionbarsherlock.app.ActionBar)34 Bundle (android.os.Bundle)5 TextView (android.widget.TextView)5 SherlockFragmentActivity (com.actionbarsherlock.app.SherlockFragmentActivity)3 Bitmap (android.graphics.Bitmap)2 GradientDrawable (android.graphics.drawable.GradientDrawable)2 FragmentTransaction (android.support.v4.app.FragmentTransaction)2 View (android.view.View)2 AdapterView (android.widget.AdapterView)2 Button (android.widget.Button)2 ImageView (android.widget.ImageView)2 LinearLayout (android.widget.LinearLayout)2 OnNavigationListener (com.actionbarsherlock.app.ActionBar.OnNavigationListener)2 FailReason (com.nostra13.universalimageloader.core.assist.FailReason)2 ImageLoadingListener (com.nostra13.universalimageloader.core.assist.ImageLoadingListener)2 Activity (org.holoeverywhere.app.Activity)2 DataSetObserver (android.database.DataSetObserver)1 Fragment (android.support.v4.app.Fragment)1 ViewPager (android.support.v4.view.ViewPager)1 LayoutInflater (android.view.LayoutInflater)1