KiteZoomSpec

@Immutable
data class KiteZoomSpec(val pinchEnabled: Boolean = true, val doubleTapEnabled: Boolean = true, val panEnabled: Boolean = true, val minZoom: Float = 1.0f, val maxZoom: Float = 8.0f, val doubleTapZoom: Float = 2.5f, val resetZoomOnPageChange: Boolean = true)(source)

Zoom & pan behaviour for KiteDocView.

minZoom/maxZoom bound all zoom changes, including programmatic ones through KiteDocViewState.setZoom, so an app driving zoom from its own slider (gestures disabled) still declares its range here.

Parameters

pinchEnabled

two-finger pinch zoom, Ctrl or Cmd with the wheel or a trackpad pinch, and Ctrl or Cmd with plus, minus and 0 on a keyboard.

doubleTapEnabled

double-tap toggles between minZoom and doubleTapZoom.

doubleTapZoom

the zoom a double tap goes to. It must be finite and above 0, and a double tap clamps it into minZoom..maxZoom, as every zoom change is clamped.

panEnabled

one-finger pan while zoomed in. A quick release lets the pan go on and slow down, and in KiteDocLayout.Paged and KiteDocLayout.Spread a drag that goes on past the edge of the page turns it.

resetZoomOnPageChange

in KiteDocLayout.Paged and KiteDocLayout.Spread, snap zoom back to minZoom when the reader lands on another page or spread. The page a pager first shows is not a change, so a zoom set before the pager appears stays. Disable when zoom is driven externally and should persist across pages.

Constructors

Link copied to clipboard
constructor(pinchEnabled: Boolean = true, doubleTapEnabled: Boolean = true, panEnabled: Boolean = true, minZoom: Float = 1.0f, maxZoom: Float = 8.0f, doubleTapZoom: Float = 2.5f, resetZoomOnPageChange: Boolean = true)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard