I have a mix of animations working in different scenarios. As an example:
I have fade-in and fade-out animations in a small circular bitmap. On ACTION_DOWNshould start fade-in
and on ACTION_UP, when the ends of the attenuation end , the attenuation must be performed. BUT, if the user raises his finger in front of the ends of the attenuation, he should stop there ( fadein.cancel()), the fade-out should start with the THAT alpha value. I donβt want a new animator of objects every time, I defined such an animator in the constructor
fadein = Objectanimator.ofFloat(bitmap, "alpha", 1.0f);
fadeOut = Objectanimator.ofFloat(bitmap, "alpha", 0.0f);
What happens if I create a problem, as mentioned (quickly typing my finger), the fadeout animator will pick an alpha value in which the fade-in value will stop and it will be RETAIN. That is, the 2nd time, he will NOT pick up a new alpha! Why is this? What is the workaround? Create new objects every time?
source
share