-1

I was looking for different ways to do this using styles or programmatically, but not one way worked. Is it possible to increase the size of this icon in any way?

enter image description here

Toolbar:

    <android.support.v7.widget.Toolbar
            android:id="@+id/toolbar"
            android:background="@color/color_primary"
            android:layout_width="match_parent"
            android:layout_height="@dimen/toolbar_h">

            <RelativeLayout
                android:id="@+id/toolbar_wrapper"
                android:layout_width="match_parent"
                android:layout_height="match_parent">

                <TextView
                    android:clickable="true"
                    android:focusable="true"
                      ....

Activity:

<LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:fitsSystemWindows="true"
        android:orientation="vertical">

        <include
            layout="@layout/toolbar"/>

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent">

            <android.support.v4.widget.DrawerLayout 
                android:id="@+id/drawer_layout"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:fitsSystemWindows="true"
                tools:openDrawer="end">
                 ....

Activity code:

override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState) 
    binding = DataBindingUtil.setContentView(this, R.layout.activity_skeleton) 
    val toggle = object : ActionBarDrawerToggle(this, drawer, toolbar, R.string.nd_open, R.string.nd_close) {}
    drawer.addDrawerListener(toggle)
    toggle.syncState()
}
sanu
  • 529
  • 10
  • 30

2 Answers2

-1

You can change the size of Navigation Drawer icons by overriding design_navigation_icon_size attribute in dimens.xml

<dimen name="design_navigation_icon_size" tools:override="true">40dp</dimen>

-1

If you want to add a custom nav icon to your action bar you should be doing as follows -

    onCreate(Bundle savedInstanceState){
    ......
        setSupportActionBar(binding.toolbar);

    if (
            getSupportActionBar() != null
            ) {
        setTitle("");
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
        getSupportActionBar().setHomeAsUpIndicator(R.drawable.icon_menu);
    }
    ......

This will set a custom drawable button to your action bar. and as you are setting it itself, now make it as per your size. or even if you want you can set different icon for different screen size.

Sagar Nayak
  • 2,138
  • 2
  • 19
  • 52
  • I finded solution: https://mobikul.com/change-hamburger-icon-android/ but, how i can add animation with arrow? – sanu Apr 19 '18 at 08:06
  • consider using morphing of icons http://choruscode.blogspot.in/2015/09/morphing-animation-for-toolbar-back.html . or alternatively, you can go for lottie views for your purpose. – Sagar Nayak Apr 19 '18 at 08:31
  • mind sharing why someone has downvoted this answer? please do share your view so that answer can be improved. don't just go on downvoting the answers. – Sagar Nayak Apr 25 '18 at 11:52