views:

516

answers:

1

I am doing a simple application for touch screen devices, and I would like to implement today's fashion: kinetic scrolling. Is it possible to do, and if yes, how?

PS: Kinetic scrolling: A scrolling mechanism where you don't use a scrollbar to scroll the content, but you touch the list itself, and pull and push it. The "physics engine" then counts out the speed, and stops based on the given settings.

+3  A: 

Use the equations of motion.

Very basic outline:

You are given zero to max speed, maxV (based on number of items in list), and a de-acceleration factor.

Get finger swipe acceleration from device, A and length of time it was applied, T

Calculate an initial scroll speed from v = min { maxV, aT }

Apply de-acceleration factor to current speed until you reach zero, raising list scroll events at a rate proportional to the current scroll speed.

Perhaps look at Kinetic Scrolling Demo with source

Mitch Wheat
Well, thanks for it, I will take a look at it!
fonix232