CanHub / Android-Image-Cropper

Image Cropping Library for Android, optimised for Camera / Gallery.
https://canhub.github.io/
Apache License 2.0
1.17k stars 240 forks source link

Opening camera doesn't allow exiting the activity #624

Closed akrulec closed 2 months ago

akrulec commented 2 months ago

I've recently upgraded the library to the newest version and I've noticed that starting the CropImageContract with opening the camera does two weird things: 1) It opens a camera in camera (see screenshot). 2) There is no way to exit the view. Pressing back brings back to the camera, and taking a picture, and saving it also brings the user back to the camera view.

Any idea what I might be setting wrong. These are the options: CropImageOptions( guidelines = CropImageView.Guidelines.ON, outputCompressFormat = Bitmap.CompressFormat.PNG, aspectRatioX = aspectRatio, aspectRatioY = aspectRatio, fixAspectRatio = true, outputRequestHeight = imageSize, outputRequestWidth = imageSize, cropMenuCropButtonTitle = "Save", activityBackgroundColor = ContextCompat.getColor(requireContext(), R.color.black), activityMenuTextColor = ContextCompat.getColor(requireContext(), R.color.white), imageSourceIncludeCamera = true, imageSourceIncludeGallery = false)

Screenshot_20240429_161251_Camera

vanniktech commented 2 months ago

Please just start the camera for yourself, create your own activity and just use the CropImageView directly. You're much more flexible this way.