title: Android - horizontal images to fit screen
body: <p>I have an Android horizontal LinearLayout with 5 images in it. I want the 5 images to fit the screen horizontally while keeping the aspect ratio. Each image is 128x128 pixel. 
  The problem is that while the width is set like what I wanted the <strong>height</strong> of the images remain the same, so they look like this on a bigger screen (this is the Nexus 7):</p>
  
  <p><img src="https://i.stack.imgur.com/35NrU.png" alt="enter image description here"></p>
  
  <p>What I have now:</p>
  
  <pre><code>&lt;LinearLayout
      android:id="@+id/linearLayout1"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:layout_alignParentTop="true"
      android:layout_centerHorizontal="true" &gt;
  
      &lt;ImageView
          android:id="@+id/imageView1"
          android:layout_width="0dp"
          android:layout_height="wrap_content"
          android:layout_weight="1"
          android:cropToPadding="true"
          android:scaleType="fitXY"
          android:src="@drawable/image01" /&gt;
  
      &lt;ImageView
          android:id="@+id/imageView2"
          android:layout_width="0dp"
          android:layout_height="wrap_content"
          android:layout_weight="1"
          android:scaleType="fitXY"
          android:src="@drawable/image02" /&gt;
  
      &lt;ImageView
          android:id="@+id/imageView3"
          android:layout_width="0dp"
          android:layout_height="wrap_content"
          android:layout_weight="1"
          android:scaleType="fitXY"
          android:src="@drawable/image03" /&gt;
  
      &lt;ImageView
          android:id="@+id/imageView4"
          android:layout_width="0dp"
          android:layout_height="wrap_content"
          android:layout_weight="1"
          android:scaleType="fitXY"
          android:src="@drawable/image04" /&gt;
  
      &lt;ImageView
          android:id="@+id/imageView5"
          android:layout_width="0dp"
          android:layout_height="wrap_content"
          android:layout_weight="1"
          android:scaleType="fitXY"
          android:src="@drawable/image05" /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>Thanks for the help</p>