How do I implement the type of page curl used in Google Play Books?

I've been searching for a proper way to emulate the kind of page flipping/curling used in the iOS apps but in an Android app. The closest thing I have seen on Android is the Google Play Books app. Are they using some part of the SDK that I haven't seen? Is there any chance of getting my hands on a similar implementation?

Most of the examples I have seen are built using some sort of RenderView based on OpenGL. That would probably work, but I would have to make sure that the screen is not rendered in vain, since I don't want to use too much power. Also I'm a little afraid of using OpenGL when handling textures that are not pow2.

Best regards, Kalle


You have to use OpenGl for making such effect in Android and have to use the below common sinusoidal graph equation :-

y=Asin(2π/λ*x)

Where,

A = Amplitude (ie the elevation of curl we want).

λ = Wavelength (ie the length of the curl we want).

x = The X axis variable which will change as you move the page.

You have to draw 3 pages on SurfaceView namely 'LeftPage' , 'CenterPage' and 'RightPage', 'CenterPage' is always visible and is responsible for 'right curl' animation while 'LeftPage' is responsible for 'left curl' animation and 'RightPage' just stay static. For detecting gestures use default GestureDetector class.

You can download the sample from here.

链接地址: http://www.djcxy.com/p/15278.html

上一篇: WebSockets和负载平衡是一个瓶颈?

下一篇: 如何实现Google Play图书中使用的页面卷曲类型?