title: CollapsingToolbarLayout collapsed with nested scrollview by default
body: <p>I don't understand why my <em>CollapsingToolbar</em> layout is collapsed when my view is created by default.</p>
  
  <p>I think this the <code>NestedScrollView</code> the responsible but i don't no why.</p>
  
  <p>This make me crazy.</p>
  
  <p>My activity layout :</p>
  
  <p>
  </p>
  
  <pre><code>    &lt;android.support.design.widget.AppBarLayout
          android:id="@+id/app_bar"
          android:layout_width="match_parent"
          android:layout_height="@dimen/app_bar_height"
          android:fitsSystemWindows="true"
          android:theme="@style/AppTheme.AppBarOverlay"&gt;
          &lt;android.support.design.widget.CollapsingToolbarLayout
              android:id="@+id/toolbar_layout"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:fitsSystemWindows="true"
              app:contentScrim="?attr/colorPrimary"
              app:layout_scrollFlags="scroll|exitUntilCollapsed"&gt;
  
          &lt;android.support.v4.view.ViewPager
              android:id="@+id/pager_images"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:fitsSystemWindows="true"
              android:scaleType="centerCrop"
              app:layout_collapseMode="parallax"/&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/AppTheme.PopupOverlay" /&gt;
          &lt;/android.support.design.widget.CollapsingToolbarLayout&gt;
  
      &lt;/android.support.design.widget.AppBarLayout&gt;
  
      &lt;include layout="@layout/content_product" /&gt;
  
  
  &lt;/android.support.design.widget.CoordinatorLayout&gt;
  </code></pre>
  
  <p>And my content_layout with nested scrollview :</p>
  
  <p>
  </p>
  
  <pre><code>&lt;LinearLayout
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:orientation="vertical"
      android:padding="4dp"&gt;
  
      &lt;include layout="@layout/layout_progress" /&gt;
  
      &lt;TextView
          android:id="@+id/tv_reference"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_gravity="center_horizontal"
          android:layout_marginBottom="2dp"
          android:layout_marginTop="8dp"
          android:ellipsize="end"
          android:maxLines="1"
          android:text=""
          android:textColor="@color/MyApp_gray"
          android:textSize="10sp"
          android:textStyle="bold" /&gt;
  
      &lt;TextView
          android:id="@+id/tv_title"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_gravity="center_horizontal"
          android:layout_marginBottom="8dp"
          android:layout_marginTop="8dp"
          android:ellipsize="end"
          android:fontFamily="sans-serif-light"
          android:maxLines="2"
          android:text=""
          android:textColor="@color/cardview_dark_background"
          android:textSize="16sp" /&gt;
  
  
      &lt;android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
          xmlns:card_view="http://schemas.android.com/apk/res-auto"
          android:id="@+id/card_view_choix"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:layout_marginBottom="4dp"
          android:layout_marginLeft="4dp"
          android:layout_marginRight="4dp"
          android:layout_marginTop="4dp"
          android:background="@android:color/white"
          card_view:cardCornerRadius="2dp"
          card_view:cardElevation="1dp"&gt;
  
          &lt;LinearLayout
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:gravity="center"
              android:orientation="vertical"
              android:paddingLeft="10dp"
              android:paddingRight="10dp"&gt;
  
  
              &lt;TextView
                  android:id="@+id/tv_quantity_title"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:layout_gravity="center_horizontal"
                  android:layout_marginTop="8dp"
                  android:ellipsize="end"
                  android:maxLines="2"
                  android:text="@string/product_quantity"
                  android:textColor="@color/cardview_dark_background"
                  android:textSize="12sp" /&gt;
  
              &lt;com.MyApp.utils.HorizontalNumberPicker
                  android:id="@+id/horizontal_qty_picker"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content" /&gt;
  
  
              &lt;View
                  android:layout_width="match_parent"
                  android:layout_height="1px"
                  android:layout_marginLeft="0dp"
                  android:layout_marginRight="0dp"
                  android:background="@color/MyApp_gray" /&gt;
  
              &lt;LinearLayout
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:layout_margin="20dp"
                  android:gravity="center"
                  android:orientation="horizontal"&gt;
  
                  &lt;TextView
                      android:id="@+id/tv_price"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:gravity="center_horizontal"
                      android:text=""
                      android:textColor="@color/cardview_dark_background"
                      android:textSize="18sp"
                      android:textStyle="" /&gt;
  
                  &lt;TextView
                      android:id="@+id/tv_price_unit"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:gravity="center_horizontal"
                      android:text=" / Unité"
                      android:textColor="@color/cardview_dark_background"
                      android:textSize="16sp" /&gt;
  
              &lt;/LinearLayout&gt;
  
              &lt;TextView
                  android:id="@+id/tv_duration"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:layout_gravity="center_horizontal"
                  android:layout_marginBottom="10dp"
                  android:drawableLeft="@drawable/ic_hourglass_red_18dp"
                  android:drawablePadding="4dp"
                  android:gravity="center"
                  android:maxLines="2"
                  android:text=""
                  android:textColor="@color/MyApp_gray"
                  android:textSize="12sp"
                  android:visibility="gone" /&gt;
  
          &lt;/LinearLayout&gt;
  
      &lt;/android.support.v7.widget.CardView&gt;
  
      &lt;Button
          android:id="@+id/btn_book"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_gravity="center_horizontal"
          android:layout_marginBottom="30dp"
          android:layout_marginTop="10dp"
          android:background="@drawable/btn_primary"
          android:drawableLeft="@drawable/ic_add_shopping_cart_white_24dp"
          android:drawablePadding="10dp"
          android:paddingLeft="20dp"
          android:paddingRight="20dp"
          android:text="@string/store_action_book"
          android:textColor="@android:color/white"
          android:textStyle="bold" /&gt;
  
      &lt;TextView
          android:id="@+id/tv_desc_title"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_gravity="center_horizontal"
          android:layout_marginBottom="2dp"
          android:layout_marginTop="20dp"
          android:ellipsize="end"
          android:maxLines="1"
          android:text="@string/product_description"
          android:textColor="@color/cardview_dark_background"
          android:textSize="14sp"
          android:textStyle="bold" /&gt;
  
      &lt;android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
          xmlns:card_view="http://schemas.android.com/apk/res-auto"
          android:id="@+id/card_view"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:layout_marginBottom="4dp"
          android:layout_marginLeft="4dp"
          android:layout_marginRight="4dp"
          android:layout_marginTop="4dp"
          android:background="@android:color/white"
          card_view:cardCornerRadius="2dp"
          card_view:cardElevation="1dp"&gt;
  
          &lt;LinearLayout
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:orientation="vertical"
              android:paddingLeft="10dp"
              android:paddingRight="10dp"&gt;
  
              &lt;at.blogc.android.views.ExpandableTextView
                  android:id="@+id/tv_description"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:layout_marginBottom="0dp"
                  android:layout_marginTop="10dp"
                  android:ellipsize="end"
                  android:maxLines="5"
                  android:text=""
                  android:textColor="@color/MyApp_gray"
                  android:textIsSelectable="true"
                  android:textSize="12sp"
                  app:animation_duration="1000" /&gt;
  
              &lt;Button
                  android:id="@+id/btn_more"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:layout_gravity="center_horizontal"
                  android:background="@android:color/transparent"
                  android:text="@string/action_expand"
                  android:textColor="@color/MyApp_red" /&gt;
          &lt;/LinearLayout&gt;
  
      &lt;/android.support.v7.widget.CardView&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p></p>
  
  <p>Rendering :
  <a href="https://i.stack.imgur.com/xX1fj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xX1fj.png" alt="Rendering"></a></p>
  
  <p>More strange it still working when i use the <em>NestedScrollView</em> to top. It seems like the <em>NestedScrollView</em> scroll to bottom automatically.</p>