Memory Leak fixes, additional way of building animations
This release fixes a potential memory leak that might cause fragments to be retained by AdditiveAnimator animations, especially infinite animations.
There is a breaking API change with regards to cancelling animations to catch this kind of leak easily:
cancelAnimations() has been replaced with cancelAnimationsForObject() and cancelAnimationsInCollection().
Also, don't forget to cancel your infinite animations when the fragment/view is being destroyed!
See below for a short explanation of the issue*.
Furthermore, a new API for building animations has been added that allows simple orchestration of multiple AdditiveAnimator instances.
Three new methods are available: AnimationSequence.playTogether(), AnimationSequence.playSequentially() and AnimationSequence.playWithDelayBetweenAnimations().
Each of these methods takes a List<AnimationSequence>, so the calls to these methods can be nested like this:
AnimationSequence.playSequentially(
AnimationSequence.playTogether(…),
AnimationSequence.playSequentially(
AdditiveAnimator.animate(…),
AnimationSequence.playTogether(…)
)
).start();