-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
fix(android): allowEdit not working when sourceType is PHOTOLIBRARY #426
base: master
Are you sure you want to change the base?
Conversation
d0058d4
to
da5d8e6
Compare
Is there any chance this will be included in the next build of the plugin? |
Please thumb it up so so it can be merged. thanks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for your PR 👍 , I've added some comments
//Crop Codes | ||
private static final int CROP_OPERATION = 100; | ||
private static final int CROP_CAMERA = CROP_OPERATION; | ||
private static final int CROP_PHOTO_ALBUM = CROP_OPERATION + 900; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any particular reason for 900
? Can we use something better than a random magic number?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason is to give a clear distinction between CROP_CAMERA operation code and CROP_PHOTO_ALBUM operation code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @hazems, why 900 specifically? Is there a reason for it?
Hope this can be reviewed and merged soon, @timbru31! We too are relying on a fix for this issue for our app. Thanks! 😊 |
hello @hazems, |
This PR is not merged yet? which version of plugin are you using? What is your OS/device information? Do you have a sample that replicates the issue? If yes, feel free to open a new issue, and we will look into it. Thanks |
@hazems I took the initiative to merge ARR-233, locally, but no effect. (android) allowEdit not working when sourceType is PHOTOLIBRARY error still exists. Can I help you? |
Platforms affected
Android
Motivation and Context
allowEdit is not respected when source type is set to
PHOTOLIBRARY
. Looking into the code of the Camera plugin, I found that this case was never handled andallowEdit
never launches cropping tool at all for Android versions >= Marshmallow.This issue is reported in
#393
Description
In order to solve this issue, I made sure that
performCrop
is called whenallowEdit
is set totrue
forPHOTOALBUM
and introduced an extra new parameter toperformCrop
method in order to determine the source type to properly set request codes for Camera and Photo Album cropping cases.Testing
I did manual testing to test all various test cases that I have and all pass fine. I also run paramedic unit tests and they runs perfectly in my emulator.
Checklist
(platform)
if this change only applies to one platform (e.g.(android)
)