forked from ivpusic/react-native-image-crop-picker
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit a166b5d
Showing
72 changed files
with
4,107 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# OSX | ||
# | ||
.DS_Store | ||
|
||
# Xcode | ||
# | ||
build/ | ||
*.pbxuser | ||
!default.pbxuser | ||
*.mode1v3 | ||
!default.mode1v3 | ||
*.mode2v3 | ||
!default.mode2v3 | ||
*.perspectivev3 | ||
!default.perspectivev3 | ||
xcuserdata | ||
*.xccheckout | ||
*.moved-aside | ||
DerivedData | ||
*.hmap | ||
*.ipa | ||
*.xcuserstate | ||
project.xcworkspace | ||
|
||
# Android/IJ | ||
# | ||
.idea | ||
.gradle | ||
local.properties | ||
|
||
# node.js | ||
# | ||
node_modules/ | ||
npm-debug.log | ||
|
||
# BUCK | ||
buck-out/ | ||
\.buckd/ | ||
android/app/libs | ||
android/keystores/debug.keystore | ||
pods | ||
.vscode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
# react-native-image-crop-picker | ||
iOS/Android image picker with support for multiple images and cropping | ||
|
||
**NOTE:** This library is result of one-night hacking, so please use it with caution. Don't assume there are not bugs. It is tested just on simple cases. | ||
|
||
## Result | ||
|
||
#### iOS | ||
<img width=200 title="iOS Single Pick" src="https://github.com/ivpusic/react-native-image-crop-picker/blob/master/images/ios_single_pick.png"> | ||
<img width=200 title="iOS Crop" src="https://github.com/ivpusic/react-native-image-crop-picker/blob/master/images/ios_crop.png"> | ||
<img width=200 title="iOS Multiple Pick" src="https://github.com/ivpusic/react-native-image-crop-picker/blob/master/images/ios_multiple_pick.png"> | ||
|
||
#### Android | ||
<img width=200 title="iOS Single Pick" src="https://github.com/ivpusic/react-native-image-crop-picker/blob/master/images/android_single_pick.png"> | ||
<img width=200 title="iOS Crop" src="https://github.com/ivpusic/react-native-image-crop-picker/blob/master/images/android_crop.png"> | ||
<img width=200 title="iOS Multiple Pick" src="https://github.com/ivpusic/react-native-image-crop-picker/blob/master/images/android_multiple.png"> | ||
|
||
## Usage | ||
|
||
Import library | ||
```javascript | ||
import ImagePicker from 'react-native-image-crop-picker'; | ||
``` | ||
|
||
Call single image picker with cropping | ||
```javascript | ||
ImagePicker.openPicker({ | ||
width: 300, | ||
height: 400, | ||
cropping: true | ||
}).then(image => { | ||
console.log(image); | ||
}); | ||
``` | ||
|
||
Call multiple image picker | ||
```javascript | ||
ImagePicker.openPicker({ | ||
multiple: true | ||
}).then(images => { | ||
console.log(images); | ||
}); | ||
``` | ||
|
||
## Install | ||
|
||
`npm install react-native-image-crop-picker --save` | ||
|
||
#### iOS | ||
|
||
``` | ||
pod 'react-native-image-crop-picker', :path => '../node_modules/react-native-image-crop-picker/ios' | ||
``` | ||
|
||
#### Android | ||
```gradle | ||
// file: android/settings.gradle | ||
... | ||
include ':react-native-image-crop-picker' | ||
project(':react-native-image-crop-picker').projectDir = new File(settingsDir, '../node_modules/react-native-image-crop-picker/android') | ||
``` | ||
```gradle | ||
// file: android/app/build.gradle | ||
... | ||
dependencies { | ||
... | ||
compile project(':react-native-image-crop-picker') | ||
} | ||
``` | ||
|
||
```java | ||
// file: MainActivity.java | ||
... | ||
|
||
import com.reactnative.picker.PickerPackage; // import package | ||
|
||
public class MainActivity extends ReactActivity { | ||
|
||
/** | ||
* A list of packages used by the app. If the app uses additional views | ||
* or modules besides the default ones, add more packages here. | ||
*/ | ||
@Override | ||
protected List<ReactPackage> getPackages() { | ||
return Arrays.<ReactPackage>asList( | ||
new MainReactPackage(), | ||
new PickerPackage() // Add package | ||
); | ||
} | ||
... | ||
} | ||
``` | ||
|
||
## How it works? | ||
|
||
It is basically wrapper around few libraries | ||
|
||
#### Android | ||
- Native Image Picker | ||
- uCrop | ||
|
||
#### iOS | ||
- QBImagePickerController | ||
- RSKImageCropper | ||
|
||
## License | ||
*MIT* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,146 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<module external.linked.project.id="android" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="" external.system.module.version="unspecified" type="JAVA_MODULE" version="4"> | ||
<component name="FacetManager"> | ||
<facet type="android-gradle" name="Android-Gradle"> | ||
<configuration> | ||
<option name="GRADLE_PROJECT_PATH" value=":" /> | ||
</configuration> | ||
</facet> | ||
<facet type="android" name="Android"> | ||
<configuration> | ||
<option name="SELECTED_BUILD_VARIANT" value="debug" /> | ||
<option name="SELECTED_TEST_ARTIFACT" value="_android_test_" /> | ||
<option name="ASSEMBLE_TASK_NAME" value="assembleDebug" /> | ||
<option name="COMPILE_JAVA_TASK_NAME" value="compileDebugSources" /> | ||
<afterSyncTasks> | ||
<task>generateDebugSources</task> | ||
</afterSyncTasks> | ||
<option name="ALLOW_USER_CONFIGURATION" value="false" /> | ||
<option name="MANIFEST_FILE_RELATIVE_PATH" value="/src/main/AndroidManifest.xml" /> | ||
<option name="RES_FOLDER_RELATIVE_PATH" value="/src/main/res" /> | ||
<option name="RES_FOLDERS_RELATIVE_PATH" value="" /> | ||
<option name="ASSETS_FOLDER_RELATIVE_PATH" value="/src/main/assets" /> | ||
<option name="LIBRARY_PROJECT" value="true" /> | ||
</configuration> | ||
</facet> | ||
</component> | ||
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="false"> | ||
<output url="file://$MODULE_DIR$/build/intermediates/classes/debug" /> | ||
<output-test url="file://$MODULE_DIR$/build/intermediates/classes/test/debug" /> | ||
<exclude-output /> | ||
<content url="file://$MODULE_DIR$"> | ||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/debug" isTestSource="false" generated="true" /> | ||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/debug" isTestSource="false" generated="true" /> | ||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/debug" isTestSource="false" generated="true" /> | ||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/debug" isTestSource="false" generated="true" /> | ||
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/debug" type="java-resource" /> | ||
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/debug" type="java-resource" /> | ||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/androidTest/debug" isTestSource="true" generated="true" /> | ||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/androidTest/debug" isTestSource="true" generated="true" /> | ||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/androidTest/debug" isTestSource="true" generated="true" /> | ||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/androidTest/debug" isTestSource="true" generated="true" /> | ||
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/androidTest/debug" type="java-test-resource" /> | ||
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/androidTest/debug" type="java-test-resource" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/debug/res" type="java-resource" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/debug/resources" type="java-resource" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/debug/assets" type="java-resource" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/debug/aidl" isTestSource="false" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/debug/java" isTestSource="false" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/debug/jni" isTestSource="false" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/debug/rs" isTestSource="false" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/debug/shaders" isTestSource="false" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/res" type="java-test-resource" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/resources" type="java-test-resource" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/assets" type="java-test-resource" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/aidl" isTestSource="true" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/java" isTestSource="true" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/jni" isTestSource="true" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/rs" isTestSource="true" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/shaders" isTestSource="true" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/main/res" type="java-resource" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/main/assets" type="java-resource" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/main/aidl" isTestSource="false" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/main/jni" isTestSource="false" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/main/shaders" isTestSource="false" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/test/res" type="java-test-resource" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/test/assets" type="java-test-resource" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/test/aidl" isTestSource="true" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/test/jni" isTestSource="true" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders" isTestSource="true" /> | ||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/annotations" /> | ||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" /> | ||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" /> | ||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/bundles" /> | ||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" /> | ||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dependency-cache" /> | ||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/animated-vector-drawable/23.3.0/jars" /> | ||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.3.0/jars" /> | ||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/recyclerview-v7/23.0.1/jars" /> | ||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-v4/23.3.0/jars" /> | ||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-vector-drawable/23.3.0/jars" /> | ||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.facebook.fresco/drawee/0.8.1/jars" /> | ||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.facebook.fresco/fbcore/0.8.1/jars" /> | ||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.facebook.fresco/fresco/0.8.1/jars" /> | ||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.facebook.fresco/imagepipeline-okhttp/0.8.1/jars" /> | ||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.facebook.fresco/imagepipeline/0.8.1/jars" /> | ||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.facebook.react/react-native/0.20.1/jars" /> | ||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.yalantis/ucrop/1.5.0/jars" /> | ||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/org.webkit/android-jsc/r174650/jars" /> | ||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" /> | ||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental-safeguard" /> | ||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jniLibs" /> | ||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/lint" /> | ||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" /> | ||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/mockable-android-23.jar" /> | ||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" /> | ||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/resources" /> | ||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" /> | ||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/shaders" /> | ||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" /> | ||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/transforms" /> | ||
<excludeFolder url="file://$MODULE_DIR$/build/outputs" /> | ||
<excludeFolder url="file://$MODULE_DIR$/build/tmp" /> | ||
</content> | ||
<orderEntry type="jdk" jdkName="Android API 23 Platform" jdkType="Android SDK" /> | ||
<orderEntry type="sourceFolder" forTests="false" /> | ||
<orderEntry type="library" exported="" name="okhttp-ws-2.5.0" level="project" /> | ||
<orderEntry type="library" exported="" name="okio-1.6.0" level="project" /> | ||
<orderEntry type="library" exported="" name="okhttp-2.5.0" level="project" /> | ||
<orderEntry type="library" exported="" name="stetho-1.2.0" level="project" /> | ||
<orderEntry type="library" exported="" name="jsr305-3.0.0" level="project" /> | ||
<orderEntry type="library" exported="" name="fbcore-0.8.1" level="project" /> | ||
<orderEntry type="library" exported="" name="commons-cli-1.2" level="project" /> | ||
<orderEntry type="library" exported="" name="recyclerview-v7-23.0.1" level="project" /> | ||
<orderEntry type="library" exported="" name="imagepipeline-0.8.1" level="project" /> | ||
<orderEntry type="library" exported="" name="android-jsc-r174650" level="project" /> | ||
<orderEntry type="library" exported="" name="fresco-0.8.1" level="project" /> | ||
<orderEntry type="library" exported="" name="support-v4-23.3.0" level="project" /> | ||
<orderEntry type="library" exported="" name="imagepipeline-okhttp-0.8.1" level="project" /> | ||
<orderEntry type="library" exported="" name="bolts-android-1.1.4" level="project" /> | ||
<orderEntry type="library" exported="" name="drawee-0.8.1" level="project" /> | ||
<orderEntry type="library" exported="" name="support-annotations-23.3.0" level="project" /> | ||
<orderEntry type="library" exported="" name="support-vector-drawable-23.3.0" level="project" /> | ||
<orderEntry type="library" exported="" name="animated-vector-drawable-23.3.0" level="project" /> | ||
<orderEntry type="library" exported="" name="appcompat-v7-23.3.0" level="project" /> | ||
<orderEntry type="library" exported="" name="library-2.4.0" level="project" /> | ||
<orderEntry type="library" exported="" name="stetho-okhttp-1.2.0" level="project" /> | ||
<orderEntry type="library" exported="" name="ucrop-1.5.0" level="project" /> | ||
<orderEntry type="library" exported="" name="jackson-core-2.2.3" level="project" /> | ||
<orderEntry type="library" exported="" name="okhttp-3.2.0" level="project" /> | ||
<orderEntry type="library" exported="" name="react-native-0.20.1" level="project" /> | ||
</component> | ||
</module> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
buildscript { | ||
repositories { | ||
jcenter() | ||
} | ||
|
||
dependencies { | ||
classpath 'com.android.tools.build:gradle:2.1.0' | ||
} | ||
} | ||
|
||
apply plugin: 'com.android.library' | ||
|
||
android { | ||
compileSdkVersion 23 | ||
buildToolsVersion "23.0.1" | ||
|
||
defaultConfig { | ||
minSdkVersion 18 | ||
targetSdkVersion 22 | ||
versionCode 1 | ||
} | ||
lintOptions { | ||
abortOnError false | ||
} | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
compile 'com.facebook.react:react-native:0.20.+' | ||
compile 'com.yalantis:ucrop:1.5.0' | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#Tue May 17 14:28:43 CEST 2016 | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip |
Oops, something went wrong.