Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Action Bar Sherlock with buttons

i'm building an app and i really want to align buttons to the left using ABS (action bar sherlock) 4.0 I really like the dropbox interface as shown under this:

Dropbox interface

So, my question is: How can i align the buttons to the left and how can i jump between views in ViewFlow using buttons?

I've seen that people can add tabs to their ABS, but not with the title like the Dropbox interface.

Thanks. Also if u need my sourcecode i will add it later if needed.

Regards

Stian Instebø

like image 571
Stian Instebo Avatar asked Nov 14 '12 17:11

Stian Instebo


1 Answers

setCustomView() is the magic method you might be looking for.

To achieve the same layout shown in the Dropbox app, you would first call setDisplayShowHomeEnabled(false) on your ActionBar.

Next, you could define the layout for the buttons somewhere in XML. Once this is done, calling setCustomView(R.layout.my_actionbar_nav) will do the trick. (It will now be positioned on the left-hand side of the ActionBar).

It'll be your responsibility to wire up the appropriate onClick listeners for your layout's inner button Views, but it's not a bad price to pay for setting up custom navigation.

like image 114
Chris Horner Avatar answered Oct 18 '22 22:10

Chris Horner