Translations: 简体中文
Tip
- The following example takes precedence over the Compose version component for demonstration
- ZoomState.zoomable is equivalent to ZoomImageView.zoomable
- ZoomState.subsampling is equivalent to ZoomImageView.subsampling
ZoomImage generates some logs during its run, which can help you find the problem when something goes wrong and help you understand it How ZoomImage works.
The Logger class encapsulates the print, level control, and output pipelines of logs
The Logger.level property controls the print level of the log, the default is INFO, you can modify it to expand the output range of the log
example:
val zoomState: ZoomState by rememberZoomState()
LaunchEffect(zoomState.logger) {
zoomState.logger.level = Logger.DEBUG
}
SketchZoomAsyncImage(
imageUri = "https://sample.com/sample.jpeg",
contentDescription = "view image",
modifier = Modifier.fillMaxSize(),
zoomState = zoomState,
)
The Logger.pipeline property controls the output pipeline of the log, and the default is AndroidLogPipeline to output to Android console, you can modify it to output logs elsewhere
example:
val zoomState: ZoomState by rememberZoomState()
zoomState.logger.pipeline = MyLoggerPipeline()
SketchZoomAsyncImage(
imageUri = "https://sample.com/sample.jpeg",
contentDescription = "view image",
modifier = Modifier.fillMaxSize(),
zoomState = zoomState,
)