Implement Page Curl on Android

Page Curl in Android

There are some open source projects that can be used to achieve the Page curl feature. This android project or this Github Project can be used to achieve the feature. The Android page curl project uses only Canvas to render a 2D curl effect. Since it does not use OpenGL, it can be implemented for any Android Version. The Github PageFlip project uses OpenGL 2.0 to produce a 3D page curl effect.

Implement page curl on android?

I just created a open source project which features a page curl simulation in 2D using the native canvas: https://github.com/moritz-wundke/android-page-curl
I'm still working on it to add adapters and such to make it usable as a standalone view.

  • EDIT: Links updated.
  • EDIT: Missing files has been pushed to repo.

Try to implement a page curl example in android from here

You have to replace:

    @Override
public int getPageCount() {
return 5;
}

with:

    @Override
public int getPageCount() {
return mBitmapIds.length;
}

Then, modify the calls to "loadBitmap" method (within the "updatePage" method) replacing the last parameter (it has a fixed number) with the "index" variable. Furthermore, you can get rid of the whole switch and configure the pages like you wish (just extract the code from the switch-case you want).

UPDATE1

Use this method:

    @Override
public void updatePage(CurlPage page, int width, int height, int index) {
Bitmap front = loadBitmap(width, height, index);
page.setTexture(front, CurlPage.SIDE_BOTH);
page.setColor(Color.argb(127, 255, 255, 255), CurlPage.SIDE_BACK);
}

Page Curl Animation in android?

I found one sample code.

youtube

mediafire



Related Topics



Leave a reply



Submit