Search in sources :

Example 1 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 2 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)

Example 3 with ActionBar

use of com.actionbarsherlock.app.ActionBar in project android-ui-design-pattern by MathieuCalba.

the class FeedItemActivity method initActionBar.

private void initActionBar() {
    final ActionBar ab = getSupportActionBar();
    ab.setDisplayHomeAsUpEnabled(true);
    ab.setDisplayShowHomeEnabled(true);
    ab.setHomeButtonEnabled(true);
    ab.setDisplayShowTitleEnabled(true);
    ab.setTitle(null);
}
Also used : ActionBar(com.actionbarsherlock.app.ActionBar)

Example 4 with ActionBar

use of com.actionbarsherlock.app.ActionBar in project android-ui-design-pattern by MathieuCalba.

the class HomeActivity method initActionBar.

private void initActionBar() {
    setRefreshingState(false);
    final ActionBar ab = getSupportActionBar();
    ab.setDisplayHomeAsUpEnabled(false);
    ab.setDisplayShowHomeEnabled(true);
    ab.setHomeButtonEnabled(false);
    ab.setDisplayShowTitleEnabled(false);
}
Also used : ActionBar(com.actionbarsherlock.app.ActionBar)

Example 5 with ActionBar

use of com.actionbarsherlock.app.ActionBar in project mobile-android by photo.

the class PhotoDetailsFragment method photoSelected.

void photoSelected(final Photo photo) {
    ActionBar actionBar = ((Activity) getSupportActivity()).getSupportActionBar();
    String title = photo.getTitle();
    if (TextUtils.isEmpty(title)) {
        title = photo.getFilenameOriginal();
    }
    actionBar.setTitle(getString(R.string.details_title_and_date_header, title, CommonUtils.formatDateTime(photo.getDateTaken())));
    titleText.setText(title);
    dateText.setText(CommonUtils.formatDateTime(photo.getDateTaken()));
    privateBtn.setVisibility(photo.isPrivate() ? View.VISIBLE : View.GONE);
    ensureThumbVisible(photo);
}
Also used : Activity(org.holoeverywhere.app.Activity) 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