android – Response to touch on cardview


There is a list of clickable CardView built with a RecyclerView and a custom Адаптера with a standard implementation. ViewHolder implements OnClickListener . Missing element "touch" animation. Those. when clicking on any cardView there is no response that the click actually happened, only one OnClickListener .

How can I fasten the animation of the ripple effect? There are probably ready-made implementations from Google itself, but for some reason I can’t find anything other than this . I tried to do it, the animation really appeared, but now the OnClickListener method does not work 🙂 Or rather, it works, but only if you click on the edges of the cardview (apparently where I have the layout_margin defined and where the click animation does not reach). How can the problem be solved? Thank you

cardview.xml markup

<!-- тут много textView и LinearLayout -->


Apparently, these are the features of Android development that you just need to know.

I removed android:clickable="true" from the markup and everything worked as it should. Hope it helps someone in the future.

Scroll to Top