title: CoordinateLayout collapse LinearLayout with childviews
body: <p>Hey there I have a layout with mainly two <code>Views</code>, the one at the top is for selection and the bottom one shows the content (<code>ScrollView</code> with <code>Listview</code>).
  My desired behavior is that when I scroll through the content the upper <code>View</code> <em>collapses</em> or <em>expands</em> (<code>CollapsingToolbarLayout</code> like).</p>
  
  <p>At the moment I realized the whole layout with <code>layout_weights</code> and I'm not sure how to correctly implement the <code>CoordinateLayout</code> for resizing the the View. </p>
  
  <p>Layout is like this:</p>
  
  <p></p>
  
  <pre><code>&lt;LinearLayout
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:orientation="vertical"&gt;
  
  &lt;LinearLayout
      android:id="@+id/preview_wrapper"
      android:orientation="vertical"
      android:layout_width="match_parent"
      android:layout_height="0dp"&gt;
  
  &lt;android.support.v4.view.ViewPager
      android:id="@+id/view_pager_preview"
      android:layout_width="match_parent"
      android:layout_height="0dp"
      android:layout_weight="0.4"&gt;
  
  &lt;/android.support.v4.view.ViewPager&gt;
  
  
  &lt;CustomIndicator
      android:id="@+id/pager_indicator"
      android:layout_width="match_parent"
      android:layout_height="0dp"
      android:layout_weight="0.1"/&gt;
  &lt;/LinearLayout&gt;
  
  &lt;LinearLayout
      android:layout_width="match_parent"
      android:layout_height="0dp"
      android:layout_weight="0.5"&gt;
  
  &lt;android.support.v4.view.ViewPager
      android:id="@+id/view_pager_content"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:layout_below="@id/view_pager_preview"&gt;
  &lt;ScrollView
      android:id="@+id/scroll_view"
      android:focusable="false"
      android:layout_width="match_parent"
      android:layout_height="match_parent"&gt;
  
  
  &lt;/ScrollView&gt;
  &lt;/android.support.v4.view.ViewPager&gt;
  &lt;/LinearLayout&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p></p>
  
  <p>Would be glad if someone could explain how to implement <code>CoordinateLayout</code>, <code>CollapsingToolbarLayout</code> and <code>AppBarLayout</code> in this case.</p>