Curl GLSurface View
Shows a paper curl like pagination using an OpenGL ES surface view. This class is based on https://github.com/harism/android-pagecurl
Types
Interface to handle events when current index (i.e. visible page) completely changes.
Interface to handle click events on a page.
Provider to feed 'book' with bitmaps which are used for rendering pages.
Observer interface for handling CurlView size changes.
Properties
Allows curl on last page.
Curl animation duration expressed in milliseconds.
Gets or sets color factor offset to make darker or clearer the area of the texture close to the curl. Value must be between 0.0f and 1.0f (both included). The larger the value, the clearer the are will be. The smaller the value, the darker the area will be.
Current bitmap index. This is always displayed as front of right page.
Handles events when currently visible page changes.
Enables or disables flag for rendering some lines used for development. When enabled, shows curl position.
Enables or disables flag for drawing polygon outlines. Seeing polygon outlines gives good insight on how original rectangle is divided.
Enables or disables flag for enabling shadow rendering.
Enables or disables flag for texture rendering.
If set to true, touch event pressure information is used to adjust curl radius. The more you press, the flatter the curl becomes. This is somewhat experimental and results may vary significantly between devices. On emulator pressure information seems to be flat 1.0f which is maximum value and therefore not very much of use.
Gets or sets maximum number of times the curl can be divided into. The bigger the value the smoother the curl will be, at the expense of having more polygons to be drawn.
Listener to handle page clicks.
Curl animation duration during a page jump expressed in milliseconds.
Provides page bitmap data.
Whether left side page is rendered. This is useful mostly for situations where right (main) page is aligned to left side of screen and left page is not visible anyway.
Gets or sets inner color for shadow. Inner color is the color drawn next to surface where shadowed area starts.
Gets or sets outer color for shadow. Outer color is the color the shadow ends to.
Size changed observer for this view. Call back method is called from this View's onSizeChanged method.
Functions
Called when a touch event is received on this view.
Sets background color - or OpenGL clear color to be more precise. Color is a 32bit value consisting of 0xAARRGGBB and is extracted using android.graphics.Color eventually.
Set current page index. Page indices are zero based values presenting page being shown on right side of the book. E.g if you set value to 4; right side front facing bitmap will be with index 4, back facing 5 and for left side page index 3 is front facing, and index 2 back facing (once page is on left side it's flipped over).
Sets actual screen pixel margins.
Set margins (or padding). Note: margins are proportional. Meaning a value of .1f will produce a 10% margin.
Sets current page index with an animation. Page indices are zero based values presenting page being shown on right side of the book. E.g if you set value to 4; right side front facing bitmap will be with index 4, back facing 5 and for left side page index 3 is front facing, and index 2 back facing (once page is on left side it's flipped over).