title: Scaling an image to max available width, keeping aspect ratio and avoiding ImageView extra space
body: <p>I have this simple layout XML, and a green_square.png file which is 30X30 pixels </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout 
      xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      android:orientation="vertical" &gt;
  
      &lt;ImageView
          android:background="@color/red"
          android:layout_width="fill_parent"
          android:layout_height="fill_parent"
          android:adjustViewBounds="true"
          android:scaleType="fitStart"
          android:src="@drawable/green_square"/&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>What I'm trying to achieve is scaling the image to fill the parent width, keeping it's aspect ratio with no extra space of the ImageView.</p>
  
  <p>I've added a red background to the ImageView just for reference of the extra space I want to avoid.</p>
  
  <p><a href="https://lh6.googleusercontent.com/-0UaWzbAvVkA/TwLdxtHZx6I/AAAAAAAAByA/YQh5Ein-2Fs/w500-h423-k/screen-shot.jpg" rel="noreferrer"><strong>Here is my goal</strong></a></p>