I'm using <CanHub Image Cropper> to select and cro...
# compose
j
I'm using CanHub Image Cropper to select and crop a square image in compose, here is the launcher and invocation:
Copy code
var 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? Thanks
b
@Justin Xu I introduce you this library which we used in production app. https://github.com/mr0xf00/easycrop