Package-level declarations

Types

Link copied to clipboard

Implement this interface for reacting to double clicks on Modifier.zoomable's content. By default, DoubleClickToZoomListener.cycle is used.

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

Gestures that Modifier.zoomable will observe and respond to.

Link copied to clipboard

Detects zoom and pan events made using keyboard and mouse shortcuts.

Link copied to clipboard
class HardwareShortcutsSpec(val enabled: Boolean = true, val shortcutDetector: HardwareShortcutDetector = HardwareShortcutDetector.Default)

Describes how keyboard and mouse shortcuts are handled. When enabled, Modifier.zoomable's content will participate in the focus system to receive hardware events.

Link copied to clipboard

Represents a visual effect that displays when the zoom limits of a zoomable container have been reached.

Link copied to clipboard

Modifier.zoomable uses ZoomableContentLocation to understand the content's visual size and position in order to prevent it from going out of bounds during pan & zoom gestures.

Link copied to clipboard

Graphics transformations generated by Modifier.zoomable when pan & zoom gestures are received.

Link copied to clipboard

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

Link copied to clipboard
sealed interface ZoomableState
Link copied to clipboard
abstract class ZoomFocalPoint

Defines the focal point to use when zooming. The focal point determines which part of the content remains fixed (or is brought into position) as the zoom animation runs.

Link copied to clipboard
class ZoomLimit(val factor: Float, val overzoomEffect: OverzoomEffect = OverzoomEffect.RubberBanding)
Link copied to clipboard
class ZoomSpec(val maximum: ZoomLimit = ZoomLimit(factor = 2f, overzoomEffect = OverzoomEffect.RubberBanding), val minimum: ZoomLimit = ZoomLimit(factor = 1f, overzoomEffect = OverzoomEffect.RubberBanding))

Also see: DynamicZoomSpec.

Properties

Link copied to clipboard

Represents the coordinate space of the visible viewport — the bounds of the composable where Modifier.zoomable() is applied.

Link copied to clipboard

Represents the coordinate space of the zoomable content (e.g., an image).

Functions

Link copied to clipboard
fun rememberZoomableState(zoomSpec: DynamicZoomSpec, autoApplyTransformations: Boolean = true, hardwareShortcutsSpec: HardwareShortcutsSpec = HardwareShortcutsSpec()): ZoomableState
fun rememberZoomableState(zoomSpec: ZoomSpec = ZoomSpec(maxZoomFactor = 2f), autoApplyTransformations: Boolean = true, hardwareShortcutsSpec: HardwareShortcutsSpec = HardwareShortcutsSpec()): ZoomableState

Create a ZoomableState that can be used with Modifier.zoomable.

Link copied to clipboard
fun Modifier.zoomable(state: ZoomableState, onClick: (clickedAt: Offset) -> Unit? = null, onLongClick: (clickedAt: Offset) -> Unit? = null, clipToBounds: Boolean = true, onDoubleClick: DoubleClickToZoomListener? = DoubleClickToZoomListener.cycle()): Modifier
fun Modifier.zoomable(state: ZoomableState, enabled: Boolean = true, onClick: (clickedAt: Offset) -> Unit? = null, onLongClick: (clickedAt: Offset) -> Unit? = null, clipToBounds: Boolean = true, onDoubleClick: DoubleClickToZoomListener? = DoubleClickToZoomListener.cycle()): Modifier

fun Modifier.zoomable(state: ZoomableState, gestures: EnabledZoomGestures, onClick: (clickedAt: Offset) -> Unit? = null, onLongClick: (clickedAt: Offset) -> Unit? = null, onDoubleClick: DoubleClickToZoomListener? = DoubleClickToZoomListener.cycle(), clipToBounds: Boolean = true): Modifier

A Modifier for handling pan & zoom gestures, designed to be shared across all your media composables so that your users can use the same familiar gestures throughout your app. It offers,