Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Implementing an Action Bar: ABSherlock or ABCompat?

The application currently has tabulations and bar custom made (by previous guy) from fragments to copy cat Apple design.

I want to move toward Android action bar to provide Android experience and usual behavior.

Should I implement Action Bar Sherlock or Action Bar Compat?

Pro ABS:

  • Lots of documentation
  • Action bar Tabs is well known (that's what I need to do)
  • About Holo theme? ABS is great to support it, how perform ABCompat?

Pro ABCompat:

  • Supported by Google (better in the long run?)
  • Better connection with navigation drawer (but I will not use one)
  • No external dependencies in Java Build path

What others arguments help decide? Which one should I pick ?

From my point of view, provided I succeed to do a action bar with fixed tabs, the Action Bar compatibility is the best choice (but not by much).

Thank you for helping me! (even providing arguments I missed)

like image 487
Poutrathor Avatar asked Jul 31 '13 11:07

Poutrathor


2 Answers

The main reason that made me switch to ActionBarCompat is the Menu appearence in devices with android <= 2.3. With ActionBarSherlock, the menu appears very ugly, with the default menu of the device. With the ActionBarCompat, the menu appears the same way it appears when you open it in devices with Android >= 4.0 and hardware menu key.

But, be aware that the ActionBarCompat has some bugs to be resolved yet. I'm dealing with this bug:

SearchView taking all the space in the new ActionBarCompat

UPDATE:

Another bug:

https://code.google.com/p/android/issues/detail?id=58321&thanks=58321&ts=1375277660

UPDATE:

I've created a patched version of the ActionBarCompat to solve the issue with the ActionMode. See here:

The ActionMode is being created twice with the ActionBarCompat r18

like image 53
Fernando Camargo Avatar answered Nov 10 '22 14:11

Fernando Camargo


The reasons why I migrated my app from ABS to Action Bar Compat were as follows:

  1. I have only a very basic implementation of action bar tabs and I could see it would be simple to migrate

  2. I prefer the Google documentation - it is clearer and more complete

  3. Software maintenance will be simpler and less error prone because I now have no external dependencies.

  4. I had run into a problem with ABS whereby I wanted to handle an orientation change (but you can't because of the way ABS hooks in to Android).

  5. I haven't seen any statements from anybody connected with ABS about their long term plans for ABS. So I'm not convinced they are going to continue to support it. I may be wrong - but I haven't seen anything.

  6. Performance is not really an issue for me, but I can't see why Google's "native" implementation would run slower than ABS and I suspect that it may perform better.

These are just my personal impressions.

like image 38
IanB Avatar answered Nov 10 '22 15:11

IanB