My blog has been moved to ariya.ofilabs.com.

Wednesday, October 21, 2009

kinetic scrolling: the state machine

Some of the slides from last Maemo Summit in Amsterdam have been made online. Here is the one from the Cross Platform with Qt talk that I held. It does not give much, though, since mostly what counts is the real live demo. Let us hope that at some point in time, the recorded videos will be online as well. Of course, there are also other interesting slides such as Harmattan highlights and its architecture, Web Runtime, Quake3, and many others.

While I am there, if you check the slides from my talk above, page 9 shows the secret behind kinetic scrolling code, which I featured before as Flick Charm or Flickable interface. Or, in another version as follows (click to enlarge):

Of course, it is the simplified version and ignore some details, but that should be a good start to really digest the code. Since it was hacked in the old 4.4/4.5 time, I did not have the luxury of using the new state machine framework in Qt 4.6. As an exercise for you, the brave readers, convert the code to use the framework. In addition, it does not support yet bouncing-on-edge feature, something which can serve as another exercise, too.

Have fun with scrolling :)

3 comments:

Anonymous said...

Hm, on your picture I don't see the difference between Pressed and Stop states. Could they be merged into one state ?

Victor Noagbodji said...

@above reply
there is a difference. remember a state machine is represented as a directed graph. so where the edge comes from is important

Victor Noagbodji said...

nvm. you may be right