Created
January 31, 2023 11:20
-
-
Save tdcolvin/15245cc69302180036c26f99c2bcc622 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
//The URI of the photo that the user has picked | |
var photoUri: Uri? by remember { mutableStateOf(null) } | |
//The launcher we will use for the PickVisualMedia contract. | |
//When .launch()ed, this will display the photo picker. | |
val launcher = rememberLauncherForActivityResult(ActivityResultContracts.PickVisualMedia()) { uri -> | |
//When the user has selected a photo, its URL is returned here | |
photoUri = uri | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment