Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
react-native-syan-image-picker
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenSource
react-native-syan-image-picker
Commits
98e93870
Commit
98e93870
authored
Apr 03, 2019
by
少言
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix iOS 视频size
change 安卓包名
parent
86a93d38
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
7 additions
and
11 deletions
+7
-11
AndroidManifest.xml
android/src/main/AndroidManifest.xml
+1
-1
RNSyanImagePickerModule.java
...src/main/java/com/syanpicker/RNSyanImagePickerModule.java
+1
-1
RNSyanImagePickerPackage.java
...rc/main/java/com/syanpicker/RNSyanImagePickerPackage.java
+2
-2
RNSyanImagePicker.m
ios/RNSyanImagePicker.m
+2
-6
package.json
package.json
+1
-1
No files found.
android/src/main/AndroidManifest.xml
View file @
98e93870
<manifest
xmlns:android=
"http://schemas.android.com/apk/res/android"
<manifest
xmlns:android=
"http://schemas.android.com/apk/res/android"
package=
"com.
reactlibrary
"
>
package=
"com.
syanpicker
"
>
<application>
<application>
</application>
</application>
...
...
android/src/main/java/com/
reactlibrary
/RNSyanImagePickerModule.java
→
android/src/main/java/com/
syanpicker
/RNSyanImagePickerModule.java
View file @
98e93870
package
com
.
reactlibrary
;
package
com
.
syanpicker
;
import
android.app.Activity
;
import
android.app.Activity
;
import
android.content.Intent
;
import
android.content.Intent
;
...
...
android/src/main/java/com/
reactlibrary
/RNSyanImagePickerPackage.java
→
android/src/main/java/com/
syanpicker
/RNSyanImagePickerPackage.java
View file @
98e93870
package
com
.
reactlibrary
;
package
com
.
syanpicker
;
import
com.facebook.react.ReactPackage
;
import
com.facebook.react.ReactPackage
;
import
com.facebook.react.bridge.JavaScriptModule
;
import
com.facebook.react.bridge.JavaScriptModule
;
...
...
ios/RNSyanImagePicker.m
View file @
98e93870
...
@@ -95,9 +95,7 @@ RCT_EXPORT_METHOD(openVideoPicker:(NSDictionary *)options callback:(RCTResponseS
...
@@ -95,9 +95,7 @@ RCT_EXPORT_METHOD(openVideoPicker:(NSDictionary *)options callback:(RCTResponseS
}
}
-
(
void
)
openTZImagePicker
:
(
NSDictionary
*
)
options
callback
:
(
RCTResponseSenderBlock
)
callback
{
-
(
void
)
openTZImagePicker
:
(
NSDictionary
*
)
options
callback
:
(
RCTResponseSenderBlock
)
callback
{
// 照片最大可选张数
NSInteger
imageCount
=
[
options
sy_integerForKey
:
@"imageCount"
];
NSInteger
imageCount
=
[
options
sy_integerForKey
:
@"imageCount"
];
// 显示内部拍照按钮
BOOL
isCamera
=
[
options
sy_boolForKey
:
@"isCamera"
];
BOOL
isCamera
=
[
options
sy_boolForKey
:
@"isCamera"
];
BOOL
isCrop
=
[
options
sy_boolForKey
:
@"isCrop"
];
BOOL
isCrop
=
[
options
sy_boolForKey
:
@"isCrop"
];
BOOL
allowPickingGif
=
[
options
sy_boolForKey
:
@"allowPickingGif"
];
BOOL
allowPickingGif
=
[
options
sy_boolForKey
:
@"allowPickingGif"
];
...
@@ -158,8 +156,7 @@ RCT_EXPORT_METHOD(openVideoPicker:(NSDictionary *)options callback:(RCTResponseS
...
@@ -158,8 +156,7 @@ RCT_EXPORT_METHOD(openVideoPicker:(NSDictionary *)options callback:(RCTResponseS
NSMutableDictionary
*
video
=
[
NSMutableDictionary
dictionary
];
NSMutableDictionary
*
video
=
[
NSMutableDictionary
dictionary
];
video
[
@"uri"
]
=
outputPath
;
video
[
@"uri"
]
=
outputPath
;
video
[
@"fileName"
]
=
[
asset
valueForKey
:
@"filename"
];
video
[
@"fileName"
]
=
[
asset
valueForKey
:
@"filename"
];
PHAssetResource
*
resource
=
[[
PHAssetResource
assetResourcesForAsset
:
asset
]
firstObject
];
NSInteger
size
=
[[
NSFileManager
defaultManager
]
attributesOfItemAtPath
:
outputPath
error
:
nil
].
fileSize
;
long
long
size
=
[[
resource
valueForKey
:
@"fileSize"
]
longLongValue
];
video
[
@"size"
]
=
@
(
size
);
video
[
@"size"
]
=
@
(
size
);
if
(
asset
.
mediaType
==
PHAssetMediaTypeVideo
)
{
if
(
asset
.
mediaType
==
PHAssetMediaTypeVideo
)
{
video
[
@"type"
]
=
@"video"
;
video
[
@"type"
]
=
@"video"
;
...
@@ -194,8 +191,7 @@ RCT_EXPORT_METHOD(openVideoPicker:(NSDictionary *)options callback:(RCTResponseS
...
@@ -194,8 +191,7 @@ RCT_EXPORT_METHOD(openVideoPicker:(NSDictionary *)options callback:(RCTResponseS
NSMutableDictionary
*
video
=
[
NSMutableDictionary
dictionary
];
NSMutableDictionary
*
video
=
[
NSMutableDictionary
dictionary
];
video
[
@"uri"
]
=
outputPath
;
video
[
@"uri"
]
=
outputPath
;
video
[
@"fileName"
]
=
[
asset
valueForKey
:
@"filename"
];
video
[
@"fileName"
]
=
[
asset
valueForKey
:
@"filename"
];
PHAssetResource
*
resource
=
[[
PHAssetResource
assetResourcesForAsset
:
asset
]
firstObject
];
NSInteger
size
=
[[
NSFileManager
defaultManager
]
attributesOfItemAtPath
:
outputPath
error
:
nil
].
fileSize
;
long
long
size
=
[[
resource
valueForKey
:
@"fileSize"
]
longLongValue
];
video
[
@"size"
]
=
@
(
size
);
video
[
@"size"
]
=
@
(
size
);
if
(
asset
.
mediaType
==
PHAssetMediaTypeVideo
)
{
if
(
asset
.
mediaType
==
PHAssetMediaTypeVideo
)
{
video
[
@"type"
]
=
@"video"
;
video
[
@"type"
]
=
@"video"
;
...
...
package.json
View file @
98e93870
{
{
"name"
:
"react-native-syan-image-picker"
,
"name"
:
"react-native-syan-image-picker"
,
"version"
:
"0.3.
3
"
,
"version"
:
"0.3.
4
"
,
"description"
:
"React-Native 多图片选择 支持裁剪 压缩"
,
"description"
:
"React-Native 多图片选择 支持裁剪 压缩"
,
"main"
:
"index.js"
,
"main"
:
"index.js"
,
"scripts"
:
{
"scripts"
:
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment