ZoomableImage

fun ZoomableImage(imageModel: Any?, contentDescription: String, modifier: Modifier = Modifier, contentScale: ContentScale = ContentScale.Fit, minScale: Float = 0.5f, maxScale: Float = 3.0f, isRotation: Boolean = false, isZoomable: Boolean = true, @DrawableRes placeholderDrawable: Int = R.drawable.ic_tall_placeholder, @DrawableRes errorDrawable: Int = placeholderDrawable, @IntRange(from = 0, to = 100) encodeQuality: Int = 85, @FloatRange(from = 0.0, to = 1.0) sizeMultiplier: Float = 1.0f, onSwipeRight: () -> Unit? = null, onSwipeLeft: () -> Unit? = null)

Creates an Image composable that can be zoomed in and out.

Author

Arnau Mora

Since

20220118

See also

Parameters

imageModel

The data to load into the image through Glide.

contentDescription

The description of the image for accessibility.

modifier

Modifiers to apply to the image component.

minScale

The minimum scale that can be applied to the image.

maxScale

The maximum scale that can be applied to the image.

isRotation

Whether or not the image can be rotated.

isZoomable

Whether or not the image can be zoomed.

placeholderDrawable

The drawable that will be displayed when the image is being loaded.

errorDrawable

The drawable that will be displayed when the image could not be loaded.

encodeQuality

The quality in which the image will be encoded.

sizeMultiplier

The size multiplier for scaling the image.

onSwipeRight

Will be called when the user swipes the image to the right.

onSwipeLeft

Will be called when the user swipes the image to the left.