ZoomableState

class ZoomableState(val minScale: Float = 1.0f, val maxScale: Float = Float.MAX_VALUE, initialTranslateX: Float = 0.0f, initialTranslateY: Float = 0.0f, initialScale: Float = minScale)

A state object that can be hoisted to observe scale and translate for ZoomableLayout.

In most cases, this will be created via rememberZoomableState.

Parameters

minScale

the minimum scale value for ZoomableState.minScale

maxScale

the maximum scale value for ZoomableState.maxScale

initialTranslateX

the initial translateX value for ZoomableState.translateX

initialTranslateY

the initial translateY value for ZoomableState.translateY

initialScale

the initial scale value for ZoomableState.scale

Constructors

Link copied to clipboard
constructor(minScale: Float = 1.0f, maxScale: Float = Float.MAX_VALUE, initialTranslateX: Float = 0.0f, initialTranslateY: Float = 0.0f, initialScale: Float = minScale)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
val minScale: Float = 1.0f
Link copied to clipboard

The current scale value for ZoomableLayout.

Link copied to clipboard

The current translateX value for ZoomableLayout.

Link copied to clipboard

The current translateY value for ZoomableLayout.

Functions

Link copied to clipboard
suspend fun animateScaleTo(scale: Float, animationSpec: <Error class: unknown class><Float> = spring(), initialVelocity: Float = 0.0f): <Error class: unknown class>

Animates scale of ZoomableLayout to given scale.

Link copied to clipboard
suspend fun animateTranslationTo(translation: <Error class: unknown class>, animationSpec: <Error class: unknown class><Float> = spring(), initialVelocity: Float = 0.0f): <Error class: unknown class>

Animates translation of ZoomableLayout to given translation.

Link copied to clipboard
suspend fun snapScaleTo(scale: Float): <Error class: unknown class>

Instantly sets scale of ZoomableLayout to given scale.

Link copied to clipboard
open override fun toString(): String