title: Android xml drawable color change on selected/focused
body: <p>I create a drawable xml file to draw a line using the following code.</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&gt;
          &lt;shape android:shape="line"&gt;
              &lt;solid android:color="@color/colorPrimary" /&gt;
              &lt;size android:width="100dp" android:height="50dp" /&gt;
              &lt;stroke android:width="5dp" android:color="@color/colorPrimary" /&gt;
          &lt;/shape&gt;
      &lt;/item&gt;
  
  &lt;/selector&gt;
  </code></pre>
  
  <p>Result Image:
  <a href="https://i.stack.imgur.com/RsWvq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RsWvq.png" alt="enter image description here"></a></p>
  
  <p>I want to change this image color when it is selected or focused. How can i achieve this? Any guidance would be appreciated. Thankyou</p>