Ripple effect on a LinearLayout

I wanted to add a ripple effect on the Bottom Sheet I created in the previous post. This was easily achieved by adding:

  <item name="android:background">?android:attr/selectableItemBackground</item>

to use the default Android ripple or:

`<item name="android:background">?attr/selectableItemBackground</item>

to use a definition in your theme. Here’s the result:

You can see how all the ripples of each item in the LinearLayout are triggered, even though I put the ripple effect per row! Turns out that it was just that I had to add

  <item name="android:clickable">true</item>

to each row container to make it work.