Reputation: 1369
I've tried looking all around google and various stack questions but can't seem to find anything similar to what I'm doing.
Basically, I just want to start a given ObjectAnimator animation at a certain offset of the animation (e.g. 30% through the animation, or 70% through the animation) rather than starting it from the beginning.
I'm not sure if I should be using a specific Interpolator or if there is a similar function to animation.setStartTime(). I've been using this guide heavily but can't seem to find anything in the API for setting the initial timeline of an animation to begin.
Maybe I need to be using keyframes? But I'm not sure how to sync up a keyframe to just start at 30% or 50% or 70% of the way through.
I just need to be pointed in the right direction, any help is appreciated.
Thanks
Upvotes: 3
Views: 2420
Reputation: 39873
The method setCurrentFraction()
Sets the position of the animation to the specified fraction.
So setting the animation to an offset of 30% could be achieved with
animator.setCurrentFraction(0.3f);
Upvotes: 2