title: Set initial height of parallax image in CollapsingToolbarLayout
body: <p>I have an Android activity which uses a CollapsingToolbarLayout inside a CoordinatorLayout to achieve a scrolling / collapsing toolbar with an image as the backdrop / banner.</p>
  
  <p>The image is loaded from the internet and I don't know its size beforehand. </p>
  
  <p>I would like the toolbar to be a certain height (160dp) initially, but if the image is larger than this I would then like to allow the user to scroll down even further to reveal the rest of the image. However, this should never happen automatically. Initial state is 160dp height, but user should be able to scroll it down to increase the height of the image further.</p>
  
  <p>I can't seem to find the correct combination of height / minheight to achieve this. Is this even possible at all?</p>
  
  <p>Here is my layout:</p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      android:orientation="vertical"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:fitsSystemWindows="true"
      android:background="@color/toolbar_text"&gt;
  
      &lt;android.support.design.widget.CoordinatorLayout
              android:id="@+id/coordinatorLayout"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:fitsSystemWindows="true"&gt;
  
          &lt;android.support.design.widget.AppBarLayout
                  android:id="@+id/appBarLayout"
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:fitsSystemWindows="true"&gt;
  
              &lt;android.support.design.widget.CollapsingToolbarLayout
                      android:id="@+id/collapsing_toolbar"
                      android:layout_width="match_parent"
                      android:layout_height="match_parent"
                      app:layout_scrollFlags="scroll|exitUntilCollapsed"
                      app:contentScrim="?attr/colorPrimary"
                      android:fitsSystemWindows="true"&gt;
  
                  &lt;!-- The background banner --&gt;
                  &lt;ImageView
                          android:id="@+id/imgBanner"
                          android:layout_width="match_parent"
                          android:layout_height="160dp"
                          android:scaleType="centerCrop"
                          android:fitsSystemWindows="true"
                          app:layout_collapseMode="parallax"/&gt;
  
                  &lt;android.support.v7.widget.Toolbar
                          android:id="@+id/toolbar"
                          android:layout_width="match_parent"
                          android:layout_height="?attr/actionBarSize"
                          app:layout_collapseMode="pin"
                          app:theme="@style/AppToolbarTheme" /&gt;
  
              &lt;/android.support.design.widget.CollapsingToolbarLayout&gt;
  
          &lt;/android.support.design.widget.AppBarLayout&gt;
  
          &lt;android.support.v4.widget.NestedScrollView
                  android:layout_width="match_parent"
                  android:layout_height="match_parent"
                  android:layout_gravity="fill_vertical"
                  android:clipToPadding="false"
                  app:layout_behavior="@string/appbar_scrolling_view_behavior" &gt;
  
                  ...
          &lt;/android.support.v4.widget.NestedScrollView&gt;
  
      &lt;/android.support.design.widget.CoordinatorLayout&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>The height of the banner image is set to 160dp which controls how large the toolbar is initially, but obviously this way I cannot extend it beyond the 160dp because that is the height of the view.</p>
  
  <p>I tried setting 160dp height to the <code>CollapsingToolbarLayout</code> or the <code>AppBarLayout</code> but nothing helps, it is always maximum 160dp in height and I can only scroll it up (smaller image) and not down, even if the image is much larger and the <code>ImageView</code> is set to scale as <code>wrap_content</code>.</p>
  
  <p>Here's a drawing of what I want to achieve in case it isn't clear:
  <a href="https://dl.dropboxusercontent.com/u/14309718/collapsingtoolbar.jpg" rel="noreferrer"><img src="https://dl.dropboxusercontent.com/u/14309718/collapsingtoolbar.jpg" alt="Mockup of what I want"></a></p>