title: how to remove empty spaces of imageview without cropping them
body: <blockquote>
  <p>I'm trying to add a <code>ImageView</code> to my <code>CardView</code> but i don't know how
  to set image inside of <code>ImageView</code> that has a Full Width
  (<code>match_parent</code>) and a <code>wrap_content</code> height ! By default there would
  be some spaces in Imageview (bottom and top parts, depend on width and
  height of image) as you see below :</p>
  </blockquote>
  <p><a href="https://i.stack.imgur.com/tNUGE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tNUGE.png" alt="how does instagram fill it's images without cropping them?" /></a></p>
  <blockquote>
  <p>any way to remove these empty spaces without cropping images ?</p>
  </blockquote>
  <p><strong>here is my layout :</strong></p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;android.support.v7.widget.CardView xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
  xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;
  android:id=&quot;@+id/cardview2&quot;
  android:layout_width=&quot;match_parent&quot;
  android:layout_height=&quot;wrap_content&quot;
  android:layout_margin=&quot;5dp&quot;
  android:clickable=&quot;true&quot;
  android:focusable=&quot;true&quot;
  android:foreground=&quot;?android:attr/selectableItemBackground&quot;
  app:cardElevation=&quot;3dp&quot;&gt;
  
  &lt;RelativeLayout
      android:layout_width=&quot;match_parent&quot;
      android:layout_height=&quot;wrap_content&quot;&gt;
  
      &lt;RelativeLayout
          android:id=&quot;@+id/cardviewLayout&quot;
          android:layout_width=&quot;match_parent&quot;
          android:layout_height=&quot;wrap_content&quot;&gt;
  
          &lt;ImageView
              android:layout_width=&quot;match_parent&quot;
              android:layout_height=&quot;wrap_content&quot;
              android:src=&quot;@drawable/ryan_gosling&quot;
              /&gt;
      &lt;/LinearLayout&gt;
  
  &lt;/RelativeLayout&gt;
  &lt;/android.support.v7.widget.CardView&gt;
  </code></pre>