title: Scroll away picture and appbar title but leave tabs in Android
body: <p>I use app support and <code>CoordinatorLayout</code>. I was able to implement <code>CollapsingToolbarLayout</code> with <code>ImageView</code> and <code>Toolbar</code> that hide when scrolling. I am struggled with tabs - <code>TabLayout</code> is not collapsed, which is good. The problem is that it does not look nice - I want it to use bottom part of the picture as background.</p>
  
  <p>I moved TabLayout within <code>CollapsingToolbarLayout</code> and then it uses the picture as background but there are two problems - tabs are located at top of the screen and they are hidden when scrolling. </p>
  
  <p><a href="https://i.stack.imgur.com/rM5Ir.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rM5Ir.png" alt="enter image description here"></a></p>
  
  <p>I want to achieve the effect that it will sit at bottom of picture </p>
  
  <p><a href="https://i.stack.imgur.com/nPSAj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nPSAj.png" alt="enter image description here"></a></p>
  
  <p>and it will stay at top of the screen when other parts are scrolled away</p>
  
  <p><a href="https://i.stack.imgur.com/lKLMZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lKLMZ.png" alt="enter image description here"></a></p>
  
  <p>Layout:</p>
  
  <pre><code>&lt;android.support.design.widget.CoordinatorLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:app="http://schemas.android.com/apk/res-auto"
  xmlns:tools="http://schemas.android.com/tools"
  android:layout_width="match_parent"
  android:layout_height="match_parent"&gt;
  
  &lt;android.support.design.widget.AppBarLayout
      android:id="@+id/main.appbar"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
      android:fitsSystemWindows="true"
      &gt;
  
      &lt;android.support.design.widget.CollapsingToolbarLayout
          android:id="@+id/main.collapsing"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          app:layout_scrollFlags="scroll|enterAlways|snap"
          android:fitsSystemWindows="true"
          app:contentScrim="?attr/colorPrimary"
          app:expandedTitleMarginStart="4dp"
          app:expandedTitleMarginEnd="64dp"
          &gt;
  
          &lt;ImageView
              android:id="@+id/main.backdrop"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:scaleType="centerCrop"
              android:fitsSystemWindows="true"
              android:src="@drawable/digit1_hill"
              app:layout_collapseMode="parallax"
              /&gt;
  
          &lt;android.support.v7.widget.Toolbar
              android:id="@+id/main.toolbar"
              android:layout_width="match_parent"
              android:layout_height="?attr/actionBarSize"
              app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
              app:layout_collapseMode="pin"
              /&gt;
  
          &lt;android.support.design.widget.TabLayout
              android:id="@+id/main.tabs"
              android:layout_width="fill_parent"
              android:layout_height="?attr/actionBarSize"
              app:tabSelectedTextColor="?android:attr/textColorPrimaryInverse"
              app:tabIndicatorColor="?android:attr/textColorPrimaryInverse"
              app:tabIndicatorHeight="4dp"
              /&gt;
      &lt;/android.support.design.widget.CollapsingToolbarLayout&gt;
  &lt;/android.support.design.widget.AppBarLayout&gt;
  
  &lt;android.support.v4.view.ViewPager
      android:id="@+id/dashboard.viewpager"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      app:layout_behavior="@string/appbar_scrolling_view_behavior"
      /&gt;
  &lt;/android.support.design.widget.CoordinatorLayout&gt;
  </code></pre>