It is understandable that ObjectAnimator would not support pause/resume functions because the class manages the begin value, end value and duration of the animation itself. What would be the best approach to implement a "illusion" of pause/resume on an ObjectAnimator animation even with the absent of such operations?
I have been thinking of the following work around:
when a pause operation is initiated..
Step 1. Calling ObjectAnimator.setTarget() for redirecting the animator to update an dummy object
Step 1. Calling ObjectAnimator.setPropertyName() for redirecting the animator to update a dummy property of the same object.
Step 2. Calling ObjectAnimator.getCurrentPlayTime() for storing the current position of animation in time.
when a resume operation is initiated..
Step 1. Re-creating/Cloning the ObjectAnimator and manually set the current position of animation in time to this ObjectAnimator instance
Step 2. ObjectAnimator.start()
Here are my questions
1. Do you think this work around would work?
2. For the resume operation step #1, is that a way to reduce the cost creating an ObjectAnimator? Would the ObjectAnimator.clone() worked even the copied animator has already started?