I'm trying to adjust the size of my ActionBar, and even if there are a lot of posts about that no one seems to work for me. I wonder if it has anything to do with the fact that I just upgraded to API 21. Here's my styles.xml:
<style name="AppTheme" parent="Theme.AppCompat.Light">
<!-- Main theme colors -->
<!-- your app branding color for the app bar -->
<item name="colorPrimary">@color/Black</item>
<!-- darker variant for the status bar and contextual app bars -->
<item name="colorPrimaryDark">@color/Black</item>
<!-- theme UI controls like checkboxes and text fields -->
<!-- native widgets will now be "tinted" with accent color -->
<item name="colorAccent">@color/Moccasin</item>
<!--Action bar style-->
<item name="android:actionBarStyle">@style/AppTheme.ActionBar</item>
<item name="actionBarStyle">@style/AppTheme.ActionBar</item>
</style>
<style name="AppTheme.ActionBar" parent="Widget.AppCompat.Light.ActionBar">
<item name="titleTextStyle">@style/AppTheme.ActionBar.TitleText</item>
<item name="android:titleTextStyle">@style/AppTheme.ActionBar.TitleText</item>
<item name="actionBarSize">40dp</item>
<item name="android:actionBarSize">40dp</item>
<item name="android:height">40dp</item>
</style>
<style name="AppTheme.ActionBar.TitleText" parent="TextAppearance.AppCompat.Widget.ActionBar.Title">
<item name="android:textSize">16sp</item>
<item name="android:textColor">@color/DarkGreen</item>
</style>
I would expect the ActionBar to be smaller, but instead nothing changed in its dimension, while for example the text size and color are set correctly as expected. Any ideas?
EDIT: so I partially solved it by adding
<item name="height">40dp</item>
as suggested in some posts, however now I get something like this:
as if it was cut to the desired size while being still formatted to the original one. How can I solve this? I tried using the additional attribute
android:actionBarSize
but with no success. The problem persists if I change the size to 80dp, where I get this:
How do I make the drawer icon and the question mark icon be resized and recentered according to the ActionBar size?