How do I animate the background of a button from one drawable(xml or single image) to another drawable(xml or single image) set parameters like repeatMode, repeatCount and duration. I already know how to do this for the backgroundColor property. I cannot figure out how to use an objectAnimator or valueAnimator to achieve this for the background instead.
Asked
Active
Viewed 131 times
1
-
1try this link http://stackoverflow.com/questions/18221581/how-to-animate-button-in-android – Naveen Nov 13 '15 at 12:16
-
Hi Naveen. None of those answers have anything to do with background. I know how to animate other attributes like translation,scaling , rotation etc. I am trying to animate the background of a button from drawable to another using property animations. – Rohan Nov 13 '15 at 12:32
-
What do you mean by *"animate background from one drawable to another"*? You want to morph between them? You won't be able to do that. What you can do is to put one View with one background on top of another View (with the second background), and animate the alpha of them so it looks as though your background changes. – Bartek Lipinski Nov 20 '15 at 10:00