CurlRenderer

class CurlRenderer(observer: CurlRenderer.Observer? = null, val usePerspectiveProjection: Boolean = USE_PERSPECTIVE_PROJECTION) : GLSurfaceView.Renderer

Actual renderer class for the GLSurfaceView implementation of a curl view. This class is based on https://github.com/harism/android-pagecurl

Parameters

usePerspectiveProjection

determines whether perspective projection must be used or not.

Constructors

Link copied to clipboard
constructor(observer: CurlRenderer.Observer? = null, usePerspectiveProjection: Boolean = USE_PERSPECTIVE_PROJECTION)

Types

Link copied to clipboard
object Companion
Link copied to clipboard
interface Observer

Observer for waiting render engine/state updates.

Properties

Link copied to clipboard

Background fill color.

Functions

Link copied to clipboard

Adds CurlMesh to this renderer.

Link copied to clipboard
fun getPageRect(page: Int): RectF?

Returns rect reserved for left or right page. Value page should be PAGE_LEFT or PAGE_RIGHT.

Link copied to clipboard

Inverse translates screen coordinates into view coordinates.

Link copied to clipboard

Inverse translates screen coordinates into view coordinates.

Link copied to clipboard
open override fun onDrawFrame(gl: GL10?)

Draws curl meshes.

Link copied to clipboard
open override fun onSurfaceChanged(gl: GL10?, width: Int, height: Int)

Called once surface is created.

Link copied to clipboard
open override fun onSurfaceCreated(gl: GL10?, config: EGLConfig?)

Called once surface is created.

Link copied to clipboard

Removes CurlMesh from this renderer.

Link copied to clipboard
fun setMargins(left: Int, top: Int, right: Int, bottom: Int)

Sets actual screen pixel margins.

Link copied to clipboard
fun setProportionalMargins(left: Float, top: Float, right: Float, bottom: Float)

Sets proportional margins or padding. Note: margins are proportional. Meaning a value of 0.1f will produce a 10% margin

Link copied to clipboard

Sets visible page count to one or two. Should be either SHOW_ONE_PAGE or SHOW_TWO_PAGES.

Link copied to clipboard
fun translate(pt: PointF)

Translates screen coordinates into view coordinates.