0

I have these two groups inside NavigationView menu XML:

<group>
    <item
        android:id="@+id/nav_top"
        android:icon="@drawable/ic_flame"
        android:checkable="true"
        android:title="@string/top_rated" />

    <item
        android:id="@+id/nav_latest"
        android:icon="@drawable/ic_clock"
        android:checkable="true"
        android:title="@string/latest_uploads" />
</group>

<group>
    <item
        android:id="@+id/nav_allvids"
        android:icon="@drawable/ic_flame"
        android:checkable="true"
        android:title="@string/top_rated" />

    <item
        android:id="@+id/nav_allpics"
        android:icon="@drawable/ic_shuffle"
        android:checkable="true"
        android:title="@string/random" />
</group>

I need to add space between them, the solution here: How can I increase margin between two particular groups? in Navigation Drawer is bad because the space is too much.

So how can I do that?

Eduard Unruh
  • 985
  • 1
  • 14
  • 35

1 Answers1

0

Add this to your dimens.xml:

<dimen name="design_navigation_separator_vertical_padding">16dp</dimen>

(This value defines the top and bottom padding for the groups of the com.google.android.material.navigation.NavigationView)

giorgos.nl
  • 2,704
  • 27
  • 36