Google is committed to advancing racial equity for Black communities. See how.

ZoomableState

class ZoomableState
kotlin.Any
   ↳ androidx.ui.foundation.gestures.ZoomableState

State of the zoomable composable modifier. Provides smooth scaling capabilities.

Summary

Public constructors
<init>(onZoomDelta: (Float) -> Unit, animationClock: AnimationClockObservable)

State of the zoomable composable modifier.

Public methods
Unit
smoothScaleBy(value: Float, onEnd: (endReason: AnimationEndReason, finishValue: Float) -> Unit = null)

Smooth scale by a ratio of value over the current size.

Properties
(Float) -> Unit

callback to be invoked when pinch/smooth zooming occurs.

Public constructors

<init>

ZoomableState(
    onZoomDelta: (Float) -> Unit,
    animationClock: AnimationClockObservable)

State of the zoomable composable modifier. Provides smooth scaling capabilities.

Parameters
onZoomDelta: (Float) -> Unit callback to be invoked when pinch/smooth zooming occurs. The callback receives the delta as the ratio of the new size compared to the old. Callers should update their state and UI in this callback.
animationClock: AnimationClockObservable clock observable to run animation on. Consider querying AnimationClockAmbient to get current composition value

Public methods

smoothScaleBy

fun smoothScaleBy(
    value: Float,
    onEnd: (endReason: AnimationEndReason, finishValue: Float) -> Unit = null
): Unit

Smooth scale by a ratio of value over the current size.

Parameters
value: Float ratio over the current size by which to scale

Properties

onZoomDelta

val onZoomDelta: (Float) -> Unit

callback to be invoked when pinch/smooth zooming occurs. The callback receives the delta as the ratio of the new size compared to the old. Callers should update their state and UI in this callback.