title: Custom button colours for disabled and enabled
body: <p>I have an android application that has a button which I want to have black text and background while it is disabled and then a green background with white writing when it is enabled.</p>
  
  <p>Ive got the enabling and disabling working but if I change the colors the button stays the same regardless of its state.</p>
  
  <p>I've read that I need to use a custom selector to set the colors manually and this is what I have got so far:</p>
  
  <p>continuebutton.xml in res/drawable:(green is declared in /res/values/colors.xml)</p>
  
  <pre><code>&lt;selector xmlns:android="http://schemas.android.com/apk/res/android"&gt;
  &lt;item 
  android:state_enabled="false"
      android.textColor ="@android:color/black"
      android:drawable="@android:color/black" /&gt;
  &lt;item 
      android:state_enabled="true"
      android.textColor ="@android:color/white"
      android:drawable="@color/green" /&gt;
  </code></pre>
  
  <p></p>
  
  <p>continuebutton in layout xml file:</p>
  
  <p>
  
  <pre><code> android:id="@+id/continueButton"
     android:layout_width="200dp"
      android:layout_height="55dp"  android:layout_gravity="center" android:paddingTop="10dp" android:textSize="18dp" 
      android:text="@string/continueButton" android:background="@drawable/continuebutton" /&gt;
  </code></pre>
  
  <p>I think I'm doing something wrong in the continuebutton.xml file but I'm not sure how to fix it.</p>
  
  <p>Any help would be greatly appreciated!</p>
  
  <p>Thanks</p>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>I have the background changing color, the last problem is resolve is the text color which is staying black regardless of whether the button is disabled or enabled(should be white for enabled).</p>
  
  <p>Do i need to make a new xml file in res/drawable for the text color?</p>
  
  <p>Any ideas?</p>