capture Async And Share
Capture and share Image
capture and saveTo Cache Folder then make Intent.ACTION_SEND For share
also see CaptureController.captureAsync
Example usage:
val captureController = rememberCaptureController()
val uiScope = rememberCoroutineScope()
val context = LocalContext.current
// The content to be captured in to Bitmap
Column(
modifier = Modifier.capturable(captureController),
) {
// Composable content
}
Button(
onClick = {
scope.launch {
captureController.captureAsyncAndShare(
context = context
)
}
}) { ... }
Parameters
Context
Share Type PNG or JPEG ImageType
Need For get contentUri default value : (com.your.package).fileprovider
add option if need for Intent.createChooser Custom Actions / Custom Target / Excluding Component
clear temp file when exit app
Capture and share Image
capture and saveTo platform.Foundation.NSTemporaryDirectory then make UIActivityViewController For share
also see CaptureController.captureAsync
Example usage:
val captureController = rememberCaptureController()
val uiScope = rememberCoroutineScope()
// The content to be captured in to Bitmap
Column(
modifier = Modifier.capturable(captureController),
) {
// Composable content
}
Button(
onClick = {
scope.launch {
captureController.captureAsyncAndShare()
}
}) { ... }
Parameters
save temp File name default value : "capture_shared"
title of UIActivityViewController meta default value : "Share Captured Image"
Share Type PNG or JPEG ImageType
add option if need for UIActivityViewController
The topViewController where UIActivityViewController will be presented. By default, it retrieves the top rootViewController.