Adding a ripple effect to an Android RecyclerView item

This is a repost of an answer I wrote on Stack Overflow.

By default a RecyclerView item does not give a visual indication when you touch it. It may be simplest to use one of the following options in your RecyclerView row's background:

  • android:background="?android:attr/selectableItemBackground"

However if you are experiencing problems with this method or if you want finer control over the colors, then you can do…



Flutter and Dart developer. Twitter: @suragch1

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store