├── .babelrc ├── .gitignore ├── .npmignore ├── CHANGELOG.md ├── Example ├── .babelrc ├── .buckconfig ├── .flowconfig ├── .gitattributes ├── .gitignore ├── .watchmanconfig ├── __tests__ │ └── App.js ├── 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 ├── app.json ├── app │ ├── Main.js │ ├── __tests__ │ │ ├── __snapshots__ │ │ │ └── index-test.js.snap │ │ └── index-test.js │ ├── components │ │ ├── button │ │ │ └── Button.js │ │ ├── index.js │ │ └── list │ │ │ ├── FullWidthSubItem.js │ │ │ ├── ListItem.js │ │ │ ├── ListItemButton.js │ │ │ └── ProgressListItem.js │ ├── constants │ │ ├── animation.js │ │ ├── color.js │ │ ├── index.js │ │ └── layout.js │ ├── index.js │ ├── models │ │ ├── Todo.js │ │ ├── TodoCollection.js │ │ └── index.js │ └── scenes │ │ ├── index.js │ │ └── todo │ │ ├── TodoScene.js │ │ └── components │ │ ├── TodoDetails.js │ │ ├── TodoSubItem.js │ │ ├── TodoSwipeList.js │ │ └── index.js ├── assets │ └── capture.gif ├── index.js ├── ios │ ├── Example-tvOS │ │ └── Info.plist │ ├── Example-tvOSTests │ │ └── Info.plist │ ├── Example.xcodeproj │ │ ├── project.pbxproj │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ ├── Example-tvOS.xcscheme │ │ │ └── Example.xcscheme │ ├── Example │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── Base.lproj │ │ │ └── LaunchScreen.xib │ │ ├── Images.xcassets │ │ │ ├── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ │ └── Contents.json │ │ ├── Info.plist │ │ └── main.m │ └── ExampleTests │ │ ├── ExampleTests.m │ │ └── Info.plist ├── package.json └── yarn.lock ├── README.md ├── index.js ├── package.json ├── src ├── components │ ├── HorizontalGestureResponder.js │ ├── SwipeList.js │ ├── SwipeRow.js │ ├── __tests__ │ │ ├── HorizontalGestureResponder-test.js │ │ ├── SwipRow-test.js │ │ ├── SwipeList-test.js │ │ └── __snapshots__ │ │ │ ├── HorizontalGestureResponder-test.js.snap │ │ │ ├── SwipRow-test.js.snap │ │ │ └── SwipeList-test.js.snap │ └── index.js ├── constants │ └── index.js └── util │ ├── gesture │ ├── __mocks__ │ │ ├── getGestureAngle.js │ │ ├── isValidVelocity.js │ │ └── normalizeVelocity.js │ ├── __tests__ │ │ ├── getGestureAngle-test.js │ │ ├── isValidHorizontalGestureAngle-test.js │ │ ├── isValidHorizontalGestureSpeed-test.js │ │ └── isValidVelocity-test.js │ ├── applySimpleTension.js │ ├── getGestureAngle.js │ ├── index.js │ ├── isValidGestureDistance.js │ ├── isValidHorizontalGesture.js │ ├── isValidHorizontalGestureAngle.js │ ├── isValidHorizontalGestureSpeed.js │ └── isValidVelocity.js │ ├── index.js │ └── layout │ └── index.js └── yarn.lock /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["react-native"] 3 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | /.idea/ 3 | /node_modules/ 4 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | /.idea/ 2 | /Example/ 3 | /node_modules/ 4 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change log 2 | 3 | ## v1.4.0 4 | > 2018-02-01 5 | 6 | **Breaking changes - requires RN >= 0.47.0** 7 | - Switched from `ListView` to `FlatList` 8 | - `calloutRow` no longer takes a sectionId, it now has the signature `calloutRow(rowNumber, amountToMove)` 9 | 10 | ## v1.3.0 11 | > 2017-05-23 12 | - Fixed incorrect refs for `ScrollView` type lists. This fixes an issue where the rows would not animate out 13 | 14 | ## v1.2.5 15 | > 2017-05-19 16 | 17 | - Added `calloutRow` to `SwipeList`. `calloutRow` takes a rowId, sectionId, and the amount to open the row and returns a promise. 18 | -------------------------------------------------------------------------------- /Example/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["react-native"] 3 | } 4 | -------------------------------------------------------------------------------- /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 | ; We fork some components by platform 3 | .*/*[.]android.js 4 | 5 | ; Ignore "BUCK" generated dirs 6 | /\.buckd/ 7 | 8 | ; Ignore unexpected extra "@providesModule" 9 | .*/node_modules/.*/node_modules/fbjs/.* 10 | 11 | ; Ignore duplicate module providers 12 | ; For RN Apps installed via npm, "Libraries" folder is inside 13 | ; "node_modules/react-native" but in the source repo it is in the root 14 | .*/Libraries/react-native/React.js 15 | 16 | ; Ignore polyfills 17 | .*/Libraries/polyfills/.* 18 | 19 | ; Ignore metro 20 | .*/node_modules/metro/.* 21 | 22 | [include] 23 | 24 | [libs] 25 | node_modules/react-native/Libraries/react-native/react-native-interface.js 26 | node_modules/react-native/flow/ 27 | node_modules/react-native/flow-github/ 28 | 29 | [options] 30 | emoji=true 31 | 32 | module.system=haste 33 | 34 | munge_underscores=true 35 | 36 | 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' 37 | 38 | module.file_ext=.js 39 | module.file_ext=.jsx 40 | module.file_ext=.json 41 | module.file_ext=.native.js 42 | 43 | suppress_type=$FlowIssue 44 | suppress_type=$FlowFixMe 45 | suppress_type=$FlowFixMeProps 46 | suppress_type=$FlowFixMeState 47 | 48 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\) 49 | suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+ 50 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy 51 | suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError 52 | 53 | unsafe.enable_getters_and_setters=true 54 | 55 | [version] 56 | ^0.61.0 57 | -------------------------------------------------------------------------------- /Example/.gitattributes: -------------------------------------------------------------------------------- 1 | *.pbxproj -text 2 | -------------------------------------------------------------------------------- /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/IntelliJ 26 | # 27 | build/ 28 | .idea 29 | .gradle 30 | local.properties 31 | *.iml 32 | 33 | # node.js 34 | # 35 | node_modules/ 36 | npm-debug.log 37 | yarn-error.log 38 | 39 | # BUCK 40 | buck-out/ 41 | \.buckd/ 42 | *.keystore 43 | 44 | # fastlane 45 | # 46 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 47 | # screenshots whenever they are needed. 48 | # For more information about the recommended setup visit: 49 | # https://docs.fastlane.tools/best-practices/source-control/ 50 | 51 | */fastlane/report.xml 52 | */fastlane/Preview.html 53 | */fastlane/screenshots 54 | -------------------------------------------------------------------------------- /Example/.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /Example/__tests__/App.js: -------------------------------------------------------------------------------- 1 | import 'react-native'; 2 | import React from 'react'; 3 | import App from '../App'; 4 | 5 | // Note: test renderer must be required after react-native. 6 | import renderer from 'react-test-renderer'; 7 | 8 | it('renders correctly', () => { 9 | const tree = renderer.create( 10 | 11 | ); 12 | }); 13 | -------------------------------------------------------------------------------- /Example/android/app/BUCK: -------------------------------------------------------------------------------- 1 | # To learn about Buck see [Docs](https://buckbuild.com/). 2 | # To run your application with Buck: 3 | # - install Buck 4 | # - `npm start` - to start the packager 5 | # - `cd android` 6 | # - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"` 7 | # - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck 8 | # - `buck install -r android/app` - compile, install and run application 9 | # 10 | 11 | lib_deps = [] 12 | 13 | for jarfile in glob(['libs/*.jar']): 14 | name = 'jars__' + jarfile[jarfile.rindex('/') + 1: jarfile.rindex('.jar')] 15 | lib_deps.append(':' + name) 16 | prebuilt_jar( 17 | name = name, 18 | binary_jar = jarfile, 19 | ) 20 | 21 | for aarfile in glob(['libs/*.aar']): 22 | name = 'aars__' + aarfile[aarfile.rindex('/') + 1: aarfile.rindex('.aar')] 23 | lib_deps.append(':' + name) 24 | android_prebuilt_aar( 25 | name = name, 26 | aar = aarfile, 27 | ) 28 | 29 | android_library( 30 | name = "all-libs", 31 | exported_deps = lib_deps, 32 | ) 33 | 34 | android_library( 35 | name = "app-code", 36 | srcs = glob([ 37 | "src/main/java/**/*.java", 38 | ]), 39 | deps = [ 40 | ":all-libs", 41 | ":build_config", 42 | ":res", 43 | ], 44 | ) 45 | 46 | android_build_config( 47 | name = "build_config", 48 | package = "com.example", 49 | ) 50 | 51 | android_resource( 52 | name = "res", 53 | package = "com.example", 54 | res = "src/main/res", 55 | ) 56 | 57 | android_binary( 58 | name = "app", 59 | keystore = "//android/keystores:debug", 60 | manifest = "src/main/AndroidManifest.xml", 61 | package_type = "debug", 62 | deps = [ 63 | ":app-code", 64 | ], 65 | ) 66 | -------------------------------------------------------------------------------- /Example/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "com.android.application" 2 | 3 | import com.android.build.OutputFile 4 | 5 | /** 6 | * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets 7 | * and bundleReleaseJsAndAssets). 8 | * These basically call `react-native bundle` with the correct arguments during the Android build 9 | * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the 10 | * bundle directly from the development server. Below you can see all the possible configurations 11 | * and their defaults. If you decide to add a configuration block, make sure to add it before the 12 | * `apply from: "../../node_modules/react-native/react.gradle"` line. 13 | * 14 | * project.ext.react = [ 15 | * // the name of the generated asset file containing your JS bundle 16 | * bundleAssetName: "index.android.bundle", 17 | * 18 | * // the entry file for bundle generation 19 | * entryFile: "index.android.js", 20 | * 21 | * // whether to bundle JS and assets in debug mode 22 | * bundleInDebug: false, 23 | * 24 | * // whether to bundle JS and assets in release mode 25 | * bundleInRelease: true, 26 | * 27 | * // whether to bundle JS and assets in another build variant (if configured). 28 | * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants 29 | * // The configuration property can be in the following formats 30 | * // 'bundleIn${productFlavor}${buildType}' 31 | * // 'bundleIn${buildType}' 32 | * // bundleInFreeDebug: true, 33 | * // bundleInPaidRelease: true, 34 | * // bundleInBeta: true, 35 | * 36 | * // whether to disable dev mode in custom build variants (by default only disabled in release) 37 | * // for example: to disable dev mode in the staging build type (if configured) 38 | * devDisabledInStaging: true, 39 | * // The configuration property can be in the following formats 40 | * // 'devDisabledIn${productFlavor}${buildType}' 41 | * // 'devDisabledIn${buildType}' 42 | * 43 | * // the root of your project, i.e. where "package.json" lives 44 | * root: "../../", 45 | * 46 | * // where to put the JS bundle asset in debug mode 47 | * jsBundleDirDebug: "$buildDir/intermediates/assets/debug", 48 | * 49 | * // where to put the JS bundle asset in release mode 50 | * jsBundleDirRelease: "$buildDir/intermediates/assets/release", 51 | * 52 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 53 | * // require('./image.png')), in debug mode 54 | * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug", 55 | * 56 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 57 | * // require('./image.png')), in release mode 58 | * resourcesDirRelease: "$buildDir/intermediates/res/merged/release", 59 | * 60 | * // by default the gradle tasks are skipped if none of the JS files or assets change; this means 61 | * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to 62 | * // date; if you have any other folders that you want to ignore for performance reasons (gradle 63 | * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/ 64 | * // for example, you might want to remove it from here. 65 | * inputExcludes: ["android/**", "ios/**"], 66 | * 67 | * // override which node gets called and with what additional arguments 68 | * nodeExecutableAndArgs: ["node"], 69 | * 70 | * // supply additional arguments to the packager 71 | * extraPackagerArgs: [] 72 | * ] 73 | */ 74 | 75 | project.ext.react = [ 76 | entryFile: "index.js" 77 | ] 78 | 79 | apply from: "../../node_modules/react-native/react.gradle" 80 | 81 | /** 82 | * Set this to true to create two separate APKs instead of one: 83 | * - An APK that only works on ARM devices 84 | * - An APK that only works on x86 devices 85 | * The advantage is the size of the APK is reduced by about 4MB. 86 | * Upload all the APKs to the Play Store and people will download 87 | * the correct one based on the CPU architecture of their device. 88 | */ 89 | def enableSeparateBuildPerCPUArchitecture = false 90 | 91 | /** 92 | * Run Proguard to shrink the Java bytecode in release builds. 93 | */ 94 | def enableProguardInReleaseBuilds = false 95 | 96 | android { 97 | compileSdkVersion 23 98 | buildToolsVersion "23.0.1" 99 | 100 | defaultConfig { 101 | applicationId "com.example" 102 | minSdkVersion 16 103 | targetSdkVersion 22 104 | versionCode 1 105 | versionName "1.0" 106 | ndk { 107 | abiFilters "armeabi-v7a", "x86" 108 | } 109 | } 110 | splits { 111 | abi { 112 | reset() 113 | enable enableSeparateBuildPerCPUArchitecture 114 | universalApk false // If true, also generate a universal APK 115 | include "armeabi-v7a", "x86" 116 | } 117 | } 118 | buildTypes { 119 | release { 120 | minifyEnabled enableProguardInReleaseBuilds 121 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" 122 | } 123 | } 124 | // applicationVariants are e.g. debug, release 125 | applicationVariants.all { variant -> 126 | variant.outputs.each { output -> 127 | // For each separate APK per architecture, set a unique version code as described here: 128 | // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits 129 | def versionCodes = ["armeabi-v7a":1, "x86":2] 130 | def abi = output.getFilter(OutputFile.ABI) 131 | if (abi != null) { // null for the universal-debug, universal-release variants 132 | output.versionCodeOverride = 133 | versionCodes.get(abi) * 1048576 + defaultConfig.versionCode 134 | } 135 | } 136 | } 137 | } 138 | 139 | dependencies { 140 | compile fileTree(dir: "libs", include: ["*.jar"]) 141 | compile "com.android.support:appcompat-v7:23.0.1" 142 | compile "com.facebook.react:react-native:+" // From node_modules 143 | } 144 | 145 | // Run this once to be able to run the application with BUCK 146 | // puts all compile dependencies into folder libs for BUCK to use 147 | task copyDownloadableDepsToLibs(type: Copy) { 148 | from configurations.compile 149 | into 'libs' 150 | } 151 | -------------------------------------------------------------------------------- /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 | # TextLayoutBuilder uses a non-public Android constructor within StaticLayout. 54 | # See libs/proxy/src/main/java/com/facebook/fbui/textlayoutbuilder/proxy for details. 55 | -dontwarn android.text.StaticLayout 56 | 57 | # okhttp 58 | 59 | -keepattributes Signature 60 | -keepattributes *Annotation* 61 | -keep class okhttp3.** { *; } 62 | -keep interface okhttp3.** { *; } 63 | -dontwarn okhttp3.** 64 | 65 | # okio 66 | 67 | -keep class sun.misc.Unsafe { *; } 68 | -dontwarn java.nio.file.* 69 | -dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement 70 | -dontwarn okio.** 71 | -------------------------------------------------------------------------------- /Example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 12 | 13 | 19 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /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 | import com.facebook.soloader.SoLoader; 10 | 11 | import java.util.Arrays; 12 | import java.util.List; 13 | 14 | public class MainApplication extends Application implements ReactApplication { 15 | 16 | private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) { 17 | @Override 18 | public boolean getUseDeveloperSupport() { 19 | return BuildConfig.DEBUG; 20 | } 21 | 22 | @Override 23 | protected List getPackages() { 24 | return Arrays.asList( 25 | new MainReactPackage() 26 | ); 27 | } 28 | 29 | @Override 30 | protected String getJSMainModuleName() { 31 | return "index"; 32 | } 33 | }; 34 | 35 | @Override 36 | public ReactNativeHost getReactNativeHost() { 37 | return mReactNativeHost; 38 | } 39 | 40 | @Override 41 | public void onCreate() { 42 | super.onCreate(); 43 | SoLoader.init(this, /* native exopackage */ false); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ProvataHealth/react-native-smooth-swipe-list/aad034368f9ad5aaf3456d63bd395dd342fd25e1/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/ProvataHealth/react-native-smooth-swipe-list/aad034368f9ad5aaf3456d63bd395dd342fd25e1/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/ProvataHealth/react-native-smooth-swipe-list/aad034368f9ad5aaf3456d63bd395dd342fd25e1/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/ProvataHealth/react-native-smooth-swipe-list/aad034368f9ad5aaf3456d63bd395dd342fd25e1/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.2.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/ProvataHealth/react-native-smooth-swipe-list/aad034368f9ad5aaf3456d63bd395dd342fd25e1/Example/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /Example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip 6 | -------------------------------------------------------------------------------- /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 | properties = "debug.keystore.properties", 4 | store = "debug.keystore", 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 | -------------------------------------------------------------------------------- /Example/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "SmoothSwipeList", 3 | "displayName": "SmoothSwipeList" 4 | } -------------------------------------------------------------------------------- /Example/app/Main.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { View, StyleSheet } from 'react-native'; 3 | 4 | import { TodoScene } from './scenes'; 5 | 6 | const Main = () => ( 7 | 8 | 9 | 10 | ); 11 | 12 | 13 | const styles = StyleSheet.create({ 14 | container: { 15 | position: 'absolute', 16 | top: 0, 17 | right: 0, 18 | bottom: 0, 19 | left: 0, 20 | flexDirection: 'column', 21 | alignItems: 'center', 22 | justifyContent: 'flex-start', 23 | marginTop: 25 24 | } 25 | }); 26 | 27 | 28 | export default Main; -------------------------------------------------------------------------------- /Example/app/__tests__/index-test.js: -------------------------------------------------------------------------------- 1 | import 'react-native'; 2 | import React from 'react'; 3 | import Main from '../index'; 4 | 5 | // Note: test renderer must be required after react-native. 6 | import renderer from 'react-test-renderer'; 7 | 8 | it('renders Main correctly', () => { 9 | const tree = renderer.create( 10 |
11 | ); 12 | expect(tree).toMatchSnapshot(); 13 | }); 14 | -------------------------------------------------------------------------------- /Example/app/components/button/Button.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import PropTypes from 'prop-types'; 3 | import { View, StyleSheet, Text, TouchableHighlight } from 'react-native'; 4 | 5 | import { 6 | color 7 | } from '../../constants' 8 | 9 | const Button = (props) => ( 10 | 13 | 14 | {props.children} 15 | 16 | 17 | ); 18 | 19 | Button.propTypes = {}; 20 | 21 | Button.displayName = 'Button'; 22 | 23 | const styles = StyleSheet.create({ 24 | container: { 25 | width: 200, 26 | height: 50, 27 | backgroundColor: color.PRIMARY, 28 | alignItems: 'center', 29 | justifyContent: 'center', 30 | borderRadius: 5 31 | }, 32 | text: { 33 | color: color.LIGHT, 34 | fontSize: 18 35 | } 36 | }); 37 | 38 | 39 | export default Button; -------------------------------------------------------------------------------- /Example/app/components/index.js: -------------------------------------------------------------------------------- 1 | export { default as ListItem } from './list/ListItem'; 2 | export { default as ListItemButton } from './list/ListItemButton'; 3 | export { default as FullWidthSubItem } from './list/FullWidthSubItem'; 4 | 5 | export { default as Button } from './button/Button'; -------------------------------------------------------------------------------- /Example/app/components/list/FullWidthSubItem.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import PropTypes from 'prop-types'; 3 | import { StyleSheet, View, ViewPropTypes } from 'react-native'; 4 | 5 | 6 | const FullWidthSubItem = ({ style, children }) => ( 7 | 8 | {children} 9 | 10 | ); 11 | 12 | FullWidthSubItem.propTypes = { style: ViewPropTypes.style }; 13 | 14 | FullWidthSubItem.displayName = "FullWidthSubItem"; 15 | 16 | const styles = StyleSheet.create({ 17 | container: { 18 | flex: 1, 19 | alignSelf: 'stretch', 20 | justifyContent: 'center', 21 | alignItems: 'center', 22 | flexDirection: 'row' 23 | } 24 | }); 25 | 26 | 27 | export default FullWidthSubItem; -------------------------------------------------------------------------------- /Example/app/components/list/ListItem.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import PropTypes from 'prop-types'; 3 | import { View, StyleSheet, Text, TouchableHighlight } from 'react-native'; 4 | 5 | import { 6 | layout 7 | } from '../../constants'; 8 | 9 | 10 | const ListItem = (props) => ( 11 | 12 | 13 | 14 | {props.title} 15 | 16 | {props.children} 17 | 18 | 19 | ); 20 | 21 | ListItem.propTypes = {}; 22 | 23 | ListItem.displayName = 'ListItem'; 24 | 25 | const styles = StyleSheet.create({ 26 | container: { 27 | alignSelf: 'stretch', 28 | paddingHorizontal: 25, 29 | justifyContent: 'center', 30 | height: layout.LIST_ITEM_HEIGHT, 31 | backgroundColor: '#fff', 32 | borderBottomColor: '#eee', 33 | borderBottomWidth: 1 34 | }, 35 | text: { 36 | color: '#444' 37 | } 38 | }); 39 | 40 | 41 | export default ListItem; -------------------------------------------------------------------------------- /Example/app/components/list/ListItemButton.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import PropTypes from 'prop-types'; 3 | import { StyleSheet, View, Text, TouchableOpacity } from 'react-native'; 4 | 5 | import { color } from '../../constants'; 6 | 7 | 8 | const ListItemButton = (props) => ( 9 | 10 | 11 | 12 | {props.text} 13 | 14 | 15 | 16 | ); 17 | 18 | function getBackgroundStyle(props) { 19 | let backgroundColor = props.open ? 'rgb(200, 0, 100)' : color[props.color]; 20 | return color ? { backgroundColor } : {}; 21 | } 22 | 23 | ListItemButton.propTypes = { 24 | onPress: PropTypes.func 25 | }; 26 | 27 | ListItemButton.displayName = 'ListItemButton'; 28 | 29 | const styles = StyleSheet.create({ 30 | container: { 31 | flex: 1, 32 | paddingHorizontal: 10, 33 | backgroundColor: 'rgb(55, 210, 240)', 34 | alignItems: 'center', 35 | justifyContent: 'center', 36 | alignSelf: 'stretch' 37 | }, 38 | text: { 39 | color: color.LIGHT 40 | } 41 | }); 42 | 43 | 44 | export default ListItemButton; -------------------------------------------------------------------------------- /Example/app/components/list/ProgressListItem.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import createReactClass from 'create-react-class'; 3 | import PropTypes from 'prop-types'; 4 | import { View, StyleSheet, Animated } from 'react-native'; 5 | import ListItem from './ListItem'; 6 | import { 7 | ANIMATION_EASING_DEFAULT 8 | } from '../../constants/animation'; 9 | 10 | 11 | const styles = StyleSheet.create({ 12 | progressContainer: { 13 | marginTop: 5, 14 | backgroundColor: '#c2c3cc' 15 | }, 16 | progressBar: { 17 | width: '100%', 18 | height: 8, 19 | backgroundColor: '#62c1ff' 20 | } 21 | }); 22 | 23 | 24 | const ProgressListItem = createReactClass({ 25 | displayName: 'ProgressListItem', 26 | propTypes: { 27 | ...ListItem.propTypes, 28 | progress: PropTypes.number // between 0 and 1 29 | }, 30 | 31 | getDefaultProps() { 32 | return { 33 | progress: 0, 34 | openRow: PropTypes.func.isRequired 35 | }; 36 | }, 37 | 38 | getInitialState() { 39 | return { 40 | progressAnim: new Animated.Value(0) 41 | } 42 | }, 43 | 44 | componentDidMount() { 45 | if (this.props.progress) { 46 | this.animateProgressBar(this.props.progress); 47 | } 48 | }, 49 | 50 | componentWillReceiveProps(nextProps) { 51 | if (nextProps.progress !== this.props.progress) { 52 | this.animateProgressBar(nextProps.progress); 53 | } 54 | }, 55 | 56 | animateProgressBar(toValue) { 57 | return Animated.timing( 58 | this.state.progressAnim, 59 | { 60 | toValue, 61 | duration: 2000, 62 | easing: ANIMATION_EASING_DEFAULT 63 | } 64 | ).start(); 65 | }, 66 | 67 | openRow() { 68 | this.props.openRow('right'); 69 | }, 70 | 71 | render() { 72 | let { progress, ...listItemProps } = this.props; 73 | return ( 74 | 75 | 76 | {this.renderProgressBar()} 77 | 78 | 79 | ) 80 | }, 81 | 82 | renderProgressBar() { 83 | let progressStyle = { 84 | width: this.state.progressAnim.interpolate({ 85 | inputRange: [0, 1], 86 | outputRange: ['0%', '100%'] 87 | }) 88 | }; 89 | return ( 90 | 91 | ); 92 | } 93 | }); 94 | 95 | 96 | export default ProgressListItem; -------------------------------------------------------------------------------- /Example/app/constants/animation.js: -------------------------------------------------------------------------------- 1 | import { Easing } from 'react-native'; 2 | 3 | export const ANIMATION_SPEED_DEFAULT = 500; 4 | export const ANIMATION_EASING_DEFAULT = Easing.inOut(Easing.cubic); 5 | 6 | export default { 7 | ANIMATION_SPEED_DEFAULT, 8 | ANIMATION_EASING_DEFAULT 9 | }; -------------------------------------------------------------------------------- /Example/app/constants/color.js: -------------------------------------------------------------------------------- 1 | 2 | export const PRIMARY = 'rgb(44, 217, 222)'; 3 | export const SECONDARY = 'rgb(139, 219, 193)'; 4 | export const WHITE = 'rgb(250, 250, 250)'; 5 | export const LIGHT = 'rgb(247, 247, 247)'; 6 | export const MID = 'rgb(215, 215, 215)'; 7 | export const DARK = 'rgb(60, 60, 60)'; 8 | 9 | export const RED = 'rgb(225, 20, 100)'; 10 | 11 | export default { 12 | PRIMARY, 13 | SECONDARY, 14 | WHITE, 15 | LIGHT, 16 | MID, 17 | DARK, 18 | RED 19 | } -------------------------------------------------------------------------------- /Example/app/constants/index.js: -------------------------------------------------------------------------------- 1 | export { default as animation } from './animation'; 2 | export { default as color } from './color'; 3 | export { default as layout } from './layout'; -------------------------------------------------------------------------------- /Example/app/constants/layout.js: -------------------------------------------------------------------------------- 1 | import { Dimensions } from 'react-native'; 2 | 3 | export const SCREEN_WIDTH = Dimensions.get('window').width; 4 | export const SCREEN_HEIGHT = Dimensions.get('window').height; 5 | 6 | export const LIST_ITEM_HEIGHT = 55; 7 | 8 | export default { 9 | SCREEN_WIDTH, 10 | SCREEN_HEIGHT, 11 | LIST_ITEM_HEIGHT 12 | }; -------------------------------------------------------------------------------- /Example/app/index.js: -------------------------------------------------------------------------------- 1 | import Main from './Main'; 2 | 3 | export default Main; -------------------------------------------------------------------------------- /Example/app/models/Todo.js: -------------------------------------------------------------------------------- 1 | import Immutable from 'immutable'; 2 | 3 | 4 | class Todo { 5 | 6 | constructor(data) { 7 | this.data = data instanceof Immutable.Map ? data : new Immutable.Map(data); 8 | } 9 | 10 | getId() { 11 | return this.data.get('id'); 12 | } 13 | 14 | getTitle() { 15 | return this.data.get('title'); 16 | } 17 | 18 | getDescription() { 19 | return this.data.get('description'); 20 | } 21 | 22 | isComplete() { 23 | return this.data.get('complete'); 24 | } 25 | 26 | isArchived() { 27 | return this.data.get('archived'); 28 | } 29 | 30 | setComplete(complete) { 31 | return new Todo(this.data.set('complete', complete)); 32 | } 33 | 34 | setArchived(archived) { 35 | return new Todo(this.data.set('archived', archived)); 36 | } 37 | 38 | getProgress() { 39 | return this.isComplete() ? 1 : this.data.get('progress'); 40 | } 41 | } 42 | 43 | 44 | export default Todo; -------------------------------------------------------------------------------- /Example/app/models/TodoCollection.js: -------------------------------------------------------------------------------- 1 | import Immutable from 'immutable'; 2 | import Todo from './Todo'; 3 | import find from 'lodash/find'; 4 | import findIndex from 'lodash/findIndex'; 5 | import filter from 'lodash/filter'; 6 | 7 | class TodoCollection { 8 | 9 | constructor(items = []) { 10 | if (items instanceof Immutable.List) { 11 | this.items = items; 12 | } 13 | else { 14 | this.items = new Immutable.fromJS(items.map(this._wrapItemWithTodo)); 15 | } 16 | this.length = this.items.size; 17 | for (let i = 0; i < this.length; i++) { 18 | this[i] = this.items.get(i); 19 | } 20 | } 21 | 22 | get(index) { 23 | return this.items.get(index); 24 | } 25 | 26 | getById(id) { 27 | return find(this.items.toArray(), item => item.get() === id); 28 | } 29 | 30 | putById(id, item) { 31 | if (!item) { 32 | return this; 33 | } 34 | let index = findIndex(this.items.toArray(), (item) => { 35 | return item.getId() === id; 36 | }); 37 | item = (item instanceof Todo) ? item : this._wrapItemWithTodo(item); 38 | return index >= 0 ? this.set(index, item) : this.push(item); 39 | } 40 | 41 | set(index, item) { 42 | if (!item) { 43 | return this; 44 | } 45 | if (item instanceof Todo) { 46 | return new TodoCollection(this.items.set(index, item)); 47 | } 48 | return new TodoCollection(this.items.set(index, this._wrapItemWithTodo(item))); 49 | } 50 | 51 | filterComplete() { 52 | let items = filter(this.items.toArray(),(item) => item.complete) || []; 53 | return new TodoCollection(items); 54 | } 55 | 56 | filterIncomplete() { 57 | let items = filter(this.items.toArray(),(item) => !item.complete) || []; 58 | return new TodoCollection(items); 59 | } 60 | 61 | filterArchived() { 62 | let items = filter(this.items.toArray(),(item) => item.archived) || []; 63 | return new TodoCollection(items); 64 | } 65 | 66 | filterBy(predicate) { 67 | let items = filter(this.items.toArray(), predicate); 68 | if (items) { 69 | new TodoCollection(items); 70 | } 71 | return this; 72 | } 73 | 74 | delete(index) { 75 | return this.deleteBy((item, i) => { 76 | return i === index; 77 | }); 78 | } 79 | 80 | deleteBy(predicate) { 81 | let index = findIndex(this.items.toArray(), predicate); 82 | if (index) { 83 | return new TodoCollection(this.items.delete(index)); 84 | } 85 | 86 | return this; 87 | } 88 | 89 | pop() { 90 | return new TodoCollection(this.items.pop()); 91 | } 92 | 93 | push(item) { 94 | if (!item) { 95 | return this; 96 | } 97 | if (item instanceof Todo) { 98 | return new TodoCollection(this.items.push(item)); 99 | } 100 | return new TodoCollection(this.items.push(this._wrapItemWithTodo(item))); 101 | } 102 | 103 | unshift(item) { 104 | if (!item) { 105 | return this; 106 | } 107 | if (item instanceof Todo) { 108 | return new TodoCollection(this.items.unshift(item)); 109 | } 110 | return new TodoCollection(this.items.unshift(this._wrapItemWithTodo(item))); 111 | } 112 | 113 | _wrapItemWithTodo(item) { 114 | return new Todo(item); 115 | } 116 | 117 | } 118 | 119 | 120 | export default TodoCollection; -------------------------------------------------------------------------------- /Example/app/models/index.js: -------------------------------------------------------------------------------- 1 | export { default as Todo } from './Todo'; 2 | export { default as TodoCollection } from './TodoCollection'; -------------------------------------------------------------------------------- /Example/app/scenes/index.js: -------------------------------------------------------------------------------- 1 | export { default as TodoScene } from './todo/TodoScene'; -------------------------------------------------------------------------------- /Example/app/scenes/todo/TodoScene.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import createReactClass from 'create-react-class'; 3 | import { View, Text, StyleSheet, TouchableHighlight } from 'react-native'; 4 | import times from 'lodash/times'; 5 | 6 | import { Todo, TodoCollection } from '../../models'; 7 | import { TodoSwipeList, TodoDetails } from './components' 8 | 9 | const INITIAL_TODO_COUNT = 10; 10 | const TITLES = ['Sleep', 'Write Code', 'Eat']; 11 | const INITIAL_TODOS = times(INITIAL_TODO_COUNT, (i) => { 12 | return { 13 | id: i + 1, 14 | title: TITLES[(i + 1) % 3], 15 | completed: false, 16 | archived: false, 17 | progress: Math.random() 18 | }; 19 | }); 20 | 21 | const TodoScene = createReactClass({ 22 | 23 | getInitialState() { 24 | // using this component's state as a store for simplicity sake 25 | return { 26 | activeTodo: null, 27 | todoCount: INITIAL_TODO_COUNT, 28 | todos: new TodoCollection(INITIAL_TODOS) 29 | }; 30 | }, 31 | 32 | archiveTodo(todo) { 33 | let updatedTodo = todo.setArchived(true); 34 | this.setState({ 35 | todos: this.state.todos.putById(updatedTodo.getId(), updatedTodo) 36 | }); 37 | }, 38 | 39 | toggleTodoComplete(todo) { 40 | let updatedTodo = todo.setComplete(!todo.isComplete()); 41 | this.setState({ 42 | todos: this.state.todos.putById(updatedTodo.getId(), updatedTodo) 43 | }); 44 | this.tryCloseSwipeRow(); 45 | }, 46 | 47 | addTodo() { 48 | let count = this.state.todoCount + 1; 49 | this.setState({ 50 | todoCount: count, 51 | todos: this.state.todos.unshift({ 52 | id: count, 53 | title: 'A New Todo', 54 | complete: false, 55 | archived: false 56 | }) 57 | }); 58 | this.tryCloseSwipeRow(); 59 | }, 60 | 61 | tryCloseSwipeRow() { 62 | this.swipeList && this.swipeList.tryCloseOpenRow(); 63 | }, 64 | 65 | setSwipeListRef(component) { 66 | this.swipeList = component; 67 | }, 68 | 69 | render() { 70 | return ( 71 | 72 | 73 | Swipe List Example 74 | 75 | {this.renderActiveView()} 76 | 77 | ); 78 | }, 79 | 80 | renderActiveView() { 81 | if (this.state.activeTodo) { 82 | return ; 83 | } 84 | return ( 85 | 90 | ); 91 | } 92 | }); 93 | 94 | const styles = StyleSheet.create({ 95 | container: { 96 | position: 'absolute', 97 | top: 0, 98 | right: 0, 99 | bottom: 0, 100 | left: 0, 101 | flexDirection: 'column', 102 | alignItems: 'center', 103 | justifyContent: 'flex-start' 104 | }, 105 | header: { 106 | fontSize: 18, 107 | fontWeight: 'bold', 108 | marginBottom: 15 109 | } 110 | }); 111 | 112 | 113 | export default TodoScene; -------------------------------------------------------------------------------- /Example/app/scenes/todo/components/TodoDetails.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import createReactClass from 'create-react-class'; 3 | import PropTypes from 'prop-types'; 4 | import { View, Text } from 'react-native'; 5 | 6 | 7 | const TodoDetails = createReactClass({ 8 | 9 | propTypes: {}, 10 | 11 | render() { 12 | return ( 13 | 14 | 15 | Todo Details 16 | 17 | 18 | ); 19 | } 20 | }); 21 | 22 | 23 | export default TodoDetails; -------------------------------------------------------------------------------- /Example/app/scenes/todo/components/TodoSubItem.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import createReactClass from 'create-react-class'; 3 | import PropTypes from 'prop-types'; 4 | import { StyleSheet, View, Text, TouchableOpacity } from 'react-native'; 5 | 6 | import { FullWidthSubItem } from '../../../components'; 7 | 8 | const TodoSubItem = createReactClass({ 9 | 10 | onItemPress() { 11 | console.log('item pressed'); 12 | }, 13 | 14 | render() { 15 | return ( 16 | 17 | 18 | 19 | ); 20 | }, 21 | 22 | renderItems() { 23 | return ['Step One', 'Step Two', 'Step Three'].map((item) => { 24 | return ( 25 | this.onItemPress(item)}> 26 | 27 | 28 | {item} 29 | 30 | 31 | 32 | ); 33 | }); 34 | } 35 | }); 36 | 37 | const styles = StyleSheet.create({ 38 | container: { 39 | justifyContent: 'space-around', 40 | flexDirection: 'row' 41 | }, 42 | item: { 43 | flex: 1, 44 | alignSelf: 'stretch', 45 | marginHorizontal: 5, 46 | alignItems: 'center', 47 | justifyContent: 'center' 48 | } 49 | }); 50 | 51 | export default TodoSubItem; -------------------------------------------------------------------------------- /Example/app/scenes/todo/components/TodoSwipeList.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import createReactClass from 'create-react-class'; 3 | import PropTypes from 'prop-types'; 4 | import { View, Text, StyleSheet, TouchableHighlight } from 'react-native'; 5 | 6 | import map from 'lodash/map'; 7 | import find from 'lodash/find'; 8 | import reduce from 'lodash/reduce'; 9 | 10 | import { TodoCollection } from '../../../models'; 11 | import { color } from '../../../constants'; 12 | import { ListItem, ListItemButton } from '../../../components'; 13 | //import TodoSubItem from './TodoSubItem'; 14 | import SwipeList from 'react-native-smooth-swipe-list'; 15 | import ProgressListItem from '../../../components/list/ProgressListItem'; 16 | 17 | 18 | const TodoSwipeList = createReactClass({ 19 | 20 | propTypes: { 21 | todos: PropTypes.instanceOf(TodoCollection).isRequired, 22 | toggleTodoComplete: PropTypes.func.isRequired, 23 | archiveTodo: PropTypes.func.isRequired, 24 | addTodo: PropTypes.func.isRequired 25 | }, 26 | 27 | componentWillMount() { 28 | this.rowData = map(this.props.todos, this.constructRowData); 29 | }, 30 | 31 | componentDidMount() { 32 | // open the row on the left, then the right 33 | this.callOutRowSwipe(); 34 | }, 35 | 36 | callOutRowSwipe() { 37 | Promise.resolve() 38 | .then(() => this.swipeList.calloutRow(3, 100)) 39 | .then(() => this.swipeList.calloutRow(3, -100)); 40 | }, 41 | 42 | componentWillReceiveProps(nextProps) { 43 | if (this.props.todos !== nextProps.todos) { 44 | this.rowData = reduce(nextProps.todos, (newRowData, todo, i) => { 45 | if (todo.isArchived()) { 46 | return newRowData; 47 | } 48 | else if (todo !== this.props.todos.get(i)) { 49 | return newRowData.concat([this.constructRowData(todo)]); 50 | } 51 | return newRowData.concat([find(this.rowData, data => data.id === todo.getId())]); 52 | }, []); 53 | } 54 | }, 55 | 56 | constructRowData(todo) { 57 | return { 58 | id: todo.getId(), 59 | rowView: this.getRowView(todo), 60 | rightSubView: this.getToggleButton(todo), 61 | leftSubView: this.getArchiveButton(todo), 62 | leftSubViewOptions: { 63 | closeOnPress: false 64 | } 65 | 66 | }; 67 | }, 68 | 69 | tryCloseOpenRow() { 70 | this.swipeList && this.swipeList.tryCloseOpenRow(); 71 | }, 72 | 73 | setSwipeListRef(component) { 74 | this.swipeList = component; 75 | }, 76 | 77 | render() { 78 | return ( 79 | 80 | {this.renderAddButton()} 81 | 85 | 86 | ); 87 | }, 88 | 89 | renderAddButton() { 90 | return ( 91 | 95 | ); 96 | }, 97 | 98 | getRowView(todo) { 99 | let title = todo.getTitle(); 100 | return ; 101 | }, 102 | 103 | getToggleButton(todo) { 104 | let text = todo.isComplete() ? 'Undo' : 'Complete'; 105 | return ( 106 | this.props.toggleTodoComplete(todo)} 107 | text={text} 108 | color="PRIMARY" /> 109 | ); 110 | }, 111 | 112 | getArchiveButton(todo) { 113 | return ( 114 | this.props.archiveTodo(todo)} 115 | text="Archive" 116 | color="RED" /> 117 | ); 118 | } 119 | }); 120 | 121 | const styles = StyleSheet.create({ 122 | swipeListContainer: { 123 | flex: 1, 124 | alignSelf: 'stretch' 125 | }, 126 | list: { 127 | backgroundColor: color.LIGHT 128 | }, 129 | addButton: { 130 | padding: 15, 131 | backgroundColor: 'white', 132 | alignItems: 'center' 133 | }, 134 | addButtonText: { 135 | 136 | }, 137 | row: { 138 | alignSelf: 'stretch', 139 | height: 55, 140 | backgroundColor: '#eee' 141 | }, 142 | fullSubView: { 143 | flex: 1, 144 | alignSelf: 'stretch', 145 | alignItems: 'center', 146 | justifyContent: 'center', 147 | backgroundColor: 'rgb(50, 175, 175)' 148 | }, 149 | buttonText: { 150 | color: '#fff', 151 | backgroundColor: 'transparent' 152 | } 153 | }); 154 | 155 | 156 | export default TodoSwipeList; -------------------------------------------------------------------------------- /Example/app/scenes/todo/components/index.js: -------------------------------------------------------------------------------- 1 | export { default as TodoSwipeList } from './TodoSwipeList'; 2 | export { default as TodoSubItem } from './TodoSubItem'; 3 | export { default as TodoDetails } from './TodoDetails'; -------------------------------------------------------------------------------- /Example/assets/capture.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ProvataHealth/react-native-smooth-swipe-list/aad034368f9ad5aaf3456d63bd395dd342fd25e1/Example/assets/capture.gif -------------------------------------------------------------------------------- /Example/index.js: -------------------------------------------------------------------------------- 1 | import { AppRegistry } from 'react-native'; 2 | import Main from './app/Main'; 3 | 4 | AppRegistry.registerComponent('Example', () => Main); 5 | -------------------------------------------------------------------------------- /Example/ios/Example-tvOS/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 | NSExceptionAllowsInsecureHTTPLoads 49 | 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /Example/ios/Example-tvOSTests/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/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 | 2D02E4BC1E0B4A80006451C7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; }; 26 | 2D02E4BD1E0B4A84006451C7 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 27 | 2D02E4BF1E0B4AB3006451C7 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; 28 | 2D02E4C21E0B4AEC006451C7 /* libRCTAnimation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5E9157351DD0AC6500FF2AA8 /* libRCTAnimation.a */; }; 29 | 2D02E4C31E0B4AEC006451C7 /* libRCTImage-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3E841DF850E9000B6D8A /* libRCTImage-tvOS.a */; }; 30 | 2D02E4C41E0B4AEC006451C7 /* libRCTLinking-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3E881DF850E9000B6D8A /* libRCTLinking-tvOS.a */; }; 31 | 2D02E4C51E0B4AEC006451C7 /* libRCTNetwork-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3E8C1DF850E9000B6D8A /* libRCTNetwork-tvOS.a */; }; 32 | 2D02E4C61E0B4AEC006451C7 /* libRCTSettings-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3E901DF850E9000B6D8A /* libRCTSettings-tvOS.a */; }; 33 | 2D02E4C71E0B4AEC006451C7 /* libRCTText-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3E941DF850E9000B6D8A /* libRCTText-tvOS.a */; }; 34 | 2D02E4C81E0B4AEC006451C7 /* libRCTWebSocket-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3E991DF850E9000B6D8A /* libRCTWebSocket-tvOS.a */; }; 35 | 2D16E6881FA4F8E400B85C8A /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2D16E6891FA4F8E400B85C8A /* libReact.a */; }; 36 | 2DCD954D1E0B4F2C00145EB5 /* ExampleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* ExampleTests.m */; }; 37 | 5E9157361DD0AC6A00FF2AA8 /* libRCTAnimation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5E9157331DD0AC6500FF2AA8 /* libRCTAnimation.a */; }; 38 | 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; }; 39 | ADBDB9381DFEBF1600ED6528 /* libRCTBlob.a in Frameworks */ = {isa = PBXBuildFile; fileRef = ADBDB9271DFEBF0700ED6528 /* libRCTBlob.a */; }; 40 | /* End PBXBuildFile section */ 41 | 42 | /* Begin PBXContainerItemProxy section */ 43 | 00C302AB1ABCB8CE00DB3ED1 /* PBXContainerItemProxy */ = { 44 | isa = PBXContainerItemProxy; 45 | containerPortal = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */; 46 | proxyType = 2; 47 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 48 | remoteInfo = RCTActionSheet; 49 | }; 50 | 00C302B91ABCB90400DB3ED1 /* PBXContainerItemProxy */ = { 51 | isa = PBXContainerItemProxy; 52 | containerPortal = 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */; 53 | proxyType = 2; 54 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 55 | remoteInfo = RCTGeolocation; 56 | }; 57 | 00C302BF1ABCB91800DB3ED1 /* PBXContainerItemProxy */ = { 58 | isa = PBXContainerItemProxy; 59 | containerPortal = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */; 60 | proxyType = 2; 61 | remoteGlobalIDString = 58B5115D1A9E6B3D00147676; 62 | remoteInfo = RCTImage; 63 | }; 64 | 00C302DB1ABCB9D200DB3ED1 /* PBXContainerItemProxy */ = { 65 | isa = PBXContainerItemProxy; 66 | containerPortal = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */; 67 | proxyType = 2; 68 | remoteGlobalIDString = 58B511DB1A9E6C8500147676; 69 | remoteInfo = RCTNetwork; 70 | }; 71 | 00C302E31ABCB9EE00DB3ED1 /* PBXContainerItemProxy */ = { 72 | isa = PBXContainerItemProxy; 73 | containerPortal = 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */; 74 | proxyType = 2; 75 | remoteGlobalIDString = 832C81801AAF6DEF007FA2F7; 76 | remoteInfo = RCTVibration; 77 | }; 78 | 00E356F41AD99517003FC87E /* PBXContainerItemProxy */ = { 79 | isa = PBXContainerItemProxy; 80 | containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */; 81 | proxyType = 1; 82 | remoteGlobalIDString = 13B07F861A680F5B00A75B9A; 83 | remoteInfo = Example; 84 | }; 85 | 139105C01AF99BAD00B5F7CC /* PBXContainerItemProxy */ = { 86 | isa = PBXContainerItemProxy; 87 | containerPortal = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */; 88 | proxyType = 2; 89 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 90 | remoteInfo = RCTSettings; 91 | }; 92 | 139FDEF31B06529B00C62182 /* PBXContainerItemProxy */ = { 93 | isa = PBXContainerItemProxy; 94 | containerPortal = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */; 95 | proxyType = 2; 96 | remoteGlobalIDString = 3C86DF461ADF2C930047B81A; 97 | remoteInfo = RCTWebSocket; 98 | }; 99 | 146834031AC3E56700842450 /* PBXContainerItemProxy */ = { 100 | isa = PBXContainerItemProxy; 101 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 102 | proxyType = 2; 103 | remoteGlobalIDString = 83CBBA2E1A601D0E00E9B192; 104 | remoteInfo = React; 105 | }; 106 | 2D02E4911E0B4A5D006451C7 /* PBXContainerItemProxy */ = { 107 | isa = PBXContainerItemProxy; 108 | containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */; 109 | proxyType = 1; 110 | remoteGlobalIDString = 2D02E47A1E0B4A5D006451C7; 111 | remoteInfo = "Example-tvOS"; 112 | }; 113 | 2D16E6711FA4F8DC00B85C8A /* PBXContainerItemProxy */ = { 114 | isa = PBXContainerItemProxy; 115 | containerPortal = ADBDB91F1DFEBF0600ED6528 /* RCTBlob.xcodeproj */; 116 | proxyType = 2; 117 | remoteGlobalIDString = ADD01A681E09402E00F6D226; 118 | remoteInfo = "RCTBlob-tvOS"; 119 | }; 120 | 2D16E6831FA4F8DC00B85C8A /* PBXContainerItemProxy */ = { 121 | isa = PBXContainerItemProxy; 122 | containerPortal = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */; 123 | proxyType = 2; 124 | remoteGlobalIDString = 3DBE0D001F3B181A0099AA32; 125 | remoteInfo = fishhook; 126 | }; 127 | 2D16E6851FA4F8DC00B85C8A /* PBXContainerItemProxy */ = { 128 | isa = PBXContainerItemProxy; 129 | containerPortal = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */; 130 | proxyType = 2; 131 | remoteGlobalIDString = 3DBE0D0D1F3B181C0099AA32; 132 | remoteInfo = "fishhook-tvOS"; 133 | }; 134 | 3DAD3E831DF850E9000B6D8A /* PBXContainerItemProxy */ = { 135 | isa = PBXContainerItemProxy; 136 | containerPortal = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */; 137 | proxyType = 2; 138 | remoteGlobalIDString = 2D2A283A1D9B042B00D4039D; 139 | remoteInfo = "RCTImage-tvOS"; 140 | }; 141 | 3DAD3E871DF850E9000B6D8A /* PBXContainerItemProxy */ = { 142 | isa = PBXContainerItemProxy; 143 | containerPortal = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */; 144 | proxyType = 2; 145 | remoteGlobalIDString = 2D2A28471D9B043800D4039D; 146 | remoteInfo = "RCTLinking-tvOS"; 147 | }; 148 | 3DAD3E8B1DF850E9000B6D8A /* PBXContainerItemProxy */ = { 149 | isa = PBXContainerItemProxy; 150 | containerPortal = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */; 151 | proxyType = 2; 152 | remoteGlobalIDString = 2D2A28541D9B044C00D4039D; 153 | remoteInfo = "RCTNetwork-tvOS"; 154 | }; 155 | 3DAD3E8F1DF850E9000B6D8A /* PBXContainerItemProxy */ = { 156 | isa = PBXContainerItemProxy; 157 | containerPortal = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */; 158 | proxyType = 2; 159 | remoteGlobalIDString = 2D2A28611D9B046600D4039D; 160 | remoteInfo = "RCTSettings-tvOS"; 161 | }; 162 | 3DAD3E931DF850E9000B6D8A /* PBXContainerItemProxy */ = { 163 | isa = PBXContainerItemProxy; 164 | containerPortal = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */; 165 | proxyType = 2; 166 | remoteGlobalIDString = 2D2A287B1D9B048500D4039D; 167 | remoteInfo = "RCTText-tvOS"; 168 | }; 169 | 3DAD3E981DF850E9000B6D8A /* PBXContainerItemProxy */ = { 170 | isa = PBXContainerItemProxy; 171 | containerPortal = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */; 172 | proxyType = 2; 173 | remoteGlobalIDString = 2D2A28881D9B049200D4039D; 174 | remoteInfo = "RCTWebSocket-tvOS"; 175 | }; 176 | 3DAD3EA21DF850E9000B6D8A /* PBXContainerItemProxy */ = { 177 | isa = PBXContainerItemProxy; 178 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 179 | proxyType = 2; 180 | remoteGlobalIDString = 2D2A28131D9B038B00D4039D; 181 | remoteInfo = "React-tvOS"; 182 | }; 183 | 3DAD3EA41DF850E9000B6D8A /* PBXContainerItemProxy */ = { 184 | isa = PBXContainerItemProxy; 185 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 186 | proxyType = 2; 187 | remoteGlobalIDString = 3D3C059A1DE3340900C268FA; 188 | remoteInfo = yoga; 189 | }; 190 | 3DAD3EA61DF850E9000B6D8A /* PBXContainerItemProxy */ = { 191 | isa = PBXContainerItemProxy; 192 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 193 | proxyType = 2; 194 | remoteGlobalIDString = 3D3C06751DE3340C00C268FA; 195 | remoteInfo = "yoga-tvOS"; 196 | }; 197 | 3DAD3EA81DF850E9000B6D8A /* PBXContainerItemProxy */ = { 198 | isa = PBXContainerItemProxy; 199 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 200 | proxyType = 2; 201 | remoteGlobalIDString = 3D3CD9251DE5FBEC00167DC4; 202 | remoteInfo = cxxreact; 203 | }; 204 | 3DAD3EAA1DF850E9000B6D8A /* PBXContainerItemProxy */ = { 205 | isa = PBXContainerItemProxy; 206 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 207 | proxyType = 2; 208 | remoteGlobalIDString = 3D3CD9321DE5FBEE00167DC4; 209 | remoteInfo = "cxxreact-tvOS"; 210 | }; 211 | 3DAD3EAC1DF850E9000B6D8A /* PBXContainerItemProxy */ = { 212 | isa = PBXContainerItemProxy; 213 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 214 | proxyType = 2; 215 | remoteGlobalIDString = 3D3CD90B1DE5FBD600167DC4; 216 | remoteInfo = jschelpers; 217 | }; 218 | 3DAD3EAE1DF850E9000B6D8A /* PBXContainerItemProxy */ = { 219 | isa = PBXContainerItemProxy; 220 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 221 | proxyType = 2; 222 | remoteGlobalIDString = 3D3CD9181DE5FBD800167DC4; 223 | remoteInfo = "jschelpers-tvOS"; 224 | }; 225 | 5E9157321DD0AC6500FF2AA8 /* PBXContainerItemProxy */ = { 226 | isa = PBXContainerItemProxy; 227 | containerPortal = 5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */; 228 | proxyType = 2; 229 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 230 | remoteInfo = RCTAnimation; 231 | }; 232 | 5E9157341DD0AC6500FF2AA8 /* PBXContainerItemProxy */ = { 233 | isa = PBXContainerItemProxy; 234 | containerPortal = 5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */; 235 | proxyType = 2; 236 | remoteGlobalIDString = 2D2A28201D9B03D100D4039D; 237 | remoteInfo = "RCTAnimation-tvOS"; 238 | }; 239 | 78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */ = { 240 | isa = PBXContainerItemProxy; 241 | containerPortal = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */; 242 | proxyType = 2; 243 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 244 | remoteInfo = RCTLinking; 245 | }; 246 | 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */ = { 247 | isa = PBXContainerItemProxy; 248 | containerPortal = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */; 249 | proxyType = 2; 250 | remoteGlobalIDString = 58B5119B1A9E6C1200147676; 251 | remoteInfo = RCTText; 252 | }; 253 | ADBDB9261DFEBF0700ED6528 /* PBXContainerItemProxy */ = { 254 | isa = PBXContainerItemProxy; 255 | containerPortal = ADBDB91F1DFEBF0600ED6528 /* RCTBlob.xcodeproj */; 256 | proxyType = 2; 257 | remoteGlobalIDString = 358F4ED71D1E81A9004DF814; 258 | remoteInfo = RCTBlob; 259 | }; 260 | /* End PBXContainerItemProxy section */ 261 | 262 | /* Begin PBXFileReference section */ 263 | 008F07F21AC5B25A0029DE68 /* main.jsbundle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = main.jsbundle; sourceTree = ""; }; 264 | 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTActionSheet.xcodeproj; path = "../node_modules/react-native/Libraries/ActionSheetIOS/RCTActionSheet.xcodeproj"; sourceTree = ""; }; 265 | 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTGeolocation.xcodeproj; path = "../node_modules/react-native/Libraries/Geolocation/RCTGeolocation.xcodeproj"; sourceTree = ""; }; 266 | 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTImage.xcodeproj; path = "../node_modules/react-native/Libraries/Image/RCTImage.xcodeproj"; sourceTree = ""; }; 267 | 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTNetwork.xcodeproj; path = "../node_modules/react-native/Libraries/Network/RCTNetwork.xcodeproj"; sourceTree = ""; }; 268 | 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTVibration.xcodeproj; path = "../node_modules/react-native/Libraries/Vibration/RCTVibration.xcodeproj"; sourceTree = ""; }; 269 | 00E356EE1AD99517003FC87E /* ExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 270 | 00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 271 | 00E356F21AD99517003FC87E /* ExampleTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ExampleTests.m; sourceTree = ""; }; 272 | 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTSettings.xcodeproj; path = "../node_modules/react-native/Libraries/Settings/RCTSettings.xcodeproj"; sourceTree = ""; }; 273 | 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTWebSocket.xcodeproj; path = "../node_modules/react-native/Libraries/WebSocket/RCTWebSocket.xcodeproj"; sourceTree = ""; }; 274 | 13B07F961A680F5B00A75B9A /* Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Example.app; sourceTree = BUILT_PRODUCTS_DIR; }; 275 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = Example/AppDelegate.h; sourceTree = ""; }; 276 | 13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = Example/AppDelegate.m; sourceTree = ""; }; 277 | 13B07FB21A68108700A75B9A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 278 | 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = Example/Images.xcassets; sourceTree = ""; }; 279 | 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = Example/Info.plist; sourceTree = ""; }; 280 | 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = Example/main.m; sourceTree = ""; }; 281 | 146833FF1AC3E56700842450 /* React.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = React.xcodeproj; path = "../node_modules/react-native/React/React.xcodeproj"; sourceTree = ""; }; 282 | 2D02E47B1E0B4A5D006451C7 /* Example-tvOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Example-tvOS.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 283 | 2D02E4901E0B4A5D006451C7 /* Example-tvOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Example-tvOSTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 284 | 2D16E6891FA4F8E400B85C8A /* libReact.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libReact.a; sourceTree = BUILT_PRODUCTS_DIR; }; 285 | 5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTAnimation.xcodeproj; path = "../node_modules/react-native/Libraries/NativeAnimation/RCTAnimation.xcodeproj"; sourceTree = ""; }; 286 | 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = "../node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj"; sourceTree = ""; }; 287 | 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "../node_modules/react-native/Libraries/Text/RCTText.xcodeproj"; sourceTree = ""; }; 288 | ADBDB91F1DFEBF0600ED6528 /* RCTBlob.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTBlob.xcodeproj; path = "../node_modules/react-native/Libraries/Blob/RCTBlob.xcodeproj"; sourceTree = ""; }; 289 | /* End PBXFileReference section */ 290 | 291 | /* Begin PBXFrameworksBuildPhase section */ 292 | 00E356EB1AD99517003FC87E /* Frameworks */ = { 293 | isa = PBXFrameworksBuildPhase; 294 | buildActionMask = 2147483647; 295 | files = ( 296 | 140ED2AC1D01E1AD002B40FF /* libReact.a in Frameworks */, 297 | ); 298 | runOnlyForDeploymentPostprocessing = 0; 299 | }; 300 | 13B07F8C1A680F5B00A75B9A /* Frameworks */ = { 301 | isa = PBXFrameworksBuildPhase; 302 | buildActionMask = 2147483647; 303 | files = ( 304 | ADBDB9381DFEBF1600ED6528 /* libRCTBlob.a in Frameworks */, 305 | 5E9157361DD0AC6A00FF2AA8 /* libRCTAnimation.a in Frameworks */, 306 | 146834051AC3E58100842450 /* libReact.a in Frameworks */, 307 | 5E9157361DD0AC6A00FF2AA8 /* libRCTAnimation.a in Frameworks */, 308 | 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */, 309 | 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */, 310 | 00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */, 311 | 133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */, 312 | 00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */, 313 | 139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */, 314 | 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */, 315 | 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */, 316 | 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */, 317 | ); 318 | runOnlyForDeploymentPostprocessing = 0; 319 | }; 320 | 2D02E4781E0B4A5D006451C7 /* Frameworks */ = { 321 | isa = PBXFrameworksBuildPhase; 322 | buildActionMask = 2147483647; 323 | files = ( 324 | 2D16E6881FA4F8E400B85C8A /* libReact.a in Frameworks */, 325 | 2D02E4C21E0B4AEC006451C7 /* libRCTAnimation.a in Frameworks */, 326 | 2D02E4C31E0B4AEC006451C7 /* libRCTImage-tvOS.a in Frameworks */, 327 | 2D02E4C41E0B4AEC006451C7 /* libRCTLinking-tvOS.a in Frameworks */, 328 | 2D02E4C51E0B4AEC006451C7 /* libRCTNetwork-tvOS.a in Frameworks */, 329 | 2D02E4C61E0B4AEC006451C7 /* libRCTSettings-tvOS.a in Frameworks */, 330 | 2D02E4C71E0B4AEC006451C7 /* libRCTText-tvOS.a in Frameworks */, 331 | 2D02E4C81E0B4AEC006451C7 /* libRCTWebSocket-tvOS.a in Frameworks */, 332 | ); 333 | runOnlyForDeploymentPostprocessing = 0; 334 | }; 335 | 2D02E48D1E0B4A5D006451C7 /* Frameworks */ = { 336 | isa = PBXFrameworksBuildPhase; 337 | buildActionMask = 2147483647; 338 | files = ( 339 | ); 340 | runOnlyForDeploymentPostprocessing = 0; 341 | }; 342 | /* End PBXFrameworksBuildPhase section */ 343 | 344 | /* Begin PBXGroup section */ 345 | 00C302A81ABCB8CE00DB3ED1 /* Products */ = { 346 | isa = PBXGroup; 347 | children = ( 348 | 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */, 349 | ); 350 | name = Products; 351 | sourceTree = ""; 352 | }; 353 | 00C302B61ABCB90400DB3ED1 /* Products */ = { 354 | isa = PBXGroup; 355 | children = ( 356 | 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */, 357 | ); 358 | name = Products; 359 | sourceTree = ""; 360 | }; 361 | 00C302BC1ABCB91800DB3ED1 /* Products */ = { 362 | isa = PBXGroup; 363 | children = ( 364 | 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */, 365 | 3DAD3E841DF850E9000B6D8A /* libRCTImage-tvOS.a */, 366 | ); 367 | name = Products; 368 | sourceTree = ""; 369 | }; 370 | 00C302D41ABCB9D200DB3ED1 /* Products */ = { 371 | isa = PBXGroup; 372 | children = ( 373 | 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */, 374 | 3DAD3E8C1DF850E9000B6D8A /* libRCTNetwork-tvOS.a */, 375 | ); 376 | name = Products; 377 | sourceTree = ""; 378 | }; 379 | 00C302E01ABCB9EE00DB3ED1 /* Products */ = { 380 | isa = PBXGroup; 381 | children = ( 382 | 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */, 383 | ); 384 | name = Products; 385 | sourceTree = ""; 386 | }; 387 | 00E356EF1AD99517003FC87E /* ExampleTests */ = { 388 | isa = PBXGroup; 389 | children = ( 390 | 00E356F21AD99517003FC87E /* ExampleTests.m */, 391 | 00E356F01AD99517003FC87E /* Supporting Files */, 392 | ); 393 | path = ExampleTests; 394 | sourceTree = ""; 395 | }; 396 | 00E356F01AD99517003FC87E /* Supporting Files */ = { 397 | isa = PBXGroup; 398 | children = ( 399 | 00E356F11AD99517003FC87E /* Info.plist */, 400 | ); 401 | name = "Supporting Files"; 402 | sourceTree = ""; 403 | }; 404 | 139105B71AF99BAD00B5F7CC /* Products */ = { 405 | isa = PBXGroup; 406 | children = ( 407 | 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */, 408 | 3DAD3E901DF850E9000B6D8A /* libRCTSettings-tvOS.a */, 409 | ); 410 | name = Products; 411 | sourceTree = ""; 412 | }; 413 | 139FDEE71B06529A00C62182 /* Products */ = { 414 | isa = PBXGroup; 415 | children = ( 416 | 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */, 417 | 3DAD3E991DF850E9000B6D8A /* libRCTWebSocket-tvOS.a */, 418 | 2D16E6841FA4F8DC00B85C8A /* libfishhook.a */, 419 | 2D16E6861FA4F8DC00B85C8A /* libfishhook-tvOS.a */, 420 | ); 421 | name = Products; 422 | sourceTree = ""; 423 | }; 424 | 13B07FAE1A68108700A75B9A /* Example */ = { 425 | isa = PBXGroup; 426 | children = ( 427 | 008F07F21AC5B25A0029DE68 /* main.jsbundle */, 428 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */, 429 | 13B07FB01A68108700A75B9A /* AppDelegate.m */, 430 | 13B07FB51A68108700A75B9A /* Images.xcassets */, 431 | 13B07FB61A68108700A75B9A /* Info.plist */, 432 | 13B07FB11A68108700A75B9A /* LaunchScreen.xib */, 433 | 13B07FB71A68108700A75B9A /* main.m */, 434 | ); 435 | name = Example; 436 | sourceTree = ""; 437 | }; 438 | 146834001AC3E56700842450 /* Products */ = { 439 | isa = PBXGroup; 440 | children = ( 441 | 146834041AC3E56700842450 /* libReact.a */, 442 | 3DAD3EA51DF850E9000B6D8A /* libyoga.a */, 443 | 3DAD3EA71DF850E9000B6D8A /* libyoga.a */, 444 | 3DAD3EA91DF850E9000B6D8A /* libcxxreact.a */, 445 | 3DAD3EAB1DF850E9000B6D8A /* libcxxreact.a */, 446 | 3DAD3EAD1DF850E9000B6D8A /* libjschelpers.a */, 447 | 3DAD3EAF1DF850E9000B6D8A /* libjschelpers.a */, 448 | 3DAD3EA31DF850E9000B6D8A /* libReact-tvOS.a */, 449 | ); 450 | name = Products; 451 | sourceTree = ""; 452 | }; 453 | 2D16E6871FA4F8E400B85C8A /* Frameworks */ = { 454 | isa = PBXGroup; 455 | children = ( 456 | 2D16E6891FA4F8E400B85C8A /* libReact.a */, 457 | ); 458 | name = Frameworks; 459 | sourceTree = ""; 460 | }; 461 | 5E91572E1DD0AC6500FF2AA8 /* Products */ = { 462 | isa = PBXGroup; 463 | children = ( 464 | 5E9157331DD0AC6500FF2AA8 /* libRCTAnimation.a */, 465 | 5E9157351DD0AC6500FF2AA8 /* libRCTAnimation.a */, 466 | ); 467 | name = Products; 468 | sourceTree = ""; 469 | }; 470 | 78C398B11ACF4ADC00677621 /* Products */ = { 471 | isa = PBXGroup; 472 | children = ( 473 | 78C398B91ACF4ADC00677621 /* libRCTLinking.a */, 474 | 3DAD3E881DF850E9000B6D8A /* libRCTLinking-tvOS.a */, 475 | ); 476 | name = Products; 477 | sourceTree = ""; 478 | }; 479 | 832341AE1AAA6A7D00B99B32 /* Libraries */ = { 480 | isa = PBXGroup; 481 | children = ( 482 | 5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */, 483 | 146833FF1AC3E56700842450 /* React.xcodeproj */, 484 | 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */, 485 | ADBDB91F1DFEBF0600ED6528 /* RCTBlob.xcodeproj */, 486 | 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */, 487 | 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */, 488 | 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */, 489 | 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */, 490 | 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */, 491 | 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */, 492 | 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */, 493 | 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */, 494 | ); 495 | name = Libraries; 496 | sourceTree = ""; 497 | }; 498 | 832341B11AAA6A8300B99B32 /* Products */ = { 499 | isa = PBXGroup; 500 | children = ( 501 | 832341B51AAA6A8300B99B32 /* libRCTText.a */, 502 | 3DAD3E941DF850E9000B6D8A /* libRCTText-tvOS.a */, 503 | ); 504 | name = Products; 505 | sourceTree = ""; 506 | }; 507 | 83CBB9F61A601CBA00E9B192 = { 508 | isa = PBXGroup; 509 | children = ( 510 | 13B07FAE1A68108700A75B9A /* Example */, 511 | 832341AE1AAA6A7D00B99B32 /* Libraries */, 512 | 00E356EF1AD99517003FC87E /* ExampleTests */, 513 | 83CBBA001A601CBA00E9B192 /* Products */, 514 | 2D16E6871FA4F8E400B85C8A /* Frameworks */, 515 | ); 516 | indentWidth = 2; 517 | sourceTree = ""; 518 | tabWidth = 2; 519 | usesTabs = 0; 520 | }; 521 | 83CBBA001A601CBA00E9B192 /* Products */ = { 522 | isa = PBXGroup; 523 | children = ( 524 | 13B07F961A680F5B00A75B9A /* Example.app */, 525 | 00E356EE1AD99517003FC87E /* ExampleTests.xctest */, 526 | 2D02E47B1E0B4A5D006451C7 /* Example-tvOS.app */, 527 | 2D02E4901E0B4A5D006451C7 /* Example-tvOSTests.xctest */, 528 | ); 529 | name = Products; 530 | sourceTree = ""; 531 | }; 532 | ADBDB9201DFEBF0600ED6528 /* Products */ = { 533 | isa = PBXGroup; 534 | children = ( 535 | ADBDB9271DFEBF0700ED6528 /* libRCTBlob.a */, 536 | 2D16E6721FA4F8DC00B85C8A /* libRCTBlob-tvOS.a */, 537 | ); 538 | name = Products; 539 | sourceTree = ""; 540 | }; 541 | /* End PBXGroup section */ 542 | 543 | /* Begin PBXNativeTarget section */ 544 | 00E356ED1AD99517003FC87E /* ExampleTests */ = { 545 | isa = PBXNativeTarget; 546 | buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "ExampleTests" */; 547 | buildPhases = ( 548 | 00E356EA1AD99517003FC87E /* Sources */, 549 | 00E356EB1AD99517003FC87E /* Frameworks */, 550 | 00E356EC1AD99517003FC87E /* Resources */, 551 | ); 552 | buildRules = ( 553 | ); 554 | dependencies = ( 555 | 00E356F51AD99517003FC87E /* PBXTargetDependency */, 556 | ); 557 | name = ExampleTests; 558 | productName = ExampleTests; 559 | productReference = 00E356EE1AD99517003FC87E /* ExampleTests.xctest */; 560 | productType = "com.apple.product-type.bundle.unit-test"; 561 | }; 562 | 13B07F861A680F5B00A75B9A /* Example */ = { 563 | isa = PBXNativeTarget; 564 | buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "Example" */; 565 | buildPhases = ( 566 | 13B07F871A680F5B00A75B9A /* Sources */, 567 | 13B07F8C1A680F5B00A75B9A /* Frameworks */, 568 | 13B07F8E1A680F5B00A75B9A /* Resources */, 569 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */, 570 | ); 571 | buildRules = ( 572 | ); 573 | dependencies = ( 574 | ); 575 | name = Example; 576 | productName = "Hello World"; 577 | productReference = 13B07F961A680F5B00A75B9A /* Example.app */; 578 | productType = "com.apple.product-type.application"; 579 | }; 580 | 2D02E47A1E0B4A5D006451C7 /* Example-tvOS */ = { 581 | isa = PBXNativeTarget; 582 | buildConfigurationList = 2D02E4BA1E0B4A5E006451C7 /* Build configuration list for PBXNativeTarget "Example-tvOS" */; 583 | buildPhases = ( 584 | 2D02E4771E0B4A5D006451C7 /* Sources */, 585 | 2D02E4781E0B4A5D006451C7 /* Frameworks */, 586 | 2D02E4791E0B4A5D006451C7 /* Resources */, 587 | 2D02E4CB1E0B4B27006451C7 /* Bundle React Native Code And Images */, 588 | ); 589 | buildRules = ( 590 | ); 591 | dependencies = ( 592 | ); 593 | name = "Example-tvOS"; 594 | productName = "Example-tvOS"; 595 | productReference = 2D02E47B1E0B4A5D006451C7 /* Example-tvOS.app */; 596 | productType = "com.apple.product-type.application"; 597 | }; 598 | 2D02E48F1E0B4A5D006451C7 /* Example-tvOSTests */ = { 599 | isa = PBXNativeTarget; 600 | buildConfigurationList = 2D02E4BB1E0B4A5E006451C7 /* Build configuration list for PBXNativeTarget "Example-tvOSTests" */; 601 | buildPhases = ( 602 | 2D02E48C1E0B4A5D006451C7 /* Sources */, 603 | 2D02E48D1E0B4A5D006451C7 /* Frameworks */, 604 | 2D02E48E1E0B4A5D006451C7 /* Resources */, 605 | ); 606 | buildRules = ( 607 | ); 608 | dependencies = ( 609 | 2D02E4921E0B4A5D006451C7 /* PBXTargetDependency */, 610 | ); 611 | name = "Example-tvOSTests"; 612 | productName = "Example-tvOSTests"; 613 | productReference = 2D02E4901E0B4A5D006451C7 /* Example-tvOSTests.xctest */; 614 | productType = "com.apple.product-type.bundle.unit-test"; 615 | }; 616 | /* End PBXNativeTarget section */ 617 | 618 | /* Begin PBXProject section */ 619 | 83CBB9F71A601CBA00E9B192 /* Project object */ = { 620 | isa = PBXProject; 621 | attributes = { 622 | LastUpgradeCheck = 0610; 623 | ORGANIZATIONNAME = Facebook; 624 | TargetAttributes = { 625 | 00E356ED1AD99517003FC87E = { 626 | CreatedOnToolsVersion = 6.2; 627 | TestTargetID = 13B07F861A680F5B00A75B9A; 628 | }; 629 | 2D02E47A1E0B4A5D006451C7 = { 630 | CreatedOnToolsVersion = 8.2.1; 631 | ProvisioningStyle = Automatic; 632 | }; 633 | 2D02E48F1E0B4A5D006451C7 = { 634 | CreatedOnToolsVersion = 8.2.1; 635 | ProvisioningStyle = Automatic; 636 | TestTargetID = 2D02E47A1E0B4A5D006451C7; 637 | }; 638 | }; 639 | }; 640 | buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "Example" */; 641 | compatibilityVersion = "Xcode 3.2"; 642 | developmentRegion = English; 643 | hasScannedForEncodings = 0; 644 | knownRegions = ( 645 | en, 646 | Base, 647 | ); 648 | mainGroup = 83CBB9F61A601CBA00E9B192; 649 | productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */; 650 | projectDirPath = ""; 651 | projectReferences = ( 652 | { 653 | ProductGroup = 00C302A81ABCB8CE00DB3ED1 /* Products */; 654 | ProjectRef = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */; 655 | }, 656 | { 657 | ProductGroup = 5E91572E1DD0AC6500FF2AA8 /* Products */; 658 | ProjectRef = 5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */; 659 | }, 660 | { 661 | ProductGroup = ADBDB9201DFEBF0600ED6528 /* Products */; 662 | ProjectRef = ADBDB91F1DFEBF0600ED6528 /* RCTBlob.xcodeproj */; 663 | }, 664 | { 665 | ProductGroup = 00C302B61ABCB90400DB3ED1 /* Products */; 666 | ProjectRef = 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */; 667 | }, 668 | { 669 | ProductGroup = 00C302BC1ABCB91800DB3ED1 /* Products */; 670 | ProjectRef = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */; 671 | }, 672 | { 673 | ProductGroup = 78C398B11ACF4ADC00677621 /* Products */; 674 | ProjectRef = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */; 675 | }, 676 | { 677 | ProductGroup = 00C302D41ABCB9D200DB3ED1 /* Products */; 678 | ProjectRef = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */; 679 | }, 680 | { 681 | ProductGroup = 139105B71AF99BAD00B5F7CC /* Products */; 682 | ProjectRef = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */; 683 | }, 684 | { 685 | ProductGroup = 832341B11AAA6A8300B99B32 /* Products */; 686 | ProjectRef = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */; 687 | }, 688 | { 689 | ProductGroup = 00C302E01ABCB9EE00DB3ED1 /* Products */; 690 | ProjectRef = 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */; 691 | }, 692 | { 693 | ProductGroup = 139FDEE71B06529A00C62182 /* Products */; 694 | ProjectRef = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */; 695 | }, 696 | { 697 | ProductGroup = 146834001AC3E56700842450 /* Products */; 698 | ProjectRef = 146833FF1AC3E56700842450 /* React.xcodeproj */; 699 | }, 700 | ); 701 | projectRoot = ""; 702 | targets = ( 703 | 13B07F861A680F5B00A75B9A /* Example */, 704 | 00E356ED1AD99517003FC87E /* ExampleTests */, 705 | 2D02E47A1E0B4A5D006451C7 /* Example-tvOS */, 706 | 2D02E48F1E0B4A5D006451C7 /* Example-tvOSTests */, 707 | ); 708 | }; 709 | /* End PBXProject section */ 710 | 711 | /* Begin PBXReferenceProxy section */ 712 | 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */ = { 713 | isa = PBXReferenceProxy; 714 | fileType = archive.ar; 715 | path = libRCTActionSheet.a; 716 | remoteRef = 00C302AB1ABCB8CE00DB3ED1 /* PBXContainerItemProxy */; 717 | sourceTree = BUILT_PRODUCTS_DIR; 718 | }; 719 | 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */ = { 720 | isa = PBXReferenceProxy; 721 | fileType = archive.ar; 722 | path = libRCTGeolocation.a; 723 | remoteRef = 00C302B91ABCB90400DB3ED1 /* PBXContainerItemProxy */; 724 | sourceTree = BUILT_PRODUCTS_DIR; 725 | }; 726 | 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */ = { 727 | isa = PBXReferenceProxy; 728 | fileType = archive.ar; 729 | path = libRCTImage.a; 730 | remoteRef = 00C302BF1ABCB91800DB3ED1 /* PBXContainerItemProxy */; 731 | sourceTree = BUILT_PRODUCTS_DIR; 732 | }; 733 | 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */ = { 734 | isa = PBXReferenceProxy; 735 | fileType = archive.ar; 736 | path = libRCTNetwork.a; 737 | remoteRef = 00C302DB1ABCB9D200DB3ED1 /* PBXContainerItemProxy */; 738 | sourceTree = BUILT_PRODUCTS_DIR; 739 | }; 740 | 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */ = { 741 | isa = PBXReferenceProxy; 742 | fileType = archive.ar; 743 | path = libRCTVibration.a; 744 | remoteRef = 00C302E31ABCB9EE00DB3ED1 /* PBXContainerItemProxy */; 745 | sourceTree = BUILT_PRODUCTS_DIR; 746 | }; 747 | 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */ = { 748 | isa = PBXReferenceProxy; 749 | fileType = archive.ar; 750 | path = libRCTSettings.a; 751 | remoteRef = 139105C01AF99BAD00B5F7CC /* PBXContainerItemProxy */; 752 | sourceTree = BUILT_PRODUCTS_DIR; 753 | }; 754 | 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */ = { 755 | isa = PBXReferenceProxy; 756 | fileType = archive.ar; 757 | path = libRCTWebSocket.a; 758 | remoteRef = 139FDEF31B06529B00C62182 /* PBXContainerItemProxy */; 759 | sourceTree = BUILT_PRODUCTS_DIR; 760 | }; 761 | 146834041AC3E56700842450 /* libReact.a */ = { 762 | isa = PBXReferenceProxy; 763 | fileType = archive.ar; 764 | path = libReact.a; 765 | remoteRef = 146834031AC3E56700842450 /* PBXContainerItemProxy */; 766 | sourceTree = BUILT_PRODUCTS_DIR; 767 | }; 768 | 2D16E6721FA4F8DC00B85C8A /* libRCTBlob-tvOS.a */ = { 769 | isa = PBXReferenceProxy; 770 | fileType = archive.ar; 771 | path = "libRCTBlob-tvOS.a"; 772 | remoteRef = 2D16E6711FA4F8DC00B85C8A /* PBXContainerItemProxy */; 773 | sourceTree = BUILT_PRODUCTS_DIR; 774 | }; 775 | 2D16E6841FA4F8DC00B85C8A /* libfishhook.a */ = { 776 | isa = PBXReferenceProxy; 777 | fileType = archive.ar; 778 | path = libfishhook.a; 779 | remoteRef = 2D16E6831FA4F8DC00B85C8A /* PBXContainerItemProxy */; 780 | sourceTree = BUILT_PRODUCTS_DIR; 781 | }; 782 | 2D16E6861FA4F8DC00B85C8A /* libfishhook-tvOS.a */ = { 783 | isa = PBXReferenceProxy; 784 | fileType = archive.ar; 785 | path = "libfishhook-tvOS.a"; 786 | remoteRef = 2D16E6851FA4F8DC00B85C8A /* PBXContainerItemProxy */; 787 | sourceTree = BUILT_PRODUCTS_DIR; 788 | }; 789 | 3DAD3E841DF850E9000B6D8A /* libRCTImage-tvOS.a */ = { 790 | isa = PBXReferenceProxy; 791 | fileType = archive.ar; 792 | path = "libRCTImage-tvOS.a"; 793 | remoteRef = 3DAD3E831DF850E9000B6D8A /* PBXContainerItemProxy */; 794 | sourceTree = BUILT_PRODUCTS_DIR; 795 | }; 796 | 3DAD3E881DF850E9000B6D8A /* libRCTLinking-tvOS.a */ = { 797 | isa = PBXReferenceProxy; 798 | fileType = archive.ar; 799 | path = "libRCTLinking-tvOS.a"; 800 | remoteRef = 3DAD3E871DF850E9000B6D8A /* PBXContainerItemProxy */; 801 | sourceTree = BUILT_PRODUCTS_DIR; 802 | }; 803 | 3DAD3E8C1DF850E9000B6D8A /* libRCTNetwork-tvOS.a */ = { 804 | isa = PBXReferenceProxy; 805 | fileType = archive.ar; 806 | path = "libRCTNetwork-tvOS.a"; 807 | remoteRef = 3DAD3E8B1DF850E9000B6D8A /* PBXContainerItemProxy */; 808 | sourceTree = BUILT_PRODUCTS_DIR; 809 | }; 810 | 3DAD3E901DF850E9000B6D8A /* libRCTSettings-tvOS.a */ = { 811 | isa = PBXReferenceProxy; 812 | fileType = archive.ar; 813 | path = "libRCTSettings-tvOS.a"; 814 | remoteRef = 3DAD3E8F1DF850E9000B6D8A /* PBXContainerItemProxy */; 815 | sourceTree = BUILT_PRODUCTS_DIR; 816 | }; 817 | 3DAD3E941DF850E9000B6D8A /* libRCTText-tvOS.a */ = { 818 | isa = PBXReferenceProxy; 819 | fileType = archive.ar; 820 | path = "libRCTText-tvOS.a"; 821 | remoteRef = 3DAD3E931DF850E9000B6D8A /* PBXContainerItemProxy */; 822 | sourceTree = BUILT_PRODUCTS_DIR; 823 | }; 824 | 3DAD3E991DF850E9000B6D8A /* libRCTWebSocket-tvOS.a */ = { 825 | isa = PBXReferenceProxy; 826 | fileType = archive.ar; 827 | path = "libRCTWebSocket-tvOS.a"; 828 | remoteRef = 3DAD3E981DF850E9000B6D8A /* PBXContainerItemProxy */; 829 | sourceTree = BUILT_PRODUCTS_DIR; 830 | }; 831 | 3DAD3EA31DF850E9000B6D8A /* libReact-tvOS.a */ = { 832 | isa = PBXReferenceProxy; 833 | fileType = archive.ar; 834 | path = "libReact-tvOS.a"; 835 | remoteRef = 3DAD3EA21DF850E9000B6D8A /* PBXContainerItemProxy */; 836 | sourceTree = BUILT_PRODUCTS_DIR; 837 | }; 838 | 3DAD3EA51DF850E9000B6D8A /* libyoga.a */ = { 839 | isa = PBXReferenceProxy; 840 | fileType = archive.ar; 841 | path = libyoga.a; 842 | remoteRef = 3DAD3EA41DF850E9000B6D8A /* PBXContainerItemProxy */; 843 | sourceTree = BUILT_PRODUCTS_DIR; 844 | }; 845 | 3DAD3EA71DF850E9000B6D8A /* libyoga.a */ = { 846 | isa = PBXReferenceProxy; 847 | fileType = archive.ar; 848 | path = libyoga.a; 849 | remoteRef = 3DAD3EA61DF850E9000B6D8A /* PBXContainerItemProxy */; 850 | sourceTree = BUILT_PRODUCTS_DIR; 851 | }; 852 | 3DAD3EA91DF850E9000B6D8A /* libcxxreact.a */ = { 853 | isa = PBXReferenceProxy; 854 | fileType = archive.ar; 855 | path = libcxxreact.a; 856 | remoteRef = 3DAD3EA81DF850E9000B6D8A /* PBXContainerItemProxy */; 857 | sourceTree = BUILT_PRODUCTS_DIR; 858 | }; 859 | 3DAD3EAB1DF850E9000B6D8A /* libcxxreact.a */ = { 860 | isa = PBXReferenceProxy; 861 | fileType = archive.ar; 862 | path = libcxxreact.a; 863 | remoteRef = 3DAD3EAA1DF850E9000B6D8A /* PBXContainerItemProxy */; 864 | sourceTree = BUILT_PRODUCTS_DIR; 865 | }; 866 | 3DAD3EAD1DF850E9000B6D8A /* libjschelpers.a */ = { 867 | isa = PBXReferenceProxy; 868 | fileType = archive.ar; 869 | path = libjschelpers.a; 870 | remoteRef = 3DAD3EAC1DF850E9000B6D8A /* PBXContainerItemProxy */; 871 | sourceTree = BUILT_PRODUCTS_DIR; 872 | }; 873 | 3DAD3EAF1DF850E9000B6D8A /* libjschelpers.a */ = { 874 | isa = PBXReferenceProxy; 875 | fileType = archive.ar; 876 | path = libjschelpers.a; 877 | remoteRef = 3DAD3EAE1DF850E9000B6D8A /* PBXContainerItemProxy */; 878 | sourceTree = BUILT_PRODUCTS_DIR; 879 | }; 880 | 5E9157331DD0AC6500FF2AA8 /* libRCTAnimation.a */ = { 881 | isa = PBXReferenceProxy; 882 | fileType = archive.ar; 883 | path = libRCTAnimation.a; 884 | remoteRef = 5E9157321DD0AC6500FF2AA8 /* PBXContainerItemProxy */; 885 | sourceTree = BUILT_PRODUCTS_DIR; 886 | }; 887 | 5E9157351DD0AC6500FF2AA8 /* libRCTAnimation.a */ = { 888 | isa = PBXReferenceProxy; 889 | fileType = archive.ar; 890 | path = libRCTAnimation.a; 891 | remoteRef = 5E9157341DD0AC6500FF2AA8 /* PBXContainerItemProxy */; 892 | sourceTree = BUILT_PRODUCTS_DIR; 893 | }; 894 | 78C398B91ACF4ADC00677621 /* libRCTLinking.a */ = { 895 | isa = PBXReferenceProxy; 896 | fileType = archive.ar; 897 | path = libRCTLinking.a; 898 | remoteRef = 78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */; 899 | sourceTree = BUILT_PRODUCTS_DIR; 900 | }; 901 | 832341B51AAA6A8300B99B32 /* libRCTText.a */ = { 902 | isa = PBXReferenceProxy; 903 | fileType = archive.ar; 904 | path = libRCTText.a; 905 | remoteRef = 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */; 906 | sourceTree = BUILT_PRODUCTS_DIR; 907 | }; 908 | ADBDB9271DFEBF0700ED6528 /* libRCTBlob.a */ = { 909 | isa = PBXReferenceProxy; 910 | fileType = archive.ar; 911 | path = libRCTBlob.a; 912 | remoteRef = ADBDB9261DFEBF0700ED6528 /* PBXContainerItemProxy */; 913 | sourceTree = BUILT_PRODUCTS_DIR; 914 | }; 915 | /* End PBXReferenceProxy section */ 916 | 917 | /* Begin PBXResourcesBuildPhase section */ 918 | 00E356EC1AD99517003FC87E /* Resources */ = { 919 | isa = PBXResourcesBuildPhase; 920 | buildActionMask = 2147483647; 921 | files = ( 922 | ); 923 | runOnlyForDeploymentPostprocessing = 0; 924 | }; 925 | 13B07F8E1A680F5B00A75B9A /* Resources */ = { 926 | isa = PBXResourcesBuildPhase; 927 | buildActionMask = 2147483647; 928 | files = ( 929 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */, 930 | 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */, 931 | ); 932 | runOnlyForDeploymentPostprocessing = 0; 933 | }; 934 | 2D02E4791E0B4A5D006451C7 /* Resources */ = { 935 | isa = PBXResourcesBuildPhase; 936 | buildActionMask = 2147483647; 937 | files = ( 938 | 2D02E4BD1E0B4A84006451C7 /* Images.xcassets in Resources */, 939 | ); 940 | runOnlyForDeploymentPostprocessing = 0; 941 | }; 942 | 2D02E48E1E0B4A5D006451C7 /* Resources */ = { 943 | isa = PBXResourcesBuildPhase; 944 | buildActionMask = 2147483647; 945 | files = ( 946 | ); 947 | runOnlyForDeploymentPostprocessing = 0; 948 | }; 949 | /* End PBXResourcesBuildPhase section */ 950 | 951 | /* Begin PBXShellScriptBuildPhase section */ 952 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = { 953 | isa = PBXShellScriptBuildPhase; 954 | buildActionMask = 2147483647; 955 | files = ( 956 | ); 957 | inputPaths = ( 958 | ); 959 | name = "Bundle React Native code and images"; 960 | outputPaths = ( 961 | ); 962 | runOnlyForDeploymentPostprocessing = 0; 963 | shellPath = /bin/sh; 964 | shellScript = "export NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh"; 965 | }; 966 | 2D02E4CB1E0B4B27006451C7 /* Bundle React Native Code And Images */ = { 967 | isa = PBXShellScriptBuildPhase; 968 | buildActionMask = 2147483647; 969 | files = ( 970 | ); 971 | inputPaths = ( 972 | ); 973 | name = "Bundle React Native Code And Images"; 974 | outputPaths = ( 975 | ); 976 | runOnlyForDeploymentPostprocessing = 0; 977 | shellPath = /bin/sh; 978 | shellScript = "export NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh"; 979 | }; 980 | /* End PBXShellScriptBuildPhase section */ 981 | 982 | /* Begin PBXSourcesBuildPhase section */ 983 | 00E356EA1AD99517003FC87E /* Sources */ = { 984 | isa = PBXSourcesBuildPhase; 985 | buildActionMask = 2147483647; 986 | files = ( 987 | 00E356F31AD99517003FC87E /* ExampleTests.m in Sources */, 988 | ); 989 | runOnlyForDeploymentPostprocessing = 0; 990 | }; 991 | 13B07F871A680F5B00A75B9A /* Sources */ = { 992 | isa = PBXSourcesBuildPhase; 993 | buildActionMask = 2147483647; 994 | files = ( 995 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */, 996 | 13B07FC11A68108700A75B9A /* main.m in Sources */, 997 | ); 998 | runOnlyForDeploymentPostprocessing = 0; 999 | }; 1000 | 2D02E4771E0B4A5D006451C7 /* Sources */ = { 1001 | isa = PBXSourcesBuildPhase; 1002 | buildActionMask = 2147483647; 1003 | files = ( 1004 | 2D02E4BF1E0B4AB3006451C7 /* main.m in Sources */, 1005 | 2D02E4BC1E0B4A80006451C7 /* AppDelegate.m in Sources */, 1006 | ); 1007 | runOnlyForDeploymentPostprocessing = 0; 1008 | }; 1009 | 2D02E48C1E0B4A5D006451C7 /* Sources */ = { 1010 | isa = PBXSourcesBuildPhase; 1011 | buildActionMask = 2147483647; 1012 | files = ( 1013 | 2DCD954D1E0B4F2C00145EB5 /* ExampleTests.m in Sources */, 1014 | ); 1015 | runOnlyForDeploymentPostprocessing = 0; 1016 | }; 1017 | /* End PBXSourcesBuildPhase section */ 1018 | 1019 | /* Begin PBXTargetDependency section */ 1020 | 00E356F51AD99517003FC87E /* PBXTargetDependency */ = { 1021 | isa = PBXTargetDependency; 1022 | target = 13B07F861A680F5B00A75B9A /* Example */; 1023 | targetProxy = 00E356F41AD99517003FC87E /* PBXContainerItemProxy */; 1024 | }; 1025 | 2D02E4921E0B4A5D006451C7 /* PBXTargetDependency */ = { 1026 | isa = PBXTargetDependency; 1027 | target = 2D02E47A1E0B4A5D006451C7 /* Example-tvOS */; 1028 | targetProxy = 2D02E4911E0B4A5D006451C7 /* PBXContainerItemProxy */; 1029 | }; 1030 | /* End PBXTargetDependency section */ 1031 | 1032 | /* Begin PBXVariantGroup section */ 1033 | 13B07FB11A68108700A75B9A /* LaunchScreen.xib */ = { 1034 | isa = PBXVariantGroup; 1035 | children = ( 1036 | 13B07FB21A68108700A75B9A /* Base */, 1037 | ); 1038 | name = LaunchScreen.xib; 1039 | path = Example; 1040 | sourceTree = ""; 1041 | }; 1042 | /* End PBXVariantGroup section */ 1043 | 1044 | /* Begin XCBuildConfiguration section */ 1045 | 00E356F61AD99517003FC87E /* Debug */ = { 1046 | isa = XCBuildConfiguration; 1047 | buildSettings = { 1048 | BUNDLE_LOADER = "$(TEST_HOST)"; 1049 | GCC_PREPROCESSOR_DEFINITIONS = ( 1050 | "DEBUG=1", 1051 | "$(inherited)", 1052 | ); 1053 | INFOPLIST_FILE = ExampleTests/Info.plist; 1054 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 1055 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 1056 | OTHER_LDFLAGS = ( 1057 | "-ObjC", 1058 | "-lc++", 1059 | ); 1060 | PRODUCT_NAME = "$(TARGET_NAME)"; 1061 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Example.app/Example"; 1062 | }; 1063 | name = Debug; 1064 | }; 1065 | 00E356F71AD99517003FC87E /* Release */ = { 1066 | isa = XCBuildConfiguration; 1067 | buildSettings = { 1068 | BUNDLE_LOADER = "$(TEST_HOST)"; 1069 | COPY_PHASE_STRIP = NO; 1070 | INFOPLIST_FILE = ExampleTests/Info.plist; 1071 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 1072 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 1073 | OTHER_LDFLAGS = ( 1074 | "-ObjC", 1075 | "-lc++", 1076 | ); 1077 | PRODUCT_NAME = "$(TARGET_NAME)"; 1078 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Example.app/Example"; 1079 | }; 1080 | name = Release; 1081 | }; 1082 | 13B07F941A680F5B00A75B9A /* Debug */ = { 1083 | isa = XCBuildConfiguration; 1084 | buildSettings = { 1085 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 1086 | CURRENT_PROJECT_VERSION = 1; 1087 | DEAD_CODE_STRIPPING = NO; 1088 | INFOPLIST_FILE = Example/Info.plist; 1089 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 1090 | OTHER_LDFLAGS = ( 1091 | "$(inherited)", 1092 | "-ObjC", 1093 | "-lc++", 1094 | ); 1095 | PRODUCT_NAME = Example; 1096 | VERSIONING_SYSTEM = "apple-generic"; 1097 | }; 1098 | name = Debug; 1099 | }; 1100 | 13B07F951A680F5B00A75B9A /* Release */ = { 1101 | isa = XCBuildConfiguration; 1102 | buildSettings = { 1103 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 1104 | CURRENT_PROJECT_VERSION = 1; 1105 | INFOPLIST_FILE = Example/Info.plist; 1106 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 1107 | OTHER_LDFLAGS = ( 1108 | "$(inherited)", 1109 | "-ObjC", 1110 | "-lc++", 1111 | ); 1112 | PRODUCT_NAME = Example; 1113 | VERSIONING_SYSTEM = "apple-generic"; 1114 | }; 1115 | name = Release; 1116 | }; 1117 | 2D02E4971E0B4A5E006451C7 /* Debug */ = { 1118 | isa = XCBuildConfiguration; 1119 | buildSettings = { 1120 | ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image"; 1121 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 1122 | CLANG_ANALYZER_NONNULL = YES; 1123 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 1124 | CLANG_WARN_INFINITE_RECURSION = YES; 1125 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 1126 | DEBUG_INFORMATION_FORMAT = dwarf; 1127 | ENABLE_TESTABILITY = YES; 1128 | GCC_NO_COMMON_BLOCKS = YES; 1129 | INFOPLIST_FILE = "Example-tvOS/Info.plist"; 1130 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 1131 | OTHER_LDFLAGS = ( 1132 | "-ObjC", 1133 | "-lc++", 1134 | ); 1135 | PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.REACT.Example-tvOS"; 1136 | PRODUCT_NAME = "$(TARGET_NAME)"; 1137 | SDKROOT = appletvos; 1138 | TARGETED_DEVICE_FAMILY = 3; 1139 | TVOS_DEPLOYMENT_TARGET = 9.2; 1140 | }; 1141 | name = Debug; 1142 | }; 1143 | 2D02E4981E0B4A5E006451C7 /* Release */ = { 1144 | isa = XCBuildConfiguration; 1145 | buildSettings = { 1146 | ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image"; 1147 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 1148 | CLANG_ANALYZER_NONNULL = YES; 1149 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 1150 | CLANG_WARN_INFINITE_RECURSION = YES; 1151 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 1152 | COPY_PHASE_STRIP = NO; 1153 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 1154 | GCC_NO_COMMON_BLOCKS = YES; 1155 | INFOPLIST_FILE = "Example-tvOS/Info.plist"; 1156 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 1157 | OTHER_LDFLAGS = ( 1158 | "-ObjC", 1159 | "-lc++", 1160 | ); 1161 | PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.REACT.Example-tvOS"; 1162 | PRODUCT_NAME = "$(TARGET_NAME)"; 1163 | SDKROOT = appletvos; 1164 | TARGETED_DEVICE_FAMILY = 3; 1165 | TVOS_DEPLOYMENT_TARGET = 9.2; 1166 | }; 1167 | name = Release; 1168 | }; 1169 | 2D02E4991E0B4A5E006451C7 /* Debug */ = { 1170 | isa = XCBuildConfiguration; 1171 | buildSettings = { 1172 | BUNDLE_LOADER = "$(TEST_HOST)"; 1173 | CLANG_ANALYZER_NONNULL = YES; 1174 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 1175 | CLANG_WARN_INFINITE_RECURSION = YES; 1176 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 1177 | DEBUG_INFORMATION_FORMAT = dwarf; 1178 | ENABLE_TESTABILITY = YES; 1179 | GCC_NO_COMMON_BLOCKS = YES; 1180 | INFOPLIST_FILE = "Example-tvOSTests/Info.plist"; 1181 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 1182 | PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.REACT.Example-tvOSTests"; 1183 | PRODUCT_NAME = "$(TARGET_NAME)"; 1184 | SDKROOT = appletvos; 1185 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Example-tvOS.app/Example-tvOS"; 1186 | TVOS_DEPLOYMENT_TARGET = 10.1; 1187 | }; 1188 | name = Debug; 1189 | }; 1190 | 2D02E49A1E0B4A5E006451C7 /* Release */ = { 1191 | isa = XCBuildConfiguration; 1192 | buildSettings = { 1193 | BUNDLE_LOADER = "$(TEST_HOST)"; 1194 | CLANG_ANALYZER_NONNULL = YES; 1195 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 1196 | CLANG_WARN_INFINITE_RECURSION = YES; 1197 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 1198 | COPY_PHASE_STRIP = NO; 1199 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 1200 | GCC_NO_COMMON_BLOCKS = YES; 1201 | INFOPLIST_FILE = "Example-tvOSTests/Info.plist"; 1202 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 1203 | PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.REACT.Example-tvOSTests"; 1204 | PRODUCT_NAME = "$(TARGET_NAME)"; 1205 | SDKROOT = appletvos; 1206 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Example-tvOS.app/Example-tvOS"; 1207 | TVOS_DEPLOYMENT_TARGET = 10.1; 1208 | }; 1209 | name = Release; 1210 | }; 1211 | 83CBBA201A601CBA00E9B192 /* Debug */ = { 1212 | isa = XCBuildConfiguration; 1213 | buildSettings = { 1214 | ALWAYS_SEARCH_USER_PATHS = NO; 1215 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 1216 | CLANG_CXX_LIBRARY = "libc++"; 1217 | CLANG_ENABLE_MODULES = YES; 1218 | CLANG_ENABLE_OBJC_ARC = YES; 1219 | CLANG_WARN_BOOL_CONVERSION = YES; 1220 | CLANG_WARN_CONSTANT_CONVERSION = YES; 1221 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 1222 | CLANG_WARN_EMPTY_BODY = YES; 1223 | CLANG_WARN_ENUM_CONVERSION = YES; 1224 | CLANG_WARN_INT_CONVERSION = YES; 1225 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 1226 | CLANG_WARN_UNREACHABLE_CODE = YES; 1227 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 1228 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 1229 | COPY_PHASE_STRIP = NO; 1230 | ENABLE_STRICT_OBJC_MSGSEND = YES; 1231 | GCC_C_LANGUAGE_STANDARD = gnu99; 1232 | GCC_DYNAMIC_NO_PIC = NO; 1233 | GCC_OPTIMIZATION_LEVEL = 0; 1234 | GCC_PREPROCESSOR_DEFINITIONS = ( 1235 | "DEBUG=1", 1236 | "$(inherited)", 1237 | ); 1238 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 1239 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 1240 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 1241 | GCC_WARN_UNDECLARED_SELECTOR = YES; 1242 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 1243 | GCC_WARN_UNUSED_FUNCTION = YES; 1244 | GCC_WARN_UNUSED_VARIABLE = YES; 1245 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 1246 | MTL_ENABLE_DEBUG_INFO = YES; 1247 | ONLY_ACTIVE_ARCH = YES; 1248 | SDKROOT = iphoneos; 1249 | }; 1250 | name = Debug; 1251 | }; 1252 | 83CBBA211A601CBA00E9B192 /* Release */ = { 1253 | isa = XCBuildConfiguration; 1254 | buildSettings = { 1255 | ALWAYS_SEARCH_USER_PATHS = NO; 1256 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 1257 | CLANG_CXX_LIBRARY = "libc++"; 1258 | CLANG_ENABLE_MODULES = YES; 1259 | CLANG_ENABLE_OBJC_ARC = YES; 1260 | CLANG_WARN_BOOL_CONVERSION = YES; 1261 | CLANG_WARN_CONSTANT_CONVERSION = YES; 1262 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 1263 | CLANG_WARN_EMPTY_BODY = YES; 1264 | CLANG_WARN_ENUM_CONVERSION = YES; 1265 | CLANG_WARN_INT_CONVERSION = YES; 1266 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 1267 | CLANG_WARN_UNREACHABLE_CODE = YES; 1268 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 1269 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 1270 | COPY_PHASE_STRIP = YES; 1271 | ENABLE_NS_ASSERTIONS = NO; 1272 | ENABLE_STRICT_OBJC_MSGSEND = YES; 1273 | GCC_C_LANGUAGE_STANDARD = gnu99; 1274 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 1275 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 1276 | GCC_WARN_UNDECLARED_SELECTOR = YES; 1277 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 1278 | GCC_WARN_UNUSED_FUNCTION = YES; 1279 | GCC_WARN_UNUSED_VARIABLE = YES; 1280 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 1281 | MTL_ENABLE_DEBUG_INFO = NO; 1282 | SDKROOT = iphoneos; 1283 | VALIDATE_PRODUCT = YES; 1284 | }; 1285 | name = Release; 1286 | }; 1287 | /* End XCBuildConfiguration section */ 1288 | 1289 | /* Begin XCConfigurationList section */ 1290 | 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "ExampleTests" */ = { 1291 | isa = XCConfigurationList; 1292 | buildConfigurations = ( 1293 | 00E356F61AD99517003FC87E /* Debug */, 1294 | 00E356F71AD99517003FC87E /* Release */, 1295 | ); 1296 | defaultConfigurationIsVisible = 0; 1297 | defaultConfigurationName = Release; 1298 | }; 1299 | 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "Example" */ = { 1300 | isa = XCConfigurationList; 1301 | buildConfigurations = ( 1302 | 13B07F941A680F5B00A75B9A /* Debug */, 1303 | 13B07F951A680F5B00A75B9A /* Release */, 1304 | ); 1305 | defaultConfigurationIsVisible = 0; 1306 | defaultConfigurationName = Release; 1307 | }; 1308 | 2D02E4BA1E0B4A5E006451C7 /* Build configuration list for PBXNativeTarget "Example-tvOS" */ = { 1309 | isa = XCConfigurationList; 1310 | buildConfigurations = ( 1311 | 2D02E4971E0B4A5E006451C7 /* Debug */, 1312 | 2D02E4981E0B4A5E006451C7 /* Release */, 1313 | ); 1314 | defaultConfigurationIsVisible = 0; 1315 | defaultConfigurationName = Release; 1316 | }; 1317 | 2D02E4BB1E0B4A5E006451C7 /* Build configuration list for PBXNativeTarget "Example-tvOSTests" */ = { 1318 | isa = XCConfigurationList; 1319 | buildConfigurations = ( 1320 | 2D02E4991E0B4A5E006451C7 /* Debug */, 1321 | 2D02E49A1E0B4A5E006451C7 /* Release */, 1322 | ); 1323 | defaultConfigurationIsVisible = 0; 1324 | defaultConfigurationName = Release; 1325 | }; 1326 | 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "Example" */ = { 1327 | isa = XCConfigurationList; 1328 | buildConfigurations = ( 1329 | 83CBBA201A601CBA00E9B192 /* Debug */, 1330 | 83CBBA211A601CBA00E9B192 /* Release */, 1331 | ); 1332 | defaultConfigurationIsVisible = 0; 1333 | defaultConfigurationName = Release; 1334 | }; 1335 | /* End XCConfigurationList section */ 1336 | }; 1337 | rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */; 1338 | } 1339 | -------------------------------------------------------------------------------- /Example/ios/Example.xcodeproj/xcshareddata/xcschemes/Example-tvOS.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 43 | 49 | 50 | 51 | 52 | 53 | 58 | 59 | 61 | 67 | 68 | 69 | 70 | 71 | 77 | 78 | 79 | 80 | 81 | 82 | 92 | 94 | 100 | 101 | 102 | 103 | 104 | 105 | 111 | 113 | 119 | 120 | 121 | 122 | 124 | 125 | 128 | 129 | 130 | -------------------------------------------------------------------------------- /Example/ios/Example.xcodeproj/xcshareddata/xcschemes/Example.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 43 | 49 | 50 | 51 | 52 | 53 | 58 | 59 | 61 | 67 | 68 | 69 | 70 | 71 | 77 | 78 | 79 | 80 | 81 | 82 | 92 | 94 | 100 | 101 | 102 | 103 | 104 | 105 | 111 | 113 | 119 | 120 | 121 | 122 | 124 | 125 | 128 | 129 | 130 | -------------------------------------------------------------------------------- /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 13 | #import 14 | 15 | @implementation AppDelegate 16 | 17 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 18 | { 19 | NSURL *jsCodeLocation; 20 | 21 | jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" 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/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Example/ios/Example/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | Example 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSRequiresIPhoneOS 26 | 27 | UILaunchStoryboardName 28 | LaunchScreen 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UIViewControllerBasedStatusBarAppearance 40 | 41 | NSLocationWhenInUseUsageDescription 42 | 43 | NSAppTransportSecurity 44 | 45 | 46 | NSExceptionDomains 47 | 48 | localhost 49 | 50 | NSExceptionAllowsInsecureHTTPLoads 51 | 52 | 53 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /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/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 14 | #import 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 = [[[RCTSharedApplication() 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/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/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Example", 3 | "version": "0.0.1", 4 | "private": true, 5 | "scripts": { 6 | "start": "node node_modules/react-native/local-cli/cli.js start", 7 | "test": "jest" 8 | }, 9 | "dependencies": { 10 | "create-react-class": "^15.6.3", 11 | "immutable": "^3.8.2", 12 | "lodash": "^4.17.4", 13 | "prop-types": "^15.6.0", 14 | "react": "16.2.0", 15 | "react-addons-shallow-compare": "^15.6.2", 16 | "react-native": "0.52.2", 17 | "react-native-emoji": "^1.2.0", 18 | "react-native-smooth-swipe-list": "1.4.6" 19 | }, 20 | "devDependencies": { 21 | "babel-jest": "22.1.0", 22 | "babel-preset-react-native": "4.0.0", 23 | "jest": "22.1.4", 24 | "react-test-renderer": "16.2.0" 25 | }, 26 | "jest": { 27 | "preset": "react-native" 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # react-native-smooth-swipe-list 2 | 3 | #### A swipe-able ListView component modeled after the list view in the iOS Mail app. 4 | 5 | - React Native >= 0.47.0 use 1.4.0 6 | 7 | - React Native < 0.47.0 use 1.3.2 8 | 9 | ## Example 10 | ![example gif](https://github.com/ProvataHealth/react-native-smooth-swipe-list/blob/master/Example/assets/capture.gif) 11 | 12 | #### Running example 13 | ```bash 14 | git clone git@github.com:ProvataHealth/react-native-smooth-swipe-list.git 15 | cd react-native-smooth-swipe-list 16 | cd Example 17 | npm install 18 | react-native run-ios #or react-native run-android 19 | ``` 20 | 21 | ## Installation 22 | ```bash 23 | npm install --save react-native-smooth-swipe-list 24 | ``` 25 | 26 | ## Usage 27 | A `SwipeList` builds a `ListView.DataSource` from its `props.rowData`. The DataSource is primarily the views provided by `rowData` wrapped by a `SwipeRow` 28 | ```javascript 29 | ... 30 | import SwipeList from 'react-native-smooth-swipe-list'; 31 | 32 | const ListParent = React.createClass({ 33 | 34 | propTypes: { 35 | // takes in array of todo objects 36 | ... 37 | }, 38 | 39 | componentDidMount() { 40 | // it's a good idea to store the derived rowData to prevent 41 | // unnecessary re-renders of the rows in the ListView 42 | this.rowData = this.props.todos.map(this.constructRowData); 43 | }, 44 | 45 | componentWillReceiveProps(nextProps) { 46 | // however if you store the derived data you will need to handle the 47 | // logic for whether a rowData element needs to be replaced 48 | ... 49 | }, 50 | 51 | constructRowData(todo) { 52 | return { 53 | id: todo.id, 54 | rowView: this.getRowView(todo), 55 | leftSubView: this.getMarkCompleteButton(), //optional 56 | rightSubView: this.getArchiveButton(), //optional 57 | style: styles.row //optional but recommended to style your rows 58 | }; 59 | }, 60 | 61 | getRowView() { 62 | // return the view that will be the face of the row 63 | ... 64 | }, 65 | 66 | getMarkCompleteButton() { 67 | // return your touchable view, it can be whatever 68 | ... 69 | }, 70 | 71 | getArchiveButton() { 72 | ... 73 | }, 74 | 75 | render() { 76 | return ; 77 | } 78 | }); 79 | ``` 80 | 81 | ## API 82 | 83 | ### SwipeList Component 84 | 85 | #### Props 86 | * [FlatList props...](https://facebook.github.io/react-native/docs/flatlist.html) 87 | * `rowData` - Object with the follow properties: 88 | * `id`(required) - Used to identify the rowData 89 | * `setRef` - get a reference to the component for this row, receives `component, rowData, index` 90 | * `rowView`(required) - View to use as the row face, rendered inside a `SwipeRow` 91 | * `[left/right]SubView` - View to show when swiping left or right rendered inside a `SwipeRow` below the `rowView` 92 | * `[left/right]leftSubViewOptions` - Options to customize left and right subviews 93 | * `fullWidth` - Will the view span the full width of the row *(default false)* 94 | * `closeOnPress` - Whether the row should close on a press if not followed by a valid gesture *(default true)* 95 | * `style` - Style to apply to the row root view 96 | * `props` - Any additional props you want to be set on the `SwipeRow` 97 | * `gestureTensionParams` - Provide to tweak the tension of gestures 98 | * `threshold` - The point at which tension will begin to be applied *(default subViewWidth)* 99 | * `stretch` - How far past length the gesture can go *(default 1)* 100 | * `resistanceStrength` The resistance of the gesture past length *(between 0-1, default 0.5)* 101 | * `scrollEnabled` Whether to allow scrolling the ListVIew *(default: true)* 102 | * `onScrollStateChange` - Hook for responding to scroll enabled (true) or disabled (false) 103 | * `swipeRowProps` - Props to be set on all `SwipeRow`'s 104 | * `rowStyle` - Style to apply to all rows root views 105 | * `onSwipeStateChange` - callback for receiving updates about swipe state (SWIPE_START, SWIPE_END, OPEN_ROW_START, OPEN_ROW_END, CLOSE_ROW_START, CLOSE_ROW_END) 106 | * `style` - Style applied to the ListView 107 | 108 | ### Methods 109 | * `tryCloseOpenRow()` - Close any open row 110 | * `calloutRow(rowNumber, amount):Promise` - Open the row by `amount` and then closes it 111 | 112 | 113 | ### SwipeRow Component 114 | **Note: In most cases you will want to use the `SwipeList` and not directly render a `SwipeRow`. The `SwipeList` will handle 115 | wrapping the various rendered views from your `rowData`** 116 | 117 | See [React Native PanResponder](https://facebook.github.io/react-native/docs/panresponder.html) for information about gesture events. 118 | 119 | ### Props passed into row rendered 120 | * `open` - whether the row is open or not 121 | * `openRow` - opens the row 122 | 123 | #### Props 124 | * `id` - id of the rows data 125 | * `style` - Style to apply to the row container 126 | * `rowViewStyle` - Style to apply the the inner row view 127 | * `gestureTensionParams` - Provide to tweak the tension of gestures 128 | * `threshold` - The point at which tension will begin to be applied *(default subViewWidth)* 129 | * `stretch` - How far past length the gesture can go *(default 1)* 130 | * `resistanceStrength` The resistance of the gesture past length *(between 0-1, default 0.5)* 131 | * `swipeEnabled` - Where the row should respond to gestures 132 | * `onGestureStart` - Called on initial gesture, before 'onSwipeStart' 133 | * `onSwipeStart` - Called when a gesture starts 134 | * `onSwipeUpdate` - Called each update of the gesture after start and before end 135 | * `onSwipeEnd` - Called when the gesture ends 136 | * `onOpenStart` - Called when the row open animation begins 137 | * `onOpenEnd` - Called when the row animation ends 138 | * `onCloseStart` - Called when the row close animation begins 139 | * `onCloseEnd` - Called when the row close ends 140 | * `onCapture` - Called when a gesture capture happens 141 | * `[left/right]SubView` - View to be rendered for left / right gestures 142 | * `[left/right]SubViewOptions` - Option for configuring left and right sub views 143 | * `fullWidth` - Will the view span the full width of the row *(default false)* 144 | * `closeOnPress` - Whether the row should close on a press if not followed by a valid gesture *(default true)* 145 | * `startOpen` - Whether the row should start open 146 | * `blockChildEventsWhenOpen` - If true will capture gesture events before they reach the rowView *(default: true)* 147 | * `closeOnPropUpdate` - Whether to close the row if new props come in *(default true)* 148 | * `animateRemoveSpeed` - Speed (ms) at which to animate the row when it is removed *(default: 150ms)* 149 | * `animateAddSpeed` - Speed (ms) at which to animate the row when it is removed *(default: 150ms)* 150 | 151 | ### Methods 152 | * `close(skipAnimation)` - Close row. *Optionally skip animating* 153 | * `open(side, skipAnimation)` - Open row on `side`. *Optionally skip animating* 154 | 155 | ## Feature Checklist 156 | - [x] Support left/right sub views of arbitrary size 157 | - [x] Support basic inertia 158 | - [x] Minimize the number of renders / updates 159 | - [x] Animate removal of SwipeRows from SwipeList 160 | - [x] Animate adding of SwipeRows to SwipeList 161 | - [ ] Passing left/right button props instead of views for ease of use 162 | - [ ] Multi sub view staggered position translation 163 | - [ ] Passing pan information to sub views (e.g. for animating icons, bg color, etc) 164 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | import { 2 | SwipeList 3 | } from './src/components'; 4 | 5 | export { default as constants } from './src/constants'; 6 | export { SwipeRow } from './src/components'; 7 | export { HorizontalGestureResponder } from './src/components'; 8 | export default SwipeList; -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-native-smooth-swipe-list", 3 | "version": "1.4.7", 4 | "main": "index", 5 | "author": "Andrew Grewell ", 6 | "description": "A swipe-able `ListView` component modeled after the list view in the iOS Mail app.", 7 | "scripts": { 8 | "start": "node node_modules/react-native/local-cli/cli.js start", 9 | "test": "jest", 10 | "clean": "rm -rf $TMPDIR/react-* && watchman watch-del-all && npm cache clean" 11 | }, 12 | "repository": { 13 | "type": "git", 14 | "url": "https://github.com/ProvataHealth/react-native-smooth-swipe-list.git" 15 | }, 16 | "license": "MIT", 17 | "keywords": [ 18 | "react-native", 19 | "react", 20 | "react-component", 21 | "swipe", 22 | "swipe list", 23 | "SwipeList", 24 | "swipeable list", 25 | "ios", 26 | "android", 27 | "native swipe list" 28 | ], 29 | "dependencies": { 30 | "create-react-class": "^15.6.3", 31 | "lodash": "^4.17.4", 32 | "prop-types": "^15.6.0", 33 | "react-addons-shallow-compare": "^15.6.2" 34 | }, 35 | "peerDependencies": { 36 | "react": "16.2.0", 37 | "react-native": "0.47.0" 38 | }, 39 | "devDependencies": { 40 | "babel-jest": "^22.1.0", 41 | "babel-preset-react-native": "^4.0.0", 42 | "jest": "^22.1.4", 43 | "react-test-renderer": "^16.2.0" 44 | }, 45 | "jest": { 46 | "preset": "react-native", 47 | "testPathIgnorePatterns": [ 48 | "/node_modules/", 49 | "/Example/" 50 | ] 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/components/HorizontalGestureResponder.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import PropTypes from 'prop-types'; 3 | import { PanResponder, Animated } from 'react-native'; 4 | import shallowCompare from 'react-addons-shallow-compare'; 5 | import createReactClass from 'create-react-class'; 6 | 7 | import { 8 | isValidHorizontalGesture, 9 | } from '../util/gesture/index'; 10 | 11 | 12 | const HorizontalGestureResponder = createReactClass({ 13 | 14 | propTypes: { 15 | enabled: PropTypes.bool, // should we respond to gestures 16 | leftGestureEnabled: PropTypes.bool, 17 | rightGestureEnabled: PropTypes.bool, 18 | shouldSetResponderOnStart: PropTypes.func, 19 | shouldSetResponderOnMove: PropTypes.func, 20 | shouldSetResponderCapture: PropTypes.func, // hook for becoming capture on start 21 | allowTermination: PropTypes.bool, // should we allow another responder to capture? 22 | onGestureStart: PropTypes.func, 23 | onResponderStart: PropTypes.func, 24 | onResponderEnd: PropTypes.func, 25 | onResponderUpdate: PropTypes.func, 26 | onInvalidGesture: PropTypes.func 27 | }, 28 | 29 | getDefaultProps() { 30 | return { 31 | enabled: true, 32 | leftGestureEnabled: true, 33 | rightGestureEnabled: true, 34 | allowTermination: false, 35 | shouldSetResponderCapture: () => false, 36 | shouldSetResponderOnMove: () => true, 37 | shouldSetResponderOnStart: () => false, 38 | onGestureStart: () => {}, 39 | onResponderStart: () => {}, 40 | onResponderEnd: () => {}, 41 | onResponderUpdate: () => {}, 42 | onInvalidGesture: () => {} 43 | }; 44 | }, 45 | 46 | componentWillMount() { 47 | this.panResponder = PanResponder.create({ 48 | onStartShouldSetPanResponderCapture: this.handleOnStartShouldSetPanResponderCapture, 49 | onStartShouldSetPanResponder: this.handleOnStartShouldSetPanResponder, 50 | onMoveShouldSetPanResponder: this.handleOnMoveShouldSetPanResponder, 51 | onPanResponderGrant: this.handleResponderStart, 52 | onPanResponderMove: this.handlePanResponderMove, 53 | onPanResponderRelease: this.handlePanResponderEnd, 54 | onPanResponderTerminationRequest: () => this.props.allowTermination, 55 | onPanResponderTerminate: this.handlePanResponderEnd 56 | }); 57 | }, 58 | 59 | shouldComponentUpdate(nextProps, nextState) { 60 | return shallowCompare(this, nextProps, nextState); 61 | }, 62 | 63 | handleOnStartShouldSetPanResponderCapture(e, g) { 64 | this.props.onGestureStart(e, g); 65 | return this.props.enabled && this.props.shouldSetResponderCapture(e, g); 66 | }, 67 | 68 | handleOnStartShouldSetPanResponder(e, g) { 69 | return this.props.enabled && this.props.shouldSetResponderOnStart(e, g); 70 | }, 71 | 72 | handleOnMoveShouldSetPanResponder(e, g) { 73 | if (this.props.enabled && this.props.shouldSetResponderOnMove(e, g)) { 74 | if (isValidHorizontalGesture(g)) { 75 | return true; 76 | } 77 | else { 78 | this.props.onInvalidGesture(e, g); 79 | return false; 80 | } 81 | } 82 | return false; 83 | }, 84 | 85 | handleResponderStart(e, g) { 86 | return this.props.onResponderStart(e, g); 87 | }, 88 | 89 | handlePanResponderMove(e, g) { 90 | return this.props.onResponderUpdate(e, g); 91 | }, 92 | 93 | handlePanResponderEnd(e, g) { 94 | return this.props.onResponderEnd(e, g); 95 | }, 96 | 97 | render() { 98 | let panHandlers = this.props.enabled ? this.panResponder.panHandlers : {}; 99 | return ( 100 | 101 | {this.props.children} 102 | 103 | ); 104 | } 105 | }); 106 | 107 | 108 | export default HorizontalGestureResponder; -------------------------------------------------------------------------------- /src/components/SwipeList.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import PropTypes from 'prop-types'; 3 | import { StyleSheet, View, ListView, ScrollView, ViewPropTypes, FlatList } from 'react-native'; 4 | import createReactClass from 'create-react-class'; 5 | import shallowCompare from 'react-addons-shallow-compare'; 6 | import reduce from 'lodash/reduce'; 7 | import every from 'lodash/every'; 8 | import some from 'lodash/some'; 9 | import map from 'lodash/map'; 10 | 11 | import SwipeRow from './SwipeRow'; 12 | 13 | const SWIPE_STATE = { 14 | SWIPE_START: 'swipeStart', 15 | SWIPE_END: 'swipeEnd', 16 | ROW_OPEN_START: 'rowOpenStart', 17 | ROW_OPEN_END: 'rowOpenEnd', 18 | ROW_CLOSE_START: 'rowCloseStart', 19 | ROW_CLOSE_END: 'rowCloseEnd' 20 | }; 21 | 22 | 23 | const SwipeList = createReactClass({ 24 | 25 | propTypes: { 26 | rowData: (props, propName, componentName) => { 27 | let rowData = props[propName]; 28 | if (rowData) { 29 | let isArray = rowData instanceof Array; 30 | let correctShape = every(rowData, data => { 31 | return (data instanceof Object) && data.id != null; 32 | }); 33 | if (!isArray || !correctShape) { 34 | return new Error( 35 | `Invalid prop ${propName} supplied to ${componentName} ` + 36 | `${propName} must be an Array of objects with ids` 37 | ); 38 | } 39 | } 40 | }, 41 | style: ViewPropTypes.style, 42 | rowStyle: ViewPropTypes.style, 43 | scrollEnabled: PropTypes.bool, 44 | onScrollStateChange: PropTypes.func, 45 | gestureTensionParams: PropTypes.shape({ 46 | length: PropTypes.number, 47 | stretch: PropTypes.number, 48 | resistanceStrength: PropTypes.number 49 | }), 50 | isScrollView: PropTypes.bool, 51 | swipeRowProps: PropTypes.object, 52 | onSwipeStateChange: PropTypes.func 53 | }, 54 | 55 | getDefaultProps() { 56 | return { 57 | scrollEnabled: true, 58 | onSwipeStateChange: () => {}, 59 | onScrollStateChange: () => {}, 60 | keyExtractor: (item, index) => (item.key || item.id || index) 61 | }; 62 | }, 63 | 64 | getInitialState() { 65 | return { 66 | scrollEnabled: this.props.scrollEnabled, 67 | dataSource: this.props.rowData || [] 68 | }; 69 | }, 70 | 71 | componentWillMount() { 72 | this.closeTimeout = null; 73 | this.rowRefs = {}; 74 | }, 75 | 76 | componentWillUnmount() { 77 | this.clearCloseTimeout(); 78 | }, 79 | 80 | shouldComponentUpdate(nextProps, nextState) { 81 | return shallowCompare(this, nextProps, nextState); 82 | }, 83 | 84 | componentWillReceiveProps(nextProps) { 85 | if (this.props.rowData !== nextProps.rowData) { 86 | this.checkAnimateRemoveRow(nextProps.rowData); 87 | this.checkAnimateAddRow(nextProps.rowData); 88 | } 89 | }, 90 | 91 | calloutRow(rowNumber, amount) { 92 | let rowData = this.state.dataSource[rowNumber - 1]; 93 | let rowId = rowData && rowData.id; 94 | let row = this.getRowRef(rowId); 95 | return row && row.calloutRow(amount); 96 | }, 97 | 98 | checkAnimateRemoveRow(nextRowData = []) { 99 | if (this.props.rowData && (nextRowData.length < this.props.rowData.length)) { 100 | let numRemoved = 0; 101 | let indexesToRemove = reduce(this.props.rowData, (result, data, i) => { 102 | let nextData = nextRowData[i - numRemoved]; 103 | let shouldRemove = !nextData || nextData.id !== data.id; 104 | if (shouldRemove) { 105 | numRemoved += 1; 106 | return result.concat([i]); 107 | } 108 | return result; 109 | }, []); 110 | //FIXME update this, probably isn't need with the FlatList 111 | let rowRefs = map(indexesToRemove, (index) => { 112 | let rowData = this.state.dataSource[index]; 113 | return getRefKeyForRow(rowData.id); 114 | }); 115 | if (rowRefs.length) { 116 | rowRefs.forEach(ref => { 117 | let component = this.rowRefs[ref]; 118 | component && component.animateOut(() => this.updateDataSource(nextRowData)); 119 | }); 120 | } 121 | } 122 | else { 123 | this.updateDataSource(nextRowData); 124 | } 125 | }, 126 | 127 | checkAnimateAddRow(nextRowData = []) { 128 | let rowsAdded = this.props.rowData ? nextRowData.length - this.props.rowData.length : nextRowData.length; 129 | if (rowsAdded > 0) { 130 | nextRowData.forEach((nextData) => { 131 | let existing = some(this.props.rowData, (prevData) => { 132 | return prevData.id === nextData.id; 133 | }); 134 | 135 | if (!existing) { 136 | nextData.isNew = true; 137 | } 138 | }); 139 | } 140 | }, 141 | 142 | updateDataSource(nextRowData) { 143 | this.setState({ 144 | dataSource: nextRowData 145 | }); 146 | }, 147 | 148 | handleSwipeStart(row, e, g) { 149 | this.tryCloseOpenRow(row); 150 | this.listView && this.listView.setNativeProps({ scrollEnabled: false }); 151 | this.props.onScrollStateChange(false); 152 | this.props.onSwipeStateChange(SWIPE_STATE.SWIPE_START); 153 | }, 154 | 155 | handleSwipeEnd(row, e, g) { 156 | this.listView && this.listView.setNativeProps({ scrollEnabled: true }); 157 | this.props.onScrollStateChange(true); 158 | this.props.onSwipeStateChange(SWIPE_STATE.SWIPE_END); 159 | }, 160 | 161 | handleRowOpenStart(row) { 162 | this.openRowRef = row; 163 | this.props.onSwipeStateChange(SWIPE_STATE.ROW_OPEN_START); 164 | }, 165 | 166 | handleRowOpenEnd(finished) { 167 | this.props.onSwipeStateChange(SWIPE_STATE.ROW_OPEN_END, finished); 168 | }, 169 | 170 | handleRowCloseStart() { 171 | this.openRowRef = null; 172 | this.props.onSwipeStateChange(SWIPE_STATE.ROW_CLOSE_START); 173 | }, 174 | 175 | handleRowCloseEnd(finished) { 176 | this.props.onSwipeStateChange(SWIPE_STATE.ROW_CLOSE_END, finished); 177 | }, 178 | 179 | tryCloseOpenRow(row) { 180 | if (this.openRowRef && this.openRowRef !== row) { 181 | this.closeOpenRow(); 182 | } 183 | }, 184 | 185 | closeOpenRow() { 186 | if (this.openRowRef && this.openRowRef.isOpen()) { 187 | this.openRowRef.close(); 188 | this.openRowRef = null; 189 | } 190 | }, 191 | 192 | onRowPressCheckSetCloseTimeout() { 193 | clearTimeout(this.closeTimeout); 194 | this.closeTimeout = setTimeout( this.closeOpenRow, 250); 195 | }, 196 | 197 | clearCloseTimeout() { 198 | clearTimeout(this.closeTimeout); 199 | this.closeTimeout = null; 200 | }, 201 | 202 | isAnotherRowOpen(row) { 203 | return !!(this.openRowRef && this.openRowRef !== row); 204 | }, 205 | 206 | setListViewRef(component) { 207 | if (component) { 208 | this.listView = component; 209 | } 210 | }, 211 | 212 | getRowRef(rowId) { 213 | return this.rowRefs[getRefKeyForRow(rowId)] 214 | }, 215 | 216 | setRowRef(component, rowId) { 217 | this.rowRefs[getRefKeyForRow(rowId)] = component; 218 | }, 219 | 220 | render() { 221 | if (this.props.isScrollView) { 222 | return ( 223 | 224 | 228 | {this.renderScrollViewRows()} 229 | 230 | 231 | ); 232 | } 233 | return ( 234 | 235 | 242 | 243 | ); 244 | }, 245 | 246 | renderScrollViewRows() { 247 | return map(this.state.dataSource, (rowData, i) => { 248 | return this.renderSwipeListItem({ index: i, item: rowData }); 249 | }); 250 | }, 251 | 252 | renderSwipeListItem({ item, index }) { 253 | let ref = this.getRowRefProvider(item.id, item, index); 254 | return ( 255 | 277 | {item.rowView} 278 | 279 | ); 280 | }, 281 | 282 | getRowRefProvider(rowId, item, index) { 283 | return (component) => { 284 | if (item.setRef) { 285 | item.setRef(component, item, index); 286 | } 287 | this.setRowRef(component, rowId); 288 | }; 289 | } 290 | }); 291 | 292 | function getRefKeyForRow(rowId) { 293 | return `${rowId}`; 294 | } 295 | 296 | 297 | const styles = StyleSheet.create({ 298 | container: { 299 | alignSelf: 'stretch' 300 | }, 301 | listView: { 302 | alignSelf: 'stretch', 303 | backgroundColor: 'rgb(111, 111, 111)' 304 | } 305 | }); 306 | 307 | SwipeList.SwipeState = SWIPE_STATE; 308 | 309 | export default SwipeList; 310 | -------------------------------------------------------------------------------- /src/components/SwipeRow.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import PropTypes from 'prop-types'; 3 | import { 4 | StyleSheet, 5 | View, 6 | Animated, 7 | Easing, 8 | ViewPropTypes 9 | } from 'react-native'; 10 | 11 | import createReactClass from 'create-react-class'; 12 | 13 | import { 14 | applySimpleTension 15 | } from '../util/gesture/index'; 16 | import { 17 | getWidth, 18 | getHeight 19 | } from '../util/layout/index'; 20 | import { 21 | GESTURE_DISTANCE_THRESHOLD, 22 | OPEN_POSITION_THRESHOLD_FACTOR, 23 | CLOSE_POSITION_THRESHOLD_FACTOR, 24 | MAX_OPEN_THRESHOLD, 25 | OPEN_TENSION_THRESHOLD 26 | } from '../constants/index'; 27 | import HorizontalGestureResponder from './HorizontalGestureResponder'; 28 | import isFinite from 'lodash/isFinite'; 29 | function isDefined(value) { 30 | return (value !== null || value !== undefined); 31 | } 32 | 33 | const SubViewOptionsShape = { 34 | fullWidth: PropTypes.bool, 35 | closeOnClick: PropTypes.bool 36 | }; 37 | 38 | const defaultSubViewOptions = { 39 | fullWidth: false, 40 | closeOnPress: true 41 | }; 42 | 43 | const SwipeRow = createReactClass({ 44 | 45 | propTypes: { 46 | style: ViewPropTypes.style, 47 | id: PropTypes.oneOfType([ 48 | PropTypes.number, 49 | PropTypes.string 50 | ]).isRequired, 51 | rowViewStyle: ViewPropTypes.style, 52 | gestureTensionParams: PropTypes.shape({ 53 | threshold: PropTypes.number, 54 | stretch: PropTypes.number, 55 | resistanceStrength: PropTypes.number 56 | }), 57 | onGestureStart: PropTypes.func, 58 | swipeEnabled: PropTypes.bool, 59 | onSwipeStart: PropTypes.func, 60 | onSwipeUpdate: PropTypes.func, 61 | onSwipeEnd: PropTypes.func, 62 | onOpenStart: PropTypes.func, 63 | onOpenEnd: PropTypes.func, 64 | onCloseStart: PropTypes.func, 65 | onCloseEnd: PropTypes.func, 66 | onCapture: PropTypes.func, 67 | leftSubView: PropTypes.element, 68 | rightSubView: PropTypes.element, 69 | leftSubViewOptions: PropTypes.shape(SubViewOptionsShape), 70 | rightSubViewOptions: PropTypes.shape(SubViewOptionsShape), 71 | startOpen: PropTypes.bool, 72 | blockChildEventsWhenOpen: PropTypes.bool, 73 | isAnotherRowOpen: PropTypes.func, 74 | closeOnPropUpdate: PropTypes.bool, 75 | animateRemoveSpeed: PropTypes.number, 76 | animateAddSpeed: PropTypes.number, 77 | startCloseTimeout: PropTypes.func.isRequired, 78 | clearCloseTimeout: PropTypes.func.isRequired, 79 | animateAdd: PropTypes.bool 80 | }, 81 | 82 | getDefaultProps() { 83 | return { 84 | swipeEnabled: true, 85 | blockChildEventsWhenOpen: true, 86 | leftSubViewOptions: defaultSubViewOptions, 87 | rightSubViewOptions: defaultSubViewOptions, 88 | closeOnPropUpdate: false, 89 | gestureTensionParams: {}, 90 | animateRemoveSpeed: 150, 91 | animateAddSpeed: 150, 92 | isAnotherRowOpen: () => false, 93 | onGestureStart: () => {}, 94 | onSwipeStart: () => {}, 95 | onSwipeUpdate: () => {}, 96 | onSwipeEnd: () => {}, 97 | onOpenStart: () => {}, 98 | onOpenEnd: () => {}, 99 | onCloseStart: () => {}, 100 | onCloseEnd: () => {} 101 | }; 102 | }, 103 | 104 | getInitialState() { 105 | return { 106 | pan: new Animated.ValueXY(), 107 | heightAnim: new Animated.Value(0), 108 | heightAnimating: false, 109 | activeSide: null, 110 | open: false 111 | }; 112 | }, 113 | 114 | componentDidMount() { 115 | this.mounted = true; 116 | }, 117 | 118 | componentWillReceiveProps(nextProps) { 119 | if (!this.props.animateAdd && nextProps.animateAdd) { 120 | this.animateIn(); 121 | } 122 | else if (this.props.id !== nextProps.id) { 123 | this.clearCloseTimeout(); 124 | this.resetState(); 125 | } 126 | this.props.closeOnPropUpdate && this.close(); 127 | }, 128 | 129 | componentWillUpdate(nextProps, nextState) { 130 | this.checkHandleSubViewWidthUpdate(nextState); 131 | }, 132 | 133 | componentDidUpdate(prevProps, prevState) { 134 | this.checkOpenOnUpdate(); 135 | }, 136 | 137 | componentWillUnmount() { 138 | this.mounted = false; 139 | this.clearCloseTimeout(); 140 | }, 141 | 142 | calloutRow(openPosition) { 143 | return new Promise((resolve) => { 144 | this.resolveCallout = resolve; 145 | if (this.gestureActive) { 146 | // user interaction takes precedence 147 | return resolve(false); 148 | } 149 | this.onSwipeStart(); 150 | this.runOpenAndClose(0, openPosition, openPosition / 25); 151 | }) 152 | }, 153 | 154 | runOpenAndClose(currentPosition, endPosition, speed) { 155 | requestAnimationFrame((timestamp) => { 156 | if (this.gestureActive) { 157 | // end if the user has started a gesture 158 | return this.resolveCallout(false); 159 | } 160 | 161 | currentPosition += speed; 162 | let absCurrent = Math.abs(currentPosition); 163 | let absEnd = Math.abs(endPosition); 164 | 165 | // close once we are past the delay 166 | if (absCurrent >= (absEnd + 75)) { 167 | return this.onSwipeEnd(null, { dx: 0, vx: 1 }).then(() => this.resolveCallout(true)); 168 | } 169 | 170 | // only animate the row while we are less than the end position 171 | if (absCurrent < absEnd) { 172 | this.onSwipeUpdate(null, { dx: currentPosition }); 173 | } 174 | 175 | // keep looping until we reach the threshold past the end, this gives the open state a little delay 176 | return this.runOpenAndClose(currentPosition, endPosition, speed); 177 | }); 178 | }, 179 | 180 | resetState(additionalState) { 181 | if (this.mounted) { 182 | this.setState({ 183 | ...this.getInitialState(), 184 | ...additionalState 185 | }); 186 | } 187 | }, 188 | 189 | checkOpenOnUpdate() { 190 | if (this.state.openOnNextUpdate) { 191 | const switchOffOpenFlag = (isLeft) => { 192 | this.setState({ 193 | openOnNextUpdate: false 194 | }, () => { 195 | let openPosition = isLeft ? this.state.leftSubViewWidth : -this.state.rightSubViewWidth; 196 | this.mounted && this.animateOpenOrClose(openPosition, 0.75, true); 197 | }); 198 | }; 199 | if (this.state.activeSide === 'left' && this.state.leftSubViewWidth) { 200 | switchOffOpenFlag(true); 201 | } 202 | else if (this.state.activeSide === 'right' && this.state.rightSubViewWidth) { 203 | switchOffOpenFlag(); 204 | } 205 | } 206 | }, 207 | 208 | checkHandleSubViewWidthUpdate(nextState) { 209 | let updateLeft = this.state.leftSubViewWidth !== nextState.leftSubViewWidth && nextState.leftSubViewWidth >= 0; 210 | let updateRight = this.state.rightSubViewWidth !== nextState.rightSubViewWidth && nextState.rightSubViewWidth >= 0; 211 | if (nextState.open && !nextState.heightAnimating && (updateLeft || updateRight)) { 212 | let activeSide = nextState.activeSide; 213 | let position = activeSide === 'left' ? nextState.leftSubViewWidth : nextState.rightSubViewWidth; 214 | this.animateOpenOrClose(position, 15, true); 215 | } 216 | }, 217 | 218 | animateIn() { 219 | this.state.heightAnim.setValue(0); 220 | this.setState({ 221 | heightAnimating: true 222 | }, () => { 223 | if (!this.mounted) { 224 | return; 225 | } 226 | Animated.timing( 227 | this.state.heightAnim, 228 | { 229 | toValue: this.state.rowHeight, 230 | duration: this.props.animateAddSpeed, 231 | easing: Easing.in(Easing.cubic) 232 | } 233 | ).start(() => this.resetState({ animateInComplete: true })); 234 | }); 235 | }, 236 | 237 | animateOut(onComplete) { 238 | this.state.heightAnim.setValue(this.state.rowHeight); 239 | this.setState({ 240 | heightAnimating: true 241 | }, () => { 242 | if (!this.mounted) { 243 | return; 244 | } 245 | Animated.timing( 246 | this.state.heightAnim, 247 | { 248 | toValue: 0, 249 | duration: this.props.animateRemoveSpeed, 250 | easing: Easing.in(Easing.cubic) 251 | } 252 | ).start(onComplete); 253 | }); 254 | }, 255 | 256 | onSwipeStart(e, g) { 257 | this.gestureActive = !!e; 258 | e && this.props.onSwipeStart(this, e, g); // support this being called manually for the callouts 259 | let offsetX = this.state.pan.x._value || 0; 260 | this.state.pan.setOffset({ x: offsetX, y: 0 }); 261 | this.state.pan.setValue({ x: 0, y: 0 }); 262 | this.clearCloseTimeout(); 263 | }, 264 | 265 | onSwipeUpdate(e, g) { 266 | let { dx } = g; 267 | e && this.props.onSwipeUpdate(this, e, g); 268 | this.state.open ? this.updatePanPosition(dx) : this.handleSwipeWhenClosed(dx); 269 | }, 270 | 271 | onSwipeEnd(e, g) { 272 | this.gestureActive = false; 273 | let { dx, vx } = g; 274 | e && this.props.onSwipeEnd(this, e, g); 275 | this.state.pan.flattenOffset(); 276 | 277 | if (this.state.open) { 278 | return this.checkAnimateOpenOrClose(dx, vx); 279 | } 280 | else if (this.state.activeSide === 'left' && dx > 0 || this.state.activeSide === 'right' && dx < 0) { 281 | return this.checkAnimateOpenOrClose(dx, vx); 282 | } 283 | else { 284 | return this.checkAnimateOpenOrClose(0, vx); 285 | } 286 | }, 287 | 288 | handleSwipeWhenClosed(dx) { 289 | if (dx >= 0) { 290 | if (!this.state.activeSide && this.props.leftSubView) { 291 | this.setState({ 292 | activeSide: 'left' 293 | }); 294 | } 295 | this.updatePanPosition(dx); 296 | } 297 | else if (dx <= 0) { 298 | if (!this.state.activeSide && this.props.rightSubView) { 299 | this.setState({ 300 | activeSide: 'right' 301 | }); 302 | } 303 | this.updatePanPosition(dx); 304 | } 305 | }, 306 | 307 | updatePanPosition(dx) { 308 | let relativeDX = this.getRelativeDX(dx); 309 | let absOffset = Math.abs(this.state.pan.x._offset); 310 | if (this.state.activeSide === 'left') { 311 | let threshold = (this.state.leftSubViewWidth - absOffset); 312 | dx = relativeDX >= threshold ? dx : -(this.state.leftSubViewWidth - threshold); 313 | if (dx > 0) { 314 | dx = this.applyTensionToGesture(dx); 315 | } 316 | this.setPanPosition(dx); 317 | } 318 | else if (this.state.activeSide === 'right') { 319 | let threshold = (this.state.rightSubViewWidth - absOffset); 320 | dx = relativeDX >= threshold ? dx : (this.state.rightSubViewWidth - threshold); 321 | if (dx < 0) { 322 | dx = this.applyTensionToGesture(dx); 323 | } 324 | this.setPanPosition(dx); 325 | } 326 | }, 327 | 328 | getRelativeDX(dx) { 329 | if (this.state.activeSide === 'left') { 330 | return dx + this.state.leftSubViewWidth; 331 | } 332 | else if (this.state.activeSide === 'right') { 333 | return this.state.rightSubViewWidth - dx; 334 | } 335 | }, 336 | 337 | setPanPosition(dx) { 338 | if (isFinite(dx)) { 339 | this.state.pan.setValue({ x: dx, y: 0 }); 340 | } 341 | }, 342 | 343 | applyTensionToGesture(dx) { 344 | let tensionParams = this.props.gestureTensionParams; 345 | let tensionThreshold = this.state.open 346 | ? OPEN_TENSION_THRESHOLD 347 | : (tensionParams.threshold || this.getActiveSubViewWidth()); 348 | return applySimpleTension( 349 | dx, 350 | tensionThreshold, 351 | tensionParams.stretch, 352 | tensionParams.resistanceStrength 353 | ); 354 | }, 355 | 356 | checkAnimateOpenOrClose(dx, vx) { 357 | if ((Math.abs(dx) <= GESTURE_DISTANCE_THRESHOLD) && this.state.open) { 358 | return this.animateOpenOrClose(0, vx); 359 | } 360 | else { 361 | return this.checkOpenOrClose(dx, vx); 362 | } 363 | }, 364 | 365 | checkOpenOrClose(dx, vx) { 366 | let isLeft = this.state.activeSide === 'left'; 367 | let openPosition = this.getActiveSubViewOpenPosition(); 368 | let toValue; 369 | let isOpen; 370 | if (this.state.open) { 371 | let pastClosedThreshold = this.isPastCloseThreshold(dx, vx); 372 | if ((dx > 0 && isLeft) || (dx < 0 && !isLeft)) { 373 | isOpen = true; 374 | toValue = openPosition; 375 | } 376 | else { 377 | isOpen = !pastClosedThreshold; 378 | toValue = pastClosedThreshold ? 0 : openPosition; 379 | } 380 | } 381 | else { 382 | let pastOpenThreshold = this.isPastOpenThreshold(dx, vx); 383 | isOpen = pastOpenThreshold; 384 | toValue = pastOpenThreshold ? openPosition : 0; 385 | } 386 | return this.animateOpenOrClose(toValue, vx); 387 | }, 388 | 389 | isPastOpenThreshold(dx, vx) { 390 | if (dx > 0 && this.props.leftSubView || dx < 0 && this.props.rightSubView) { 391 | let thresholdBase = this.getActiveSubViewWidth() * OPEN_POSITION_THRESHOLD_FACTOR; 392 | let absVX = Math.abs(vx); 393 | let velocityMod = (absVX * (thresholdBase * 2)); 394 | let threshold = thresholdBase - velocityMod; 395 | return Math.abs(dx) >= Math.min(threshold, MAX_OPEN_THRESHOLD); 396 | } 397 | 398 | return false; 399 | }, 400 | 401 | isPastCloseThreshold(dx, vx) { 402 | let thresholdBase = this.getActiveSubViewWidth() * CLOSE_POSITION_THRESHOLD_FACTOR; 403 | let absVX = Math.abs(vx); 404 | let velocityMod = (absVX * (thresholdBase * 2)); 405 | let threshold = thresholdBase - velocityMod; 406 | return Math.abs(dx) >= threshold; 407 | }, 408 | 409 | close(skipAnimation) { 410 | // don't allow a manual close if the gesture is active 411 | if (this.state.open && !this.gestureActive) { 412 | this.clearCloseTimeout(); 413 | if (skipAnimation) { 414 | this.setState({ pan: new Animated.ValueXY() }); 415 | this.props.onCloseStart(); 416 | this.props.onCloseEnd(true); 417 | } 418 | else { 419 | this.animateOpenOrClose(0, 1.75, true); 420 | } 421 | } 422 | }, 423 | 424 | open(side, skipAnimation) { 425 | if (!this.state.open) { 426 | this.clearCloseTimeout(); 427 | let openPosition = side === 'left' ? this.state.leftSubViewWidth : -this.state.rightSubViewWidth; 428 | if (skipAnimation) { 429 | this.setState({ 430 | pan: new Animated.ValueXY({ x: openPosition, y: 0 }), 431 | activeSide: side, 432 | open: true 433 | }); 434 | this.props.onOpenStart(this); 435 | this.props.onOpenEnd(true); 436 | } 437 | else { 438 | this.setState({ 439 | activeSide: side, 440 | openOnNextUpdate: true, 441 | }); 442 | } 443 | } 444 | }, 445 | 446 | animateOpenOrClose(toValue, vx, noBounce) { 447 | if (!this.mounted) { 448 | return Promise.resolve(); 449 | } 450 | let isOpen = toValue !== 0; 451 | 452 | // don't wait for the animation to change the open state 453 | isOpen ? this.props.onOpenStart(this) : this.props.onCloseStart(); 454 | this.setState({ 455 | open: isOpen 456 | }); 457 | 458 | return new Promise((resolve) => { 459 | Animated.spring( 460 | this.state.pan, 461 | { 462 | toValue: { x: toValue, y: 0 }, 463 | velocity: vx, 464 | friction: noBounce ? 10 : 5, 465 | tension: 22 * Math.abs(vx) 466 | } 467 | ).start(({ finished }) => { 468 | resolve(); 469 | this.onAnimateFinish(finished, isOpen); 470 | }); 471 | }); 472 | }, 473 | 474 | onAnimateFinish(finished, isOpen) { 475 | if (this.mounted) { 476 | isOpen ? this.props.onOpenEnd(finished) : this.props.onCloseEnd(finished); 477 | if (this.state.pan.x._value === 0) { 478 | this.setState({ 479 | activeSide: isOpen ? this.state.activeSide : null 480 | }); 481 | } 482 | } 483 | }, 484 | 485 | isOpen() { 486 | return this.state.open; 487 | }, 488 | 489 | getActiveSubViewOpenPosition() { 490 | return this.state.activeSide === 'left' 491 | ? this.state.leftSubViewWidth 492 | : -this.state.rightSubViewWidth; 493 | }, 494 | 495 | getActiveSubViewWidth() { 496 | return this.state.activeSide === 'left' 497 | ? this.state.leftSubViewWidth 498 | : this.state.rightSubViewWidth; 499 | }, 500 | 501 | setRowHeight(e) { 502 | let height = getHeight(e); 503 | if (height === this.state.rowHeight || this.state.heightAnimating) { 504 | return; 505 | } 506 | this.setState({ 507 | rowHeight: height 508 | }, () => { 509 | if (this.props.animateAdd && !this.state.animateInComplete) { 510 | this.animateIn(); 511 | } 512 | }); 513 | }, 514 | 515 | setLeftSubViewWidth(e) { 516 | let width = getWidth(e); 517 | if (width !== this.state.leftSubViewWidth) { 518 | this.setState({ leftSubViewWidth: width }); 519 | } 520 | }, 521 | 522 | setRightSubViewWidth(e) { 523 | let width = getWidth(e); 524 | if (width !== this.state.rightSubViewWidth) { 525 | this.setState({ rightSubViewWidth: width }); 526 | } 527 | }, 528 | 529 | isSwipeable() { 530 | return !!(this.props.leftSubView || this.props.rightSubView) && this.props.swipeEnabled; 531 | }, 532 | 533 | checkSetCloseTimeout(e, g) { 534 | this.props.onGestureStart(this, e, g); 535 | this.props.startCloseTimeout(); 536 | return this.props.isAnotherRowOpen(this); 537 | }, 538 | 539 | clearCloseTimeout() { 540 | this.props.clearCloseTimeout(); 541 | }, 542 | 543 | shouldCloseOnClick() { 544 | let options = this.state.activeSide === 'left' ? this.props.leftSubViewOptions : this.props.rightSubViewOptions; 545 | let closeOnPress = options.fullWidth ? false : options.closeOnPress; 546 | return isDefined(closeOnPress) ? closeOnPress : defaultSubViewOptions.closeOnPress; 547 | }, 548 | 549 | render() { 550 | return ( 551 | 553 | 560 | {this.renderSubView()} 561 | 563 | {React.cloneElement(React.Children.only(this.props.children), 564 | { 565 | open: this.state.open, 566 | openRow: this.open, 567 | closeRow: this.close 568 | })} 569 | 570 | 571 | 572 | ); 573 | }, 574 | 575 | getHeightStyle() { 576 | if (this.state.heightAnimating) { 577 | return { 578 | height: this.state.heightAnim, 579 | overflow: 'hidden' 580 | }; 581 | } 582 | }, 583 | 584 | getRowPointerEvents() { 585 | return (this.state.open && this.props.blockChildEventsWhenOpen) ? 'none' : 'box-none'; 586 | }, 587 | 588 | renderSubView() { 589 | let activeSide = this.state.activeSide; 590 | let isLeft = activeSide === 'left'; 591 | let subView = this.getActiveSubView(isLeft); 592 | let onLayout = this.getActiveSubViewOnLayout(isLeft); 593 | let activeSideStyle = this.getActiveSideStyle(isLeft); 594 | let panStyle = this.getSubViewPanStyle(isLeft); 595 | let wrapperStyle = this.getSubViewWrapperStyle(isLeft); 596 | if (activeSide && subView) { 597 | return ( 598 | 599 | 600 | {React.cloneElement(subView, { open: this.state.open })} 601 | 602 | 603 | ); 604 | } 605 | }, 606 | 607 | checkGetBlockCloseTimeout(isLeft) { 608 | let opts = isLeft ? this.props.leftSubViewOptions : this.props.rightSubViewOptions; 609 | if (!opts.fullWidth) { 610 | return; 611 | } 612 | return { onStartShouldSetResponderCapture: this.props.clearCloseTimeout }; 613 | }, 614 | 615 | getActiveSubView(isLeft) { 616 | return isLeft ? this.props.leftSubView : this.props.rightSubView; 617 | }, 618 | 619 | getActiveSubViewOnLayout(isLeft) { 620 | return isLeft ? this.setLeftSubViewWidth : this.setRightSubViewWidth; 621 | }, 622 | 623 | getSubViewWrapperStyle(isLeft) { 624 | let widthKnown = isLeft ? this.state.leftSubViewWidth : this.state.rightSubViewWidth; 625 | let fullWidth = isLeft 626 | ? this.props.leftSubViewOptions.fullWidth 627 | : this.props.rightSubViewOptions.fullWidth; 628 | 629 | fullWidth = isDefined(fullWidth) ? fullWidth : defaultSubViewOptions.fullWidth; 630 | return { 631 | opacity: widthKnown ? 1 : 0, 632 | flex: fullWidth ? 1 : 0 633 | }; 634 | }, 635 | 636 | getActiveSideStyle(isLeft) { 637 | return isLeft ? styles.leftSubView : styles.rightSubView; 638 | }, 639 | 640 | getSubViewPanStyle() { 641 | if (this.state.activeSide === 'left' && this.state.leftSubViewWidth) { 642 | return { 643 | transform: [{ 644 | translateX: this.state.pan.x.interpolate({ 645 | inputRange: [0, this.state.leftSubViewWidth], 646 | outputRange: [-this.state.leftSubViewWidth, 0] 647 | }) 648 | }] 649 | }; 650 | } 651 | else if (this.state.activeSide === 'right' && this.state.rightSubViewWidth) { 652 | return { 653 | transform: [{ 654 | translateX: this.state.pan.x.interpolate({ 655 | inputRange: [-this.state.rightSubViewWidth, 0], 656 | outputRange: [0, this.state.rightSubViewWidth] 657 | }) 658 | }] 659 | }; 660 | } 661 | } 662 | }); 663 | 664 | const styles = StyleSheet.create({ 665 | container: { 666 | alignSelf: 'stretch', 667 | backgroundColor: 'transparent' 668 | }, 669 | containerInner: { 670 | alignSelf: 'stretch' 671 | }, 672 | subViewContainer: { 673 | position: 'absolute', 674 | flexDirection: 'row', 675 | left: 0, 676 | right: 0, 677 | top: 0, 678 | bottom: 0 679 | }, 680 | subViewWrapper: { 681 | flexDirection: 'row', 682 | alignItems: 'stretch', 683 | alignSelf: 'stretch' 684 | }, 685 | fullSubView: { 686 | flex: 1 687 | }, 688 | leftSubView: { 689 | alignItems: 'flex-start' 690 | }, 691 | rightSubView: { 692 | justifyContent: 'flex-end' 693 | } 694 | }); 695 | 696 | 697 | export default SwipeRow; 698 | -------------------------------------------------------------------------------- /src/components/__tests__/HorizontalGestureResponder-test.js: -------------------------------------------------------------------------------- 1 | import 'react-native'; 2 | import React from 'react'; 3 | import { View, Text } from 'react-native'; 4 | 5 | import HorizontalGestureResponder from '../HorizontalGestureResponder'; 6 | 7 | import renderer from 'react-test-renderer'; 8 | 9 | describe('HorizontalGestureResponder', () => { 10 | 11 | it('renders correctly if enabled 1', () => { 12 | const tree = renderer.create( 13 | 14 | 15 | Child Component 16 | 17 | 18 | ); 19 | expect(tree).toMatchSnapshot(); 20 | }); 21 | 22 | it('renders correctly if disabled 1', () => { 23 | const tree = renderer.create( 24 | 25 | 26 | Child Component 27 | 28 | 29 | ); 30 | expect(tree).toMatchSnapshot(); 31 | }) 32 | }); -------------------------------------------------------------------------------- /src/components/__tests__/SwipRow-test.js: -------------------------------------------------------------------------------- 1 | import 'react-native'; 2 | import React from 'react'; 3 | import { View, Text } from 'react-native'; 4 | 5 | import SwipeRow from '../SwipeRow'; 6 | 7 | import renderer from 'react-test-renderer'; 8 | 9 | describe('SwipeRow', () => { 10 | 11 | it('renders correctly 1', () => { 12 | const tree = renderer.create( 13 | 14 | 15 | Child Component 16 | 17 | 18 | ); 19 | 20 | expect(tree).toMatchSnapshot(); 21 | }); 22 | }); -------------------------------------------------------------------------------- /src/components/__tests__/SwipeList-test.js: -------------------------------------------------------------------------------- 1 | import 'react-native'; 2 | import React from 'react'; 3 | import { View, Text } from 'react-native'; 4 | 5 | import SwipeList from '../SwipeList'; 6 | 7 | import renderer from 'react-test-renderer'; 8 | 9 | describe('SwipeList', () => { 10 | 11 | it('renders correctly 1', () => { 12 | const tree = renderer.create( 13 | 14 | 15 | Child Component 16 | 17 | 18 | ); 19 | 20 | expect(tree).toMatchSnapshot(); 21 | }); 22 | }); -------------------------------------------------------------------------------- /src/components/__tests__/__snapshots__/HorizontalGestureResponder-test.js.snap: -------------------------------------------------------------------------------- 1 | exports[`HorizontalGestureResponder renders correctly if disabled 1 1`] = ` 2 | 8 | 12 | Child Component 13 | 14 | 15 | `; 16 | 17 | exports[`HorizontalGestureResponder renders correctly if enabled 1 1`] = ` 18 | 36 | 40 | Child Component 41 | 42 | 43 | `; 44 | -------------------------------------------------------------------------------- /src/components/__tests__/__snapshots__/SwipRow-test.js.snap: -------------------------------------------------------------------------------- 1 | exports[`SwipeRow renders correctly 1 1`] = ` 2 | 12 | 18 | 27 | 31 | Child Component 32 | 33 | 34 | 35 | 36 | `; 37 | -------------------------------------------------------------------------------- /src/components/__tests__/__snapshots__/SwipeList-test.js.snap: -------------------------------------------------------------------------------- 1 | exports[`SwipeList renders correctly 1 1`] = ` 2 | 37 | `; 38 | -------------------------------------------------------------------------------- /src/components/index.js: -------------------------------------------------------------------------------- 1 | export { default as HorizontalGestureResponder } from './HorizontalGestureResponder'; 2 | export { default as SwipeList } from './SwipeList'; 3 | export { default as SwipeRow } from './SwipeRow'; -------------------------------------------------------------------------------- /src/constants/index.js: -------------------------------------------------------------------------------- 1 | // after distance a gesture must move before being considered for validation 2 | export const GESTURE_DISTANCE_THRESHOLD = 3; 3 | 4 | // what velocity is considered 'quick' 5 | export const QUICK_GESTURE_VELOCITY_THRESHOLD = 0.15; 6 | 7 | // allow the gesture angle to be ± VELOCITY_THRESHOLD_ANGLE_SLOP 8 | // e.g. if a left swipe is within 180 ± VELOCITY_THRESHOLD_ANGLE_SLOP 9 | // than the threshold will be reduced by VELOCITY_THRESHOLD_SLOP_MOD 10 | export const VELOCITY_THRESHOLD_ANGLE_SLOP = 5; 11 | 12 | // the amount to multiply the gesture velocity threshold by if it is within the angle slop 13 | export const VELOCITY_THRESHOLD_SLOP_MOD = 0.1; 14 | 15 | // velocity comes back different on android, so this value will normalize it with iOS 16 | export const ANDROID_TO_IO_VELOCITY_MOD = 220000; 17 | 18 | const TOTAL_LEFT_ANGLE = 180; 19 | const TOTAL_RIGHT_ANGLE1 = 360; 20 | const TOTAL_RIGHT_ANGLE2 = 0; 21 | const HORIZONTAL_ANGLE_THRESHOLD = 30; 22 | export const LEFT_GESTURE_ANGLE_RANGE = { 23 | MIN: TOTAL_LEFT_ANGLE - HORIZONTAL_ANGLE_THRESHOLD, 24 | MAX: TOTAL_LEFT_ANGLE + HORIZONTAL_ANGLE_THRESHOLD 25 | }; 26 | 27 | export const RIGHT_GESTURE_ANGLE_RANGE = { 28 | MIN1: TOTAL_RIGHT_ANGLE1 - HORIZONTAL_ANGLE_THRESHOLD, 29 | MAX1: TOTAL_RIGHT_ANGLE1, 30 | MIN2: TOTAL_RIGHT_ANGLE2, 31 | MAX2: TOTAL_RIGHT_ANGLE2 + HORIZONTAL_ANGLE_THRESHOLD 32 | }; 33 | 34 | export const OPEN_POSITION_THRESHOLD_FACTOR = 0.4; 35 | export const CLOSE_POSITION_THRESHOLD_FACTOR = 0.3; 36 | export const MAX_OPEN_THRESHOLD = 60; 37 | export const OPEN_VELOCITY_THRESHOLD = 0.5; 38 | export const OPEN_TENSION_THRESHOLD = 30; 39 | 40 | export default { 41 | GESTURE_DISTANCE_THRESHOLD, 42 | QUICK_GESTURE_VELOCITY_THRESHOLD, 43 | ANDROID_TO_IO_VELOCITY_MOD, 44 | VELOCITY_THRESHOLD_ANGLE_SLOP, 45 | VELOCITY_THRESHOLD_SLOP_MOD, 46 | LEFT_GESTURE_ANGLE_RANGE, 47 | RIGHT_GESTURE_ANGLE_RANGE, 48 | OPEN_POSITION_THRESHOLD_FACTOR, 49 | CLOSE_POSITION_THRESHOLD_FACTOR, 50 | MAX_OPEN_THRESHOLD, 51 | OPEN_VELOCITY_THRESHOLD, 52 | OPEN_TENSION_THRESHOLD 53 | } -------------------------------------------------------------------------------- /src/util/gesture/__mocks__/getGestureAngle.js: -------------------------------------------------------------------------------- 1 | const getGestureAngle = jest.fn(); 2 | 3 | export function mockGestureAngle(angle) { 4 | getGestureAngle.mockImplementationOnce(() => angle); 5 | } 6 | 7 | export default getGestureAngle; -------------------------------------------------------------------------------- /src/util/gesture/__mocks__/isValidVelocity.js: -------------------------------------------------------------------------------- 1 | const isValidVelocity = jest.fn((v, threshold) => v >= threshold); 2 | 3 | export default isValidVelocity; -------------------------------------------------------------------------------- /src/util/gesture/__mocks__/normalizeVelocity.js: -------------------------------------------------------------------------------- 1 | export default jest.fn(v => v); -------------------------------------------------------------------------------- /src/util/gesture/__tests__/getGestureAngle-test.js: -------------------------------------------------------------------------------- 1 | import getGestureAngle from '../getGestureAngle'; 2 | 3 | jest.unmock('../getGestureAngle'); 4 | 5 | describe('getGestureAngle', () => { 6 | it('returns the correct angle derived from a gestureState object', () => { 7 | let gestureAngle1 = getGestureAngle({ 8 | x0: 0, 9 | y0: 0, 10 | dx: 100, 11 | dy: 100 12 | }); 13 | expect(gestureAngle1).toEqual(45); 14 | 15 | let gestureAngle2 = getGestureAngle({ 16 | x0: 0, 17 | y0: 0, 18 | dx: 0, 19 | dy: 0 20 | }); 21 | expect(gestureAngle2).toEqual(0); 22 | }); 23 | }); -------------------------------------------------------------------------------- /src/util/gesture/__tests__/isValidHorizontalGestureAngle-test.js: -------------------------------------------------------------------------------- 1 | import isValidHorizontalGestureAngle from '../isValidHorizontalGestureAngle'; 2 | import getGestureAngle from '../getGestureAngle'; 3 | 4 | import { 5 | LEFT_GESTURE_ANGLE_RANGE, 6 | RIGHT_GESTURE_ANGLE_RANGE 7 | } from '../../../constants/index'; 8 | 9 | jest.unmock('../isValidHorizontalGestureAngle'); 10 | 11 | jest.mock('../getGestureAngle'); 12 | import { mockGestureAngle } from '../getGestureAngle'; 13 | 14 | describe('isValidHorizontalGestureAngle', () => { 15 | // VALID LEFT 16 | it('returns true for valid left gestures in min range', () => { 17 | mockGestureAngle(LEFT_GESTURE_ANGLE_RANGE.MIN); 18 | expect(isValidHorizontalGestureAngle()).toBeTruthy(); 19 | }); 20 | 21 | it('returns true for valid left gestures in max range', () => { 22 | mockGestureAngle(LEFT_GESTURE_ANGLE_RANGE.MAX); 23 | expect(isValidHorizontalGestureAngle()).toBeTruthy(); 24 | }); 25 | 26 | // VALID RIGHT 27 | it('returns true for valid right gestures in min range', () => { 28 | mockGestureAngle(RIGHT_GESTURE_ANGLE_RANGE.MIN1); 29 | expect(isValidHorizontalGestureAngle()).toBeTruthy(); 30 | 31 | mockGestureAngle(RIGHT_GESTURE_ANGLE_RANGE.MIN2); 32 | expect(isValidHorizontalGestureAngle()).toBeTruthy(); 33 | }); 34 | 35 | it('returns true for valid right gestures in max range', () => { 36 | mockGestureAngle(RIGHT_GESTURE_ANGLE_RANGE.MAX1); 37 | expect(isValidHorizontalGestureAngle()).toBeTruthy(); 38 | 39 | mockGestureAngle(RIGHT_GESTURE_ANGLE_RANGE.MAX2); 40 | expect(isValidHorizontalGestureAngle()).toBeTruthy(); 41 | }); 42 | 43 | // INVALID LEFT 44 | it('returns false for left gestures outside the min range', () => { 45 | mockGestureAngle(LEFT_GESTURE_ANGLE_RANGE.MIN - 1); 46 | expect(isValidHorizontalGestureAngle()).toBeFalsy(); 47 | }); 48 | 49 | it('returns false for left gestures outside the max range', () => { 50 | mockGestureAngle(LEFT_GESTURE_ANGLE_RANGE.MAX + 1); 51 | expect(isValidHorizontalGestureAngle()).toBeFalsy(); 52 | }); 53 | 54 | // INVALID RIGHT 55 | it('returns false for right gestures outside the min range', () => { 56 | mockGestureAngle(RIGHT_GESTURE_ANGLE_RANGE.MIN1 - 1); 57 | expect(isValidHorizontalGestureAngle()).toBeFalsy(); 58 | 59 | mockGestureAngle(RIGHT_GESTURE_ANGLE_RANGE.MIN2 - 1); 60 | expect(isValidHorizontalGestureAngle()).toBeFalsy(); 61 | }); 62 | 63 | // GENERAL INVALID 64 | it('returns false for right gestures outside the max range', () => { 65 | mockGestureAngle(RIGHT_GESTURE_ANGLE_RANGE.MAX1 + 1); 66 | expect(isValidHorizontalGestureAngle()).toBeFalsy(); 67 | 68 | mockGestureAngle(RIGHT_GESTURE_ANGLE_RANGE.MAX2 + 1); 69 | expect(isValidHorizontalGestureAngle()).toBeFalsy(); 70 | }); 71 | 72 | it('returns false for invalid params', () => { 73 | expect(isValidHorizontalGestureAngle()).toBeFalsy(); 74 | }) 75 | }); -------------------------------------------------------------------------------- /src/util/gesture/__tests__/isValidHorizontalGestureSpeed-test.js: -------------------------------------------------------------------------------- 1 | import isValidHorizontalGestureSpeed from '../isValidHorizontalGestureSpeed'; 2 | import isValidVelocity from '../isValidVelocity'; 3 | import { mockGestureAngle } from '../getGestureAngle'; 4 | 5 | import { 6 | QUICK_GESTURE_VELOCITY_THRESHOLD, 7 | VELOCITY_THRESHOLD_ANGLE_SLOP, 8 | VELOCITY_THRESHOLD_SLOP_MOD 9 | } from '../../../constants/index'; 10 | 11 | jest.unmock('../isValidHorizontalGestureSpeed'); 12 | jest.mock('../getGestureAngle'); 13 | jest.mock('../isValidVelocity'); 14 | 15 | 16 | describe('isValidHorizontalGestureSpeed', () => { 17 | 18 | it('returns true for normal speeds inside horizontal threshold', () => { 19 | mockGestureAngle(180 + VELOCITY_THRESHOLD_ANGLE_SLOP); 20 | let velocity = QUICK_GESTURE_VELOCITY_THRESHOLD; 21 | expect(isValidHorizontalGestureSpeed({ vx: velocity })).toBeTruthy(); 22 | }); 23 | 24 | it('returns true for slower speeds with with shallower angle', () => { 25 | mockGestureAngle(180 + VELOCITY_THRESHOLD_ANGLE_SLOP); 26 | let velocity = QUICK_GESTURE_VELOCITY_THRESHOLD * VELOCITY_THRESHOLD_SLOP_MOD; 27 | expect(isValidHorizontalGestureSpeed({ vx: velocity })).toBeTruthy(); 28 | }); 29 | 30 | it('returns false if speed is too slow', () => { 31 | expect(isValidHorizontalGestureSpeed({ vx: QUICK_GESTURE_VELOCITY_THRESHOLD * 0.99 })).toBeFalsy(); 32 | }); 33 | }); -------------------------------------------------------------------------------- /src/util/gesture/__tests__/isValidVelocity-test.js: -------------------------------------------------------------------------------- 1 | import isValidVelocity from '../isValidVelocity'; 2 | 3 | jest.unmock('../isValidVelocity'); 4 | 5 | describe('isValidVelocity', () => { 6 | it('returns true if over threshold', () => { 7 | expect(isValidVelocity(5.1, 5)); 8 | }); 9 | 10 | it('returns false if under threshold', () => { 11 | expect(isValidVelocity(4.9, 5)); 12 | }); 13 | }); -------------------------------------------------------------------------------- /src/util/gesture/applySimpleTension.js: -------------------------------------------------------------------------------- 1 | import clamp from 'lodash/clamp'; 2 | 3 | const MIN_RESISTANCE = 0.5; 4 | 5 | export default function applySimpleTension(dx, threshold = 50, stretch = 3, resistanceStrength = 0.55) { 6 | let absDX = Math.abs(dx); 7 | if (absDX > threshold) { 8 | stretch = Math.max(stretch, 1); 9 | let delta = absDX - threshold; 10 | let maxLength = threshold * stretch; 11 | let resistanceBase = MIN_RESISTANCE + ((1 - MIN_RESISTANCE) * clamp(resistanceStrength, 0, 1)); 12 | let resistanceDelta = 1 - resistanceBase; 13 | let change = (maxLength - threshold); 14 | let progress = Math.min(delta / change, 1); 15 | let resistance = resistanceBase + (resistanceDelta * progress); 16 | return ((absDX + (change * (resistanceDelta * progress))) - (delta * resistance)) * Math.sign(dx); 17 | } 18 | 19 | return dx; 20 | } -------------------------------------------------------------------------------- /src/util/gesture/getGestureAngle.js: -------------------------------------------------------------------------------- 1 | 2 | 3 | /** 4 | * 5 | * @param {object} g - gestureState object 6 | * @see {@link https://facebook.github.io/react-native/docs/panresponder.html } 7 | * @return {float} - between 0 and 360 8 | */ 9 | export default function getGestureAngle(g) { 10 | let startPoint = { x: g.x0, y: g.y0 }; 11 | let endPoint = { x: g.dx, y: g.dy }; 12 | return getAngleBetweenPoints(startPoint, endPoint); 13 | } 14 | 15 | // referenced: https://gist.github.com/conorbuck/2606166 16 | function getAngleBetweenPoints(p1 = { x: 0, y: 0 }, p2 = { x: 0, y: 0 }, returnRadians) { 17 | let angle = Math.atan2(p2.y - p1.y, p2.x - p1.x); 18 | if (!returnRadians) { 19 | angle = angle * 360 / (2* Math.PI); 20 | 21 | angle = angle < 0 ? angle + 360 : angle; 22 | } 23 | return angle; 24 | } -------------------------------------------------------------------------------- /src/util/gesture/index.js: -------------------------------------------------------------------------------- 1 | export { default as applySimpleTension } from './applySimpleTension'; 2 | export { default as getGestureAngle } from './getGestureAngle'; 3 | export { default as isValidHorizontalGestureAngle } from './isValidHorizontalGestureAngle'; 4 | export { default as isValidHorizontalGestureSpeed } from './isValidHorizontalGestureSpeed'; 5 | export { default as isValidGestureDistance } from './isValidGestureDistance'; 6 | export { default as isValidHorizontalGesture } from './isValidHorizontalGesture'; 7 | export { default as isValidVelocity } from './isValidVelocity'; 8 | -------------------------------------------------------------------------------- /src/util/gesture/isValidGestureDistance.js: -------------------------------------------------------------------------------- 1 | import { GESTURE_DISTANCE_THRESHOLD } from '../../constants/index'; 2 | 3 | export default function(g) { 4 | let { dx } = g; 5 | return Math.abs(dx) > GESTURE_DISTANCE_THRESHOLD; 6 | } -------------------------------------------------------------------------------- /src/util/gesture/isValidHorizontalGesture.js: -------------------------------------------------------------------------------- 1 | import isValidGestureDistance from './isValidGestureDistance'; 2 | import isValidHorizontalGestureAngle from './isValidHorizontalGestureAngle'; 3 | import isValidHorizontalGestureSpeed from './isValidHorizontalGestureSpeed'; 4 | 5 | export default function isValidHorizontalGesture(g) { 6 | return isValidGestureDistance(g) && isValidHorizontalGestureAngle(g) && isValidHorizontalGestureSpeed(g); 7 | } -------------------------------------------------------------------------------- /src/util/gesture/isValidHorizontalGestureAngle.js: -------------------------------------------------------------------------------- 1 | import inRange from 'lodash/inRange'; 2 | 3 | import { 4 | LEFT_GESTURE_ANGLE_RANGE, 5 | RIGHT_GESTURE_ANGLE_RANGE, 6 | } from '../../constants/index'; 7 | import getGestureAngle from './getGestureAngle'; 8 | 9 | 10 | /** 11 | * 12 | * @param {object} g - gestureState object 13 | * @see {@link https://facebook.github.io/react-native/docs/panresponder.html } 14 | * @return {bool} 15 | */ 16 | export default function isValidHorizontalGestureAngle(g) { 17 | let gestureAngle = getGestureAngle(g); 18 | let isLeftRange = inRange(gestureAngle, LEFT_GESTURE_ANGLE_RANGE.MIN, LEFT_GESTURE_ANGLE_RANGE.MAX + 1); 19 | let isRightRange = inRange( 20 | gestureAngle, 21 | RIGHT_GESTURE_ANGLE_RANGE.MIN1, 22 | RIGHT_GESTURE_ANGLE_RANGE.MAX1 + 1 23 | ) || inRange(gestureAngle, RIGHT_GESTURE_ANGLE_RANGE.MIN2, RIGHT_GESTURE_ANGLE_RANGE.MAX2 + 1); 24 | 25 | return isLeftRange || isRightRange; 26 | }; -------------------------------------------------------------------------------- /src/util/gesture/isValidHorizontalGestureSpeed.js: -------------------------------------------------------------------------------- 1 | import inRange from 'lodash/inRange'; 2 | 3 | import { 4 | VELOCITY_THRESHOLD_ANGLE_SLOP, 5 | VELOCITY_THRESHOLD_SLOP_MOD, 6 | QUICK_GESTURE_VELOCITY_THRESHOLD 7 | } from '../../constants/index'; 8 | import getGestureAngle from './getGestureAngle'; 9 | import isValidVelocity from './isValidVelocity'; 10 | 11 | /** 12 | * 13 | * @param {object} g - gestureState object 14 | * @param {float} [thresholdOverride] - value to use instead of the quick gesture constant 15 | * @return {bool} 16 | */ 17 | export default function isValidHorizontalGestureSpeed(g, thresholdOverride) { 18 | // the closer we are to horizontal, decrease the velocity threshold, for simplicity sake making it a static range 19 | let gestureAngle = getGestureAngle(g); 20 | let insideLeftSlop = inRange( 21 | gestureAngle, 22 | 180 - VELOCITY_THRESHOLD_ANGLE_SLOP, 23 | 180 + VELOCITY_THRESHOLD_ANGLE_SLOP + 1 24 | ); 25 | let insideRightSlop = inRange( 26 | gestureAngle, 360 - VELOCITY_THRESHOLD_ANGLE_SLOP, 27 | 361 28 | ) || inRange(gestureAngle, 0, VELOCITY_THRESHOLD_ANGLE_SLOP + 1); 29 | let baseThreshold = thresholdOverride || QUICK_GESTURE_VELOCITY_THRESHOLD; 30 | let velocityThreshold = baseThreshold * ((insideLeftSlop || insideRightSlop) ? VELOCITY_THRESHOLD_SLOP_MOD : 1); 31 | let { vx } = g; 32 | return isValidVelocity(vx, velocityThreshold); 33 | }; -------------------------------------------------------------------------------- /src/util/gesture/isValidVelocity.js: -------------------------------------------------------------------------------- 1 | 2 | export default function isValidVelocity(v, threshold) { 3 | return v ? Math.abs(v) >= threshold : false; 4 | }; 5 | 6 | -------------------------------------------------------------------------------- /src/util/index.js: -------------------------------------------------------------------------------- 1 | 2 | export { default as gesture } from './gesture/index'; 3 | export { default as layout } from './layout/index'; -------------------------------------------------------------------------------- /src/util/layout/index.js: -------------------------------------------------------------------------------- 1 | // For use with View.onLayout 2 | 3 | /** 4 | * 5 | * @param {event} e - { nativeEvent: { layout: { x, y, width, height } } } 6 | * @see {@link https://facebook.github.io/react-native/docs/view.html#onlayout } 7 | * @returns {*|layout} 8 | */ 9 | export function getLayout(e) { 10 | return e && e.nativeEvent.layout; 11 | } 12 | 13 | 14 | /** 15 | * 16 | * @param {event} e - { nativeEvent: { layout: { x, y, width, height } } } 17 | * @see {@link https://facebook.github.io/react-native/docs/view.html#onlayout } 18 | * @returns {*|float} - width 19 | */ 20 | export function getWidth(e) { 21 | return e && e.nativeEvent.layout.width; 22 | } 23 | 24 | 25 | /** 26 | * 27 | * @param {event} e - { nativeEvent: { layout: { x, y, width, height } } } 28 | * @see {@link https://facebook.github.io/react-native/docs/view.html#onlayout } 29 | * @returns {*|float} - height 30 | */ 31 | export function getHeight(e) { 32 | return e && e.nativeEvent.layout.height; 33 | } 34 | 35 | export default { 36 | getLayout, 37 | getWidth, 38 | getHeight 39 | }; --------------------------------------------------------------------------------