I'm trying to center a view on my ActionBar, relative to the overall width. The code I have at the moment:
actionBar.setDisplayShowCustomEnabled(true);
actionBar.setCustomView(R.layout.action_bar_custom);
sets a linear layout with centered gravity in the middle of the Home button and the Menu buttons, instead of directly in the middle of the Action Bar. Some fragments have menu options and some don't, which need to be there.
How would I achieve this?
Examples of what is currently happening: