Skip to content

Conversation

@adwiv
Copy link

@adwiv adwiv commented Oct 28, 2016

There is no change in the way library is invoked, except that it now allows you to pass a null or empty Uri.

The changes in this PR are:

CropImage

  • CropImage.activity(Uri) method does not throw exception if image uri is null or empty. We can also alternatively create a new method, but I thought this might be better to have a single entry point.
  • If camera permission is not available when collect the intents to show the image pickers, the camera related intents are ignored. This allows us to create a picker without always needing the camera permission.
  • Changes to annotations for allowing null uri and remove lint warnings.

CropImageActivity

  • If the passed uri requires storage permission, request the permission and set image after receiving permission.
  • If the passed uri is null, start a picker. However, if camera permission is explicitly required, request the camera permission first and then start the picker in the onRequestPermissionsResult.
  • We dont care whether the user allowed or denied the camera permission. CropImage picker will automatically remove the camera intents if permission is not available.

AndroidManifest of QuickStart Sample

  • Request Camera permission to test for permission handling. Not actually required for quickstart sample. Can be removed after testing.

QuickStart MainActivity

  • Removed unnecessary code not required after the new change.

@ArthurHub
Copy link
Owner

Sorry it took me so long to check your PR.

AWESOME WORK! LOVE IT!

you are awesome

@ArthurHub ArthurHub merged commit 9e53d85 into ArthurHub:master Nov 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants