title: Auto adjusting image sizes in GridLayout?
body: <p>I have 12 images which I wish to display in a grid of 4 rows by 3 columns.
  For this purpose I am using a GridLayout.
  The images are of different sizes and I wish for them to be scaled so each fill a cell, something like weight in Linear Layout.
  I've played with the <code>ImageViews</code> <code>scaleType</code> and  <code>adjustViewBounds</code> properties but have only succeeded by manually setting <code>layout_width</code> and <code>layout_height</code>.
  Is this possible or should I adjust the sizes in advance? Is there a better way of achieving my goal with a different layout? </p>
  
  <p>I am working with Android Studio 1.1.0, API 21.</p>
  
  <p>Thank you!</p>
  
  <p><strong>activity_set_background.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;GridLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  android:id="@+id/ImagesGridLayout"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:columnCount="3"
  android:rowCount="4"
  tools:context=".SetBackgroundActivity"&gt;
  
  
  &lt;ImageView
      android:id="@+id/background1"
      android:layout_gravity="start|top"
      android:scaleType="centerInside"
      android:adjustViewBounds="true"
      android:layout_rowSpan="1"
      android:layout_columnSpan="1"
      android:src="@drawable/bg1"
      android:layout_width="118dp"
      android:layout_height="97dp"
      android:layout_row="0"
      android:layout_column="0" /&gt;
  
  &lt;ImageView
      android:id="@+id/background2"
      android:layout_gravity="left|top"
      android:src="@drawable/bg2"
      android:layout_width="118dp"
      android:layout_height="97dp"
      android:layout_row="0"
      android:layout_column="1" /&gt;
  
  &lt;ImageView
      android:id="@+id/background3"
      android:layout_gravity="left|top"
      android:src="@drawable/bg3"
      android:layout_width="118dp"
      android:layout_height="97dp"
      android:layout_row="0"
      android:layout_column="2" /&gt;
  
  &lt;ImageView
      android:id="@+id/background4"
      android:layout_gravity="left|top"
      android:src="@drawable/bg4"
      android:layout_width="118dp"
      android:layout_height="97dp"
      android:layout_row="1"
      android:layout_column="0" /&gt;
  
  &lt;ImageView
      android:id="@+id/background5"
      android:layout_gravity="left|top"
      android:src="@drawable/bg5"
      android:layout_width="118dp"
      android:layout_height="97dp"
      android:layout_row="1"
      android:layout_column="1" /&gt;
  
  &lt;ImageView
      android:id="@+id/background6"
      android:layout_gravity="left|top"
      android:src="@drawable/bg6"
      android:layout_width="118dp"
      android:layout_height="97dp"
      android:layout_row="1"
      android:layout_column="2" /&gt;
  
  &lt;ImageView
      android:id="@+id/background7"
      android:layout_gravity="start|top"
      android:scaleType="centerInside"
      android:adjustViewBounds="true"
      android:layout_rowSpan="1"
      android:layout_columnSpan="1"
      android:src="@drawable/bg7"
      android:layout_row="2"
      android:layout_column="0"
      android:layout_width="124dp"
      android:layout_height="123dp" /&gt;
  
  &lt;ImageView
      android:id="@+id/background8"
      android:layout_gravity="left|top"
      android:src="@drawable/bg8"
      android:layout_width="131dp"
      android:layout_height="108dp"
      android:layout_row="2"
      android:layout_column="1" /&gt;
  
  &lt;ImageView
      android:id="@+id/background9"
      android:layout_gravity="left|top"
      android:src="@drawable/bg9"
      android:layout_width="118dp"
      android:layout_height="97dp"
      android:layout_row="2"
      android:layout_column="2" /&gt;
  
  &lt;ImageView
      android:id="@+id/background10"
      android:layout_gravity="left|top"
      android:src="@drawable/bg10"
      android:layout_width="118dp"
      android:layout_height="97dp"
      android:layout_row="3"
      android:layout_column="0" /&gt;
  
  &lt;ImageView
      android:id="@+id/background11"
      android:layout_gravity="left|top"
      android:src="@drawable/bg11"
      android:layout_width="118dp"
      android:layout_height="97dp"
      android:layout_row="3"
      android:layout_column="1" /&gt;
  
  &lt;ImageView
      android:id="@+id/background12"
      android:layout_gravity="left|top"
      android:src="@drawable/bg12"
      android:layout_width="118dp"
      android:layout_height="97dp"
      android:layout_row="3"
      android:layout_column="2" /&gt;
  </code></pre>
  
  <p></p>