title: Android - How to get ripple effect on GridView items?
body: <p>I have implemented image gallery using GridView. The layout for the grid item:</p>
  
  <pre><code>&lt;FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:descendantFocusability="blocksDescendants" &gt;
  
      &lt;ImageView
          android:id="@+id/media_item"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:contentDescription="@string/thumbnail_for_image"
          android:scaleType="centerCrop" /&gt;
  
      &lt;View
          android:id="@+id/overlay_view"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:background="?attr/selectableItemBackground" /&gt;
  &lt;/FrameLayout&gt;
  </code></pre>
  
  <p>My goal is to get this nice material ripple effect upon touching the grid item.
  Unfortunately, I couldn't manage to find pure solution for my problem.
  So I came up with using <a href="https://stackoverflow.com/questions/27847151/ripple-effect-on-top-of-image-android">this</a>, as author says, work around - adding overlay <strong>View</strong> on top of main <strong>ImageView</strong>, and setting background to </p>
  
  <p><code>?attr/selectableItemBackground</code></p>
  
  <p>Putting it to ImageView's background or parent FrameLayout background didn't work.</p>
  
  <p>I'm sure, there must be a better way to handle it.</p>