I need to make an application with 2 activity.
The arrangement of the elements on them is as follows: alt text

What is the best way to do this? Leave the actionBar on top or make the layout additional?
I do not know how, for example, to make the application name in the actionBar in the middle, how to hide / show the "reload" button, how to make the "home" arrow appear, and the text in the middle.

UPD

public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.menu, menu); menuItem = menu.findItem(R.id.reload_button); menuItem.setEnabled(true); menuItem.setVisible(true); } 

    1 answer 1

    With ActionBar of course. You can hide the menu button, for example, by calling setHasOptionsMenu (false), or by loading another menu layout. Also, you can set your custom layout for the action bar, which will look like anything, but I don’t know the truth about text centering, you need to test it by experience, but as a rule there are no problems with the Action Bar. Simply, in the end you get less code than with pens to write all the same.

    • Well, then the questions: How to hide / show the "reload" button? How to change the background color of actionBar? - Stas0n
    • I wrote. You make your entire layout for the bar - inflite it and use as you like. And the button to hide what's the problem then? It all depends on the context. - DroidAlex
    • And how to write your layout for the bar? I just never did this ... The hide / show button does not work - added code - Stas0n
    • As usual layout any. Then through LayoutInflater you get it and call actionBar.setCustomView (view). You can hide the button as I have already written through setHasOptionsMenu (false), but I think it can be otherwise. - DroidAlex
    • Yes, I just never did it. Can I see an example somewhere? - Stas0n