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);
}
}
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));
}
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();
}
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));
}
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();
}
Aggregations