如何实施Google Play图书中使用的页面卷曲类型? [英] How do I implement the type of page curl used in Google Play Books?

查看:235
本文介绍了如何实施Google Play图书中使用的页面卷曲类型?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在寻找一种正确的方法来模仿iOS应用中使用的页面翻转/卷曲,但是在Android应用中。我在Android上看到的最接近的是Google Play图书应用。他们是否使用了我没见过的SDK的某些部分?是否有机会获得类似的实现?

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?

我见过的大部分示例都是使用某种基于OpenGL的RenderView构建的。这可能会奏效,但我必须确保屏幕不会徒劳,因为我不想使用太多的电量。在处理不是pow2的纹理时,我有点害怕使用OpenGL。

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.

祝你好运,
Kalle

Best regards, Kalle

推荐答案

你有使用OpenGl在Android中产生这样的效果,并且必须使用
以下常见的正弦图方程: -

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)

y=Asin(2π/λ*x)

其中,

A =幅度(即我们想要的卷曲高度)。

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

λ=波长(即我们想要的卷曲长度)。

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

x = X轴变量将随着你而改变移动页面。

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

你必须在SurfaceView上绘制3个页面,即'LeftPage','CenterPage'和'RightPage','CenterPage'始终可见并负责'right curl'动画,而'LeftPage'负责'left curl'动画,'RightPage'保持静止。
用于检测手势使用默认的GestureDetector类。

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.

您可以从这里

这篇关于如何实施Google Play图书中使用的页面卷曲类型?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆