I am having trouble getting the click effect visible in my inbox.
I have an xml action layout as follows:
<?xml version="1.0" encoding="utf-8"?> <android.support.v4.widget.DrawerLayout android:id="@+id/drawer_layout" 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: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>
As you can see, I put the NavigationView in my DrawerLayout and then populate the NavigationView with the xml menu file.
My activity_main_drawer.xml as follows:
<menu xmlns:android="http://schemas.android.com/apk/res/android" > <group> <item android:id="@+id/id1" android:title="Item 1"/> <item android:id="@+id/id2" android:title="Item 2"/> <item android:id="@+id/id3" android:title="Item 3"/> <item android:id="@+id/id4" android:title="Item 4"/> </group>
Unfortunately, when I do this, I have no visual effect after clicking on an item in this drawer menu. I would like to have the so-called "ripple effect". How can i do this?
source share