title: How to use StateListAnimator?
body: <p>From the <a href="https://developer.android.com/preview/material/animations.html#viewstate">docs</a>:</p>
  
  <blockquote>
    <p>The new StateListAnimator class lets you define animators that run
    when the state of a view changes. The following example shows how to
    define an StateListAnimator as an XML resource:</p>
  </blockquote>
  
  <pre><code>&lt;!-- animate the translationZ property of a view when pressed --&gt; &lt;selector xmlns:android="http://schemas.android.com/apk/res/android"&gt;  
    &lt;item android:state_pressed="true"&gt;
      &lt;set&gt;
        &lt;objectAnimator android:propertyName="translationZ"
          android:duration="100"
          android:valueTo="2"
          android:valueType="floatType"/&gt;
          &lt;!-- you could have other objectAnimator elements
               here for "x" and "y", or other properties --&gt;
      &lt;/set&gt;   
    &lt;/item&gt;   
    &lt;item android:state_enabled="true"
      android:state_pressed="false"
      android:state_focused="true"&gt;
      &lt;set&gt;
        &lt;objectAnimator android:propertyName="translationZ"
          android:duration="100"
          android:valueTo="2"
          android:valueType="floatType"/&gt;
      &lt;/set&gt; 
    &lt;/item&gt; 
  &lt;/selector&gt;
  </code></pre>
  
  <p>However, it says nothing about how to actually <em>use</em> this xml file. There seems to be no method on the <code>Resources</code> class to get a <code>StateListAnimator</code>, and the <code>StateListAnimator</code> class does not provide any info either.</p>
  
  <p>How can we use this?</p>