How to create a toolbar (e.g. secondary action bar) in Android?

The gmail app has this toolbar that looks like an action bar (even including the overflow menu). This is a blue bar about 1/4 of the screen. See Image 1:

Image 1

I want the bar to have a red arrow. I looked through the documentation and did not see the widget that does this. How can I make such a bar?

Also, if you see the orange arrow below, this means that this application has both an action bar at the top and bottom. I am curious how this is done, but my main question is how to make the toolbar look like an action bar wherever I want on the screen.

Image 1 is on the phone. I also included image 2 and image 3 below, which is a 7 "and 10" tablet, respectively. Note that the β€œsplit” action bar is on the same panel as the tablet views.

Image 2

Image 3

+7
source share
1 answer

For the orange panel, you should simply add this tag to your manifest (under your activity tag):

android:uiOptions="splitActionBarWhenNarrow" 

As for red, I would imagine it was just a LinearLayout with QuickContactBadge , TextView s and a few Button - not an actual instance of an ActionBar .

+11
source

All Articles