Justin Xu
03/01/2023, 9:22 PMvar pfpURI: Uri by remember { mutableStateOf(Uri.EMPTY) }
...
val profilePictureLauncher =
rememberLauncherForActivityResult(CropImageContract()) { result ->
if (result.isSuccessful) {
pfpURI = result.uriContent!!
}
}
...
// Launch the select/crop image activity
profilePictureLauncher.launch(
CropImageContractOptions(
null,
CropImageOptions(
guidelines = CropImageView.Guidelines.ON,
fixAspectRatio = true,
outputCompressFormat =
Bitmap.CompressFormat.PNG
)
)
)
However, once I launch the launcher and select the image to crop, the cropping screen shows up but there isn't any button to actually confirm the crop and finish the activity with the cropped URI as result. I put a screenshot below of the screen I get stuck on, is there something I'm missing in the code to confirm the crop? ThanksBaoNguyen
03/02/2023, 8:17 AM