Vipul J
Vipul J

Reputation: 6691

How to add padding and increase width of Navigation Drawer icon in Action bar?

I want to increase width of Navigation drawer icon and add left and right padding to it. Any idea how to do it?

Thanks

Upvotes: 1

Views: 2358

Answers (3)

WISHY
WISHY

Reputation: 11999

You can do it using the styles:

 <style name="DrawerArrowStyle" parent="Widget.AppCompat.DrawerArrowToggle">
    <item name="spinBars">true</item>
    <item name="color">#FE1B56</item>
    <item name="barSize">20dp</item>
    <!--<item name="thickness">3dp</item>-->
</style>

Add this in your parent theme

 <item name="drawerArrowStyle">@style/DrawerArrowStyle</item>

Upvotes: 1

David Crozier
David Crozier

Reputation: 1568

I also wanted the icon to be wider, so I used Gimp (image editor) to make it wider (just added a few more pixels of the grey lines and extra transparency to the right). The Action Bar displays the icon appropriately and moves the other elements over to fit (like the action bar title). I've provided the image below in case you want to use it: ic_drawer.png wider

Upvotes: 0

rosorio
rosorio

Reputation: 321

For padding you can use:

ImageView view = (ImageView)findViewById(android.R.id.home);
view.setPadding(left, top, right, bottom);

Regarding the Icon width have you tried using a larger icon?

Upvotes: 1

Related Questions