Skip to content

Instantly share code, notes, and snippets.

@ch8n
Created October 16, 2021 10:39
Show Gist options
  • Save ch8n/0e1e4c19d5cdb398a374c0b0755ed67e to your computer and use it in GitHub Desktop.
Save ch8n/0e1e4c19d5cdb398a374c0b0755ed67e to your computer and use it in GitHub Desktop.
Coloumn {
val snapShot = CaptureBitmap {
Button(
onClick = {},
modifier = Modifier
.fillMaxWidth()
.padding(24.dp)
.height(55.dp),
) {
Text(text = "Capture my image")
}
}
Button(
onClick = {
MainScope().launch {
val bitmap = snapShot.invoke()
val uri = saveImage(bitmap, context)
if (uri != null) {
shareImageUri(context, uri)
}
}
},
modifier = Modifier
.fillMaxWidth()
.padding(24.dp)
.height(55.dp),
) {
Text(text = "Share")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment