Skip to content

Commit

Permalink
Prepare for release 3.3.6 (#259)
Browse files Browse the repository at this point in the history
* Code cleaning

* Update changelog release
  • Loading branch information
Canato authored Nov 5, 2021
1 parent cf8232c commit 33a0a42
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- `Fixed` for any bug fixes.
- `Security` in case of vulnerabilities.

## [unreleased 3.3.6] - 05/10/21
## [3.3.6] - 05/11/21
### Added
- Added `PickImageContractOptions` to enable users specify image source [#226](https://github.com/CanHub/Android-Image-Cropper/issues/226)

Expand Down
22 changes: 9 additions & 13 deletions cropper/src/main/java/com/canhub/cropper/CropImage.kt
Original file line number Diff line number Diff line change
Expand Up @@ -194,24 +194,20 @@ object CropImage {
val includeGallery = options.includeGallery
val allIntents: MutableList<Intent> = ArrayList()
val packageManager = context.packageManager

// collect all camera intents if Camera permission is available
if (!isExplicitCameraPermissionRequired(context) && includeCamera) {
if (!isExplicitCameraPermissionRequired(context) && includeCamera)
allIntents.addAll(getCameraIntents(context, packageManager))
}
if (includeGallery) {
allIntents.addAll(
getGalleryIntents(
packageManager,
Intent.ACTION_GET_CONTENT
)
)
}

if (includeGallery)
allIntents.addAll(getGalleryIntents(packageManager, Intent.ACTION_GET_CONTENT))

// Create a chooser from the main intent
val chooserIntent = Intent.createChooser(allIntents.removeAt(allIntents.size - 1), title)

// Add all other intents
chooserIntent.putExtra(
Intent.EXTRA_INITIAL_INTENTS, allIntents.toTypedArray<Parcelable>()
)
chooserIntent.putExtra(Intent.EXTRA_INITIAL_INTENTS, allIntents.toTypedArray<Parcelable>())

return chooserIntent
}

Expand Down

0 comments on commit 33a0a42

Please sign in to comment.