├── .circleci └── config.yml ├── .editorconfig ├── .gitattributes ├── .gitignore ├── .yarnrc ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── android ├── build.gradle └── src │ └── main │ ├── AndroidManifest.xml │ └── java │ └── com │ └── reactnativelyrefreshcontrol │ ├── LyRefreshControlPackage.java │ └── LyRefreshControlViewManager.java ├── babel.config.js ├── example ├── android │ ├── app │ │ ├── build.gradle │ │ ├── debug.keystore │ │ ├── proguard-rules.pro │ │ └── src │ │ │ ├── debug │ │ │ ├── AndroidManifest.xml │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── reactnativelyrefreshcontrol │ │ │ │ └── ReactNativeFlipper.java │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── reactnativelyrefreshcontrol │ │ │ │ ├── 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 │ ├── LyRefreshControlExample-Bridging-Header.h │ ├── LyRefreshControlExample.xcodeproj │ │ ├── project.pbxproj │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── LyRefreshControlExample.xcscheme │ ├── LyRefreshControlExample.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ ├── LyRefreshControlExample │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── Images.xcassets │ │ │ ├── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ │ └── Contents.json │ │ ├── Info.plist │ │ ├── LaunchScreen.storyboard │ │ └── main.m │ ├── Podfile │ └── Podfile.lock ├── metro.config.js ├── package.json ├── src │ ├── App.tsx │ └── assets │ │ ├── dropdown_anim__00010@2x.png │ │ ├── dropdown_anim__00011@2x.png │ │ ├── dropdown_anim__00012@2x.png │ │ ├── dropdown_anim__00013@2x.png │ │ ├── dropdown_anim__00014@2x.png │ │ ├── dropdown_anim__00015@2x.png │ │ ├── dropdown_anim__00016@2x.png │ │ ├── dropdown_anim__00017@2x.png │ │ ├── dropdown_anim__00018@2x.png │ │ ├── dropdown_anim__00019@2x.png │ │ ├── dropdown_anim__0001@2x.png │ │ ├── dropdown_anim__00020@2x.png │ │ ├── dropdown_anim__00021@2x.png │ │ ├── dropdown_anim__00022@2x.png │ │ ├── dropdown_anim__00023@2x.png │ │ ├── dropdown_anim__00024@2x.png │ │ ├── dropdown_anim__00025@2x.png │ │ ├── dropdown_anim__00026@2x.png │ │ ├── dropdown_anim__00027@2x.png │ │ ├── dropdown_anim__00028@2x.png │ │ ├── dropdown_anim__00029@2x.png │ │ ├── dropdown_anim__0002@2x.png │ │ ├── dropdown_anim__00030@2x.png │ │ ├── dropdown_anim__00031@2x.png │ │ ├── dropdown_anim__00032@2x.png │ │ ├── dropdown_anim__00033@2x.png │ │ ├── dropdown_anim__00034@2x.png │ │ ├── dropdown_anim__00035@2x.png │ │ ├── dropdown_anim__00036@2x.png │ │ ├── dropdown_anim__00037@2x.png │ │ ├── dropdown_anim__00038@2x.png │ │ ├── dropdown_anim__00039@2x.png │ │ ├── dropdown_anim__0003@2x.png │ │ ├── dropdown_anim__00040@2x.png │ │ ├── dropdown_anim__00041@2x.png │ │ ├── dropdown_anim__00042@2x.png │ │ ├── dropdown_anim__00043@2x.png │ │ ├── dropdown_anim__00044@2x.png │ │ ├── dropdown_anim__00045@2x.png │ │ ├── dropdown_anim__00046@2x.png │ │ ├── dropdown_anim__00047@2x.png │ │ ├── dropdown_anim__00048@2x.png │ │ ├── dropdown_anim__00049@2x.png │ │ ├── dropdown_anim__0004@2x.png │ │ ├── dropdown_anim__00050@2x.png │ │ ├── dropdown_anim__00051@2x.png │ │ ├── dropdown_anim__00052@2x.png │ │ ├── dropdown_anim__00053@2x.png │ │ ├── dropdown_anim__00054@2x.png │ │ ├── dropdown_anim__00055@2x.png │ │ ├── dropdown_anim__00056@2x.png │ │ ├── dropdown_anim__00057@2x.png │ │ ├── dropdown_anim__00058@2x.png │ │ ├── dropdown_anim__00059@2x.png │ │ ├── dropdown_anim__0005@2x.png │ │ ├── dropdown_anim__00060@2x.png │ │ ├── dropdown_anim__0006@2x.png │ │ ├── dropdown_anim__0007@2x.png │ │ ├── dropdown_anim__0008@2x.png │ │ ├── dropdown_anim__0009@2x.png │ │ ├── dropdown_loading_01@2x.png │ │ ├── dropdown_loading_02@2x.png │ │ └── dropdown_loading_03@2x.png └── yarn.lock ├── github └── live.gif ├── ios ├── LyRefreshControl.h ├── LyRefreshControl.m ├── LyRefreshControl.xcodeproj │ └── project.pbxproj └── LyRefreshControlViewManager.m ├── package.json ├── react-native-ly-refresh-control.podspec ├── scripts └── bootstrap.js ├── src ├── __tests__ │ └── index.test.tsx └── index.tsx ├── 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 | Make sure your code passes TypeScript and ESLint. Run the following to verify: 36 | 37 | ```sh 38 | yarn typescript 39 | yarn lint 40 | ``` 41 | 42 | To fix formatting errors, run the following: 43 | 44 | ```sh 45 | yarn lint --fix 46 | ``` 47 | 48 | Remember to add tests for your change if possible. Run the unit tests by: 49 | 50 | ```sh 51 | yarn test 52 | ``` 53 | 54 | To edit the Objective-C files, open `example/ios/LyRefreshControlExample.xcworkspace` in XCode and find the source files at `Pods > Development Pods > react-native-ly-refresh-control`. 55 | 56 | To edit the Kotlin files, open `example/android` in Android studio and find the source files at `reactnativelyrefreshcontrol` under `Android`. 57 | 58 | ### Commit message convention 59 | 60 | We follow the [conventional commits specification](https://www.conventionalcommits.org/en) for our commit messages: 61 | 62 | - `fix`: bug fixes, e.g. fix crash due to deprecated method. 63 | - `feat`: new features, e.g. add new method to the module. 64 | - `refactor`: code refactor, e.g. migrate from class components to hooks. 65 | - `docs`: changes into documentation, e.g. add usage example for the module.. 66 | - `test`: adding or updating tests, e.g. add integration tests using detox. 67 | - `chore`: tooling changes, e.g. change CI config. 68 | 69 | Our pre-commit hooks verify that your commit message matches this format when committing. 70 | 71 | ### Linting and tests 72 | 73 | [ESLint](https://eslint.org/), [Prettier](https://prettier.io/), [TypeScript](https://www.typescriptlang.org/) 74 | 75 | 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. 76 | 77 | Our pre-commit hooks verify that the linter and tests pass when committing. 78 | 79 | ### Publishing to npm 80 | 81 | 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. 82 | 83 | To publish new versions, run the following: 84 | 85 | ```sh 86 | yarn release 87 | ``` 88 | 89 | ### Scripts 90 | 91 | The `package.json` file contains various scripts for common tasks: 92 | 93 | - `yarn bootstrap`: setup project by installing all dependencies and pods. 94 | - `yarn typescript`: type-check files with TypeScript. 95 | - `yarn lint`: lint files with ESLint. 96 | - `yarn test`: run unit tests with Jest. 97 | - `yarn example start`: start the Metro server for the example app. 98 | - `yarn example android`: run the example app on Android. 99 | - `yarn example ios`: run the example app on iOS. 100 | 101 | ### Sending a pull request 102 | 103 | > **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). 104 | 105 | When you're sending a pull request: 106 | 107 | - Prefer small pull requests focused on one change. 108 | - Verify that linters and tests are passing. 109 | - Review the documentation to make sure it looks good. 110 | - Follow the pull request template when opening a pull request. 111 | - For pull requests that change the API or implementation, discuss with maintainers first by opening an issue. 112 | 113 | ## Code of Conduct 114 | 115 | ### Our Pledge 116 | 117 | 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. 118 | 119 | We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community. 120 | 121 | ### Our Standards 122 | 123 | Examples of behavior that contributes to a positive environment for our community include: 124 | 125 | - Demonstrating empathy and kindness toward other people 126 | - Being respectful of differing opinions, viewpoints, and experiences 127 | - Giving and gracefully accepting constructive feedback 128 | - Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience 129 | - Focusing on what is best not just for us as individuals, but for the overall community 130 | 131 | Examples of unacceptable behavior include: 132 | 133 | - The use of sexualized language or imagery, and sexual attention or 134 | advances of any kind 135 | - Trolling, insulting or derogatory comments, and personal or political attacks 136 | - Public or private harassment 137 | - Publishing others' private information, such as a physical or email 138 | address, without their explicit permission 139 | - Other conduct which could reasonably be considered inappropriate in a 140 | professional setting 141 | 142 | ### Enforcement Responsibilities 143 | 144 | 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. 145 | 146 | 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. 147 | 148 | ### Scope 149 | 150 | 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. 151 | 152 | ### Enforcement 153 | 154 | 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. 155 | 156 | All community leaders are obligated to respect the privacy and security of the reporter of any incident. 157 | 158 | ### Enforcement Guidelines 159 | 160 | Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct: 161 | 162 | #### 1. Correction 163 | 164 | **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community. 165 | 166 | **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. 167 | 168 | #### 2. Warning 169 | 170 | **Community Impact**: A violation through a single incident or series of actions. 171 | 172 | **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. 173 | 174 | #### 3. Temporary Ban 175 | 176 | **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior. 177 | 178 | **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. 179 | 180 | #### 4. Permanent Ban 181 | 182 | **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. 183 | 184 | **Consequence**: A permanent ban from any sort of public interaction within the community. 185 | 186 | ### Attribution 187 | 188 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0, 189 | available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. 190 | 191 | Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity). 192 | 193 | [homepage]: https://www.contributor-covenant.org 194 | 195 | For answers to common questions about this code of conduct, see the FAQ at 196 | https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations. 197 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Syan 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-ly-refresh-control 2 | 3 | 下拉刷新 4 | 5 | iOS 基于MJRefresh 通过RCTCustomRefreshContolProtocol实现RefreshControl组件封装 6 | JS端可以无侵入自定义下拉刷新只需要替换对应的refreshControl 7 | 8 | Android 未完成 9 | 10 | ## Installation 11 | 12 | ```sh 13 | yarn react-native-ly-refresh-control 14 | ``` 15 | 16 | ## Usage 17 | 18 | ```js 19 | import LYRefreshControl from "react-native-ly-refresh-control"; 20 | 21 | 42 | } 43 | > 44 | ... 45 | 46 | 47 | 48 | ``` 49 | 50 | ## Live 51 | 52 | ![](./github/live.gif) 53 | 54 | ## TODO 55 | 56 | * [ ] iOS 更多属性控制 57 | * [ ] android 基于 SmartRefreshLayout 实现 58 | 59 | ## License 60 | 61 | MIT 62 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | if (project == rootProject) { 3 | repositories { 4 | google() 5 | jcenter() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:3.5.3' 10 | } 11 | } 12 | } 13 | 14 | apply plugin: 'com.android.library' 15 | 16 | def safeExtGet(prop, fallback) { 17 | rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback 18 | } 19 | 20 | android { 21 | compileSdkVersion safeExtGet('LyRefreshControl_compileSdkVersion', 29) 22 | buildToolsVersion safeExtGet('LyRefreshControl_buildToolsVersion', '29.0.2') 23 | defaultConfig { 24 | minSdkVersion safeExtGet('LyRefreshControl_minSdkVersion', 16) 25 | targetSdkVersion safeExtGet('LyRefreshControl_targetSdkVersion', 29) 26 | versionCode 1 27 | versionName "1.0" 28 | 29 | } 30 | 31 | buildTypes { 32 | release { 33 | minifyEnabled false 34 | } 35 | } 36 | lintOptions { 37 | disable 'GradleCompatible' 38 | } 39 | compileOptions { 40 | sourceCompatibility JavaVersion.VERSION_1_8 41 | targetCompatibility JavaVersion.VERSION_1_8 42 | } 43 | } 44 | 45 | repositories { 46 | mavenLocal() 47 | maven { 48 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm 49 | url("$rootDir/../node_modules/react-native/android") 50 | } 51 | google() 52 | jcenter() 53 | } 54 | 55 | dependencies { 56 | //noinspection GradleDynamicVersion 57 | implementation "com.facebook.react:react-native:+" // From node_modules 58 | } 59 | -------------------------------------------------------------------------------- /android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /android/src/main/java/com/reactnativelyrefreshcontrol/LyRefreshControlPackage.java: -------------------------------------------------------------------------------- 1 | package com.reactnativelyrefreshcontrol; 2 | 3 | import com.facebook.react.ReactPackage; 4 | import com.facebook.react.bridge.NativeModule; 5 | import com.facebook.react.bridge.ReactApplicationContext; 6 | import com.facebook.react.uimanager.ViewManager; 7 | 8 | import java.util.Arrays; 9 | import java.util.Collections; 10 | import java.util.List; 11 | 12 | public class LyRefreshControlPackage implements ReactPackage { 13 | @Override 14 | public List createNativeModules(ReactApplicationContext reactContext) { 15 | return Collections.emptyList(); 16 | } 17 | 18 | @Override 19 | public List createViewManagers(ReactApplicationContext reactContext) { 20 | return Arrays.asList(new LyRefreshControlViewManager()); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /android/src/main/java/com/reactnativelyrefreshcontrol/LyRefreshControlViewManager.java: -------------------------------------------------------------------------------- 1 | package com.reactnativelyrefreshcontrol; 2 | 3 | import android.graphics.Color; 4 | import android.view.View; 5 | 6 | import androidx.annotation.NonNull; 7 | 8 | import com.facebook.react.uimanager.SimpleViewManager; 9 | import com.facebook.react.uimanager.ThemedReactContext; 10 | import com.facebook.react.uimanager.annotations.ReactProp; 11 | 12 | public class LyRefreshControlViewManager extends SimpleViewManager { 13 | public static final String REACT_CLASS = "LyRefreshControlView"; 14 | 15 | @Override 16 | @NonNull 17 | public String getName() { 18 | return REACT_CLASS; 19 | } 20 | 21 | @Override 22 | @NonNull 23 | public View createViewInstance(ThemedReactContext reactContext) { 24 | return new View(reactContext); 25 | } 26 | 27 | @ReactProp(name = "color") 28 | public void setColor(View view, String color) { 29 | view.setBackgroundColor(Color.parseColor(color)); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /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 LyRefreshControlExample: 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 LyRefreshControlExample, 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: false, // 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 LyRefreshControlExample, 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 | compileSdkVersion rootProject.ext.compileSdkVersion 124 | 125 | compileOptions { 126 | sourceCompatibility JavaVersion.VERSION_1_8 127 | targetCompatibility JavaVersion.VERSION_1_8 128 | } 129 | 130 | defaultConfig { 131 | applicationId "com.example.reactnativelyrefreshcontrol" 132 | minSdkVersion rootProject.ext.minSdkVersion 133 | targetSdkVersion rootProject.ext.targetSdkVersion 134 | versionCode 1 135 | versionName "1.0" 136 | } 137 | splits { 138 | abi { 139 | reset() 140 | enable enableSeparateBuildPerCPUArchitecture 141 | universalApk false // If true, also generate a universal APK 142 | include "armeabi-v7a", "x86", "arm64-v8a", "x86_64" 143 | } 144 | } 145 | signingConfigs { 146 | debug { 147 | storeFile file('debug.keystore') 148 | storePassword 'android' 149 | keyAlias 'androiddebugkey' 150 | keyPassword 'android' 151 | } 152 | } 153 | buildTypes { 154 | debug { 155 | signingConfig signingConfigs.debug 156 | } 157 | release { 158 | // Caution! In production, you need to generate your own keystore file. 159 | // see https://reactnative.dev/docs/signed-apk-android. 160 | signingConfig signingConfigs.debug 161 | minifyEnabled enableProguardInReleaseBuilds 162 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" 163 | } 164 | } 165 | // applicationVariants are e.g. debug, release 166 | applicationVariants.all { variant -> 167 | variant.outputs.each { output -> 168 | // For each separate APK per architecture, set a unique version code as described here: 169 | // https://developer.android.com/studio/build/configure-apk-splits.html 170 | def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4] 171 | def abi = output.getFilter(OutputFile.ABI) 172 | if (abi != null) { // null for the universal-debug, universal-release variants 173 | output.versionCodeOverride = 174 | versionCodes.get(abi) * 1048576 + defaultConfig.versionCode 175 | } 176 | 177 | } 178 | } 179 | } 180 | 181 | dependencies { 182 | implementation fileTree(dir: "libs", include: ["*.jar"]) 183 | //noinspection GradleDynamicVersion 184 | implementation "com.facebook.react:react-native:+" // From node_modules 185 | 186 | 187 | implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0" 188 | debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") { 189 | exclude group:'com.facebook.fbjni' 190 | } 191 | debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") { 192 | exclude group:'com.facebook.flipper' 193 | exclude group:'com.squareup.okhttp3', module:'okhttp' 194 | } 195 | debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") { 196 | exclude group:'com.facebook.flipper' 197 | } 198 | 199 | if (enableHermes) { 200 | def hermesPath = "../../node_modules/hermes-engine/android/"; 201 | debugImplementation files(hermesPath + "hermes-debug.aar") 202 | releaseImplementation files(hermesPath + "hermes-release.aar") 203 | } else { 204 | implementation jscFlavor 205 | } 206 | 207 | implementation project(':reactnativelyrefreshcontrol') 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/syanbo/react-native-ly-refresh-control/20c05d6096562c7f9c784171da0be33a43b980aa/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/reactnativelyrefreshcontrol/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.reactnativelyrefreshcontrol; 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/reactnativelyrefreshcontrol/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.example.reactnativelyrefreshcontrol; 2 | 3 | import com.facebook.react.ReactActivity; 4 | 5 | public class MainActivity extends ReactActivity { 6 | 7 | /** 8 | * Returns the name of the main component registered from JavaScript. This is used to schedule 9 | * rendering of the component. 10 | */ 11 | @Override 12 | protected String getMainComponentName() { 13 | return "LyRefreshControlExample"; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/com/example/reactnativelyrefreshcontrol/MainApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.reactnativelyrefreshcontrol; 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 | import com.reactnativelyrefreshcontrol.LyRefreshControlPackage; 14 | 15 | public class MainApplication extends Application implements ReactApplication { 16 | 17 | private final ReactNativeHost mReactNativeHost = 18 | new ReactNativeHost(this) { 19 | @Override 20 | public boolean getUseDeveloperSupport() { 21 | return BuildConfig.DEBUG; 22 | } 23 | 24 | @Override 25 | protected List getPackages() { 26 | @SuppressWarnings("UnnecessaryLocalVariable") 27 | List packages = new PackageList(this).getPackages(); 28 | // Packages that cannot be autolinked yet can be added manually here, for LyRefreshControlExample: 29 | // packages.add(new MyReactNativePackage()); 30 | packages.add(new LyRefreshControlPackage()); 31 | return packages; 32 | } 33 | 34 | @Override 35 | protected String getJSMainModuleName() { 36 | return "index"; 37 | } 38 | }; 39 | 40 | @Override 41 | public ReactNativeHost getReactNativeHost() { 42 | return mReactNativeHost; 43 | } 44 | 45 | @Override 46 | public void onCreate() { 47 | super.onCreate(); 48 | SoLoader.init(this, /* native exopackage */ false); 49 | initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); // Remove this line if you don't want Flipper enabled 50 | } 51 | 52 | /** 53 | * Loads Flipper in React Native templates. 54 | * 55 | * @param context 56 | */ 57 | private static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) { 58 | if (BuildConfig.DEBUG) { 59 | try { 60 | /* 61 | We use reflection here to pick up the class that initializes Flipper, 62 | since Flipper library is not available in release mode 63 | */ 64 | Class aClass = Class.forName("com.reactnativelyrefreshcontrolExample.ReactNativeFlipper"); 65 | aClass 66 | .getMethod("initializeFlipper", Context.class, ReactInstanceManager.class) 67 | .invoke(null, context, reactInstanceManager); 68 | } catch (ClassNotFoundException e) { 69 | e.printStackTrace(); 70 | } catch (NoSuchMethodException e) { 71 | e.printStackTrace(); 72 | } catch (IllegalAccessException e) { 73 | e.printStackTrace(); 74 | } catch (InvocationTargetException e) { 75 | e.printStackTrace(); 76 | } 77 | } 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syanbo/react-native-ly-refresh-control/20c05d6096562c7f9c784171da0be33a43b980aa/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/syanbo/react-native-ly-refresh-control/20c05d6096562c7f9c784171da0be33a43b980aa/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/syanbo/react-native-ly-refresh-control/20c05d6096562c7f9c784171da0be33a43b980aa/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/syanbo/react-native-ly-refresh-control/20c05d6096562c7f9c784171da0be33a43b980aa/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/syanbo/react-native-ly-refresh-control/20c05d6096562c7f9c784171da0be33a43b980aa/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/syanbo/react-native-ly-refresh-control/20c05d6096562c7f9c784171da0be33a43b980aa/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/syanbo/react-native-ly-refresh-control/20c05d6096562c7f9c784171da0be33a43b980aa/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/syanbo/react-native-ly-refresh-control/20c05d6096562c7f9c784171da0be33a43b980aa/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/syanbo/react-native-ly-refresh-control/20c05d6096562c7f9c784171da0be33a43b980aa/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/syanbo/react-native-ly-refresh-control/20c05d6096562c7f9c784171da0be33a43b980aa/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | LyRefreshControl 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 = "29.0.2" 6 | minSdkVersion = 16 7 | compileSdkVersion = 29 8 | targetSdkVersion = 29 9 | } 10 | repositories { 11 | google() 12 | jcenter() 13 | } 14 | dependencies { 15 | classpath("com.android.tools.build:gradle:3.5.3") 16 | 17 | // NOTE: Do not place your application dependencies here; they belong 18 | // in the individual module build.gradle files 19 | } 20 | } 21 | 22 | allprojects { 23 | repositories { 24 | mavenLocal() 25 | maven { 26 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm 27 | url("$rootDir/../node_modules/react-native/android") 28 | } 29 | maven { 30 | // Android JSC is installed from npm 31 | url("$rootDir/../node_modules/jsc-android/dist") 32 | } 33 | 34 | google() 35 | jcenter() 36 | maven { url 'https://www.jitpack.io' } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /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.54.0 23 | -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syanbo/react-native-ly-refresh-control/20c05d6096562c7f9c784171da0be33a43b980aa/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.2-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 = 'LyRefreshControlExample' 2 | apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings) 3 | include ':app' 4 | 5 | include ':reactnativelyrefreshcontrol' 6 | project(':reactnativelyrefreshcontrol').projectDir = new File(rootProject.projectDir, '../../android') 7 | -------------------------------------------------------------------------------- /example/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "LyRefreshControlExample", 3 | "displayName": "LyRefreshControl 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 | ], 17 | }; 18 | -------------------------------------------------------------------------------- /example/index.tsx: -------------------------------------------------------------------------------- 1 | import { AppRegistry } from 'react-native'; 2 | import App from './src/App'; 3 | import { name as appName } from './app.json'; 4 | 5 | AppRegistry.registerComponent(appName, () => App); 6 | -------------------------------------------------------------------------------- /example/ios/File.swift: -------------------------------------------------------------------------------- 1 | // 2 | // File.swift 3 | // LyRefreshControlExample 4 | // 5 | 6 | import Foundation 7 | -------------------------------------------------------------------------------- /example/ios/LyRefreshControlExample-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/LyRefreshControlExample.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 00E356F31AD99517003FC87E /* LyRefreshControlExampleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* LyRefreshControlExampleTests.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 /* LyRefreshControlExampleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* LyRefreshControlExampleTests.m */; }; 18 | 4C39C56BAD484C67AA576FFA /* libPods-LyRefreshControlExample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = CA3E69C5B9553B26FBA2DF04 /* libPods-LyRefreshControlExample.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 = LyRefreshControlExample; 29 | }; 30 | 2D02E4911E0B4A5D006451C7 /* PBXContainerItemProxy */ = { 31 | isa = PBXContainerItemProxy; 32 | containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */; 33 | proxyType = 1; 34 | remoteGlobalIDString = 2D02E47A1E0B4A5D006451C7; 35 | remoteInfo = "LyRefreshControlExample-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 /* LyRefreshControlExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = LyRefreshControlExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 42 | 00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 43 | 00E356F21AD99517003FC87E /* LyRefreshControlExampleTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LyRefreshControlExampleTests.m; sourceTree = ""; }; 44 | 13B07F961A680F5B00A75B9A /* LyRefreshControlExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = LyRefreshControlExample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 45 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = LyRefreshControlExample/AppDelegate.h; sourceTree = ""; }; 46 | 13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = LyRefreshControlExample/AppDelegate.m; sourceTree = ""; }; 47 | 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = LyRefreshControlExample/Images.xcassets; sourceTree = ""; }; 48 | 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = LyRefreshControlExample/Info.plist; sourceTree = ""; }; 49 | 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = LyRefreshControlExample/main.m; sourceTree = ""; }; 50 | 2D02E47B1E0B4A5D006451C7 /* LyRefreshControlExample-tvOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "LyRefreshControlExample-tvOS.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 51 | 2D02E4901E0B4A5D006451C7 /* LyRefreshControlExample-tvOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "LyRefreshControlExample-tvOSTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 52 | 47F7ED3B7971BE374F7B8635 /* Pods-LyRefreshControlExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-LyRefreshControlExample.debug.xcconfig"; path = "Target Support Files/Pods-LyRefreshControlExample/Pods-LyRefreshControlExample.debug.xcconfig"; sourceTree = ""; }; 53 | 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = LyRefreshControlExample/LaunchScreen.storyboard; sourceTree = ""; }; 54 | CA3E69C5B9553B26FBA2DF04 /* libPods-LyRefreshControlExample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-LyRefreshControlExample.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 55 | E00ACF0FDA8BF921659E2F9A /* Pods-LyRefreshControlExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-LyRefreshControlExample.release.xcconfig"; path = "Target Support Files/Pods-LyRefreshControlExample/Pods-LyRefreshControlExample.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-LyRefreshControlExample.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 /* LyRefreshControlExampleTests */ = { 94 | isa = PBXGroup; 95 | children = ( 96 | 00E356F21AD99517003FC87E /* LyRefreshControlExampleTests.m */, 97 | 00E356F01AD99517003FC87E /* Supporting Files */, 98 | ); 99 | path = LyRefreshControlExampleTests; 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 /* LyRefreshControlExample */ = { 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 = LyRefreshControlExample; 122 | sourceTree = ""; 123 | }; 124 | 2D16E6871FA4F8E400B85C8A /* Frameworks */ = { 125 | isa = PBXGroup; 126 | children = ( 127 | ED297162215061F000B7C4FE /* JavaScriptCore.framework */, 128 | ED2971642150620600B7C4FE /* JavaScriptCore.framework */, 129 | CA3E69C5B9553B26FBA2DF04 /* libPods-LyRefreshControlExample.a */, 130 | ); 131 | name = Frameworks; 132 | sourceTree = ""; 133 | }; 134 | 6B9684456A2045ADE5A6E47E /* Pods */ = { 135 | isa = PBXGroup; 136 | children = ( 137 | 47F7ED3B7971BE374F7B8635 /* Pods-LyRefreshControlExample.debug.xcconfig */, 138 | E00ACF0FDA8BF921659E2F9A /* Pods-LyRefreshControlExample.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 /* LyRefreshControlExample */, 155 | 832341AE1AAA6A7D00B99B32 /* Libraries */, 156 | 00E356EF1AD99517003FC87E /* LyRefreshControlExampleTests */, 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 /* LyRefreshControlExample.app */, 170 | 00E356EE1AD99517003FC87E /* LyRefreshControlExampleTests.xctest */, 171 | 2D02E47B1E0B4A5D006451C7 /* LyRefreshControlExample-tvOS.app */, 172 | 2D02E4901E0B4A5D006451C7 /* LyRefreshControlExample-tvOSTests.xctest */, 173 | ); 174 | name = Products; 175 | sourceTree = ""; 176 | }; 177 | /* End PBXGroup section */ 178 | 179 | /* Begin PBXNativeTarget section */ 180 | 00E356ED1AD99517003FC87E /* LyRefreshControlExampleTests */ = { 181 | isa = PBXNativeTarget; 182 | buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "LyRefreshControlExampleTests" */; 183 | buildPhases = ( 184 | 00E356EA1AD99517003FC87E /* Sources */, 185 | 00E356EB1AD99517003FC87E /* Frameworks */, 186 | 00E356EC1AD99517003FC87E /* Resources */, 187 | ); 188 | buildRules = ( 189 | ); 190 | dependencies = ( 191 | 00E356F51AD99517003FC87E /* PBXTargetDependency */, 192 | ); 193 | name = LyRefreshControlExampleTests; 194 | productName = LyRefreshControlExampleTests; 195 | productReference = 00E356EE1AD99517003FC87E /* LyRefreshControlExampleTests.xctest */; 196 | productType = "com.apple.product-type.bundle.unit-test"; 197 | }; 198 | 13B07F861A680F5B00A75B9A /* LyRefreshControlExample */ = { 199 | isa = PBXNativeTarget; 200 | buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "LyRefreshControlExample" */; 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 | ); 210 | buildRules = ( 211 | ); 212 | dependencies = ( 213 | ); 214 | name = LyRefreshControlExample; 215 | productName = LyRefreshControlExample; 216 | productReference = 13B07F961A680F5B00A75B9A /* LyRefreshControlExample.app */; 217 | productType = "com.apple.product-type.application"; 218 | }; 219 | 2D02E47A1E0B4A5D006451C7 /* LyRefreshControlExample-tvOS */ = { 220 | isa = PBXNativeTarget; 221 | buildConfigurationList = 2D02E4BA1E0B4A5E006451C7 /* Build configuration list for PBXNativeTarget "LyRefreshControlExample-tvOS" */; 222 | buildPhases = ( 223 | FD10A7F122414F3F0027D42C /* Start Packager */, 224 | 2D02E4771E0B4A5D006451C7 /* Sources */, 225 | 2D02E4781E0B4A5D006451C7 /* Frameworks */, 226 | 2D02E4791E0B4A5D006451C7 /* Resources */, 227 | 2D02E4CB1E0B4B27006451C7 /* Bundle React Native Code And Images */, 228 | ); 229 | buildRules = ( 230 | ); 231 | dependencies = ( 232 | ); 233 | name = "LyRefreshControlExample-tvOS"; 234 | productName = "LyRefreshControlExample-tvOS"; 235 | productReference = 2D02E47B1E0B4A5D006451C7 /* LyRefreshControlExample-tvOS.app */; 236 | productType = "com.apple.product-type.application"; 237 | }; 238 | 2D02E48F1E0B4A5D006451C7 /* LyRefreshControlExample-tvOSTests */ = { 239 | isa = PBXNativeTarget; 240 | buildConfigurationList = 2D02E4BB1E0B4A5E006451C7 /* Build configuration list for PBXNativeTarget "LyRefreshControlExample-tvOSTests" */; 241 | buildPhases = ( 242 | 2D02E48C1E0B4A5D006451C7 /* Sources */, 243 | 2D02E48D1E0B4A5D006451C7 /* Frameworks */, 244 | 2D02E48E1E0B4A5D006451C7 /* Resources */, 245 | ); 246 | buildRules = ( 247 | ); 248 | dependencies = ( 249 | 2D02E4921E0B4A5D006451C7 /* PBXTargetDependency */, 250 | ); 251 | name = "LyRefreshControlExample-tvOSTests"; 252 | productName = "LyRefreshControlExample-tvOSTests"; 253 | productReference = 2D02E4901E0B4A5D006451C7 /* LyRefreshControlExample-tvOSTests.xctest */; 254 | productType = "com.apple.product-type.bundle.unit-test"; 255 | }; 256 | /* End PBXNativeTarget section */ 257 | 258 | /* Begin PBXProject section */ 259 | 83CBB9F71A601CBA00E9B192 /* Project object */ = { 260 | isa = PBXProject; 261 | attributes = { 262 | LastUpgradeCheck = 1130; 263 | TargetAttributes = { 264 | 00E356ED1AD99517003FC87E = { 265 | CreatedOnToolsVersion = 6.2; 266 | TestTargetID = 13B07F861A680F5B00A75B9A; 267 | }; 268 | 13B07F861A680F5B00A75B9A = { 269 | LastSwiftMigration = 1120; 270 | }; 271 | 2D02E47A1E0B4A5D006451C7 = { 272 | CreatedOnToolsVersion = 8.2.1; 273 | ProvisioningStyle = Automatic; 274 | }; 275 | 2D02E48F1E0B4A5D006451C7 = { 276 | CreatedOnToolsVersion = 8.2.1; 277 | ProvisioningStyle = Automatic; 278 | TestTargetID = 2D02E47A1E0B4A5D006451C7; 279 | }; 280 | }; 281 | }; 282 | buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "LyRefreshControlExample" */; 283 | compatibilityVersion = "Xcode 3.2"; 284 | developmentRegion = en; 285 | hasScannedForEncodings = 0; 286 | knownRegions = ( 287 | en, 288 | Base, 289 | ); 290 | mainGroup = 83CBB9F61A601CBA00E9B192; 291 | productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */; 292 | projectDirPath = ""; 293 | projectRoot = ""; 294 | targets = ( 295 | 13B07F861A680F5B00A75B9A /* LyRefreshControlExample */, 296 | 00E356ED1AD99517003FC87E /* LyRefreshControlExampleTests */, 297 | 2D02E47A1E0B4A5D006451C7 /* LyRefreshControlExample-tvOS */, 298 | 2D02E48F1E0B4A5D006451C7 /* LyRefreshControlExample-tvOSTests */, 299 | ); 300 | }; 301 | /* End PBXProject section */ 302 | 303 | /* Begin PBXResourcesBuildPhase section */ 304 | 00E356EC1AD99517003FC87E /* Resources */ = { 305 | isa = PBXResourcesBuildPhase; 306 | buildActionMask = 2147483647; 307 | files = ( 308 | ); 309 | runOnlyForDeploymentPostprocessing = 0; 310 | }; 311 | 13B07F8E1A680F5B00A75B9A /* Resources */ = { 312 | isa = PBXResourcesBuildPhase; 313 | buildActionMask = 2147483647; 314 | files = ( 315 | 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */, 316 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */, 317 | ); 318 | runOnlyForDeploymentPostprocessing = 0; 319 | }; 320 | 2D02E4791E0B4A5D006451C7 /* Resources */ = { 321 | isa = PBXResourcesBuildPhase; 322 | buildActionMask = 2147483647; 323 | files = ( 324 | 2D02E4BD1E0B4A84006451C7 /* Images.xcassets in Resources */, 325 | ); 326 | runOnlyForDeploymentPostprocessing = 0; 327 | }; 328 | 2D02E48E1E0B4A5D006451C7 /* Resources */ = { 329 | isa = PBXResourcesBuildPhase; 330 | buildActionMask = 2147483647; 331 | files = ( 332 | ); 333 | runOnlyForDeploymentPostprocessing = 0; 334 | }; 335 | /* End PBXResourcesBuildPhase section */ 336 | 337 | /* Begin PBXShellScriptBuildPhase section */ 338 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = { 339 | isa = PBXShellScriptBuildPhase; 340 | buildActionMask = 2147483647; 341 | files = ( 342 | ); 343 | inputPaths = ( 344 | ); 345 | name = "Bundle React Native code and images"; 346 | outputPaths = ( 347 | ); 348 | runOnlyForDeploymentPostprocessing = 0; 349 | shellPath = /bin/sh; 350 | shellScript = "export NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh"; 351 | }; 352 | 2D02E4CB1E0B4B27006451C7 /* Bundle React Native Code And Images */ = { 353 | isa = PBXShellScriptBuildPhase; 354 | buildActionMask = 2147483647; 355 | files = ( 356 | ); 357 | inputPaths = ( 358 | ); 359 | name = "Bundle React Native Code And Images"; 360 | outputPaths = ( 361 | ); 362 | runOnlyForDeploymentPostprocessing = 0; 363 | shellPath = /bin/sh; 364 | shellScript = "export NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh"; 365 | }; 366 | 4F0A6FC082772762E3E4C96C /* [CP] Check Pods Manifest.lock */ = { 367 | isa = PBXShellScriptBuildPhase; 368 | buildActionMask = 2147483647; 369 | files = ( 370 | ); 371 | inputFileListPaths = ( 372 | ); 373 | inputPaths = ( 374 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 375 | "${PODS_ROOT}/Manifest.lock", 376 | ); 377 | name = "[CP] Check Pods Manifest.lock"; 378 | outputFileListPaths = ( 379 | ); 380 | outputPaths = ( 381 | "$(DERIVED_FILE_DIR)/Pods-LyRefreshControlExample-checkManifestLockResult.txt", 382 | ); 383 | runOnlyForDeploymentPostprocessing = 0; 384 | shellPath = /bin/sh; 385 | 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"; 386 | showEnvVarsInLog = 0; 387 | }; 388 | C1D60D28B925C94BD88E79D7 /* [CP] Copy Pods Resources */ = { 389 | isa = PBXShellScriptBuildPhase; 390 | buildActionMask = 2147483647; 391 | files = ( 392 | ); 393 | inputPaths = ( 394 | "${PODS_ROOT}/Target Support Files/Pods-LyRefreshControlExample/Pods-LyRefreshControlExample-resources.sh", 395 | "${PODS_ROOT}/MJRefresh/MJRefresh/MJRefresh.bundle", 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}/MJRefresh.bundle", 401 | "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/AccessibilityResources.bundle", 402 | ); 403 | runOnlyForDeploymentPostprocessing = 0; 404 | shellPath = /bin/sh; 405 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-LyRefreshControlExample/Pods-LyRefreshControlExample-resources.sh\"\n"; 406 | showEnvVarsInLog = 0; 407 | }; 408 | FD10A7F022414F080027D42C /* Start Packager */ = { 409 | isa = PBXShellScriptBuildPhase; 410 | buildActionMask = 2147483647; 411 | files = ( 412 | ); 413 | inputFileListPaths = ( 414 | ); 415 | inputPaths = ( 416 | ); 417 | name = "Start Packager"; 418 | outputFileListPaths = ( 419 | ); 420 | outputPaths = ( 421 | ); 422 | runOnlyForDeploymentPostprocessing = 0; 423 | shellPath = /bin/sh; 424 | 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"; 425 | showEnvVarsInLog = 0; 426 | }; 427 | FD10A7F122414F3F0027D42C /* Start Packager */ = { 428 | isa = PBXShellScriptBuildPhase; 429 | buildActionMask = 2147483647; 430 | files = ( 431 | ); 432 | inputFileListPaths = ( 433 | ); 434 | inputPaths = ( 435 | ); 436 | name = "Start Packager"; 437 | outputFileListPaths = ( 438 | ); 439 | outputPaths = ( 440 | ); 441 | runOnlyForDeploymentPostprocessing = 0; 442 | shellPath = /bin/sh; 443 | 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"; 444 | showEnvVarsInLog = 0; 445 | }; 446 | /* End PBXShellScriptBuildPhase section */ 447 | 448 | /* Begin PBXSourcesBuildPhase section */ 449 | 00E356EA1AD99517003FC87E /* Sources */ = { 450 | isa = PBXSourcesBuildPhase; 451 | buildActionMask = 2147483647; 452 | files = ( 453 | 00E356F31AD99517003FC87E /* LyRefreshControlExampleTests.m in Sources */, 454 | ); 455 | runOnlyForDeploymentPostprocessing = 0; 456 | }; 457 | 13B07F871A680F5B00A75B9A /* Sources */ = { 458 | isa = PBXSourcesBuildPhase; 459 | buildActionMask = 2147483647; 460 | files = ( 461 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */, 462 | 13B07FC11A68108700A75B9A /* main.m in Sources */, 463 | ); 464 | runOnlyForDeploymentPostprocessing = 0; 465 | }; 466 | 2D02E4771E0B4A5D006451C7 /* Sources */ = { 467 | isa = PBXSourcesBuildPhase; 468 | buildActionMask = 2147483647; 469 | files = ( 470 | 2D02E4BF1E0B4AB3006451C7 /* main.m in Sources */, 471 | 2D02E4BC1E0B4A80006451C7 /* AppDelegate.m in Sources */, 472 | ); 473 | runOnlyForDeploymentPostprocessing = 0; 474 | }; 475 | 2D02E48C1E0B4A5D006451C7 /* Sources */ = { 476 | isa = PBXSourcesBuildPhase; 477 | buildActionMask = 2147483647; 478 | files = ( 479 | 2DCD954D1E0B4F2C00145EB5 /* LyRefreshControlExampleTests.m in Sources */, 480 | ); 481 | runOnlyForDeploymentPostprocessing = 0; 482 | }; 483 | /* End PBXSourcesBuildPhase section */ 484 | 485 | /* Begin PBXTargetDependency section */ 486 | 00E356F51AD99517003FC87E /* PBXTargetDependency */ = { 487 | isa = PBXTargetDependency; 488 | target = 13B07F861A680F5B00A75B9A /* LyRefreshControlExample */; 489 | targetProxy = 00E356F41AD99517003FC87E /* PBXContainerItemProxy */; 490 | }; 491 | 2D02E4921E0B4A5D006451C7 /* PBXTargetDependency */ = { 492 | isa = PBXTargetDependency; 493 | target = 2D02E47A1E0B4A5D006451C7 /* LyRefreshControlExample-tvOS */; 494 | targetProxy = 2D02E4911E0B4A5D006451C7 /* PBXContainerItemProxy */; 495 | }; 496 | /* End PBXTargetDependency section */ 497 | 498 | /* Begin XCBuildConfiguration section */ 499 | 00E356F61AD99517003FC87E /* Debug */ = { 500 | isa = XCBuildConfiguration; 501 | buildSettings = { 502 | BUNDLE_LOADER = "$(TEST_HOST)"; 503 | GCC_PREPROCESSOR_DEFINITIONS = ( 504 | "DEBUG=1", 505 | "$(inherited)", 506 | ); 507 | INFOPLIST_FILE = LyRefreshControlExampleTests/Info.plist; 508 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 509 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 510 | OTHER_LDFLAGS = ( 511 | "-ObjC", 512 | "-lc++", 513 | "$(inherited)", 514 | ); 515 | PRODUCT_BUNDLE_IDENTIFIER = com.example.reactnativelyrefreshcontrol; 516 | PRODUCT_NAME = "$(TARGET_NAME)"; 517 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/LyRefreshControlExample.app/LyRefreshControlExample"; 518 | }; 519 | name = Debug; 520 | }; 521 | 00E356F71AD99517003FC87E /* Release */ = { 522 | isa = XCBuildConfiguration; 523 | buildSettings = { 524 | BUNDLE_LOADER = "$(TEST_HOST)"; 525 | COPY_PHASE_STRIP = NO; 526 | INFOPLIST_FILE = LyRefreshControlExampleTests/Info.plist; 527 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 528 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 529 | OTHER_LDFLAGS = ( 530 | "-ObjC", 531 | "-lc++", 532 | "$(inherited)", 533 | ); 534 | PRODUCT_BUNDLE_IDENTIFIER = com.example.reactnativelyrefreshcontrol; 535 | PRODUCT_NAME = "$(TARGET_NAME)"; 536 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/LyRefreshControlExample.app/LyRefreshControlExample"; 537 | }; 538 | name = Release; 539 | }; 540 | 13B07F941A680F5B00A75B9A /* Debug */ = { 541 | isa = XCBuildConfiguration; 542 | baseConfigurationReference = 47F7ED3B7971BE374F7B8635 /* Pods-LyRefreshControlExample.debug.xcconfig */; 543 | buildSettings = { 544 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 545 | CLANG_ENABLE_MODULES = YES; 546 | CURRENT_PROJECT_VERSION = 1; 547 | ENABLE_BITCODE = NO; 548 | INFOPLIST_FILE = LyRefreshControlExample/Info.plist; 549 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 550 | OTHER_LDFLAGS = ( 551 | "$(inherited)", 552 | "-ObjC", 553 | "-lc++", 554 | ); 555 | PRODUCT_BUNDLE_IDENTIFIER = com.example.reactnativelyrefreshcontrol; 556 | PRODUCT_NAME = LyRefreshControlExample; 557 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 558 | SWIFT_VERSION = 5.0; 559 | VERSIONING_SYSTEM = "apple-generic"; 560 | }; 561 | name = Debug; 562 | }; 563 | 13B07F951A680F5B00A75B9A /* Release */ = { 564 | isa = XCBuildConfiguration; 565 | baseConfigurationReference = E00ACF0FDA8BF921659E2F9A /* Pods-LyRefreshControlExample.release.xcconfig */; 566 | buildSettings = { 567 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 568 | CLANG_ENABLE_MODULES = YES; 569 | CURRENT_PROJECT_VERSION = 1; 570 | INFOPLIST_FILE = LyRefreshControlExample/Info.plist; 571 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 572 | OTHER_LDFLAGS = ( 573 | "$(inherited)", 574 | "-ObjC", 575 | "-lc++", 576 | ); 577 | PRODUCT_BUNDLE_IDENTIFIER = com.example.reactnativelyrefreshcontrol; 578 | PRODUCT_NAME = LyRefreshControlExample; 579 | SWIFT_VERSION = 5.0; 580 | VERSIONING_SYSTEM = "apple-generic"; 581 | }; 582 | name = Release; 583 | }; 584 | 2D02E4971E0B4A5E006451C7 /* Debug */ = { 585 | isa = XCBuildConfiguration; 586 | buildSettings = { 587 | ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image"; 588 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 589 | CLANG_ANALYZER_NONNULL = YES; 590 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 591 | CLANG_WARN_INFINITE_RECURSION = YES; 592 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 593 | DEBUG_INFORMATION_FORMAT = dwarf; 594 | ENABLE_TESTABILITY = YES; 595 | GCC_NO_COMMON_BLOCKS = YES; 596 | INFOPLIST_FILE = "LyRefreshControlExample-tvOS/Info.plist"; 597 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 598 | OTHER_LDFLAGS = ( 599 | "$(inherited)", 600 | "-ObjC", 601 | "-lc++", 602 | ); 603 | PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.LyRefreshControlExample-tvOS"; 604 | PRODUCT_NAME = "$(TARGET_NAME)"; 605 | SDKROOT = appletvos; 606 | TARGETED_DEVICE_FAMILY = 3; 607 | TVOS_DEPLOYMENT_TARGET = 10.0; 608 | }; 609 | name = Debug; 610 | }; 611 | 2D02E4981E0B4A5E006451C7 /* Release */ = { 612 | isa = XCBuildConfiguration; 613 | buildSettings = { 614 | ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image"; 615 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 616 | CLANG_ANALYZER_NONNULL = YES; 617 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 618 | CLANG_WARN_INFINITE_RECURSION = YES; 619 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 620 | COPY_PHASE_STRIP = NO; 621 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 622 | GCC_NO_COMMON_BLOCKS = YES; 623 | INFOPLIST_FILE = "LyRefreshControlExample-tvOS/Info.plist"; 624 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 625 | OTHER_LDFLAGS = ( 626 | "$(inherited)", 627 | "-ObjC", 628 | "-lc++", 629 | ); 630 | PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.LyRefreshControlExample-tvOS"; 631 | PRODUCT_NAME = "$(TARGET_NAME)"; 632 | SDKROOT = appletvos; 633 | TARGETED_DEVICE_FAMILY = 3; 634 | TVOS_DEPLOYMENT_TARGET = 10.0; 635 | }; 636 | name = Release; 637 | }; 638 | 2D02E4991E0B4A5E006451C7 /* Debug */ = { 639 | isa = XCBuildConfiguration; 640 | buildSettings = { 641 | BUNDLE_LOADER = "$(TEST_HOST)"; 642 | CLANG_ANALYZER_NONNULL = YES; 643 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 644 | CLANG_WARN_INFINITE_RECURSION = YES; 645 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 646 | DEBUG_INFORMATION_FORMAT = dwarf; 647 | ENABLE_TESTABILITY = YES; 648 | GCC_NO_COMMON_BLOCKS = YES; 649 | INFOPLIST_FILE = "LyRefreshControlExample-tvOSTests/Info.plist"; 650 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 651 | OTHER_LDFLAGS = ( 652 | "$(inherited)", 653 | "-ObjC", 654 | "-lc++", 655 | ); 656 | PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.LyRefreshControlExample-tvOSTests"; 657 | PRODUCT_NAME = "$(TARGET_NAME)"; 658 | SDKROOT = appletvos; 659 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/LyRefreshControlExample-tvOS.app/LyRefreshControlExample-tvOS"; 660 | TVOS_DEPLOYMENT_TARGET = 10.1; 661 | }; 662 | name = Debug; 663 | }; 664 | 2D02E49A1E0B4A5E006451C7 /* Release */ = { 665 | isa = XCBuildConfiguration; 666 | buildSettings = { 667 | BUNDLE_LOADER = "$(TEST_HOST)"; 668 | CLANG_ANALYZER_NONNULL = YES; 669 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 670 | CLANG_WARN_INFINITE_RECURSION = YES; 671 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 672 | COPY_PHASE_STRIP = NO; 673 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 674 | GCC_NO_COMMON_BLOCKS = YES; 675 | INFOPLIST_FILE = "LyRefreshControlExample-tvOSTests/Info.plist"; 676 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 677 | OTHER_LDFLAGS = ( 678 | "$(inherited)", 679 | "-ObjC", 680 | "-lc++", 681 | ); 682 | PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.LyRefreshControlExample-tvOSTests"; 683 | PRODUCT_NAME = "$(TARGET_NAME)"; 684 | SDKROOT = appletvos; 685 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/LyRefreshControlExample-tvOS.app/LyRefreshControlExample-tvOS"; 686 | TVOS_DEPLOYMENT_TARGET = 10.1; 687 | }; 688 | name = Release; 689 | }; 690 | 83CBBA201A601CBA00E9B192 /* Debug */ = { 691 | isa = XCBuildConfiguration; 692 | buildSettings = { 693 | ALWAYS_SEARCH_USER_PATHS = NO; 694 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 695 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 696 | CLANG_CXX_LIBRARY = "libc++"; 697 | CLANG_ENABLE_MODULES = YES; 698 | CLANG_ENABLE_OBJC_ARC = YES; 699 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 700 | CLANG_WARN_BOOL_CONVERSION = YES; 701 | CLANG_WARN_COMMA = YES; 702 | CLANG_WARN_CONSTANT_CONVERSION = YES; 703 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 704 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 705 | CLANG_WARN_EMPTY_BODY = YES; 706 | CLANG_WARN_ENUM_CONVERSION = YES; 707 | CLANG_WARN_INFINITE_RECURSION = YES; 708 | CLANG_WARN_INT_CONVERSION = YES; 709 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 710 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 711 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 712 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 713 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 714 | CLANG_WARN_STRICT_PROTOTYPES = YES; 715 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 716 | CLANG_WARN_UNREACHABLE_CODE = YES; 717 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 718 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 719 | COPY_PHASE_STRIP = NO; 720 | ENABLE_STRICT_OBJC_MSGSEND = YES; 721 | ENABLE_TESTABILITY = YES; 722 | GCC_C_LANGUAGE_STANDARD = gnu99; 723 | GCC_DYNAMIC_NO_PIC = NO; 724 | GCC_NO_COMMON_BLOCKS = YES; 725 | GCC_OPTIMIZATION_LEVEL = 0; 726 | GCC_PREPROCESSOR_DEFINITIONS = ( 727 | "DEBUG=1", 728 | "$(inherited)", 729 | ); 730 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 731 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 732 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 733 | GCC_WARN_UNDECLARED_SELECTOR = YES; 734 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 735 | GCC_WARN_UNUSED_FUNCTION = YES; 736 | GCC_WARN_UNUSED_VARIABLE = YES; 737 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 738 | LD_RUNPATH_SEARCH_PATHS = "/usr/lib/swift $(inherited)"; 739 | LIBRARY_SEARCH_PATHS = ( 740 | "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"", 741 | "\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)\"", 742 | "\"$(inherited)\"", 743 | ); 744 | MTL_ENABLE_DEBUG_INFO = YES; 745 | ONLY_ACTIVE_ARCH = YES; 746 | SDKROOT = iphoneos; 747 | }; 748 | name = Debug; 749 | }; 750 | 83CBBA211A601CBA00E9B192 /* Release */ = { 751 | isa = XCBuildConfiguration; 752 | buildSettings = { 753 | ALWAYS_SEARCH_USER_PATHS = NO; 754 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 755 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 756 | CLANG_CXX_LIBRARY = "libc++"; 757 | CLANG_ENABLE_MODULES = YES; 758 | CLANG_ENABLE_OBJC_ARC = YES; 759 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 760 | CLANG_WARN_BOOL_CONVERSION = YES; 761 | CLANG_WARN_COMMA = YES; 762 | CLANG_WARN_CONSTANT_CONVERSION = YES; 763 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 764 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 765 | CLANG_WARN_EMPTY_BODY = YES; 766 | CLANG_WARN_ENUM_CONVERSION = YES; 767 | CLANG_WARN_INFINITE_RECURSION = YES; 768 | CLANG_WARN_INT_CONVERSION = YES; 769 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 770 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 771 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 772 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 773 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 774 | CLANG_WARN_STRICT_PROTOTYPES = YES; 775 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 776 | CLANG_WARN_UNREACHABLE_CODE = YES; 777 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 778 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 779 | COPY_PHASE_STRIP = YES; 780 | ENABLE_NS_ASSERTIONS = NO; 781 | ENABLE_STRICT_OBJC_MSGSEND = YES; 782 | GCC_C_LANGUAGE_STANDARD = gnu99; 783 | GCC_NO_COMMON_BLOCKS = YES; 784 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 785 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 786 | GCC_WARN_UNDECLARED_SELECTOR = YES; 787 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 788 | GCC_WARN_UNUSED_FUNCTION = YES; 789 | GCC_WARN_UNUSED_VARIABLE = YES; 790 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 791 | LD_RUNPATH_SEARCH_PATHS = "/usr/lib/swift $(inherited)"; 792 | LIBRARY_SEARCH_PATHS = ( 793 | "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"", 794 | "\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)\"", 795 | "\"$(inherited)\"", 796 | ); 797 | MTL_ENABLE_DEBUG_INFO = NO; 798 | SDKROOT = iphoneos; 799 | VALIDATE_PRODUCT = YES; 800 | }; 801 | name = Release; 802 | }; 803 | /* End XCBuildConfiguration section */ 804 | 805 | /* Begin XCConfigurationList section */ 806 | 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "LyRefreshControlExampleTests" */ = { 807 | isa = XCConfigurationList; 808 | buildConfigurations = ( 809 | 00E356F61AD99517003FC87E /* Debug */, 810 | 00E356F71AD99517003FC87E /* Release */, 811 | ); 812 | defaultConfigurationIsVisible = 0; 813 | defaultConfigurationName = Release; 814 | }; 815 | 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "LyRefreshControlExample" */ = { 816 | isa = XCConfigurationList; 817 | buildConfigurations = ( 818 | 13B07F941A680F5B00A75B9A /* Debug */, 819 | 13B07F951A680F5B00A75B9A /* Release */, 820 | ); 821 | defaultConfigurationIsVisible = 0; 822 | defaultConfigurationName = Release; 823 | }; 824 | 2D02E4BA1E0B4A5E006451C7 /* Build configuration list for PBXNativeTarget "LyRefreshControlExample-tvOS" */ = { 825 | isa = XCConfigurationList; 826 | buildConfigurations = ( 827 | 2D02E4971E0B4A5E006451C7 /* Debug */, 828 | 2D02E4981E0B4A5E006451C7 /* Release */, 829 | ); 830 | defaultConfigurationIsVisible = 0; 831 | defaultConfigurationName = Release; 832 | }; 833 | 2D02E4BB1E0B4A5E006451C7 /* Build configuration list for PBXNativeTarget "LyRefreshControlExample-tvOSTests" */ = { 834 | isa = XCConfigurationList; 835 | buildConfigurations = ( 836 | 2D02E4991E0B4A5E006451C7 /* Debug */, 837 | 2D02E49A1E0B4A5E006451C7 /* Release */, 838 | ); 839 | defaultConfigurationIsVisible = 0; 840 | defaultConfigurationName = Release; 841 | }; 842 | 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "LyRefreshControlExample" */ = { 843 | isa = XCConfigurationList; 844 | buildConfigurations = ( 845 | 83CBBA201A601CBA00E9B192 /* Debug */, 846 | 83CBBA211A601CBA00E9B192 /* Release */, 847 | ); 848 | defaultConfigurationIsVisible = 0; 849 | defaultConfigurationName = Release; 850 | }; 851 | /* End XCConfigurationList section */ 852 | }; 853 | rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */; 854 | } 855 | -------------------------------------------------------------------------------- /example/ios/LyRefreshControlExample.xcodeproj/xcshareddata/xcschemes/LyRefreshControlExample.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/LyRefreshControlExample.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /example/ios/LyRefreshControlExample.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/LyRefreshControlExample/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/LyRefreshControlExample/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:@"LyRefreshControlExample" 42 | initialProperties:nil]; 43 | 44 | rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1]; 45 | 46 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 47 | UIViewController *rootViewController = [UIViewController new]; 48 | rootViewController.view = rootView; 49 | self.window.rootViewController = rootViewController; 50 | [self.window makeKeyAndVisible]; 51 | return YES; 52 | } 53 | 54 | - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge 55 | { 56 | #if DEBUG 57 | return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil]; 58 | #else 59 | return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; 60 | #endif 61 | } 62 | 63 | @end 64 | -------------------------------------------------------------------------------- /example/ios/LyRefreshControlExample/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/LyRefreshControlExample/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /example/ios/LyRefreshControlExample/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | LyRefreshControl 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/LyRefreshControlExample/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/LyRefreshControlExample/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/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, '10.0' 5 | 6 | target 'LyRefreshControlExample' do 7 | config = use_native_modules! 8 | 9 | use_react_native!(:path => config["reactNativePath"]) 10 | 11 | pod 'react-native-ly-refresh-control', :path => '../..' 12 | 13 | # Enables Flipper. 14 | # 15 | # Note that if you have use_frameworks! enabled, Flipper will not work and 16 | # you should disable these next few lines. 17 | # use_flipper!({ 'Flipper' => '0.80.0' }) 18 | # post_install do |installer| 19 | # flipper_post_install(installer) 20 | # end 21 | end 22 | -------------------------------------------------------------------------------- /example/ios/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - boost-for-react-native (1.63.0) 3 | - DoubleConversion (1.1.6) 4 | - FBLazyVector (0.63.4) 5 | - FBReactNativeSpec (0.63.4): 6 | - Folly (= 2020.01.13.00) 7 | - RCTRequired (= 0.63.4) 8 | - RCTTypeSafety (= 0.63.4) 9 | - React-Core (= 0.63.4) 10 | - React-jsi (= 0.63.4) 11 | - ReactCommon/turbomodule/core (= 0.63.4) 12 | - Folly (2020.01.13.00): 13 | - boost-for-react-native 14 | - DoubleConversion 15 | - Folly/Default (= 2020.01.13.00) 16 | - glog 17 | - Folly/Default (2020.01.13.00): 18 | - boost-for-react-native 19 | - DoubleConversion 20 | - glog 21 | - glog (0.3.5) 22 | - MJRefresh (3.7.2) 23 | - RCTRequired (0.63.4) 24 | - RCTTypeSafety (0.63.4): 25 | - FBLazyVector (= 0.63.4) 26 | - Folly (= 2020.01.13.00) 27 | - RCTRequired (= 0.63.4) 28 | - React-Core (= 0.63.4) 29 | - React (0.63.4): 30 | - React-Core (= 0.63.4) 31 | - React-Core/DevSupport (= 0.63.4) 32 | - React-Core/RCTWebSocket (= 0.63.4) 33 | - React-RCTActionSheet (= 0.63.4) 34 | - React-RCTAnimation (= 0.63.4) 35 | - React-RCTBlob (= 0.63.4) 36 | - React-RCTImage (= 0.63.4) 37 | - React-RCTLinking (= 0.63.4) 38 | - React-RCTNetwork (= 0.63.4) 39 | - React-RCTSettings (= 0.63.4) 40 | - React-RCTText (= 0.63.4) 41 | - React-RCTVibration (= 0.63.4) 42 | - React-callinvoker (0.63.4) 43 | - React-Core (0.63.4): 44 | - Folly (= 2020.01.13.00) 45 | - glog 46 | - React-Core/Default (= 0.63.4) 47 | - React-cxxreact (= 0.63.4) 48 | - React-jsi (= 0.63.4) 49 | - React-jsiexecutor (= 0.63.4) 50 | - Yoga 51 | - React-Core/CoreModulesHeaders (0.63.4): 52 | - Folly (= 2020.01.13.00) 53 | - glog 54 | - React-Core/Default 55 | - React-cxxreact (= 0.63.4) 56 | - React-jsi (= 0.63.4) 57 | - React-jsiexecutor (= 0.63.4) 58 | - Yoga 59 | - React-Core/Default (0.63.4): 60 | - Folly (= 2020.01.13.00) 61 | - glog 62 | - React-cxxreact (= 0.63.4) 63 | - React-jsi (= 0.63.4) 64 | - React-jsiexecutor (= 0.63.4) 65 | - Yoga 66 | - React-Core/DevSupport (0.63.4): 67 | - Folly (= 2020.01.13.00) 68 | - glog 69 | - React-Core/Default (= 0.63.4) 70 | - React-Core/RCTWebSocket (= 0.63.4) 71 | - React-cxxreact (= 0.63.4) 72 | - React-jsi (= 0.63.4) 73 | - React-jsiexecutor (= 0.63.4) 74 | - React-jsinspector (= 0.63.4) 75 | - Yoga 76 | - React-Core/RCTActionSheetHeaders (0.63.4): 77 | - Folly (= 2020.01.13.00) 78 | - glog 79 | - React-Core/Default 80 | - React-cxxreact (= 0.63.4) 81 | - React-jsi (= 0.63.4) 82 | - React-jsiexecutor (= 0.63.4) 83 | - Yoga 84 | - React-Core/RCTAnimationHeaders (0.63.4): 85 | - Folly (= 2020.01.13.00) 86 | - glog 87 | - React-Core/Default 88 | - React-cxxreact (= 0.63.4) 89 | - React-jsi (= 0.63.4) 90 | - React-jsiexecutor (= 0.63.4) 91 | - Yoga 92 | - React-Core/RCTBlobHeaders (0.63.4): 93 | - Folly (= 2020.01.13.00) 94 | - glog 95 | - React-Core/Default 96 | - React-cxxreact (= 0.63.4) 97 | - React-jsi (= 0.63.4) 98 | - React-jsiexecutor (= 0.63.4) 99 | - Yoga 100 | - React-Core/RCTImageHeaders (0.63.4): 101 | - Folly (= 2020.01.13.00) 102 | - glog 103 | - React-Core/Default 104 | - React-cxxreact (= 0.63.4) 105 | - React-jsi (= 0.63.4) 106 | - React-jsiexecutor (= 0.63.4) 107 | - Yoga 108 | - React-Core/RCTLinkingHeaders (0.63.4): 109 | - Folly (= 2020.01.13.00) 110 | - glog 111 | - React-Core/Default 112 | - React-cxxreact (= 0.63.4) 113 | - React-jsi (= 0.63.4) 114 | - React-jsiexecutor (= 0.63.4) 115 | - Yoga 116 | - React-Core/RCTNetworkHeaders (0.63.4): 117 | - Folly (= 2020.01.13.00) 118 | - glog 119 | - React-Core/Default 120 | - React-cxxreact (= 0.63.4) 121 | - React-jsi (= 0.63.4) 122 | - React-jsiexecutor (= 0.63.4) 123 | - Yoga 124 | - React-Core/RCTSettingsHeaders (0.63.4): 125 | - Folly (= 2020.01.13.00) 126 | - glog 127 | - React-Core/Default 128 | - React-cxxreact (= 0.63.4) 129 | - React-jsi (= 0.63.4) 130 | - React-jsiexecutor (= 0.63.4) 131 | - Yoga 132 | - React-Core/RCTTextHeaders (0.63.4): 133 | - Folly (= 2020.01.13.00) 134 | - glog 135 | - React-Core/Default 136 | - React-cxxreact (= 0.63.4) 137 | - React-jsi (= 0.63.4) 138 | - React-jsiexecutor (= 0.63.4) 139 | - Yoga 140 | - React-Core/RCTVibrationHeaders (0.63.4): 141 | - Folly (= 2020.01.13.00) 142 | - glog 143 | - React-Core/Default 144 | - React-cxxreact (= 0.63.4) 145 | - React-jsi (= 0.63.4) 146 | - React-jsiexecutor (= 0.63.4) 147 | - Yoga 148 | - React-Core/RCTWebSocket (0.63.4): 149 | - Folly (= 2020.01.13.00) 150 | - glog 151 | - React-Core/Default (= 0.63.4) 152 | - React-cxxreact (= 0.63.4) 153 | - React-jsi (= 0.63.4) 154 | - React-jsiexecutor (= 0.63.4) 155 | - Yoga 156 | - React-CoreModules (0.63.4): 157 | - FBReactNativeSpec (= 0.63.4) 158 | - Folly (= 2020.01.13.00) 159 | - RCTTypeSafety (= 0.63.4) 160 | - React-Core/CoreModulesHeaders (= 0.63.4) 161 | - React-jsi (= 0.63.4) 162 | - React-RCTImage (= 0.63.4) 163 | - ReactCommon/turbomodule/core (= 0.63.4) 164 | - React-cxxreact (0.63.4): 165 | - boost-for-react-native (= 1.63.0) 166 | - DoubleConversion 167 | - Folly (= 2020.01.13.00) 168 | - glog 169 | - React-callinvoker (= 0.63.4) 170 | - React-jsinspector (= 0.63.4) 171 | - React-jsi (0.63.4): 172 | - boost-for-react-native (= 1.63.0) 173 | - DoubleConversion 174 | - Folly (= 2020.01.13.00) 175 | - glog 176 | - React-jsi/Default (= 0.63.4) 177 | - React-jsi/Default (0.63.4): 178 | - boost-for-react-native (= 1.63.0) 179 | - DoubleConversion 180 | - Folly (= 2020.01.13.00) 181 | - glog 182 | - React-jsiexecutor (0.63.4): 183 | - DoubleConversion 184 | - Folly (= 2020.01.13.00) 185 | - glog 186 | - React-cxxreact (= 0.63.4) 187 | - React-jsi (= 0.63.4) 188 | - React-jsinspector (0.63.4) 189 | - react-native-ly-refresh-control (0.1.0): 190 | - MJRefresh 191 | - React-Core 192 | - React-RCTActionSheet (0.63.4): 193 | - React-Core/RCTActionSheetHeaders (= 0.63.4) 194 | - React-RCTAnimation (0.63.4): 195 | - FBReactNativeSpec (= 0.63.4) 196 | - Folly (= 2020.01.13.00) 197 | - RCTTypeSafety (= 0.63.4) 198 | - React-Core/RCTAnimationHeaders (= 0.63.4) 199 | - React-jsi (= 0.63.4) 200 | - ReactCommon/turbomodule/core (= 0.63.4) 201 | - React-RCTBlob (0.63.4): 202 | - FBReactNativeSpec (= 0.63.4) 203 | - Folly (= 2020.01.13.00) 204 | - React-Core/RCTBlobHeaders (= 0.63.4) 205 | - React-Core/RCTWebSocket (= 0.63.4) 206 | - React-jsi (= 0.63.4) 207 | - React-RCTNetwork (= 0.63.4) 208 | - ReactCommon/turbomodule/core (= 0.63.4) 209 | - React-RCTImage (0.63.4): 210 | - FBReactNativeSpec (= 0.63.4) 211 | - Folly (= 2020.01.13.00) 212 | - RCTTypeSafety (= 0.63.4) 213 | - React-Core/RCTImageHeaders (= 0.63.4) 214 | - React-jsi (= 0.63.4) 215 | - React-RCTNetwork (= 0.63.4) 216 | - ReactCommon/turbomodule/core (= 0.63.4) 217 | - React-RCTLinking (0.63.4): 218 | - FBReactNativeSpec (= 0.63.4) 219 | - React-Core/RCTLinkingHeaders (= 0.63.4) 220 | - React-jsi (= 0.63.4) 221 | - ReactCommon/turbomodule/core (= 0.63.4) 222 | - React-RCTNetwork (0.63.4): 223 | - FBReactNativeSpec (= 0.63.4) 224 | - Folly (= 2020.01.13.00) 225 | - RCTTypeSafety (= 0.63.4) 226 | - React-Core/RCTNetworkHeaders (= 0.63.4) 227 | - React-jsi (= 0.63.4) 228 | - ReactCommon/turbomodule/core (= 0.63.4) 229 | - React-RCTSettings (0.63.4): 230 | - FBReactNativeSpec (= 0.63.4) 231 | - Folly (= 2020.01.13.00) 232 | - RCTTypeSafety (= 0.63.4) 233 | - React-Core/RCTSettingsHeaders (= 0.63.4) 234 | - React-jsi (= 0.63.4) 235 | - ReactCommon/turbomodule/core (= 0.63.4) 236 | - React-RCTText (0.63.4): 237 | - React-Core/RCTTextHeaders (= 0.63.4) 238 | - React-RCTVibration (0.63.4): 239 | - FBReactNativeSpec (= 0.63.4) 240 | - Folly (= 2020.01.13.00) 241 | - React-Core/RCTVibrationHeaders (= 0.63.4) 242 | - React-jsi (= 0.63.4) 243 | - ReactCommon/turbomodule/core (= 0.63.4) 244 | - ReactCommon/turbomodule/core (0.63.4): 245 | - DoubleConversion 246 | - Folly (= 2020.01.13.00) 247 | - glog 248 | - React-callinvoker (= 0.63.4) 249 | - React-Core (= 0.63.4) 250 | - React-cxxreact (= 0.63.4) 251 | - React-jsi (= 0.63.4) 252 | - Yoga (1.14.0) 253 | 254 | DEPENDENCIES: 255 | - DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`) 256 | - FBLazyVector (from `../node_modules/react-native/Libraries/FBLazyVector`) 257 | - FBReactNativeSpec (from `../node_modules/react-native/Libraries/FBReactNativeSpec`) 258 | - Folly (from `../node_modules/react-native/third-party-podspecs/Folly.podspec`) 259 | - glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`) 260 | - RCTRequired (from `../node_modules/react-native/Libraries/RCTRequired`) 261 | - RCTTypeSafety (from `../node_modules/react-native/Libraries/TypeSafety`) 262 | - React (from `../node_modules/react-native/`) 263 | - React-callinvoker (from `../node_modules/react-native/ReactCommon/callinvoker`) 264 | - React-Core (from `../node_modules/react-native/`) 265 | - React-Core/DevSupport (from `../node_modules/react-native/`) 266 | - React-Core/RCTWebSocket (from `../node_modules/react-native/`) 267 | - React-CoreModules (from `../node_modules/react-native/React/CoreModules`) 268 | - React-cxxreact (from `../node_modules/react-native/ReactCommon/cxxreact`) 269 | - React-jsi (from `../node_modules/react-native/ReactCommon/jsi`) 270 | - React-jsiexecutor (from `../node_modules/react-native/ReactCommon/jsiexecutor`) 271 | - React-jsinspector (from `../node_modules/react-native/ReactCommon/jsinspector`) 272 | - react-native-ly-refresh-control (from `../..`) 273 | - React-RCTActionSheet (from `../node_modules/react-native/Libraries/ActionSheetIOS`) 274 | - React-RCTAnimation (from `../node_modules/react-native/Libraries/NativeAnimation`) 275 | - React-RCTBlob (from `../node_modules/react-native/Libraries/Blob`) 276 | - React-RCTImage (from `../node_modules/react-native/Libraries/Image`) 277 | - React-RCTLinking (from `../node_modules/react-native/Libraries/LinkingIOS`) 278 | - React-RCTNetwork (from `../node_modules/react-native/Libraries/Network`) 279 | - React-RCTSettings (from `../node_modules/react-native/Libraries/Settings`) 280 | - React-RCTText (from `../node_modules/react-native/Libraries/Text`) 281 | - React-RCTVibration (from `../node_modules/react-native/Libraries/Vibration`) 282 | - ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`) 283 | - Yoga (from `../node_modules/react-native/ReactCommon/yoga`) 284 | 285 | SPEC REPOS: 286 | trunk: 287 | - boost-for-react-native 288 | - MJRefresh 289 | 290 | EXTERNAL SOURCES: 291 | DoubleConversion: 292 | :podspec: "../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec" 293 | FBLazyVector: 294 | :path: "../node_modules/react-native/Libraries/FBLazyVector" 295 | FBReactNativeSpec: 296 | :path: "../node_modules/react-native/Libraries/FBReactNativeSpec" 297 | Folly: 298 | :podspec: "../node_modules/react-native/third-party-podspecs/Folly.podspec" 299 | glog: 300 | :podspec: "../node_modules/react-native/third-party-podspecs/glog.podspec" 301 | RCTRequired: 302 | :path: "../node_modules/react-native/Libraries/RCTRequired" 303 | RCTTypeSafety: 304 | :path: "../node_modules/react-native/Libraries/TypeSafety" 305 | React: 306 | :path: "../node_modules/react-native/" 307 | React-callinvoker: 308 | :path: "../node_modules/react-native/ReactCommon/callinvoker" 309 | React-Core: 310 | :path: "../node_modules/react-native/" 311 | React-CoreModules: 312 | :path: "../node_modules/react-native/React/CoreModules" 313 | React-cxxreact: 314 | :path: "../node_modules/react-native/ReactCommon/cxxreact" 315 | React-jsi: 316 | :path: "../node_modules/react-native/ReactCommon/jsi" 317 | React-jsiexecutor: 318 | :path: "../node_modules/react-native/ReactCommon/jsiexecutor" 319 | React-jsinspector: 320 | :path: "../node_modules/react-native/ReactCommon/jsinspector" 321 | react-native-ly-refresh-control: 322 | :path: "../.." 323 | React-RCTActionSheet: 324 | :path: "../node_modules/react-native/Libraries/ActionSheetIOS" 325 | React-RCTAnimation: 326 | :path: "../node_modules/react-native/Libraries/NativeAnimation" 327 | React-RCTBlob: 328 | :path: "../node_modules/react-native/Libraries/Blob" 329 | React-RCTImage: 330 | :path: "../node_modules/react-native/Libraries/Image" 331 | React-RCTLinking: 332 | :path: "../node_modules/react-native/Libraries/LinkingIOS" 333 | React-RCTNetwork: 334 | :path: "../node_modules/react-native/Libraries/Network" 335 | React-RCTSettings: 336 | :path: "../node_modules/react-native/Libraries/Settings" 337 | React-RCTText: 338 | :path: "../node_modules/react-native/Libraries/Text" 339 | React-RCTVibration: 340 | :path: "../node_modules/react-native/Libraries/Vibration" 341 | ReactCommon: 342 | :path: "../node_modules/react-native/ReactCommon" 343 | Yoga: 344 | :path: "../node_modules/react-native/ReactCommon/yoga" 345 | 346 | SPEC CHECKSUMS: 347 | boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c 348 | DoubleConversion: cde416483dac037923206447da6e1454df403714 349 | FBLazyVector: 3bb422f41b18121b71783a905c10e58606f7dc3e 350 | FBReactNativeSpec: f2c97f2529dd79c083355182cc158c9f98f4bd6e 351 | Folly: b73c3869541e86821df3c387eb0af5f65addfab4 352 | glog: 40a13f7840415b9a77023fbcae0f1e6f43192af3 353 | MJRefresh: 30997d30b347c8e9508a4db11e3a690da0c9b85a 354 | RCTRequired: 082f10cd3f905d6c124597fd1c14f6f2655ff65e 355 | RCTTypeSafety: 8c9c544ecbf20337d069e4ae7fd9a377aadf504b 356 | React: b0a957a2c44da4113b0c4c9853d8387f8e64e615 357 | React-callinvoker: c3f44dd3cb195b6aa46621fff95ded79d59043fe 358 | React-Core: d3b2a1ac9a2c13c3bcde712d9281fc1c8a5b315b 359 | React-CoreModules: 0581ff36cb797da0943d424f69e7098e43e9be60 360 | React-cxxreact: c1480d4fda5720086c90df537ee7d285d4c57ac3 361 | React-jsi: a0418934cf48f25b485631deb27c64dc40fb4c31 362 | React-jsiexecutor: 93bd528844ad21dc07aab1c67cb10abae6df6949 363 | React-jsinspector: 58aef7155bc9a9683f5b60b35eccea8722a4f53a 364 | react-native-ly-refresh-control: 0bd9616520c9d75c3343b487d870e323ef2ccc08 365 | React-RCTActionSheet: 89a0ca9f4a06c1f93c26067af074ccdce0f40336 366 | React-RCTAnimation: 1bde3ecc0c104c55df246eda516e0deb03c4e49b 367 | React-RCTBlob: a97d378b527740cc667e03ebfa183a75231ab0f0 368 | React-RCTImage: c1b1f2d3f43a4a528c8946d6092384b5c880d2f0 369 | React-RCTLinking: 35ae4ab9dc0410d1fcbdce4d7623194a27214fb2 370 | React-RCTNetwork: 29ec2696f8d8cfff7331fac83d3e893c95ef43ae 371 | React-RCTSettings: 60f0691bba2074ef394f95d4c2265ec284e0a46a 372 | React-RCTText: 5c51df3f08cb9dedc6e790161195d12bac06101c 373 | React-RCTVibration: ae4f914cfe8de7d4de95ae1ea6cc8f6315d73d9d 374 | ReactCommon: 73d79c7039f473b76db6ff7c6b159c478acbbb3b 375 | Yoga: 4bd86afe9883422a7c4028c00e34790f560923d6 376 | 377 | PODFILE CHECKSUM: 98639232b8f56dfd8fc143868b0529db285a504e 378 | 379 | COCOAPODS: 1.10.1 380 | -------------------------------------------------------------------------------- /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-ly-refresh-control-example", 3 | "description": "Example app for react-native-ly-refresh-control", 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": "16.13.1", 13 | "react-native": "0.63.4" 14 | }, 15 | "devDependencies": { 16 | "@babel/core": "^7.12.10", 17 | "@babel/runtime": "^7.12.5", 18 | "babel-plugin-module-resolver": "^4.0.0", 19 | "metro-react-native-babel-preset": "^0.64.0" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /example/src/App.tsx: -------------------------------------------------------------------------------- 1 | import React, { useEffect, useState } from 'react'; 2 | import { StyleSheet, View, ScrollView, SafeAreaView } from 'react-native'; 3 | import LYRefreshControl from 'react-native-ly-refresh-control'; 4 | 5 | export default function App() { 6 | const [refreshing, setRefreshing] = useState(true); 7 | 8 | useEffect(() => { 9 | setTimeout(() => { 10 | setRefreshing(false); 11 | }, 3000); 12 | }, []); 13 | 14 | const onRefresh = () => { 15 | setRefreshing(true); 16 | setTimeout(() => { 17 | setRefreshing(false); 18 | }, 3000); 19 | console.log('下拉刷新'); 20 | }; 21 | 22 | return ( 23 | 24 | 45 | } 46 | > 47 | {[...new Array(10)].map((_v: any, i) => ( 48 | 49 | ))} 50 | 51 | 52 | ); 53 | } 54 | 55 | const styles = StyleSheet.create({ 56 | container: { 57 | flex: 1, 58 | }, 59 | scroll: { 60 | flex: 1, 61 | }, 62 | cell: { 63 | height: 44, 64 | backgroundColor: 'red', 65 | margin: 4, 66 | }, 67 | }); 68 | -------------------------------------------------------------------------------- /example/src/assets/dropdown_anim__00010@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syanbo/react-native-ly-refresh-control/20c05d6096562c7f9c784171da0be33a43b980aa/example/src/assets/dropdown_anim__00010@2x.png -------------------------------------------------------------------------------- /example/src/assets/dropdown_anim__00011@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syanbo/react-native-ly-refresh-control/20c05d6096562c7f9c784171da0be33a43b980aa/example/src/assets/dropdown_anim__00011@2x.png -------------------------------------------------------------------------------- /example/src/assets/dropdown_anim__00012@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syanbo/react-native-ly-refresh-control/20c05d6096562c7f9c784171da0be33a43b980aa/example/src/assets/dropdown_anim__00012@2x.png -------------------------------------------------------------------------------- /example/src/assets/dropdown_anim__00013@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syanbo/react-native-ly-refresh-control/20c05d6096562c7f9c784171da0be33a43b980aa/example/src/assets/dropdown_anim__00013@2x.png -------------------------------------------------------------------------------- /example/src/assets/dropdown_anim__00014@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syanbo/react-native-ly-refresh-control/20c05d6096562c7f9c784171da0be33a43b980aa/example/src/assets/dropdown_anim__00014@2x.png -------------------------------------------------------------------------------- /example/src/assets/dropdown_anim__00015@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syanbo/react-native-ly-refresh-control/20c05d6096562c7f9c784171da0be33a43b980aa/example/src/assets/dropdown_anim__00015@2x.png -------------------------------------------------------------------------------- /example/src/assets/dropdown_anim__00016@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syanbo/react-native-ly-refresh-control/20c05d6096562c7f9c784171da0be33a43b980aa/example/src/assets/dropdown_anim__00016@2x.png -------------------------------------------------------------------------------- /example/src/assets/dropdown_anim__00017@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syanbo/react-native-ly-refresh-control/20c05d6096562c7f9c784171da0be33a43b980aa/example/src/assets/dropdown_anim__00017@2x.png -------------------------------------------------------------------------------- /example/src/assets/dropdown_anim__00018@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syanbo/react-native-ly-refresh-control/20c05d6096562c7f9c784171da0be33a43b980aa/example/src/assets/dropdown_anim__00018@2x.png -------------------------------------------------------------------------------- /example/src/assets/dropdown_anim__00019@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syanbo/react-native-ly-refresh-control/20c05d6096562c7f9c784171da0be33a43b980aa/example/src/assets/dropdown_anim__00019@2x.png -------------------------------------------------------------------------------- /example/src/assets/dropdown_anim__0001@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syanbo/react-native-ly-refresh-control/20c05d6096562c7f9c784171da0be33a43b980aa/example/src/assets/dropdown_anim__0001@2x.png -------------------------------------------------------------------------------- /example/src/assets/dropdown_anim__00020@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syanbo/react-native-ly-refresh-control/20c05d6096562c7f9c784171da0be33a43b980aa/example/src/assets/dropdown_anim__00020@2x.png -------------------------------------------------------------------------------- /example/src/assets/dropdown_anim__00021@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syanbo/react-native-ly-refresh-control/20c05d6096562c7f9c784171da0be33a43b980aa/example/src/assets/dropdown_anim__00021@2x.png -------------------------------------------------------------------------------- /example/src/assets/dropdown_anim__00022@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syanbo/react-native-ly-refresh-control/20c05d6096562c7f9c784171da0be33a43b980aa/example/src/assets/dropdown_anim__00022@2x.png -------------------------------------------------------------------------------- /example/src/assets/dropdown_anim__00023@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syanbo/react-native-ly-refresh-control/20c05d6096562c7f9c784171da0be33a43b980aa/example/src/assets/dropdown_anim__00023@2x.png -------------------------------------------------------------------------------- /example/src/assets/dropdown_anim__00024@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syanbo/react-native-ly-refresh-control/20c05d6096562c7f9c784171da0be33a43b980aa/example/src/assets/dropdown_anim__00024@2x.png -------------------------------------------------------------------------------- /example/src/assets/dropdown_anim__00025@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syanbo/react-native-ly-refresh-control/20c05d6096562c7f9c784171da0be33a43b980aa/example/src/assets/dropdown_anim__00025@2x.png -------------------------------------------------------------------------------- /example/src/assets/dropdown_anim__00026@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syanbo/react-native-ly-refresh-control/20c05d6096562c7f9c784171da0be33a43b980aa/example/src/assets/dropdown_anim__00026@2x.png -------------------------------------------------------------------------------- /example/src/assets/dropdown_anim__00027@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syanbo/react-native-ly-refresh-control/20c05d6096562c7f9c784171da0be33a43b980aa/example/src/assets/dropdown_anim__00027@2x.png -------------------------------------------------------------------------------- /example/src/assets/dropdown_anim__00028@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syanbo/react-native-ly-refresh-control/20c05d6096562c7f9c784171da0be33a43b980aa/example/src/assets/dropdown_anim__00028@2x.png -------------------------------------------------------------------------------- /example/src/assets/dropdown_anim__00029@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syanbo/react-native-ly-refresh-control/20c05d6096562c7f9c784171da0be33a43b980aa/example/src/assets/dropdown_anim__00029@2x.png -------------------------------------------------------------------------------- /example/src/assets/dropdown_anim__0002@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syanbo/react-native-ly-refresh-control/20c05d6096562c7f9c784171da0be33a43b980aa/example/src/assets/dropdown_anim__0002@2x.png -------------------------------------------------------------------------------- /example/src/assets/dropdown_anim__00030@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syanbo/react-native-ly-refresh-control/20c05d6096562c7f9c784171da0be33a43b980aa/example/src/assets/dropdown_anim__00030@2x.png -------------------------------------------------------------------------------- /example/src/assets/dropdown_anim__00031@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syanbo/react-native-ly-refresh-control/20c05d6096562c7f9c784171da0be33a43b980aa/example/src/assets/dropdown_anim__00031@2x.png -------------------------------------------------------------------------------- /example/src/assets/dropdown_anim__00032@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syanbo/react-native-ly-refresh-control/20c05d6096562c7f9c784171da0be33a43b980aa/example/src/assets/dropdown_anim__00032@2x.png -------------------------------------------------------------------------------- /example/src/assets/dropdown_anim__00033@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syanbo/react-native-ly-refresh-control/20c05d6096562c7f9c784171da0be33a43b980aa/example/src/assets/dropdown_anim__00033@2x.png -------------------------------------------------------------------------------- /example/src/assets/dropdown_anim__00034@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syanbo/react-native-ly-refresh-control/20c05d6096562c7f9c784171da0be33a43b980aa/example/src/assets/dropdown_anim__00034@2x.png -------------------------------------------------------------------------------- /example/src/assets/dropdown_anim__00035@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syanbo/react-native-ly-refresh-control/20c05d6096562c7f9c784171da0be33a43b980aa/example/src/assets/dropdown_anim__00035@2x.png -------------------------------------------------------------------------------- /example/src/assets/dropdown_anim__00036@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syanbo/react-native-ly-refresh-control/20c05d6096562c7f9c784171da0be33a43b980aa/example/src/assets/dropdown_anim__00036@2x.png -------------------------------------------------------------------------------- /example/src/assets/dropdown_anim__00037@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syanbo/react-native-ly-refresh-control/20c05d6096562c7f9c784171da0be33a43b980aa/example/src/assets/dropdown_anim__00037@2x.png -------------------------------------------------------------------------------- /example/src/assets/dropdown_anim__00038@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syanbo/react-native-ly-refresh-control/20c05d6096562c7f9c784171da0be33a43b980aa/example/src/assets/dropdown_anim__00038@2x.png -------------------------------------------------------------------------------- /example/src/assets/dropdown_anim__00039@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syanbo/react-native-ly-refresh-control/20c05d6096562c7f9c784171da0be33a43b980aa/example/src/assets/dropdown_anim__00039@2x.png -------------------------------------------------------------------------------- /example/src/assets/dropdown_anim__0003@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syanbo/react-native-ly-refresh-control/20c05d6096562c7f9c784171da0be33a43b980aa/example/src/assets/dropdown_anim__0003@2x.png -------------------------------------------------------------------------------- /example/src/assets/dropdown_anim__00040@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syanbo/react-native-ly-refresh-control/20c05d6096562c7f9c784171da0be33a43b980aa/example/src/assets/dropdown_anim__00040@2x.png -------------------------------------------------------------------------------- /example/src/assets/dropdown_anim__00041@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syanbo/react-native-ly-refresh-control/20c05d6096562c7f9c784171da0be33a43b980aa/example/src/assets/dropdown_anim__00041@2x.png -------------------------------------------------------------------------------- /example/src/assets/dropdown_anim__00042@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syanbo/react-native-ly-refresh-control/20c05d6096562c7f9c784171da0be33a43b980aa/example/src/assets/dropdown_anim__00042@2x.png -------------------------------------------------------------------------------- /example/src/assets/dropdown_anim__00043@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syanbo/react-native-ly-refresh-control/20c05d6096562c7f9c784171da0be33a43b980aa/example/src/assets/dropdown_anim__00043@2x.png -------------------------------------------------------------------------------- /example/src/assets/dropdown_anim__00044@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syanbo/react-native-ly-refresh-control/20c05d6096562c7f9c784171da0be33a43b980aa/example/src/assets/dropdown_anim__00044@2x.png -------------------------------------------------------------------------------- /example/src/assets/dropdown_anim__00045@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syanbo/react-native-ly-refresh-control/20c05d6096562c7f9c784171da0be33a43b980aa/example/src/assets/dropdown_anim__00045@2x.png -------------------------------------------------------------------------------- /example/src/assets/dropdown_anim__00046@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syanbo/react-native-ly-refresh-control/20c05d6096562c7f9c784171da0be33a43b980aa/example/src/assets/dropdown_anim__00046@2x.png -------------------------------------------------------------------------------- /example/src/assets/dropdown_anim__00047@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syanbo/react-native-ly-refresh-control/20c05d6096562c7f9c784171da0be33a43b980aa/example/src/assets/dropdown_anim__00047@2x.png -------------------------------------------------------------------------------- /example/src/assets/dropdown_anim__00048@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syanbo/react-native-ly-refresh-control/20c05d6096562c7f9c784171da0be33a43b980aa/example/src/assets/dropdown_anim__00048@2x.png -------------------------------------------------------------------------------- /example/src/assets/dropdown_anim__00049@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syanbo/react-native-ly-refresh-control/20c05d6096562c7f9c784171da0be33a43b980aa/example/src/assets/dropdown_anim__00049@2x.png -------------------------------------------------------------------------------- /example/src/assets/dropdown_anim__0004@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syanbo/react-native-ly-refresh-control/20c05d6096562c7f9c784171da0be33a43b980aa/example/src/assets/dropdown_anim__0004@2x.png -------------------------------------------------------------------------------- /example/src/assets/dropdown_anim__00050@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syanbo/react-native-ly-refresh-control/20c05d6096562c7f9c784171da0be33a43b980aa/example/src/assets/dropdown_anim__00050@2x.png -------------------------------------------------------------------------------- /example/src/assets/dropdown_anim__00051@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syanbo/react-native-ly-refresh-control/20c05d6096562c7f9c784171da0be33a43b980aa/example/src/assets/dropdown_anim__00051@2x.png -------------------------------------------------------------------------------- /example/src/assets/dropdown_anim__00052@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syanbo/react-native-ly-refresh-control/20c05d6096562c7f9c784171da0be33a43b980aa/example/src/assets/dropdown_anim__00052@2x.png -------------------------------------------------------------------------------- /example/src/assets/dropdown_anim__00053@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syanbo/react-native-ly-refresh-control/20c05d6096562c7f9c784171da0be33a43b980aa/example/src/assets/dropdown_anim__00053@2x.png -------------------------------------------------------------------------------- /example/src/assets/dropdown_anim__00054@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syanbo/react-native-ly-refresh-control/20c05d6096562c7f9c784171da0be33a43b980aa/example/src/assets/dropdown_anim__00054@2x.png -------------------------------------------------------------------------------- /example/src/assets/dropdown_anim__00055@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syanbo/react-native-ly-refresh-control/20c05d6096562c7f9c784171da0be33a43b980aa/example/src/assets/dropdown_anim__00055@2x.png -------------------------------------------------------------------------------- /example/src/assets/dropdown_anim__00056@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syanbo/react-native-ly-refresh-control/20c05d6096562c7f9c784171da0be33a43b980aa/example/src/assets/dropdown_anim__00056@2x.png -------------------------------------------------------------------------------- /example/src/assets/dropdown_anim__00057@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syanbo/react-native-ly-refresh-control/20c05d6096562c7f9c784171da0be33a43b980aa/example/src/assets/dropdown_anim__00057@2x.png -------------------------------------------------------------------------------- /example/src/assets/dropdown_anim__00058@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syanbo/react-native-ly-refresh-control/20c05d6096562c7f9c784171da0be33a43b980aa/example/src/assets/dropdown_anim__00058@2x.png -------------------------------------------------------------------------------- /example/src/assets/dropdown_anim__00059@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syanbo/react-native-ly-refresh-control/20c05d6096562c7f9c784171da0be33a43b980aa/example/src/assets/dropdown_anim__00059@2x.png -------------------------------------------------------------------------------- /example/src/assets/dropdown_anim__0005@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syanbo/react-native-ly-refresh-control/20c05d6096562c7f9c784171da0be33a43b980aa/example/src/assets/dropdown_anim__0005@2x.png -------------------------------------------------------------------------------- /example/src/assets/dropdown_anim__00060@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syanbo/react-native-ly-refresh-control/20c05d6096562c7f9c784171da0be33a43b980aa/example/src/assets/dropdown_anim__00060@2x.png -------------------------------------------------------------------------------- /example/src/assets/dropdown_anim__0006@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syanbo/react-native-ly-refresh-control/20c05d6096562c7f9c784171da0be33a43b980aa/example/src/assets/dropdown_anim__0006@2x.png -------------------------------------------------------------------------------- /example/src/assets/dropdown_anim__0007@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syanbo/react-native-ly-refresh-control/20c05d6096562c7f9c784171da0be33a43b980aa/example/src/assets/dropdown_anim__0007@2x.png -------------------------------------------------------------------------------- /example/src/assets/dropdown_anim__0008@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syanbo/react-native-ly-refresh-control/20c05d6096562c7f9c784171da0be33a43b980aa/example/src/assets/dropdown_anim__0008@2x.png -------------------------------------------------------------------------------- /example/src/assets/dropdown_anim__0009@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syanbo/react-native-ly-refresh-control/20c05d6096562c7f9c784171da0be33a43b980aa/example/src/assets/dropdown_anim__0009@2x.png -------------------------------------------------------------------------------- /example/src/assets/dropdown_loading_01@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syanbo/react-native-ly-refresh-control/20c05d6096562c7f9c784171da0be33a43b980aa/example/src/assets/dropdown_loading_01@2x.png -------------------------------------------------------------------------------- /example/src/assets/dropdown_loading_02@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syanbo/react-native-ly-refresh-control/20c05d6096562c7f9c784171da0be33a43b980aa/example/src/assets/dropdown_loading_02@2x.png -------------------------------------------------------------------------------- /example/src/assets/dropdown_loading_03@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syanbo/react-native-ly-refresh-control/20c05d6096562c7f9c784171da0be33a43b980aa/example/src/assets/dropdown_loading_03@2x.png -------------------------------------------------------------------------------- /github/live.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syanbo/react-native-ly-refresh-control/20c05d6096562c7f9c784171da0be33a43b980aa/github/live.gif -------------------------------------------------------------------------------- /ios/LyRefreshControl.h: -------------------------------------------------------------------------------- 1 | // 2 | // LyRefreshControl.h 3 | // react-native-ly-refresh-control 4 | // 5 | // Created by 邓博 on 2021/9/11. 6 | // 7 | 8 | #import 9 | 10 | #import 11 | #import 12 | #import 13 | #import 14 | 15 | NS_ASSUME_NONNULL_BEGIN 16 | 17 | @interface LyRefreshControl : MJRefreshGifHeader 18 | 19 | @property (nonatomic, copy) NSString *title; 20 | @property (nonatomic, copy) RCTDirectEventBlock onRefresh; 21 | @property (nonatomic, copy) NSArray *idleImageSources; 22 | @property (nonatomic, copy) NSArray *refreshingImageSources; 23 | 24 | @end 25 | 26 | NS_ASSUME_NONNULL_END 27 | -------------------------------------------------------------------------------- /ios/LyRefreshControl.m: -------------------------------------------------------------------------------- 1 | // 2 | // LyRefreshControl.m 3 | // react-native-ly-refresh-control 4 | // 5 | // Created by 邓博 on 2021/9/11. 6 | // 7 | 8 | #import "LyRefreshControl.h" 9 | 10 | #import "RCTUtils.h" 11 | #import 12 | 13 | @interface LyRefreshControl () 14 | @end 15 | 16 | @implementation LyRefreshControl { 17 | BOOL _isInitialRender; 18 | BOOL _currentRefreshingState; 19 | UInt64 _currentRefreshingStateClock; 20 | UInt64 _currentRefreshingStateTimestamp; 21 | BOOL _refreshingProgrammatically; 22 | NSString *_title; 23 | UIColor *_titleColor; 24 | } 25 | 26 | - (instancetype)init 27 | { 28 | if ((self = [super init])) { 29 | [self setRefreshingTarget:self refreshingAction:@selector(refreshControlValueChanged)]; 30 | _currentRefreshingStateClock = 1; 31 | _currentRefreshingStateTimestamp = 0; 32 | _isInitialRender = true; 33 | _currentRefreshingState = false; 34 | } 35 | return self; 36 | } 37 | 38 | - (void)setFrame:(CGRect)frame { 39 | CGFloat width = self.scrollView.frame.size.width ?: [UIScreen mainScreen].bounds.size.width; 40 | CGFloat height = 88; 41 | CGFloat y = -height; 42 | [super setFrame:CGRectMake(frame.origin.x, y, width, height)]; 43 | } 44 | 45 | RCT_NOT_IMPLEMENTED(-(instancetype)initWithCoder : (NSCoder *)aDecoder) 46 | 47 | - (void)layoutSubviews 48 | { 49 | [super layoutSubviews]; 50 | 51 | // Fix for bug #7976 52 | // TODO: Remove when updating to use iOS 10 refreshControl UIScrollView prop. 53 | if (self.backgroundColor == nil) { 54 | self.backgroundColor = [UIColor clearColor]; 55 | } 56 | 57 | // If the control is refreshing when mounted we need to call 58 | // beginRefreshing in layoutSubview or it doesn't work. 59 | if (_currentRefreshingState && _isInitialRender) { 60 | [self beginRefreshingProgrammatically]; 61 | } 62 | _isInitialRender = false; 63 | } 64 | 65 | - (void)beginRefreshingProgrammatically 66 | { 67 | UInt64 beginRefreshingTimestamp = _currentRefreshingStateTimestamp; 68 | _refreshingProgrammatically = YES; 69 | // When using begin refreshing we need to adjust the ScrollView content offset manually. 70 | UIScrollView *scrollView = (UIScrollView *)self.superview; 71 | // Fix for bug #24855 72 | [self sizeToFit]; 73 | CGPoint offset = {scrollView.contentOffset.x, scrollView.contentOffset.y - self.frame.size.height}; 74 | 75 | // `beginRefreshing` must be called after the animation is done. This is why it is impossible 76 | // to use `setContentOffset` with `animated:YES`. 77 | [UIView animateWithDuration:0.25 78 | delay:0 79 | options:UIViewAnimationOptionBeginFromCurrentState 80 | animations:^(void) { 81 | [scrollView setContentOffset:offset]; 82 | } 83 | completion:^(__unused BOOL finished) { 84 | if (beginRefreshingTimestamp == self->_currentRefreshingStateTimestamp) { 85 | [super beginRefreshing]; 86 | [self setCurrentRefreshingState:super.refreshing]; 87 | } 88 | }]; 89 | } 90 | 91 | - (void)endRefreshingProgrammatically 92 | { 93 | // The contentOffset of the scrollview MUST be greater than the contentInset before calling 94 | // endRefreshing otherwise the next pull to refresh will not work properly. 95 | UIScrollView *scrollView = (UIScrollView *)self.superview; 96 | if (_refreshingProgrammatically && scrollView.contentOffset.y < -scrollView.contentInset.top) { 97 | UInt64 endRefreshingTimestamp = _currentRefreshingStateTimestamp; 98 | CGPoint offset = {scrollView.contentOffset.x, -scrollView.contentInset.top}; 99 | [UIView animateWithDuration:0.25 100 | delay:0 101 | options:UIViewAnimationOptionBeginFromCurrentState 102 | animations:^(void) { 103 | [scrollView setContentOffset:offset]; 104 | } 105 | completion:^(__unused BOOL finished) { 106 | if (endRefreshingTimestamp == self->_currentRefreshingStateTimestamp) { 107 | [super endRefreshing]; 108 | [self setCurrentRefreshingState:super.refreshing]; 109 | } 110 | }]; 111 | } else { 112 | [super endRefreshing]; 113 | } 114 | } 115 | 116 | - (NSString *)title 117 | { 118 | return _title; 119 | } 120 | 121 | - (void)setTitle:(NSString *)title 122 | { 123 | _title = title; 124 | [self _updateTitle]; 125 | } 126 | 127 | - (void)setIdleImageSources:(NSArray *)idleImageSources 128 | { 129 | _idleImageSources = idleImageSources; 130 | [self prepare]; 131 | } 132 | 133 | - (void)setRefreshingImageSources:(NSArray *)refreshingImageSources 134 | { 135 | _refreshingImageSources = refreshingImageSources; 136 | [self prepare]; 137 | } 138 | 139 | - (void)setTitleColor:(UIColor *)color 140 | { 141 | _titleColor = color; 142 | [self _updateTitle]; 143 | } 144 | 145 | - (void)_updateTitle 146 | { 147 | if (!_title) { 148 | return; 149 | } 150 | 151 | // NSMutableDictionary *attributes = [NSMutableDictionary dictionary]; 152 | // if (_titleColor) { 153 | // attributes[NSForegroundColorAttributeName] = _titleColor; 154 | // } 155 | 156 | // self.attributedTitle = [[NSAttributedString alloc] initWithString:_title attributes:attributes]; 157 | } 158 | 159 | - (void)setRefreshing:(BOOL)refreshing 160 | { 161 | if (_currentRefreshingState != refreshing) { 162 | [self setCurrentRefreshingState:refreshing]; 163 | 164 | if (refreshing) { 165 | if (!_isInitialRender) { 166 | [self beginRefreshingProgrammatically]; 167 | } 168 | } else { 169 | [self endRefreshingProgrammatically]; 170 | } 171 | } 172 | } 173 | 174 | - (void)setCurrentRefreshingState:(BOOL)refreshing 175 | { 176 | _currentRefreshingState = refreshing; 177 | _currentRefreshingStateTimestamp = _currentRefreshingStateClock++; 178 | } 179 | 180 | - (void)refreshControlValueChanged 181 | { 182 | [self setCurrentRefreshingState:super.refreshing]; 183 | _refreshingProgrammatically = NO; 184 | 185 | if (_onRefresh) { 186 | _onRefresh(nil); 187 | } 188 | } 189 | 190 | - (void)prepare 191 | { 192 | [super prepare]; 193 | 194 | // 设置普通状态的动画图片 195 | NSMutableArray *idleImages = [NSMutableArray array]; 196 | for (NSUInteger i = 0; i < [_idleImageSources count]; i++) { 197 | RCTImageSource *source = _idleImageSources[i]; 198 | UIImage *image = [UIImage imageWithData:[NSData dataWithContentsOfURL:source.request.URL]]; 199 | [idleImages addObject:image]; 200 | } 201 | 202 | [self setImages:idleImages forState:MJRefreshStateIdle]; 203 | 204 | // 设置即将刷新状态的动画图片(一松开就会刷新的状态) 205 | NSMutableArray *refreshingImages = [NSMutableArray array]; 206 | for (NSUInteger i = 0; i < [_refreshingImageSources count]; i++) { 207 | RCTImageSource *source = _refreshingImageSources[i]; 208 | UIImage *image = [UIImage imageWithData:[NSData dataWithContentsOfURL:source.request.URL]]; 209 | [refreshingImages addObject:image]; 210 | } 211 | [self setImages:refreshingImages forState:MJRefreshStatePulling]; 212 | 213 | // 设置正在刷新状态的动画图片 214 | [self setImages:refreshingImages forState:MJRefreshStateRefreshing]; 215 | } 216 | 217 | @end 218 | -------------------------------------------------------------------------------- /ios/LyRefreshControl.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 11 | 5E555C0D2413F4C50049A1A2 /* LyRefreshControl.m in Sources */ = {isa = PBXBuildFile; fileRef = B3E7B5891CC2AC0600A0062D /* LyRefreshControl.m */; }; 12 | 13 | /* End PBXBuildFile section */ 14 | 15 | /* Begin PBXCopyFilesBuildPhase section */ 16 | 58B511D91A9E6C8500147676 /* CopyFiles */ = { 17 | isa = PBXCopyFilesBuildPhase; 18 | buildActionMask = 2147483647; 19 | dstPath = "include/$(PRODUCT_NAME)"; 20 | dstSubfolderSpec = 16; 21 | files = ( 22 | ); 23 | runOnlyForDeploymentPostprocessing = 0; 24 | }; 25 | /* End PBXCopyFilesBuildPhase section */ 26 | 27 | /* Begin PBXFileReference section */ 28 | 134814201AA4EA6300B7C361 /* libLyRefreshControl.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libLyRefreshControl.a; sourceTree = BUILT_PRODUCTS_DIR; }; 29 | 30 | B3E7B5881CC2AC0600A0062D /* LyRefreshControl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LyRefreshControl.h; sourceTree = ""; }; 31 | B3E7B5891CC2AC0600A0062D /* LyRefreshControl.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LyRefreshControl.m; sourceTree = ""; }; 32 | 33 | /* End PBXFileReference section */ 34 | 35 | /* Begin PBXFrameworksBuildPhase section */ 36 | 58B511D81A9E6C8500147676 /* Frameworks */ = { 37 | isa = PBXFrameworksBuildPhase; 38 | buildActionMask = 2147483647; 39 | files = ( 40 | ); 41 | runOnlyForDeploymentPostprocessing = 0; 42 | }; 43 | /* End PBXFrameworksBuildPhase section */ 44 | 45 | /* Begin PBXGroup section */ 46 | 134814211AA4EA7D00B7C361 /* Products */ = { 47 | isa = PBXGroup; 48 | children = ( 49 | 134814201AA4EA6300B7C361 /* libLyRefreshControl.a */, 50 | ); 51 | name = Products; 52 | sourceTree = ""; 53 | }; 54 | 58B511D21A9E6C8500147676 = { 55 | isa = PBXGroup; 56 | children = ( 57 | 58 | B3E7B5881CC2AC0600A0062D /* LyRefreshControl.h */, 59 | B3E7B5891CC2AC0600A0062D /* LyRefreshControl.m */, 60 | 61 | 134814211AA4EA7D00B7C361 /* Products */, 62 | ); 63 | sourceTree = ""; 64 | }; 65 | /* End PBXGroup section */ 66 | 67 | /* Begin PBXNativeTarget section */ 68 | 58B511DA1A9E6C8500147676 /* LyRefreshControl */ = { 69 | isa = PBXNativeTarget; 70 | buildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "LyRefreshControl" */; 71 | buildPhases = ( 72 | 58B511D71A9E6C8500147676 /* Sources */, 73 | 58B511D81A9E6C8500147676 /* Frameworks */, 74 | 58B511D91A9E6C8500147676 /* CopyFiles */, 75 | ); 76 | buildRules = ( 77 | ); 78 | dependencies = ( 79 | ); 80 | name = LyRefreshControl; 81 | productName = RCTDataManager; 82 | productReference = 134814201AA4EA6300B7C361 /* libLyRefreshControl.a */; 83 | productType = "com.apple.product-type.library.static"; 84 | }; 85 | /* End PBXNativeTarget section */ 86 | 87 | /* Begin PBXProject section */ 88 | 58B511D31A9E6C8500147676 /* Project object */ = { 89 | isa = PBXProject; 90 | attributes = { 91 | LastUpgradeCheck = 0920; 92 | ORGANIZATIONNAME = Facebook; 93 | TargetAttributes = { 94 | 58B511DA1A9E6C8500147676 = { 95 | CreatedOnToolsVersion = 6.1.1; 96 | }; 97 | }; 98 | }; 99 | buildConfigurationList = 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "LyRefreshControl" */; 100 | compatibilityVersion = "Xcode 3.2"; 101 | developmentRegion = English; 102 | hasScannedForEncodings = 0; 103 | knownRegions = ( 104 | English, 105 | en, 106 | ); 107 | mainGroup = 58B511D21A9E6C8500147676; 108 | productRefGroup = 58B511D21A9E6C8500147676; 109 | projectDirPath = ""; 110 | projectRoot = ""; 111 | targets = ( 112 | 58B511DA1A9E6C8500147676 /* LyRefreshControl */, 113 | ); 114 | }; 115 | /* End PBXProject section */ 116 | 117 | /* Begin PBXSourcesBuildPhase section */ 118 | 58B511D71A9E6C8500147676 /* Sources */ = { 119 | isa = PBXSourcesBuildPhase; 120 | buildActionMask = 2147483647; 121 | files = ( 122 | 123 | B3E7B58A1CC2AC0600A0062D /* LyRefreshControl.m in Sources */, 124 | 125 | ); 126 | runOnlyForDeploymentPostprocessing = 0; 127 | }; 128 | /* End PBXSourcesBuildPhase section */ 129 | 130 | /* Begin XCBuildConfiguration section */ 131 | 58B511ED1A9E6C8500147676 /* Debug */ = { 132 | isa = XCBuildConfiguration; 133 | buildSettings = { 134 | ALWAYS_SEARCH_USER_PATHS = NO; 135 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 136 | CLANG_CXX_LIBRARY = "libc++"; 137 | CLANG_ENABLE_MODULES = YES; 138 | CLANG_ENABLE_OBJC_ARC = YES; 139 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 140 | CLANG_WARN_BOOL_CONVERSION = YES; 141 | CLANG_WARN_COMMA = YES; 142 | CLANG_WARN_CONSTANT_CONVERSION = YES; 143 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 144 | CLANG_WARN_EMPTY_BODY = YES; 145 | CLANG_WARN_ENUM_CONVERSION = YES; 146 | CLANG_WARN_INFINITE_RECURSION = YES; 147 | CLANG_WARN_INT_CONVERSION = YES; 148 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 149 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 150 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 151 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 152 | CLANG_WARN_STRICT_PROTOTYPES = YES; 153 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 154 | CLANG_WARN_UNREACHABLE_CODE = YES; 155 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 156 | COPY_PHASE_STRIP = NO; 157 | ENABLE_STRICT_OBJC_MSGSEND = YES; 158 | ENABLE_TESTABILITY = YES; 159 | GCC_C_LANGUAGE_STANDARD = gnu99; 160 | GCC_DYNAMIC_NO_PIC = NO; 161 | GCC_NO_COMMON_BLOCKS = YES; 162 | GCC_OPTIMIZATION_LEVEL = 0; 163 | GCC_PREPROCESSOR_DEFINITIONS = ( 164 | "DEBUG=1", 165 | "$(inherited)", 166 | ); 167 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 168 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 169 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 170 | GCC_WARN_UNDECLARED_SELECTOR = YES; 171 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 172 | GCC_WARN_UNUSED_FUNCTION = YES; 173 | GCC_WARN_UNUSED_VARIABLE = YES; 174 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 175 | MTL_ENABLE_DEBUG_INFO = YES; 176 | ONLY_ACTIVE_ARCH = YES; 177 | SDKROOT = iphoneos; 178 | }; 179 | name = Debug; 180 | }; 181 | 58B511EE1A9E6C8500147676 /* Release */ = { 182 | isa = XCBuildConfiguration; 183 | buildSettings = { 184 | ALWAYS_SEARCH_USER_PATHS = NO; 185 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 186 | CLANG_CXX_LIBRARY = "libc++"; 187 | CLANG_ENABLE_MODULES = YES; 188 | CLANG_ENABLE_OBJC_ARC = YES; 189 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 190 | CLANG_WARN_BOOL_CONVERSION = YES; 191 | CLANG_WARN_COMMA = YES; 192 | CLANG_WARN_CONSTANT_CONVERSION = YES; 193 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 194 | CLANG_WARN_EMPTY_BODY = YES; 195 | CLANG_WARN_ENUM_CONVERSION = YES; 196 | CLANG_WARN_INFINITE_RECURSION = YES; 197 | CLANG_WARN_INT_CONVERSION = YES; 198 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 199 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 200 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 201 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 202 | CLANG_WARN_STRICT_PROTOTYPES = YES; 203 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 204 | CLANG_WARN_UNREACHABLE_CODE = YES; 205 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 206 | COPY_PHASE_STRIP = YES; 207 | ENABLE_NS_ASSERTIONS = NO; 208 | ENABLE_STRICT_OBJC_MSGSEND = YES; 209 | GCC_C_LANGUAGE_STANDARD = gnu99; 210 | GCC_NO_COMMON_BLOCKS = YES; 211 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 212 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 213 | GCC_WARN_UNDECLARED_SELECTOR = YES; 214 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 215 | GCC_WARN_UNUSED_FUNCTION = YES; 216 | GCC_WARN_UNUSED_VARIABLE = YES; 217 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 218 | MTL_ENABLE_DEBUG_INFO = NO; 219 | SDKROOT = iphoneos; 220 | VALIDATE_PRODUCT = YES; 221 | }; 222 | name = Release; 223 | }; 224 | 58B511F01A9E6C8500147676 /* Debug */ = { 225 | isa = XCBuildConfiguration; 226 | buildSettings = { 227 | HEADER_SEARCH_PATHS = ( 228 | "$(inherited)", 229 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 230 | "$(SRCROOT)/../../../React/**", 231 | "$(SRCROOT)/../../react-native/React/**", 232 | ); 233 | LIBRARY_SEARCH_PATHS = "$(inherited)"; 234 | OTHER_LDFLAGS = "-ObjC"; 235 | PRODUCT_NAME = LyRefreshControl; 236 | SKIP_INSTALL = YES; 237 | 238 | }; 239 | name = Debug; 240 | }; 241 | 58B511F11A9E6C8500147676 /* Release */ = { 242 | isa = XCBuildConfiguration; 243 | buildSettings = { 244 | HEADER_SEARCH_PATHS = ( 245 | "$(inherited)", 246 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 247 | "$(SRCROOT)/../../../React/**", 248 | "$(SRCROOT)/../../react-native/React/**", 249 | ); 250 | LIBRARY_SEARCH_PATHS = "$(inherited)"; 251 | OTHER_LDFLAGS = "-ObjC"; 252 | PRODUCT_NAME = LyRefreshControl; 253 | SKIP_INSTALL = YES; 254 | 255 | }; 256 | name = Release; 257 | }; 258 | /* End XCBuildConfiguration section */ 259 | 260 | /* Begin XCConfigurationList section */ 261 | 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "LyRefreshControl" */ = { 262 | isa = XCConfigurationList; 263 | buildConfigurations = ( 264 | 58B511ED1A9E6C8500147676 /* Debug */, 265 | 58B511EE1A9E6C8500147676 /* Release */, 266 | ); 267 | defaultConfigurationIsVisible = 0; 268 | defaultConfigurationName = Release; 269 | }; 270 | 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "LyRefreshControl" */ = { 271 | isa = XCConfigurationList; 272 | buildConfigurations = ( 273 | 58B511F01A9E6C8500147676 /* Debug */, 274 | 58B511F11A9E6C8500147676 /* Release */, 275 | ); 276 | defaultConfigurationIsVisible = 0; 277 | defaultConfigurationName = Release; 278 | }; 279 | /* End XCConfigurationList section */ 280 | }; 281 | rootObject = 58B511D31A9E6C8500147676 /* Project object */; 282 | } 283 | -------------------------------------------------------------------------------- /ios/LyRefreshControlViewManager.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | #import 4 | 5 | #import "LyRefreshControl.h" 6 | #import "RCTRefreshableProtocol.h" 7 | 8 | @interface LyRefreshControlViewManager : RCTViewManager 9 | @end 10 | 11 | @implementation LyRefreshControlViewManager 12 | 13 | RCT_EXPORT_MODULE(LyRefreshControlView) 14 | 15 | - (UIView *)view 16 | { 17 | return [LyRefreshControl new]; 18 | } 19 | 20 | RCT_EXPORT_VIEW_PROPERTY(onRefresh, RCTDirectEventBlock) 21 | RCT_EXPORT_VIEW_PROPERTY(refreshing, BOOL) 22 | RCT_EXPORT_VIEW_PROPERTY(tintColor, UIColor) 23 | RCT_EXPORT_VIEW_PROPERTY(title, NSString) 24 | RCT_EXPORT_VIEW_PROPERTY(titleColor, UIColor) 25 | RCT_REMAP_VIEW_PROPERTY(idleSources, idleImageSources, NSArray); 26 | RCT_REMAP_VIEW_PROPERTY(refreshingSources, refreshingImageSources, NSArray); 27 | 28 | RCT_EXPORT_METHOD(setNativeRefreshing : (nonnull NSNumber *)viewTag toRefreshing : (BOOL)refreshing) 29 | { 30 | [self.bridge.uiManager addUIBlock:^(RCTUIManager *uiManager, NSDictionary *viewRegistry) { 31 | UIView *view = viewRegistry[viewTag]; 32 | 33 | if ([view conformsToProtocol:@protocol(RCTRefreshableProtocol)]) { 34 | [(id)view setRefreshing:refreshing]; 35 | } else { 36 | RCTLogError(@"view must conform to protocol RCTRefreshableProtocol"); 37 | } 38 | }]; 39 | } 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-native-ly-refresh-control", 3 | "version": "0.1.0", 4 | "description": "下拉刷新", 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-ly-refresh-control.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/syanbo/react-native-ly-refresh-control", 40 | "author": "Syan (https://github.com/syanbo)", 41 | "license": "MIT", 42 | "bugs": { 43 | "url": "https://github.com/syanbo/react-native-ly-refresh-control/issues" 44 | }, 45 | "homepage": "https://github.com/syanbo/react-native-ly-refresh-control#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 | "release-it": "^14.2.2", 68 | "typescript": "^4.1.3" 69 | }, 70 | "peerDependencies": { 71 | "react": "*", 72 | "react-native": "*" 73 | }, 74 | "jest": { 75 | "preset": "react-native", 76 | "modulePathIgnorePatterns": [ 77 | "/example/node_modules", 78 | "/lib/" 79 | ] 80 | }, 81 | "husky": { 82 | "hooks": { 83 | "commit-msg": "commitlint -E HUSKY_GIT_PARAMS", 84 | "pre-commit": "yarn lint && yarn typescript" 85 | } 86 | }, 87 | "commitlint": { 88 | "extends": [ 89 | "@commitlint/config-conventional" 90 | ] 91 | }, 92 | "release-it": { 93 | "git": { 94 | "commitMessage": "chore: release ${version}", 95 | "tagName": "v${version}" 96 | }, 97 | "npm": { 98 | "publish": true 99 | }, 100 | "github": { 101 | "release": true 102 | }, 103 | "plugins": { 104 | "@release-it/conventional-changelog": { 105 | "preset": "angular" 106 | } 107 | } 108 | }, 109 | "eslintConfig": { 110 | "root": true, 111 | "extends": [ 112 | "@react-native-community", 113 | "prettier" 114 | ], 115 | "rules": { 116 | "prettier/prettier": [ 117 | "error", 118 | { 119 | "quoteProps": "consistent", 120 | "singleQuote": true, 121 | "tabWidth": 2, 122 | "trailingComma": "es5", 123 | "useTabs": false 124 | } 125 | ] 126 | } 127 | }, 128 | "eslintIgnore": [ 129 | "node_modules/", 130 | "lib/" 131 | ], 132 | "prettier": { 133 | "quoteProps": "consistent", 134 | "singleQuote": true, 135 | "tabWidth": 2, 136 | "trailingComma": "es5", 137 | "useTabs": false 138 | }, 139 | "react-native-builder-bob": { 140 | "source": "src", 141 | "output": "lib", 142 | "targets": [ 143 | "commonjs", 144 | "module", 145 | [ 146 | "typescript", 147 | { 148 | "project": "tsconfig.build.json" 149 | } 150 | ] 151 | ] 152 | } 153 | } 154 | -------------------------------------------------------------------------------- /react-native-ly-refresh-control.podspec: -------------------------------------------------------------------------------- 1 | require "json" 2 | 3 | package = JSON.parse(File.read(File.join(__dir__, "package.json"))) 4 | 5 | Pod::Spec.new do |s| 6 | s.name = "react-native-ly-refresh-control" 7 | s.version = package["version"] 8 | s.summary = package["description"] 9 | s.homepage = package["homepage"] 10 | s.license = package["license"] 11 | s.authors = package["author"] 12 | 13 | s.platforms = { :ios => "10.0" } 14 | s.source = { :git => "https://github.com/syanbo/react-native-ly-refresh-control.git", :tag => "#{s.version}" } 15 | 16 | s.source_files = "ios/**/*.{h,m,mm}" 17 | 18 | # s.resource_bundles = { 19 | # 'LYRefreshControl' => ['ios/Assets/*.png'] 20 | # } 21 | 22 | s.dependency "React-Core" 23 | s.dependency "MJRefresh" 24 | 25 | end 26 | -------------------------------------------------------------------------------- /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/index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { 3 | Platform, 4 | requireNativeComponent, 5 | UIManager, 6 | findNodeHandle, 7 | Image, 8 | ImageRequireSource, 9 | } from 'react-native'; 10 | 11 | const NativeRefreshControl = requireNativeComponent('LyRefreshControlView'); 12 | 13 | interface RefreshControlProps { 14 | idleSources: ImageRequireSource[]; 15 | refreshingSources: ImageRequireSource[]; 16 | refreshing: boolean; 17 | tintColor?: string; 18 | titleColor?: string; 19 | title?: string; 20 | enabled?: boolean; 21 | onRefresh?: () => void | Promise; 22 | } 23 | 24 | export default class LYRefreshControl extends React.Component { 25 | _nativeRef: any; 26 | _lastNativeRefreshing = false; 27 | 28 | componentDidMount() { 29 | this._lastNativeRefreshing = this.props.refreshing; 30 | } 31 | 32 | componentDidUpdate(prevProps: RefreshControlProps) { 33 | if (this.props.refreshing !== prevProps.refreshing) { 34 | this._lastNativeRefreshing = this.props.refreshing; 35 | } else if ( 36 | this.props.refreshing !== this._lastNativeRefreshing && 37 | this._nativeRef 38 | ) { 39 | UIManager.dispatchViewManagerCommand( 40 | this._getViewHandle(), 41 | this._getCommands().setNativeRefreshing, 42 | [this.props.refreshing] 43 | ); 44 | this._lastNativeRefreshing = this.props.refreshing; 45 | } 46 | } 47 | 48 | render() { 49 | if (Platform.OS === 'ios') { 50 | const { idleSources, refreshingSources, ...props } = this.props; 51 | const resolveIdleSources = idleSources.map((source) => { 52 | return ( 53 | Image.resolveAssetSource(source) || { 54 | uri: undefined, 55 | width: undefined, 56 | height: undefined, 57 | } 58 | ); 59 | }); 60 | 61 | const resolveRefreshingSources = refreshingSources.map((source) => { 62 | return ( 63 | Image.resolveAssetSource(source) || { 64 | uri: undefined, 65 | width: undefined, 66 | height: undefined, 67 | } 68 | ); 69 | }); 70 | 71 | return ( 72 | 80 | ); 81 | } else { 82 | return null; 83 | } 84 | } 85 | 86 | _onRefresh = () => { 87 | this._lastNativeRefreshing = true; 88 | this.props.onRefresh && this.props.onRefresh(); 89 | this.forceUpdate(); 90 | }; 91 | 92 | _setNativeRef = (ref: any) => { 93 | this._nativeRef = ref; 94 | }; 95 | 96 | // @ts-ignore 97 | _getCommands = () => UIManager.LyRefreshControlView.Commands; 98 | 99 | _getViewHandle = () => { 100 | return findNodeHandle(this._nativeRef); 101 | }; 102 | } 103 | -------------------------------------------------------------------------------- /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-ly-refresh-control": ["./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 | --------------------------------------------------------------------------------