I am using a RotationAnimation
to rotate a custom view object (derived directly from View
). The view object's onDraw()
is called repeatedly during the animation, and then onAnimationEnd
callback is called. In the callback I am updating the view's backing data object to record its new rotation.
The problem I am seeing is that the view object continues to have its onDraw()
called after the onAnimationEnd
callback has been called and has returned. This is a problem because, in the callback, I update values that cause the view to render its contents with a rotation. Since the animation is also still transforming the view, the end-result is that it briefly over-rotates before snapping back to the correct position as the rotation transform is removed.
So, if the animation causes the animated view's onDraw()
to be called after onAnimationEnd
is called, how can I determine when the animation has really finished so that I can update the backing object model at the appropriate time?
I'd be grateful for any help on this.