I am developing an application for Android. In my application, I add a menu item to the navigation view programmatically. But I had a problem with the development of these elements when they are marked. My problem is that when checking an item, only the color of the text changes. But I want the element to be highlighted as shown below.

I add a menu item programmatically like this
menu.add(CATEGORY_MENU_GROUP_ID, itemId, i + 1, title).setIcon(dIcon).setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
item.setChecked(true);
return true;
}
});
I followed this Android question - Navigation View menu item background color
So I created a background element like this (nav_item_bg.xml)
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<solid android:color="@color/lightGray" >
</solid>
<stroke
android:width="1dp"
android:color="@color/lightGray" >
</stroke>
</shape>
My kind of xml navigation
<android.support.design.widget.NavigationView
app:itemIconTint="@drawable/drawer_item"
app:itemTextColor="@drawable/drawer_item"
android:id="@+id/left_nv_view"
app:headerLayout="@layout/header_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start" />
This is my box_item.xml in Drawable
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="@color/colorAccent" android:state_enabled="true" android:state_checked="true" />
<item android:color="@color/black" android:state_enabled="true" android:state_checked="false" />
<item android:state_enabled="false" android:color="@color/lightGray" />
</selector>
, , . , , . ?
nav_item_bg.xml
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="@color/lightGray" android:state_enabled="true" android:state_checked="true" />
<item android:color="@color/white" android:state_enabled="true" android:state_checked="false" />
<item android:state_enabled="false" android:color="@color/white" />
</selector>
.