-
-
Notifications
You must be signed in to change notification settings - Fork 259
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] - setOnCropImageCompleteListener does not work #261
Comments
Hey @kingspride thanks for the detailed issue, helps a lot to understand and be useful ^^
It should only get called after you call to drop. While selecting the area, moving, scaling we are not cropping yet. To use crop from the Can check more in the sample code. Obs: We have a strange shadow bug that I was trying to fix last weekend, not lucky yet ;) |
I'm closing, since the behaviour looks ok from the text, let's reopen if need, let me know ^^ |
@Canato I need to get the cropped image as soon as the user releases the cropping rectangle. there's also a setOnSetCropOverlayReleasedListener which in principle does what I want, but unfortunately using this breaks the cropper's automatic zoom. maybe you want to look into that aswell. otherwise, this is a really great lib. feels like a unix tool: does only one thing, but its very streamlined and good at that. EDIT: heres the code snippet: binding.cropImageView.setOnSetCropOverlayReleasedListener{
binding.cardPreviewInclude.profile.setImageBitmap(binding.cropImageView.croppedImage?.let { it1 -> cropToSquare(it1) })
} |
This is what you mean by broke zoom? This is what I mean here:
If this is the bug, is not exactly related to the listener, but something else we need to fix, so you can use the |
yes. If I dont use the Listener, its behaving normally. |
Exactly, I can reproduce this some times on normal usage, so I'm sure is not related to this listener =| But is some pain to fix this, since is not consistent, but maybe is consistent with |
... I just wanted to add that the zoom gets applied when dragging the cropping rectangle to an edge - maybe this helps finding the root cause ;) |
On the line Why you believe they should be different? |
Yeah I think its a misunderstanding. sorry. |
I think I found the cause of the shadow bug: also, if I would use |
Will take a better look ASAP, but if you found consistency, let's open a PR and merge it =D |
I could verify now that the I've tested on Android 6.0.1 (SDK23) on an old Moto G 3rd Gen, and it worked as expected. If you are OK with it, I would open a PR and just remove the 3 occurences of |
Please open, yeah big chance this was forgot in some part or wrong copied pasted. On the PR, please add the steps to reproduce |
ready to merge :) |
@kingspride I'm having a little of problem finding time to test the ticket, but will soon XD. Thanks for the amazing work |
Describe the bug
setOnCropImageCompleteListener does not work
Lambda function never gets called.
To Reproduce
use the CropImageView, then:
create a Lambda function:
notice that it never gets called when moving and scaling the crop region.
Expected behavior
Lambda should get called when releasing the cropping rectangle so that the selected region can be automatically refreshed into i.E. a Preview Drawable
Media
Smartphone (please complete the following information):
The text was updated successfully, but these errors were encountered: