Skip to content

Latest commit

 

History

History
52 lines (38 loc) · 1.57 KB

click.md

File metadata and controls

52 lines (38 loc) · 1.57 KB

Click Events

Translations: 简体中文

Tip

ZoomImage needs to receive double-click events, so it has to intercept click and long press events, and you can receive both events through the provided interface

Examples

compose:

SketchZoomAsyncImage(
    imageUri = "https://sample.com/sample.jpeg",
    contentDescription = "view image",
    modifier = Modifier.fillMaxSize(),
    onTap = { touch: Offset ->
        // Click Events
    },
    onLongPress = { touch: Offset ->
        // Long press event    
    },
)

view:

View's setOnClickListener and setOnLongClickListener methods are still available Additional OnViewTapListener and OnViewLongPressListener interfaces with touch location are provided

val sketchZoomImageView = SketchZoomImageView(context)

sketchZoomImageView.onViewTapListener = { view: android.view.View, x: Float, y: Float ->
    // Click Events
}

sketchZoomImageView.onViewLongPressListener = { view: android.view.View, x: Float, y: Float ->
    // Long press event      
}