title: RecyclerView within NestedScrollView Layout Not Scrolling
body: <p>I have some problem with scrolling in RecyclerView within a NestedScrollView, beside CollapsingToolbarLayout.<br>
  The Problem is RecyclerView Does not Scroll and CollapsingToolbarLayout Does not Expand/Collapse. 
  Here is the 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/drawerLayout"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:layoutDirection="rtl"
  tools:context=".MainActivity"&gt;
  
  &lt;android.support.design.widget.CoordinatorLayout
      android:id="@+id/rootLayout"
      android:layout_width="match_parent"
      android:layout_height="match_parent"&gt;
  
      &lt;android.support.design.widget.AppBarLayout
          android:layout_width="match_parent"
          android:layout_height="256dp"
          android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"&gt;
  
          &lt;android.support.design.widget.CollapsingToolbarLayout
              android:id="@+id/collapsingToolbarLayout"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:elevation="12dp"
              app:contentScrim="?attr/colorPrimary"
              app:expandedTitleMarginEnd="64dp"
              app:expandedTitleTextAppearance="@color/trans"
              app:layout_scrollFlags="scroll|enterAlwaysCollapsed"&gt;
  
              &lt;ImageView
                  android:layout_width="match_parent"
                  android:layout_height="match_parent"
                  android:scaleType="centerCrop"
                  android:src="@drawable/header" /&gt;
  
              &lt;ImageView
                  android:layout_width="match_parent"
                  android:layout_height="match_parent"
                  android:scaleType="centerCrop"
                  android:src="@drawable/header_basij" /&gt;
  
              &lt;android.support.v7.widget.Toolbar
                  android:id="@+id/toolbar"
                  android:layout_width="match_parent"
                  android:layout_height="?attr/actionBarSize"
                  android:minHeight="?attr/actionBarSize"
                  android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
                  app:layout_collapseMode="pin"
                  app:popupTheme="@style/ThemeOverlay.AppCompat.Light" /&gt;
  
          &lt;/android.support.design.widget.CollapsingToolbarLayout&gt;
  
      &lt;/android.support.design.widget.AppBarLayout&gt;
  
      &lt;android.support.v4.widget.NestedScrollView
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:fadeScrollbars="true"
          android:fillViewport="true"
          android:scrollbarDefaultDelayBeforeFade="1000"
          android:scrollbarFadeDuration="2000"
          android:scrollbars="vertical"
          app:layout_behavior="@string/appbar_scrolling_view_behavior"&gt;
  
          &lt;LinearLayout
              android:id="@+id/containerLayout"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:orientation="vertical"&gt;
  
              &lt;pl.droidsonroids.gif.GifImageView
                  android:id="@+id/pbar"
                  android:layout_width="100dp"
                  android:layout_height="30dp"
                  android:layout_gravity="center"
                  android:layout_marginTop="8dp"
                  android:background="@color/trans"
                  android:src="@drawable/loader"
                  /&gt;
  
              &lt;LinearLayout
                  android:id="@+id/interneterror"
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:layout_marginTop="20dp"
                  android:orientation="vertical"
                  android:visibility="visible"&gt;
  
                  &lt;TextView
                      android:id="@+id/errorhandler"
                      android:layout_width="match_parent"
                      android:layout_height="wrap_content"
                      android:gravity="center"
                      android:text="خطا در اتصال به اینترنت"
                      android:textColor="#212121" /&gt;
  
                  &lt;Button
                      android:id="@+id/tryagainme"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:layout_gravity="center"
                      android:text="سعی دوباره"
                      android:textColor="@color/colorPrimary" /&gt;
  
              &lt;/LinearLayout&gt;
  
              &lt;android.support.v7.widget.RecyclerView
                  xmlns:android="http://schemas.android.com/apk/res/android"
                  xmlns:tools="http://schemas.android.com/tools"
                  android:id="@+id/recyclerView"
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:fadeScrollbars="true"
                  android:layoutDirection="rtl"
                  android:scrollbars="vertical"
                  tools:context=".MainActivity"/&gt;
  
          &lt;/LinearLayout&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"
      android:layout_width="wrap_content"
      android:layout_height="match_parent"
      android:layout_gravity="start"
      android:layoutDirection="rtl"
      app:headerLayout="@layout/navigation_header"
      app:itemIconTint="@color/nav_item_icon_tint_color"
      app:itemTextColor="@color/nav_item_text_color"
      app:menu="@menu/navigation_menu" /&gt;
  
  &lt;/android.support.v4.widget.DrawerLayout&gt;  
  </code></pre>
  
  <p>Thanks For Help.</p>