├── .circleci └── config.yml ├── .editorconfig ├── .gitattributes ├── .gitignore ├── .yarnrc ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── babel.config.js ├── example ├── android │ ├── app │ │ ├── build.gradle │ │ ├── debug.keystore │ │ ├── proguard-rules.pro │ │ └── src │ │ │ ├── debug │ │ │ ├── AndroidManifest.xml │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── reactnativeswipeable │ │ │ │ └── ReactNativeFlipper.java │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── reactnativeswipeable │ │ │ │ ├── MainActivity.java │ │ │ │ └── MainApplication.java │ │ │ └── res │ │ │ ├── mipmap-hdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ └── values │ │ │ ├── strings.xml │ │ │ └── styles.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ └── settings.gradle ├── app.json ├── babel.config.js ├── index.tsx ├── ios │ ├── File.swift │ ├── Podfile │ ├── Podfile.lock │ ├── SwipeableExample-Bridging-Header.h │ ├── SwipeableExample.xcodeproj │ │ ├── project.pbxproj │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── SwipeableExample.xcscheme │ ├── SwipeableExample.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ └── SwipeableExample │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── Images.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ └── Contents.json │ │ ├── Info.plist │ │ ├── LaunchScreen.storyboard │ │ └── main.m ├── metro.config.js ├── package.json ├── src │ ├── App.tsx │ └── components │ │ └── PersonItem.tsx └── yarn.lock ├── package.json ├── pictures └── intro.gif ├── scripts └── bootstrap.js ├── src ├── __tests__ │ └── index.test.tsx ├── components │ ├── SwipeableContainer.tsx │ ├── SwipeableItem.tsx │ ├── useSwipeableContext.ts │ └── utils.ts └── index.ts ├── tsconfig.build.json ├── tsconfig.json └── yarn.lock /.circleci/config.yml: -------------------------------------------------------------------------------- 1 | version: 2.1 2 | 3 | executors: 4 | default: 5 | docker: 6 | - image: circleci/node:10 7 | working_directory: ~/project 8 | 9 | commands: 10 | attach_project: 11 | steps: 12 | - attach_workspace: 13 | at: ~/project 14 | 15 | jobs: 16 | install-dependencies: 17 | executor: default 18 | steps: 19 | - checkout 20 | - attach_project 21 | - restore_cache: 22 | keys: 23 | - dependencies-{{ checksum "package.json" }} 24 | - dependencies- 25 | - restore_cache: 26 | keys: 27 | - dependencies-example-{{ checksum "example/package.json" }} 28 | - dependencies-example- 29 | - run: 30 | name: Install dependencies 31 | command: | 32 | yarn install --cwd example --frozen-lockfile 33 | yarn install --frozen-lockfile 34 | - save_cache: 35 | key: dependencies-{{ checksum "package.json" }} 36 | paths: node_modules 37 | - save_cache: 38 | key: dependencies-example-{{ checksum "example/package.json" }} 39 | paths: example/node_modules 40 | - persist_to_workspace: 41 | root: . 42 | paths: . 43 | 44 | lint: 45 | executor: default 46 | steps: 47 | - attach_project 48 | - run: 49 | name: Lint files 50 | command: | 51 | yarn lint 52 | 53 | typescript: 54 | executor: default 55 | steps: 56 | - attach_project 57 | - run: 58 | name: Typecheck files 59 | command: | 60 | yarn typescript 61 | 62 | unit-tests: 63 | executor: default 64 | steps: 65 | - attach_project 66 | - run: 67 | name: Run unit tests 68 | command: | 69 | yarn test --coverage 70 | - store_artifacts: 71 | path: coverage 72 | destination: coverage 73 | 74 | build-package: 75 | executor: default 76 | steps: 77 | - attach_project 78 | - run: 79 | name: Build package 80 | command: | 81 | yarn prepare 82 | 83 | workflows: 84 | build-and-test: 85 | jobs: 86 | - install-dependencies 87 | - lint: 88 | requires: 89 | - install-dependencies 90 | - typescript: 91 | requires: 92 | - install-dependencies 93 | - unit-tests: 94 | requires: 95 | - install-dependencies 96 | - build-package: 97 | requires: 98 | - install-dependencies 99 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig helps developers define and maintain consistent 2 | # coding styles between different editors and IDEs 3 | # editorconfig.org 4 | 5 | root = true 6 | 7 | [*] 8 | 9 | indent_style = space 10 | indent_size = 2 11 | 12 | end_of_line = lf 13 | charset = utf-8 14 | trim_trailing_whitespace = true 15 | insert_final_newline = true 16 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.pbxproj -text 2 | # specific for windows script files 3 | *.bat text eol=crlf -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # XDE 6 | .expo/ 7 | 8 | # VSCode 9 | .vscode/ 10 | jsconfig.json 11 | 12 | # Xcode 13 | # 14 | build/ 15 | *.pbxuser 16 | !default.pbxuser 17 | *.mode1v3 18 | !default.mode1v3 19 | *.mode2v3 20 | !default.mode2v3 21 | *.perspectivev3 22 | !default.perspectivev3 23 | xcuserdata 24 | *.xccheckout 25 | *.moved-aside 26 | DerivedData 27 | *.hmap 28 | *.ipa 29 | *.xcuserstate 30 | project.xcworkspace 31 | 32 | # Android/IJ 33 | # 34 | .idea 35 | .gradle 36 | local.properties 37 | android.iml 38 | 39 | # Cocoapods 40 | # 41 | example/ios/Pods 42 | 43 | # node.js 44 | # 45 | node_modules/ 46 | npm-debug.log 47 | yarn-debug.log 48 | yarn-error.log 49 | 50 | # BUCK 51 | buck-out/ 52 | \.buckd/ 53 | android/app/libs 54 | android/keystores/debug.keystore 55 | 56 | # Expo 57 | .expo/* 58 | 59 | # generated by bob 60 | lib/ 61 | -------------------------------------------------------------------------------- /.yarnrc: -------------------------------------------------------------------------------- 1 | # Override Yarn command so we can automatically setup the repo on running `yarn` 2 | 3 | yarn-path "scripts/bootstrap.js" 4 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | We want this community to be friendly and respectful to each other. Please follow it in all your interactions with the project. 4 | 5 | ## Development workflow 6 | 7 | To get started with the project, run `yarn` in the root directory to install the required dependencies for each package: 8 | 9 | ```sh 10 | yarn 11 | ``` 12 | 13 | > While it's possible to use [`npm`](https://github.com/npm/cli), the tooling is built around [`yarn`](https://classic.yarnpkg.com/), so you'll have an easier time if you use `yarn` for development. 14 | 15 | While developing, you can run the [example app](/example/) to test your changes. Any changes you make in your library's JavaScript code will be reflected in the example app without a rebuild. If you change any native code, then you'll need to rebuild the example app. 16 | 17 | To start the packager: 18 | 19 | ```sh 20 | yarn example start 21 | ``` 22 | 23 | To run the example app on Android: 24 | 25 | ```sh 26 | yarn example android 27 | ``` 28 | 29 | To run the example app on iOS: 30 | 31 | ```sh 32 | yarn example ios 33 | ``` 34 | 35 | To run the example app on Web: 36 | 37 | ```sh 38 | yarn example web 39 | ``` 40 | 41 | Make sure your code passes TypeScript and ESLint. Run the following to verify: 42 | 43 | ```sh 44 | yarn typescript 45 | yarn lint 46 | ``` 47 | 48 | To fix formatting errors, run the following: 49 | 50 | ```sh 51 | yarn lint --fix 52 | ``` 53 | 54 | Remember to add tests for your change if possible. Run the unit tests by: 55 | 56 | ```sh 57 | yarn test 58 | ``` 59 | 60 | ### Commit message convention 61 | 62 | We follow the [conventional commits specification](https://www.conventionalcommits.org/en) for our commit messages: 63 | 64 | - `fix`: bug fixes, e.g. fix crash due to deprecated method. 65 | - `feat`: new features, e.g. add new method to the module. 66 | - `refactor`: code refactor, e.g. migrate from class components to hooks. 67 | - `docs`: changes into documentation, e.g. add usage example for the module.. 68 | - `test`: adding or updating tests, e.g. add integration tests using detox. 69 | - `chore`: tooling changes, e.g. change CI config. 70 | 71 | Our pre-commit hooks verify that your commit message matches this format when committing. 72 | 73 | ### Linting and tests 74 | 75 | [ESLint](https://eslint.org/), [Prettier](https://prettier.io/), [TypeScript](https://www.typescriptlang.org/) 76 | 77 | We use [TypeScript](https://www.typescriptlang.org/) for type checking, [ESLint](https://eslint.org/) with [Prettier](https://prettier.io/) for linting and formatting the code, and [Jest](https://jestjs.io/) for testing. 78 | 79 | Our pre-commit hooks verify that the linter and tests pass when committing. 80 | 81 | ### Publishing to npm 82 | 83 | We use [release-it](https://github.com/release-it/release-it) to make it easier to publish new versions. It handles common tasks like bumping version based on semver, creating tags and releases etc. 84 | 85 | To publish new versions, run the following: 86 | 87 | ```sh 88 | yarn release 89 | ``` 90 | 91 | ### Scripts 92 | 93 | The `package.json` file contains various scripts for common tasks: 94 | 95 | - `yarn bootstrap`: setup project by installing all dependencies and pods. 96 | - `yarn typescript`: type-check files with TypeScript. 97 | - `yarn lint`: lint files with ESLint. 98 | - `yarn test`: run unit tests with Jest. 99 | - `yarn example start`: start the Metro server for the example app. 100 | - `yarn example android`: run the example app on Android. 101 | - `yarn example ios`: run the example app on iOS. 102 | 103 | ### Sending a pull request 104 | 105 | > **Working on your first pull request?** You can learn how from this _free_ series: [How to Contribute to an Open Source Project on GitHub](https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github). 106 | 107 | When you're sending a pull request: 108 | 109 | - Prefer small pull requests focused on one change. 110 | - Verify that linters and tests are passing. 111 | - Review the documentation to make sure it looks good. 112 | - Follow the pull request template when opening a pull request. 113 | - For pull requests that change the API or implementation, discuss with maintainers first by opening an issue. 114 | 115 | ## Code of Conduct 116 | 117 | ### Our Pledge 118 | 119 | We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation. 120 | 121 | We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community. 122 | 123 | ### Our Standards 124 | 125 | Examples of behavior that contributes to a positive environment for our community include: 126 | 127 | - Demonstrating empathy and kindness toward other people 128 | - Being respectful of differing opinions, viewpoints, and experiences 129 | - Giving and gracefully accepting constructive feedback 130 | - Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience 131 | - Focusing on what is best not just for us as individuals, but for the overall community 132 | 133 | Examples of unacceptable behavior include: 134 | 135 | - The use of sexualized language or imagery, and sexual attention or 136 | advances of any kind 137 | - Trolling, insulting or derogatory comments, and personal or political attacks 138 | - Public or private harassment 139 | - Publishing others' private information, such as a physical or email 140 | address, without their explicit permission 141 | - Other conduct which could reasonably be considered inappropriate in a 142 | professional setting 143 | 144 | ### Enforcement Responsibilities 145 | 146 | Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful. 147 | 148 | Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate. 149 | 150 | ### Scope 151 | 152 | This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. 153 | 154 | ### Enforcement 155 | 156 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at [INSERT CONTACT METHOD]. All complaints will be reviewed and investigated promptly and fairly. 157 | 158 | All community leaders are obligated to respect the privacy and security of the reporter of any incident. 159 | 160 | ### Enforcement Guidelines 161 | 162 | Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct: 163 | 164 | #### 1. Correction 165 | 166 | **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community. 167 | 168 | **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested. 169 | 170 | #### 2. Warning 171 | 172 | **Community Impact**: A violation through a single incident or series of actions. 173 | 174 | **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban. 175 | 176 | #### 3. Temporary Ban 177 | 178 | **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior. 179 | 180 | **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban. 181 | 182 | #### 4. Permanent Ban 183 | 184 | **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals. 185 | 186 | **Consequence**: A permanent ban from any sort of public interaction within the community. 187 | 188 | ### Attribution 189 | 190 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0, 191 | available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. 192 | 193 | Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity). 194 | 195 | [homepage]: https://www.contributor-covenant.org 196 | 197 | For answers to common questions about this code of conduct, see the FAQ at 198 | https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations. 199 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Tuan Luong 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # react-native-swipeable 2 | 3 | Swipeable component for react native powered by Reanimated 2 and Gesture Handler 4 | 5 | ![alt text](pictures/intro.gif "Intro") 6 | ## Installation 7 | 8 | ```sh 9 | yarn add @r0b0t3d/react-native-swipeable 10 | ``` 11 | 12 | Also add dependencies, and follow instructions there to setup your project 13 | ``` 14 | yarn add react-native-reanimated react-native-gesture-handler 15 | ``` 16 | ## Usage 17 | 18 | ```js 19 | import { 20 | SwipeableItem, 21 | withSwipeableContext, 22 | useSwipeableContext, 23 | } from 'react-native-swipeable'; 24 | 25 | // ... 26 | 27 | function YourComponent() { 28 | const { close } = useSwipeableContext(); 29 | 30 | ... 31 | 32 | const renderLeftActions = useCallback(() => { 33 | return ( 34 | 35 | 36 | Pin 37 | 38 | 39 | ); 40 | }, [handlePinPress]); 41 | 42 | return ( 43 | 52 | 53 | 54 | 55 | {item.name} 56 | 57 | Lorem Ipsum is simply dummy text of the printing and typesetting 58 | industry. 59 | 60 | 61 | 62 | 63 | ); 64 | } 65 | 66 | export default withSwipeableContext(YourComponent); 67 | ``` 68 | 69 | Check [Example](example/src) for the trick I did to close the item when other opened. 70 | 71 | **Hint:** I used `Animated.ShareValue` to set the current item with menu opened 72 | 73 | ## Contributing 74 | 75 | See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow. 76 | 77 | ## License 78 | 79 | MIT 80 | -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: ['module:metro-react-native-babel-preset'], 3 | }; 4 | -------------------------------------------------------------------------------- /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 | * // https://reactnative.dev/docs/performance#enable-the-ram-format 22 | * bundleCommand: "ram-bundle", 23 | * 24 | * // whether to bundle JS and assets in debug mode 25 | * bundleInDebug: false, 26 | * 27 | * // whether to bundle JS and assets in release mode 28 | * bundleInRelease: true, 29 | * 30 | * // whether to bundle JS and assets in another build variant (if configured). 31 | * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants 32 | * // The configuration property can be in the following formats 33 | * // 'bundleIn${productFlavor}${buildType}' 34 | * // 'bundleIn${buildType}' 35 | * // bundleInFreeDebug: true, 36 | * // bundleInPaidRelease: true, 37 | * // bundleInBeta: true, 38 | * 39 | * // whether to disable dev mode in custom build variants (by default only disabled in release) 40 | * // for SwipeableExample: to disable dev mode in the staging build type (if configured) 41 | * devDisabledInStaging: true, 42 | * // The configuration property can be in the following formats 43 | * // 'devDisabledIn${productFlavor}${buildType}' 44 | * // 'devDisabledIn${buildType}' 45 | * 46 | * // the root of your project, i.e. where "package.json" lives 47 | * root: "../../", 48 | * 49 | * // where to put the JS bundle asset in debug mode 50 | * jsBundleDirDebug: "$buildDir/intermediates/assets/debug", 51 | * 52 | * // where to put the JS bundle asset in release mode 53 | * jsBundleDirRelease: "$buildDir/intermediates/assets/release", 54 | * 55 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 56 | * // require('./image.png')), in debug mode 57 | * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug", 58 | * 59 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 60 | * // require('./image.png')), in release mode 61 | * resourcesDirRelease: "$buildDir/intermediates/res/merged/release", 62 | * 63 | * // by default the gradle tasks are skipped if none of the JS files or assets change; this means 64 | * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to 65 | * // date; if you have any other folders that you want to ignore for performance reasons (gradle 66 | * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/ 67 | * // for SwipeableExample, you might want to remove it from here. 68 | * inputExcludes: ["android/**", "ios/**"], 69 | * 70 | * // override which node gets called and with what additional arguments 71 | * nodeExecutableAndArgs: ["node"], 72 | * 73 | * // supply additional arguments to the packager 74 | * extraPackagerArgs: [] 75 | * ] 76 | */ 77 | 78 | project.ext.react = [ 79 | enableHermes: true, // clean and rebuild if changing 80 | entryFile: "index.tsx", 81 | ] 82 | 83 | apply from: "../../node_modules/react-native/react.gradle" 84 | 85 | /** 86 | * Set this to true to create two separate APKs instead of one: 87 | * - An APK that only works on ARM devices 88 | * - An APK that only works on x86 devices 89 | * The advantage is the size of the APK is reduced by about 4MB. 90 | * Upload all the APKs to the Play Store and people will download 91 | * the correct one based on the CPU architecture of their device. 92 | */ 93 | def enableSeparateBuildPerCPUArchitecture = false 94 | 95 | /** 96 | * Run Proguard to shrink the Java bytecode in release builds. 97 | */ 98 | def enableProguardInReleaseBuilds = false 99 | 100 | /** 101 | * The preferred build flavor of JavaScriptCore. 102 | * 103 | * For SwipeableExample, to use the international variant, you can use: 104 | * `def jscFlavor = 'org.webkit:android-jsc-intl:+'` 105 | * 106 | * The international variant includes ICU i18n library and necessary data 107 | * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that 108 | * give correct results when using with locales other than en-US. Note that 109 | * this variant is about 6MiB larger per architecture than default. 110 | */ 111 | def jscFlavor = 'org.webkit:android-jsc:+' 112 | 113 | /** 114 | * Whether to enable the Hermes VM. 115 | * 116 | * This should be set on project.ext.react and mirrored here. If it is not set 117 | * on project.ext.react, JavaScript will not be compiled to Hermes Bytecode 118 | * and the benefits of using Hermes will therefore be sharply reduced. 119 | */ 120 | def enableHermes = project.ext.react.get("enableHermes", false); 121 | 122 | android { 123 | ndkVersion rootProject.ext.ndkVersion 124 | compileSdkVersion rootProject.ext.compileSdkVersion 125 | 126 | compileOptions { 127 | sourceCompatibility JavaVersion.VERSION_1_8 128 | targetCompatibility JavaVersion.VERSION_1_8 129 | } 130 | 131 | defaultConfig { 132 | applicationId "com.example.reactnativeswipeable" 133 | minSdkVersion rootProject.ext.minSdkVersion 134 | targetSdkVersion rootProject.ext.targetSdkVersion 135 | versionCode 1 136 | versionName "1.0" 137 | } 138 | splits { 139 | abi { 140 | reset() 141 | enable enableSeparateBuildPerCPUArchitecture 142 | universalApk false // If true, also generate a universal APK 143 | include "armeabi-v7a", "x86", "arm64-v8a", "x86_64" 144 | } 145 | } 146 | signingConfigs { 147 | debug { 148 | storeFile file('debug.keystore') 149 | storePassword 'android' 150 | keyAlias 'androiddebugkey' 151 | keyPassword 'android' 152 | } 153 | } 154 | buildTypes { 155 | debug { 156 | signingConfig signingConfigs.debug 157 | } 158 | release { 159 | // Caution! In production, you need to generate your own keystore file. 160 | // see https://reactnative.dev/docs/signed-apk-android. 161 | signingConfig signingConfigs.debug 162 | minifyEnabled enableProguardInReleaseBuilds 163 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" 164 | } 165 | } 166 | // applicationVariants are e.g. debug, release 167 | applicationVariants.all { variant -> 168 | variant.outputs.each { output -> 169 | // For each separate APK per architecture, set a unique version code as described here: 170 | // https://developer.android.com/studio/build/configure-apk-splits.html 171 | def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4] 172 | def abi = output.getFilter(OutputFile.ABI) 173 | if (abi != null) { // null for the universal-debug, universal-release variants 174 | output.versionCodeOverride = 175 | defaultConfig.versionCode * 1000 + versionCodes.get(abi) 176 | } 177 | 178 | } 179 | } 180 | } 181 | 182 | dependencies { 183 | implementation fileTree(dir: "libs", include: ["*.jar"]) 184 | //noinspection GradleDynamicVersion 185 | implementation "com.facebook.react:react-native:+" // From node_modules 186 | 187 | 188 | implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0" 189 | debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") { 190 | exclude group:'com.facebook.fbjni' 191 | } 192 | debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") { 193 | exclude group:'com.facebook.flipper' 194 | exclude group:'com.squareup.okhttp3', module:'okhttp' 195 | } 196 | debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") { 197 | exclude group:'com.facebook.flipper' 198 | } 199 | 200 | if (enableHermes) { 201 | def hermesPath = "../../node_modules/hermes-engine/android/"; 202 | debugImplementation files(hermesPath + "hermes-debug.aar") 203 | releaseImplementation files(hermesPath + "hermes-release.aar") 204 | } else { 205 | implementation jscFlavor 206 | } 207 | 208 | } 209 | 210 | // Run this once to be able to run the application with BUCK 211 | // puts all compile dependencies into folder libs for BUCK to use 212 | task copyDownloadableDepsToLibs(type: Copy) { 213 | from configurations.compile 214 | into 'libs' 215 | } 216 | 217 | apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project) 218 | -------------------------------------------------------------------------------- /example/android/app/debug.keystore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0b0t3d/react-native-swipeable/f816445074b22911f71ce714713f08ce6eb5fda0/example/android/app/debug.keystore -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /example/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/android/app/src/debug/java/com/example/reactnativeswipeable/ReactNativeFlipper.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Facebook, Inc. and its affiliates. 3 | * 4 | *

This source code is licensed under the MIT license found in the LICENSE file in the root 5 | * directory of this source tree. 6 | */ 7 | package com.example.reactnativeswipeable; 8 | 9 | import android.content.Context; 10 | import com.facebook.flipper.android.AndroidFlipperClient; 11 | import com.facebook.flipper.android.utils.FlipperUtils; 12 | import com.facebook.flipper.core.FlipperClient; 13 | import com.facebook.flipper.plugins.crashreporter.CrashReporterPlugin; 14 | import com.facebook.flipper.plugins.databases.DatabasesFlipperPlugin; 15 | import com.facebook.flipper.plugins.fresco.FrescoFlipperPlugin; 16 | import com.facebook.flipper.plugins.inspector.DescriptorMapping; 17 | import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin; 18 | import com.facebook.flipper.plugins.network.FlipperOkhttpInterceptor; 19 | import com.facebook.flipper.plugins.network.NetworkFlipperPlugin; 20 | import com.facebook.flipper.plugins.react.ReactFlipperPlugin; 21 | import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin; 22 | import com.facebook.react.ReactInstanceManager; 23 | import com.facebook.react.bridge.ReactContext; 24 | import com.facebook.react.modules.network.NetworkingModule; 25 | import okhttp3.OkHttpClient; 26 | 27 | public class ReactNativeFlipper { 28 | public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) { 29 | if (FlipperUtils.shouldEnableFlipper(context)) { 30 | final FlipperClient client = AndroidFlipperClient.getInstance(context); 31 | client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults())); 32 | client.addPlugin(new ReactFlipperPlugin()); 33 | client.addPlugin(new DatabasesFlipperPlugin(context)); 34 | client.addPlugin(new SharedPreferencesFlipperPlugin(context)); 35 | client.addPlugin(CrashReporterPlugin.getInstance()); 36 | NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin(); 37 | NetworkingModule.setCustomClientBuilder( 38 | new NetworkingModule.CustomClientBuilder() { 39 | @Override 40 | public void apply(OkHttpClient.Builder builder) { 41 | builder.addNetworkInterceptor(new FlipperOkhttpInterceptor(networkFlipperPlugin)); 42 | } 43 | }); 44 | client.addPlugin(networkFlipperPlugin); 45 | client.start(); 46 | // Fresco Plugin needs to ensure that ImagePipelineFactory is initialized 47 | // Hence we run if after all native modules have been initialized 48 | ReactContext reactContext = reactInstanceManager.getCurrentReactContext(); 49 | if (reactContext == null) { 50 | reactInstanceManager.addReactInstanceEventListener( 51 | new ReactInstanceManager.ReactInstanceEventListener() { 52 | @Override 53 | public void onReactContextInitialized(ReactContext reactContext) { 54 | reactInstanceManager.removeReactInstanceEventListener(this); 55 | reactContext.runOnNativeModulesQueueThread( 56 | new Runnable() { 57 | @Override 58 | public void run() { 59 | client.addPlugin(new FrescoFlipperPlugin()); 60 | } 61 | }); 62 | } 63 | }); 64 | } else { 65 | client.addPlugin(new FrescoFlipperPlugin()); 66 | } 67 | } 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 13 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/com/example/reactnativeswipeable/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.example.reactnativeswipeable; 2 | 3 | import com.facebook.react.ReactActivity; 4 | 5 | import com.facebook.react.ReactActivityDelegate; 6 | import com.facebook.react.ReactRootView; 7 | import com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView; 8 | 9 | public class MainActivity extends ReactActivity { 10 | 11 | /** 12 | * Returns the name of the main component registered from JavaScript. This is used to schedule 13 | * rendering of the component. 14 | */ 15 | @Override 16 | protected String getMainComponentName() { 17 | return "SwipeableExample"; 18 | } 19 | 20 | @Override 21 | protected ReactActivityDelegate createReactActivityDelegate() { 22 | return new ReactActivityDelegate(this, getMainComponentName()) { 23 | @Override 24 | protected ReactRootView createRootView() { 25 | return new RNGestureHandlerEnabledRootView(MainActivity.this); 26 | } 27 | }; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/com/example/reactnativeswipeable/MainApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.reactnativeswipeable; 2 | 3 | import android.app.Application; 4 | import android.content.Context; 5 | import com.facebook.react.PackageList; 6 | import com.facebook.react.ReactApplication; 7 | import com.facebook.react.ReactNativeHost; 8 | import com.facebook.react.ReactPackage; 9 | import com.facebook.react.ReactInstanceManager; 10 | import com.facebook.soloader.SoLoader; 11 | import java.lang.reflect.InvocationTargetException; 12 | import java.util.List; 13 | 14 | import com.facebook.react.bridge.JSIModulePackage; 15 | import com.swmansion.reanimated.ReanimatedJSIModulePackage; 16 | 17 | public class MainApplication extends Application implements ReactApplication { 18 | 19 | private final ReactNativeHost mReactNativeHost = 20 | new ReactNativeHost(this) { 21 | @Override 22 | public boolean getUseDeveloperSupport() { 23 | return BuildConfig.DEBUG; 24 | } 25 | 26 | @Override 27 | protected List getPackages() { 28 | @SuppressWarnings("UnnecessaryLocalVariable") 29 | List packages = new PackageList(this).getPackages(); 30 | // Packages that cannot be autolinked yet can be added manually here, for SwipeableExample: 31 | // packages.add(new MyReactNativePackage()); 32 | 33 | return packages; 34 | } 35 | 36 | @Override 37 | protected String getJSMainModuleName() { 38 | return "index"; 39 | } 40 | 41 | @Override 42 | protected JSIModulePackage getJSIModulePackage() { 43 | return new ReanimatedJSIModulePackage(); 44 | } 45 | }; 46 | 47 | @Override 48 | public ReactNativeHost getReactNativeHost() { 49 | return mReactNativeHost; 50 | } 51 | 52 | @Override 53 | public void onCreate() { 54 | super.onCreate(); 55 | SoLoader.init(this, /* native exopackage */ false); 56 | initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); // Remove this line if you don't want Flipper enabled 57 | } 58 | 59 | /** 60 | * Loads Flipper in React Native templates. 61 | * 62 | * @param context 63 | */ 64 | private static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) { 65 | if (BuildConfig.DEBUG) { 66 | try { 67 | /* 68 | We use reflection here to pick up the class that initializes Flipper, 69 | since Flipper library is not available in release mode 70 | */ 71 | Class aClass = Class.forName("com.reactnativeswipeableExample.ReactNativeFlipper"); 72 | aClass 73 | .getMethod("initializeFlipper", Context.class, ReactInstanceManager.class) 74 | .invoke(null, context, reactInstanceManager); 75 | } catch (ClassNotFoundException e) { 76 | e.printStackTrace(); 77 | } catch (NoSuchMethodException e) { 78 | e.printStackTrace(); 79 | } catch (IllegalAccessException e) { 80 | e.printStackTrace(); 81 | } catch (InvocationTargetException e) { 82 | e.printStackTrace(); 83 | } 84 | } 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0b0t3d/react-native-swipeable/f816445074b22911f71ce714713f08ce6eb5fda0/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0b0t3d/react-native-swipeable/f816445074b22911f71ce714713f08ce6eb5fda0/example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0b0t3d/react-native-swipeable/f816445074b22911f71ce714713f08ce6eb5fda0/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0b0t3d/react-native-swipeable/f816445074b22911f71ce714713f08ce6eb5fda0/example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0b0t3d/react-native-swipeable/f816445074b22911f71ce714713f08ce6eb5fda0/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0b0t3d/react-native-swipeable/f816445074b22911f71ce714713f08ce6eb5fda0/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0b0t3d/react-native-swipeable/f816445074b22911f71ce714713f08ce6eb5fda0/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0b0t3d/react-native-swipeable/f816445074b22911f71ce714713f08ce6eb5fda0/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0b0t3d/react-native-swipeable/f816445074b22911f71ce714713f08ce6eb5fda0/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0b0t3d/react-native-swipeable/f816445074b22911f71ce714713f08ce6eb5fda0/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | Swipeable Example 3 | 4 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /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 | ext { 5 | buildToolsVersion = "30.0.2" 6 | minSdkVersion = 21 7 | compileSdkVersion = 30 8 | targetSdkVersion = 30 9 | ndkVersion = "20.1.5948944" 10 | } 11 | repositories { 12 | google() 13 | mavenCentral() 14 | } 15 | dependencies { 16 | classpath("com.android.tools.build:gradle:4.2.1") 17 | 18 | // NOTE: Do not place your application dependencies here; they belong 19 | // in the individual module build.gradle files 20 | } 21 | } 22 | 23 | allprojects { 24 | repositories { 25 | mavenCentral() 26 | mavenLocal() 27 | maven { 28 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm 29 | url("$rootDir/../node_modules/react-native/android") 30 | } 31 | maven { 32 | // Android JSC is installed from npm 33 | url("$rootDir/../node_modules/jsc-android/dist") 34 | } 35 | 36 | google() 37 | maven { url 'https://www.jitpack.io' } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /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.useAndroidX=true 21 | android.enableJetifier=true 22 | FLIPPER_VERSION=0.93.0 23 | -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0b0t3d/react-native-swipeable/f816445074b22911f71ce714713f08ce6eb5fda0/example/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-all.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /example/android/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | # 4 | # Copyright 2015 the original author or authors. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # https://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ############################################################################## 20 | ## 21 | ## Gradle start up script for UN*X 22 | ## 23 | ############################################################################## 24 | 25 | # Attempt to set APP_HOME 26 | # Resolve links: $0 may be a link 27 | PRG="$0" 28 | # Need this for relative symlinks. 29 | while [ -h "$PRG" ] ; do 30 | ls=`ls -ld "$PRG"` 31 | link=`expr "$ls" : '.*-> \(.*\)$'` 32 | if expr "$link" : '/.*' > /dev/null; then 33 | PRG="$link" 34 | else 35 | PRG=`dirname "$PRG"`"/$link" 36 | fi 37 | done 38 | SAVED="`pwd`" 39 | cd "`dirname \"$PRG\"`/" >/dev/null 40 | APP_HOME="`pwd -P`" 41 | cd "$SAVED" >/dev/null 42 | 43 | APP_NAME="Gradle" 44 | APP_BASE_NAME=`basename "$0"` 45 | 46 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 47 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' 48 | 49 | # Use the maximum available, or set MAX_FD != -1 to use that value. 50 | MAX_FD="maximum" 51 | 52 | warn () { 53 | echo "$*" 54 | } 55 | 56 | die () { 57 | echo 58 | echo "$*" 59 | echo 60 | exit 1 61 | } 62 | 63 | # OS specific support (must be 'true' or 'false'). 64 | cygwin=false 65 | msys=false 66 | darwin=false 67 | nonstop=false 68 | case "`uname`" in 69 | CYGWIN* ) 70 | cygwin=true 71 | ;; 72 | Darwin* ) 73 | darwin=true 74 | ;; 75 | MINGW* ) 76 | msys=true 77 | ;; 78 | NONSTOP* ) 79 | nonstop=true 80 | ;; 81 | esac 82 | 83 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 84 | 85 | # Determine the Java command to use to start the JVM. 86 | if [ -n "$JAVA_HOME" ] ; then 87 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 88 | # IBM's JDK on AIX uses strange locations for the executables 89 | JAVACMD="$JAVA_HOME/jre/sh/java" 90 | else 91 | JAVACMD="$JAVA_HOME/bin/java" 92 | fi 93 | if [ ! -x "$JAVACMD" ] ; then 94 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 95 | 96 | Please set the JAVA_HOME variable in your environment to match the 97 | location of your Java installation." 98 | fi 99 | else 100 | JAVACMD="java" 101 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 102 | 103 | Please set the JAVA_HOME variable in your environment to match the 104 | location of your Java installation." 105 | fi 106 | 107 | # Increase the maximum file descriptors if we can. 108 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 109 | MAX_FD_LIMIT=`ulimit -H -n` 110 | if [ $? -eq 0 ] ; then 111 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 112 | MAX_FD="$MAX_FD_LIMIT" 113 | fi 114 | ulimit -n $MAX_FD 115 | if [ $? -ne 0 ] ; then 116 | warn "Could not set maximum file descriptor limit: $MAX_FD" 117 | fi 118 | else 119 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 120 | fi 121 | fi 122 | 123 | # For Darwin, add options to specify how the application appears in the dock 124 | if $darwin; then 125 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 126 | fi 127 | 128 | # For Cygwin or MSYS, switch paths to Windows format before running java 129 | if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then 130 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 131 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 132 | JAVACMD=`cygpath --unix "$JAVACMD"` 133 | 134 | # We build the pattern for arguments to be converted via cygpath 135 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 136 | SEP="" 137 | for dir in $ROOTDIRSRAW ; do 138 | ROOTDIRS="$ROOTDIRS$SEP$dir" 139 | SEP="|" 140 | done 141 | OURCYGPATTERN="(^($ROOTDIRS))" 142 | # Add a user-defined pattern to the cygpath arguments 143 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 144 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 145 | fi 146 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 147 | i=0 148 | for arg in "$@" ; do 149 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 150 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 151 | 152 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 153 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 154 | else 155 | eval `echo args$i`="\"$arg\"" 156 | fi 157 | i=`expr $i + 1` 158 | done 159 | case $i in 160 | 0) set -- ;; 161 | 1) set -- "$args0" ;; 162 | 2) set -- "$args0" "$args1" ;; 163 | 3) set -- "$args0" "$args1" "$args2" ;; 164 | 4) set -- "$args0" "$args1" "$args2" "$args3" ;; 165 | 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 166 | 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 167 | 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 168 | 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 169 | 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 170 | esac 171 | fi 172 | 173 | # Escape application args 174 | save () { 175 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done 176 | echo " " 177 | } 178 | APP_ARGS=`save "$@"` 179 | 180 | # Collect all arguments for the java command, following the shell quoting and substitution rules 181 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" 182 | 183 | exec "$JAVACMD" "$@" 184 | -------------------------------------------------------------------------------- /example/android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem http://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%" == "" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%" == "" set DIRNAME=. 29 | set APP_BASE_NAME=%~n0 30 | set APP_HOME=%DIRNAME% 31 | 32 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 33 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 34 | 35 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 36 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 37 | 38 | @rem Find java.exe 39 | if defined JAVA_HOME goto findJavaFromJavaHome 40 | 41 | set JAVA_EXE=java.exe 42 | %JAVA_EXE% -version >NUL 2>&1 43 | if "%ERRORLEVEL%" == "0" goto init 44 | 45 | echo. 46 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 47 | echo. 48 | echo Please set the JAVA_HOME variable in your environment to match the 49 | echo location of your Java installation. 50 | 51 | goto fail 52 | 53 | :findJavaFromJavaHome 54 | set JAVA_HOME=%JAVA_HOME:"=% 55 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 56 | 57 | if exist "%JAVA_EXE%" goto init 58 | 59 | echo. 60 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 61 | echo. 62 | echo Please set the JAVA_HOME variable in your environment to match the 63 | echo location of your Java installation. 64 | 65 | goto fail 66 | 67 | :init 68 | @rem Get command-line arguments, handling Windows variants 69 | 70 | if not "%OS%" == "Windows_NT" goto win9xME_args 71 | 72 | :win9xME_args 73 | @rem Slurp the command line arguments. 74 | set CMD_LINE_ARGS= 75 | set _SKIP=2 76 | 77 | :win9xME_args_slurp 78 | if "x%~1" == "x" goto execute 79 | 80 | set CMD_LINE_ARGS=%* 81 | 82 | :execute 83 | @rem Setup the command line 84 | 85 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 86 | 87 | @rem Execute Gradle 88 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 89 | 90 | :end 91 | @rem End local scope for the variables with windows NT shell 92 | if "%ERRORLEVEL%"=="0" goto mainEnd 93 | 94 | :fail 95 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 96 | rem the _cmd.exe /c_ return code! 97 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 98 | exit /b 1 99 | 100 | :mainEnd 101 | if "%OS%"=="Windows_NT" endlocal 102 | 103 | :omega 104 | -------------------------------------------------------------------------------- /example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'SwipeableExample' 2 | apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings) 3 | include ':app' 4 | 5 | -------------------------------------------------------------------------------- /example/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "SwipeableExample", 3 | "displayName": "Swipeable Example" 4 | } 5 | -------------------------------------------------------------------------------- /example/babel.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const pak = require('../package.json'); 3 | 4 | module.exports = { 5 | presets: ['module:metro-react-native-babel-preset'], 6 | plugins: [ 7 | [ 8 | 'module-resolver', 9 | { 10 | extensions: ['.tsx', '.ts', '.js', '.json'], 11 | alias: { 12 | [pak.name]: path.join(__dirname, '..', pak.source), 13 | }, 14 | }, 15 | ], 16 | 'react-native-reanimated/plugin', 17 | ], 18 | }; 19 | -------------------------------------------------------------------------------- /example/index.tsx: -------------------------------------------------------------------------------- 1 | import 'react-native-gesture-handler'; 2 | 3 | import { AppRegistry } from 'react-native'; 4 | import App from './src/App'; 5 | import { name as appName } from './app.json'; 6 | 7 | AppRegistry.registerComponent(appName, () => App); 8 | -------------------------------------------------------------------------------- /example/ios/File.swift: -------------------------------------------------------------------------------- 1 | // 2 | // File.swift 3 | // SwipeableExample 4 | // 5 | 6 | import Foundation 7 | -------------------------------------------------------------------------------- /example/ios/Podfile: -------------------------------------------------------------------------------- 1 | require_relative '../node_modules/react-native/scripts/react_native_pods' 2 | require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' 3 | 4 | platform :ios, '11.0' 5 | 6 | target 'SwipeableExample' do 7 | config = use_native_modules! 8 | 9 | use_react_native!( 10 | :path => config[:reactNativePath], 11 | # to enable hermes on iOS, change `false` to `true` and then install pods 12 | :hermes_enabled => true 13 | ) 14 | 15 | # Enables Flipper. 16 | # 17 | # Note that if you have use_frameworks! enabled, Flipper will not work and 18 | # you should disable these next few lines. 19 | # use_flipper!() 20 | 21 | post_install do |installer| 22 | react_native_post_install(installer) 23 | end 24 | end 25 | -------------------------------------------------------------------------------- /example/ios/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - boost-for-react-native (1.63.0) 3 | - DoubleConversion (1.1.6) 4 | - FBLazyVector (0.65.0-rc.2) 5 | - FBReactNativeSpec (0.65.0-rc.2): 6 | - RCT-Folly (= 2021.04.26.00) 7 | - RCTRequired (= 0.65.0-rc.2) 8 | - RCTTypeSafety (= 0.65.0-rc.2) 9 | - React-Core (= 0.65.0-rc.2) 10 | - React-jsi (= 0.65.0-rc.2) 11 | - ReactCommon/turbomodule/core (= 0.65.0-rc.2) 12 | - fmt (6.2.1) 13 | - glog (0.3.5) 14 | - hermes-engine (0.8.0) 15 | - libevent (2.1.12) 16 | - RCT-Folly (2021.04.26.00): 17 | - boost-for-react-native 18 | - DoubleConversion 19 | - fmt (~> 6.2.1) 20 | - glog 21 | - RCT-Folly/Default (= 2021.04.26.00) 22 | - RCT-Folly/Default (2021.04.26.00): 23 | - boost-for-react-native 24 | - DoubleConversion 25 | - fmt (~> 6.2.1) 26 | - glog 27 | - RCT-Folly/Futures (2021.04.26.00): 28 | - boost-for-react-native 29 | - DoubleConversion 30 | - fmt (~> 6.2.1) 31 | - glog 32 | - libevent 33 | - RCTRequired (0.65.0-rc.2) 34 | - RCTTypeSafety (0.65.0-rc.2): 35 | - FBLazyVector (= 0.65.0-rc.2) 36 | - RCT-Folly (= 2021.04.26.00) 37 | - RCTRequired (= 0.65.0-rc.2) 38 | - React-Core (= 0.65.0-rc.2) 39 | - React (0.65.0-rc.2): 40 | - React-Core (= 0.65.0-rc.2) 41 | - React-Core/DevSupport (= 0.65.0-rc.2) 42 | - React-Core/RCTWebSocket (= 0.65.0-rc.2) 43 | - React-RCTActionSheet (= 0.65.0-rc.2) 44 | - React-RCTAnimation (= 0.65.0-rc.2) 45 | - React-RCTBlob (= 0.65.0-rc.2) 46 | - React-RCTImage (= 0.65.0-rc.2) 47 | - React-RCTLinking (= 0.65.0-rc.2) 48 | - React-RCTNetwork (= 0.65.0-rc.2) 49 | - React-RCTSettings (= 0.65.0-rc.2) 50 | - React-RCTText (= 0.65.0-rc.2) 51 | - React-RCTVibration (= 0.65.0-rc.2) 52 | - React-callinvoker (0.65.0-rc.2) 53 | - React-Core (0.65.0-rc.2): 54 | - glog 55 | - RCT-Folly (= 2021.04.26.00) 56 | - React-Core/Default (= 0.65.0-rc.2) 57 | - React-cxxreact (= 0.65.0-rc.2) 58 | - React-jsi (= 0.65.0-rc.2) 59 | - React-jsiexecutor (= 0.65.0-rc.2) 60 | - React-perflogger (= 0.65.0-rc.2) 61 | - Yoga 62 | - React-Core/CoreModulesHeaders (0.65.0-rc.2): 63 | - glog 64 | - RCT-Folly (= 2021.04.26.00) 65 | - React-Core/Default 66 | - React-cxxreact (= 0.65.0-rc.2) 67 | - React-jsi (= 0.65.0-rc.2) 68 | - React-jsiexecutor (= 0.65.0-rc.2) 69 | - React-perflogger (= 0.65.0-rc.2) 70 | - Yoga 71 | - React-Core/Default (0.65.0-rc.2): 72 | - glog 73 | - RCT-Folly (= 2021.04.26.00) 74 | - React-cxxreact (= 0.65.0-rc.2) 75 | - React-jsi (= 0.65.0-rc.2) 76 | - React-jsiexecutor (= 0.65.0-rc.2) 77 | - React-perflogger (= 0.65.0-rc.2) 78 | - Yoga 79 | - React-Core/DevSupport (0.65.0-rc.2): 80 | - glog 81 | - RCT-Folly (= 2021.04.26.00) 82 | - React-Core/Default (= 0.65.0-rc.2) 83 | - React-Core/RCTWebSocket (= 0.65.0-rc.2) 84 | - React-cxxreact (= 0.65.0-rc.2) 85 | - React-jsi (= 0.65.0-rc.2) 86 | - React-jsiexecutor (= 0.65.0-rc.2) 87 | - React-jsinspector (= 0.65.0-rc.2) 88 | - React-perflogger (= 0.65.0-rc.2) 89 | - Yoga 90 | - React-Core/RCTActionSheetHeaders (0.65.0-rc.2): 91 | - glog 92 | - RCT-Folly (= 2021.04.26.00) 93 | - React-Core/Default 94 | - React-cxxreact (= 0.65.0-rc.2) 95 | - React-jsi (= 0.65.0-rc.2) 96 | - React-jsiexecutor (= 0.65.0-rc.2) 97 | - React-perflogger (= 0.65.0-rc.2) 98 | - Yoga 99 | - React-Core/RCTAnimationHeaders (0.65.0-rc.2): 100 | - glog 101 | - RCT-Folly (= 2021.04.26.00) 102 | - React-Core/Default 103 | - React-cxxreact (= 0.65.0-rc.2) 104 | - React-jsi (= 0.65.0-rc.2) 105 | - React-jsiexecutor (= 0.65.0-rc.2) 106 | - React-perflogger (= 0.65.0-rc.2) 107 | - Yoga 108 | - React-Core/RCTBlobHeaders (0.65.0-rc.2): 109 | - glog 110 | - RCT-Folly (= 2021.04.26.00) 111 | - React-Core/Default 112 | - React-cxxreact (= 0.65.0-rc.2) 113 | - React-jsi (= 0.65.0-rc.2) 114 | - React-jsiexecutor (= 0.65.0-rc.2) 115 | - React-perflogger (= 0.65.0-rc.2) 116 | - Yoga 117 | - React-Core/RCTImageHeaders (0.65.0-rc.2): 118 | - glog 119 | - RCT-Folly (= 2021.04.26.00) 120 | - React-Core/Default 121 | - React-cxxreact (= 0.65.0-rc.2) 122 | - React-jsi (= 0.65.0-rc.2) 123 | - React-jsiexecutor (= 0.65.0-rc.2) 124 | - React-perflogger (= 0.65.0-rc.2) 125 | - Yoga 126 | - React-Core/RCTLinkingHeaders (0.65.0-rc.2): 127 | - glog 128 | - RCT-Folly (= 2021.04.26.00) 129 | - React-Core/Default 130 | - React-cxxreact (= 0.65.0-rc.2) 131 | - React-jsi (= 0.65.0-rc.2) 132 | - React-jsiexecutor (= 0.65.0-rc.2) 133 | - React-perflogger (= 0.65.0-rc.2) 134 | - Yoga 135 | - React-Core/RCTNetworkHeaders (0.65.0-rc.2): 136 | - glog 137 | - RCT-Folly (= 2021.04.26.00) 138 | - React-Core/Default 139 | - React-cxxreact (= 0.65.0-rc.2) 140 | - React-jsi (= 0.65.0-rc.2) 141 | - React-jsiexecutor (= 0.65.0-rc.2) 142 | - React-perflogger (= 0.65.0-rc.2) 143 | - Yoga 144 | - React-Core/RCTSettingsHeaders (0.65.0-rc.2): 145 | - glog 146 | - RCT-Folly (= 2021.04.26.00) 147 | - React-Core/Default 148 | - React-cxxreact (= 0.65.0-rc.2) 149 | - React-jsi (= 0.65.0-rc.2) 150 | - React-jsiexecutor (= 0.65.0-rc.2) 151 | - React-perflogger (= 0.65.0-rc.2) 152 | - Yoga 153 | - React-Core/RCTTextHeaders (0.65.0-rc.2): 154 | - glog 155 | - RCT-Folly (= 2021.04.26.00) 156 | - React-Core/Default 157 | - React-cxxreact (= 0.65.0-rc.2) 158 | - React-jsi (= 0.65.0-rc.2) 159 | - React-jsiexecutor (= 0.65.0-rc.2) 160 | - React-perflogger (= 0.65.0-rc.2) 161 | - Yoga 162 | - React-Core/RCTVibrationHeaders (0.65.0-rc.2): 163 | - glog 164 | - RCT-Folly (= 2021.04.26.00) 165 | - React-Core/Default 166 | - React-cxxreact (= 0.65.0-rc.2) 167 | - React-jsi (= 0.65.0-rc.2) 168 | - React-jsiexecutor (= 0.65.0-rc.2) 169 | - React-perflogger (= 0.65.0-rc.2) 170 | - Yoga 171 | - React-Core/RCTWebSocket (0.65.0-rc.2): 172 | - glog 173 | - RCT-Folly (= 2021.04.26.00) 174 | - React-Core/Default (= 0.65.0-rc.2) 175 | - React-cxxreact (= 0.65.0-rc.2) 176 | - React-jsi (= 0.65.0-rc.2) 177 | - React-jsiexecutor (= 0.65.0-rc.2) 178 | - React-perflogger (= 0.65.0-rc.2) 179 | - Yoga 180 | - React-CoreModules (0.65.0-rc.2): 181 | - FBReactNativeSpec (= 0.65.0-rc.2) 182 | - RCT-Folly (= 2021.04.26.00) 183 | - RCTTypeSafety (= 0.65.0-rc.2) 184 | - React-Core/CoreModulesHeaders (= 0.65.0-rc.2) 185 | - React-jsi (= 0.65.0-rc.2) 186 | - React-RCTImage (= 0.65.0-rc.2) 187 | - ReactCommon/turbomodule/core (= 0.65.0-rc.2) 188 | - React-cxxreact (0.65.0-rc.2): 189 | - boost-for-react-native (= 1.63.0) 190 | - DoubleConversion 191 | - glog 192 | - RCT-Folly (= 2021.04.26.00) 193 | - React-callinvoker (= 0.65.0-rc.2) 194 | - React-jsi (= 0.65.0-rc.2) 195 | - React-jsinspector (= 0.65.0-rc.2) 196 | - React-perflogger (= 0.65.0-rc.2) 197 | - React-runtimeexecutor (= 0.65.0-rc.2) 198 | - React-hermes (0.65.0-rc.2): 199 | - DoubleConversion 200 | - glog 201 | - hermes-engine 202 | - RCT-Folly (= 2021.04.26.00) 203 | - RCT-Folly/Futures (= 2021.04.26.00) 204 | - React-cxxreact (= 0.65.0-rc.2) 205 | - React-jsi (= 0.65.0-rc.2) 206 | - React-jsiexecutor (= 0.65.0-rc.2) 207 | - React-jsinspector (= 0.65.0-rc.2) 208 | - React-perflogger (= 0.65.0-rc.2) 209 | - React-jsi (0.65.0-rc.2): 210 | - boost-for-react-native (= 1.63.0) 211 | - DoubleConversion 212 | - glog 213 | - RCT-Folly (= 2021.04.26.00) 214 | - React-jsi/Default (= 0.65.0-rc.2) 215 | - React-jsi/Default (0.65.0-rc.2): 216 | - boost-for-react-native (= 1.63.0) 217 | - DoubleConversion 218 | - glog 219 | - RCT-Folly (= 2021.04.26.00) 220 | - React-jsiexecutor (0.65.0-rc.2): 221 | - DoubleConversion 222 | - glog 223 | - RCT-Folly (= 2021.04.26.00) 224 | - React-cxxreact (= 0.65.0-rc.2) 225 | - React-jsi (= 0.65.0-rc.2) 226 | - React-perflogger (= 0.65.0-rc.2) 227 | - React-jsinspector (0.65.0-rc.2) 228 | - React-perflogger (0.65.0-rc.2) 229 | - React-RCTActionSheet (0.65.0-rc.2): 230 | - React-Core/RCTActionSheetHeaders (= 0.65.0-rc.2) 231 | - React-RCTAnimation (0.65.0-rc.2): 232 | - FBReactNativeSpec (= 0.65.0-rc.2) 233 | - RCT-Folly (= 2021.04.26.00) 234 | - RCTTypeSafety (= 0.65.0-rc.2) 235 | - React-Core/RCTAnimationHeaders (= 0.65.0-rc.2) 236 | - React-jsi (= 0.65.0-rc.2) 237 | - ReactCommon/turbomodule/core (= 0.65.0-rc.2) 238 | - React-RCTBlob (0.65.0-rc.2): 239 | - FBReactNativeSpec (= 0.65.0-rc.2) 240 | - RCT-Folly (= 2021.04.26.00) 241 | - React-Core/RCTBlobHeaders (= 0.65.0-rc.2) 242 | - React-Core/RCTWebSocket (= 0.65.0-rc.2) 243 | - React-jsi (= 0.65.0-rc.2) 244 | - React-RCTNetwork (= 0.65.0-rc.2) 245 | - ReactCommon/turbomodule/core (= 0.65.0-rc.2) 246 | - React-RCTImage (0.65.0-rc.2): 247 | - FBReactNativeSpec (= 0.65.0-rc.2) 248 | - RCT-Folly (= 2021.04.26.00) 249 | - RCTTypeSafety (= 0.65.0-rc.2) 250 | - React-Core/RCTImageHeaders (= 0.65.0-rc.2) 251 | - React-jsi (= 0.65.0-rc.2) 252 | - React-RCTNetwork (= 0.65.0-rc.2) 253 | - ReactCommon/turbomodule/core (= 0.65.0-rc.2) 254 | - React-RCTLinking (0.65.0-rc.2): 255 | - FBReactNativeSpec (= 0.65.0-rc.2) 256 | - React-Core/RCTLinkingHeaders (= 0.65.0-rc.2) 257 | - React-jsi (= 0.65.0-rc.2) 258 | - ReactCommon/turbomodule/core (= 0.65.0-rc.2) 259 | - React-RCTNetwork (0.65.0-rc.2): 260 | - FBReactNativeSpec (= 0.65.0-rc.2) 261 | - RCT-Folly (= 2021.04.26.00) 262 | - RCTTypeSafety (= 0.65.0-rc.2) 263 | - React-Core/RCTNetworkHeaders (= 0.65.0-rc.2) 264 | - React-jsi (= 0.65.0-rc.2) 265 | - ReactCommon/turbomodule/core (= 0.65.0-rc.2) 266 | - React-RCTSettings (0.65.0-rc.2): 267 | - FBReactNativeSpec (= 0.65.0-rc.2) 268 | - RCT-Folly (= 2021.04.26.00) 269 | - RCTTypeSafety (= 0.65.0-rc.2) 270 | - React-Core/RCTSettingsHeaders (= 0.65.0-rc.2) 271 | - React-jsi (= 0.65.0-rc.2) 272 | - ReactCommon/turbomodule/core (= 0.65.0-rc.2) 273 | - React-RCTText (0.65.0-rc.2): 274 | - React-Core/RCTTextHeaders (= 0.65.0-rc.2) 275 | - React-RCTVibration (0.65.0-rc.2): 276 | - FBReactNativeSpec (= 0.65.0-rc.2) 277 | - RCT-Folly (= 2021.04.26.00) 278 | - React-Core/RCTVibrationHeaders (= 0.65.0-rc.2) 279 | - React-jsi (= 0.65.0-rc.2) 280 | - ReactCommon/turbomodule/core (= 0.65.0-rc.2) 281 | - React-runtimeexecutor (0.65.0-rc.2): 282 | - React-jsi (= 0.65.0-rc.2) 283 | - ReactCommon/turbomodule/core (0.65.0-rc.2): 284 | - DoubleConversion 285 | - glog 286 | - RCT-Folly (= 2021.04.26.00) 287 | - React-callinvoker (= 0.65.0-rc.2) 288 | - React-Core (= 0.65.0-rc.2) 289 | - React-cxxreact (= 0.65.0-rc.2) 290 | - React-jsi (= 0.65.0-rc.2) 291 | - React-perflogger (= 0.65.0-rc.2) 292 | - RNGestureHandler (1.10.3): 293 | - React-Core 294 | - RNReanimated (2.2.0): 295 | - DoubleConversion 296 | - FBLazyVector 297 | - FBReactNativeSpec 298 | - glog 299 | - RCT-Folly 300 | - RCTRequired 301 | - RCTTypeSafety 302 | - React 303 | - React-callinvoker 304 | - React-Core 305 | - React-Core/DevSupport 306 | - React-Core/RCTWebSocket 307 | - React-CoreModules 308 | - React-cxxreact 309 | - React-jsi 310 | - React-jsiexecutor 311 | - React-jsinspector 312 | - React-RCTActionSheet 313 | - React-RCTAnimation 314 | - React-RCTBlob 315 | - React-RCTImage 316 | - React-RCTLinking 317 | - React-RCTNetwork 318 | - React-RCTSettings 319 | - React-RCTText 320 | - React-RCTVibration 321 | - ReactCommon/turbomodule/core 322 | - Yoga 323 | - Yoga (1.14.0) 324 | 325 | DEPENDENCIES: 326 | - DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`) 327 | - FBLazyVector (from `../node_modules/react-native/Libraries/FBLazyVector`) 328 | - FBReactNativeSpec (from `../node_modules/react-native/React/FBReactNativeSpec`) 329 | - glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`) 330 | - hermes-engine (~> 0.8.0) 331 | - libevent (~> 2.1.12) 332 | - RCT-Folly (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`) 333 | - RCTRequired (from `../node_modules/react-native/Libraries/RCTRequired`) 334 | - RCTTypeSafety (from `../node_modules/react-native/Libraries/TypeSafety`) 335 | - React (from `../node_modules/react-native/`) 336 | - React-callinvoker (from `../node_modules/react-native/ReactCommon/callinvoker`) 337 | - React-Core (from `../node_modules/react-native/`) 338 | - React-Core/DevSupport (from `../node_modules/react-native/`) 339 | - React-Core/RCTWebSocket (from `../node_modules/react-native/`) 340 | - React-CoreModules (from `../node_modules/react-native/React/CoreModules`) 341 | - React-cxxreact (from `../node_modules/react-native/ReactCommon/cxxreact`) 342 | - React-hermes (from `../node_modules/react-native/ReactCommon/hermes`) 343 | - React-jsi (from `../node_modules/react-native/ReactCommon/jsi`) 344 | - React-jsiexecutor (from `../node_modules/react-native/ReactCommon/jsiexecutor`) 345 | - React-jsinspector (from `../node_modules/react-native/ReactCommon/jsinspector`) 346 | - React-perflogger (from `../node_modules/react-native/ReactCommon/reactperflogger`) 347 | - React-RCTActionSheet (from `../node_modules/react-native/Libraries/ActionSheetIOS`) 348 | - React-RCTAnimation (from `../node_modules/react-native/Libraries/NativeAnimation`) 349 | - React-RCTBlob (from `../node_modules/react-native/Libraries/Blob`) 350 | - React-RCTImage (from `../node_modules/react-native/Libraries/Image`) 351 | - React-RCTLinking (from `../node_modules/react-native/Libraries/LinkingIOS`) 352 | - React-RCTNetwork (from `../node_modules/react-native/Libraries/Network`) 353 | - React-RCTSettings (from `../node_modules/react-native/Libraries/Settings`) 354 | - React-RCTText (from `../node_modules/react-native/Libraries/Text`) 355 | - React-RCTVibration (from `../node_modules/react-native/Libraries/Vibration`) 356 | - React-runtimeexecutor (from `../node_modules/react-native/ReactCommon/runtimeexecutor`) 357 | - ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`) 358 | - RNGestureHandler (from `../node_modules/react-native-gesture-handler`) 359 | - RNReanimated (from `../node_modules/react-native-reanimated`) 360 | - Yoga (from `../node_modules/react-native/ReactCommon/yoga`) 361 | 362 | SPEC REPOS: 363 | trunk: 364 | - boost-for-react-native 365 | - fmt 366 | - hermes-engine 367 | - libevent 368 | 369 | EXTERNAL SOURCES: 370 | DoubleConversion: 371 | :podspec: "../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec" 372 | FBLazyVector: 373 | :path: "../node_modules/react-native/Libraries/FBLazyVector" 374 | FBReactNativeSpec: 375 | :path: "../node_modules/react-native/React/FBReactNativeSpec" 376 | glog: 377 | :podspec: "../node_modules/react-native/third-party-podspecs/glog.podspec" 378 | RCT-Folly: 379 | :podspec: "../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec" 380 | RCTRequired: 381 | :path: "../node_modules/react-native/Libraries/RCTRequired" 382 | RCTTypeSafety: 383 | :path: "../node_modules/react-native/Libraries/TypeSafety" 384 | React: 385 | :path: "../node_modules/react-native/" 386 | React-callinvoker: 387 | :path: "../node_modules/react-native/ReactCommon/callinvoker" 388 | React-Core: 389 | :path: "../node_modules/react-native/" 390 | React-CoreModules: 391 | :path: "../node_modules/react-native/React/CoreModules" 392 | React-cxxreact: 393 | :path: "../node_modules/react-native/ReactCommon/cxxreact" 394 | React-hermes: 395 | :path: "../node_modules/react-native/ReactCommon/hermes" 396 | React-jsi: 397 | :path: "../node_modules/react-native/ReactCommon/jsi" 398 | React-jsiexecutor: 399 | :path: "../node_modules/react-native/ReactCommon/jsiexecutor" 400 | React-jsinspector: 401 | :path: "../node_modules/react-native/ReactCommon/jsinspector" 402 | React-perflogger: 403 | :path: "../node_modules/react-native/ReactCommon/reactperflogger" 404 | React-RCTActionSheet: 405 | :path: "../node_modules/react-native/Libraries/ActionSheetIOS" 406 | React-RCTAnimation: 407 | :path: "../node_modules/react-native/Libraries/NativeAnimation" 408 | React-RCTBlob: 409 | :path: "../node_modules/react-native/Libraries/Blob" 410 | React-RCTImage: 411 | :path: "../node_modules/react-native/Libraries/Image" 412 | React-RCTLinking: 413 | :path: "../node_modules/react-native/Libraries/LinkingIOS" 414 | React-RCTNetwork: 415 | :path: "../node_modules/react-native/Libraries/Network" 416 | React-RCTSettings: 417 | :path: "../node_modules/react-native/Libraries/Settings" 418 | React-RCTText: 419 | :path: "../node_modules/react-native/Libraries/Text" 420 | React-RCTVibration: 421 | :path: "../node_modules/react-native/Libraries/Vibration" 422 | React-runtimeexecutor: 423 | :path: "../node_modules/react-native/ReactCommon/runtimeexecutor" 424 | ReactCommon: 425 | :path: "../node_modules/react-native/ReactCommon" 426 | RNGestureHandler: 427 | :path: "../node_modules/react-native-gesture-handler" 428 | RNReanimated: 429 | :path: "../node_modules/react-native-reanimated" 430 | Yoga: 431 | :path: "../node_modules/react-native/ReactCommon/yoga" 432 | 433 | SPEC CHECKSUMS: 434 | boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c 435 | DoubleConversion: cde416483dac037923206447da6e1454df403714 436 | FBLazyVector: 19dbc3027d5f70bbd6349fa4c06423d3bbdc97d8 437 | FBReactNativeSpec: 49a061424cc06f9d42121cdd09015bc844f7fbe1 438 | fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9 439 | glog: 40a13f7840415b9a77023fbcae0f1e6f43192af3 440 | hermes-engine: d2bc9a5f4910d7e44d453d96645259214930e13f 441 | libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913 442 | RCT-Folly: 0dd9e1eb86348ecab5ba76f910b56f4b5fef3c46 443 | RCTRequired: cd00793094d8154ce29593493fa0fce91553a98b 444 | RCTTypeSafety: fc96f9337f2760158f4fe5b3a82958985046f4b0 445 | React: 80b9d12d007a2c9f0fc376f01761cb97830c087c 446 | React-callinvoker: 4f1ad76d66235b31e1d8a0133ec675eff1e57123 447 | React-Core: 80f7f600c1c8e0f5bae0af8b52b2506b3e800155 448 | React-CoreModules: 4021592e60f5ca045d42c3a617ff837128743be5 449 | React-cxxreact: 36a8b9f9fc20a3342322ee9ff2bfcbf9cbc60376 450 | React-hermes: c77c7c774f4e91dc84602ade12a29d6cd5de8868 451 | React-jsi: bf57573b9432c91f69296c1f408e3adfeecf6d10 452 | React-jsiexecutor: 38618f9770ecfcc91e68124d2ae14602c0dc5732 453 | React-jsinspector: 52288061f1d1451929056447956ebfd5da3a243f 454 | React-perflogger: 7825d9c5a8e2f1356d1845bd2b5231df9327ce95 455 | React-RCTActionSheet: 92d1044c451f2017270c21d9a2075883509533d3 456 | React-RCTAnimation: b9dbd7970762f3f4c2549054c7e4d53f5badcb90 457 | React-RCTBlob: 89a8f8df1dbd3d5d1c1302d209680032cc66a2bd 458 | React-RCTImage: d8b3f08a7f14390eb425659c20f23f41195cb460 459 | React-RCTLinking: f8cc32bc6be8d3b25139495ffd4e49a3006c480b 460 | React-RCTNetwork: c2e70b034ebe1e39ecb7f27bf6ffb3edc255704a 461 | React-RCTSettings: d055dd1106c021a166b1e833433fad9d55004c2e 462 | React-RCTText: 23eddf37ffa1ed65cad23e155c17e6be3b319fbd 463 | React-RCTVibration: 62dd21ce9ed6bc41d6ae8b1f4d79f4ff0dee0a8c 464 | React-runtimeexecutor: a3d8c200821fe4b2b9960f918d1bcaf9a356f5af 465 | ReactCommon: a7dd2a6d6f8667c26b4dcdca16d69a59d799047a 466 | RNGestureHandler: a479ebd5ed4221a810967000735517df0d2db211 467 | RNReanimated: 7245c2ff6dca3b42b6f77e800adf85ce68532759 468 | Yoga: 52a3397158f0a5a0d49c51fb94ced9eee3ce5c73 469 | 470 | PODFILE CHECKSUM: fba44abdc87e67ebef5b86cbc86e7462229a7d94 471 | 472 | COCOAPODS: 1.10.1 473 | -------------------------------------------------------------------------------- /example/ios/SwipeableExample-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | // 2 | // Use this file to import your target's public headers that you would like to expose to Swift. 3 | // 4 | -------------------------------------------------------------------------------- /example/ios/SwipeableExample.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 00E356F31AD99517003FC87E /* SwipeableExampleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* SwipeableExampleTests.m */; }; 11 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; }; 12 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 13 | 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; 14 | 2D02E4BC1E0B4A80006451C7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; }; 15 | 2D02E4BD1E0B4A84006451C7 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 16 | 2D02E4BF1E0B4AB3006451C7 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; 17 | 2DCD954D1E0B4F2C00145EB5 /* SwipeableExampleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* SwipeableExampleTests.m */; }; 18 | 4C39C56BAD484C67AA576FFA /* libPods-SwipeableExample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = CA3E69C5B9553B26FBA2DF04 /* libPods-SwipeableExample.a */; }; 19 | 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; }; 20 | /* End PBXBuildFile section */ 21 | 22 | /* Begin PBXContainerItemProxy section */ 23 | 00E356F41AD99517003FC87E /* PBXContainerItemProxy */ = { 24 | isa = PBXContainerItemProxy; 25 | containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */; 26 | proxyType = 1; 27 | remoteGlobalIDString = 13B07F861A680F5B00A75B9A; 28 | remoteInfo = SwipeableExample; 29 | }; 30 | 2D02E4911E0B4A5D006451C7 /* PBXContainerItemProxy */ = { 31 | isa = PBXContainerItemProxy; 32 | containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */; 33 | proxyType = 1; 34 | remoteGlobalIDString = 2D02E47A1E0B4A5D006451C7; 35 | remoteInfo = "SwipeableExample-tvOS"; 36 | }; 37 | /* End PBXContainerItemProxy section */ 38 | 39 | /* Begin PBXFileReference section */ 40 | 008F07F21AC5B25A0029DE68 /* main.jsbundle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = main.jsbundle; sourceTree = ""; }; 41 | 00E356EE1AD99517003FC87E /* SwipeableExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SwipeableExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 42 | 00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 43 | 00E356F21AD99517003FC87E /* SwipeableExampleTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SwipeableExampleTests.m; sourceTree = ""; }; 44 | 13B07F961A680F5B00A75B9A /* SwipeableExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SwipeableExample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 45 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = SwipeableExample/AppDelegate.h; sourceTree = ""; }; 46 | 13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = SwipeableExample/AppDelegate.m; sourceTree = ""; }; 47 | 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = SwipeableExample/Images.xcassets; sourceTree = ""; }; 48 | 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = SwipeableExample/Info.plist; sourceTree = ""; }; 49 | 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = SwipeableExample/main.m; sourceTree = ""; }; 50 | 2D02E47B1E0B4A5D006451C7 /* SwipeableExample-tvOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "SwipeableExample-tvOS.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 51 | 2D02E4901E0B4A5D006451C7 /* SwipeableExample-tvOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "SwipeableExample-tvOSTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 52 | 47F7ED3B7971BE374F7B8635 /* Pods-SwipeableExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwipeableExample.debug.xcconfig"; path = "Target Support Files/Pods-SwipeableExample/Pods-SwipeableExample.debug.xcconfig"; sourceTree = ""; }; 53 | 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = SwipeableExample/LaunchScreen.storyboard; sourceTree = ""; }; 54 | CA3E69C5B9553B26FBA2DF04 /* libPods-SwipeableExample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-SwipeableExample.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 55 | E00ACF0FDA8BF921659E2F9A /* Pods-SwipeableExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwipeableExample.release.xcconfig"; path = "Target Support Files/Pods-SwipeableExample/Pods-SwipeableExample.release.xcconfig"; sourceTree = ""; }; 56 | ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; 57 | ED2971642150620600B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS12.0.sdk/System/Library/Frameworks/JavaScriptCore.framework; sourceTree = DEVELOPER_DIR; }; 58 | /* End PBXFileReference section */ 59 | 60 | /* Begin PBXFrameworksBuildPhase section */ 61 | 00E356EB1AD99517003FC87E /* Frameworks */ = { 62 | isa = PBXFrameworksBuildPhase; 63 | buildActionMask = 2147483647; 64 | files = ( 65 | ); 66 | runOnlyForDeploymentPostprocessing = 0; 67 | }; 68 | 13B07F8C1A680F5B00A75B9A /* Frameworks */ = { 69 | isa = PBXFrameworksBuildPhase; 70 | buildActionMask = 2147483647; 71 | files = ( 72 | 4C39C56BAD484C67AA576FFA /* libPods-SwipeableExample.a in Frameworks */, 73 | ); 74 | runOnlyForDeploymentPostprocessing = 0; 75 | }; 76 | 2D02E4781E0B4A5D006451C7 /* Frameworks */ = { 77 | isa = PBXFrameworksBuildPhase; 78 | buildActionMask = 2147483647; 79 | files = ( 80 | ); 81 | runOnlyForDeploymentPostprocessing = 0; 82 | }; 83 | 2D02E48D1E0B4A5D006451C7 /* Frameworks */ = { 84 | isa = PBXFrameworksBuildPhase; 85 | buildActionMask = 2147483647; 86 | files = ( 87 | ); 88 | runOnlyForDeploymentPostprocessing = 0; 89 | }; 90 | /* End PBXFrameworksBuildPhase section */ 91 | 92 | /* Begin PBXGroup section */ 93 | 00E356EF1AD99517003FC87E /* SwipeableExampleTests */ = { 94 | isa = PBXGroup; 95 | children = ( 96 | 00E356F21AD99517003FC87E /* SwipeableExampleTests.m */, 97 | 00E356F01AD99517003FC87E /* Supporting Files */, 98 | ); 99 | path = SwipeableExampleTests; 100 | sourceTree = ""; 101 | }; 102 | 00E356F01AD99517003FC87E /* Supporting Files */ = { 103 | isa = PBXGroup; 104 | children = ( 105 | 00E356F11AD99517003FC87E /* Info.plist */, 106 | ); 107 | name = "Supporting Files"; 108 | sourceTree = ""; 109 | }; 110 | 13B07FAE1A68108700A75B9A /* SwipeableExample */ = { 111 | isa = PBXGroup; 112 | children = ( 113 | 008F07F21AC5B25A0029DE68 /* main.jsbundle */, 114 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */, 115 | 13B07FB01A68108700A75B9A /* AppDelegate.m */, 116 | 13B07FB51A68108700A75B9A /* Images.xcassets */, 117 | 13B07FB61A68108700A75B9A /* Info.plist */, 118 | 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */, 119 | 13B07FB71A68108700A75B9A /* main.m */, 120 | ); 121 | name = SwipeableExample; 122 | sourceTree = ""; 123 | }; 124 | 2D16E6871FA4F8E400B85C8A /* Frameworks */ = { 125 | isa = PBXGroup; 126 | children = ( 127 | ED297162215061F000B7C4FE /* JavaScriptCore.framework */, 128 | ED2971642150620600B7C4FE /* JavaScriptCore.framework */, 129 | CA3E69C5B9553B26FBA2DF04 /* libPods-SwipeableExample.a */, 130 | ); 131 | name = Frameworks; 132 | sourceTree = ""; 133 | }; 134 | 6B9684456A2045ADE5A6E47E /* Pods */ = { 135 | isa = PBXGroup; 136 | children = ( 137 | 47F7ED3B7971BE374F7B8635 /* Pods-SwipeableExample.debug.xcconfig */, 138 | E00ACF0FDA8BF921659E2F9A /* Pods-SwipeableExample.release.xcconfig */, 139 | ); 140 | name = Pods; 141 | path = Pods; 142 | sourceTree = ""; 143 | }; 144 | 832341AE1AAA6A7D00B99B32 /* Libraries */ = { 145 | isa = PBXGroup; 146 | children = ( 147 | ); 148 | name = Libraries; 149 | sourceTree = ""; 150 | }; 151 | 83CBB9F61A601CBA00E9B192 = { 152 | isa = PBXGroup; 153 | children = ( 154 | 13B07FAE1A68108700A75B9A /* SwipeableExample */, 155 | 832341AE1AAA6A7D00B99B32 /* Libraries */, 156 | 00E356EF1AD99517003FC87E /* SwipeableExampleTests */, 157 | 83CBBA001A601CBA00E9B192 /* Products */, 158 | 2D16E6871FA4F8E400B85C8A /* Frameworks */, 159 | 6B9684456A2045ADE5A6E47E /* Pods */, 160 | ); 161 | indentWidth = 2; 162 | sourceTree = ""; 163 | tabWidth = 2; 164 | usesTabs = 0; 165 | }; 166 | 83CBBA001A601CBA00E9B192 /* Products */ = { 167 | isa = PBXGroup; 168 | children = ( 169 | 13B07F961A680F5B00A75B9A /* SwipeableExample.app */, 170 | 00E356EE1AD99517003FC87E /* SwipeableExampleTests.xctest */, 171 | 2D02E47B1E0B4A5D006451C7 /* SwipeableExample-tvOS.app */, 172 | 2D02E4901E0B4A5D006451C7 /* SwipeableExample-tvOSTests.xctest */, 173 | ); 174 | name = Products; 175 | sourceTree = ""; 176 | }; 177 | /* End PBXGroup section */ 178 | 179 | /* Begin PBXNativeTarget section */ 180 | 00E356ED1AD99517003FC87E /* SwipeableExampleTests */ = { 181 | isa = PBXNativeTarget; 182 | buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "SwipeableExampleTests" */; 183 | buildPhases = ( 184 | 00E356EA1AD99517003FC87E /* Sources */, 185 | 00E356EB1AD99517003FC87E /* Frameworks */, 186 | 00E356EC1AD99517003FC87E /* Resources */, 187 | ); 188 | buildRules = ( 189 | ); 190 | dependencies = ( 191 | 00E356F51AD99517003FC87E /* PBXTargetDependency */, 192 | ); 193 | name = SwipeableExampleTests; 194 | productName = SwipeableExampleTests; 195 | productReference = 00E356EE1AD99517003FC87E /* SwipeableExampleTests.xctest */; 196 | productType = "com.apple.product-type.bundle.unit-test"; 197 | }; 198 | 13B07F861A680F5B00A75B9A /* SwipeableExample */ = { 199 | isa = PBXNativeTarget; 200 | buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "SwipeableExample" */; 201 | buildPhases = ( 202 | 4F0A6FC082772762E3E4C96C /* [CP] Check Pods Manifest.lock */, 203 | FD10A7F022414F080027D42C /* Start Packager */, 204 | 13B07F871A680F5B00A75B9A /* Sources */, 205 | 13B07F8C1A680F5B00A75B9A /* Frameworks */, 206 | 13B07F8E1A680F5B00A75B9A /* Resources */, 207 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */, 208 | C1D60D28B925C94BD88E79D7 /* [CP] Copy Pods Resources */, 209 | C4FA1CD774EF17D228791A41 /* [CP] Embed Pods Frameworks */, 210 | ); 211 | buildRules = ( 212 | ); 213 | dependencies = ( 214 | ); 215 | name = SwipeableExample; 216 | productName = SwipeableExample; 217 | productReference = 13B07F961A680F5B00A75B9A /* SwipeableExample.app */; 218 | productType = "com.apple.product-type.application"; 219 | }; 220 | 2D02E47A1E0B4A5D006451C7 /* SwipeableExample-tvOS */ = { 221 | isa = PBXNativeTarget; 222 | buildConfigurationList = 2D02E4BA1E0B4A5E006451C7 /* Build configuration list for PBXNativeTarget "SwipeableExample-tvOS" */; 223 | buildPhases = ( 224 | FD10A7F122414F3F0027D42C /* Start Packager */, 225 | 2D02E4771E0B4A5D006451C7 /* Sources */, 226 | 2D02E4781E0B4A5D006451C7 /* Frameworks */, 227 | 2D02E4791E0B4A5D006451C7 /* Resources */, 228 | 2D02E4CB1E0B4B27006451C7 /* Bundle React Native Code And Images */, 229 | ); 230 | buildRules = ( 231 | ); 232 | dependencies = ( 233 | ); 234 | name = "SwipeableExample-tvOS"; 235 | productName = "SwipeableExample-tvOS"; 236 | productReference = 2D02E47B1E0B4A5D006451C7 /* SwipeableExample-tvOS.app */; 237 | productType = "com.apple.product-type.application"; 238 | }; 239 | 2D02E48F1E0B4A5D006451C7 /* SwipeableExample-tvOSTests */ = { 240 | isa = PBXNativeTarget; 241 | buildConfigurationList = 2D02E4BB1E0B4A5E006451C7 /* Build configuration list for PBXNativeTarget "SwipeableExample-tvOSTests" */; 242 | buildPhases = ( 243 | 2D02E48C1E0B4A5D006451C7 /* Sources */, 244 | 2D02E48D1E0B4A5D006451C7 /* Frameworks */, 245 | 2D02E48E1E0B4A5D006451C7 /* Resources */, 246 | ); 247 | buildRules = ( 248 | ); 249 | dependencies = ( 250 | 2D02E4921E0B4A5D006451C7 /* PBXTargetDependency */, 251 | ); 252 | name = "SwipeableExample-tvOSTests"; 253 | productName = "SwipeableExample-tvOSTests"; 254 | productReference = 2D02E4901E0B4A5D006451C7 /* SwipeableExample-tvOSTests.xctest */; 255 | productType = "com.apple.product-type.bundle.unit-test"; 256 | }; 257 | /* End PBXNativeTarget section */ 258 | 259 | /* Begin PBXProject section */ 260 | 83CBB9F71A601CBA00E9B192 /* Project object */ = { 261 | isa = PBXProject; 262 | attributes = { 263 | LastUpgradeCheck = 1130; 264 | TargetAttributes = { 265 | 00E356ED1AD99517003FC87E = { 266 | CreatedOnToolsVersion = 6.2; 267 | TestTargetID = 13B07F861A680F5B00A75B9A; 268 | }; 269 | 13B07F861A680F5B00A75B9A = { 270 | LastSwiftMigration = 1120; 271 | }; 272 | 2D02E47A1E0B4A5D006451C7 = { 273 | CreatedOnToolsVersion = 8.2.1; 274 | ProvisioningStyle = Automatic; 275 | }; 276 | 2D02E48F1E0B4A5D006451C7 = { 277 | CreatedOnToolsVersion = 8.2.1; 278 | ProvisioningStyle = Automatic; 279 | TestTargetID = 2D02E47A1E0B4A5D006451C7; 280 | }; 281 | }; 282 | }; 283 | buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "SwipeableExample" */; 284 | compatibilityVersion = "Xcode 3.2"; 285 | developmentRegion = en; 286 | hasScannedForEncodings = 0; 287 | knownRegions = ( 288 | en, 289 | Base, 290 | ); 291 | mainGroup = 83CBB9F61A601CBA00E9B192; 292 | productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */; 293 | projectDirPath = ""; 294 | projectRoot = ""; 295 | targets = ( 296 | 13B07F861A680F5B00A75B9A /* SwipeableExample */, 297 | 00E356ED1AD99517003FC87E /* SwipeableExampleTests */, 298 | 2D02E47A1E0B4A5D006451C7 /* SwipeableExample-tvOS */, 299 | 2D02E48F1E0B4A5D006451C7 /* SwipeableExample-tvOSTests */, 300 | ); 301 | }; 302 | /* End PBXProject section */ 303 | 304 | /* Begin PBXResourcesBuildPhase section */ 305 | 00E356EC1AD99517003FC87E /* Resources */ = { 306 | isa = PBXResourcesBuildPhase; 307 | buildActionMask = 2147483647; 308 | files = ( 309 | ); 310 | runOnlyForDeploymentPostprocessing = 0; 311 | }; 312 | 13B07F8E1A680F5B00A75B9A /* Resources */ = { 313 | isa = PBXResourcesBuildPhase; 314 | buildActionMask = 2147483647; 315 | files = ( 316 | 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */, 317 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */, 318 | ); 319 | runOnlyForDeploymentPostprocessing = 0; 320 | }; 321 | 2D02E4791E0B4A5D006451C7 /* Resources */ = { 322 | isa = PBXResourcesBuildPhase; 323 | buildActionMask = 2147483647; 324 | files = ( 325 | 2D02E4BD1E0B4A84006451C7 /* Images.xcassets in Resources */, 326 | ); 327 | runOnlyForDeploymentPostprocessing = 0; 328 | }; 329 | 2D02E48E1E0B4A5D006451C7 /* Resources */ = { 330 | isa = PBXResourcesBuildPhase; 331 | buildActionMask = 2147483647; 332 | files = ( 333 | ); 334 | runOnlyForDeploymentPostprocessing = 0; 335 | }; 336 | /* End PBXResourcesBuildPhase section */ 337 | 338 | /* Begin PBXShellScriptBuildPhase section */ 339 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = { 340 | isa = PBXShellScriptBuildPhase; 341 | buildActionMask = 2147483647; 342 | files = ( 343 | ); 344 | inputPaths = ( 345 | ); 346 | name = "Bundle React Native code and images"; 347 | outputPaths = ( 348 | ); 349 | runOnlyForDeploymentPostprocessing = 0; 350 | shellPath = /bin/sh; 351 | shellScript = "export NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh"; 352 | }; 353 | 2D02E4CB1E0B4B27006451C7 /* Bundle React Native Code And Images */ = { 354 | isa = PBXShellScriptBuildPhase; 355 | buildActionMask = 2147483647; 356 | files = ( 357 | ); 358 | inputPaths = ( 359 | ); 360 | name = "Bundle React Native Code And Images"; 361 | outputPaths = ( 362 | ); 363 | runOnlyForDeploymentPostprocessing = 0; 364 | shellPath = /bin/sh; 365 | shellScript = "export NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh"; 366 | }; 367 | 4F0A6FC082772762E3E4C96C /* [CP] Check Pods Manifest.lock */ = { 368 | isa = PBXShellScriptBuildPhase; 369 | buildActionMask = 2147483647; 370 | files = ( 371 | ); 372 | inputFileListPaths = ( 373 | ); 374 | inputPaths = ( 375 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 376 | "${PODS_ROOT}/Manifest.lock", 377 | ); 378 | name = "[CP] Check Pods Manifest.lock"; 379 | outputFileListPaths = ( 380 | ); 381 | outputPaths = ( 382 | "$(DERIVED_FILE_DIR)/Pods-SwipeableExample-checkManifestLockResult.txt", 383 | ); 384 | runOnlyForDeploymentPostprocessing = 0; 385 | shellPath = /bin/sh; 386 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 387 | showEnvVarsInLog = 0; 388 | }; 389 | C1D60D28B925C94BD88E79D7 /* [CP] Copy Pods Resources */ = { 390 | isa = PBXShellScriptBuildPhase; 391 | buildActionMask = 2147483647; 392 | files = ( 393 | ); 394 | inputPaths = ( 395 | "${PODS_ROOT}/Target Support Files/Pods-SwipeableExample/Pods-SwipeableExample-resources.sh", 396 | "${PODS_CONFIGURATION_BUILD_DIR}/React-Core/AccessibilityResources.bundle", 397 | ); 398 | name = "[CP] Copy Pods Resources"; 399 | outputPaths = ( 400 | "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/AccessibilityResources.bundle", 401 | ); 402 | runOnlyForDeploymentPostprocessing = 0; 403 | shellPath = /bin/sh; 404 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-SwipeableExample/Pods-SwipeableExample-resources.sh\"\n"; 405 | showEnvVarsInLog = 0; 406 | }; 407 | C4FA1CD774EF17D228791A41 /* [CP] Embed Pods Frameworks */ = { 408 | isa = PBXShellScriptBuildPhase; 409 | buildActionMask = 2147483647; 410 | files = ( 411 | ); 412 | inputPaths = ( 413 | "${PODS_ROOT}/Target Support Files/Pods-SwipeableExample/Pods-SwipeableExample-frameworks.sh", 414 | "${PODS_ROOT}/hermes-engine/destroot/Library/Frameworks/iphoneos/hermes.framework", 415 | ); 416 | name = "[CP] Embed Pods Frameworks"; 417 | outputPaths = ( 418 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/hermes.framework", 419 | ); 420 | runOnlyForDeploymentPostprocessing = 0; 421 | shellPath = /bin/sh; 422 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-SwipeableExample/Pods-SwipeableExample-frameworks.sh\"\n"; 423 | showEnvVarsInLog = 0; 424 | }; 425 | FD10A7F022414F080027D42C /* Start Packager */ = { 426 | isa = PBXShellScriptBuildPhase; 427 | buildActionMask = 2147483647; 428 | files = ( 429 | ); 430 | inputFileListPaths = ( 431 | ); 432 | inputPaths = ( 433 | ); 434 | name = "Start Packager"; 435 | outputFileListPaths = ( 436 | ); 437 | outputPaths = ( 438 | ); 439 | runOnlyForDeploymentPostprocessing = 0; 440 | shellPath = /bin/sh; 441 | shellScript = "export RCT_METRO_PORT=\"${RCT_METRO_PORT:=8081}\"\necho \"export RCT_METRO_PORT=${RCT_METRO_PORT}\" > \"${SRCROOT}/../node_modules/react-native/scripts/.packager.env\"\nif [ -z \"${RCT_NO_LAUNCH_PACKAGER+xxx}\" ] ; then\n if nc -w 5 -z localhost ${RCT_METRO_PORT} ; then\n if ! curl -s \"http://localhost:${RCT_METRO_PORT}/status\" | grep -q \"packager-status:running\" ; then\n echo \"Port ${RCT_METRO_PORT} already in use, packager is either not running or not running correctly\"\n exit 2\n fi\n else\n open \"$SRCROOT/../node_modules/react-native/scripts/launchPackager.command\" || echo \"Can't start packager automatically\"\n fi\nfi\n"; 442 | showEnvVarsInLog = 0; 443 | }; 444 | FD10A7F122414F3F0027D42C /* Start Packager */ = { 445 | isa = PBXShellScriptBuildPhase; 446 | buildActionMask = 2147483647; 447 | files = ( 448 | ); 449 | inputFileListPaths = ( 450 | ); 451 | inputPaths = ( 452 | ); 453 | name = "Start Packager"; 454 | outputFileListPaths = ( 455 | ); 456 | outputPaths = ( 457 | ); 458 | runOnlyForDeploymentPostprocessing = 0; 459 | shellPath = /bin/sh; 460 | shellScript = "export RCT_METRO_PORT=\"${RCT_METRO_PORT:=8081}\"\necho \"export RCT_METRO_PORT=${RCT_METRO_PORT}\" > \"${SRCROOT}/../node_modules/react-native/scripts/.packager.env\"\nif [ -z \"${RCT_NO_LAUNCH_PACKAGER+xxx}\" ] ; then\n if nc -w 5 -z localhost ${RCT_METRO_PORT} ; then\n if ! curl -s \"http://localhost:${RCT_METRO_PORT}/status\" | grep -q \"packager-status:running\" ; then\n echo \"Port ${RCT_METRO_PORT} already in use, packager is either not running or not running correctly\"\n exit 2\n fi\n else\n open \"$SRCROOT/../node_modules/react-native/scripts/launchPackager.command\" || echo \"Can't start packager automatically\"\n fi\nfi\n"; 461 | showEnvVarsInLog = 0; 462 | }; 463 | /* End PBXShellScriptBuildPhase section */ 464 | 465 | /* Begin PBXSourcesBuildPhase section */ 466 | 00E356EA1AD99517003FC87E /* Sources */ = { 467 | isa = PBXSourcesBuildPhase; 468 | buildActionMask = 2147483647; 469 | files = ( 470 | 00E356F31AD99517003FC87E /* SwipeableExampleTests.m in Sources */, 471 | ); 472 | runOnlyForDeploymentPostprocessing = 0; 473 | }; 474 | 13B07F871A680F5B00A75B9A /* Sources */ = { 475 | isa = PBXSourcesBuildPhase; 476 | buildActionMask = 2147483647; 477 | files = ( 478 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */, 479 | 13B07FC11A68108700A75B9A /* main.m in Sources */, 480 | ); 481 | runOnlyForDeploymentPostprocessing = 0; 482 | }; 483 | 2D02E4771E0B4A5D006451C7 /* Sources */ = { 484 | isa = PBXSourcesBuildPhase; 485 | buildActionMask = 2147483647; 486 | files = ( 487 | 2D02E4BF1E0B4AB3006451C7 /* main.m in Sources */, 488 | 2D02E4BC1E0B4A80006451C7 /* AppDelegate.m in Sources */, 489 | ); 490 | runOnlyForDeploymentPostprocessing = 0; 491 | }; 492 | 2D02E48C1E0B4A5D006451C7 /* Sources */ = { 493 | isa = PBXSourcesBuildPhase; 494 | buildActionMask = 2147483647; 495 | files = ( 496 | 2DCD954D1E0B4F2C00145EB5 /* SwipeableExampleTests.m in Sources */, 497 | ); 498 | runOnlyForDeploymentPostprocessing = 0; 499 | }; 500 | /* End PBXSourcesBuildPhase section */ 501 | 502 | /* Begin PBXTargetDependency section */ 503 | 00E356F51AD99517003FC87E /* PBXTargetDependency */ = { 504 | isa = PBXTargetDependency; 505 | target = 13B07F861A680F5B00A75B9A /* SwipeableExample */; 506 | targetProxy = 00E356F41AD99517003FC87E /* PBXContainerItemProxy */; 507 | }; 508 | 2D02E4921E0B4A5D006451C7 /* PBXTargetDependency */ = { 509 | isa = PBXTargetDependency; 510 | target = 2D02E47A1E0B4A5D006451C7 /* SwipeableExample-tvOS */; 511 | targetProxy = 2D02E4911E0B4A5D006451C7 /* PBXContainerItemProxy */; 512 | }; 513 | /* End PBXTargetDependency section */ 514 | 515 | /* Begin XCBuildConfiguration section */ 516 | 00E356F61AD99517003FC87E /* Debug */ = { 517 | isa = XCBuildConfiguration; 518 | buildSettings = { 519 | BUNDLE_LOADER = "$(TEST_HOST)"; 520 | GCC_PREPROCESSOR_DEFINITIONS = ( 521 | "DEBUG=1", 522 | "$(inherited)", 523 | ); 524 | INFOPLIST_FILE = SwipeableExampleTests/Info.plist; 525 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 526 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 527 | OTHER_LDFLAGS = ( 528 | "-ObjC", 529 | "-lc++", 530 | "$(inherited)", 531 | ); 532 | PRODUCT_BUNDLE_IDENTIFIER = com.example.reactnativeswipeable; 533 | PRODUCT_NAME = "$(TARGET_NAME)"; 534 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SwipeableExample.app/SwipeableExample"; 535 | }; 536 | name = Debug; 537 | }; 538 | 00E356F71AD99517003FC87E /* Release */ = { 539 | isa = XCBuildConfiguration; 540 | buildSettings = { 541 | BUNDLE_LOADER = "$(TEST_HOST)"; 542 | COPY_PHASE_STRIP = NO; 543 | INFOPLIST_FILE = SwipeableExampleTests/Info.plist; 544 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 545 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 546 | OTHER_LDFLAGS = ( 547 | "-ObjC", 548 | "-lc++", 549 | "$(inherited)", 550 | ); 551 | PRODUCT_BUNDLE_IDENTIFIER = com.example.reactnativeswipeable; 552 | PRODUCT_NAME = "$(TARGET_NAME)"; 553 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SwipeableExample.app/SwipeableExample"; 554 | }; 555 | name = Release; 556 | }; 557 | 13B07F941A680F5B00A75B9A /* Debug */ = { 558 | isa = XCBuildConfiguration; 559 | baseConfigurationReference = 47F7ED3B7971BE374F7B8635 /* Pods-SwipeableExample.debug.xcconfig */; 560 | buildSettings = { 561 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 562 | CLANG_ENABLE_MODULES = YES; 563 | CURRENT_PROJECT_VERSION = 1; 564 | ENABLE_BITCODE = NO; 565 | INFOPLIST_FILE = SwipeableExample/Info.plist; 566 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 567 | OTHER_LDFLAGS = ( 568 | "$(inherited)", 569 | "-ObjC", 570 | "-lc++", 571 | ); 572 | PRODUCT_BUNDLE_IDENTIFIER = com.example.reactnativeswipeable; 573 | PRODUCT_NAME = SwipeableExample; 574 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 575 | SWIFT_VERSION = 5.0; 576 | VERSIONING_SYSTEM = "apple-generic"; 577 | }; 578 | name = Debug; 579 | }; 580 | 13B07F951A680F5B00A75B9A /* Release */ = { 581 | isa = XCBuildConfiguration; 582 | baseConfigurationReference = E00ACF0FDA8BF921659E2F9A /* Pods-SwipeableExample.release.xcconfig */; 583 | buildSettings = { 584 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 585 | CLANG_ENABLE_MODULES = YES; 586 | CURRENT_PROJECT_VERSION = 1; 587 | INFOPLIST_FILE = SwipeableExample/Info.plist; 588 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 589 | OTHER_LDFLAGS = ( 590 | "$(inherited)", 591 | "-ObjC", 592 | "-lc++", 593 | ); 594 | PRODUCT_BUNDLE_IDENTIFIER = com.example.reactnativeswipeable; 595 | PRODUCT_NAME = SwipeableExample; 596 | SWIFT_VERSION = 5.0; 597 | VERSIONING_SYSTEM = "apple-generic"; 598 | }; 599 | name = Release; 600 | }; 601 | 2D02E4971E0B4A5E006451C7 /* Debug */ = { 602 | isa = XCBuildConfiguration; 603 | buildSettings = { 604 | ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image"; 605 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 606 | CLANG_ANALYZER_NONNULL = YES; 607 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 608 | CLANG_WARN_INFINITE_RECURSION = YES; 609 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 610 | DEBUG_INFORMATION_FORMAT = dwarf; 611 | ENABLE_TESTABILITY = YES; 612 | GCC_NO_COMMON_BLOCKS = YES; 613 | INFOPLIST_FILE = "SwipeableExample-tvOS/Info.plist"; 614 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 615 | OTHER_LDFLAGS = ( 616 | "$(inherited)", 617 | "-ObjC", 618 | "-lc++", 619 | ); 620 | PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.SwipeableExample-tvOS"; 621 | PRODUCT_NAME = "$(TARGET_NAME)"; 622 | SDKROOT = appletvos; 623 | TARGETED_DEVICE_FAMILY = 3; 624 | TVOS_DEPLOYMENT_TARGET = 10.0; 625 | }; 626 | name = Debug; 627 | }; 628 | 2D02E4981E0B4A5E006451C7 /* Release */ = { 629 | isa = XCBuildConfiguration; 630 | buildSettings = { 631 | ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image"; 632 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 633 | CLANG_ANALYZER_NONNULL = YES; 634 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 635 | CLANG_WARN_INFINITE_RECURSION = YES; 636 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 637 | COPY_PHASE_STRIP = NO; 638 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 639 | GCC_NO_COMMON_BLOCKS = YES; 640 | INFOPLIST_FILE = "SwipeableExample-tvOS/Info.plist"; 641 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 642 | OTHER_LDFLAGS = ( 643 | "$(inherited)", 644 | "-ObjC", 645 | "-lc++", 646 | ); 647 | PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.SwipeableExample-tvOS"; 648 | PRODUCT_NAME = "$(TARGET_NAME)"; 649 | SDKROOT = appletvos; 650 | TARGETED_DEVICE_FAMILY = 3; 651 | TVOS_DEPLOYMENT_TARGET = 10.0; 652 | }; 653 | name = Release; 654 | }; 655 | 2D02E4991E0B4A5E006451C7 /* Debug */ = { 656 | isa = XCBuildConfiguration; 657 | buildSettings = { 658 | BUNDLE_LOADER = "$(TEST_HOST)"; 659 | CLANG_ANALYZER_NONNULL = YES; 660 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 661 | CLANG_WARN_INFINITE_RECURSION = YES; 662 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 663 | DEBUG_INFORMATION_FORMAT = dwarf; 664 | ENABLE_TESTABILITY = YES; 665 | GCC_NO_COMMON_BLOCKS = YES; 666 | INFOPLIST_FILE = "SwipeableExample-tvOSTests/Info.plist"; 667 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 668 | OTHER_LDFLAGS = ( 669 | "$(inherited)", 670 | "-ObjC", 671 | "-lc++", 672 | ); 673 | PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.SwipeableExample-tvOSTests"; 674 | PRODUCT_NAME = "$(TARGET_NAME)"; 675 | SDKROOT = appletvos; 676 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SwipeableExample-tvOS.app/SwipeableExample-tvOS"; 677 | TVOS_DEPLOYMENT_TARGET = 10.1; 678 | }; 679 | name = Debug; 680 | }; 681 | 2D02E49A1E0B4A5E006451C7 /* Release */ = { 682 | isa = XCBuildConfiguration; 683 | buildSettings = { 684 | BUNDLE_LOADER = "$(TEST_HOST)"; 685 | CLANG_ANALYZER_NONNULL = YES; 686 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 687 | CLANG_WARN_INFINITE_RECURSION = YES; 688 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 689 | COPY_PHASE_STRIP = NO; 690 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 691 | GCC_NO_COMMON_BLOCKS = YES; 692 | INFOPLIST_FILE = "SwipeableExample-tvOSTests/Info.plist"; 693 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 694 | OTHER_LDFLAGS = ( 695 | "$(inherited)", 696 | "-ObjC", 697 | "-lc++", 698 | ); 699 | PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.SwipeableExample-tvOSTests"; 700 | PRODUCT_NAME = "$(TARGET_NAME)"; 701 | SDKROOT = appletvos; 702 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SwipeableExample-tvOS.app/SwipeableExample-tvOS"; 703 | TVOS_DEPLOYMENT_TARGET = 10.1; 704 | }; 705 | name = Release; 706 | }; 707 | 83CBBA201A601CBA00E9B192 /* Debug */ = { 708 | isa = XCBuildConfiguration; 709 | buildSettings = { 710 | ALWAYS_SEARCH_USER_PATHS = NO; 711 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 712 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 713 | CLANG_CXX_LIBRARY = "libc++"; 714 | CLANG_ENABLE_MODULES = YES; 715 | CLANG_ENABLE_OBJC_ARC = YES; 716 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 717 | CLANG_WARN_BOOL_CONVERSION = YES; 718 | CLANG_WARN_COMMA = YES; 719 | CLANG_WARN_CONSTANT_CONVERSION = YES; 720 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 721 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 722 | CLANG_WARN_EMPTY_BODY = YES; 723 | CLANG_WARN_ENUM_CONVERSION = YES; 724 | CLANG_WARN_INFINITE_RECURSION = YES; 725 | CLANG_WARN_INT_CONVERSION = YES; 726 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 727 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 728 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 729 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 730 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 731 | CLANG_WARN_STRICT_PROTOTYPES = YES; 732 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 733 | CLANG_WARN_UNREACHABLE_CODE = YES; 734 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 735 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 736 | COPY_PHASE_STRIP = NO; 737 | ENABLE_STRICT_OBJC_MSGSEND = YES; 738 | ENABLE_TESTABILITY = YES; 739 | "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "arm64 i386"; 740 | GCC_C_LANGUAGE_STANDARD = gnu99; 741 | GCC_DYNAMIC_NO_PIC = NO; 742 | GCC_NO_COMMON_BLOCKS = YES; 743 | GCC_OPTIMIZATION_LEVEL = 0; 744 | GCC_PREPROCESSOR_DEFINITIONS = ( 745 | "DEBUG=1", 746 | "$(inherited)", 747 | ); 748 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 749 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 750 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 751 | GCC_WARN_UNDECLARED_SELECTOR = YES; 752 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 753 | GCC_WARN_UNUSED_FUNCTION = YES; 754 | GCC_WARN_UNUSED_VARIABLE = YES; 755 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 756 | LD_RUNPATH_SEARCH_PATHS = "/usr/lib/swift $(inherited)"; 757 | LIBRARY_SEARCH_PATHS = ( 758 | "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"", 759 | "\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)\"", 760 | "\"$(inherited)\"", 761 | ); 762 | MTL_ENABLE_DEBUG_INFO = YES; 763 | ONLY_ACTIVE_ARCH = YES; 764 | SDKROOT = iphoneos; 765 | }; 766 | name = Debug; 767 | }; 768 | 83CBBA211A601CBA00E9B192 /* Release */ = { 769 | isa = XCBuildConfiguration; 770 | buildSettings = { 771 | ALWAYS_SEARCH_USER_PATHS = NO; 772 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 773 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 774 | CLANG_CXX_LIBRARY = "libc++"; 775 | CLANG_ENABLE_MODULES = YES; 776 | CLANG_ENABLE_OBJC_ARC = YES; 777 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 778 | CLANG_WARN_BOOL_CONVERSION = YES; 779 | CLANG_WARN_COMMA = YES; 780 | CLANG_WARN_CONSTANT_CONVERSION = YES; 781 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 782 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 783 | CLANG_WARN_EMPTY_BODY = YES; 784 | CLANG_WARN_ENUM_CONVERSION = YES; 785 | CLANG_WARN_INFINITE_RECURSION = YES; 786 | CLANG_WARN_INT_CONVERSION = YES; 787 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 788 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 789 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 790 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 791 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 792 | CLANG_WARN_STRICT_PROTOTYPES = YES; 793 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 794 | CLANG_WARN_UNREACHABLE_CODE = YES; 795 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 796 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 797 | COPY_PHASE_STRIP = YES; 798 | ENABLE_NS_ASSERTIONS = NO; 799 | ENABLE_STRICT_OBJC_MSGSEND = YES; 800 | "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "arm64 i386"; 801 | GCC_C_LANGUAGE_STANDARD = gnu99; 802 | GCC_NO_COMMON_BLOCKS = YES; 803 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 804 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 805 | GCC_WARN_UNDECLARED_SELECTOR = YES; 806 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 807 | GCC_WARN_UNUSED_FUNCTION = YES; 808 | GCC_WARN_UNUSED_VARIABLE = YES; 809 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 810 | LD_RUNPATH_SEARCH_PATHS = "/usr/lib/swift $(inherited)"; 811 | LIBRARY_SEARCH_PATHS = ( 812 | "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"", 813 | "\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)\"", 814 | "\"$(inherited)\"", 815 | ); 816 | MTL_ENABLE_DEBUG_INFO = NO; 817 | SDKROOT = iphoneos; 818 | VALIDATE_PRODUCT = YES; 819 | }; 820 | name = Release; 821 | }; 822 | /* End XCBuildConfiguration section */ 823 | 824 | /* Begin XCConfigurationList section */ 825 | 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "SwipeableExampleTests" */ = { 826 | isa = XCConfigurationList; 827 | buildConfigurations = ( 828 | 00E356F61AD99517003FC87E /* Debug */, 829 | 00E356F71AD99517003FC87E /* Release */, 830 | ); 831 | defaultConfigurationIsVisible = 0; 832 | defaultConfigurationName = Release; 833 | }; 834 | 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "SwipeableExample" */ = { 835 | isa = XCConfigurationList; 836 | buildConfigurations = ( 837 | 13B07F941A680F5B00A75B9A /* Debug */, 838 | 13B07F951A680F5B00A75B9A /* Release */, 839 | ); 840 | defaultConfigurationIsVisible = 0; 841 | defaultConfigurationName = Release; 842 | }; 843 | 2D02E4BA1E0B4A5E006451C7 /* Build configuration list for PBXNativeTarget "SwipeableExample-tvOS" */ = { 844 | isa = XCConfigurationList; 845 | buildConfigurations = ( 846 | 2D02E4971E0B4A5E006451C7 /* Debug */, 847 | 2D02E4981E0B4A5E006451C7 /* Release */, 848 | ); 849 | defaultConfigurationIsVisible = 0; 850 | defaultConfigurationName = Release; 851 | }; 852 | 2D02E4BB1E0B4A5E006451C7 /* Build configuration list for PBXNativeTarget "SwipeableExample-tvOSTests" */ = { 853 | isa = XCConfigurationList; 854 | buildConfigurations = ( 855 | 2D02E4991E0B4A5E006451C7 /* Debug */, 856 | 2D02E49A1E0B4A5E006451C7 /* Release */, 857 | ); 858 | defaultConfigurationIsVisible = 0; 859 | defaultConfigurationName = Release; 860 | }; 861 | 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "SwipeableExample" */ = { 862 | isa = XCConfigurationList; 863 | buildConfigurations = ( 864 | 83CBBA201A601CBA00E9B192 /* Debug */, 865 | 83CBBA211A601CBA00E9B192 /* Release */, 866 | ); 867 | defaultConfigurationIsVisible = 0; 868 | defaultConfigurationName = Release; 869 | }; 870 | /* End XCConfigurationList section */ 871 | }; 872 | rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */; 873 | } 874 | -------------------------------------------------------------------------------- /example/ios/SwipeableExample.xcodeproj/xcshareddata/xcschemes/SwipeableExample.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 44 | 45 | 51 | 52 | 53 | 54 | 64 | 66 | 72 | 73 | 74 | 75 | 81 | 83 | 89 | 90 | 91 | 92 | 94 | 95 | 98 | 99 | 100 | -------------------------------------------------------------------------------- /example/ios/SwipeableExample.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /example/ios/SwipeableExample.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/SwipeableExample/AppDelegate.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Facebook, Inc. and its affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #import 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (nonatomic, strong) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /example/ios/SwipeableExample/AppDelegate.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Facebook, Inc. and its affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #import "AppDelegate.h" 9 | 10 | #import 11 | #import 12 | #import 13 | 14 | #ifdef FB_SONARKIT_ENABLED 15 | #import 16 | #import 17 | #import 18 | #import 19 | #import 20 | #import 21 | static void InitializeFlipper(UIApplication *application) { 22 | FlipperClient *client = [FlipperClient sharedClient]; 23 | SKDescriptorMapper *layoutDescriptorMapper = [[SKDescriptorMapper alloc] initWithDefaults]; 24 | [client addPlugin:[[FlipperKitLayoutPlugin alloc] initWithRootNode:application withDescriptorMapper:layoutDescriptorMapper]]; 25 | [client addPlugin:[[FKUserDefaultsPlugin alloc] initWithSuiteName:nil]]; 26 | [client addPlugin:[FlipperKitReactPlugin new]]; 27 | [client addPlugin:[[FlipperKitNetworkPlugin alloc] initWithNetworkAdapter:[SKIOSNetworkAdapter new]]]; 28 | [client start]; 29 | } 30 | #endif 31 | 32 | @implementation AppDelegate 33 | 34 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 35 | { 36 | #ifdef FB_SONARKIT_ENABLED 37 | InitializeFlipper(application); 38 | #endif 39 | RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions]; 40 | RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge 41 | moduleName:@"SwipeableExample" 42 | initialProperties:nil]; 43 | 44 | if (@available(iOS 13.0, *)) { 45 | rootView.backgroundColor = [UIColor systemBackgroundColor]; 46 | } else { 47 | rootView.backgroundColor = [UIColor whiteColor]; 48 | } 49 | 50 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 51 | UIViewController *rootViewController = [UIViewController new]; 52 | rootViewController.view = rootView; 53 | self.window.rootViewController = rootViewController; 54 | [self.window makeKeyAndVisible]; 55 | return YES; 56 | } 57 | 58 | - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge 59 | { 60 | #if DEBUG 61 | return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil]; 62 | #else 63 | return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; 64 | #endif 65 | } 66 | 67 | @end 68 | -------------------------------------------------------------------------------- /example/ios/SwipeableExample/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/SwipeableExample/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /example/ios/SwipeableExample/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | Swipeable Example 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 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 | NSAppTransportSecurity 28 | 29 | NSAllowsArbitraryLoads 30 | 31 | NSExceptionDomains 32 | 33 | localhost 34 | 35 | NSExceptionAllowsInsecureHTTPLoads 36 | 37 | 38 | 39 | 40 | NSLocationWhenInUseUsageDescription 41 | 42 | UILaunchStoryboardName 43 | LaunchScreen 44 | UIRequiredDeviceCapabilities 45 | 46 | armv7 47 | 48 | UISupportedInterfaceOrientations 49 | 50 | UIInterfaceOrientationPortrait 51 | UIInterfaceOrientationLandscapeLeft 52 | UIInterfaceOrientationLandscapeRight 53 | 54 | UIViewControllerBasedStatusBarAppearance 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /example/ios/SwipeableExample/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 25 | 31 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /example/ios/SwipeableExample/main.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Facebook, Inc. and its affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #import 9 | 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /example/metro.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const blacklist = require('metro-config/src/defaults/blacklist'); 3 | const escape = require('escape-string-regexp'); 4 | const pak = require('../package.json'); 5 | 6 | const root = path.resolve(__dirname, '..'); 7 | 8 | const modules = Object.keys({ 9 | ...pak.peerDependencies, 10 | }); 11 | 12 | module.exports = { 13 | projectRoot: __dirname, 14 | watchFolders: [root], 15 | 16 | // We need to make sure that only one version is loaded for peerDependencies 17 | // So we blacklist them at the root, and alias them to the versions in example's node_modules 18 | resolver: { 19 | blacklistRE: blacklist( 20 | modules.map( 21 | (m) => 22 | new RegExp(`^${escape(path.join(root, 'node_modules', m))}\\/.*$`) 23 | ) 24 | ), 25 | 26 | extraNodeModules: modules.reduce((acc, name) => { 27 | acc[name] = path.join(__dirname, 'node_modules', name); 28 | return acc; 29 | }, {}), 30 | }, 31 | 32 | transformer: { 33 | getTransformOptions: async () => ({ 34 | transform: { 35 | experimentalImportSupport: false, 36 | inlineRequires: true, 37 | }, 38 | }), 39 | }, 40 | }; 41 | -------------------------------------------------------------------------------- /example/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-native-swipeable-example", 3 | "description": "Example app for react-native-swipeable", 4 | "version": "0.0.1", 5 | "private": true, 6 | "scripts": { 7 | "android": "react-native run-android", 8 | "ios": "react-native run-ios", 9 | "start": "react-native start" 10 | }, 11 | "dependencies": { 12 | "react": "17.0.2", 13 | "react-native": "0.65.0-rc.2", 14 | "react-native-gesture-handler": "^1.10.3", 15 | "react-native-reanimated": "^2.2.0" 16 | }, 17 | "devDependencies": { 18 | "@babel/core": "^7.12.9", 19 | "@babel/runtime": "^7.12.5", 20 | "@react-native-community/eslint-config": "^2.0.0", 21 | "babel-jest": "^26.6.3", 22 | "babel-plugin-module-resolver": "^4.0.0", 23 | "eslint": "7.14.0", 24 | "jest": "^26.6.3", 25 | "metro-react-native-babel-preset": "^0.66.0", 26 | "react-native-codegen": "^0.0.7", 27 | "react-test-renderer": "17.0.1" 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /example/src/App.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | import { StyleSheet, FlatList, SafeAreaView } from 'react-native'; 3 | import { useSharedValue } from 'react-native-reanimated'; 4 | import {} from 'react-native-swipeable'; 5 | import PersonItem from './components/PersonItem'; 6 | 7 | const DATA = [ 8 | { 9 | id: 1, 10 | avatar: 11 | 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQNCBWq-ooJMctuPFZ_rSqfQBLyazZuOOvGSTQgpPBmjmrAwJXRXIl1slGQvtR3p_Q7rS4&usqp=CAU', 12 | name: 'Christopher Posey', 13 | }, 14 | { 15 | id: 2, 16 | avatar: 17 | 'https://photoartinc.com/wp-content/uploads/2018/02/photos-for-profile-picture.jpg', 18 | name: 'Anna Joey', 19 | }, 20 | { 21 | id: 3, 22 | avatar: 23 | 'https://s.studiobinder.com/wp-content/uploads/2021/01/Best-black-and-white-portraits-by-Platon.jpg?resolution=2560,1', 24 | name: 'Rishi Micha', 25 | }, 26 | { 27 | id: 4, 28 | avatar: 29 | 'https://abrittonphotography.com/wp-content/uploads/2017/12/Famous-Black-and-White-Portrait-Photographers.jpg', 30 | name: 'Parminder Ibraheem', 31 | }, 32 | { 33 | id: 5, 34 | avatar: 35 | 'https://cdn.goodgallery.com/e5ba8caf-02ad-404d-b239-84f0f06ff99c/t/0400/2fkix8wm/black-white-portrait-photographer-baltimore-maryland.jpg', 36 | name: 'Nevena Pavle', 37 | }, 38 | { 39 | id: 6, 40 | avatar: 41 | 'https://www.amateurphotographer.co.uk/wp-content/uploads/2020/04/Mono-portraits-without-rotolight.jpg', 42 | name: 'Pitter Radmila', 43 | }, 44 | { 45 | id: 7, 46 | avatar: 47 | 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQInqh7fBdL9eYAdoTK4zt8wSkdCb-2chFApw&usqp=CAU', 48 | name: 'Celestino Redmund', 49 | }, 50 | ]; 51 | 52 | export default function App() { 53 | const activeItem = useSharedValue(-1); 54 | 55 | const renderItem = React.useCallback( 56 | ({ item }) => { 57 | return ; 58 | }, 59 | [activeItem] 60 | ); 61 | 62 | return ( 63 | 64 | 65 | 66 | ); 67 | } 68 | 69 | const styles = StyleSheet.create({ 70 | container: { 71 | flex: 1, 72 | }, 73 | box: { 74 | width: 60, 75 | height: 60, 76 | marginVertical: 20, 77 | }, 78 | }); 79 | -------------------------------------------------------------------------------- /example/src/components/PersonItem.tsx: -------------------------------------------------------------------------------- 1 | import React, { useCallback } from 'react'; 2 | import { Alert, Image, StyleSheet, Text, View } from 'react-native'; 3 | import type Animated from 'react-native-reanimated'; 4 | import { useDerivedValue } from 'react-native-reanimated'; 5 | import { 6 | SwipeableItem, 7 | withSwipeableContext, 8 | useSwipeableContext, 9 | } from 'react-native-swipeable'; 10 | 11 | type Props = { 12 | item: any; 13 | activeItem: Animated.SharedValue; 14 | }; 15 | 16 | function PersonItem({ item, activeItem }: Props) { 17 | const { close } = useSwipeableContext(); 18 | 19 | const handleDeletePress = useCallback(() => { 20 | Alert.alert('Delete pressed'); 21 | }, []); 22 | 23 | const handleEditPress = useCallback(() => { 24 | Alert.alert('Edit pressed'); 25 | }, []); 26 | 27 | const handlePinPress = useCallback(() => { 28 | Alert.alert('Pin pressed'); 29 | }, []); 30 | 31 | const handleItemPress = useCallback(() => { 32 | Alert.alert('Item pressed'); 33 | }, []); 34 | 35 | useDerivedValue(() => { 36 | if (activeItem.value !== item.id) { 37 | close(); 38 | } 39 | }, []); 40 | 41 | const handleStartDrag = useCallback(() => { 42 | activeItem.value = item.id; 43 | }, [item, activeItem]); 44 | 45 | const renderRightActions = useCallback(() => { 46 | return ( 47 | <> 48 | 49 | 50 | Delete 51 | 52 | 53 | 54 | 55 | Edit 56 | 57 | 58 | 59 | ); 60 | }, [handleDeletePress, handleEditPress]); 61 | 62 | const renderLeftActions = useCallback(() => { 63 | return ( 64 | 65 | 66 | Pin 67 | 68 | 69 | ); 70 | }, [handlePinPress]); 71 | 72 | return ( 73 | 80 | 81 | 82 | 83 | {item.name} 84 | 85 | Lorem Ipsum is simply dummy text of the printing and typesetting 86 | industry. 87 | 88 | 89 | 90 | 91 | ); 92 | } 93 | 94 | export default withSwipeableContext(PersonItem); 95 | 96 | const styles = StyleSheet.create({ 97 | container: { 98 | marginTop: 20, 99 | }, 100 | overlay: { 101 | paddingHorizontal: 20, 102 | flexDirection: 'row', 103 | backgroundColor: 'white', 104 | }, 105 | avatar: { 106 | width: 80, 107 | height: 80, 108 | borderRadius: 12, 109 | }, 110 | info: { 111 | marginLeft: 20, 112 | flex: 1, 113 | }, 114 | name: { 115 | fontWeight: '700', 116 | fontSize: 20, 117 | marginBottom: 10, 118 | }, 119 | delete: { 120 | width: 80, 121 | backgroundColor: 'red', 122 | flex: 1, 123 | alignItems: 'center', 124 | justifyContent: 'center', 125 | }, 126 | }); 127 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@r0b0t3d/react-native-swipeable", 3 | "version": "0.1.1", 4 | "description": "Swipeable component for react native powered by Reanimated 2 and Gesture Handler", 5 | "main": "lib/commonjs/index", 6 | "module": "lib/module/index", 7 | "types": "lib/typescript/index.d.ts", 8 | "react-native": "src/index", 9 | "source": "src/index", 10 | "files": [ 11 | "src", 12 | "lib", 13 | "android", 14 | "ios", 15 | "cpp", 16 | "react-native-swipeable.podspec", 17 | "!lib/typescript/example", 18 | "!android/build", 19 | "!ios/build", 20 | "!**/__tests__", 21 | "!**/__fixtures__", 22 | "!**/__mocks__" 23 | ], 24 | "scripts": { 25 | "test": "jest", 26 | "typescript": "tsc --noEmit", 27 | "lint": "eslint \"**/*.{js,ts,tsx}\"", 28 | "prepare": "bob build", 29 | "release": "release-it", 30 | "example": "yarn --cwd example", 31 | "pods": "cd example && pod-install --quiet", 32 | "bootstrap": "yarn example && yarn && yarn pods" 33 | }, 34 | "keywords": [ 35 | "react-native", 36 | "ios", 37 | "android" 38 | ], 39 | "repository": "https://github.com/r0b0t3d/react-native-swipeable", 40 | "author": "Tuan Luong (https://github.com/r0b0t3d)", 41 | "license": "MIT", 42 | "bugs": { 43 | "url": "https://github.com/r0b0t3d/react-native-swipeable/issues" 44 | }, 45 | "homepage": "https://github.com/r0b0t3d/react-native-swipeable#readme", 46 | "publishConfig": { 47 | "registry": "https://registry.npmjs.org/" 48 | }, 49 | "devDependencies": { 50 | "@commitlint/config-conventional": "^11.0.0", 51 | "@react-native-community/eslint-config": "^2.0.0", 52 | "@release-it/conventional-changelog": "^2.0.0", 53 | "@types/jest": "^26.0.0", 54 | "@types/react": "^16.9.19", 55 | "@types/react-native": "0.62.13", 56 | "commitlint": "^11.0.0", 57 | "eslint": "^7.2.0", 58 | "eslint-config-prettier": "^7.0.0", 59 | "eslint-plugin-prettier": "^3.1.3", 60 | "husky": "^4.2.5", 61 | "jest": "^26.0.1", 62 | "pod-install": "^0.1.0", 63 | "prettier": "^2.0.5", 64 | "react": "16.13.1", 65 | "react-native": "0.63.4", 66 | "react-native-builder-bob": "^0.18.0", 67 | "react-native-gesture-handler": "^1.10.3", 68 | "react-native-reanimated": "^2.2.0", 69 | "release-it": "^14.2.2", 70 | "typescript": "^4.1.3" 71 | }, 72 | "peerDependencies": { 73 | "react": "*", 74 | "react-native": "*", 75 | "react-native-gesture-handler": ">=1.10.3", 76 | "react-native-reanimated": ">=2.2.0" 77 | }, 78 | "jest": { 79 | "preset": "react-native", 80 | "modulePathIgnorePatterns": [ 81 | "/example/node_modules", 82 | "/lib/" 83 | ] 84 | }, 85 | "husky": { 86 | "hooks": { 87 | "commit-msg": "commitlint -E HUSKY_GIT_PARAMS", 88 | "pre-commit": "yarn lint && yarn typescript" 89 | } 90 | }, 91 | "commitlint": { 92 | "extends": [ 93 | "@commitlint/config-conventional" 94 | ] 95 | }, 96 | "release-it": { 97 | "git": { 98 | "commitMessage": "chore: release ${version}", 99 | "tagName": "v${version}" 100 | }, 101 | "npm": { 102 | "publish": true 103 | }, 104 | "github": { 105 | "release": true 106 | }, 107 | "plugins": { 108 | "@release-it/conventional-changelog": { 109 | "preset": "angular" 110 | } 111 | } 112 | }, 113 | "eslintConfig": { 114 | "root": true, 115 | "extends": [ 116 | "@react-native-community", 117 | "prettier" 118 | ], 119 | "rules": { 120 | "prettier/prettier": [ 121 | "error", 122 | { 123 | "quoteProps": "consistent", 124 | "singleQuote": true, 125 | "tabWidth": 2, 126 | "trailingComma": "es5", 127 | "useTabs": false 128 | } 129 | ] 130 | } 131 | }, 132 | "eslintIgnore": [ 133 | "node_modules/", 134 | "lib/" 135 | ], 136 | "prettier": { 137 | "quoteProps": "consistent", 138 | "singleQuote": true, 139 | "tabWidth": 2, 140 | "trailingComma": "es5", 141 | "useTabs": false 142 | }, 143 | "react-native-builder-bob": { 144 | "source": "src", 145 | "output": "lib", 146 | "targets": [ 147 | "commonjs", 148 | "module", 149 | [ 150 | "typescript", 151 | { 152 | "project": "tsconfig.build.json" 153 | } 154 | ] 155 | ] 156 | } 157 | } 158 | -------------------------------------------------------------------------------- /pictures/intro.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r0b0t3d/react-native-swipeable/f816445074b22911f71ce714713f08ce6eb5fda0/pictures/intro.gif -------------------------------------------------------------------------------- /scripts/bootstrap.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const child_process = require('child_process'); 3 | 4 | const root = path.resolve(__dirname, '..'); 5 | const args = process.argv.slice(2); 6 | const options = { 7 | cwd: process.cwd(), 8 | env: process.env, 9 | stdio: 'inherit', 10 | encoding: 'utf-8', 11 | }; 12 | 13 | let result; 14 | 15 | if (process.cwd() !== root || args.length) { 16 | // We're not in the root of the project, or additional arguments were passed 17 | // In this case, forward the command to `yarn` 18 | result = child_process.spawnSync('yarn', args, options); 19 | } else { 20 | // If `yarn` is run without arguments, perform bootstrap 21 | result = child_process.spawnSync('yarn', ['bootstrap'], options); 22 | } 23 | 24 | process.exitCode = result.status; 25 | -------------------------------------------------------------------------------- /src/__tests__/index.test.tsx: -------------------------------------------------------------------------------- 1 | it.todo('write a test'); 2 | -------------------------------------------------------------------------------- /src/components/SwipeableContainer.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable react-hooks/exhaustive-deps */ 2 | import React, { ReactElement, FC, useMemo, useCallback } from 'react'; 3 | import { useSharedValue, withSpring } from 'react-native-reanimated'; 4 | import { SwipeableContext } from './useSwipeableContext'; 5 | 6 | const defaultSpringConfigs = { 7 | overshootClamping: true, 8 | }; 9 | 10 | type Props = { 11 | children: ReactElement; 12 | }; 13 | 14 | function SwipeableContainer({ children }: Props) { 15 | const translateX = useSharedValue(0); 16 | const swipeableState = useSharedValue<'closed' | 'opened'>('closed'); 17 | 18 | const close = useCallback(() => { 19 | 'worklet'; 20 | 21 | if (swipeableState.value === 'opened') { 22 | translateX.value = withSpring(0, defaultSpringConfigs); 23 | swipeableState.value = 'closed'; 24 | } 25 | }, []); 26 | 27 | const context = useMemo( 28 | () => ({ 29 | translateX, 30 | swipeableState, 31 | close, 32 | }), 33 | [] 34 | ); 35 | 36 | return ( 37 | 38 | {children} 39 | 40 | ); 41 | } 42 | 43 | export default function withSwipeableContext(Component: FC) { 44 | return (props: T) => ( 45 | 46 | 47 | 48 | ); 49 | } 50 | -------------------------------------------------------------------------------- /src/components/SwipeableItem.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable react-hooks/exhaustive-deps */ 2 | import React, { ReactElement, useRef, useCallback } from 'react'; 3 | import { 4 | StyleProp, 5 | ViewStyle, 6 | StyleSheet, 7 | View, 8 | LayoutChangeEvent, 9 | } from 'react-native'; 10 | 11 | import { 12 | PanGestureHandler, 13 | TapGestureHandler, 14 | } from 'react-native-gesture-handler'; 15 | import Animated, { 16 | runOnJS, 17 | useAnimatedGestureHandler, 18 | useAnimatedStyle, 19 | useSharedValue, 20 | withSpring, 21 | } from 'react-native-reanimated'; 22 | import useSwipeableContext from './useSwipeableContext'; 23 | import { rubberClamp, springConfig } from './utils'; 24 | 25 | type Props = { 26 | containerStyle?: StyleProp; 27 | children: ReactElement; 28 | renderRightActions?: () => ReactElement; 29 | renderLeftActions?: () => ReactElement; 30 | onOpened?: () => void; 31 | onClosed?: () => void; 32 | onItemPress?: () => void; 33 | onStartDrag?: () => void; 34 | }; 35 | 36 | export default function SwipeableItem({ 37 | containerStyle, 38 | children, 39 | renderRightActions, 40 | renderLeftActions, 41 | onStartDrag = () => null, 42 | onOpened = () => null, 43 | onClosed = () => null, 44 | onItemPress = () => null, 45 | }: Props) { 46 | const rightActionsWidth = useSharedValue(0); 47 | const leftActionsWidth = useSharedValue(0); 48 | const panRef = useRef(null); 49 | 50 | const { translateX, swipeableState, close } = useSwipeableContext(); 51 | 52 | const findSnapPoint = useCallback((x: number, direction: string) => { 53 | 'worklet'; 54 | 55 | const snapPoints: number[] = []; 56 | if (rightActionsWidth.value > 0) { 57 | snapPoints.push(-rightActionsWidth.value); 58 | } 59 | snapPoints.push(0); 60 | if (leftActionsWidth.value > 0) { 61 | snapPoints.push(leftActionsWidth.value); 62 | } 63 | if (direction === 'right') { 64 | for (let i = snapPoints.length - 1; i >= 0; i -= 1) { 65 | if (x > snapPoints[i]) { 66 | const toIndex = Math.min(snapPoints.length - 1, i + 1); 67 | return snapPoints[toIndex]; 68 | } 69 | } 70 | } else if (direction === 'left') { 71 | for (let i = 0; i < snapPoints.length; i += 1) { 72 | if (x < snapPoints[i]) { 73 | const toIndex = Math.max(0, i - 1); 74 | return snapPoints[toIndex]; 75 | } 76 | } 77 | } 78 | return 0; 79 | }, []); 80 | 81 | const gestureHandler = useAnimatedGestureHandler( 82 | { 83 | onStart: (_, ctx: any) => { 84 | ctx.startX = translateX.value; 85 | runOnJS(onStartDrag)(); 86 | }, 87 | onActive: (event, ctx) => { 88 | const diff = (ctx.prevTranslationX || 0) - event.translationX; 89 | if (diff > 0) { 90 | ctx.gestureDirection = 'left'; 91 | } else if (diff < 0) { 92 | ctx.gestureDirection = 'right'; 93 | } else { 94 | ctx.gestureDirection = 'unknown'; 95 | } 96 | ctx.prevTranslationX = event.translationX; 97 | const toValue = ctx.startX + event.translationX; 98 | const leftBound = -rightActionsWidth.value; 99 | const rightBound = leftActionsWidth.value; 100 | const value = rubberClamp(toValue, leftBound, rightBound); 101 | translateX.value = value; 102 | }, 103 | onEnd: (event, ctx) => { 104 | const finalX = ctx.startX + event.translationX; 105 | const snapPoint = findSnapPoint(finalX, ctx.gestureDirection); 106 | const newState = snapPoint === 0 ? 'closed' : 'opened'; 107 | if (newState !== swipeableState.value) { 108 | swipeableState.value = newState; 109 | if (newState === 'opened') { 110 | runOnJS(onOpened)(); 111 | } else { 112 | runOnJS(onClosed)(); 113 | } 114 | } 115 | translateX.value = withSpring( 116 | snapPoint || 0, 117 | springConfig(event.velocityX) 118 | ); 119 | }, 120 | }, 121 | [findSnapPoint] 122 | ); 123 | 124 | const animatedStyle = useAnimatedStyle(() => ({ 125 | transform: [ 126 | { 127 | translateX: translateX.value, 128 | }, 129 | ], 130 | })); 131 | 132 | const handleRightActionsLayout = useCallback((layout: LayoutChangeEvent) => { 133 | rightActionsWidth.value = layout.nativeEvent.layout.width; 134 | }, []); 135 | 136 | const handleLeftActionsLayout = useCallback((layout: LayoutChangeEvent) => { 137 | leftActionsWidth.value = layout.nativeEvent.layout.width; 138 | }, []); 139 | 140 | const handleItemTap = useCallback(() => { 141 | if (swipeableState.value === 'opened') { 142 | close(); 143 | return; 144 | } 145 | onItemPress(); 146 | }, [close, onItemPress]); 147 | 148 | return ( 149 | 154 | 155 | {renderRightActions && ( 156 | 157 | {renderRightActions()} 158 | 159 | )} 160 | {renderLeftActions && ( 161 | 162 | {renderLeftActions()} 163 | 164 | )} 165 | 171 | 172 | {children} 173 | 174 | 175 | 176 | 177 | ); 178 | } 179 | 180 | function SwipeableButton({ 181 | style, 182 | children, 183 | onPress, 184 | }: { 185 | style?: StyleProp; 186 | children: ReactElement; 187 | onPress: () => void; 188 | }) { 189 | const handleSingleTap = useCallback(() => { 190 | onPress(); 191 | }, [onPress]); 192 | 193 | return ( 194 | 195 | {children} 196 | 197 | ); 198 | } 199 | 200 | SwipeableItem.Button = SwipeableButton; 201 | 202 | const styles = StyleSheet.create({ 203 | container: {}, 204 | overlay: {}, 205 | rightActions: { 206 | flexDirection: 'row', 207 | position: 'absolute', 208 | top: 0, 209 | bottom: 0, 210 | right: 0, 211 | }, 212 | leftActions: { 213 | flexDirection: 'row', 214 | position: 'absolute', 215 | top: 0, 216 | bottom: 0, 217 | left: 0, 218 | }, 219 | }); 220 | -------------------------------------------------------------------------------- /src/components/useSwipeableContext.ts: -------------------------------------------------------------------------------- 1 | import { createContext, useContext } from 'react'; 2 | import type Animated from 'react-native-reanimated'; 3 | 4 | type SwipeableContextType = { 5 | translateX: Animated.SharedValue; 6 | swipeableState: Animated.SharedValue<'closed' | 'opened'>; 7 | close: () => void; 8 | }; 9 | 10 | // @ts-ignore 11 | export const SwipeableContext = createContext(); 12 | 13 | export default function useSwipeableContext() { 14 | const ctx = useContext(SwipeableContext); 15 | if (!ctx) { 16 | throw new Error('Component should be wrapped by withSwipeableContext'); 17 | } 18 | return ctx; 19 | } 20 | -------------------------------------------------------------------------------- /src/components/utils.ts: -------------------------------------------------------------------------------- 1 | export const springConfig = (velocity: number) => { 2 | 'worklet'; 3 | 4 | return { 5 | stiffness: 1000, 6 | damping: 500, 7 | mass: 3, 8 | overshootClamping: true, 9 | restDisplacementThreshold: 0.01, 10 | restSpeedThreshold: 0.01, 11 | velocity, 12 | }; 13 | }; 14 | 15 | export function clamp(value: number, lowerbound: number, upperbound: number) { 16 | 'worklet'; 17 | 18 | return Math.min(Math.max(value, lowerbound), upperbound); 19 | } 20 | 21 | /** 22 | * calculates rubber value 23 | * 24 | * @param x distance from the edge 25 | * @param dim dimension, either width or height 26 | * @param coeff constant value, UIScrollView uses 0.55 27 | * @returns rubber = (1.0 – (1.0 / ((x * coeff / dim) + 1.0))) * dim 28 | */ 29 | export const rubberBandClamp = (x: number, dim: number, coeff: number) => { 30 | 'worklet'; 31 | 32 | return (1.0 - 1.0 / ((x * coeff) / dim + 1.0)) * dim; 33 | }; 34 | 35 | export const rubberClamp = ( 36 | x: number, 37 | leftBound: number, 38 | rightBound: number, 39 | coeff = 0.55 40 | ) => { 41 | 'worklet'; 42 | 43 | const clampedX = clamp(x, leftBound, rightBound); 44 | const diff = Math.abs(x - clampedX); 45 | const sign = clampedX > x ? -1 : 1; 46 | const dimension = rightBound - leftBound; 47 | 48 | return clampedX + sign * rubberBandClamp(diff, dimension, coeff); 49 | }; 50 | -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- 1 | export { default as SwipeableItem } from './components/SwipeableItem'; 2 | export { default as withSwipeableContext } from './components/SwipeableContainer'; 3 | export { default as useSwipeableContext } from './components/useSwipeableContext'; 4 | -------------------------------------------------------------------------------- /tsconfig.build.json: -------------------------------------------------------------------------------- 1 | 2 | { 3 | "extends": "./tsconfig", 4 | "exclude": ["example"] 5 | } 6 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "baseUrl": "./", 4 | "paths": { 5 | "react-native-swipeable": ["./src/index"] 6 | }, 7 | "allowUnreachableCode": false, 8 | "allowUnusedLabels": false, 9 | "esModuleInterop": true, 10 | "importsNotUsedAsValues": "error", 11 | "forceConsistentCasingInFileNames": true, 12 | "jsx": "react", 13 | "lib": ["esnext"], 14 | "module": "esnext", 15 | "moduleResolution": "node", 16 | "noFallthroughCasesInSwitch": true, 17 | "noImplicitReturns": true, 18 | "noImplicitUseStrict": false, 19 | "noStrictGenericChecks": false, 20 | "noUnusedLocals": true, 21 | "noUnusedParameters": true, 22 | "resolveJsonModule": true, 23 | "skipLibCheck": true, 24 | "strict": true, 25 | "target": "esnext" 26 | } 27 | } 28 | --------------------------------------------------------------------------------