How to highlight the selected (clicked) line in recyclerview? The listview was automatic. Thanks in advance.
How to highlight the selected (clicked) line in recyclerview? The listview was automatic. Thanks in advance.
Hello
I'll assume you're talking about the rippe
effect, which is the effect of the image below:
Simplyputtheattributesbelowintotheinflatoparentlayoutbyyouradapter.
android:clickable="true"
android:focusable="true"
android:background="?attr/selectableItemBackground"
Example:
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clickable="true"
android:focusable="true"
android:background="?attr/selectableItemBackground">