ReaderViewTransformManager

Used for programmatically managing transformations of the ReaderView, such as scaling and translating. You can for example use this to zoom to a position when a user clicks on the ReaderView.

Get an instance of this type by calling ReaderView.transformManager

Functions

Link copied to clipboard
abstract suspend fun applyTransform(transformData: TransformData?, animationOptions: TransformAnimationOptions? = TransformAnimationOptions()): ColibrioResult<Unit>
abstract fun applyTransform(transformData: TransformData?, animationOptions: TransformAnimationOptions? = TransformAnimationOptions(), onSuccess: () -> Unit = {}, onError: (ColibrioException) -> Unit = {})

Applies the given transform to the ReaderView. Passing null will remove the ReaderView's active transform.

Link copied to clipboard
abstract suspend fun removeActiveTransform(animationOptions: TransformAnimationOptions? = TransformAnimationOptions()): ColibrioResult<Unit>
abstract fun removeActiveTransform(animationOptions: TransformAnimationOptions? = TransformAnimationOptions(), onSuccess: () -> Unit = {}, onError: (ColibrioException) -> Unit = {})

Removes the ReaderView's current active transform.

Link copied to clipboard
abstract suspend fun zoomToClientPosition(clientX: Double, clientY: Double, scale: Double, animationOptions: TransformAnimationOptions? = TransformAnimationOptions()): ColibrioResult<Unit>
abstract fun zoomToClientPosition(clientX: Double, clientY: Double, scale: Double, animationOptions: TransformAnimationOptions? = TransformAnimationOptions(), onSuccess: () -> Unit = {}, onError: (ColibrioException) -> Unit = {})

Applies a transform to the ReaderView that will scale and translate publication content. The publication content at the X and Y coordinate in the ReaderView is centered in the ReaderView.

Link copied to clipboard
abstract suspend fun zoomToClientRect(rect: Rect, options: TransformRectZoomOptions? = TransformRectZoomOptions()): ColibrioResult<Unit>
abstract fun zoomToClientRect(rect: Rect, options: TransformRectZoomOptions? = TransformRectZoomOptions(), onSuccess: () -> Unit = {}, onError: (ColibrioException) -> Unit = {})

Applies a transform to the ReaderView that will scale and translate publication content so that the specified rectangle is centered in the ReaderView.

Link copied to clipboard
abstract suspend fun zoomToEventPosition(event: MouseEngineEventData, scale: Double, animationOptions: TransformAnimationOptions? = TransformAnimationOptions()): ColibrioResult<Unit>
abstract fun zoomToEventPosition(event: MouseEngineEventData, scale: Double, animationOptions: TransformAnimationOptions? = TransformAnimationOptions(), onSuccess: () -> Unit = {}, onError: (ColibrioException) -> Unit = {})

Applies a transform to the ReaderView using a MouseEngineEvent or PointerEngineEvent. The transform will scale and translate publication content so that the specified position is centered in the ReaderView.

Link copied to clipboard
abstract suspend fun zoomToPublicationViewportPosition(x: Length, y: Length, scale: Double, animationOptions: TransformAnimationOptions? = TransformAnimationOptions()): ColibrioResult<Unit>
abstract fun zoomToPublicationViewportPosition(x: Length, y: Length, scale: Double, animationOptions: TransformAnimationOptions? = TransformAnimationOptions(), onSuccess: () -> Unit = {}, onError: (ColibrioException) -> Unit = {})

Applies a transform to the ReaderView that will scale and translate publication content so that the specified position is centered in the ReaderView.

Link copied to clipboard
abstract suspend fun zoomToPublicationViewportRect(rect: Rect, unit: LengthUnit, options: TransformRectZoomOptions = TransformRectZoomOptions()): ColibrioResult<Unit>
abstract fun zoomToPublicationViewportRect(rect: Rect, unit: LengthUnit, options: TransformRectZoomOptions = TransformRectZoomOptions(), onSuccess: () -> Unit = {}, onError: (ColibrioException) -> Unit = {})

Applies a transform to the ReaderView that will scale and translate publication content so that the specified rectangle coordinates is centered in the ReaderView.

Properties

Link copied to clipboard

Get the current active transform applied to the ReaderView.

Link copied to clipboard
abstract val canTransform: Boolean

If it's possible to transform the ReaderView at this time.