Package-level declarations
Types
Link copied to clipboard
viewer传入的Compose数据类型参数
Link copied to clipboard
class ImageViewerState(offsetX: Float = DEFAULT_OFFSET_X, offsetY: Float = DEFAULT_OFFSET_Y, scale: Float = DEFAULT_SCALE, rotation: Float = DEFAULT_ROTATION, animationSpec: AnimationSpec<Float>? = null, crossfadeAnimationSpec: AnimationSpec<Float>? = null) : CoroutineScope
viewer状态对象,用于记录compose组件状态
Link copied to clipboard
class RawGesture(val onTap: (Offset) -> Unit = {}, val onDoubleTap: (Offset) -> Unit = {}, val onLongPress: (Offset) -> Unit = {}, val gestureStart: () -> Unit = {}, val gestureEnd: (transformOnly: Boolean) -> Unit = {}, val onGesture: (centroid: Offset, pan: Offset, zoom: Float, rotation: Float, event: PointerEvent) -> Boolean = { _, _, _, _, _ -> true })
Link copied to clipboard
data class SizeChangeContent(val defaultSize: IntSize, val containerSize: IntSize, val maxScale: Float)
Link copied to clipboard
Properties
Functions
Link copied to clipboard
Link copied to clipboard
suspend fun PointerInputScope.detectTransformGestures(panZoomLock: Boolean = false, gestureStart: () -> Unit = {}, gestureEnd: (Boolean) -> Unit = {}, onTap: (Offset) -> Unit = {}, onDoubleTap: (Offset) -> Unit = {}, onGesture: (centroid: Offset, pan: Offset, zoom: Float, rotation: Float, event: PointerEvent) -> Boolean)
重写事件监听方法
Link copied to clipboard
Link copied to clipboard
fun ImageComposeCanvas(modifier: Modifier = Modifier, samplingDecoder: SamplingDecoder, scale: Float = DEFAULT_SCALE, offsetX: Float = DEFAULT_OFFSET_X, offsetY: Float = DEFAULT_OFFSET_Y, rotation: Float = DEFAULT_ROTATION, gesture: RawGesture = RawGesture(), onMounted: () -> Unit = {}, onSizeChange: suspend (SizeChangeContent) -> Unit = {}, crossfadeAnimationSpec: AnimationSpec<Float> = DEFAULT_CROSS_FADE_ANIMATE_SPEC, boundClip: Boolean = true, debugMode: Boolean = false)
Link copied to clipboard
fun ImageComposeOrigin(modifier: Modifier = Modifier, model: Any, scale: Float = DEFAULT_SCALE, offsetX: Float = DEFAULT_OFFSET_X, offsetY: Float = DEFAULT_OFFSET_Y, rotation: Float = DEFAULT_ROTATION, gesture: RawGesture = RawGesture(), onMounted: () -> Unit = {}, onSizeChange: suspend (SizeChangeContent) -> Unit = {}, crossfadeAnimationSpec: AnimationSpec<Float> = DEFAULT_CROSS_FADE_ANIMATE_SPEC, boundClip: Boolean = true)
Link copied to clipboard
fun ImageViewer(modifier: Modifier = Modifier, model: Any?, state: ImageViewerState = rememberViewerState(), detectGesture: ViewerGestureScope.() -> Unit = {}, boundClip: Boolean = true, debugMode: Boolean = false)
model支持Painter、ImageBitmap、ImageVector、SamplingDecoder、ComposeModel
Link copied to clipboard
把位移限制在边界内
Link copied to clipboard
fun rememberViewerState(offsetX: Float = DEFAULT_OFFSET_X, offsetY: Float = DEFAULT_OFFSET_Y, scale: Float = DEFAULT_SCALE, rotation: Float = DEFAULT_ROTATION, animationSpec: AnimationSpec<Float>? = null, crossfadeAnimationSpec: AnimationSpec<Float>? = null): ImageViewerState
记录viewer状态
Link copied to clipboard
让后一个数与前一个数的符号保持一致