title: EditText bottom line colour changing on focus
body: <p>Here is the <code>EditText</code>'s <code>abc_edit_text_material</code> drawable XML:</p>
  
  <pre><code>&lt;selector&gt;
      &lt;item android:state_enabled="false" android:drawable="@drawable/abc_textfield_default_mtrl_alpha"/&gt;
      &lt;item android:state_pressed="false" android:state_focused="false" android:drawable="@drawable/abc_textfield_default_mtrl_alpha"/&gt;
      &lt;item android:drawable="@drawable/abc_textfield_activated_mtrl_alpha"/&gt;
  &lt;/selector&gt;
  </code></pre>
  
  <p>It defines a set of images but not colours (and I can not track the moment when the colour is applied).</p>
  
  <p>The following piece of code makes the bottom line always stay red, though its thickness changes with focus (so, the same <code>&lt;selector&gt;</code> is still in use):</p>
  
  <pre><code>Drawable back = edittext.getBackground();
  back.setColorFilter(0xffff0000, PorterDuff.Mode.SRC_ATOP);
  editText.setBackground(back);
  </code></pre>
  
  <p>But if after that I restore the default drawable, colours start changing according to the current focus state (gray unfocused, accent focused):</p>
  
  <pre><code>back.setBackgroundResource(R.drawable.abc_edit_text_material);
  </code></pre>
  
  <p>The questions:</p>
  
  <ol>
  <li>Why is the same <code>selector</code> used after applying a modified <code>Drawable</code>?  </li>
  <li>Why do colours start to respond to focus changes after re-setting the same XML drawable as the background? Is there some object storing a set of colours corresponding to <code>selector</code>'s <code>state_enabled</code>, etc?  </li>
  <li>(Maybe, the answer to this one will also make clear the previous two)<br>
  At which moment and how is colour applied by default? I mean, does it check whether the background is default and which class calls for this colouring? I tried looking through the sources from <code>AppCompatEditText</code> to <code>View</code> and did not find anything like that</li>
  </ol>