Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Comparing The android action bar compat, pager and tabs sample to ActionBarSherlock

I hope this question will not be rejected as there is no code. But still, I think it could interest some people as android documentation of action bar and its compatibility is becoming quite large these times.

I have an app I would like to convert to a new UI using action bar, tabs and pager. But I want it to be compatible from android 4.0 down to android 2.2 let's say.

What are the possibilities, advantages and drawbacks of using either :

  • action bar from ICS with support api + some code from samples (like actionbar compat & support samples for tabs and pager)
  • versus action sherlock tabs+pager ?
  • versus action sherlock action bar tabs ?

Thanks !

like image 548
Snicolas Avatar asked Oct 09 '22 03:10

Snicolas


1 Answers

I've used ABS on several projects and it's a dream. It saves me an enormous amount of time, the apps look great, and the version compatibility is excellent.

Navigation Tabs are a Google recommended approach to primary navigation as part of the ActionBar, so I'd say use that (or ActionBar actions, or a drop-down spinner), unless you have a good reason not too. And as it's in ABS and works back to older versions, it's pretty easy to implement, so you can spend time on the actual app.

ABS does take a little effort to get the dependencies set up, but it's just a library project, it's not hard, and the little time needed is massively made up for by the benefits.

I think the main difference between the last two options is whether you want users to side-swipe between tabs, and that will depend on the app. If you want side-swiping, go with the pager, if not the ActionBar NavigationTabs will probably do the job.

like image 71
Ollie C Avatar answered Oct 12 '22 11:10

Ollie C