title: Get specific drawable from state list drawable
body: <p>I have a state list drawable, and i want to get a specific drawable from the state list drawable:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;selector xmlns:android="http://schemas.android.com/apk/res/android" xmlns:kplus="http://schemas.android.com/apk/res-auto"&gt;
  
  
      &lt;item kplus:key_type_space_alt="true" android:state_pressed="true" android:drawable="@drawable/space_1_pressed" /&gt;
      &lt;item kplus:key_type_space_alt="true" android:drawable="@drawable/space_1_normal" /&gt;
  
      &lt;!-- TopNav keys. --&gt;
  
      &lt;item kplus:key_type_topnav="true" android:state_pressed="true" android:drawable="@drawable/tab_down" /&gt;
      &lt;item kplus:key_type_topnav="true" android:state_selected="true" android:drawable="@drawable/tab_down" /&gt;
      &lt;item kplus:key_type_topnav="true" android:drawable="@drawable/tab_normal" /&gt;
  
      &lt;!-- TopRow keys. --&gt;
  
      &lt;item kplus:key_type_toprow="true" android:state_pressed="true" android:drawable="@drawable/numeric_presseed" /&gt;
      &lt;item kplus:key_type_toprow="true" android:drawable="@drawable/numeric_normal" /&gt;
  &lt;/selector&gt;
  </code></pre>
  
  <p>I select the correct drawable state for each key, something like this:</p>
  
  <pre><code>if (keyIsNumbers) {
      if (KPlusInputMethodService.sNumbersState == 2) {
          drawableState = mDrawableStatesProvider.KEY_STATE_TOPNAV_CHECKED;
      }
  }
  </code></pre>
  
  <p>Now the states are defined like this:</p>
  
  <pre><code>KEY_STATE_TOPNAV_NORMAL = new int[] {keyTypeTopNavAttrId};
  KEY_STATE_TOPNAV_PRESSED = new int[] {keyTypeTopNavAttrId, android.R.attr.state_pressed};
  KEY_STATE_TOPNAV_CHECKED = new int[] {keyTypeTopNavAttrId, android.R.attr.state_selected};
  </code></pre>
  
  <p>Now my question is how to extract the correct drawable for each state ? I need to get the 9patch padding of the drawable, because if the state have different padding on 9patch it will get the padding only for the top drawable, and i want to set the padding manually for each key (drawable.getPadding(rect)).</p>