Reversing an Animation

前端 未结 8 455
清歌不尽
清歌不尽 2020-11-30 01:41

I have an ImageView that gets animated when it is added to a layout. When it is removed, I want to reverse the same animation.

Is there a way to reverse an animation

8条回答
  •  北海茫月
    2020-11-30 02:17

    If you are using animation from xml then an easy way is to made an exact same reverse animation to original animation. Add Animation.AnimationListener to original animation and in onAnimationEnd method start the reverse animation.

提交回复
热议问题