I'm using navdrawer with support of android.support.design.widget.NavigationView
I'd like to add a separator between groups (or first of "settings", it's not a problem), but I cannot find a method in web. Thank you for your support
base_layout.xml
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/drawer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context=".MainActivity">
<LinearLayout
android:layout_height="match_parent"
android:layout_width="match_parent"
android:orientation="vertical"
>
<include
android:id="@+id/toolbar"
layout="@layout/toolbar"
/>
<FrameLayout
android:id="@+id/frame"
android:layout_width="match_parent"
android:layout_height="match_parent">
</FrameLayout>
</LinearLayout>
<!--
IF YOU NEED HEADER:
app:headerLayout="@layout/drawer_header"
-->
<android.support.design.widget.NavigationView
android:id="@+id/navigation_view"
android:layout_height="match_parent"
android:layout_width="wrap_content"
android:layout_gravity="start"
app:menu="@menu/drawer"
/>
</android.support.v4.widget.DrawerLayout>
drawer.xml
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<group android:checkableBehavior="single">
<item
android:id="@+id/home"
android:checked="false"
android:icon="@drawable/ic_home_black_24dp"
android:title="@string/list_home" />
<item
android:id="@+id/list_event"
android:checked="false"
android:icon="@drawable/ic_list_black_24dp"
android:title="@string/list_event" />
</group>
<group android:checkableBehavior="single">
<item
android:id="@+id/settings"
android:checked="false"
android:icon="@drawable/ic_settings_black_24dp"
android:title="@string/settings" />
</group>
</menu>
I did try to add View to drawer.xml but without success (simply nothing appear as divider):
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<group android:checkableBehavior="single">
<item
android:id="@+id/home"
android:checked="false"
android:icon="@drawable/ic_home_black_24dp"
android:title="@string/list_home" />
<item
android:id="@+id/list_event"
android:checked="false"
android:icon="@drawable/ic_list_black_24dp"
android:title="@string/list_event" />
</group>
<View
android:layout_width="fill_parent"
android:layout_height="10dp"
android:background="#000000"/>
<group android:checkableBehavior="single">
<View
android:layout_width="fill_parent"
android:layout_height="10dp"
android:background="#000000"/>
<item
android:id="@+id/settings"
android:checked="false"
android:icon="@drawable/ic_settings_black_24dp"
android:title="@string/settings" />
</group>
</menu>