title: CollapsingToolbarLayout in fragments
body: <p>I have an AppCompatActivity that contain fragments and it controls the replacing of many fragments. I want to show differents toolbar depending of fragment to show. </p>
  
  <p>This is the code for main_activity.xml:</p>
  
  <pre><code>&lt;android.support.v4.widget.DrawerLayout 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:id="@+id/drawer"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  tools:context="com.inthecheesefactory.lab.designlibrary.activity.MainActivity"&gt;
  
  &lt;android.support.design.widget.CoordinatorLayout
      android:id="@+id/rootLayout"
      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="@dimen/app_bar_height"
          android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"&gt;
  
          &lt;android.support.design.widget.CollapsingToolbarLayout
              android:id="@+id/collapsing_toolbar"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              app:contentScrim="?attr/colorPrimary"
              app:expandedTitleMarginStart="@dimen/expanded_toolbar_title_margin_start"
              app:layout_scrollFlags="scroll|exitUntilCollapsed"&gt;
  
              &lt;ImageView
                  android:id="@+id/image"
                  android:layout_width="match_parent"
                  android:layout_height="match_parent"
                  android:scaleType="centerCrop"
                  app:layout_collapseMode="parallax"
                  app:layout_collapseParallaxMultiplier="0.7" /&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:popupTheme="@style/ThemeOverlay.AppCompat.Light"
                  app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" /&gt;
  
          &lt;/android.support.design.widget.CollapsingToolbarLayout&gt;
  
      &lt;/android.support.design.widget.AppBarLayout&gt;
  
      &lt;android.support.v4.widget.NestedScrollView
          android:id="@+id/nest_scrollview"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          app:layout_behavior="@string/appbar_scrolling_view_behavior"&gt;
  
          &lt;FrameLayout android:id="@+id/container"
              android:layout_width="match_parent"
              android:clickable="true"
              android:layout_height="match_parent"
              android:layout_below="@+id/appBarLayout"/&gt;
  
      &lt;/android.support.v4.widget.NestedScrollView&gt;
  
  
  &lt;/android.support.design.widget.CoordinatorLayout&gt;
  
  &lt;android.support.design.widget.NavigationView
      android:id="@+id/navigation_view"
      android:layout_height="match_parent"
      android:layout_width="wrap_content"
      android:fitsSystemWindows="false"
      android:layout_gravity="start"
      app:headerLayout="@layout/nav_header_main"
      app:menu="@menu/drawer_menu_login"
      /&gt;
  
  &lt;/android.support.v4.widget.DrawerLayout&gt;
  </code></pre>
  
  <p>With this code the AppBarLayout is collapsed with the colorPrimary on background. I want to disable this collapsed in some fragments and in another fragments I need it to show an image in the ImageView of CollapsingToolBarLayout.
  It works fine in fragments that have an image to collapse in AppBarLayout but in the fragments that not have any image to collapse I want to cancel the collapse to show a normal toolbar without any expand, is it possible??</p>
  
  <p>Thanks in advance.</p>