How to use ObjectAnimator to change a the background of a View with a crossfade (or fade out - fade in) animation?

Posted by jul on Stack Overflow See other posts from Stack Overflow or by jul
Published on 2012-03-23T17:20:26Z Indexed on 2012/03/23 17:29 UTC
Read the original article Hit count: 206

Filed under:

is there any way to create one animation with ObjectAnimator to change the background of a View with a crossfade animation?

Something like

ObjectAnimator.ofObject(<myView.background>, <crossfade or fade in -fade out>, <resources_1>, <resources_2>);

I know I can do a fade out of one image, set a listener to detect the end of the animation, and fade in the other image. I'd just like to know if there's a more elegant way...

Thanks

© Stack Overflow or respective owner

Related posts about animation