How to make page turning effect in Android?

独自空忆成欢 提交于 2019-11-30 02:28:25

Take a look at this.

It's a Calculator application, which changes between normal/scientific mode on swipe gesture:

onFling(MotionEvent, MotionEvent, float, float)

It uses TranslateAnimation to accomplish the effect, but dragging between the views and tracking your finger, like in the iPhone is not implemented. Try using

onScroll(MotionEvent, MotionEvent, float, float)

for that.

As for Flexbook-like component, it shouldn't be hard to implement, if you use the masking approach.

Android M3 (pre-1.0 version) even had PageTurner widget, but it got deprecated, since it wasn't generic-enough, like the other widgets. You can try and dig up the old Android sources to find the implementation of PageTurner and modify it for Cupcake/Donut.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!