androidandroid-actionbarnavigation-drawerandroid-toolbarandroid-navigationview

How to change navigation icon size


I want to design an activity with different sizes but my problem is i cant change the size of the navigationView icon in the action bar.

enter image description here

NavigationView :

<com.google.android.material.navigation.NavigationView
            android:id="@+id/navigationView_main"
            style="@style/NavigationView.all"
            />

Style :

<style name="NavigationView.all" >
    <item name="android:layout_width">@dimen/widthNavigationView_all</item>
    <item name="android:layout_height">match_parent</item>
    <item name="headerLayout">@layout/navigation_all_header</item>
    <item name="android:layout_gravity">start</item>
    <item name="itemIconTint">@color/itemIconTint_navigationView</item>
    <item name="itemTextColor">@color/itemTextColor_navigationView</item>
</style>

Solution

  • I found solution. We need to access DrawerArrowToggle style attributes.

    <style name="AppTheme" parent="Theme.MaterialComponents.Light.DarkActionBar.Bridge">
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@color/colorAccent</item>
    
        <item name="drawerArrowStyle">@style/DrawerArrowToggle</item>
    </style>
    
    //Style required 
    <style name="DrawerArrowToggle" parent="Widget.AppCompat.DrawerArrowToggle">
        <item name="barLength">28dp</item>
        <item name="gapBetweenBars">5dp</item>
        <item name="drawableSize">24dp</item>
    </style>