title: Issue to hide Toolbar when scrolling in android
body: <p>I've an Activity with an NavigationDrawer and a Toolbar. I'm facing a problem when i want disappear a toobar when one of child fragment view is scrolled. Everything works fine except that there is some view coming up from the bottom which has the exact same size as the toolbar that is disappearing.</p>
  
  <p>I made an GIF Animation that shows the problem. Due to my reputation i can not post the image directly but <a href="http://i.stack.imgur.com/Pe5Tl.gif" rel="nofollow">this gif</a> and <a href="http://i.giphy.com/3oEduZPUZv5QvUIigo.gif" rel="nofollow">this gif</a> shows the problem</p>
  
  <p>I tried to figure out where this is coming from. It seems that its from my container FrameLayout where my fragment views are placed during runtime. I changed its background to green so i can identify it. </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_layout"
  android:layout_width="match_parent"
  android:layout_height="match_parent" &gt;
  
  &lt;LinearLayout
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:orientation="vertical" &gt;
  
      &lt;include
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          app:layout_scrollFlags="scroll|enterAlways"
          layout="@layout/toolbar" /&gt;
  
      &lt;FrameLayout
          android:id="@+id/container"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:background="@color/darkGreen"
          tools:context="org.cddevlib.breathe.MainActivity" /&gt;
  &lt;/LinearLayout&gt;
  
  &lt;fragment
      android:id="@+id/navigation_drawer"
      android:name="org.cddevlib.breathe.NavigationDrawerFragment"
      android:layout_width="@dimen/navigation_drawer_width"
      android:layout_height="match_parent"
      android:layout_gravity="start"
      tools:layout="@layout/fragment_navigation_drawer" /&gt; &lt;/android.support.v4.widget.DrawerLayout&gt;
  </code></pre>
  
  <p>This is the Toolbars Layout that is included</p>
  
  <pre><code>&lt;android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/toolbar"
    android:layout_width="match_parent"
    android:layout_height="?attr/actionBarSize"
    app:layout_collapseMode="pin"
    app:layout_scrollFlags="scroll|enterAlways"
    android:fitsSystemWindows="true"
    app:popupTheme="@style/ThemeOverlay.AppCompat.Light"&gt;
  &lt;/android.support.v7.widget.Toolbar&gt;
  </code></pre>
  
  <p>And finally a snippet from the fragments view that is loaded:</p>
  
  <p></p>
  
  <pre><code>&lt;android.support.design.widget.AppBarLayout
      android:id="@+id/appBarLayout"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:background="@color/black" &gt;
  
     &lt;include
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      app:layout_scrollFlags="scroll|enterAlways"
      layout="@layout/toolbar" /&gt;
  
      &lt;android.support.v4.widget.NestedScrollView
          xmlns:android="http://schemas.android.com/apk/res/android"
          xmlns:app="http://schemas.android.com/apk/res-auto"
          android:id="@+id/scrollView1"
          android:layout_width="fill_parent"
          android:layout_height="fill_parent"
          app:layout_behavior="@string/appbar_scrolling_view_behavior"
          android:background="@color/white"
          android:fillViewport="true" &gt;
  
          (...)
  </code></pre>
  
  <p>Note that i'm including the Toolbar again in that layout because i want different Toolbars for each fragment in my application by hiding / adding the toolbar. </p>
  
  <pre><code>    toolbar = (Toolbar) ((View) vw).findViewById(R.id.toolbar);
              if (toolbar != null) {
                  // // for crate home button
                  activity = (AppCompatActivity) getActivity();
                  activity.getSupportActionBar().hide();
                  toolbar.setBackgroundDrawable(new ColorDrawable((ColorUtils.getColorDark(DataModule.getInstance()
                          .getMainActivity()))));
                  activity.setSupportActionBar(toolbar);
                  activity.getSupportActionBar().setDisplayHomeAsUpEnabled(true);
              }
  </code></pre>
  
  <p><strong>SOLUTION</strong></p>
  
  <p>So thanks to sanat shukla answer is firgured out that my problem was that i used an AppBarLayout too much in my fragments view. In my fragments view, AppBarLayout was the main layout for all of my components, but it should not! Its intended to hold the toolbar content! Thanks</p>