title: AppbarLayout Height & Scrolling
body: <p>I am using CoordinatorLayout, AppBarLayout and CollapsingToolbarLayout. I have set <code>layout_scrollFlags="scroll|enterAlwaysCollapsed"</code>. In NestedScrollView, I have LinearLayout which height vary based on TextView Content size.</p>
  
  <p><strong>Problem:</strong> When I have big content in TextView say 100 lines then my toolbar collapsed as expected but if I have say 2-3 lines in the TextView  then toolbar still collapsed where as my page does not scroll. </p>
  
  <p><strong>Help:</strong> Please help in fixing this page so that if my page has enough scrollable content then only toolbar should be collapsed otherwise it should not collapse.</p>
  
  
  
  <p></p>
  
  <pre><code>&lt;android.support.design.widget.AppBarLayout
      android:id="@+id/appbar"
      android:layout_width="match_parent"
      android:layout_height="@dimen/detail_backdrop_height"
      android:fitsSystemWindows="true"
      android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"&gt;
  
      &lt;android.support.design.widget.CollapsingToolbarLayout
          android:id="@+id/collapsing_toolbar"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:fitsSystemWindows="true"
          app:contentScrim="?attr/colorPrimary"
          app:expandedTitleMarginEnd="64dp"
          app:expandedTitleMarginStart="48dp"
          app:layout_scrollFlags="scroll|enterAlwaysCollapsed"&gt;
  
          &lt;ImageView
              android:id="@+id/backdrop"
              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/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="fill_parent"
  
      app:layout_behavior="@string/appbar_scrolling_view_behavior"&gt;
  
  
      &lt;LinearLayout
  
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:orientation="vertical"&gt;
  
          &lt;TextView
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:text="Info"
              android:textAppearance="@style/TextAppearance.AppCompat.Title" /&gt;
  
          &lt;TextView
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:text="@string/cheese_ipsum" /&gt;
  
      &lt;/LinearLayout&gt;
  
  
  &lt;/android.support.v4.widget.NestedScrollView&gt;
  </code></pre>
  
  <p></p>