Android page Curl animation

AndroidCurlAndroid AnimationFlip

Android Problem Overview


  1. Is there a simple way to do the Curl page flipping animation? A Curl animation is animation of pages flipping, including the page above rolling and the shadows over the lower page.
  2. What is the recommended way to do a "gallery" that displays two pages at a time (just like a book)?

Is it:

  1. Letting the adapter display a linear layout of two images at a time? (it won't let me show a page flipping over the other like a book)
  2. Using two pages, placing somehow one near the other, and then when it's time to animate -move the next two pages over? What is the better way that would enable displaying the left page flipping over the right page?

Android Solutions


Solution 1 - Android

I'm implementing a 2D page curl in the native canvas. Check my answer in: https://stackoverflow.com/questions/3912849/implement-page-curl-on-android/

EDIT: The code project of my implementation: http://code.google.com/p/android-page-curl/ EDIT2: Links updated

Solution 2 - Android

I am using this code. Its really really perfect for any one to understand and use. Thanks a lot to Harism

GitHub Link for Page Curl Animation in android With OpenGL

Solution 3 - Android

I haven't worked on the android before, but it seems to me the best way to do a page flipping type of display would be to draw it in three layers. The first being the first page's text, the second being the "page" underneath, and the third being the next page. If you draw them from back to front, the only thing the user will see will be the text on the first page.

Now, Once you have that, you'll want to do some sort of curling/flipping animation based on whatever controls you are using. Simply choose whatever method works best for you for doing that animation, but while you are doing that, have the part of the page that isn't there anymore alpha'd out. This will allow you to see the text of the page underneath (Okay, I lied. You'll need a background behind that text too).

The problem at this point is you're still drawing the text twice over the same space, so you'll want to blend the first page's text with the animation under it. In this way, the text that is over the 0 alpha sections will be invisible. It won't bend with the animation, so that may still be an issue, but depending on the speed of the flip that might be fine still. When the animation is done, simply set the first page = the second, the animation reset to plain white, and the second page = the new second page.

The shadow effect can be done simply by partially alphaing out some black behind the page turn animation. Draw over second page (as the animation layer already is doing) and voila!

I believe your two page question could use a very similar method. Good luck

Solution 4 - Android

This is 3d animation project (based on OpenGL 2.0) - http://anettosoftware.co.uk/npc.php

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionMeymannView Question on Stackoverflow
Solution 1 - AndroidMossView Answer on Stackoverflow
Solution 2 - AndroidArslan AnwarView Answer on Stackoverflow
Solution 3 - AndroidLuninView Answer on Stackoverflow
Solution 4 - AndroidAntonView Answer on Stackoverflow