I have a recyclerview with items in it. If i click on a item, it does not give any feedback. The backgorund does not get slightly darker like in a listview. This mean I don't know I pressed the item. Is there some default selector available or should I create my own?
Asked
Active
Viewed 691 times
0
-
1it is "?attr/selectableItemBackground" – pskink Nov 23 '15 at 21:06
2 Answers
0
For RecyclerView there is no such parameter as selector in ListView. In Material Theme there are some selectors. I used following attribute attr/listChoiceBackgroundIndicator
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="@dimen/list_item_height"
android:foreground="?attr/listChoiceBackgroundIndicator">
It can be set as android:background.

m0rphine
- 126
- 4
0
You can try this.. https://stackoverflow.com/a/19780767/3209739
It gives ripple effect. So you can easily realise that you pressed an item.