Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spacing between overflow icon and action items in ActionBarSherlock

I am using ActionBarSherlock(ABS) in my project, the overflow icon takes too much margin to the left from the action items. I have the latest library of ABS in my project. You can see the screenshot below of the mentioned problem.

sherlock action bar jelly bean

The mobile is running on JellyBean version. How can i reduce the space between the overflow icon and action items?

UPDATE

I have tried changing the action items attributes , by applying the custom theme

<style name="DelightActionButtonStyle" parent="Widget.Sherlock.ActionButton">
        <!--  <item name="android:background">?attr/actionBarItemBackground</item> -->
        <item name="android:background">@color/black</item>
        <item name="android:minHeight">?attr/actionBarSize</item>

        <item name="android:minWidth">0dp</item>
        <item name="android:gravity">center</item>
        <item name="android:paddingLeft">20dp</item>
        <item name="android:paddingRight">20dp</item>
        <item name="android:scaleType">center</item>
    </style>

only background attribute takes effect on the devices which doesn't have menu button. i played with the attributes changing the margins and padding, nothing seems to have an effect. Is there a way to control these attributes for action items?

like image 542
Yashwanth Kumar Avatar asked Oct 20 '12 09:10

Yashwanth Kumar


2 Answers

If you really need to change it, here is how to reduce the width of the overflow button:

<style name="AppTheme" parent="Theme.Sherlock">
    <item name="android:actionOverflowButtonStyle">@style/MyOverflowButton</item>
</style>

<style name="MyOverflowButton" parent="Widget.Sherlock.ActionButton.Overflow">
    <item name="android:minWidth">32dip</item>
    <item name="android:padding">0dip</item>
</style>
like image 193
Matthias Robbers Avatar answered Nov 09 '22 11:11

Matthias Robbers


Your action buttons are too small. They should not be smaller than 48dp. If this must be done (it shouldn't), you can override the actionButtonStyle android:minWidth attribute:

https://stackoverflow.com/a/10808259/377260

Be sure to also include android:actionButtonStyle.

like image 2
Paul Burke Avatar answered Nov 09 '22 10:11

Paul Burke