title: How to fix a view in collapsing toolbar while scrolling?
body: <p>I want to implement collapsing toolbar with two <code>EditText</code> in it, for the purpose of user input. I'm following <a href="https://stackoverflow.com/questions/32425357/toolbar-with-edittext-material-design">this</a> answer. The answer gives perfect solution for adding two <code>EditText</code> into the collapsing toolbar. But the behavior is not as expected. </p>
  
  <p><strong>What I've achieved:</strong></p>
  
  <p><a href="https://i.stack.imgur.com/VPg5l.gif" rel="noreferrer"><img src="https://i.stack.imgur.com/VPg5l.gif" alt="enter image description here"></a></p>
  
  <p><strong>Expected Behavior:</strong>  </p>
  
  <p><a href="https://i.stack.imgur.com/O6eBT.gif" rel="noreferrer"><img src="https://i.stack.imgur.com/O6eBT.gif" alt="enter image description here"></a></p>
  
  <p><strong>My XML code</strong></p>
  
  <pre><code>&lt;android.support.design.widget.CoordinatorLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:app="http://schemas.android.com/apk/res-auto"
  android:layout_width="match_parent"
  android:layout_height="wrap_content"
  android:fitsSystemWindows="true"&gt;
  
  &lt;android.support.design.widget.AppBarLayout
      android:id="@+id/appbar"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"      &gt;
  
      &lt;android.support.design.widget.CollapsingToolbarLayout
          android:id="@+id/collapsing_tool_bar_layout"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          app:elevation="0dp"
          app:expandedTitleTextAppearance="@style/Widget.AppCompat.ActionBar.TabText"
          app:layout_scrollFlags="scroll|enterAlways"
          app:statusBarScrim="?attr/colorAccent"&gt;
  
  
          &lt;android.support.v7.widget.Toolbar
              android:id="@+id/toolbar_1"
              android:layout_width="match_parent"
              android:layout_height="?attr/actionBarSize"
              android:background="@color/primary"
              android:minHeight="?attr/actionBarSize"
              android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
              app:layout_collapseMode="none"
              app:layout_scrollFlags="scroll|exitUntilCollapsed"
              app:popupTheme="@style/ThemeOverlay.AppCompat.Light"&gt;
          &lt;/android.support.v7.widget.Toolbar&gt;
  
      &lt;/android.support.design.widget.CollapsingToolbarLayout&gt;
  
      &lt;android.support.v7.widget.Toolbar
          android:id="@+id/toolbar_2"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:background="@color/primary"
          android:minHeight="?attr/actionBarSize"
          android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
          app:layout_collapseMode="none"
          app:elevation="0dp"
          app:layout_scrollFlags="scroll|exitUntilCollapsed"
          app:popupTheme="@style/ThemeOverlay.AppCompat.Light"&gt;
  
          &lt;LinearLayout
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:orientation="vertical"
              android:paddingLeft="32dp"
              android:paddingTop="16dp"
              android:paddingBottom="56dp"
              android:paddingRight="16dp"&gt;
  
              &lt;android.support.design.widget.TextInputLayout
                  android:id="@+id/lNameLayout"
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:layout_below="@+id/fNameLayout"
                  android:layout_marginTop="10dp"&gt;
  
                  &lt;EditText
                      android:id="@+id/ltitle"
                      android:layout_width="match_parent"
                      android:layout_height="wrap_content"
                      android:ems="10"
                      android:hint="Title"/&gt;
              &lt;/android.support.design.widget.TextInputLayout&gt;
  
              &lt;android.support.design.widget.TextInputLayout
                  android:id="@+id/lNameLayout2"
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:layout_below="@+id/fNameLayout"
                  android:layout_marginTop="10dp"
                  android:layout_marginBottom="10dp"&gt;
  
                  &lt;EditText
                      android:id="@+id/ldesc"
                      android:layout_width="match_parent"
                      android:layout_height="wrap_content"
                      android:ems="10"
                      android:hint="Description"/&gt;
              &lt;/android.support.design.widget.TextInputLayout&gt;
  
  
          &lt;/LinearLayout&gt;
      &lt;/android.support.v7.widget.Toolbar&gt;
  
  &lt;/android.support.design.widget.AppBarLayout&gt;
  
  
  &lt;android.support.v4.widget.NestedScrollView
      android:layout_width="match_parent"
      app:layout_behavior="@string/appbar_scrolling_view_behavior"
      android:layout_height="match_parent"&gt;
      &lt;LinearLayout
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:orientation="vertical"
          android:paddingTop="10dp"&gt;
  
          &lt;!--my widgets here--&gt;
  
      &lt;/LinearLayout&gt;
  &lt;/android.support.v4.widget.NestedScrollView&gt;
  </code></pre>
  
  <p></p>
  
  <p>I know I can do this type of styling using <code>scrollFlag</code>. I've read <a href="https://guides.codepath.com/android/Handling-Scrolls-with-CoordinatorLayout" rel="noreferrer">this post about scroll flags.</a>But can't find exactly how to use it for this purpose.<br>
  I also want to change the font size of the <code>EditText</code> as shown in the above <code>GIF</code>. </p>
  
  <p>But first question is how to fix one view in toolbar and hide another as user scrolls up. It would be nice if someone explain with suitable example. </p>