No Ripple Effect On Recycleview Touch Event
I have implemented navigation drawer using RecycleView, but when I click on items, no ripple effect shown. My device is running API 22. fragment_navigation.xml:
Solution 1:
Try this as your Row layout
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/selectableItemBackground"
android:focusable="true"
android:clickable="true">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scaleType="fitCenter"
android:src="@android:drawable/ic_input_get"
android:id="@+id/imageView"/>
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="30dp"
android:paddingTop="10dp"
android:text="asa"
android:paddingBottom="10dp"
android:textSize="15dp"
android:textStyle="bold"
android:layout_toRightOf="@+id/imageView"
android:layout_alignParentTop="true"
android:layout_toEndOf="@+id/imageView"/>
</RelativeLayout>
Post a Comment for "No Ripple Effect On Recycleview Touch Event"