public void reverse ( ) { mPlayingBackwards = ! mPlayingBackwards ; if ( mPlayingState == RUNNING ) { long currentTime = AnimationUtils . currentAnimationTimeMillis ( ) ; long currentPlayTime = currentTime - mStartTime ; long timeLeft = mDuration - currentPlayTime ; mStartTime = currentTime - timeLeft ; } else { start ( true ) ; } }
Plays the ValueAnimator in reverse . If the animation is already running it will stop itself and play backwards from the point reached when reverse was called . If the animation is not currently running then it will start from the end and play backwards . This behavior is only set for the current animation ; future playing of the animation will use the default behavior of playing forward .