title: Setting behaviour of Floating Action Button programmatically
body: <p>I'm using the following guide to implement a scroll aware FAB:</p>
  
  <p><a href="https://guides.codepath.com/android/Floating-Action-Buttons#overview" rel="nofollow">https://guides.codepath.com/android/Floating-Action-Buttons#overview</a></p>
  
  <p>After creating the class, you set up the behaviour by declaring it in XML as follows:</p>
  
  <pre><code>&lt;android.support.design.widget.FloatingActionButton    
  app:layout_behavior="com.codepath.floatingactionbuttontest.ScrollAwareFABBehavior" /&gt;
  </code></pre>
  
  <p>Due to how my code is written, I want to set the behaviour programmatically and not in the XML. I have a feeling that this is done with the CoordinatorLayout but I'm drawing a blank.</p>
  
  <p>Any help would be appreciated!</p>
  
  <p>Thanks in advance.</p>