title: Android button animation
body: <p>I created a button in Android like this,
  <code>Button btn = new Button(getContext());</code></p>
  
  <p>Initially, the button will be animated when I click on it. It becomes darker when I press on it, and it resumes to its original color when I release the button.</p>
  
  <p>However, if I change the background color, such as <code>btn.setBackgroundColor(Color.RED)</code>, the click animation will no longer there, and this really annoyed me.</p>
  
  <p>What I want is simple, I just want to keep the click animation even I changed the button background color. </p>
  
  <p><hr>
  Updates:</p>
  
  <p>Finally, I chose the library <a href="https://github.com/rey5137/material" rel="nofollow noreferrer">Material</a> for my project in case anyone want to know.</p>
  
  <p>There are several Material UI libraries on Github that backward support SDK version &lt;21, however, it seemed that each of them has its own problems and bugs. Most of them support constructions of UI components using XML quite well, but they do not support construction in Java very well. For example, it seemed that the library I am using cannot construct Material style <code>EditText</code> programmatically in Java.</p>
  
  <p>I tried <a href="https://github.com/traex/RippleEffect" rel="nofollow noreferrer">RippleEffect</a>, <a href="https://github.com/balysv/material-ripple" rel="nofollow noreferrer">material-ripple</a> and <a href="https://github.com/rey5137/material" rel="nofollow noreferrer">Material</a>, and <a href="https://github.com/rey5137/material" rel="nofollow noreferrer">Material</a> worked better in my case.</p>