Created
October 19, 2021 12:15
-
-
Save victorbrndls/8416122ce59a80150bf9d559d7878699 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val result = remember { mutableStateOf<Bitmap?>(null) } | |
val launcher = rememberLauncherForActivityResult(ActivityResultContracts.TakePicturePreview()) { | |
result.value = it | |
} | |
Button(onClick = { launcher.launch() }) { ... } | |
result.value?.let { image -> | |
Image(image.asImageBitmap(), null, modifier = Modifier.fillMaxWidth()) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment