enCrypter enCrypter - 1 year ago 131
Android Question

How to create color changing animation? (Android)

I have a

and some text in it. I need to create an animation with 30 seconds duration, and it will slowly change the color of text from green to red. Any ideas?

Answer Source

1) 30s is a really, really long time, hardly any users would wait to see the end of it.

2) See Animating with ObjectAnimator. Something like ObjectAnimator.ofInt(textView, "textColor", Color.GREEN, Color.RED) should do what you want. Note, however, that the transition will be linear and will go through a lot of intermediary colors. until it hits #FF0000. You can of course specify the points in the middle but in general linear color transitions (in RGB) are not pretty.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download