I'm adding an ImageView dynamically to my layout and then I want it to fade in. Unfortunately the image is added and then the animation is applied, so it has a flicker to it BEFORE the animation starts. I've tried to initially set the alpha to 0 then AlphaAnimate that in, but it never shows up. I tried using Invisible or Gone on the view visibility.
I'm using an AnimationSet to fade in with other animations, then wrapping that in another AnimationSet. Could this be the issue?
Code for animation is pretty simple. no tricks. but the view looks like it's added then taken away using this.
AlphaAnimation fadeIn = new AlphaAnimation(0,1);
fadeIn.setDuration(duration/3);
fadeIn.setFillAfter(true);
Removing it from a nested AnimationSet solved the issue. I was doing an alpha/tranlate/scale in an AnimationSet, then doing 2 of those in another AnimationSet to do a zoom in/zoom out scenario
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With