ZoomableState

sealed interface ZoomableState

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Determines whether the resulting scale and translation of pan and zoom gestures should be automatically applied to by Modifier.zoomable to its content. This can be disabled if your content prefers applying the transformations in a bespoke manner.

Link copied to clipboard

Alignment of the content. Defaults to Alignment.Center.

Link copied to clipboard

Padding around the zoomable content within the viewport. This will add padding for the. content after it has been clipped, which is not possible via Modifier.padding.

Link copied to clipboard

Single source of truth for your content's aspect ratio. Defaults to ContentScale.Fit.

Link copied to clipboard

Transformations that should be applied to Modifier.zoomable's content.

Link copied to clipboard

Modifier.zoomable()'s coordinate system for representing spatial offsets in CoordinateSpace.Viewport and CoordinateSpace.ZoomableContent.

Link copied to clipboard

Whether any zoom, pan (or both) animation is in progress.

Link copied to clipboard

The visual bounds of the content with user zoom and pan. This is calculated by applying contentScale and contentAlignment to the value passed to ZoomableState.setContentLocation. This property is intended for drawing decorations around the content or for performing hit tests.

Link copied to clipboard
abstract val zoomFraction: Float?

The content's current zoom as a fraction of its min and max allowed zoom limits. Also see: ZoomableContentTransformation.scale and ZoomableContentTransformation.scaleMetadata.

Link copied to clipboard
abstract val zoomSpec: ZoomSpec

The zoom spec passed to rememberZoomableState.

Functions

Link copied to clipboard
open suspend fun panBy(offset: Offset, animationSpec: AnimationSpec<Offset> = DefaultPanAnimationSpec)

Animate pan by offset in pixels and suspend until it's finished.

abstract suspend fun panBy(offset: SpatialOffset, animationSpec: AnimationSpec<Offset> = DefaultPanAnimationSpec)

See panBy.

Link copied to clipboard
abstract suspend fun resetZoom(animationSpec: AnimationSpec<Float> = DefaultZoomAnimationSpec)
open suspend fun resetZoom(withAnimation: Boolean)

Reset content to its minimum zoom and zero offset and suspend until it's finished.

Link copied to clipboard
Link copied to clipboard
open suspend fun zoomBy(zoomFactor: Float, centroid: Offset = Offset.Unspecified, animationSpec: AnimationSpec<Float> = DefaultZoomAnimationSpec)

Zooms in or out around centroid by a ratio of zoomFactor relative to the current size, and suspends until it's finished.

abstract suspend fun zoomBy(zoomFactor: Float, focal: ZoomFocalPoint, animationSpec: AnimationSpec<Float> = DefaultZoomAnimationSpec)

Zooms in or out by a ratio of zoomFactor, using focal to determine how the zoom should be anchored, and suspends until the animation (if any) is finished.

open suspend fun zoomBy(zoomFactor: Float, centroid: SpatialOffset, animationSpec: AnimationSpec<Float> = DefaultZoomAnimationSpec)
Link copied to clipboard
open suspend fun zoomTo(zoomFactor: Float, centroid: Offset = Offset.Unspecified, animationSpec: AnimationSpec<Float> = DefaultZoomAnimationSpec)

Zooms in or out around centroid to achieve a final zoom level specified by zoomFactor, and suspends until it's finished.

abstract suspend fun zoomTo(zoomFactor: Float, focal: ZoomFocalPoint, animationSpec: AnimationSpec<Float> = DefaultZoomAnimationSpec)

Zooms in or out to the specified zoomFactor, using focal to determine how the zoom should be anchored, and suspends until the animation (if any) is finished.

open suspend fun zoomTo(zoomFactor: Float, centroid: SpatialOffset, animationSpec: AnimationSpec<Float> = DefaultZoomAnimationSpec)