zoomable
fun Modifier.zoomable(zoomState: ZoomState, zoomEnabled: Boolean = true, enableOneFingerZoom: Boolean = true, scrollGesturePropagation: ScrollGesturePropagation = ScrollGesturePropagation.ContentEdge, onTap: (position: Offset) -> Unit = {}, onDoubleTap: suspend (position: Offset) -> Unit = { position -> if (zoomEnabled) zoomState.toggleScale(2.5f, position) }): Modifier
Modifier function that make the content zoomable.
Parameters
zoom State
A ZoomState object.
zoom Enabled
specifies if zoom behaviour is enabled or disabled. Even if this is false, onTap and onDoubleTap will be called.
enable One Finger Zoom
If true, enable one finger zoom gesture, double tap followed by vertical scrolling.
scroll Gesture Propagation
specifies when scroll gestures are propagated to the parent composable element.
on Tap
will be called when single tap is detected on the element.
on Double Tap
will be called when double tap is detected on the element. This is a suspend function and called in a coroutine scope. The default is to toggle the scale between 1.0f and 2.5f with animation.