Package-level declarations

Types

Link copied to clipboard

JchuScrollGesturePropagation defines when Modifier.jchuZoomable propagates scroll gestures to the parent composable element.

Link copied to clipboard
class JchuZoomState(@FloatRange(from = 1.0) val maxScale: Float = 5.0f, contentSize: Size = Size.Zero, velocityDecay: DecayAnimationSpec<Float> = exponentialDecay())

A state object that manage scale and offset.

Functions

Link copied to clipboard
fun JchuNetworkImage(model: Any?, modifier: Modifier = Modifier, isCrossfade: Boolean = true, alpha: Float = DefaultAlpha, placeholder: Painter? = null, error: Painter? = null, requestBuilder: ImageRequest.Builder.() -> Unit = {}, onLoading: () -> Unit? = null, onSuccess: () -> Unit? = null, onError: (Throwable?) -> Unit? = null, contentScale: ContentScale = ContentScale.Crop, contentDescription: String? = null)

Multiplatform network image backed by Coil 3.

Link copied to clipboard
fun Modifier.jchuSnapBackZoomable(zoomState: JchuZoomState, zoomEnabled: Boolean = true, onTap: (position: Offset) -> Unit = {}, onDoubleTap: suspend (position: Offset) -> Unit = {}): Modifier
Link copied to clipboard
fun Modifier.jchuZoomable(zoomState: JchuZoomState, zoomEnabled: Boolean = true, enableOneFingerZoom: Boolean = true, scrollGesturePropagation: JchuScrollGesturePropagation = JchuScrollGesturePropagation.ContentEdge, onTap: (position: Offset) -> Unit = {}, onDoubleTap: suspend (position: Offset) -> Unit = { position -> if (zoomEnabled) zoomState.toggleScale( 2.5f, position ) }): Modifier

Modifier function that make the content jchuZoomable.

Link copied to clipboard
fun rememberJchuZoomState(@FloatRange(from = 1.0) maxScale: Float = 5.0f, contentSize: Size = Size.Zero, velocityDecay: DecayAnimationSpec<Float> = exponentialDecay()): JchuZoomState

Creates a JchuZoomState that is remembered across compositions.

Link copied to clipboard
suspend fun JchuZoomState.toggleScale(targetScale: Float, position: Offset, animationSpec: AnimationSpec<Float> = spring())

Toggle the scale between targetScale and 1.0f.