title: How to make StateListDrawable change background when button is pressed? (in xml)
body: <p>I am doing <a href="https://codelabs.developers.google.com/codelabs/android-training-drawables-styles-and-themes/index.html?index=..%2F..android-training#7" rel="nofollow noreferrer">Google's android tutorial on Drawables</a>.
  I completed it but am stuck on this 'challenge' task:</p>
  
  <blockquote>
    <p>create a Drawable resource that changes the background of the
    ImageButton to the same color as the border when the state of the
    ImageButton is "pressed". You should also set the color of the text
    inside the ImageButton elements to a selector that makes it white when
    the button is "pressed".</p>
  </blockquote>
  
  <p>To the <a href="https://github.com/google-developer-training/android-fundamentals-apps-v2/blob/master/Scorekeeper/app/src/main/res/values/styles.xml" rel="nofollow noreferrer">styles.xml see here for completed tutorial code before 'challenge'</a>, I modified ScoreButtons to access a new drawable, button_state</p>
  
  <pre><code>&lt;style name="ScoreButtons" parent="Widget.AppCompat.Button"&gt;
      &lt;item name="android:background"&gt;@drawable/button_state&lt;/item&gt;
      &lt;item name="android:tint"&gt;@color/colorPrimary&lt;/item&gt;
  &lt;/style&gt;
  </code></pre>
  
  <p>drawable/button_state following the android docs <a href="https://developer.android.com/guide/topics/resources/drawable-resource.html#StateList" rel="nofollow noreferrer">https://developer.android.com/guide/topics/resources/drawable-resource.html#StateList</a></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;selector xmlns:android="http://schemas.android.com/apk/res/android"&gt;
      &lt;item
          android:drawable="@drawable/button_background_pressed"
          android:state_pressed="true"
          /&gt;
  
      &lt;item
          android:drawable="@drawable/button_background_released"
          android:state_pressed="false"
          /&gt;
  &lt;/selector&gt;
  </code></pre>
  
  <p>button_background_pressed.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;shape
      xmlns:android="http://schemas.android.com/apk/res/android"
      android:shape="oval"&gt;
      &lt;stroke
          android:width="2dp"
          android:color="@color/colorPrimary"/&gt;
      android:background="@color/colorPrimary"
  &lt;/shape&gt;
  </code></pre>
  
  <p>button_background_released.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;shape
      xmlns:android="http://schemas.android.com/apk/res/android"
      android:shape="oval"&gt;
      &lt;stroke
          android:width="2dp"
          android:color="@color/colorPrimary"/&gt;
  &lt;/shape&gt;
  </code></pre>
  
  <p>There is no change when I press the buttons. What am I missing?</p>