Skip to content

Latest commit

 

History

History
51 lines (37 loc) · 1.56 KB

click.md

File metadata and controls

51 lines (37 loc) · 1.56 KB

Click Events

Translations: 简体中文

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 = "http://sample.com/sample.jpg",
    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      
}