What is the difference between ActionBarSherlock and Action Bar Compatibility
Fews days ago Google just released the ActionBar Compatibility that make me so confused. Is that the Action Bar Compatibility works same as the ActionBarSherlock and is the coding same?
Example : Does app icon to navigate "up" or ActionBar.Tab supported in Action Bar Compatibility ?
ActionBarSherlock vs ActionBarCompat:
I Just want to put few code difference between ActionBarSherlock vs ActionBarCompat Lib
We can migrate some apps from ActionBarSherlock to ActionBarCompat:
steps:
Import AppCompat project.
Replace SherlockFragmentActivity
with ActionBarActivity
.
Replace SherlockFragment
with Fragment
.
Change Menu
, MenuItem
and getSupportMenuInflater()
references.
Modify the way you get Action Views.
mSearchView = (SearchView)MenuItemCompat.getActionView(mSearchItem)
For more info, please refer this slides by +NickButcher (Google)
Thanks to Sources: http://gmariotti.blogspot.in/2013/07/actionbarsherlock-vs-actionbarcompat.html http://antonioleiva.com/actionbarcompat-migrating-actionbarsherlock/
Don't forget to read this developer.android for more about ABC!
Note: Setting it up for unit tests the same way as ABS is unfortunately not possible with the support library.
Output:
Credits: Gabriele Mariotti