开发者

calculating velocity

Im trying to implement inertial scroll开发者_JS百科ing in my GLSurfaceView and to do that i need to figure out how to calculate velocity, but im not sure how to do so. the translation is stored in a matrix, and it is calculated by the line of code below.

matrix.postTranslate(event.getX() - start.x,event.getY() - start.y);


Take a look at the Scroller and VelocityTracker classes. Together they are used to implement fling behavior in the standard framework widgets. Use these and your app will always match the native feel of the device.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜