Difference between getAnimatedValue() and getAnimatedFraction()

4.4k Views Asked by At

Could anyone tell me the difference between the two methods getAnimatedValue() and getAnimatedFraction() used in android ValueAnimator?

1

There are 1 best solutions below

7
Tarps On BEST ANSWER

Did you mean getAnimatedValue() and getAnimatedFraction()?

getAnimatedValue() returns the current value for the variable you are animating.

getAnimatedFraction() returns the value that is used for animating (it always goes from 0.0 to 1.0 basically, and the linearity of it is set by the interpolator). The animatedValue is determined through this by multiplication.

Say you want to linearly animate from 0 to 100 in 10 seconds. On the 9th second, animatedFraction is 0.9f and the animatedValue is 100*0.9f = 90.