title: Where should 'app:layout_behavior' be set?
body: <p>Should it be set at the <a href="http://developer.android.com/reference/android/support/design/widget/AppBarLayout.html" rel="noreferrer">AppBarLayout</a> sibling's parent or at the first Scrollable View inside its sibling?</p>
  
  <hr>
  
  <p>With <a href="http://developer.android.com/design/material/index.html" rel="noreferrer">Material Design for Android</a>, there are <a href="http://developer.android.com/reference/android/view/View.html" rel="noreferrer">Views</a> that let us work with the behavior of the layout depending on its surroundings, one of them is the <a href="http://developer.android.com/reference/android/support/design/widget/CoordinatorLayout.html" rel="noreferrer">CoordinatorLayout</a>, as <a href="https://guides.codepath.com/android/Handling-Scrolls-with-CoordinatorLayout" rel="noreferrer">this CodePath guide</a> mentions:</p>
  
  <blockquote>
    <p>CoordinatorLayout extends the ability to accomplish many of the
    Google's Material Design scrolling effects. Currently, there are
    several ways provided in this framework that allow it to work without
    needing to write your own custom animation code.</p>
  </blockquote>
  
  <p>The one I'm interested in now is:</p>
  
  <blockquote>
    <ul>
    <li>Expanding or contracting the Toolbar or header space to make room for    the main content.</li>
    </ul>
  </blockquote>
  
  <p>So, we would use the <a href="http://developer.android.com/reference/android/support/design/widget/AppBarLayout.html" rel="noreferrer">AppBarLayout</a> with a <a href="http://developer.android.com/reference/android/widget/Toolbar.html" rel="noreferrer">Toolbar</a> with <code>app:layout_scrollFlags</code> set and another <a href="http://developer.android.com/reference/android/view/ViewGroup.html" rel="noreferrer">ViewGroup</a> sibling to the <a href="http://developer.android.com/reference/android/support/design/widget/AppBarLayout.html" rel="noreferrer">AppBarLayout</a> with <code>app:layout_behavior</code>.</p>
  
  <p>My question is: in what exact ViewGroup (or maybe View) should we put that
  <code>app:layout_behavior</code>?</p>
  
  <hr>
  
  <p>So far, I've tried with (And they have all <strong>worked</strong>, and they are all siblings to the AppBarLayout):</p>
  
  <ul>
  <li><p>Scrolling View</p></li>
  <li><p>First ViewGroup inside a Scrollable View</p></li>
  <li><p>ScrollView inside a ViewGroup</p></li>
  </ul>
  
  <p>And this one didn't work:</p>
  
  <ul>
  <li>ViewGroup with no Scrollable View children.</li>
  </ul>
  
  <hr>
  
  <p>There are multiple examples online, but none of them really state where should you put it, like: </p>
  
  <p><a href="http://www.ingloriousmind.com/blog/quick-look-on-the-coordinatorlayout/" rel="noreferrer">http://www.ingloriousmind.com/blog/quick-look-on-the-coordinatorlayout/</a>
  <a href="https://guides.codepath.com/android/Handling-Scrolls-with-CoordinatorLayout" rel="noreferrer">https://guides.codepath.com/android/Handling-Scrolls-with-CoordinatorLayout</a>
  <a href="https://developer.android.com/training/basics/firstapp/building-ui.html" rel="noreferrer">https://developer.android.com/training/basics/firstapp/building-ui.html</a>
  <a href="https://www.bignerdranch.com/blog/becoming-material-with-android-design-support-library/" rel="noreferrer">https://www.bignerdranch.com/blog/becoming-material-with-android-design-support-library/</a> </p>