├── .gitignore ├── .npmignore ├── LICENSE ├── README.md ├── android ├── build.gradle ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── src │ └── main │ ├── AndroidManifest.xml │ └── java │ └── com │ └── wix │ └── RNSwipeView │ ├── SwipeView.java │ ├── SwipeViewManager.java │ ├── SwipeViewPackage.java │ └── events │ ├── BouncedBackEvent.java │ ├── SwipeStartEvent.java │ ├── SwipedOutEvent.java │ ├── WillBeSwipedOutEvent.java │ └── WillBounceBackEvent.java ├── example ├── .buckconfig ├── .flowconfig ├── .gitignore ├── .watchmanconfig ├── android │ ├── app │ │ ├── BUCK │ │ ├── build.gradle │ │ ├── proguard-rules.pro │ │ └── src │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ └── com │ │ │ │ └── example │ │ │ │ ├── MainActivity.java │ │ │ │ └── MainApplication.java │ │ │ └── res │ │ │ ├── mipmap-hdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ └── ic_launcher.png │ │ │ └── values │ │ │ ├── strings.xml │ │ │ └── styles.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── keystores │ │ ├── BUCK │ │ └── debug.keystore.properties │ └── settings.gradle ├── index.android.js ├── index.ios.js ├── ios │ ├── example.xcodeproj │ │ ├── project.pbxproj │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── example.xcscheme │ ├── example │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── Base.lproj │ │ │ └── LaunchScreen.xib │ │ ├── Images.xcassets │ │ │ └── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ ├── Info.plist │ │ └── main.m │ └── exampleTests │ │ ├── Info.plist │ │ └── exampleTests.m └── package.json ├── index.js ├── ios └── lib │ ├── SwipeView.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata │ ├── SwipeViewManager.h │ └── SwipeViewManager.m ├── package.json └── src └── SwipeView.js /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | ############ 3 | # Node 4 | ############ 5 | # Logs 6 | logs 7 | *.log 8 | npm-debug.log* 9 | 10 | # Runtime data 11 | pids 12 | *.pid 13 | *.seed 14 | 15 | # Directory for instrumented libs generated by jscoverage/JSCover 16 | lib-cov 17 | 18 | # Coverage directory used by tools like istanbul 19 | coverage 20 | 21 | # nyc test coverage 22 | .nyc_output 23 | 24 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 25 | .grunt 26 | 27 | # node-waf configuration 28 | .lock-wscript 29 | 30 | # Compiled binary addons (http://nodejs.org/api/addons.html) 31 | build/Release 32 | 33 | # Dependency directories 34 | node_modules 35 | jspm_packages 36 | 37 | # Optional npm cache directory 38 | .npm 39 | 40 | # Optional REPL history 41 | .node_repl_history 42 | 43 | ################ 44 | # JetBrains 45 | ################ 46 | .idea 47 | 48 | ## File-based project format: 49 | *.iws 50 | 51 | ## Plugin-specific files: 52 | 53 | # IntelliJ 54 | /out/ 55 | 56 | # mpeltonen/sbt-idea plugin 57 | .idea_modules/ 58 | 59 | # JIRA plugin 60 | atlassian-ide-plugin.xml 61 | 62 | # Crashlytics plugin (for Android Studio and IntelliJ) 63 | com_crashlytics_export_strings.xml 64 | crashlytics.properties 65 | crashlytics-build.properties 66 | fabric.properties 67 | 68 | 69 | ############ 70 | # iOS 71 | ############ 72 | # Xcode 73 | # 74 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 75 | 76 | ## Build generated 77 | ios/build/ 78 | ios/DerivedData/ 79 | 80 | ## Various settings 81 | *.pbxuser 82 | !default.pbxuser 83 | *.mode1v3 84 | !default.mode1v3 85 | *.mode2v3 86 | !default.mode2v3 87 | *.perspectivev3 88 | !default.perspectivev3 89 | ios/xcuserdata/ 90 | 91 | ## Other 92 | *.moved-aside 93 | *.xcuserstate 94 | 95 | ## Obj-C/Swift specific 96 | *.hmap 97 | *.ipa 98 | *.dSYM.zip 99 | *.dSYM 100 | 101 | # CocoaPods 102 | # 103 | # We recommend against adding the Pods directory to your .gitignore. However 104 | # you should judge for yourself, the pros and cons are mentioned at: 105 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 106 | # 107 | ios/Pods/ 108 | 109 | # Carthage 110 | # 111 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 112 | # Carthage/Checkouts 113 | 114 | Carthage/Build 115 | 116 | # fastlane 117 | # 118 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 119 | # screenshots whenever they are needed. 120 | # For more information about the recommended setup visit: 121 | # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md 122 | 123 | fastlane/report.xml 124 | fastlane/screenshots 125 | 126 | 127 | ############ 128 | # Android 129 | ############ 130 | # Built application files 131 | *.apk 132 | *.ap_ 133 | 134 | # Files for the Dalvik VM 135 | *.dex 136 | 137 | # Java class files 138 | *.class 139 | 140 | # Generated files 141 | android/bin/ 142 | android/gen/ 143 | android/out/ 144 | 145 | # Gradle files 146 | android/.gradle/ 147 | android/build/ 148 | 149 | # Local configuration file (sdk path, etc) 150 | local.properties 151 | 152 | # Proguard folder generated by Eclipse 153 | android/proguard/ 154 | 155 | # Log Files 156 | *.log 157 | 158 | # Android Studio Navigation editor temp files 159 | android/.navigation/ 160 | 161 | # Android Studio captures folder 162 | android/captures/ 163 | 164 | # Intellij 165 | *.iml 166 | 167 | # Keystore files 168 | *.jks 169 | 170 | ################## 171 | # React-Native 172 | ################## 173 | # OSX 174 | # 175 | .DS_Store 176 | 177 | # Xcode 178 | # 179 | build/ 180 | *.pbxuser 181 | !default.pbxuser 182 | *.mode1v3 183 | !default.mode1v3 184 | *.mode2v3 185 | !default.mode2v3 186 | *.perspectivev3 187 | !default.perspectivev3 188 | xcuserdata 189 | *.xccheckout 190 | *.moved-aside 191 | DerivedData 192 | *.hmap 193 | *.ipa 194 | *.xcuserstate 195 | project.xcworkspace 196 | 197 | # Android/IJ 198 | # 199 | .idea 200 | .gradle 201 | local.properties 202 | 203 | # node.js 204 | # 205 | node_modules/ 206 | npm-debug.log 207 | 208 | # BUCK 209 | buck-out/ 210 | \.buckd/ 211 | android/app/libs 212 | android/keystores/debug.keystore 213 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | example/ 2 | test/ 3 | res/generated/ 4 | 5 | .npmignore 6 | 7 | 8 | ################# 9 | # from .gitignore: 10 | ################ 11 | 12 | 13 | ############ 14 | # Node 15 | ############ 16 | # Logs 17 | logs 18 | *.log 19 | npm-debug.log* 20 | 21 | # Runtime data 22 | pids 23 | *.pid 24 | *.seed 25 | 26 | # Directory for instrumented libs generated by jscoverage/JSCover 27 | lib-cov 28 | 29 | # Coverage directory used by tools like istanbul 30 | coverage 31 | 32 | # nyc test coverage 33 | .nyc_output 34 | 35 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 36 | .grunt 37 | 38 | # node-waf configuration 39 | .lock-wscript 40 | 41 | # Compiled binary addons (http://nodejs.org/api/addons.html) 42 | build/Release 43 | 44 | # Dependency directories 45 | node_modules 46 | jspm_packages 47 | 48 | # Optional npm cache directory 49 | .npm 50 | 51 | # Optional REPL history 52 | .node_repl_history 53 | 54 | ################ 55 | # JetBrains 56 | ################ 57 | .idea 58 | 59 | ## File-based project format: 60 | *.iws 61 | 62 | ## Plugin-specific files: 63 | 64 | # IntelliJ 65 | /out/ 66 | 67 | # mpeltonen/sbt-idea plugin 68 | .idea_modules/ 69 | 70 | # JIRA plugin 71 | atlassian-ide-plugin.xml 72 | 73 | # Crashlytics plugin (for Android Studio and IntelliJ) 74 | com_crashlytics_export_strings.xml 75 | crashlytics.properties 76 | crashlytics-build.properties 77 | fabric.properties 78 | 79 | 80 | ############ 81 | # iOS 82 | ############ 83 | # Xcode 84 | # 85 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 86 | 87 | ## Build generated 88 | ios/build/ 89 | ios/DerivedData/ 90 | 91 | ## Various settings 92 | *.pbxuser 93 | !default.pbxuser 94 | *.mode1v3 95 | !default.mode1v3 96 | *.mode2v3 97 | !default.mode2v3 98 | *.perspectivev3 99 | !default.perspectivev3 100 | ios/xcuserdata/ 101 | 102 | ## Other 103 | *.moved-aside 104 | *.xcuserstate 105 | 106 | ## Obj-C/Swift specific 107 | *.hmap 108 | *.ipa 109 | *.dSYM.zip 110 | *.dSYM 111 | 112 | # CocoaPods 113 | # 114 | # We recommend against adding the Pods directory to your .gitignore. However 115 | # you should judge for yourself, the pros and cons are mentioned at: 116 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 117 | # 118 | ios/Pods/ 119 | 120 | # Carthage 121 | # 122 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 123 | # Carthage/Checkouts 124 | 125 | Carthage/Build 126 | 127 | # fastlane 128 | # 129 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 130 | # screenshots whenever they are needed. 131 | # For more information about the recommended setup visit: 132 | # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md 133 | 134 | fastlane/report.xml 135 | fastlane/screenshots 136 | 137 | 138 | ############ 139 | # Android 140 | ############ 141 | # Built application files 142 | *.apk 143 | *.ap_ 144 | 145 | # Files for the Dalvik VM 146 | *.dex 147 | 148 | # Java class files 149 | *.class 150 | 151 | # Generated files 152 | android/bin/ 153 | android/gen/ 154 | android/out/ 155 | 156 | # Gradle files 157 | android/.gradle/ 158 | android/build/ 159 | android/*/build/ 160 | 161 | # Local configuration file (sdk path, etc) 162 | local.properties 163 | 164 | # Proguard folder generated by Eclipse 165 | android/proguard/ 166 | 167 | # Log Files 168 | *.log 169 | 170 | # Android Studio Navigation editor temp files 171 | android/.navigation/ 172 | 173 | # Android Studio captures folder 174 | android/captures/ 175 | 176 | # Intellij 177 | *.iml 178 | 179 | # Keystore files 180 | *.jks 181 | 182 | ################## 183 | # React-Native 184 | ################## 185 | # OSX 186 | # 187 | .DS_Store 188 | 189 | # Xcode 190 | # 191 | build/ 192 | *.pbxuser 193 | !default.pbxuser 194 | *.mode1v3 195 | !default.mode1v3 196 | *.mode2v3 197 | !default.mode2v3 198 | *.perspectivev3 199 | !default.perspectivev3 200 | xcuserdata 201 | *.xccheckout 202 | *.moved-aside 203 | DerivedData 204 | *.hmap 205 | *.ipa 206 | *.xcuserstate 207 | project.xcworkspace 208 | 209 | # Android/IJ 210 | # 211 | .idea 212 | android/.idea 213 | android/.gradle 214 | android/local.properties 215 | 216 | # node.js 217 | # 218 | node_modules/ 219 | npm-debug.log 220 | 221 | # BUCK 222 | buck-out/ 223 | \.buckd/ 224 | android/app/libs 225 | android/keystores/debug.keystore 226 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Wix.com 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # react-native-swipe-view 2 | A native container which provides a smooth drag interaction with any react-native view to implement a horizontal swiping behaviour, for example: swiping a "card" view out of the screen to delete it. 3 | 4 | ## Installation 5 | Install from `npm`: 6 | 7 | `npm i --save react-native-swipe-view` 8 | 9 | Now link the native libraries: 10 | 11 | #### Android 12 | Add to the app `build.gradle` dependencies: 13 | 14 | ``` 15 | compile project(':RNSwipeView') 16 | ``` 17 | 18 | Add to `settings.gradle`: 19 | 20 | ``` 21 | include ':RNSwipeView' 22 | project(':RNSwipeView').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-swipe-view/android') 23 | ``` 24 | 25 | Add the package to your MainApplication.java `getPackages` list: 26 | 27 | ``` 28 | import com.wix.RNSwipeView.SwipeViewPackage; 29 | 30 | @Override 31 | protected List getPackages() { 32 | return Arrays.asList( 33 | //add this pacakge: 34 | new SwipeViewPackage() 35 | ); 36 | } 37 | }; 38 | ``` 39 | 40 | #### iOS 41 | In Xcode, drag the `SwipeView.xcodeproj` from your node modules to the libraries list in the Project Navigator. Then add `libSwipeView` to your app target "Linked Frameworks and Libraries" 42 | 43 | ## Usage 44 | `react-native-swipe-view` export a Component called `SwipeView` which you can use to wrap any hirarchy of child views that you wish to be contained and interacted with a swipe behavior. 45 | 46 | For example: 47 | 48 | ``` 49 | //import the swipe view container 50 | import {SwipeView} from 'react-native-swipe-view'; 51 | 52 | //use it in your render function 53 | 54 | 55 | This is a swipe view! 56 | 57 | 58 | Drag it to interact 59 | 60 | 61 | ``` 62 | 63 | ## supported props 64 | 65 | | prop | default | type | description | 66 | | ---- | ---- | ----| ---- | 67 | | changeOpacity | false | Boolean | Should the component change content alphw while dragging | 68 | | removeViewOnSwipedOut |false | Boolean | Should the component be removed from the hierarchy after it is swiped out | 69 | | minPanToComplete | 0.5 | Number | The distance from the view center which needs to be completed in percents for the "swipe out" action to happen. If the threshold is not reached it will bounce back | 70 | | bounceBackAnimDuration | 0.35 | Number | Duration of bounce back animation when the threshold defined in minPanToComplete is not matched | 71 | | bounceBackAnimDamping | 0.65 | Number | Damping param of iOS bounce back animation when the threshold defined in minPanToComplete is not matched | 72 | | onSwipeStart | - | Function | Callback function which is called when the swiping action starts. A `direction` param is provided wiht `left` or `right` value | 73 | | onWillBeSwipedOut | - | Function | Callback function which is called right before a view is swiped out (when it passed the minPanToComplete threshold). A `direction` param is provided wiht `left` or `right` value | 74 | | onSwipedOut | - | Function | Callback function which is called after the "swiped out" animation is done. A `direction` param is provided wiht `left` or `right` value | 75 | | onWillBounceBack | - | Function | Callback function which is called right before a view bounces back (when it fails to pass the minPanToComplete threshold). A `direction` param is provided wiht `left` or `right` value | 76 | | onBouncedBack | - | Function | Callback function which is called after the "bounce back" animation is done. A `direction` param is provided wiht `left` or `right` value | 77 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | android { 4 | compileSdkVersion 23 5 | buildToolsVersion "23.0.1" 6 | 7 | defaultConfig { 8 | minSdkVersion 16 9 | targetSdkVersion 23 10 | versionCode 2 11 | versionName "1.1" 12 | ndk { 13 | abiFilters "armeabi-v7a", "x86" 14 | } 15 | } 16 | lintOptions { 17 | warning 'InvalidPackage' 18 | } 19 | } 20 | 21 | dependencies { 22 | compile 'com.facebook.react:react-native:+' 23 | } -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wix-incubator/react-native-swipe-view/08d8782dfb472c83b6f19541c8e7aae0b6409021/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Dec 28 10:00:20 PST 2015 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip 7 | -------------------------------------------------------------------------------- /android/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # Attempt to set APP_HOME 46 | # Resolve links: $0 may be a link 47 | PRG="$0" 48 | # Need this for relative symlinks. 49 | while [ -h "$PRG" ] ; do 50 | ls=`ls -ld "$PRG"` 51 | link=`expr "$ls" : '.*-> \(.*\)$'` 52 | if expr "$link" : '/.*' > /dev/null; then 53 | PRG="$link" 54 | else 55 | PRG=`dirname "$PRG"`"/$link" 56 | fi 57 | done 58 | SAVED="`pwd`" 59 | cd "`dirname \"$PRG\"`/" >/dev/null 60 | APP_HOME="`pwd -P`" 61 | cd "$SAVED" >/dev/null 62 | 63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 64 | 65 | # Determine the Java command to use to start the JVM. 66 | if [ -n "$JAVA_HOME" ] ; then 67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 68 | # IBM's JDK on AIX uses strange locations for the executables 69 | JAVACMD="$JAVA_HOME/jre/sh/java" 70 | else 71 | JAVACMD="$JAVA_HOME/bin/java" 72 | fi 73 | if [ ! -x "$JAVACMD" ] ; then 74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 75 | 76 | Please set the JAVA_HOME variable in your environment to match the 77 | location of your Java installation." 78 | fi 79 | else 80 | JAVACMD="java" 81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 82 | 83 | Please set the JAVA_HOME variable in your environment to match the 84 | location of your Java installation." 85 | fi 86 | 87 | # Increase the maximum file descriptors if we can. 88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 89 | MAX_FD_LIMIT=`ulimit -H -n` 90 | if [ $? -eq 0 ] ; then 91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 92 | MAX_FD="$MAX_FD_LIMIT" 93 | fi 94 | ulimit -n $MAX_FD 95 | if [ $? -ne 0 ] ; then 96 | warn "Could not set maximum file descriptor limit: $MAX_FD" 97 | fi 98 | else 99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 100 | fi 101 | fi 102 | 103 | # For Darwin, add options to specify how the application appears in the dock 104 | if $darwin; then 105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 106 | fi 107 | 108 | # For Cygwin, switch paths to Windows format before running java 109 | if $cygwin ; then 110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 112 | JAVACMD=`cygpath --unix "$JAVACMD"` 113 | 114 | # We build the pattern for arguments to be converted via cygpath 115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 116 | SEP="" 117 | for dir in $ROOTDIRSRAW ; do 118 | ROOTDIRS="$ROOTDIRS$SEP$dir" 119 | SEP="|" 120 | done 121 | OURCYGPATTERN="(^($ROOTDIRS))" 122 | # Add a user-defined pattern to the cygpath arguments 123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 125 | fi 126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 127 | i=0 128 | for arg in "$@" ; do 129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 131 | 132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 134 | else 135 | eval `echo args$i`="\"$arg\"" 136 | fi 137 | i=$((i+1)) 138 | done 139 | case $i in 140 | (0) set -- ;; 141 | (1) set -- "$args0" ;; 142 | (2) set -- "$args0" "$args1" ;; 143 | (3) set -- "$args0" "$args1" "$args2" ;; 144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 150 | esac 151 | fi 152 | 153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 154 | function splitJvmOpts() { 155 | JVM_OPTS=("$@") 156 | } 157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 159 | 160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 161 | -------------------------------------------------------------------------------- /android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | -------------------------------------------------------------------------------- /android/src/main/java/com/wix/RNSwipeView/SwipeView.java: -------------------------------------------------------------------------------- 1 | package com.wix.RNSwipeView; 2 | 3 | import android.content.Context; 4 | import android.support.v4.view.MotionEventCompat; 5 | import android.view.MotionEvent; 6 | import android.view.ViewConfiguration; 7 | import android.view.ViewGroup; 8 | 9 | import com.facebook.react.uimanager.RootViewUtil; 10 | 11 | public class SwipeView extends ViewGroup { 12 | 13 | public interface SwipeViewListener { 14 | void onSwipeStart(); 15 | void onWillBeSwipedOut(); 16 | void onSwipedOut(); 17 | void onWillBounceBack(); 18 | void onBouncedBack(); 19 | } 20 | 21 | private static final float MIN_DISABLE_SCROLL = new ViewConfiguration().getScaledPagingTouchSlop(); 22 | private static final boolean DEFAULT_ANIMATE_OPACITY = true; 23 | private float initialX = 0; 24 | private boolean swiping = false; 25 | private boolean animateOpacity = DEFAULT_ANIMATE_OPACITY; 26 | private int swipeOutDistance = Integer.MAX_VALUE; 27 | private SwipeViewListener listener; 28 | 29 | public SwipeView(Context context) { 30 | super(context); 31 | } 32 | 33 | public void setListener(SwipeViewListener listener) { 34 | this.listener = listener; 35 | } 36 | 37 | @Override 38 | protected void onSizeChanged(int w, int h, int oldw, int oldh) { 39 | super.onSizeChanged(w, h, oldw, oldh); 40 | swipeOutDistance = w/2; 41 | } 42 | 43 | @Override 44 | protected void onLayout(boolean changed, int l, int t, int r, int b) { 45 | 46 | } 47 | 48 | @Override 49 | public boolean onInterceptTouchEvent(MotionEvent event) { 50 | int action = MotionEventCompat.getActionMasked(event); 51 | switch(action) { 52 | case (MotionEvent.ACTION_DOWN): 53 | initialX = event.getRawX(); 54 | return false; 55 | case (MotionEvent.ACTION_MOVE) : 56 | float deltaX = event.getRawX() - initialX; 57 | boolean nowSwiping = Math.abs(deltaX) > MIN_DISABLE_SCROLL; 58 | if (!swiping && nowSwiping && listener != null) { 59 | listener.onSwipeStart(); 60 | } 61 | 62 | swiping = swiping || nowSwiping; 63 | if(swiping) { 64 | RootViewUtil.getRootView(this).onChildStartedNativeGesture(event); 65 | } 66 | return swiping; 67 | case (MotionEvent.ACTION_UP) : 68 | case (MotionEvent.ACTION_CANCEL) : 69 | case (MotionEvent.ACTION_OUTSIDE) : 70 | default: 71 | return false; 72 | } 73 | } 74 | 75 | @Override 76 | public boolean onTouchEvent(MotionEvent event) { 77 | int action = MotionEventCompat.getActionMasked(event); 78 | 79 | switch(action) { 80 | case (MotionEvent.ACTION_MOVE) : 81 | float deltaX = event.getRawX() - initialX; 82 | handleMove(deltaX); 83 | return true; 84 | case (MotionEvent.ACTION_UP) : 85 | case (MotionEvent.ACTION_CANCEL) : 86 | case (MotionEvent.ACTION_OUTSIDE) : 87 | return handleUp(event); 88 | default : 89 | return super.onTouchEvent(event); 90 | } 91 | } 92 | 93 | private void handleMove(float deltaX) { 94 | setTranslationX(deltaX); 95 | if (animateOpacity) { 96 | float newAlpha = 1 - 0.9f * Math.min(1, Math.abs(deltaX) / swipeOutDistance); 97 | setAlpha(newAlpha); 98 | } 99 | requestDisallowInterceptTouchEvent(swiping); 100 | } 101 | 102 | private boolean handleUp(MotionEvent event) { 103 | float deltaX = event.getRawX() - initialX; 104 | 105 | if(Math.abs(deltaX) >= swipeOutDistance) { 106 | animateOut(deltaX > 0); 107 | } else { 108 | animateBack(swiping); 109 | } 110 | swiping = false; 111 | return super.onTouchEvent(event); 112 | } 113 | 114 | private void animateBack(final boolean wasSwiping) { 115 | if (wasSwiping && listener != null) { 116 | listener.onWillBounceBack(); 117 | } 118 | animate().alpha(1).setListener(null); 119 | animate().translationX(0).setListener(null).withEndAction(new Runnable() { 120 | @Override 121 | public void run() { 122 | if (wasSwiping && listener != null) { 123 | listener.onBouncedBack(); 124 | } 125 | } 126 | }); 127 | } 128 | 129 | private void animateOut(boolean left) { 130 | if (listener != null) { 131 | listener.onWillBeSwipedOut(); 132 | } 133 | animate().alpha(0); 134 | animate().translationX((left ? 1 : -1) * getContext().getResources().getDisplayMetrics().widthPixels) 135 | .setListener(null) 136 | .withEndAction(new Runnable() { 137 | @Override 138 | public void run() { 139 | if (listener != null) { 140 | listener.onSwipedOut(); 141 | } 142 | } 143 | }); 144 | } 145 | 146 | public void setAnimateOpacity(boolean animateOpacity) { 147 | this.animateOpacity = animateOpacity; 148 | } 149 | } -------------------------------------------------------------------------------- /android/src/main/java/com/wix/RNSwipeView/SwipeViewManager.java: -------------------------------------------------------------------------------- 1 | package com.wix.RNSwipeView; 2 | 3 | import com.facebook.react.common.MapBuilder; 4 | import com.facebook.react.uimanager.ThemedReactContext; 5 | import com.facebook.react.uimanager.UIManagerModule; 6 | import com.facebook.react.uimanager.ViewGroupManager; 7 | import com.facebook.react.uimanager.annotations.ReactProp; 8 | import com.facebook.react.uimanager.events.EventDispatcher; 9 | import com.wix.RNSwipeView.events.BouncedBackEvent; 10 | import com.wix.RNSwipeView.events.SwipeStartEvent; 11 | import com.wix.RNSwipeView.events.SwipedOutEvent; 12 | import com.wix.RNSwipeView.events.WillBeSwipedOutEvent; 13 | import com.wix.RNSwipeView.events.WillBounceBackEvent; 14 | 15 | import java.util.Map; 16 | 17 | import javax.annotation.Nullable; 18 | 19 | public class SwipeViewManager extends ViewGroupManager { 20 | @Override 21 | public String getName() { 22 | return "SwipeView"; 23 | } 24 | 25 | @Override 26 | protected SwipeView createViewInstance(ThemedReactContext reactContext) { 27 | return new SwipeView(reactContext); 28 | } 29 | 30 | @Override 31 | public void updateExtraData(SwipeView root, Object extraData) { 32 | 33 | } 34 | 35 | @ReactProp(name = "changeOpacity") 36 | public void setChangeOpactity(SwipeView view, boolean changeOpacity) { 37 | view.setAnimateOpacity(changeOpacity); 38 | } 39 | 40 | @Override 41 | protected void addEventEmitters(ThemedReactContext reactContext, SwipeView view) { 42 | view.setListener(new SwipeEventsEmitter(view, reactContext.getNativeModule(UIManagerModule.class).getEventDispatcher())); 43 | } 44 | 45 | @Nullable 46 | @Override 47 | public Map getExportedCustomDirectEventTypeConstants() { 48 | return MapBuilder.builder() 49 | .put("onSwipeStart", MapBuilder.of("registrationName", "onSwipeStart")) 50 | .put("onWillBeSwipedOut", MapBuilder.of("registrationName", "onWillBeSwipedOut")) 51 | .put("onSwipedOut", MapBuilder.of("registrationName", "onSwipedOut")) 52 | .put("onWillBounceBack", MapBuilder.of("registrationName", "onWillBounceBack")) 53 | .put("onBouncedBack", MapBuilder.of("registrationName", "onBouncedBack")) 54 | .build(); 55 | } 56 | 57 | private static class SwipeEventsEmitter implements SwipeView.SwipeViewListener { 58 | private final SwipeView mSwipeView; 59 | private final EventDispatcher mEventDispatcher; 60 | 61 | public SwipeEventsEmitter(SwipeView view, EventDispatcher eventDispatcher) { 62 | mSwipeView = view; 63 | mEventDispatcher = eventDispatcher; 64 | } 65 | 66 | @Override 67 | public void onSwipeStart() { 68 | mEventDispatcher.dispatchEvent(new SwipeStartEvent(mSwipeView.getId())); 69 | } 70 | 71 | @Override 72 | public void onWillBeSwipedOut() { 73 | mEventDispatcher.dispatchEvent(new WillBeSwipedOutEvent(mSwipeView.getId())); 74 | } 75 | 76 | @Override 77 | public void onSwipedOut() { 78 | mEventDispatcher.dispatchEvent(new SwipedOutEvent(mSwipeView.getId())); 79 | } 80 | 81 | @Override 82 | public void onWillBounceBack() { 83 | mEventDispatcher.dispatchEvent(new WillBounceBackEvent(mSwipeView.getId())); 84 | } 85 | 86 | @Override 87 | public void onBouncedBack() { 88 | mEventDispatcher.dispatchEvent(new BouncedBackEvent(mSwipeView.getId())); 89 | } 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /android/src/main/java/com/wix/RNSwipeView/SwipeViewPackage.java: -------------------------------------------------------------------------------- 1 | package com.wix.RNSwipeView; 2 | 3 | import com.facebook.react.ReactPackage; 4 | import com.facebook.react.bridge.JavaScriptModule; 5 | import com.facebook.react.bridge.NativeModule; 6 | import com.facebook.react.bridge.ReactApplicationContext; 7 | import com.facebook.react.uimanager.ViewManager; 8 | 9 | import java.util.Collections; 10 | import java.util.List; 11 | 12 | /** 13 | * Created by yedidyak on 07/09/2016. 14 | */ 15 | public class SwipeViewPackage implements ReactPackage { 16 | 17 | @Override 18 | public List createNativeModules(ReactApplicationContext reactContext) { 19 | return Collections.emptyList(); 20 | } 21 | 22 | public List> createJSModules() { 23 | return Collections.emptyList(); 24 | } 25 | 26 | @Override 27 | public List createViewManagers(ReactApplicationContext reactContext) { 28 | return Collections.singletonList(new SwipeViewManager()); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /android/src/main/java/com/wix/RNSwipeView/events/BouncedBackEvent.java: -------------------------------------------------------------------------------- 1 | package com.wix.RNSwipeView.events; 2 | 3 | import com.facebook.react.uimanager.events.Event; 4 | import com.facebook.react.uimanager.events.RCTEventEmitter; 5 | 6 | /** 7 | * Created by yedidyak on 07/09/2016. 8 | */ 9 | public class BouncedBackEvent extends Event { 10 | 11 | public BouncedBackEvent(int viewTag) { 12 | super(viewTag); 13 | } 14 | 15 | @Override 16 | public String getEventName() { 17 | return "onBouncedBack"; 18 | } 19 | 20 | @Override 21 | public void dispatch(RCTEventEmitter rctEventEmitter) { 22 | rctEventEmitter.receiveEvent(getViewTag(), getEventName(), null); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /android/src/main/java/com/wix/RNSwipeView/events/SwipeStartEvent.java: -------------------------------------------------------------------------------- 1 | package com.wix.RNSwipeView.events; 2 | 3 | import com.facebook.react.uimanager.events.Event; 4 | import com.facebook.react.uimanager.events.RCTEventEmitter; 5 | 6 | /** 7 | * Created by yedidyak on 07/09/2016. 8 | */ 9 | public class SwipeStartEvent extends Event { 10 | 11 | public SwipeStartEvent(int viewTag) { 12 | super(viewTag); 13 | } 14 | 15 | @Override 16 | public String getEventName() { 17 | return "onSwipeStart"; 18 | } 19 | 20 | @Override 21 | public void dispatch(RCTEventEmitter rctEventEmitter) { 22 | rctEventEmitter.receiveEvent(getViewTag(), getEventName(), null); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /android/src/main/java/com/wix/RNSwipeView/events/SwipedOutEvent.java: -------------------------------------------------------------------------------- 1 | package com.wix.RNSwipeView.events; 2 | 3 | import com.facebook.react.uimanager.events.Event; 4 | import com.facebook.react.uimanager.events.RCTEventEmitter; 5 | 6 | /** 7 | * Created by yedidyak on 07/09/2016. 8 | */ 9 | public class SwipedOutEvent extends Event { 10 | 11 | public SwipedOutEvent(int viewTag) { 12 | super(viewTag); 13 | } 14 | 15 | @Override 16 | public String getEventName() { 17 | return "onSwipedOut"; 18 | } 19 | 20 | @Override 21 | public void dispatch(RCTEventEmitter rctEventEmitter) { 22 | rctEventEmitter.receiveEvent(getViewTag(), getEventName(), null); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /android/src/main/java/com/wix/RNSwipeView/events/WillBeSwipedOutEvent.java: -------------------------------------------------------------------------------- 1 | package com.wix.RNSwipeView.events; 2 | 3 | import com.facebook.react.uimanager.events.Event; 4 | import com.facebook.react.uimanager.events.RCTEventEmitter; 5 | 6 | /** 7 | * Created by yedidyak on 07/09/2016. 8 | */ 9 | public class WillBeSwipedOutEvent extends Event { 10 | 11 | public WillBeSwipedOutEvent(int viewTag) { 12 | super(viewTag); 13 | } 14 | 15 | @Override 16 | public String getEventName() { 17 | return "onWillBeSwipedOut"; 18 | } 19 | 20 | @Override 21 | public void dispatch(RCTEventEmitter rctEventEmitter) { 22 | rctEventEmitter.receiveEvent(getViewTag(), getEventName(), null); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /android/src/main/java/com/wix/RNSwipeView/events/WillBounceBackEvent.java: -------------------------------------------------------------------------------- 1 | package com.wix.RNSwipeView.events; 2 | 3 | import com.facebook.react.uimanager.events.Event; 4 | import com.facebook.react.uimanager.events.RCTEventEmitter; 5 | 6 | /** 7 | * Created by yedidyak on 07/09/2016. 8 | */ 9 | public class WillBounceBackEvent extends Event { 10 | 11 | public WillBounceBackEvent(int viewTag) { 12 | super(viewTag); 13 | } 14 | 15 | @Override 16 | public String getEventName() { 17 | return "onWillBounceBack"; 18 | } 19 | 20 | @Override 21 | public void dispatch(RCTEventEmitter rctEventEmitter) { 22 | rctEventEmitter.receiveEvent(getViewTag(), getEventName(), null); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /example/.buckconfig: -------------------------------------------------------------------------------- 1 | 2 | [android] 3 | target = Google Inc.:Google APIs:23 4 | 5 | [maven_repositories] 6 | central = https://repo1.maven.org/maven2 7 | -------------------------------------------------------------------------------- /example/.flowconfig: -------------------------------------------------------------------------------- 1 | [ignore] 2 | 3 | # We fork some components by platform. 4 | .*/*.android.js 5 | 6 | # Ignore templates with `@flow` in header 7 | .*/local-cli/generator.* 8 | 9 | # Ignore malformed json 10 | .*/node_modules/y18n/test/.*\.json 11 | 12 | # Ignore the website subdir 13 | /website/.* 14 | 15 | # Ignore BUCK generated dirs 16 | /\.buckd/ 17 | 18 | # Ignore unexpected extra @providesModule 19 | .*/node_modules/commoner/test/source/widget/share.js 20 | 21 | # Ignore duplicate module providers 22 | # For RN Apps installed via npm, "Libraries" folder is inside node_modules/react-native but in the source repo it is in the root 23 | .*/Libraries/react-native/React.js 24 | .*/Libraries/react-native/ReactNative.js 25 | .*/node_modules/jest-runtime/build/__tests__/.* 26 | 27 | [include] 28 | 29 | [libs] 30 | node_modules/react-native/Libraries/react-native/react-native-interface.js 31 | node_modules/react-native/flow 32 | flow/ 33 | 34 | [options] 35 | module.system=haste 36 | 37 | esproposal.class_static_fields=enable 38 | esproposal.class_instance_fields=enable 39 | 40 | experimental.strict_type_args=true 41 | 42 | munge_underscores=true 43 | 44 | module.name_mapper='^image![a-zA-Z0-9$_-]+$' -> 'GlobalImageStub' 45 | module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub' 46 | 47 | suppress_type=$FlowIssue 48 | suppress_type=$FlowFixMe 49 | suppress_type=$FixMe 50 | 51 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(2[0-9]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\) 52 | suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(2[0-9]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+ 53 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy 54 | 55 | unsafe.enable_getters_and_setters=true 56 | 57 | [version] 58 | ^0.29.0 59 | -------------------------------------------------------------------------------- /example/.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # Xcode 6 | # 7 | build/ 8 | *.pbxuser 9 | !default.pbxuser 10 | *.mode1v3 11 | !default.mode1v3 12 | *.mode2v3 13 | !default.mode2v3 14 | *.perspectivev3 15 | !default.perspectivev3 16 | xcuserdata 17 | *.xccheckout 18 | *.moved-aside 19 | DerivedData 20 | *.hmap 21 | *.ipa 22 | *.xcuserstate 23 | project.xcworkspace 24 | 25 | # Android/IJ 26 | # 27 | *.iml 28 | .idea 29 | .gradle 30 | local.properties 31 | 32 | # node.js 33 | # 34 | node_modules/ 35 | npm-debug.log 36 | 37 | # BUCK 38 | buck-out/ 39 | \.buckd/ 40 | android/app/libs 41 | android/keystores/debug.keystore 42 | -------------------------------------------------------------------------------- /example/.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /example/android/app/BUCK: -------------------------------------------------------------------------------- 1 | import re 2 | 3 | # To learn about Buck see [Docs](https://buckbuild.com/). 4 | # To run your application with Buck: 5 | # - install Buck 6 | # - `npm start` - to start the packager 7 | # - `cd android` 8 | # - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"` 9 | # - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck 10 | # - `buck install -r android/app` - compile, install and run application 11 | # 12 | 13 | lib_deps = [] 14 | for jarfile in glob(['libs/*.jar']): 15 | name = 'jars__' + re.sub(r'^.*/([^/]+)\.jar$', r'\1', jarfile) 16 | lib_deps.append(':' + name) 17 | prebuilt_jar( 18 | name = name, 19 | binary_jar = jarfile, 20 | ) 21 | 22 | for aarfile in glob(['libs/*.aar']): 23 | name = 'aars__' + re.sub(r'^.*/([^/]+)\.aar$', r'\1', aarfile) 24 | lib_deps.append(':' + name) 25 | android_prebuilt_aar( 26 | name = name, 27 | aar = aarfile, 28 | ) 29 | 30 | android_library( 31 | name = 'all-libs', 32 | exported_deps = lib_deps 33 | ) 34 | 35 | android_library( 36 | name = 'app-code', 37 | srcs = glob([ 38 | 'src/main/java/**/*.java', 39 | ]), 40 | deps = [ 41 | ':all-libs', 42 | ':build_config', 43 | ':res', 44 | ], 45 | ) 46 | 47 | android_build_config( 48 | name = 'build_config', 49 | package = 'com.example', 50 | ) 51 | 52 | android_resource( 53 | name = 'res', 54 | res = 'src/main/res', 55 | package = 'com.example', 56 | ) 57 | 58 | android_binary( 59 | name = 'app', 60 | package_type = 'debug', 61 | manifest = 'src/main/AndroidManifest.xml', 62 | keystore = '//android/keystores:debug', 63 | deps = [ 64 | ':app-code', 65 | ], 66 | ) 67 | -------------------------------------------------------------------------------- /example/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "com.android.application" 2 | 3 | import com.android.build.OutputFile 4 | 5 | 6 | apply from: "../../node_modules/react-native/react.gradle" 7 | 8 | /** 9 | * Set this to true to create two separate APKs instead of one: 10 | * - An APK that only works on ARM devices 11 | * - An APK that only works on x86 devices 12 | * The advantage is the size of the APK is reduced by about 4MB. 13 | * Upload all the APKs to the Play Store and people will download 14 | * the correct one based on the CPU architecture of their device. 15 | */ 16 | def enableSeparateBuildPerCPUArchitecture = false 17 | 18 | /** 19 | * Run Proguard to shrink the Java bytecode in release builds. 20 | */ 21 | def enableProguardInReleaseBuilds = false 22 | 23 | android { 24 | compileSdkVersion 23 25 | buildToolsVersion "23.0.1" 26 | 27 | defaultConfig { 28 | applicationId "com.example" 29 | minSdkVersion 16 30 | targetSdkVersion 23 31 | versionCode 1 32 | versionName "1.0" 33 | ndk { 34 | abiFilters "armeabi-v7a", "x86" 35 | } 36 | } 37 | splits { 38 | abi { 39 | reset() 40 | enable enableSeparateBuildPerCPUArchitecture 41 | universalApk false // If true, also generate a universal APK 42 | include "armeabi-v7a", "x86" 43 | } 44 | } 45 | buildTypes { 46 | release { 47 | minifyEnabled enableProguardInReleaseBuilds 48 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" 49 | } 50 | } 51 | // applicationVariants are e.g. debug, release 52 | applicationVariants.all { variant -> 53 | variant.outputs.each { output -> 54 | // For each separate APK per architecture, set a unique version code as described here: 55 | // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits 56 | def versionCodes = ["armeabi-v7a":1, "x86":2] 57 | def abi = output.getFilter(OutputFile.ABI) 58 | if (abi != null) { // null for the universal-debug, universal-release variants 59 | output.versionCodeOverride = 60 | versionCodes.get(abi) * 1048576 + defaultConfig.versionCode 61 | } 62 | } 63 | } 64 | } 65 | 66 | dependencies { 67 | compile fileTree(dir: "libs", include: ["*.jar"]) 68 | compile "com.android.support:appcompat-v7:23.0.1" 69 | compile "com.facebook.react:react-native:+" // From node_modules 70 | compile project(':RNSwipeView') 71 | } 72 | 73 | // Run this once to be able to run the application with BUCK 74 | // puts all compile dependencies into folder libs for BUCK to use 75 | task copyDownloadableDepsToLibs(type: Copy) { 76 | from configurations.compile 77 | into 'libs' 78 | } 79 | -------------------------------------------------------------------------------- /example/android/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | 19 | # Disabling obfuscation is useful if you collect stack traces from production crashes 20 | # (unless you are using a system that supports de-obfuscate the stack traces). 21 | -dontobfuscate 22 | 23 | # React Native 24 | 25 | # Keep our interfaces so they can be used by other ProGuard rules. 26 | # See http://sourceforge.net/p/proguard/bugs/466/ 27 | -keep,allowobfuscation @interface com.facebook.proguard.annotations.DoNotStrip 28 | -keep,allowobfuscation @interface com.facebook.proguard.annotations.KeepGettersAndSetters 29 | -keep,allowobfuscation @interface com.facebook.common.internal.DoNotStrip 30 | 31 | # Do not strip any method/class that is annotated with @DoNotStrip 32 | -keep @com.facebook.proguard.annotations.DoNotStrip class * 33 | -keep @com.facebook.common.internal.DoNotStrip class * 34 | -keepclassmembers class * { 35 | @com.facebook.proguard.annotations.DoNotStrip *; 36 | @com.facebook.common.internal.DoNotStrip *; 37 | } 38 | 39 | -keepclassmembers @com.facebook.proguard.annotations.KeepGettersAndSetters class * { 40 | void set*(***); 41 | *** get*(); 42 | } 43 | 44 | -keep class * extends com.facebook.react.bridge.JavaScriptModule { *; } 45 | -keep class * extends com.facebook.react.bridge.NativeModule { *; } 46 | -keepclassmembers,includedescriptorclasses class * { native ; } 47 | -keepclassmembers class * { @com.facebook.react.uimanager.UIProp ; } 48 | -keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactProp ; } 49 | -keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactPropGroup ; } 50 | 51 | -dontwarn com.facebook.react.** 52 | 53 | # okhttp 54 | 55 | -keepattributes Signature 56 | -keepattributes *Annotation* 57 | -keep class okhttp3.** { *; } 58 | -keep interface okhttp3.** { *; } 59 | -dontwarn okhttp3.** 60 | 61 | # okio 62 | 63 | -keep class sun.misc.Unsafe { *; } 64 | -dontwarn java.nio.file.* 65 | -dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement 66 | -dontwarn okio.** 67 | -------------------------------------------------------------------------------- /example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 12 | 13 | 19 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/com/example/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.example; 2 | 3 | import com.facebook.react.ReactActivity; 4 | 5 | public class MainActivity extends ReactActivity { 6 | 7 | /** 8 | * Returns the name of the main component registered from JavaScript. 9 | * This is used to schedule rendering of the component. 10 | */ 11 | @Override 12 | protected String getMainComponentName() { 13 | return "example"; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/com/example/MainApplication.java: -------------------------------------------------------------------------------- 1 | package com.example; 2 | 3 | import android.app.Application; 4 | 5 | import com.facebook.react.ReactApplication; 6 | import com.facebook.react.ReactNativeHost; 7 | import com.facebook.react.ReactPackage; 8 | import com.facebook.react.shell.MainReactPackage; 9 | 10 | import com.wix.RNSwipeView.SwipeViewPackage; 11 | 12 | import java.util.Arrays; 13 | import java.util.List; 14 | 15 | public class MainApplication extends Application implements ReactApplication { 16 | 17 | private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) { 18 | @Override 19 | protected boolean getUseDeveloperSupport() { 20 | return BuildConfig.DEBUG; 21 | } 22 | 23 | @Override 24 | protected List getPackages() { 25 | return Arrays.asList( 26 | new MainReactPackage(), 27 | new SwipeViewPackage() 28 | ); 29 | } 30 | }; 31 | 32 | @Override 33 | public ReactNativeHost getReactNativeHost() { 34 | return mReactNativeHost; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wix-incubator/react-native-swipe-view/08d8782dfb472c83b6f19541c8e7aae0b6409021/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wix-incubator/react-native-swipe-view/08d8782dfb472c83b6f19541c8e7aae0b6409021/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wix-incubator/react-native-swipe-view/08d8782dfb472c83b6f19541c8e7aae0b6409021/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wix-incubator/react-native-swipe-view/08d8782dfb472c83b6f19541c8e7aae0b6409021/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | example 3 | 4 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/android/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | repositories { 5 | jcenter() 6 | } 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:2.1.3' 9 | 10 | // NOTE: Do not place your application dependencies here; they belong 11 | // in the individual module build.gradle files 12 | } 13 | } 14 | 15 | allprojects { 16 | repositories { 17 | mavenLocal() 18 | jcenter() 19 | maven { 20 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm 21 | url "$rootDir/../node_modules/react-native/android" 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true 19 | 20 | android.useDeprecatedNdk=true 21 | -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wix-incubator/react-native-swipe-view/08d8782dfb472c83b6f19541c8e7aae0b6409021/example/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Wed Sep 07 10:18:26 IDT 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip 7 | -------------------------------------------------------------------------------- /example/android/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # For Cygwin, ensure paths are in UNIX format before anything is touched. 46 | if $cygwin ; then 47 | [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` 48 | fi 49 | 50 | # Attempt to set APP_HOME 51 | # Resolve links: $0 may be a link 52 | PRG="$0" 53 | # Need this for relative symlinks. 54 | while [ -h "$PRG" ] ; do 55 | ls=`ls -ld "$PRG"` 56 | link=`expr "$ls" : '.*-> \(.*\)$'` 57 | if expr "$link" : '/.*' > /dev/null; then 58 | PRG="$link" 59 | else 60 | PRG=`dirname "$PRG"`"/$link" 61 | fi 62 | done 63 | SAVED="`pwd`" 64 | cd "`dirname \"$PRG\"`/" >&- 65 | APP_HOME="`pwd -P`" 66 | cd "$SAVED" >&- 67 | 68 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 69 | 70 | # Determine the Java command to use to start the JVM. 71 | if [ -n "$JAVA_HOME" ] ; then 72 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 73 | # IBM's JDK on AIX uses strange locations for the executables 74 | JAVACMD="$JAVA_HOME/jre/sh/java" 75 | else 76 | JAVACMD="$JAVA_HOME/bin/java" 77 | fi 78 | if [ ! -x "$JAVACMD" ] ; then 79 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 80 | 81 | Please set the JAVA_HOME variable in your environment to match the 82 | location of your Java installation." 83 | fi 84 | else 85 | JAVACMD="java" 86 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 87 | 88 | Please set the JAVA_HOME variable in your environment to match the 89 | location of your Java installation." 90 | fi 91 | 92 | # Increase the maximum file descriptors if we can. 93 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 94 | MAX_FD_LIMIT=`ulimit -H -n` 95 | if [ $? -eq 0 ] ; then 96 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 97 | MAX_FD="$MAX_FD_LIMIT" 98 | fi 99 | ulimit -n $MAX_FD 100 | if [ $? -ne 0 ] ; then 101 | warn "Could not set maximum file descriptor limit: $MAX_FD" 102 | fi 103 | else 104 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 105 | fi 106 | fi 107 | 108 | # For Darwin, add options to specify how the application appears in the dock 109 | if $darwin; then 110 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 111 | fi 112 | 113 | # For Cygwin, switch paths to Windows format before running java 114 | if $cygwin ; then 115 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 116 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 158 | function splitJvmOpts() { 159 | JVM_OPTS=("$@") 160 | } 161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 163 | 164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 165 | -------------------------------------------------------------------------------- /example/android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /example/android/keystores/BUCK: -------------------------------------------------------------------------------- 1 | keystore( 2 | name = 'debug', 3 | store = 'debug.keystore', 4 | properties = 'debug.keystore.properties', 5 | visibility = [ 6 | 'PUBLIC', 7 | ], 8 | ) 9 | -------------------------------------------------------------------------------- /example/android/keystores/debug.keystore.properties: -------------------------------------------------------------------------------- 1 | key.store=debug.keystore 2 | key.alias=androiddebugkey 3 | key.store.password=android 4 | key.alias.password=android 5 | -------------------------------------------------------------------------------- /example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'example' 2 | 3 | include ':app' 4 | 5 | include ':RNSwipeView' 6 | project(':RNSwipeView').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-swipe-view/android') -------------------------------------------------------------------------------- /example/index.android.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Sample React Native App 3 | * https://github.com/facebook/react-native 4 | * @flow 5 | */ 6 | 7 | import React, { Component } from 'react'; 8 | import { 9 | ScrollView, 10 | AppRegistry, 11 | StyleSheet, 12 | Text, 13 | View, TouchableOpacity 14 | } from 'react-native'; 15 | 16 | import {SwipeView} from 'react-native-swipe-view'; 17 | 18 | class example extends Component { 19 | render() { 20 | return ( 21 | 22 | {this.renderSwipeView()} 23 | {this.renderSwipeView()} 24 | {this.renderSwipeView()} 25 | {this.renderSwipeView()} 26 | {this.renderSwipeView()} 27 | {this.renderSwipeView()} 28 | {this.renderSwipeView()} 29 | {this.renderSwipeView()} 30 | {this.renderSwipeView()} 31 | {this.renderSwipeView()} 32 | {this.renderSwipeView()} 33 | {this.renderSwipeView()} 34 | {this.renderSwipeView()} 35 | {this.renderSwipeView()} 36 | {this.renderSwipeView()} 37 | 38 | ); 39 | } 40 | 41 | renderSwipeView() { 42 | return ( 43 | console.warn('Started swipe!')} 45 | onWillBeSwipedOut={(event) => console.warn('onWillBeSwipedOut!')} 46 | onSwipedOut={(event) => console.warn('onSwipedOut!')} 47 | onWillBounceBack={(event) => console.warn('onWillBounceBack!')} 48 | onBouncedBack={(event) => console.warn('onBouncedBack!')} 49 | > 50 | console.error('BAM')}> 51 | 52 | 53 | Welcome to React Native! 54 | 55 | 56 | To get started, edit index.ios.js 57 | 58 | 59 | Press Cmd+R to reload,{'\n'} 60 | Cmd+D or shake for dev menu 61 | 62 | 63 | 64 | 65 | ) 66 | } 67 | } 68 | 69 | const styles = StyleSheet.create({ 70 | container: { 71 | justifyContent: 'center', 72 | alignItems: 'center', 73 | backgroundColor: '#F5FCFF' 74 | }, 75 | welcome: { 76 | fontSize: 20, 77 | textAlign: 'center', 78 | margin: 10 79 | }, 80 | instructions: { 81 | textAlign: 'center', 82 | color: '#333333', 83 | marginBottom: 5 84 | } 85 | }); 86 | 87 | AppRegistry.registerComponent('example', () => example); 88 | -------------------------------------------------------------------------------- /example/index.ios.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Sample React Native App 3 | * https://github.com/facebook/react-native 4 | * @flow 5 | */ 6 | 7 | import React, { Component } from 'react'; 8 | import { 9 | ScrollView, 10 | AppRegistry, 11 | StyleSheet, 12 | Text, 13 | View 14 | } from 'react-native'; 15 | 16 | import {SwipeView} from 'react-native-swipe-view'; 17 | 18 | class example extends Component { 19 | render() { 20 | return ( 21 | 22 | 23 | 24 | Welcome to React Native! 25 | 26 | 27 | To get started, edit index.ios.js 28 | 29 | 30 | Press Cmd+R to reload,{'\n'} 31 | Cmd+D or shake for dev menu 32 | 33 | 34 | 35 | 36 | Welcome to React Native! 37 | 38 | 39 | To get started, edit index.ios.js 40 | 41 | 42 | Press Cmd+R to reload,{'\n'} 43 | Cmd+D or shake for dev menu 44 | 45 | 46 | 47 | 48 | Welcome to React Native! 49 | 50 | 51 | To get started, edit index.ios.js 52 | 53 | 54 | Press Cmd+R to reload,{'\n'} 55 | Cmd+D or shake for dev menu 56 | 57 | 58 | 59 | ); 60 | } 61 | } 62 | 63 | const styles = StyleSheet.create({ 64 | container: { 65 | flex: 1, 66 | justifyContent: 'center', 67 | alignItems: 'center', 68 | backgroundColor: '#F5FCFF' 69 | }, 70 | welcome: { 71 | fontSize: 20, 72 | textAlign: 'center', 73 | margin: 10 74 | }, 75 | instructions: { 76 | textAlign: 'center', 77 | color: '#333333', 78 | marginBottom: 5 79 | } 80 | }); 81 | 82 | AppRegistry.registerComponent('example', () => example); 83 | -------------------------------------------------------------------------------- /example/ios/example.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */; }; 11 | 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */; }; 12 | 00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */; }; 13 | 00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */; }; 14 | 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */; }; 15 | 00E356F31AD99517003FC87E /* exampleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* exampleTests.m */; }; 16 | 133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 78C398B91ACF4ADC00677621 /* libRCTLinking.a */; }; 17 | 139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */; }; 18 | 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */; }; 19 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; }; 20 | 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; }; 21 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 22 | 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; 23 | 140ED2AC1D01E1AD002B40FF /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; }; 24 | 146834051AC3E58100842450 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; }; 25 | 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; }; 26 | C0F19F161D7FF31B00DBB684 /* libSwipeView.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C0F19F151D7FF31200DBB684 /* libSwipeView.a */; }; 27 | /* End PBXBuildFile section */ 28 | 29 | /* Begin PBXContainerItemProxy section */ 30 | 00C302AB1ABCB8CE00DB3ED1 /* PBXContainerItemProxy */ = { 31 | isa = PBXContainerItemProxy; 32 | containerPortal = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */; 33 | proxyType = 2; 34 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 35 | remoteInfo = RCTActionSheet; 36 | }; 37 | 00C302B91ABCB90400DB3ED1 /* PBXContainerItemProxy */ = { 38 | isa = PBXContainerItemProxy; 39 | containerPortal = 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */; 40 | proxyType = 2; 41 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 42 | remoteInfo = RCTGeolocation; 43 | }; 44 | 00C302BF1ABCB91800DB3ED1 /* PBXContainerItemProxy */ = { 45 | isa = PBXContainerItemProxy; 46 | containerPortal = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */; 47 | proxyType = 2; 48 | remoteGlobalIDString = 58B5115D1A9E6B3D00147676; 49 | remoteInfo = RCTImage; 50 | }; 51 | 00C302DB1ABCB9D200DB3ED1 /* PBXContainerItemProxy */ = { 52 | isa = PBXContainerItemProxy; 53 | containerPortal = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */; 54 | proxyType = 2; 55 | remoteGlobalIDString = 58B511DB1A9E6C8500147676; 56 | remoteInfo = RCTNetwork; 57 | }; 58 | 00C302E31ABCB9EE00DB3ED1 /* PBXContainerItemProxy */ = { 59 | isa = PBXContainerItemProxy; 60 | containerPortal = 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */; 61 | proxyType = 2; 62 | remoteGlobalIDString = 832C81801AAF6DEF007FA2F7; 63 | remoteInfo = RCTVibration; 64 | }; 65 | 00E356F41AD99517003FC87E /* PBXContainerItemProxy */ = { 66 | isa = PBXContainerItemProxy; 67 | containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */; 68 | proxyType = 1; 69 | remoteGlobalIDString = 13B07F861A680F5B00A75B9A; 70 | remoteInfo = example; 71 | }; 72 | 139105C01AF99BAD00B5F7CC /* PBXContainerItemProxy */ = { 73 | isa = PBXContainerItemProxy; 74 | containerPortal = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */; 75 | proxyType = 2; 76 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 77 | remoteInfo = RCTSettings; 78 | }; 79 | 139FDEF31B06529B00C62182 /* PBXContainerItemProxy */ = { 80 | isa = PBXContainerItemProxy; 81 | containerPortal = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */; 82 | proxyType = 2; 83 | remoteGlobalIDString = 3C86DF461ADF2C930047B81A; 84 | remoteInfo = RCTWebSocket; 85 | }; 86 | 146834031AC3E56700842450 /* PBXContainerItemProxy */ = { 87 | isa = PBXContainerItemProxy; 88 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 89 | proxyType = 2; 90 | remoteGlobalIDString = 83CBBA2E1A601D0E00E9B192; 91 | remoteInfo = React; 92 | }; 93 | 78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */ = { 94 | isa = PBXContainerItemProxy; 95 | containerPortal = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */; 96 | proxyType = 2; 97 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 98 | remoteInfo = RCTLinking; 99 | }; 100 | 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */ = { 101 | isa = PBXContainerItemProxy; 102 | containerPortal = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */; 103 | proxyType = 2; 104 | remoteGlobalIDString = 58B5119B1A9E6C1200147676; 105 | remoteInfo = RCTText; 106 | }; 107 | C0F19F141D7FF31200DBB684 /* PBXContainerItemProxy */ = { 108 | isa = PBXContainerItemProxy; 109 | containerPortal = C0F19F061D7FF31200DBB684 /* SwipeView.xcodeproj */; 110 | proxyType = 2; 111 | remoteGlobalIDString = D803C61F1CE8769E006B214F; 112 | remoteInfo = SwipeView; 113 | }; 114 | /* End PBXContainerItemProxy section */ 115 | 116 | /* Begin PBXFileReference section */ 117 | 008F07F21AC5B25A0029DE68 /* main.jsbundle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = main.jsbundle; sourceTree = ""; }; 118 | 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTActionSheet.xcodeproj; path = "../node_modules/react-native/Libraries/ActionSheetIOS/RCTActionSheet.xcodeproj"; sourceTree = ""; }; 119 | 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTGeolocation.xcodeproj; path = "../node_modules/react-native/Libraries/Geolocation/RCTGeolocation.xcodeproj"; sourceTree = ""; }; 120 | 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTImage.xcodeproj; path = "../node_modules/react-native/Libraries/Image/RCTImage.xcodeproj"; sourceTree = ""; }; 121 | 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTNetwork.xcodeproj; path = "../node_modules/react-native/Libraries/Network/RCTNetwork.xcodeproj"; sourceTree = ""; }; 122 | 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTVibration.xcodeproj; path = "../node_modules/react-native/Libraries/Vibration/RCTVibration.xcodeproj"; sourceTree = ""; }; 123 | 00E356EE1AD99517003FC87E /* exampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = exampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 124 | 00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 125 | 00E356F21AD99517003FC87E /* exampleTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = exampleTests.m; sourceTree = ""; }; 126 | 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTSettings.xcodeproj; path = "../node_modules/react-native/Libraries/Settings/RCTSettings.xcodeproj"; sourceTree = ""; }; 127 | 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTWebSocket.xcodeproj; path = "../node_modules/react-native/Libraries/WebSocket/RCTWebSocket.xcodeproj"; sourceTree = ""; }; 128 | 13B07F961A680F5B00A75B9A /* example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = example.app; sourceTree = BUILT_PRODUCTS_DIR; }; 129 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = example/AppDelegate.h; sourceTree = ""; }; 130 | 13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = example/AppDelegate.m; sourceTree = ""; }; 131 | 13B07FB21A68108700A75B9A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 132 | 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = example/Images.xcassets; sourceTree = ""; }; 133 | 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = example/Info.plist; sourceTree = ""; }; 134 | 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = example/main.m; sourceTree = ""; }; 135 | 146833FF1AC3E56700842450 /* React.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = React.xcodeproj; path = "../node_modules/react-native/React/React.xcodeproj"; sourceTree = ""; }; 136 | 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = "../node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj"; sourceTree = ""; }; 137 | 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "../node_modules/react-native/Libraries/Text/RCTText.xcodeproj"; sourceTree = ""; }; 138 | C0F19F061D7FF31200DBB684 /* SwipeView.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = SwipeView.xcodeproj; path = "../node_modules/react-native-swipe-view/ios/lib/SwipeView.xcodeproj"; sourceTree = ""; }; 139 | /* End PBXFileReference section */ 140 | 141 | /* Begin PBXFrameworksBuildPhase section */ 142 | 00E356EB1AD99517003FC87E /* Frameworks */ = { 143 | isa = PBXFrameworksBuildPhase; 144 | buildActionMask = 2147483647; 145 | files = ( 146 | 140ED2AC1D01E1AD002B40FF /* libReact.a in Frameworks */, 147 | ); 148 | runOnlyForDeploymentPostprocessing = 0; 149 | }; 150 | 13B07F8C1A680F5B00A75B9A /* Frameworks */ = { 151 | isa = PBXFrameworksBuildPhase; 152 | buildActionMask = 2147483647; 153 | files = ( 154 | C0F19F161D7FF31B00DBB684 /* libSwipeView.a in Frameworks */, 155 | 146834051AC3E58100842450 /* libReact.a in Frameworks */, 156 | 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */, 157 | 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */, 158 | 00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */, 159 | 133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */, 160 | 00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */, 161 | 139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */, 162 | 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */, 163 | 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */, 164 | 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */, 165 | ); 166 | runOnlyForDeploymentPostprocessing = 0; 167 | }; 168 | /* End PBXFrameworksBuildPhase section */ 169 | 170 | /* Begin PBXGroup section */ 171 | 00C302A81ABCB8CE00DB3ED1 /* Products */ = { 172 | isa = PBXGroup; 173 | children = ( 174 | 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */, 175 | ); 176 | name = Products; 177 | sourceTree = ""; 178 | }; 179 | 00C302B61ABCB90400DB3ED1 /* Products */ = { 180 | isa = PBXGroup; 181 | children = ( 182 | 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */, 183 | ); 184 | name = Products; 185 | sourceTree = ""; 186 | }; 187 | 00C302BC1ABCB91800DB3ED1 /* Products */ = { 188 | isa = PBXGroup; 189 | children = ( 190 | 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */, 191 | ); 192 | name = Products; 193 | sourceTree = ""; 194 | }; 195 | 00C302D41ABCB9D200DB3ED1 /* Products */ = { 196 | isa = PBXGroup; 197 | children = ( 198 | 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */, 199 | ); 200 | name = Products; 201 | sourceTree = ""; 202 | }; 203 | 00C302E01ABCB9EE00DB3ED1 /* Products */ = { 204 | isa = PBXGroup; 205 | children = ( 206 | 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */, 207 | ); 208 | name = Products; 209 | sourceTree = ""; 210 | }; 211 | 00E356EF1AD99517003FC87E /* exampleTests */ = { 212 | isa = PBXGroup; 213 | children = ( 214 | 00E356F21AD99517003FC87E /* exampleTests.m */, 215 | 00E356F01AD99517003FC87E /* Supporting Files */, 216 | ); 217 | path = exampleTests; 218 | sourceTree = ""; 219 | }; 220 | 00E356F01AD99517003FC87E /* Supporting Files */ = { 221 | isa = PBXGroup; 222 | children = ( 223 | 00E356F11AD99517003FC87E /* Info.plist */, 224 | ); 225 | name = "Supporting Files"; 226 | sourceTree = ""; 227 | }; 228 | 139105B71AF99BAD00B5F7CC /* Products */ = { 229 | isa = PBXGroup; 230 | children = ( 231 | 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */, 232 | ); 233 | name = Products; 234 | sourceTree = ""; 235 | }; 236 | 139FDEE71B06529A00C62182 /* Products */ = { 237 | isa = PBXGroup; 238 | children = ( 239 | 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */, 240 | ); 241 | name = Products; 242 | sourceTree = ""; 243 | }; 244 | 13B07FAE1A68108700A75B9A /* example */ = { 245 | isa = PBXGroup; 246 | children = ( 247 | 008F07F21AC5B25A0029DE68 /* main.jsbundle */, 248 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */, 249 | 13B07FB01A68108700A75B9A /* AppDelegate.m */, 250 | 13B07FB51A68108700A75B9A /* Images.xcassets */, 251 | 13B07FB61A68108700A75B9A /* Info.plist */, 252 | 13B07FB11A68108700A75B9A /* LaunchScreen.xib */, 253 | 13B07FB71A68108700A75B9A /* main.m */, 254 | ); 255 | name = example; 256 | sourceTree = ""; 257 | }; 258 | 146834001AC3E56700842450 /* Products */ = { 259 | isa = PBXGroup; 260 | children = ( 261 | 146834041AC3E56700842450 /* libReact.a */, 262 | ); 263 | name = Products; 264 | sourceTree = ""; 265 | }; 266 | 78C398B11ACF4ADC00677621 /* Products */ = { 267 | isa = PBXGroup; 268 | children = ( 269 | 78C398B91ACF4ADC00677621 /* libRCTLinking.a */, 270 | ); 271 | name = Products; 272 | sourceTree = ""; 273 | }; 274 | 832341AE1AAA6A7D00B99B32 /* Libraries */ = { 275 | isa = PBXGroup; 276 | children = ( 277 | C0F19F061D7FF31200DBB684 /* SwipeView.xcodeproj */, 278 | 146833FF1AC3E56700842450 /* React.xcodeproj */, 279 | 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */, 280 | 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */, 281 | 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */, 282 | 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */, 283 | 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */, 284 | 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */, 285 | 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */, 286 | 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */, 287 | 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */, 288 | ); 289 | name = Libraries; 290 | sourceTree = ""; 291 | }; 292 | 832341B11AAA6A8300B99B32 /* Products */ = { 293 | isa = PBXGroup; 294 | children = ( 295 | 832341B51AAA6A8300B99B32 /* libRCTText.a */, 296 | ); 297 | name = Products; 298 | sourceTree = ""; 299 | }; 300 | 83CBB9F61A601CBA00E9B192 = { 301 | isa = PBXGroup; 302 | children = ( 303 | 13B07FAE1A68108700A75B9A /* example */, 304 | 832341AE1AAA6A7D00B99B32 /* Libraries */, 305 | 00E356EF1AD99517003FC87E /* exampleTests */, 306 | 83CBBA001A601CBA00E9B192 /* Products */, 307 | ); 308 | indentWidth = 2; 309 | sourceTree = ""; 310 | tabWidth = 2; 311 | }; 312 | 83CBBA001A601CBA00E9B192 /* Products */ = { 313 | isa = PBXGroup; 314 | children = ( 315 | 13B07F961A680F5B00A75B9A /* example.app */, 316 | 00E356EE1AD99517003FC87E /* exampleTests.xctest */, 317 | ); 318 | name = Products; 319 | sourceTree = ""; 320 | }; 321 | C0F19F071D7FF31200DBB684 /* Products */ = { 322 | isa = PBXGroup; 323 | children = ( 324 | C0F19F151D7FF31200DBB684 /* libSwipeView.a */, 325 | ); 326 | name = Products; 327 | sourceTree = ""; 328 | }; 329 | /* End PBXGroup section */ 330 | 331 | /* Begin PBXNativeTarget section */ 332 | 00E356ED1AD99517003FC87E /* exampleTests */ = { 333 | isa = PBXNativeTarget; 334 | buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "exampleTests" */; 335 | buildPhases = ( 336 | 00E356EA1AD99517003FC87E /* Sources */, 337 | 00E356EB1AD99517003FC87E /* Frameworks */, 338 | 00E356EC1AD99517003FC87E /* Resources */, 339 | ); 340 | buildRules = ( 341 | ); 342 | dependencies = ( 343 | 00E356F51AD99517003FC87E /* PBXTargetDependency */, 344 | ); 345 | name = exampleTests; 346 | productName = exampleTests; 347 | productReference = 00E356EE1AD99517003FC87E /* exampleTests.xctest */; 348 | productType = "com.apple.product-type.bundle.unit-test"; 349 | }; 350 | 13B07F861A680F5B00A75B9A /* example */ = { 351 | isa = PBXNativeTarget; 352 | buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "example" */; 353 | buildPhases = ( 354 | 13B07F871A680F5B00A75B9A /* Sources */, 355 | 13B07F8C1A680F5B00A75B9A /* Frameworks */, 356 | 13B07F8E1A680F5B00A75B9A /* Resources */, 357 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */, 358 | ); 359 | buildRules = ( 360 | ); 361 | dependencies = ( 362 | ); 363 | name = example; 364 | productName = "Hello World"; 365 | productReference = 13B07F961A680F5B00A75B9A /* example.app */; 366 | productType = "com.apple.product-type.application"; 367 | }; 368 | /* End PBXNativeTarget section */ 369 | 370 | /* Begin PBXProject section */ 371 | 83CBB9F71A601CBA00E9B192 /* Project object */ = { 372 | isa = PBXProject; 373 | attributes = { 374 | LastUpgradeCheck = 0610; 375 | ORGANIZATIONNAME = Facebook; 376 | TargetAttributes = { 377 | 00E356ED1AD99517003FC87E = { 378 | CreatedOnToolsVersion = 6.2; 379 | TestTargetID = 13B07F861A680F5B00A75B9A; 380 | }; 381 | }; 382 | }; 383 | buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "example" */; 384 | compatibilityVersion = "Xcode 3.2"; 385 | developmentRegion = English; 386 | hasScannedForEncodings = 0; 387 | knownRegions = ( 388 | en, 389 | Base, 390 | ); 391 | mainGroup = 83CBB9F61A601CBA00E9B192; 392 | productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */; 393 | projectDirPath = ""; 394 | projectReferences = ( 395 | { 396 | ProductGroup = 00C302A81ABCB8CE00DB3ED1 /* Products */; 397 | ProjectRef = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */; 398 | }, 399 | { 400 | ProductGroup = 00C302B61ABCB90400DB3ED1 /* Products */; 401 | ProjectRef = 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */; 402 | }, 403 | { 404 | ProductGroup = 00C302BC1ABCB91800DB3ED1 /* Products */; 405 | ProjectRef = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */; 406 | }, 407 | { 408 | ProductGroup = 78C398B11ACF4ADC00677621 /* Products */; 409 | ProjectRef = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */; 410 | }, 411 | { 412 | ProductGroup = 00C302D41ABCB9D200DB3ED1 /* Products */; 413 | ProjectRef = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */; 414 | }, 415 | { 416 | ProductGroup = 139105B71AF99BAD00B5F7CC /* Products */; 417 | ProjectRef = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */; 418 | }, 419 | { 420 | ProductGroup = 832341B11AAA6A8300B99B32 /* Products */; 421 | ProjectRef = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */; 422 | }, 423 | { 424 | ProductGroup = 00C302E01ABCB9EE00DB3ED1 /* Products */; 425 | ProjectRef = 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */; 426 | }, 427 | { 428 | ProductGroup = 139FDEE71B06529A00C62182 /* Products */; 429 | ProjectRef = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */; 430 | }, 431 | { 432 | ProductGroup = 146834001AC3E56700842450 /* Products */; 433 | ProjectRef = 146833FF1AC3E56700842450 /* React.xcodeproj */; 434 | }, 435 | { 436 | ProductGroup = C0F19F071D7FF31200DBB684 /* Products */; 437 | ProjectRef = C0F19F061D7FF31200DBB684 /* SwipeView.xcodeproj */; 438 | }, 439 | ); 440 | projectRoot = ""; 441 | targets = ( 442 | 13B07F861A680F5B00A75B9A /* example */, 443 | 00E356ED1AD99517003FC87E /* exampleTests */, 444 | ); 445 | }; 446 | /* End PBXProject section */ 447 | 448 | /* Begin PBXReferenceProxy section */ 449 | 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */ = { 450 | isa = PBXReferenceProxy; 451 | fileType = archive.ar; 452 | path = libRCTActionSheet.a; 453 | remoteRef = 00C302AB1ABCB8CE00DB3ED1 /* PBXContainerItemProxy */; 454 | sourceTree = BUILT_PRODUCTS_DIR; 455 | }; 456 | 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */ = { 457 | isa = PBXReferenceProxy; 458 | fileType = archive.ar; 459 | path = libRCTGeolocation.a; 460 | remoteRef = 00C302B91ABCB90400DB3ED1 /* PBXContainerItemProxy */; 461 | sourceTree = BUILT_PRODUCTS_DIR; 462 | }; 463 | 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */ = { 464 | isa = PBXReferenceProxy; 465 | fileType = archive.ar; 466 | path = libRCTImage.a; 467 | remoteRef = 00C302BF1ABCB91800DB3ED1 /* PBXContainerItemProxy */; 468 | sourceTree = BUILT_PRODUCTS_DIR; 469 | }; 470 | 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */ = { 471 | isa = PBXReferenceProxy; 472 | fileType = archive.ar; 473 | path = libRCTNetwork.a; 474 | remoteRef = 00C302DB1ABCB9D200DB3ED1 /* PBXContainerItemProxy */; 475 | sourceTree = BUILT_PRODUCTS_DIR; 476 | }; 477 | 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */ = { 478 | isa = PBXReferenceProxy; 479 | fileType = archive.ar; 480 | path = libRCTVibration.a; 481 | remoteRef = 00C302E31ABCB9EE00DB3ED1 /* PBXContainerItemProxy */; 482 | sourceTree = BUILT_PRODUCTS_DIR; 483 | }; 484 | 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */ = { 485 | isa = PBXReferenceProxy; 486 | fileType = archive.ar; 487 | path = libRCTSettings.a; 488 | remoteRef = 139105C01AF99BAD00B5F7CC /* PBXContainerItemProxy */; 489 | sourceTree = BUILT_PRODUCTS_DIR; 490 | }; 491 | 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */ = { 492 | isa = PBXReferenceProxy; 493 | fileType = archive.ar; 494 | path = libRCTWebSocket.a; 495 | remoteRef = 139FDEF31B06529B00C62182 /* PBXContainerItemProxy */; 496 | sourceTree = BUILT_PRODUCTS_DIR; 497 | }; 498 | 146834041AC3E56700842450 /* libReact.a */ = { 499 | isa = PBXReferenceProxy; 500 | fileType = archive.ar; 501 | path = libReact.a; 502 | remoteRef = 146834031AC3E56700842450 /* PBXContainerItemProxy */; 503 | sourceTree = BUILT_PRODUCTS_DIR; 504 | }; 505 | 78C398B91ACF4ADC00677621 /* libRCTLinking.a */ = { 506 | isa = PBXReferenceProxy; 507 | fileType = archive.ar; 508 | path = libRCTLinking.a; 509 | remoteRef = 78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */; 510 | sourceTree = BUILT_PRODUCTS_DIR; 511 | }; 512 | 832341B51AAA6A8300B99B32 /* libRCTText.a */ = { 513 | isa = PBXReferenceProxy; 514 | fileType = archive.ar; 515 | path = libRCTText.a; 516 | remoteRef = 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */; 517 | sourceTree = BUILT_PRODUCTS_DIR; 518 | }; 519 | C0F19F151D7FF31200DBB684 /* libSwipeView.a */ = { 520 | isa = PBXReferenceProxy; 521 | fileType = archive.ar; 522 | path = libSwipeView.a; 523 | remoteRef = C0F19F141D7FF31200DBB684 /* PBXContainerItemProxy */; 524 | sourceTree = BUILT_PRODUCTS_DIR; 525 | }; 526 | /* End PBXReferenceProxy section */ 527 | 528 | /* Begin PBXResourcesBuildPhase section */ 529 | 00E356EC1AD99517003FC87E /* Resources */ = { 530 | isa = PBXResourcesBuildPhase; 531 | buildActionMask = 2147483647; 532 | files = ( 533 | ); 534 | runOnlyForDeploymentPostprocessing = 0; 535 | }; 536 | 13B07F8E1A680F5B00A75B9A /* Resources */ = { 537 | isa = PBXResourcesBuildPhase; 538 | buildActionMask = 2147483647; 539 | files = ( 540 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */, 541 | 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */, 542 | ); 543 | runOnlyForDeploymentPostprocessing = 0; 544 | }; 545 | /* End PBXResourcesBuildPhase section */ 546 | 547 | /* Begin PBXShellScriptBuildPhase section */ 548 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = { 549 | isa = PBXShellScriptBuildPhase; 550 | buildActionMask = 2147483647; 551 | files = ( 552 | ); 553 | inputPaths = ( 554 | ); 555 | name = "Bundle React Native code and images"; 556 | outputPaths = ( 557 | ); 558 | runOnlyForDeploymentPostprocessing = 0; 559 | shellPath = /bin/sh; 560 | shellScript = "export NODE_BINARY=node\n../node_modules/react-native/packager/react-native-xcode.sh"; 561 | }; 562 | /* End PBXShellScriptBuildPhase section */ 563 | 564 | /* Begin PBXSourcesBuildPhase section */ 565 | 00E356EA1AD99517003FC87E /* Sources */ = { 566 | isa = PBXSourcesBuildPhase; 567 | buildActionMask = 2147483647; 568 | files = ( 569 | 00E356F31AD99517003FC87E /* exampleTests.m in Sources */, 570 | ); 571 | runOnlyForDeploymentPostprocessing = 0; 572 | }; 573 | 13B07F871A680F5B00A75B9A /* Sources */ = { 574 | isa = PBXSourcesBuildPhase; 575 | buildActionMask = 2147483647; 576 | files = ( 577 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */, 578 | 13B07FC11A68108700A75B9A /* main.m in Sources */, 579 | ); 580 | runOnlyForDeploymentPostprocessing = 0; 581 | }; 582 | /* End PBXSourcesBuildPhase section */ 583 | 584 | /* Begin PBXTargetDependency section */ 585 | 00E356F51AD99517003FC87E /* PBXTargetDependency */ = { 586 | isa = PBXTargetDependency; 587 | target = 13B07F861A680F5B00A75B9A /* example */; 588 | targetProxy = 00E356F41AD99517003FC87E /* PBXContainerItemProxy */; 589 | }; 590 | /* End PBXTargetDependency section */ 591 | 592 | /* Begin PBXVariantGroup section */ 593 | 13B07FB11A68108700A75B9A /* LaunchScreen.xib */ = { 594 | isa = PBXVariantGroup; 595 | children = ( 596 | 13B07FB21A68108700A75B9A /* Base */, 597 | ); 598 | name = LaunchScreen.xib; 599 | path = example; 600 | sourceTree = ""; 601 | }; 602 | /* End PBXVariantGroup section */ 603 | 604 | /* Begin XCBuildConfiguration section */ 605 | 00E356F61AD99517003FC87E /* Debug */ = { 606 | isa = XCBuildConfiguration; 607 | buildSettings = { 608 | BUNDLE_LOADER = "$(TEST_HOST)"; 609 | GCC_PREPROCESSOR_DEFINITIONS = ( 610 | "DEBUG=1", 611 | "$(inherited)", 612 | ); 613 | INFOPLIST_FILE = exampleTests/Info.plist; 614 | IPHONEOS_DEPLOYMENT_TARGET = 8.2; 615 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 616 | PRODUCT_NAME = "$(TARGET_NAME)"; 617 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/example.app/example"; 618 | }; 619 | name = Debug; 620 | }; 621 | 00E356F71AD99517003FC87E /* Release */ = { 622 | isa = XCBuildConfiguration; 623 | buildSettings = { 624 | BUNDLE_LOADER = "$(TEST_HOST)"; 625 | COPY_PHASE_STRIP = NO; 626 | INFOPLIST_FILE = exampleTests/Info.plist; 627 | IPHONEOS_DEPLOYMENT_TARGET = 8.2; 628 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 629 | PRODUCT_NAME = "$(TARGET_NAME)"; 630 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/example.app/example"; 631 | }; 632 | name = Release; 633 | }; 634 | 13B07F941A680F5B00A75B9A /* Debug */ = { 635 | isa = XCBuildConfiguration; 636 | buildSettings = { 637 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 638 | DEAD_CODE_STRIPPING = NO; 639 | HEADER_SEARCH_PATHS = ( 640 | "$(inherited)", 641 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 642 | "$(SRCROOT)/../node_modules/react-native/React/**", 643 | ); 644 | INFOPLIST_FILE = example/Info.plist; 645 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 646 | OTHER_LDFLAGS = ( 647 | "$(inherited)", 648 | "-ObjC", 649 | "-lc++", 650 | ); 651 | PRODUCT_NAME = example; 652 | }; 653 | name = Debug; 654 | }; 655 | 13B07F951A680F5B00A75B9A /* Release */ = { 656 | isa = XCBuildConfiguration; 657 | buildSettings = { 658 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 659 | HEADER_SEARCH_PATHS = ( 660 | "$(inherited)", 661 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 662 | "$(SRCROOT)/../node_modules/react-native/React/**", 663 | ); 664 | INFOPLIST_FILE = example/Info.plist; 665 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 666 | OTHER_LDFLAGS = ( 667 | "$(inherited)", 668 | "-ObjC", 669 | "-lc++", 670 | ); 671 | PRODUCT_NAME = example; 672 | }; 673 | name = Release; 674 | }; 675 | 83CBBA201A601CBA00E9B192 /* Debug */ = { 676 | isa = XCBuildConfiguration; 677 | buildSettings = { 678 | ALWAYS_SEARCH_USER_PATHS = NO; 679 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 680 | CLANG_CXX_LIBRARY = "libc++"; 681 | CLANG_ENABLE_MODULES = YES; 682 | CLANG_ENABLE_OBJC_ARC = YES; 683 | CLANG_WARN_BOOL_CONVERSION = YES; 684 | CLANG_WARN_CONSTANT_CONVERSION = YES; 685 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 686 | CLANG_WARN_EMPTY_BODY = YES; 687 | CLANG_WARN_ENUM_CONVERSION = YES; 688 | CLANG_WARN_INT_CONVERSION = YES; 689 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 690 | CLANG_WARN_UNREACHABLE_CODE = YES; 691 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 692 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 693 | COPY_PHASE_STRIP = NO; 694 | ENABLE_STRICT_OBJC_MSGSEND = YES; 695 | GCC_C_LANGUAGE_STANDARD = gnu99; 696 | GCC_DYNAMIC_NO_PIC = NO; 697 | GCC_OPTIMIZATION_LEVEL = 0; 698 | GCC_PREPROCESSOR_DEFINITIONS = ( 699 | "DEBUG=1", 700 | "$(inherited)", 701 | ); 702 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 703 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 704 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 705 | GCC_WARN_UNDECLARED_SELECTOR = YES; 706 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 707 | GCC_WARN_UNUSED_FUNCTION = YES; 708 | GCC_WARN_UNUSED_VARIABLE = YES; 709 | HEADER_SEARCH_PATHS = ( 710 | "$(inherited)", 711 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 712 | "$(SRCROOT)/../node_modules/react-native/React/**", 713 | ); 714 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 715 | MTL_ENABLE_DEBUG_INFO = YES; 716 | ONLY_ACTIVE_ARCH = YES; 717 | SDKROOT = iphoneos; 718 | }; 719 | name = Debug; 720 | }; 721 | 83CBBA211A601CBA00E9B192 /* Release */ = { 722 | isa = XCBuildConfiguration; 723 | buildSettings = { 724 | ALWAYS_SEARCH_USER_PATHS = NO; 725 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 726 | CLANG_CXX_LIBRARY = "libc++"; 727 | CLANG_ENABLE_MODULES = YES; 728 | CLANG_ENABLE_OBJC_ARC = YES; 729 | CLANG_WARN_BOOL_CONVERSION = YES; 730 | CLANG_WARN_CONSTANT_CONVERSION = YES; 731 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 732 | CLANG_WARN_EMPTY_BODY = YES; 733 | CLANG_WARN_ENUM_CONVERSION = YES; 734 | CLANG_WARN_INT_CONVERSION = YES; 735 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 736 | CLANG_WARN_UNREACHABLE_CODE = YES; 737 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 738 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 739 | COPY_PHASE_STRIP = YES; 740 | ENABLE_NS_ASSERTIONS = NO; 741 | ENABLE_STRICT_OBJC_MSGSEND = YES; 742 | GCC_C_LANGUAGE_STANDARD = gnu99; 743 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 744 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 745 | GCC_WARN_UNDECLARED_SELECTOR = YES; 746 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 747 | GCC_WARN_UNUSED_FUNCTION = YES; 748 | GCC_WARN_UNUSED_VARIABLE = YES; 749 | HEADER_SEARCH_PATHS = ( 750 | "$(inherited)", 751 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 752 | "$(SRCROOT)/../node_modules/react-native/React/**", 753 | ); 754 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 755 | MTL_ENABLE_DEBUG_INFO = NO; 756 | SDKROOT = iphoneos; 757 | VALIDATE_PRODUCT = YES; 758 | }; 759 | name = Release; 760 | }; 761 | /* End XCBuildConfiguration section */ 762 | 763 | /* Begin XCConfigurationList section */ 764 | 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "exampleTests" */ = { 765 | isa = XCConfigurationList; 766 | buildConfigurations = ( 767 | 00E356F61AD99517003FC87E /* Debug */, 768 | 00E356F71AD99517003FC87E /* Release */, 769 | ); 770 | defaultConfigurationIsVisible = 0; 771 | defaultConfigurationName = Release; 772 | }; 773 | 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "example" */ = { 774 | isa = XCConfigurationList; 775 | buildConfigurations = ( 776 | 13B07F941A680F5B00A75B9A /* Debug */, 777 | 13B07F951A680F5B00A75B9A /* Release */, 778 | ); 779 | defaultConfigurationIsVisible = 0; 780 | defaultConfigurationName = Release; 781 | }; 782 | 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "example" */ = { 783 | isa = XCConfigurationList; 784 | buildConfigurations = ( 785 | 83CBBA201A601CBA00E9B192 /* Debug */, 786 | 83CBBA211A601CBA00E9B192 /* Release */, 787 | ); 788 | defaultConfigurationIsVisible = 0; 789 | defaultConfigurationName = Release; 790 | }; 791 | /* End XCConfigurationList section */ 792 | }; 793 | rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */; 794 | } 795 | -------------------------------------------------------------------------------- /example/ios/example.xcodeproj/xcshareddata/xcschemes/example.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 44 | 45 | 47 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 65 | 66 | 75 | 77 | 83 | 84 | 85 | 86 | 87 | 88 | 94 | 96 | 102 | 103 | 104 | 105 | 107 | 108 | 111 | 112 | 113 | -------------------------------------------------------------------------------- /example/ios/example/AppDelegate.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | @interface AppDelegate : UIResponder 13 | 14 | @property (nonatomic, strong) UIWindow *window; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /example/ios/example/AppDelegate.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import "AppDelegate.h" 11 | 12 | #import "RCTBundleURLProvider.h" 13 | #import "RCTRootView.h" 14 | 15 | @implementation AppDelegate 16 | 17 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 18 | { 19 | NSURL *jsCodeLocation; 20 | 21 | jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil]; 22 | 23 | RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation 24 | moduleName:@"example" 25 | initialProperties:nil 26 | launchOptions:launchOptions]; 27 | rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1]; 28 | 29 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 30 | UIViewController *rootViewController = [UIViewController new]; 31 | rootViewController.view = rootView; 32 | self.window.rootViewController = rootViewController; 33 | [self.window makeKeyAndVisible]; 34 | return YES; 35 | } 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /example/ios/example/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 21 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /example/ios/example/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /example/ios/example/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UIViewControllerBasedStatusBarAppearance 38 | 39 | NSLocationWhenInUseUsageDescription 40 | 41 | NSAppTransportSecurity 42 | 43 | 44 | NSExceptionDomains 45 | 46 | localhost 47 | 48 | NSTemporaryExceptionAllowsInsecureHTTPLoads 49 | 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /example/ios/example/main.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | #import "AppDelegate.h" 13 | 14 | int main(int argc, char * argv[]) { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /example/ios/exampleTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /example/ios/exampleTests/exampleTests.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | #import 12 | 13 | #import "RCTLog.h" 14 | #import "RCTRootView.h" 15 | 16 | #define TIMEOUT_SECONDS 600 17 | #define TEXT_TO_LOOK_FOR @"Welcome to React Native!" 18 | 19 | @interface exampleTests : XCTestCase 20 | 21 | @end 22 | 23 | @implementation exampleTests 24 | 25 | - (BOOL)findSubviewInView:(UIView *)view matching:(BOOL(^)(UIView *view))test 26 | { 27 | if (test(view)) { 28 | return YES; 29 | } 30 | for (UIView *subview in [view subviews]) { 31 | if ([self findSubviewInView:subview matching:test]) { 32 | return YES; 33 | } 34 | } 35 | return NO; 36 | } 37 | 38 | - (void)testRendersWelcomeScreen 39 | { 40 | UIViewController *vc = [[[[UIApplication sharedApplication] delegate] window] rootViewController]; 41 | NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS]; 42 | BOOL foundElement = NO; 43 | 44 | __block NSString *redboxError = nil; 45 | RCTSetLogFunction(^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) { 46 | if (level >= RCTLogLevelError) { 47 | redboxError = message; 48 | } 49 | }); 50 | 51 | while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) { 52 | [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 53 | [[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 54 | 55 | foundElement = [self findSubviewInView:vc.view matching:^BOOL(UIView *view) { 56 | if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) { 57 | return YES; 58 | } 59 | return NO; 60 | }]; 61 | } 62 | 63 | RCTSetLogFunction(RCTDefaultLogFunction); 64 | 65 | XCTAssertNil(redboxError, @"RedBox error: %@", redboxError); 66 | XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS); 67 | } 68 | 69 | 70 | @end 71 | -------------------------------------------------------------------------------- /example/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "example", 3 | "version": "0.0.1", 4 | "private": true, 5 | "scripts": { 6 | "start": "react-native start" 7 | }, 8 | "dependencies": { 9 | "react-native": "0.38.0", 10 | "react": "15.4.1", 11 | "react-native-swipe-view": "file:../" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | import SwipeView from './src/SwipeView'; 2 | 3 | export {SwipeView}; 4 | -------------------------------------------------------------------------------- /ios/lib/SwipeView.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | D868272C1CE876DF009ABC81 /* SwipeViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = D868272B1CE876DF009ABC81 /* SwipeViewManager.m */; }; 11 | /* End PBXBuildFile section */ 12 | 13 | /* Begin PBXCopyFilesBuildPhase section */ 14 | D803C61D1CE8769E006B214F /* CopyFiles */ = { 15 | isa = PBXCopyFilesBuildPhase; 16 | buildActionMask = 2147483647; 17 | dstPath = "include/$(PRODUCT_NAME)"; 18 | dstSubfolderSpec = 16; 19 | files = ( 20 | ); 21 | runOnlyForDeploymentPostprocessing = 0; 22 | }; 23 | /* End PBXCopyFilesBuildPhase section */ 24 | 25 | /* Begin PBXFileReference section */ 26 | D803C61F1CE8769E006B214F /* libSwipeView.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libSwipeView.a; sourceTree = BUILT_PRODUCTS_DIR; }; 27 | D868272A1CE876DF009ABC81 /* SwipeViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SwipeViewManager.h; sourceTree = SOURCE_ROOT; }; 28 | D868272B1CE876DF009ABC81 /* SwipeViewManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SwipeViewManager.m; sourceTree = SOURCE_ROOT; }; 29 | /* End PBXFileReference section */ 30 | 31 | /* Begin PBXFrameworksBuildPhase section */ 32 | D803C61C1CE8769E006B214F /* Frameworks */ = { 33 | isa = PBXFrameworksBuildPhase; 34 | buildActionMask = 2147483647; 35 | files = ( 36 | ); 37 | runOnlyForDeploymentPostprocessing = 0; 38 | }; 39 | /* End PBXFrameworksBuildPhase section */ 40 | 41 | /* Begin PBXGroup section */ 42 | D803C6161CE8769E006B214F = { 43 | isa = PBXGroup; 44 | children = ( 45 | D803C6211CE8769E006B214F /* SwipeView */, 46 | D803C6201CE8769E006B214F /* Products */, 47 | ); 48 | sourceTree = ""; 49 | }; 50 | D803C6201CE8769E006B214F /* Products */ = { 51 | isa = PBXGroup; 52 | children = ( 53 | D803C61F1CE8769E006B214F /* libSwipeView.a */, 54 | ); 55 | name = Products; 56 | sourceTree = ""; 57 | }; 58 | D803C6211CE8769E006B214F /* SwipeView */ = { 59 | isa = PBXGroup; 60 | children = ( 61 | D868272A1CE876DF009ABC81 /* SwipeViewManager.h */, 62 | D868272B1CE876DF009ABC81 /* SwipeViewManager.m */, 63 | ); 64 | path = SwipeView; 65 | sourceTree = ""; 66 | }; 67 | /* End PBXGroup section */ 68 | 69 | /* Begin PBXNativeTarget section */ 70 | D803C61E1CE8769E006B214F /* SwipeView */ = { 71 | isa = PBXNativeTarget; 72 | buildConfigurationList = D803C6281CE8769E006B214F /* Build configuration list for PBXNativeTarget "SwipeView" */; 73 | buildPhases = ( 74 | D803C61B1CE8769E006B214F /* Sources */, 75 | D803C61C1CE8769E006B214F /* Frameworks */, 76 | D803C61D1CE8769E006B214F /* CopyFiles */, 77 | ); 78 | buildRules = ( 79 | ); 80 | dependencies = ( 81 | ); 82 | name = SwipeView; 83 | productName = SwipeView; 84 | productReference = D803C61F1CE8769E006B214F /* libSwipeView.a */; 85 | productType = "com.apple.product-type.library.static"; 86 | }; 87 | /* End PBXNativeTarget section */ 88 | 89 | /* Begin PBXProject section */ 90 | D803C6171CE8769E006B214F /* Project object */ = { 91 | isa = PBXProject; 92 | attributes = { 93 | LastUpgradeCheck = 0730; 94 | ORGANIZATIONNAME = wix; 95 | TargetAttributes = { 96 | D803C61E1CE8769E006B214F = { 97 | CreatedOnToolsVersion = 7.3; 98 | }; 99 | }; 100 | }; 101 | buildConfigurationList = D803C61A1CE8769E006B214F /* Build configuration list for PBXProject "SwipeView" */; 102 | compatibilityVersion = "Xcode 3.2"; 103 | developmentRegion = English; 104 | hasScannedForEncodings = 0; 105 | knownRegions = ( 106 | en, 107 | ); 108 | mainGroup = D803C6161CE8769E006B214F; 109 | productRefGroup = D803C6201CE8769E006B214F /* Products */; 110 | projectDirPath = ""; 111 | projectRoot = ""; 112 | targets = ( 113 | D803C61E1CE8769E006B214F /* SwipeView */, 114 | ); 115 | }; 116 | /* End PBXProject section */ 117 | 118 | /* Begin PBXSourcesBuildPhase section */ 119 | D803C61B1CE8769E006B214F /* Sources */ = { 120 | isa = PBXSourcesBuildPhase; 121 | buildActionMask = 2147483647; 122 | files = ( 123 | D868272C1CE876DF009ABC81 /* SwipeViewManager.m in Sources */, 124 | ); 125 | runOnlyForDeploymentPostprocessing = 0; 126 | }; 127 | /* End PBXSourcesBuildPhase section */ 128 | 129 | /* Begin XCBuildConfiguration section */ 130 | D803C6261CE8769E006B214F /* Debug */ = { 131 | isa = XCBuildConfiguration; 132 | buildSettings = { 133 | ALWAYS_SEARCH_USER_PATHS = NO; 134 | CLANG_ANALYZER_NONNULL = YES; 135 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 136 | CLANG_CXX_LIBRARY = "libc++"; 137 | CLANG_ENABLE_MODULES = YES; 138 | CLANG_ENABLE_OBJC_ARC = YES; 139 | CLANG_WARN_BOOL_CONVERSION = YES; 140 | CLANG_WARN_CONSTANT_CONVERSION = YES; 141 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 142 | CLANG_WARN_EMPTY_BODY = YES; 143 | CLANG_WARN_ENUM_CONVERSION = YES; 144 | CLANG_WARN_INT_CONVERSION = YES; 145 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 146 | CLANG_WARN_UNREACHABLE_CODE = YES; 147 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 148 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 149 | COPY_PHASE_STRIP = NO; 150 | DEBUG_INFORMATION_FORMAT = dwarf; 151 | ENABLE_STRICT_OBJC_MSGSEND = YES; 152 | ENABLE_TESTABILITY = YES; 153 | GCC_C_LANGUAGE_STANDARD = gnu99; 154 | GCC_DYNAMIC_NO_PIC = NO; 155 | GCC_NO_COMMON_BLOCKS = YES; 156 | GCC_OPTIMIZATION_LEVEL = 0; 157 | GCC_PREPROCESSOR_DEFINITIONS = ( 158 | "DEBUG=1", 159 | "$(inherited)", 160 | ); 161 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 162 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 163 | GCC_WARN_UNDECLARED_SELECTOR = YES; 164 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 165 | GCC_WARN_UNUSED_FUNCTION = YES; 166 | GCC_WARN_UNUSED_VARIABLE = YES; 167 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 168 | MTL_ENABLE_DEBUG_INFO = YES; 169 | ONLY_ACTIVE_ARCH = YES; 170 | SDKROOT = iphoneos; 171 | }; 172 | name = Debug; 173 | }; 174 | D803C6271CE8769E006B214F /* Release */ = { 175 | isa = XCBuildConfiguration; 176 | buildSettings = { 177 | ALWAYS_SEARCH_USER_PATHS = NO; 178 | CLANG_ANALYZER_NONNULL = YES; 179 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 180 | CLANG_CXX_LIBRARY = "libc++"; 181 | CLANG_ENABLE_MODULES = YES; 182 | CLANG_ENABLE_OBJC_ARC = YES; 183 | CLANG_WARN_BOOL_CONVERSION = YES; 184 | CLANG_WARN_CONSTANT_CONVERSION = YES; 185 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 186 | CLANG_WARN_EMPTY_BODY = YES; 187 | CLANG_WARN_ENUM_CONVERSION = YES; 188 | CLANG_WARN_INT_CONVERSION = YES; 189 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 190 | CLANG_WARN_UNREACHABLE_CODE = YES; 191 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 192 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 193 | COPY_PHASE_STRIP = NO; 194 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 195 | ENABLE_NS_ASSERTIONS = NO; 196 | ENABLE_STRICT_OBJC_MSGSEND = YES; 197 | GCC_C_LANGUAGE_STANDARD = gnu99; 198 | GCC_NO_COMMON_BLOCKS = YES; 199 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 200 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 201 | GCC_WARN_UNDECLARED_SELECTOR = YES; 202 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 203 | GCC_WARN_UNUSED_FUNCTION = YES; 204 | GCC_WARN_UNUSED_VARIABLE = YES; 205 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 206 | MTL_ENABLE_DEBUG_INFO = NO; 207 | SDKROOT = iphoneos; 208 | VALIDATE_PRODUCT = YES; 209 | }; 210 | name = Release; 211 | }; 212 | D803C6291CE8769E006B214F /* Debug */ = { 213 | isa = XCBuildConfiguration; 214 | buildSettings = { 215 | HEADER_SEARCH_PATHS = ( 216 | "$(inherited)", 217 | "$(SRCROOT)/../../../react-native/React/**", 218 | ); 219 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 220 | OTHER_LDFLAGS = "-ObjC"; 221 | PRODUCT_NAME = "$(TARGET_NAME)"; 222 | SKIP_INSTALL = YES; 223 | }; 224 | name = Debug; 225 | }; 226 | D803C62A1CE8769E006B214F /* Release */ = { 227 | isa = XCBuildConfiguration; 228 | buildSettings = { 229 | HEADER_SEARCH_PATHS = ( 230 | "$(inherited)", 231 | "$(SRCROOT)/../../../react-native/React/**", 232 | ); 233 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 234 | OTHER_LDFLAGS = "-ObjC"; 235 | PRODUCT_NAME = "$(TARGET_NAME)"; 236 | SKIP_INSTALL = YES; 237 | }; 238 | name = Release; 239 | }; 240 | /* End XCBuildConfiguration section */ 241 | 242 | /* Begin XCConfigurationList section */ 243 | D803C61A1CE8769E006B214F /* Build configuration list for PBXProject "SwipeView" */ = { 244 | isa = XCConfigurationList; 245 | buildConfigurations = ( 246 | D803C6261CE8769E006B214F /* Debug */, 247 | D803C6271CE8769E006B214F /* Release */, 248 | ); 249 | defaultConfigurationIsVisible = 0; 250 | defaultConfigurationName = Release; 251 | }; 252 | D803C6281CE8769E006B214F /* Build configuration list for PBXNativeTarget "SwipeView" */ = { 253 | isa = XCConfigurationList; 254 | buildConfigurations = ( 255 | D803C6291CE8769E006B214F /* Debug */, 256 | D803C62A1CE8769E006B214F /* Release */, 257 | ); 258 | defaultConfigurationIsVisible = 0; 259 | defaultConfigurationName = Release; 260 | }; 261 | /* End XCConfigurationList section */ 262 | }; 263 | rootObject = D803C6171CE8769E006B214F /* Project object */; 264 | } 265 | -------------------------------------------------------------------------------- /ios/lib/SwipeView.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/lib/SwipeViewManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // SwipeableViewManager.h 3 | // reactNativeSwipeableView 4 | // 5 | // Created by Artal Druk on 12/05/2016. 6 | // Copyright © 2016 Wix.com. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "RCTViewManager.h" 11 | 12 | @interface SwipeViewManager : RCTViewManager 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /ios/lib/SwipeViewManager.m: -------------------------------------------------------------------------------- 1 | // 2 | // SwipeableViewManager.m 3 | // reactNativeSwipeableView 4 | // 5 | // Created by Artal Druk on 12/05/2016. 6 | // Copyright © 2016 Wix.com. All rights reserved. 7 | // 8 | 9 | #import "SwipeViewManager.h" 10 | #import "RCTScrollView.h" 11 | #import "RCTRootView.h" 12 | 13 | #define kMinPanToCompleteUndefined -1 14 | #define kDefaultBounceBackDuration 0.35 15 | #define kDefaultSpringDamping 0.65 16 | 17 | @interface SwipeView : UIView 18 | @property (nonatomic) CGFloat minPanToComplete; 19 | @property (nonatomic) CGPoint originalCenter; 20 | @property (nonatomic) BOOL changeAlpha; 21 | @property (nonatomic) BOOL removeViewOnSwipedOut; 22 | @property (nonatomic) CGFloat bounceBackAnimDuration; 23 | @property (nonatomic) CGFloat bounceBackAnimDamping; 24 | @property (nonatomic, copy) RCTDirectEventBlock onSwipeStart; 25 | @property (nonatomic, copy) RCTDirectEventBlock onWillBeSwipedOut; 26 | @property (nonatomic, copy) RCTDirectEventBlock onSwipedOut; 27 | @property (nonatomic, copy) RCTDirectEventBlock onWillBounceBack; 28 | @property (nonatomic, copy) RCTDirectEventBlock onBouncedBack; 29 | 30 | @property (nonatomic, retain) UIScrollView *containerScrollVIew; 31 | @end 32 | 33 | @implementation SwipeView 34 | 35 | - (instancetype)initWithFrame:(CGRect)frame 36 | { 37 | self = [super initWithFrame:frame]; 38 | if (self) 39 | { 40 | self.changeAlpha = NO; 41 | self.removeViewOnSwipedOut = NO; 42 | self.minPanToComplete = kMinPanToCompleteUndefined; 43 | self.bounceBackAnimDuration = kDefaultBounceBackDuration; 44 | self.bounceBackAnimDamping = kDefaultSpringDamping; 45 | 46 | UIPanGestureRecognizer *panGesture = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(onPanGesture:)]; 47 | panGesture.delegate = self; 48 | [self addGestureRecognizer:panGesture]; 49 | } 50 | return self; 51 | } 52 | 53 | - (UIScrollView*)getScrollView 54 | { 55 | UIView *view = self; 56 | while (view.superview != nil) 57 | { 58 | view = view.superview; 59 | if ([view isKindOfClass:[RCTScrollView class]]) 60 | { 61 | return ((RCTScrollView*)view).scrollView; 62 | } 63 | } 64 | return nil; 65 | } 66 | 67 | -(void)restoreScrolling 68 | { 69 | if (self.containerScrollVIew != nil) 70 | { 71 | self.containerScrollVIew.scrollEnabled = YES; 72 | self.containerScrollVIew = nil; 73 | } 74 | } 75 | 76 | -(RCTRootView*)getRootView 77 | { 78 | UIView *view = self; 79 | while (view.superview != nil) 80 | { 81 | view = view.superview; 82 | if ([view isKindOfClass:[RCTRootView class]]) 83 | break; 84 | } 85 | 86 | if ([view isKindOfClass:[RCTRootView class]]) 87 | { 88 | return view; 89 | } 90 | return nil; 91 | } 92 | 93 | -(void)cancelCurrentTouch 94 | { 95 | RCTRootView *view = [self getRootView]; 96 | if (view != nil) 97 | { 98 | [(RCTRootView*)view cancelTouches]; 99 | } 100 | } 101 | 102 | - (BOOL)gestureRecognizerShouldBegin:(UIPanGestureRecognizer *)panGesture 103 | { 104 | CGPoint velocity = [panGesture velocityInView:self]; 105 | return fabs(velocity.y) < fabs(velocity.x); 106 | } 107 | 108 | -(void)onPanGesture:(UIPanGestureRecognizer*)panGesture 109 | { 110 | if(panGesture.state == UIGestureRecognizerStateBegan) 111 | { 112 | self.originalCenter = self.center; 113 | if (self.minPanToComplete == kMinPanToCompleteUndefined) 114 | { 115 | self.minPanToComplete = self.frame.size.width * 0.5; 116 | } 117 | 118 | UIScrollView *containerScrolView = [self getScrollView]; 119 | if (containerScrolView != nil && containerScrolView.scrollEnabled) 120 | { 121 | containerScrolView.scrollEnabled = NO; 122 | self.containerScrollVIew = containerScrolView; 123 | } 124 | 125 | [self cancelCurrentTouch]; 126 | 127 | NSString *directionString = ([panGesture velocityInView:self].x < 0) ? @"left" : @"right"; 128 | if (_onSwipeStart) 129 | { 130 | _onSwipeStart(@{@"direction": directionString}); 131 | } 132 | } 133 | else if(panGesture.state == UIGestureRecognizerStateChanged) 134 | { 135 | CGPoint translation = [panGesture translationInView:self.superview]; 136 | self.center = CGPointMake(self.originalCenter.x + translation.x, self.originalCenter.y); 137 | 138 | if (self.changeAlpha) 139 | { 140 | self.alpha = 1.0 - 0.9 * MIN(1, fabs(translation.x) / self.minPanToComplete); 141 | } 142 | } 143 | else if (panGesture.state == UIGestureRecognizerStateEnded || 144 | panGesture.state == UIGestureRecognizerStateFailed || 145 | panGesture.state == UIGestureRecognizerStateCancelled) 146 | { 147 | CGFloat centerDiff = self.originalCenter.x - self.center.x; 148 | CGFloat velocityX = [panGesture velocityInView:self].x; 149 | int direction = (velocityX < 0) ? -1 : 1; 150 | NSString *directionString = (direction < 0) ? @"left" : @"right"; 151 | if (fabs(centerDiff) > self.minPanToComplete || fabs(velocityX) > 2000) 152 | { 153 | if (_onWillBeSwipedOut) 154 | { 155 | _onWillBeSwipedOut(@{@"direction": directionString}); 156 | self.onWillBeSwipedOut = nil; 157 | } 158 | 159 | CGFloat distanceForSwipe = fabs(centerDiff); 160 | UIView *parentView = [self getRootView]; 161 | if(parentView != nil) 162 | { 163 | distanceForSwipe = parentView.frame.size.width - self.center.x + self.frame.size.width * 0.5; 164 | } 165 | 166 | NSTimeInterval duration = MIN(0.3, fabs(self.minPanToComplete / velocityX)); 167 | [UIView animateWithDuration:duration 168 | animations:^() 169 | { 170 | self.center = CGPointMake(self.center.x + distanceForSwipe * direction, self.center.y); 171 | } 172 | completion:^(BOOL finished) 173 | { 174 | if (_onSwipedOut) 175 | { 176 | _onSwipedOut(@{@"direction": directionString}); 177 | self.onSwipedOut = nil; 178 | 179 | if(self.removeViewOnSwipedOut) 180 | { 181 | [self removeFromSuperview]; 182 | } 183 | } 184 | 185 | [self restoreScrolling]; 186 | }]; 187 | } 188 | else 189 | { 190 | [self restoreScrolling]; 191 | 192 | if (_onWillBounceBack) 193 | { 194 | _onWillBounceBack(@{}); 195 | } 196 | 197 | [UIView animateWithDuration:self.bounceBackAnimDuration 198 | delay:0 usingSpringWithDamping:self.bounceBackAnimDamping 199 | initialSpringVelocity:0 200 | options:(UIViewAnimationOptionCurveEaseOut | UIViewAnimationOptionAllowUserInteraction) 201 | animations:^() 202 | { 203 | self.center = self.originalCenter; 204 | if (self.changeAlpha) 205 | { 206 | self.alpha = 1; 207 | } 208 | } completion:^(BOOL finished) 209 | { 210 | if (_onBouncedBack) 211 | { 212 | _onBouncedBack(@{}); 213 | } 214 | }]; 215 | } 216 | } 217 | } 218 | 219 | @end 220 | 221 | @implementation SwipeViewManager 222 | 223 | RCT_EXPORT_MODULE() 224 | 225 | - (UIView *)view 226 | { 227 | return [SwipeView new]; 228 | } 229 | 230 | RCT_REMAP_VIEW_PROPERTY(changeOpacity, changeAlpha, BOOL) 231 | RCT_REMAP_VIEW_PROPERTY(removeViewOnSwipedOut, removeViewOnSwipedOut, BOOL) 232 | RCT_REMAP_VIEW_PROPERTY(minPanToComplete, minPanToComplete, CGFloat) 233 | RCT_REMAP_VIEW_PROPERTY(bounceBackAnimDuration, bounceBackAnimDuration, CGFloat) 234 | RCT_REMAP_VIEW_PROPERTY(bounceBackAnimDamping, bounceBackAnimDamping, CGFloat) 235 | RCT_REMAP_VIEW_PROPERTY(onSwipeStart, onSwipeStart, RCTDirectEventBlock) 236 | RCT_REMAP_VIEW_PROPERTY(onWillBeSwipedOut, onWillBeSwipedOut, RCTDirectEventBlock) 237 | RCT_REMAP_VIEW_PROPERTY(onSwipedOut, onSwipedOut, RCTDirectEventBlock) 238 | RCT_REMAP_VIEW_PROPERTY(onWillBounceBack, onWillBounceBack, RCTDirectEventBlock) 239 | RCT_REMAP_VIEW_PROPERTY(onBouncedBack, onBouncedBack, RCTDirectEventBlock) 240 | 241 | @end 242 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-native-swipe-view", 3 | "publishConfig": { 4 | "registry": "https://registry.npmjs.org/" 5 | }, 6 | "repository": { 7 | "type": "git", 8 | "url": "https://github.com/wix/react-native-swipe-view.git" 9 | }, 10 | "version": "3.0.1", 11 | "description": "Native container view for enabling swipe actions (for example to enable swipe to delete and such)", 12 | "nativePackage": true, 13 | "bugs": { 14 | "url": "https://github.com/wix/react-native-swipe-view/issues" 15 | }, 16 | "homepage": "https://github.com/wix/react-native-swipe-view", 17 | "main": "index.js", 18 | "author": "Artal Druk ", 19 | "license": "MIT", 20 | "peerDependencies": { 21 | "react-native": ">=0.25.1", 22 | "react": ">=0.14.5" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/SwipeView.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by artald on 15/05/2016. 3 | */ 4 | 5 | import React, { Component } from 'react'; 6 | import { 7 | requireNativeComponent 8 | } from 'react-native'; 9 | 10 | const NativeSwipeView = requireNativeComponent('SwipeView', null); 11 | 12 | export default class SwipeView extends React.Component { 13 | render() { 14 | return ; 15 | } 16 | } --------------------------------------------------------------------------------