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

Popular posts from this blog

1111. appearing after print sequence - php -

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

Ruby on Rails, ActiveRecord, Postgres, UTF-8 and ASCII-8BIT encodings -