Skip to content

Commit f9bc5f3

Browse files
committed
fix android build fail
1 parent bccab5b commit f9bc5f3

File tree

374 files changed

+20
-42282
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

374 files changed

+20
-42282
lines changed

README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,8 @@ const response = await MultipleImagePicker.openPicker(options);
128128
| maximumMessageTitle | string | Notification | iOS | The title of the alert when the user chooses to exceed the specified number of pictures |
129129
| messageTitleButton | string | Notification | iOS | The title of button in the alert when the user chooses to exceed the specified number of pictures |
130130
| tapHereToChange | string | Tap here to change | iOS | The sub-title in navigation bar (under albums's name in iOS) |
131-
| maximumMessage | string | You have selected the maximum number of media allowed | Both | The description of the alert when the user chooses to exceed the specified number of pictures |
132-
| maximumVideoMessage | string | You have selected the maximum number of media allowed | Both | The description of the alert when the user chooses to exceed the specified number of videos |
131+
| maximumMessage | string | You have selected the maximum number of media allowed | iOS | The description of the alert when the user chooses to exceed the specified number of pictures |
132+
| maximumVideoMessage | string | You have selected the maximum number of media allowed | iOS | The description of the alert when the user chooses to exceed the specified number of videos |
133133

134134
#### selectedAssets (Important)
135135

@@ -140,7 +140,7 @@ Get an Array value only. If you want React Native Multiple Image Picker to re-se
140140
| Property | Type | Platform | Description |
141141
| ---------------- | :----: | :------: | :--------------------------------------------------------------------------------------------------- |
142142
| path | string | Both | Selected media's path |
143-
| filename | string | Both | Selected media's filename |
143+
| fileName | string | Both | Selected media's file name |
144144
| localIdentifier | string | Both | Selected media's local identifier |
145145
| width | number | Both | Selected photo/video width |
146146
| height | number | Both | Selected photo/video height |
@@ -155,9 +155,8 @@ Get an Array value only. If you want React Native Multiple Image Picker to re-se
155155

156156
## To Do
157157

158-
- [ ] Typescript.
159158
- [ ] (Bug) Record Video (iOS).
160-
- [ ] Video Compression.
159+
- [ ] Crop Image in iOS.
161160

162161
## Performance
163162

android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ dependencies {
126126
// noinspection GradleDynamicVersion
127127
api 'com.facebook.react:react-native:+'
128128
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
129-
implementation project(":picture_library")
129+
implementation 'io.github.lucksiege:pictureselector:v2.7.3-rc08'
130130
implementation 'com.github.bumptech.glide:glide:4.12.0'
131131
annotationProcessor 'com.github.bumptech.glide:compiler:4.12.0'
132132
}

android/src/main/java/com/reactnativemultipleimagepicker/MultipleImagePickerModule.kt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ class MultipleImagePickerModule(reactContext: ReactApplicationContext) :
4343
private var isExportThumbnail: Boolean = false
4444
private var maxVideo: Int = 20
4545
private var isCamera: Boolean = true
46-
private var maximumMessage: String = ""
47-
private var maximumVideoMessage: String = ""
4846

4947
@ReactMethod
5048
fun openPicker(options: ReadableMap?, promise: Promise): Unit {
@@ -101,7 +99,7 @@ class MultipleImagePickerModule(reactContext: ReactApplicationContext) :
10199
}
102100

103101
override fun onCancel() {
104-
promise.reject("user cancel")
102+
promise.reject("PICKER_CANCELLED", "User has canceled", null)
105103
}
106104
})
107105
}
@@ -119,8 +117,6 @@ class MultipleImagePickerModule(reactContext: ReactApplicationContext) :
119117
maxVideo = options.getInt("maxVideo")
120118
mPictureParameterStyle = getStyle(options)
121119
isCamera = options.getBoolean("usedCameraButton")
122-
maximumMessage = options.getString("maximumMessage").toString()
123-
maximumVideoMessage = options.getString("maximumVideoMessage").toString()
124120
}
125121
}
126122

@@ -210,7 +206,7 @@ class MultipleImagePickerModule(reactContext: ReactApplicationContext) :
210206
val type: String = if (item.mimeType.startsWith("video/")) "video" else "image"
211207
media.putString("path", item.path)
212208
media.putString("realPath", item.realPath)
213-
media.putString("filename", item.fileName)
209+
media.putString("fileName", item.fileName)
214210
media.putInt("width", item.width)
215211
media.putInt("height", item.height)
216212
media.putString("mime", item.mimeType)

example/android/settings.gradle

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,5 @@ rootProject.name = 'MultipleImagePickerExample'
22
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
33
include ':app'
44

5-
include ':picture_library'
6-
project(':picture_library').projectDir = new File(rootProject.projectDir, '../../picture_library')
7-
85
include ':reactnativemultipleimagepicker'
96
project(':reactnativemultipleimagepicker').projectDir = new File(rootProject.projectDir, '../../android')

example/src/App.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export default function App() {
1919
console.log('done: ', response);
2020
setImages(response);
2121
} catch (e) {
22-
console.log(e);
22+
console.log(e.code, e.message);
2323
}
2424
};
2525

ios/MultipleImagePicker.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ class MultipleImagePicker: NSObject, TLPhotosPickerViewControllerDelegate,UINavi
144144
var media = [
145145
"path": "file://" + filePath! as String,
146146
"localIdentifier": asset.localIdentifier,
147-
"filename":TLAsset.originalFileName!,
147+
"fileName":TLAsset.originalFileName!,
148148
"width": Int(asset.pixelWidth ) as NSNumber,
149149
"height": Int(asset.pixelHeight ) as NSNumber,
150150
"mime": type!,
@@ -211,6 +211,10 @@ class MultipleImagePicker: NSObject, TLPhotosPickerViewControllerDelegate,UINavi
211211
return false
212212
}
213213

214+
func photoPickerDidCancel() {
215+
self.reject("PICKER_CANCELLED", "User has canceled", nil)
216+
}
217+
214218
internal func dismissLoading() {
215219
if let vc = self.getTopMostViewController()?.presentedViewController, vc is UIAlertController {
216220
self.getTopMostViewController()?.dismiss(animated: false, completion: nil)

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.4.6",
3+
"version": "0.4.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",

picture_library/.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

picture_library/build.gradle

Lines changed: 0 additions & 48 deletions
This file was deleted.

picture_library/config.gradle

Lines changed: 0 additions & 37 deletions
This file was deleted.

0 commit comments

Comments
 (0)