title: Tinting ImageView image resource (png) with color state list
body: <p>I'm not getting the same behavior when tinting an <code>ImageView</code> button with a <strong>color state list</strong> as I do when using a "<strong>drawable selector</strong>" (that points to a pre-rendered alternate image).</p>
  
  <p>When the button is tapped there is no color change whatsoever, and when held down for a second or two a color change does occur but sometimes only in the bottom half of the icon.</p>
  
  <p><strong>note:</strong> I'm trying to make just the button change color, not the entire background, so that it appears to glow when touched (without having to pre-color it in an editor).</p>
  
  <p><strong>note:</strong> I realize these icons are old, and not from the new <em>material</em> set, but I can't use those just yet.</p>
  
  <p><strong>resource/drawable/ic_menu_my_calendar.png</strong></p>
  
  <p><a href="https://i.stack.imgur.com/Yxuip.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Yxuip.png" alt="ic_menu_my_calendar"></a></p>
  
  <p><strong>resource/color/calendar_btn_color_state_list.xml</strong></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:state_pressed="true" android:color="#A0AA3355"/&gt;
    &lt;item android:state_selected="true" android:color="#A0AA3355"/&gt;
    &lt;item android:state_checked="true" android:color="#A0AA3355"/&gt;  
    &lt;item android:color="#FFAAAAAA"/&gt;
  
  &lt;/selector&gt;
  </code></pre>
  
  <p><strong>usage</strong></p>
  
  <pre><code>_calendarButton = new ImageButton(this.Context);
  _calendarButton.SetImageResource(Resource.Drawable.ic_menu_my_calendar);
  _calendarButton.SetBackgroundColor(Color.Transparent);
  
  var csl = ColorStateList.CreateFromXml(Resources, Resources.GetXml(Resource.Color.calendar_btn_color_state_list));
  
  // all options give the same unexpected behavior
  _calendarButton.Drawable.SetTintList(csl);   // option 1
  _calendarButton.Background.SetTintList(csl); // option 2
  _calendarButton.ImageTintList = csl;         // option 3
  
  // tried a bunch of modes, didn't help
  //_calendarButton.ImageTintMode = PorterDuff.Mode.SrcIn;
  </code></pre>
  
  <hr>
  
  <p><strong>The following gives the behavior I'd like to achieve above.</strong></p>
  
  <p><strong>resource/drawable/calendar_btn_selector.xml</strong></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:state_pressed="true" android:drawable="@drawable/ic_menu_my_calendar_pressed"/&gt;
    &lt;item android:drawable="@drawable/ic_menu_my_calendar"/&gt;
  &lt;/selector&gt;
  </code></pre>
  
  <p><strong>usage</strong></p>
  
  <pre><code>_calendarButton = new ImageButton(this.Context);
  _calendarButton.SetImageResource(Resource.Drawable.calendar_btn_selector);
  _calendarButton.SetBackgroundColor(Color.Transparent);
  </code></pre>
  
  <p><strong>UPDATE</strong></p>
  
  <p>Found some cool effects using GIMP for pre-render method</p>
  
  <p><a href="https://i.stack.imgur.com/c1Prc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/c1Prc.png" alt="enter image description here"></a></p>
  
  <p>It was done with layering</p>
  
  <p><a href="https://i.stack.imgur.com/bh2wC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bh2wC.png" alt="enter image description here"></a></p>