Skip to content

Commit 1452782

Browse files
committed
solve issue
1 parent 32143a8 commit 1452782

File tree

4 files changed

+20
-10
lines changed

4 files changed

+20
-10
lines changed

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,8 @@ Get an Array value only. If you want React Native Multiple Image Picker to re-se
136136
| creationDate | string | iOS | UNIX timestamp when image was created |
137137

138138
## To Do
139-
- [ ] Crop photo.
140-
- [ ] Multiple croping photo (Android only).
141139
- [ ] Video Compression
140+
- [ ] Hmmm...
142141

143142
## Performance
144143

android/build.gradle

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,9 @@ dependencies {
127127
// noinspection GradleDynamicVersion
128128
api 'com.facebook.react:react-native:+'
129129
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
130-
implementation "com.github.LuckSiege.PictureSelector:picture_library:v2.6.0"
130+
implementation ('com.github.LuckSiege.PictureSelector:picture_library:v2.6.0'){
131+
exclude group: 'com.github.LuckSiege.PictureSelector', module: 'ucrop'
132+
}
131133
implementation 'com.github.bumptech.glide:glide:4.12.0'
132134
annotationProcessor 'com.github.bumptech.glide:compiler:4.12.0'
133135
}

ios/CustomPhotoPicker/CustomPhotoPickerViewController.swift

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,26 @@ class CustomPhotoPickerViewController: TLPhotosPickerViewController {
1717

1818
override func makeUI() {
1919
super.makeUI()
20-
self.customNavItem.leftBarButtonItem = UIBarButtonItem.init(barButtonSystemItem: .stop, target: nil, action: #selector(customAction))
20+
let leftBarButtonItem = UIBarButtonItem.init(barButtonSystemItem: .stop, target: nil, action: #selector(customAction))
21+
leftBarButtonItem.tintColor = .black
22+
self.customNavItem.leftBarButtonItem = leftBarButtonItem
2123
self.customNavItem.rightBarButtonItem?.tintColor = MultipleImagePickerConfigure.selectedColor
2224
}
2325

24-
2526
@objc func customAction() {
26-
self.delegate?.photoPickerDidCancel()
27-
self.dismiss(animated: true) { [weak self] in
28-
self?.delegate?.dismissComplete()
29-
self?.dismissCompletion?()
27+
DispatchQueue.main.async {
28+
self.getTopMostViewController()?.dismiss(animated: true, completion: nil)
29+
}
30+
}
31+
32+
func getTopMostViewController() -> UIViewController? {
33+
var topMostViewController = UIApplication.shared.keyWindow?.rootViewController
34+
35+
while let presentedViewController = topMostViewController?.presentedViewController {
36+
topMostViewController = presentedViewController
3037
}
38+
39+
return topMostViewController
3140
}
3241

3342

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@baronha/react-native-multiple-image-picker",
3-
"version": "0.2.6",
3+
"version": "0.2.7",
44
"description": "react-native-multiple-image-picker enables application to pick images and videos from multiple smart album in iOS/Android, similar to the current facebook app.",
55
"main": "lib/commonjs/index",
66
"module": "lib/module/index",

0 commit comments

Comments
 (0)