Próbuję dodać element Ripple
Efekt do elementu . Miałem wygląd online, ale nie mogłem znaleźć tego, czego potrzebuję. Próbowałem android:background
atrybut do RecyclerView
się i ustawić ją na "?android:selectableItemBackground"
ale to nie działa .:Efekt marnowania kliknięcia elementu recyclerview
Mój układ nadrzędny jest jak ten
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10dp">
<android.support.v7.widget.RecyclerView
android:id="@+id/dailyTaskList"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clickable="true"
android:focusable="true"
android:scrollbars="vertical" />
</LinearLayout>
i adaptera szablonu pokazano poniżej
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:custom="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="5dp">
<TextView
android:id="@+id/txtTitle"
style="@style/kaho_panel_sub_heading_textview_style"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/txtDate"
style="@style/kaho_content_small_textview_style"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
</LinearLayout>
Uprzejmie podaj mi rozwiązanie
Do którego rodzica wypróbowałeś 'android: background ="? Android: attr/selectableItemBackground "'? –