I need to add a counter to the NavigationDrawer's field nav_films_been_wathced
, but I can't found how to do that correctly. I'm using com.android.support:design:23.0.1
Here is my code:
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:openDrawer="start">
<include
layout="@layout/app_bar_main"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<android.support.design.widget.NavigationView
android:id="@+id/nav_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:fitsSystemWindows="true"
app:headerLayout="@layout/nav_header_main"
app:menu="@menu/activity_main_drawer" />
</android.support.v4.widget.DrawerLayout>
My menu.xml:
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<group
android:id="@+id/group_top"
android:checkableBehavior="single">
<item
android:id="@+id/nav_main"
android:icon="@drawable/ic_home"
android:title="@string/nav_main" />
<item
android:id="@+id/nav_films_been_wathced"
android:icon="@drawable/ic_films"
android:title="@string/nav_films_been_wathced" />
</group>
<group
android:id="@+id/group_bottom"
android:checkableBehavior="none">
<item
android:id="@+id/nav_about"
android:icon="@drawable/ic_info"
android:title="@string/nav_about" />
</group>
</menu>