title: Recording button states
body: <p>I'm creating recording button and I need these states, but I don't know how to implement them with the xml. I've tried activated, selected, and pressed states but these are not getting the job done. I have all the drawables created already but the states are screwing me up.</p>
  
  <p><strong>States I need the recording button to do:</strong></p>
  
  <p><strong>State 1.</strong> default Image of button (initial state) </p>
  
  <p><strong>State 2.</strong> Set drawable of button when the button is in the process of being pressed down </p>
  
  <p><strong>State 3.</strong> Set drawable of button after it has been pressed (after pressed down) and we are now in recording mode</p>
  
  <p><strong>State 4.</strong> After the button is clicked again return back to initial state</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/record_button_default_state" /&gt;
  
  &lt;item
      android:state_selected="true"
      android:drawable="@drawable/record_button_recording" /&gt;
  
  &lt;item
      android:state_selected="false"
      android:drawable="@drawable/record_button_default_state" /&gt;
  
  &lt;item
      android:state_pressed="true"
      android:drawable="@drawable/record_button_pressed_state" /&gt;
  </code></pre>
  
  <p></p>
  
  <p><strong>OnClickListener()</strong></p>
  
  <pre><code>case R.id.record_button:
          if (mr.getState() == ExtAudioRecorder.State.READY){
              mr.start();
              record_button.setSelected(true);
  
          }
          else if(mr.getState() == ExtAudioRecorder.State.RECORDING){
              mr.stop();
              mr.release();
  
              record_button.setSelected(false);
  
              setMediaPlayerPathAndPrepare();
  
  
          }
          break;
  </code></pre>