title: Replace toolbar layout according to the displayed fragment
body: <p>I have an activity with navigation drawer which replace the main_fragment_container on the activity.
  When one of the fragments is displayed I want to change the layout of the toolbar and add a spinner to it (and remove it when the fragment is hidden).</p>
  
  <p>My layout looks like that:</p>
  
  <pre><code>&lt;LinearLayout
      xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      xmlns:sothree="http://schemas.android.com/apk/res-auto"
  android:id="@+id/main_parent_view"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:orientation="vertical"
  android:fitsSystemWindows="true"&gt;
  
  &lt;android.support.v7.widget.Toolbar
  
      android:id="@+id/toolbar"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      sothree:theme="@style/AppTheme.ActionBar" /&gt;
  
  &lt;android.support.v4.widget.DrawerLayout
      android:id="@+id/drawer_layout"
      android:layout_width="match_parent"
      android:layout_height="match_parent"&gt;
  
      &lt;!-- Main layout --&gt;
      &lt;FrameLayout
          android:id="@+id/main_fragment_container"
          android:layout_width="match_parent"
          android:layout_height="match_parent" /&gt;
  
      &lt;!-- Nav drawer --&gt;
      &lt;fragment
          android:id="@+id/fragment_drawer"
          android:name="com.idob.mysoccer.ui.DrawerFragment"
          android:layout_width="@dimen/navigation_drawer_width"
          android:layout_height="match_parent"
          android:layout_gravity="left|start" /&gt;
  &lt;/android.support.v4.widget.DrawerLayout&gt;
  </code></pre>
  
  <p></p>