Search in sources :

Example 21 with ActionBar

use of com.actionbarsherlock.app.ActionBar in project Ushahidi_Android by ushahidi.

the class WebViewClientActivity method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    requestWindowFeature(Window.FEATURE_PROGRESS);
    super.onCreate(savedInstanceState);
    ActionBar ab = getSupportActionBar();
    ab.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
    ab.setDisplayShowTitleEnabled(true);
    mWebView = (WebView) findViewById(R.id.webView);
    mWebView.setWebViewClient(new UshahidiWebClient());
    mWebView.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
    mWebView.getSettings().setUserAgentString(USER_AGENT);
    mWebView.getSettings().setBuiltInZoomControls(true);
    mWebView.setScrollBarStyle(android.view.View.SCROLLBARS_INSIDE_OVERLAY);
    // load URL if one was provided in the intent
    String url = getIntent().getStringExtra("url");
    if (url != null) {
        loadUrl(url);
    }
}
Also used : ActionBar(com.actionbarsherlock.app.ActionBar)

Example 22 with ActionBar

use of com.actionbarsherlock.app.ActionBar in project MultiImageChooser by derosa.

the class MultiImageChooserActivity method setupHeader.

private void setupHeader() {
    // From Roman Nurik's code
    // https://plus.google.com/113735310430199015092/posts/R49wVvcDoEW
    // Inflate a "Done/Discard" custom action bar view.
    LayoutInflater inflater = (LayoutInflater) getSupportActionBar().getThemedContext().getSystemService(LAYOUT_INFLATER_SERVICE);
    final View customActionBarView = inflater.inflate(R.layout.actionbar_custom_view_done_discard, null);
    customActionBarView.findViewById(R.id.actionbar_done).setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            // "Done"
            selectClicked(null);
        }
    });
    customActionBarView.findViewById(R.id.actionbar_discard).setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            finish();
        }
    });
    // Show the custom action bar view and hide the normal Home icon and
    // title.
    final ActionBar actionBar = getSupportActionBar();
    actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM, ActionBar.DISPLAY_SHOW_CUSTOM | ActionBar.DISPLAY_SHOW_HOME | ActionBar.DISPLAY_SHOW_TITLE);
    actionBar.setCustomView(customActionBarView, new ActionBar.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
}
Also used : LayoutInflater(android.view.LayoutInflater) GridView(android.widget.GridView) ImageView(android.widget.ImageView) View(android.view.View) AdapterView(android.widget.AdapterView) AbsListView(android.widget.AbsListView) TextView(android.widget.TextView) ActionBar(com.actionbarsherlock.app.ActionBar)

Example 23 with ActionBar

use of com.actionbarsherlock.app.ActionBar in project httpclient by pixmob.

the class MainActivity method onCreate.

/**
 * Called when the activity is first created.
 */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    final ActionBar ab = getSupportActionBar();
    // set defaults for logo & home up
    ab.setDisplayHomeAsUpEnabled(showHomeUp);
    ab.setDisplayUseLogoEnabled(useLogo);
    // set up tabs nav
    for (int i = 1; i < 4; i++) {
        ab.addTab(ab.newTab().setText("Tab " + i).setTabListener(this));
    }
    // set up list nav
    ab.setListNavigationCallbacks(ArrayAdapter.createFromResource(this, R.array.sections, R.layout.sherlock_spinner_dropdown_item), new OnNavigationListener() {

        public boolean onNavigationItemSelected(int itemPosition, long itemId) {
            // FIXME add proper implementation
            rotateLeftFrag();
            return false;
        }
    });
    // default to tab navigation
    showTabsNav();
    // create a couple of simple fragments as placeholders
    final int MARGIN = 16;
    leftFrag = new RoundedColourFragment(getResources().getColor(R.color.android_green), 1f, MARGIN, MARGIN / 2, MARGIN, MARGIN);
    rightFrag = new RoundedColourFragment(getResources().getColor(R.color.honeycombish_blue), 2f, MARGIN / 2, MARGIN, MARGIN, MARGIN);
    FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
    ft.add(R.id.root, leftFrag);
    ft.add(R.id.root, rightFrag);
    ft.commit();
}
Also used : OnNavigationListener(com.actionbarsherlock.app.ActionBar.OnNavigationListener) FragmentTransaction(android.support.v4.app.FragmentTransaction) ActionBar(com.actionbarsherlock.app.ActionBar)

Example 24 with ActionBar

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

the class MainActivityTest method testSingleTabSelection.

private void testSingleTabSelection(final int index, Class<?> fragmentClass) throws InterruptedException {
    final ActionBar actionBar = activity.getSupportActionBar();
    assertNotNull(actionBar);
    Fragment fragment;
    activity.runOnUiThread(new Runnable() {

        @Override
        public void run() {
            activity.selectTab(index);
        }
    });
    instrumentation.waitForIdleSync();
    CountDownLatch signal = new CountDownLatch(1);
    signal.await(2, TimeUnit.SECONDS);
    fragment = getActivity().getCurrentFragment();
    assertNotNull(fragment);
    assertTrue(fragmentClass.isInstance(fragment));
}
Also used : CountDownLatch(java.util.concurrent.CountDownLatch) SyncFragment(com.trovebox.android.app.SyncFragment) AlbumsFragment(com.trovebox.android.app.AlbumsFragment) Fragment(android.support.v4.app.Fragment) TagsFragment(com.trovebox.android.app.TagsFragment) GalleryFragment(com.trovebox.android.app.GalleryFragment) ActionBar(com.actionbarsherlock.app.ActionBar)

Example 25 with ActionBar

use of com.actionbarsherlock.app.ActionBar in project howabout-android by recomio.

the class SearchedTrackListActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Bundle bundle = getIntent().getExtras();
    searchKeyword = bundle.getString("searchKeyword");
    ActionBar actionBar = getSupportActionBar();
    actionBar.setTitle(R.string.menu_search);
    actionBar.setSubtitle(searchKeyword);
    searchedTrackListFragment = new SearchedTrackListFragment();
    Bundle recommendedTrackListFragmentBundle = new Bundle();
    recommendedTrackListFragmentBundle.putString("searchKeyword", searchKeyword);
    searchedTrackListFragment.setArguments(recommendedTrackListFragmentBundle);
    getSupportFragmentManager().beginTransaction().replace(R.id.contentView, searchedTrackListFragment, "music_search").commit();
}
Also used : Bundle(android.os.Bundle) SearchedTrackListFragment(io.recom.howabout.category.music.fragment.SearchedTrackListFragment) 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