java - Animaiton with given velocity? -
i using velocitytracker find out velocity of motionevent in ontouch method. after motionevent finished, want start animation (translate view) velocity detected prior , accelerate/deaccelerate.
to make clear: i'm not asking duration, want animation starts given velocity.
you need implement own interpolator takes start velocity , interpolates values there. getinterpolation() method want override provide own interpolation, , documentation there describes different return values mean.
in nutshell, input how far along (from 0f 1f) in time, , output how far along want view in animation.
you have bit of calculation when creating interpolator determine appropriate return values respect initial velocity.
for reference, start looking @ the source stock accelerateinterpolator
Comments
Post a Comment