title: How to disable "expand" from AppBarLayout in fragment that has a NestedScrollView?
body: <p>I have two problems:</p>
  
  <p>1) I was able to prevent the "expand" feature when i have no NestedScrollView inside my fragment, but when i do, it keeps expanding, even using:</p>
  
  <pre><code>appBarLayout.setExpanded(false);
  appBarLayout.setActivated(false);
  </code></pre>
  
  <p><strong>There's any way to prevent the expanding of toolbar when i have a NestedScrollView inside a fragment?</strong></p>
  
  <p>2) Even if i don't have a NestedScrollView, i'm still able to expand it when i touch my finger in the toolbar, and scroll down and up. The "expand &amp; collapse" still works.</p>
  
  <p><strong>How can i disable the action of collapse and expand the toolbar when i touch my finger in it and scroll down and up?</strong></p>
  
  <p>Thanks.</p>
  
  <p>Edit1 (More info):</p>
  
  <p>This is the code of my fragment, inside of the FrameLayout.</p>
  
  <pre><code>&lt;android.support.v4.widget.NestedScrollView&gt;
  
      &lt;LinearLayout&gt;
  
          &lt;TextView /&gt;
  
          &lt;android.support.v7.widget.RecyclerView /&gt;
  
      &lt;/LinearLayout&gt;
  
  &lt;/android.support.v4.widget.NestedScrollView&gt;
  </code></pre>
  
  <p>And this is my activity structure:</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"&gt;
  
      &lt;android.support.design.widget.CoordinatorLayout&gt;
  
          &lt;android.support.design.widget.AppBarLayout&gt;
  
              &lt;android.support.design.widget.CollapsingToolbarLayout&gt;
  
                  &lt;android.support.v7.widget.Toolbar /&gt;
  
              &lt;/android.support.design.widget.CollapsingToolbarLayout&gt;
  
          &lt;/android.support.design.widget.AppBarLayout&gt;
  
          &lt;FrameLayout
              android:id="@+id/frame_container"
              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;
  
      ...
  
  &lt;/android.support.v4.widget.DrawerLayout&gt;
  </code></pre>
  
  <p>Edit 2: Th only question left now is:
  <strong>There's any way to prevent the expanding of toolbar when i have a NestedScrollView inside a fragment?</strong></p>