├── .gitignore ├── .prettierrc ├── LICENSE ├── README.md ├── babel.config.js ├── example ├── .buckconfig ├── .editorconfig ├── .eslintrc.js ├── .gitattributes ├── .gitignore ├── .prettierrc.js ├── .watchmanconfig ├── README.md ├── android │ ├── app │ │ ├── _BUCK │ │ ├── build.gradle │ │ ├── build_defs.bzl │ │ ├── debug.keystore │ │ ├── proguard-rules.pro │ │ └── src │ │ │ ├── debug │ │ │ ├── AndroidManifest.xml │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── ReactNativeFlipper.kt │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ └── com │ │ │ │ └── example │ │ │ │ ├── MainActivity.kt │ │ │ │ └── MainApplication.kt │ │ │ └── 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.js ├── ios │ ├── Podfile │ ├── Podfile.lock │ ├── example.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ └── IDEWorkspaceChecks.plist │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── example.xcscheme │ ├── example.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ └── example │ │ ├── AppDelegate.swift │ │ ├── Images.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ └── Contents.json │ │ ├── Info.plist │ │ ├── LaunchScreen.storyboard │ │ └── example-Bridging-Header.h ├── metro.config.js ├── package.json ├── src │ ├── App.tsx │ └── services │ │ └── api │ │ └── api.ts ├── tsconfig.json └── yarn.lock ├── package.json ├── src ├── assets │ ├── ic_arrow_down.png │ └── ic_tick.png ├── components │ ├── Dropdown.props.ts │ └── Dropdown.tsx └── index.tsx ├── tsconfig.json └── yarn.lock /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | lerna-debug.log* 8 | 9 | # Diagnostic reports (https://nodejs.org/api/report.html) 10 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 11 | 12 | # Runtime data 13 | pids 14 | *.pid 15 | *.seed 16 | *.pid.lock 17 | 18 | # Directory for instrumented libs generated by jscoverage/JSCover 19 | lib-cov 20 | 21 | # Coverage directory used by tools like istanbul 22 | coverage 23 | *.lcov 24 | 25 | # nyc test coverage 26 | .nyc_output 27 | 28 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 29 | .grunt 30 | 31 | # Bower dependency directory (https://bower.io/) 32 | bower_components 33 | 34 | # node-waf configuration 35 | .lock-wscript 36 | 37 | # Compiled binary addons (https://nodejs.org/api/addons.html) 38 | build/Release 39 | 40 | # Dependency directories 41 | node_modules/ 42 | jspm_packages/ 43 | 44 | # TypeScript v1 declaration files 45 | typings/ 46 | 47 | # TypeScript cache 48 | *.tsbuildinfo 49 | 50 | # Optional npm cache directory 51 | .npm 52 | 53 | # Optional eslint cache 54 | .eslintcache 55 | 56 | # Microbundle cache 57 | .rpt2_cache/ 58 | .rts2_cache_cjs/ 59 | .rts2_cache_es/ 60 | .rts2_cache_umd/ 61 | 62 | # Optional REPL history 63 | .node_repl_history 64 | 65 | # Output of 'npm pack' 66 | *.tgz 67 | 68 | # Yarn Integrity file 69 | .yarn-integrity 70 | 71 | # dotenv environment variables file 72 | .env 73 | .env.test 74 | 75 | # parcel-bundler cache (https://parceljs.org/) 76 | .cache 77 | 78 | # Next.js build output 79 | .next 80 | 81 | # Nuxt.js build / generate output 82 | .nuxt 83 | dist 84 | 85 | # Gatsby files 86 | .cache/ 87 | # Comment in the public line in if your project uses Gatsby and *not* Next.js 88 | # https://nextjs.org/blog/next-9-1#public-directory-support 89 | # public 90 | 91 | # vuepress build output 92 | .vuepress/dist 93 | 94 | # Serverless directories 95 | .serverless/ 96 | 97 | # FuseBox cache 98 | .fusebox/ 99 | 100 | # DynamoDB Local files 101 | .dynamodb/ 102 | 103 | # TernJS port file 104 | .tern-port 105 | 106 | # lib 107 | lib 108 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "arrowParens": "avoid", 3 | "semi": false, 4 | "trailingComma": "es5", 5 | "endOfLine": "lf", 6 | "tabWidth": 2, 7 | "printWidth": 80, 8 | "useTabs": false, 9 | "singleQuote": true 10 | } 11 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Long Dao 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-dropdown-enhanced 2 | 3 | A simply **dropdown** | **selected** | **picker** | **combine searchable** for react native that works both for IOS and Android. 4 | 5 | ## Installation 6 | 7 | ### # Using yarn 8 | 9 | yarn add react-native-dropdown-enhanced 10 | 11 | ### # Using npm 12 | 13 | npm i react-native-dropdown-enhanced 14 | 15 | ## Demo 16 | 17 | Code provided in **Example** folder. 18 | 19 | 20 | 21 | ## Usage 22 | 23 | #### Simple usage 24 | 25 | ```js 26 | const data: Selected[] = [ 27 | {label: 'Ha Noi', value: 10}, 28 | {label: 'Ho Chi Minh', value: 11}, 29 | {label: 'Thai Binh', value: 12}, 30 | {label: 'Da Nang', value: 13}, 31 | {label: 'Da Lat', value: 14}, 32 | {label: 'Thanh Hoa', value: 15}, 33 | ]; 34 | 35 | const App = () => { 36 | return ( 37 | 39 | console.log(label)} 43 | /> 44 | 45 | ) 46 | } 47 | ``` 48 | 49 | #### Combine search 50 | 51 | ```js 52 | const App = () => { 53 | return ( 54 | 56 | console.log(label)} 60 | searchable 61 | /> 62 | 63 | ); 64 | }; 65 | ``` 66 | 67 | ## Props 68 | 69 | Updating... 70 | 71 | ## License 72 | 73 | [MIT](https://choosealicense.com/licenses/mit/) 74 | -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: ['module:metro-react-native-babel-preset'], 3 | } 4 | -------------------------------------------------------------------------------- /example/.buckconfig: -------------------------------------------------------------------------------- 1 | 2 | [android] 3 | target = Google Inc.:Google APIs:23 4 | 5 | [maven_repositories] 6 | central = https://repo1.maven.org/maven2 7 | -------------------------------------------------------------------------------- /example/.editorconfig: -------------------------------------------------------------------------------- 1 | # Windows files 2 | [*.bat] 3 | end_of_line = crlf 4 | -------------------------------------------------------------------------------- /example/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: ['@react-native-community', 'plugin:prettier/recommended'], 3 | plugins: ['simple-import-sort'], 4 | root: true, 5 | rules: { 6 | 'import/order': 'off', 7 | 'simple-import-sort/exports': 'error', 8 | 'simple-import-sort/imports': 'error', 9 | 'sort-imports': 'off', 10 | }, 11 | } 12 | -------------------------------------------------------------------------------- /example/.gitattributes: -------------------------------------------------------------------------------- 1 | # Windows files should use crlf line endings 2 | # https://help.github.com/articles/dealing-with-line-endings/ 3 | *.bat text eol=crlf 4 | -------------------------------------------------------------------------------- /example/.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # Xcode 6 | # 7 | build/ 8 | *.pbxuser 9 | !default.pbxuser 10 | *.mode1v3 11 | !default.mode1v3 12 | *.mode2v3 13 | !default.mode2v3 14 | *.perspectivev3 15 | !default.perspectivev3 16 | xcuserdata 17 | *.xccheckout 18 | *.moved-aside 19 | DerivedData 20 | *.hmap 21 | *.ipa 22 | *.xcuserstate 23 | 24 | # Android/IntelliJ 25 | # 26 | build/ 27 | .idea 28 | .gradle 29 | local.properties 30 | *.iml 31 | 32 | # node.js 33 | # 34 | node_modules/ 35 | npm-debug.log 36 | yarn-error.log 37 | 38 | # BUCK 39 | buck-out/ 40 | \.buckd/ 41 | *.keystore 42 | !debug.keystore 43 | 44 | # fastlane 45 | # 46 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 47 | # screenshots whenever they are needed. 48 | # For more information about the recommended setup visit: 49 | # https://docs.fastlane.tools/best-practices/source-control/ 50 | 51 | */fastlane/report.xml 52 | */fastlane/Preview.html 53 | */fastlane/screenshots 54 | 55 | # Bundle artifact 56 | *.jsbundle 57 | 58 | # CocoaPods 59 | /ios/Pods/ 60 | -------------------------------------------------------------------------------- /example/.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | jsxSingleQuote: true, 3 | semi: false, 4 | singleQuote: true, 5 | } 6 | -------------------------------------------------------------------------------- /example/.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /example/README.md: -------------------------------------------------------------------------------- 1 | # example 2 | 3 | ## Getting Started 4 | 5 | ```bash 6 | yarn 7 | ``` 8 | 9 | for iOS: 10 | 11 | ```bash 12 | npx pod-install 13 | ``` 14 | 15 | To run the app use: 16 | 17 | ```bash 18 | yarn ios 19 | ``` 20 | 21 | or 22 | 23 | ```bash 24 | yarn android 25 | ``` 26 | -------------------------------------------------------------------------------- /example/android/app/_BUCK: -------------------------------------------------------------------------------- 1 | # To learn about Buck see [Docs](https://buckbuild.com/). 2 | # To run your application with Buck: 3 | # - install Buck 4 | # - `npm start` - to start the packager 5 | # - `cd android` 6 | # - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"` 7 | # - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck 8 | # - `buck install -r android/app` - compile, install and run application 9 | # 10 | 11 | load(":build_defs.bzl", "create_aar_targets", "create_jar_targets") 12 | 13 | lib_deps = [] 14 | 15 | create_aar_targets(glob(["libs/*.aar"])) 16 | 17 | create_jar_targets(glob(["libs/*.jar"])) 18 | 19 | android_library( 20 | name = "all-libs", 21 | exported_deps = lib_deps, 22 | ) 23 | 24 | android_library( 25 | name = "app-code", 26 | srcs = glob([ 27 | "src/main/java/**/*.java", 28 | ]), 29 | deps = [ 30 | ":all-libs", 31 | ":build_config", 32 | ":res", 33 | ], 34 | ) 35 | 36 | android_build_config( 37 | name = "build_config", 38 | package = "com.example", 39 | ) 40 | 41 | android_resource( 42 | name = "res", 43 | package = "com.example", 44 | res = "src/main/res", 45 | ) 46 | 47 | android_binary( 48 | name = "app", 49 | keystore = "//android/keystores:debug", 50 | manifest = "src/main/AndroidManifest.xml", 51 | package_type = "debug", 52 | deps = [ 53 | ":app-code", 54 | ], 55 | ) 56 | -------------------------------------------------------------------------------- /example/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | apply plugin: 'kotlin-android' 3 | 4 | import com.android.build.OutputFile 5 | 6 | /** 7 | * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets 8 | * and bundleReleaseJsAndAssets). 9 | * These basically call `react-native bundle` with the correct arguments during the Android build 10 | * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the 11 | * bundle directly from the development server. Below you can see all the possible configurations 12 | * and their defaults. If you decide to add a configuration block, make sure to add it before the 13 | * `apply from: "../../node_modules/react-native/react.gradle"` line. 14 | * 15 | * project.ext.react = [ 16 | * // the name of the generated asset file containing your JS bundle 17 | * bundleAssetName: "index.android.bundle", 18 | * 19 | * // the entry file for bundle generation. If none specified and 20 | * // "index.android.js" exists, it will be used. Otherwise "index.js" is 21 | * // default. Can be overridden with ENTRY_FILE environment variable. 22 | * entryFile: "index.android.js", 23 | * 24 | * // https://reactnative.dev/docs/performance#enable-the-ram-format 25 | * bundleCommand: "ram-bundle", 26 | * 27 | * // whether to bundle JS and assets in debug mode 28 | * bundleInDebug: false, 29 | * 30 | * // whether to bundle JS and assets in release mode 31 | * bundleInRelease: true, 32 | * 33 | * // whether to bundle JS and assets in another build variant (if configured). 34 | * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants 35 | * // The configuration property can be in the following formats 36 | * // 'bundleIn${productFlavor}${buildType}' 37 | * // 'bundleIn${buildType}' 38 | * // bundleInFreeDebug: true, 39 | * // bundleInPaidRelease: true, 40 | * // bundleInBeta: true, 41 | * 42 | * // whether to disable dev mode in custom build variants (by default only disabled in release) 43 | * // for example: to disable dev mode in the staging build type (if configured) 44 | * devDisabledInStaging: true, 45 | * // The configuration property can be in the following formats 46 | * // 'devDisabledIn${productFlavor}${buildType}' 47 | * // 'devDisabledIn${buildType}' 48 | * 49 | * // the root of your project, i.e. where "package.json" lives 50 | * root: "../../", 51 | * 52 | * // where to put the JS bundle asset in debug mode 53 | * jsBundleDirDebug: "$buildDir/intermediates/assets/debug", 54 | * 55 | * // where to put the JS bundle asset in release mode 56 | * jsBundleDirRelease: "$buildDir/intermediates/assets/release", 57 | * 58 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 59 | * // require('./image.png')), in debug mode 60 | * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug", 61 | * 62 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 63 | * // require('./image.png')), in release mode 64 | * resourcesDirRelease: "$buildDir/intermediates/res/merged/release", 65 | * 66 | * // by default the gradle tasks are skipped if none of the JS files or assets change; this means 67 | * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to 68 | * // date; if you have any other folders that you want to ignore for performance reasons (gradle 69 | * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/ 70 | * // for example, you might want to remove it from here. 71 | * inputExcludes: ["android/**", "ios/**"], 72 | * 73 | * // override which node gets called and with what additional arguments 74 | * nodeExecutableAndArgs: ["node"], 75 | * 76 | * // supply additional arguments to the packager 77 | * extraPackagerArgs: [] 78 | * ] 79 | */ 80 | 81 | project.ext.react = [ 82 | enableHermes: false, // clean and rebuild if changing 83 | ] 84 | 85 | apply from: '../../node_modules/react-native/react.gradle' 86 | 87 | /** 88 | * Set this to true to create two separate APKs instead of one: 89 | * - An APK that only works on ARM devices 90 | * - An APK that only works on x86 devices 91 | * The advantage is the size of the APK is reduced by about 4MB. 92 | * Upload all the APKs to the Play Store and people will download 93 | * the correct one based on the CPU architecture of their device. 94 | */ 95 | def enableSeparateBuildPerCPUArchitecture = false 96 | 97 | /** 98 | * Run Proguard to shrink the Java bytecode in release builds. 99 | */ 100 | def enableProguardInReleaseBuilds = false 101 | 102 | /** 103 | * The preferred build flavor of JavaScriptCore. 104 | * 105 | * For example, to use the international variant, you can use: 106 | * `def jscFlavor = 'org.webkit:android-jsc-intl:+'` 107 | * 108 | * The international variant includes ICU i18n library and necessary data 109 | * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that 110 | * give correct results when using with locales other than en-US. Note that 111 | * this variant is about 6MiB larger per architecture than default. 112 | */ 113 | def jscFlavor = 'org.webkit:android-jsc:+' 114 | 115 | /** 116 | * Whether to enable the Hermes VM. 117 | * 118 | * This should be set on project.ext.react and mirrored here. If it is not set 119 | * on project.ext.react, JavaScript will not be compiled to Hermes Bytecode 120 | * and the benefits of using Hermes will therefore be sharply reduced. 121 | */ 122 | def enableHermes = project.ext.react.get('enableHermes', false); 123 | 124 | android { 125 | ndkVersion rootProject.ext.ndkVersion 126 | 127 | compileSdkVersion rootProject.ext.compileSdkVersion 128 | 129 | compileOptions { 130 | sourceCompatibility JavaVersion.VERSION_1_8 131 | targetCompatibility JavaVersion.VERSION_1_8 132 | } 133 | 134 | defaultConfig { 135 | applicationId 'com.example' 136 | minSdkVersion rootProject.ext.minSdkVersion 137 | targetSdkVersion rootProject.ext.targetSdkVersion 138 | versionCode 1 139 | versionName '1.0' 140 | } 141 | splits { 142 | abi { 143 | reset() 144 | enable enableSeparateBuildPerCPUArchitecture 145 | universalApk false // If true, also generate a universal APK 146 | include 'armeabi-v7a', 'x86', 'arm64-v8a', 'x86_64' 147 | } 148 | } 149 | signingConfigs { 150 | debug { 151 | storeFile file('debug.keystore') 152 | storePassword 'android' 153 | keyAlias 'androiddebugkey' 154 | keyPassword 'android' 155 | } 156 | } 157 | buildTypes { 158 | debug { 159 | signingConfig signingConfigs.debug 160 | } 161 | release { 162 | // Caution! In production, you need to generate your own keystore file. 163 | // see https://reactnative.dev/docs/signed-apk-android. 164 | signingConfig signingConfigs.debug 165 | minifyEnabled enableProguardInReleaseBuilds 166 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 167 | } 168 | } 169 | 170 | // applicationVariants are e.g. debug, release 171 | applicationVariants.all { variant -> 172 | variant.outputs.each { output -> 173 | // For each separate APK per architecture, set a unique version code as described here: 174 | // https://developer.android.com/studio/build/configure-apk-splits.html 175 | // Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc. 176 | def versionCodes = ['armeabi-v7a': 1, 'x86': 2, 'arm64-v8a': 3, 'x86_64': 4] 177 | def abi = output.getFilter(OutputFile.ABI) 178 | if (abi != null) { // null for the universal-debug, universal-release variants 179 | output.versionCodeOverride = 180 | defaultConfig.versionCode * 1000 + versionCodes.get(abi) 181 | } 182 | 183 | } 184 | } 185 | } 186 | 187 | dependencies { 188 | implementation project(':react-native-module-template') 189 | implementation fileTree(dir: 'libs', include: ['*.jar']) 190 | //noinspection GradleDynamicVersion 191 | implementation 'com.facebook.react:react-native:+' // From node_modules 192 | 193 | implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0' 194 | 195 | debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") { 196 | exclude group: 'com.facebook.fbjni' 197 | } 198 | 199 | debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") { 200 | exclude group: 'com.facebook.flipper' 201 | exclude group: 'com.squareup.okhttp3', module: 'okhttp' 202 | } 203 | 204 | debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") { 205 | exclude group: 'com.facebook.flipper' 206 | } 207 | 208 | if (enableHermes) { 209 | def hermesPath = '../../node_modules/hermes-engine/android/'; 210 | debugImplementation files(hermesPath + 'hermes-debug.aar') 211 | releaseImplementation files(hermesPath + 'hermes-release.aar') 212 | } else { 213 | implementation jscFlavor 214 | } 215 | } 216 | 217 | // Run this once to be able to run the application with BUCK 218 | // puts all compile dependencies into folder libs for BUCK to use 219 | task copyDownloadableDepsToLibs(type: Copy) { 220 | from configurations.compile 221 | into 'libs' 222 | } 223 | 224 | apply from: file('../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle'); applyNativeModulesAppBuildGradle(project) 225 | -------------------------------------------------------------------------------- /example/android/app/build_defs.bzl: -------------------------------------------------------------------------------- 1 | """Helper definitions to glob .aar and .jar targets""" 2 | 3 | def create_aar_targets(aarfiles): 4 | for aarfile in aarfiles: 5 | name = "aars__" + aarfile[aarfile.rindex("/") + 1:aarfile.rindex(".aar")] 6 | lib_deps.append(":" + name) 7 | android_prebuilt_aar( 8 | name = name, 9 | aar = aarfile, 10 | ) 11 | 12 | def create_jar_targets(jarfiles): 13 | for jarfile in jarfiles: 14 | name = "jars__" + jarfile[jarfile.rindex("/") + 1:jarfile.rindex(".jar")] 15 | lib_deps.append(":" + name) 16 | prebuilt_jar( 17 | name = name, 18 | binary_jar = jarfile, 19 | ) 20 | -------------------------------------------------------------------------------- /example/android/app/debug.keystore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lngdao/react-native-dropdown-enhanced/6d0af29d0753f1172ab8add9fce37ceb4ad06dc0/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 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /example/android/app/src/debug/java/com/example/ReactNativeFlipper.kt: -------------------------------------------------------------------------------- 1 | package com.example 2 | 3 | import android.content.Context 4 | import com.facebook.flipper.android.AndroidFlipperClient 5 | import com.facebook.flipper.android.utils.FlipperUtils 6 | import com.facebook.flipper.plugins.crashreporter.CrashReporterPlugin 7 | import com.facebook.flipper.plugins.databases.DatabasesFlipperPlugin 8 | import com.facebook.flipper.plugins.fresco.FrescoFlipperPlugin 9 | import com.facebook.flipper.plugins.inspector.DescriptorMapping 10 | import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin 11 | import com.facebook.flipper.plugins.network.FlipperOkhttpInterceptor 12 | import com.facebook.flipper.plugins.network.NetworkFlipperPlugin 13 | import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin 14 | import com.facebook.react.ReactInstanceManager 15 | import com.facebook.react.ReactInstanceManager.ReactInstanceEventListener 16 | import com.facebook.react.bridge.ReactContext 17 | import com.facebook.react.modules.network.NetworkingModule 18 | 19 | object ReactNativeFlipper { 20 | @JvmStatic 21 | fun initializeFlipper(context: Context?, reactInstanceManager: ReactInstanceManager) { 22 | if (FlipperUtils.shouldEnableFlipper(context)) { 23 | val client = AndroidFlipperClient.getInstance(context) 24 | client.addPlugin(InspectorFlipperPlugin(context, DescriptorMapping.withDefaults())) 25 | client.addPlugin(DatabasesFlipperPlugin(context)) 26 | client.addPlugin(SharedPreferencesFlipperPlugin(context)) 27 | client.addPlugin(CrashReporterPlugin.getInstance()) 28 | val networkFlipperPlugin = NetworkFlipperPlugin() 29 | NetworkingModule.setCustomClientBuilder { builder -> builder.addNetworkInterceptor(FlipperOkhttpInterceptor(networkFlipperPlugin)) } 30 | client.addPlugin(networkFlipperPlugin) 31 | client.start() 32 | 33 | // Fresco Plugin needs to ensure that ImagePipelineFactory is initialized 34 | // Hence we run if after all native modules have been initialized 35 | val reactContext = reactInstanceManager.currentReactContext 36 | if (reactContext == null) { 37 | reactInstanceManager.addReactInstanceEventListener( 38 | object : ReactInstanceEventListener { 39 | override fun onReactContextInitialized(reactContext: ReactContext) { 40 | reactInstanceManager.removeReactInstanceEventListener(this) 41 | reactContext.runOnNativeModulesQueueThread { client.addPlugin(FrescoFlipperPlugin()) } 42 | } 43 | }) 44 | } else { 45 | client.addPlugin(FrescoFlipperPlugin()) 46 | } 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 13 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/com/example/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.example 2 | 3 | import com.facebook.react.ReactActivity 4 | 5 | class MainActivity : ReactActivity() { 6 | 7 | override fun getMainComponentName(): String? { 8 | return "example" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/com/example/MainApplication.kt: -------------------------------------------------------------------------------- 1 | package com.example 2 | 3 | import android.app.Application 4 | import android.content.Context 5 | import com.alexdemchenko.reactnativemoduletemplate.RNModuleTemplatePackage 6 | import com.facebook.react.* 7 | import com.facebook.soloader.SoLoader 8 | import java.lang.reflect.InvocationTargetException 9 | 10 | class MainApplication : Application(), ReactApplication { 11 | 12 | private val mReactNativeHost = object : ReactNativeHost(this) { 13 | override fun getUseDeveloperSupport(): Boolean { 14 | return BuildConfig.DEBUG 15 | } 16 | 17 | override fun getPackages(): List { 18 | val packages = PackageList(this).packages 19 | // Packages that cannot be autolinked yet can be added manually here, for example: 20 | // packages.add(MyReactNativePackage()); 21 | packages.add(RNModuleTemplatePackage()) 22 | return packages 23 | } 24 | 25 | override fun getJSMainModuleName(): String { 26 | return "index" 27 | } 28 | } 29 | 30 | override fun getReactNativeHost(): ReactNativeHost { 31 | return mReactNativeHost 32 | } 33 | 34 | override fun onCreate() { 35 | super.onCreate() 36 | SoLoader.init(this, false) 37 | initializeFlipper(this, reactNativeHost.reactInstanceManager) 38 | } 39 | 40 | companion object { 41 | 42 | private fun initializeFlipper(context: Context, reactInstanceManager: ReactInstanceManager) { 43 | if (BuildConfig.DEBUG) { 44 | try { 45 | val aClass = Class.forName("com.example.ReactNativeFlipper") 46 | aClass 47 | .getMethod("initializeFlipper", Context::class.java, ReactInstanceManager::class.java) 48 | .invoke(null, context, reactInstanceManager) 49 | } catch (e: ClassNotFoundException) { 50 | e.printStackTrace() 51 | } catch (e: NoSuchMethodException) { 52 | e.printStackTrace() 53 | } catch (e: IllegalAccessException) { 54 | e.printStackTrace() 55 | } catch (e: InvocationTargetException) { 56 | e.printStackTrace() 57 | } 58 | } 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lngdao/react-native-dropdown-enhanced/6d0af29d0753f1172ab8add9fce37ceb4ad06dc0/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/lngdao/react-native-dropdown-enhanced/6d0af29d0753f1172ab8add9fce37ceb4ad06dc0/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/lngdao/react-native-dropdown-enhanced/6d0af29d0753f1172ab8add9fce37ceb4ad06dc0/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/lngdao/react-native-dropdown-enhanced/6d0af29d0753f1172ab8add9fce37ceb4ad06dc0/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/lngdao/react-native-dropdown-enhanced/6d0af29d0753f1172ab8add9fce37ceb4ad06dc0/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/lngdao/react-native-dropdown-enhanced/6d0af29d0753f1172ab8add9fce37ceb4ad06dc0/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/lngdao/react-native-dropdown-enhanced/6d0af29d0753f1172ab8add9fce37ceb4ad06dc0/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/lngdao/react-native-dropdown-enhanced/6d0af29d0753f1172ab8add9fce37ceb4ad06dc0/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/lngdao/react-native-dropdown-enhanced/6d0af29d0753f1172ab8add9fce37ceb4ad06dc0/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/lngdao/react-native-dropdown-enhanced/6d0af29d0753f1172ab8add9fce37ceb4ad06dc0/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | example 3 | 4 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /example/android/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | ext { 5 | buildToolsVersion = '30.0.3' 6 | minSdkVersion = 21 7 | compileSdkVersion = 30 8 | targetSdkVersion = 30 9 | kotlinVersion = '1.5.20' 10 | ndkVersion = '22.1.7171670' 11 | } 12 | repositories { 13 | google() 14 | jcenter() 15 | } 16 | dependencies { 17 | classpath 'com.android.tools.build:gradle:4.2.2' 18 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion" 19 | // NOTE: Do not place your application dependencies here; they belong 20 | // in the individual module build.gradle files 21 | } 22 | } 23 | 24 | allprojects { 25 | repositories { 26 | mavenLocal() 27 | maven { 28 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm 29 | url "$rootDir/../node_modules/react-native/android" 30 | } 31 | maven { 32 | // Android JSC is installed from npm 33 | url "$rootDir/../node_modules/jsc-android/dist" 34 | } 35 | 36 | google() 37 | jcenter() 38 | maven { url 'https://www.jitpack.io' } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /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 | # AndroidX package structure to make it clearer which packages are bundled with the 21 | # Android operating system, and which are packaged with your app's APK 22 | # https://developer.android.com/topic/libraries/support-library/androidx-rn 23 | android.useAndroidX=true 24 | # Automatically convert third-party libraries to use AndroidX 25 | android.enableJetifier=true 26 | 27 | # Version of flipper SDK to use with React Native 28 | FLIPPER_VERSION=0.87.0 29 | -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lngdao/react-native-dropdown-enhanced/6d0af29d0753f1172ab8add9fce37ceb4ad06dc0/example/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-all.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /example/android/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | # 4 | # Copyright 2015 the original author or authors. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # https://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ############################################################################## 20 | ## 21 | ## Gradle start up script for UN*X 22 | ## 23 | ############################################################################## 24 | 25 | # Attempt to set APP_HOME 26 | # Resolve links: $0 may be a link 27 | PRG="$0" 28 | # Need this for relative symlinks. 29 | while [ -h "$PRG" ] ; do 30 | ls=`ls -ld "$PRG"` 31 | link=`expr "$ls" : '.*-> \(.*\)$'` 32 | if expr "$link" : '/.*' > /dev/null; then 33 | PRG="$link" 34 | else 35 | PRG=`dirname "$PRG"`"/$link" 36 | fi 37 | done 38 | SAVED="`pwd`" 39 | cd "`dirname \"$PRG\"`/" >/dev/null 40 | APP_HOME="`pwd -P`" 41 | cd "$SAVED" >/dev/null 42 | 43 | APP_NAME="Gradle" 44 | APP_BASE_NAME=`basename "$0"` 45 | 46 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 47 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' 48 | 49 | # Use the maximum available, or set MAX_FD != -1 to use that value. 50 | MAX_FD="maximum" 51 | 52 | warn () { 53 | echo "$*" 54 | } 55 | 56 | die () { 57 | echo 58 | echo "$*" 59 | echo 60 | exit 1 61 | } 62 | 63 | # OS specific support (must be 'true' or 'false'). 64 | cygwin=false 65 | msys=false 66 | darwin=false 67 | nonstop=false 68 | case "`uname`" in 69 | CYGWIN* ) 70 | cygwin=true 71 | ;; 72 | Darwin* ) 73 | darwin=true 74 | ;; 75 | MINGW* ) 76 | msys=true 77 | ;; 78 | NONSTOP* ) 79 | nonstop=true 80 | ;; 81 | esac 82 | 83 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 84 | 85 | 86 | # Determine the Java command to use to start the JVM. 87 | if [ -n "$JAVA_HOME" ] ; then 88 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 89 | # IBM's JDK on AIX uses strange locations for the executables 90 | JAVACMD="$JAVA_HOME/jre/sh/java" 91 | else 92 | JAVACMD="$JAVA_HOME/bin/java" 93 | fi 94 | if [ ! -x "$JAVACMD" ] ; then 95 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 96 | 97 | Please set the JAVA_HOME variable in your environment to match the 98 | location of your Java installation." 99 | fi 100 | else 101 | JAVACMD="java" 102 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 103 | 104 | Please set the JAVA_HOME variable in your environment to match the 105 | location of your Java installation." 106 | fi 107 | 108 | # Increase the maximum file descriptors if we can. 109 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 110 | MAX_FD_LIMIT=`ulimit -H -n` 111 | if [ $? -eq 0 ] ; then 112 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 113 | MAX_FD="$MAX_FD_LIMIT" 114 | fi 115 | ulimit -n $MAX_FD 116 | if [ $? -ne 0 ] ; then 117 | warn "Could not set maximum file descriptor limit: $MAX_FD" 118 | fi 119 | else 120 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 121 | fi 122 | fi 123 | 124 | # For Darwin, add options to specify how the application appears in the dock 125 | if $darwin; then 126 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 127 | fi 128 | 129 | # For Cygwin or MSYS, switch paths to Windows format before running java 130 | if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then 131 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 132 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 133 | 134 | JAVACMD=`cygpath --unix "$JAVACMD"` 135 | 136 | # We build the pattern for arguments to be converted via cygpath 137 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 138 | SEP="" 139 | for dir in $ROOTDIRSRAW ; do 140 | ROOTDIRS="$ROOTDIRS$SEP$dir" 141 | SEP="|" 142 | done 143 | OURCYGPATTERN="(^($ROOTDIRS))" 144 | # Add a user-defined pattern to the cygpath arguments 145 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 146 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 147 | fi 148 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 149 | i=0 150 | for arg in "$@" ; do 151 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 152 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 153 | 154 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 155 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 156 | else 157 | eval `echo args$i`="\"$arg\"" 158 | fi 159 | i=`expr $i + 1` 160 | done 161 | case $i in 162 | 0) set -- ;; 163 | 1) set -- "$args0" ;; 164 | 2) set -- "$args0" "$args1" ;; 165 | 3) set -- "$args0" "$args1" "$args2" ;; 166 | 4) set -- "$args0" "$args1" "$args2" "$args3" ;; 167 | 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 168 | 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 169 | 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 170 | 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 171 | 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 172 | esac 173 | fi 174 | 175 | # Escape application args 176 | save () { 177 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done 178 | echo " " 179 | } 180 | APP_ARGS=`save "$@"` 181 | 182 | # Collect all arguments for the java command, following the shell quoting and substitution rules 183 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" 184 | 185 | exec "$JAVACMD" "$@" 186 | -------------------------------------------------------------------------------- /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 https://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 execute 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 execute 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 | :execute 68 | @rem Setup the command line 69 | 70 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 71 | 72 | 73 | @rem Execute Gradle 74 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* 75 | 76 | :end 77 | @rem End local scope for the variables with windows NT shell 78 | if "%ERRORLEVEL%"=="0" goto mainEnd 79 | 80 | :fail 81 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 82 | rem the _cmd.exe /c_ return code! 83 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 84 | exit /b 1 85 | 86 | :mainEnd 87 | if "%OS%"=="Windows_NT" endlocal 88 | 89 | :omega 90 | -------------------------------------------------------------------------------- /example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'example' 2 | apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings) 3 | 4 | include ':react-native-module-template' 5 | project(':react-native-module-template').projectDir = new File(rootProject.projectDir, '../../android') 6 | 7 | include ':app' 8 | -------------------------------------------------------------------------------- /example/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "example", 3 | "displayName": "example" 4 | } 5 | -------------------------------------------------------------------------------- /example/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: ['module:metro-react-native-babel-preset'], 3 | } 4 | -------------------------------------------------------------------------------- /example/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @format 3 | */ 4 | 5 | import { AppRegistry } from 'react-native' 6 | 7 | import { name as appName } from './app.json' 8 | import App from './src/App' 9 | 10 | AppRegistry.registerComponent(appName, () => App) 11 | -------------------------------------------------------------------------------- /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 'example' do 7 | config = use_native_modules! 8 | 9 | use_react_native!( 10 | :path => config[:reactNativePath], 11 | # to enable hermes on iOS, change `false` to `true` and then install pods 12 | :hermes_enabled => false 13 | ) 14 | 15 | # Enables Flipper. 16 | # 17 | # Note that if you have use_frameworks! enabled, Flipper will not work and 18 | # you should disable the next line. 19 | use_flipper!({ 'Flipper' => '0.87.0' }) 20 | 21 | post_install do |installer| 22 | react_native_post_install(installer) 23 | end 24 | end 25 | -------------------------------------------------------------------------------- /example/ios/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - boost-for-react-native (1.63.0) 3 | - CocoaAsyncSocket (7.6.5) 4 | - DoubleConversion (1.1.6) 5 | - FBLazyVector (0.64.2) 6 | - FBReactNativeSpec (0.64.2): 7 | - RCT-Folly (= 2020.01.13.00) 8 | - RCTRequired (= 0.64.2) 9 | - RCTTypeSafety (= 0.64.2) 10 | - React-Core (= 0.64.2) 11 | - React-jsi (= 0.64.2) 12 | - ReactCommon/turbomodule/core (= 0.64.2) 13 | - Flipper (0.87.0): 14 | - Flipper-Folly (~> 2.5) 15 | - Flipper-RSocket (~> 1.3) 16 | - Flipper-DoubleConversion (1.1.7) 17 | - Flipper-Folly (2.5.3): 18 | - boost-for-react-native 19 | - Flipper-DoubleConversion 20 | - Flipper-Glog 21 | - libevent (~> 2.1.12) 22 | - OpenSSL-Universal (= 1.1.180) 23 | - Flipper-Glog (0.3.6) 24 | - Flipper-PeerTalk (0.0.4) 25 | - Flipper-RSocket (1.3.1): 26 | - Flipper-Folly (~> 2.5) 27 | - FlipperKit (0.87.0): 28 | - FlipperKit/Core (= 0.87.0) 29 | - FlipperKit/Core (0.87.0): 30 | - Flipper (~> 0.87.0) 31 | - FlipperKit/CppBridge 32 | - FlipperKit/FBCxxFollyDynamicConvert 33 | - FlipperKit/FBDefines 34 | - FlipperKit/FKPortForwarding 35 | - FlipperKit/CppBridge (0.87.0): 36 | - Flipper (~> 0.87.0) 37 | - FlipperKit/FBCxxFollyDynamicConvert (0.87.0): 38 | - Flipper-Folly (~> 2.5) 39 | - FlipperKit/FBDefines (0.87.0) 40 | - FlipperKit/FKPortForwarding (0.87.0): 41 | - CocoaAsyncSocket (~> 7.6) 42 | - Flipper-PeerTalk (~> 0.0.4) 43 | - FlipperKit/FlipperKitHighlightOverlay (0.87.0) 44 | - FlipperKit/FlipperKitLayoutHelpers (0.87.0): 45 | - FlipperKit/Core 46 | - FlipperKit/FlipperKitHighlightOverlay 47 | - FlipperKit/FlipperKitLayoutTextSearchable 48 | - FlipperKit/FlipperKitLayoutIOSDescriptors (0.87.0): 49 | - FlipperKit/Core 50 | - FlipperKit/FlipperKitHighlightOverlay 51 | - FlipperKit/FlipperKitLayoutHelpers 52 | - YogaKit (~> 1.18) 53 | - FlipperKit/FlipperKitLayoutPlugin (0.87.0): 54 | - FlipperKit/Core 55 | - FlipperKit/FlipperKitHighlightOverlay 56 | - FlipperKit/FlipperKitLayoutHelpers 57 | - FlipperKit/FlipperKitLayoutIOSDescriptors 58 | - FlipperKit/FlipperKitLayoutTextSearchable 59 | - YogaKit (~> 1.18) 60 | - FlipperKit/FlipperKitLayoutTextSearchable (0.87.0) 61 | - FlipperKit/FlipperKitNetworkPlugin (0.87.0): 62 | - FlipperKit/Core 63 | - FlipperKit/FlipperKitReactPlugin (0.87.0): 64 | - FlipperKit/Core 65 | - FlipperKit/FlipperKitUserDefaultsPlugin (0.87.0): 66 | - FlipperKit/Core 67 | - FlipperKit/SKIOSNetworkPlugin (0.87.0): 68 | - FlipperKit/Core 69 | - FlipperKit/FlipperKitNetworkPlugin 70 | - glog (0.3.5) 71 | - libevent (2.1.12) 72 | - OpenSSL-Universal (1.1.180) 73 | - RCT-Folly (2020.01.13.00): 74 | - boost-for-react-native 75 | - DoubleConversion 76 | - glog 77 | - RCT-Folly/Default (= 2020.01.13.00) 78 | - RCT-Folly/Default (2020.01.13.00): 79 | - boost-for-react-native 80 | - DoubleConversion 81 | - glog 82 | - RCTRequired (0.64.2) 83 | - RCTTypeSafety (0.64.2): 84 | - FBLazyVector (= 0.64.2) 85 | - RCT-Folly (= 2020.01.13.00) 86 | - RCTRequired (= 0.64.2) 87 | - React-Core (= 0.64.2) 88 | - React (0.64.2): 89 | - React-Core (= 0.64.2) 90 | - React-Core/DevSupport (= 0.64.2) 91 | - React-Core/RCTWebSocket (= 0.64.2) 92 | - React-RCTActionSheet (= 0.64.2) 93 | - React-RCTAnimation (= 0.64.2) 94 | - React-RCTBlob (= 0.64.2) 95 | - React-RCTImage (= 0.64.2) 96 | - React-RCTLinking (= 0.64.2) 97 | - React-RCTNetwork (= 0.64.2) 98 | - React-RCTSettings (= 0.64.2) 99 | - React-RCTText (= 0.64.2) 100 | - React-RCTVibration (= 0.64.2) 101 | - React-callinvoker (0.64.2) 102 | - React-Core (0.64.2): 103 | - glog 104 | - RCT-Folly (= 2020.01.13.00) 105 | - React-Core/Default (= 0.64.2) 106 | - React-cxxreact (= 0.64.2) 107 | - React-jsi (= 0.64.2) 108 | - React-jsiexecutor (= 0.64.2) 109 | - React-perflogger (= 0.64.2) 110 | - Yoga 111 | - React-Core/CoreModulesHeaders (0.64.2): 112 | - glog 113 | - RCT-Folly (= 2020.01.13.00) 114 | - React-Core/Default 115 | - React-cxxreact (= 0.64.2) 116 | - React-jsi (= 0.64.2) 117 | - React-jsiexecutor (= 0.64.2) 118 | - React-perflogger (= 0.64.2) 119 | - Yoga 120 | - React-Core/Default (0.64.2): 121 | - glog 122 | - RCT-Folly (= 2020.01.13.00) 123 | - React-cxxreact (= 0.64.2) 124 | - React-jsi (= 0.64.2) 125 | - React-jsiexecutor (= 0.64.2) 126 | - React-perflogger (= 0.64.2) 127 | - Yoga 128 | - React-Core/DevSupport (0.64.2): 129 | - glog 130 | - RCT-Folly (= 2020.01.13.00) 131 | - React-Core/Default (= 0.64.2) 132 | - React-Core/RCTWebSocket (= 0.64.2) 133 | - React-cxxreact (= 0.64.2) 134 | - React-jsi (= 0.64.2) 135 | - React-jsiexecutor (= 0.64.2) 136 | - React-jsinspector (= 0.64.2) 137 | - React-perflogger (= 0.64.2) 138 | - Yoga 139 | - React-Core/RCTActionSheetHeaders (0.64.2): 140 | - glog 141 | - RCT-Folly (= 2020.01.13.00) 142 | - React-Core/Default 143 | - React-cxxreact (= 0.64.2) 144 | - React-jsi (= 0.64.2) 145 | - React-jsiexecutor (= 0.64.2) 146 | - React-perflogger (= 0.64.2) 147 | - Yoga 148 | - React-Core/RCTAnimationHeaders (0.64.2): 149 | - glog 150 | - RCT-Folly (= 2020.01.13.00) 151 | - React-Core/Default 152 | - React-cxxreact (= 0.64.2) 153 | - React-jsi (= 0.64.2) 154 | - React-jsiexecutor (= 0.64.2) 155 | - React-perflogger (= 0.64.2) 156 | - Yoga 157 | - React-Core/RCTBlobHeaders (0.64.2): 158 | - glog 159 | - RCT-Folly (= 2020.01.13.00) 160 | - React-Core/Default 161 | - React-cxxreact (= 0.64.2) 162 | - React-jsi (= 0.64.2) 163 | - React-jsiexecutor (= 0.64.2) 164 | - React-perflogger (= 0.64.2) 165 | - Yoga 166 | - React-Core/RCTImageHeaders (0.64.2): 167 | - glog 168 | - RCT-Folly (= 2020.01.13.00) 169 | - React-Core/Default 170 | - React-cxxreact (= 0.64.2) 171 | - React-jsi (= 0.64.2) 172 | - React-jsiexecutor (= 0.64.2) 173 | - React-perflogger (= 0.64.2) 174 | - Yoga 175 | - React-Core/RCTLinkingHeaders (0.64.2): 176 | - glog 177 | - RCT-Folly (= 2020.01.13.00) 178 | - React-Core/Default 179 | - React-cxxreact (= 0.64.2) 180 | - React-jsi (= 0.64.2) 181 | - React-jsiexecutor (= 0.64.2) 182 | - React-perflogger (= 0.64.2) 183 | - Yoga 184 | - React-Core/RCTNetworkHeaders (0.64.2): 185 | - glog 186 | - RCT-Folly (= 2020.01.13.00) 187 | - React-Core/Default 188 | - React-cxxreact (= 0.64.2) 189 | - React-jsi (= 0.64.2) 190 | - React-jsiexecutor (= 0.64.2) 191 | - React-perflogger (= 0.64.2) 192 | - Yoga 193 | - React-Core/RCTSettingsHeaders (0.64.2): 194 | - glog 195 | - RCT-Folly (= 2020.01.13.00) 196 | - React-Core/Default 197 | - React-cxxreact (= 0.64.2) 198 | - React-jsi (= 0.64.2) 199 | - React-jsiexecutor (= 0.64.2) 200 | - React-perflogger (= 0.64.2) 201 | - Yoga 202 | - React-Core/RCTTextHeaders (0.64.2): 203 | - glog 204 | - RCT-Folly (= 2020.01.13.00) 205 | - React-Core/Default 206 | - React-cxxreact (= 0.64.2) 207 | - React-jsi (= 0.64.2) 208 | - React-jsiexecutor (= 0.64.2) 209 | - React-perflogger (= 0.64.2) 210 | - Yoga 211 | - React-Core/RCTVibrationHeaders (0.64.2): 212 | - glog 213 | - RCT-Folly (= 2020.01.13.00) 214 | - React-Core/Default 215 | - React-cxxreact (= 0.64.2) 216 | - React-jsi (= 0.64.2) 217 | - React-jsiexecutor (= 0.64.2) 218 | - React-perflogger (= 0.64.2) 219 | - Yoga 220 | - React-Core/RCTWebSocket (0.64.2): 221 | - glog 222 | - RCT-Folly (= 2020.01.13.00) 223 | - React-Core/Default (= 0.64.2) 224 | - React-cxxreact (= 0.64.2) 225 | - React-jsi (= 0.64.2) 226 | - React-jsiexecutor (= 0.64.2) 227 | - React-perflogger (= 0.64.2) 228 | - Yoga 229 | - React-CoreModules (0.64.2): 230 | - FBReactNativeSpec (= 0.64.2) 231 | - RCT-Folly (= 2020.01.13.00) 232 | - RCTTypeSafety (= 0.64.2) 233 | - React-Core/CoreModulesHeaders (= 0.64.2) 234 | - React-jsi (= 0.64.2) 235 | - React-RCTImage (= 0.64.2) 236 | - ReactCommon/turbomodule/core (= 0.64.2) 237 | - React-cxxreact (0.64.2): 238 | - boost-for-react-native (= 1.63.0) 239 | - DoubleConversion 240 | - glog 241 | - RCT-Folly (= 2020.01.13.00) 242 | - React-callinvoker (= 0.64.2) 243 | - React-jsi (= 0.64.2) 244 | - React-jsinspector (= 0.64.2) 245 | - React-perflogger (= 0.64.2) 246 | - React-runtimeexecutor (= 0.64.2) 247 | - React-jsi (0.64.2): 248 | - boost-for-react-native (= 1.63.0) 249 | - DoubleConversion 250 | - glog 251 | - RCT-Folly (= 2020.01.13.00) 252 | - React-jsi/Default (= 0.64.2) 253 | - React-jsi/Default (0.64.2): 254 | - boost-for-react-native (= 1.63.0) 255 | - DoubleConversion 256 | - glog 257 | - RCT-Folly (= 2020.01.13.00) 258 | - React-jsiexecutor (0.64.2): 259 | - DoubleConversion 260 | - glog 261 | - RCT-Folly (= 2020.01.13.00) 262 | - React-cxxreact (= 0.64.2) 263 | - React-jsi (= 0.64.2) 264 | - React-perflogger (= 0.64.2) 265 | - React-jsinspector (0.64.2) 266 | - React-perflogger (0.64.2) 267 | - React-RCTActionSheet (0.64.2): 268 | - React-Core/RCTActionSheetHeaders (= 0.64.2) 269 | - React-RCTAnimation (0.64.2): 270 | - FBReactNativeSpec (= 0.64.2) 271 | - RCT-Folly (= 2020.01.13.00) 272 | - RCTTypeSafety (= 0.64.2) 273 | - React-Core/RCTAnimationHeaders (= 0.64.2) 274 | - React-jsi (= 0.64.2) 275 | - ReactCommon/turbomodule/core (= 0.64.2) 276 | - React-RCTBlob (0.64.2): 277 | - FBReactNativeSpec (= 0.64.2) 278 | - RCT-Folly (= 2020.01.13.00) 279 | - React-Core/RCTBlobHeaders (= 0.64.2) 280 | - React-Core/RCTWebSocket (= 0.64.2) 281 | - React-jsi (= 0.64.2) 282 | - React-RCTNetwork (= 0.64.2) 283 | - ReactCommon/turbomodule/core (= 0.64.2) 284 | - React-RCTImage (0.64.2): 285 | - FBReactNativeSpec (= 0.64.2) 286 | - RCT-Folly (= 2020.01.13.00) 287 | - RCTTypeSafety (= 0.64.2) 288 | - React-Core/RCTImageHeaders (= 0.64.2) 289 | - React-jsi (= 0.64.2) 290 | - React-RCTNetwork (= 0.64.2) 291 | - ReactCommon/turbomodule/core (= 0.64.2) 292 | - React-RCTLinking (0.64.2): 293 | - FBReactNativeSpec (= 0.64.2) 294 | - React-Core/RCTLinkingHeaders (= 0.64.2) 295 | - React-jsi (= 0.64.2) 296 | - ReactCommon/turbomodule/core (= 0.64.2) 297 | - React-RCTNetwork (0.64.2): 298 | - FBReactNativeSpec (= 0.64.2) 299 | - RCT-Folly (= 2020.01.13.00) 300 | - RCTTypeSafety (= 0.64.2) 301 | - React-Core/RCTNetworkHeaders (= 0.64.2) 302 | - React-jsi (= 0.64.2) 303 | - ReactCommon/turbomodule/core (= 0.64.2) 304 | - React-RCTSettings (0.64.2): 305 | - FBReactNativeSpec (= 0.64.2) 306 | - RCT-Folly (= 2020.01.13.00) 307 | - RCTTypeSafety (= 0.64.2) 308 | - React-Core/RCTSettingsHeaders (= 0.64.2) 309 | - React-jsi (= 0.64.2) 310 | - ReactCommon/turbomodule/core (= 0.64.2) 311 | - React-RCTText (0.64.2): 312 | - React-Core/RCTTextHeaders (= 0.64.2) 313 | - React-RCTVibration (0.64.2): 314 | - FBReactNativeSpec (= 0.64.2) 315 | - RCT-Folly (= 2020.01.13.00) 316 | - React-Core/RCTVibrationHeaders (= 0.64.2) 317 | - React-jsi (= 0.64.2) 318 | - ReactCommon/turbomodule/core (= 0.64.2) 319 | - React-runtimeexecutor (0.64.2): 320 | - React-jsi (= 0.64.2) 321 | - ReactCommon/turbomodule/core (0.64.2): 322 | - DoubleConversion 323 | - glog 324 | - RCT-Folly (= 2020.01.13.00) 325 | - React-callinvoker (= 0.64.2) 326 | - React-Core (= 0.64.2) 327 | - React-cxxreact (= 0.64.2) 328 | - React-jsi (= 0.64.2) 329 | - React-perflogger (= 0.64.2) 330 | - Yoga (1.14.0) 331 | - YogaKit (1.18.1): 332 | - Yoga (~> 1.14) 333 | 334 | DEPENDENCIES: 335 | - DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`) 336 | - FBLazyVector (from `../node_modules/react-native/Libraries/FBLazyVector`) 337 | - FBReactNativeSpec (from `../node_modules/react-native/React/FBReactNativeSpec`) 338 | - Flipper (= 0.87.0) 339 | - Flipper-DoubleConversion (= 1.1.7) 340 | - Flipper-Folly (~> 2.5.3) 341 | - Flipper-Glog (= 0.3.6) 342 | - Flipper-PeerTalk (~> 0.0.4) 343 | - Flipper-RSocket (~> 1.3) 344 | - FlipperKit (= 0.87.0) 345 | - FlipperKit/Core (= 0.87.0) 346 | - FlipperKit/CppBridge (= 0.87.0) 347 | - FlipperKit/FBCxxFollyDynamicConvert (= 0.87.0) 348 | - FlipperKit/FBDefines (= 0.87.0) 349 | - FlipperKit/FKPortForwarding (= 0.87.0) 350 | - FlipperKit/FlipperKitHighlightOverlay (= 0.87.0) 351 | - FlipperKit/FlipperKitLayoutPlugin (= 0.87.0) 352 | - FlipperKit/FlipperKitLayoutTextSearchable (= 0.87.0) 353 | - FlipperKit/FlipperKitNetworkPlugin (= 0.87.0) 354 | - FlipperKit/FlipperKitReactPlugin (= 0.87.0) 355 | - FlipperKit/FlipperKitUserDefaultsPlugin (= 0.87.0) 356 | - FlipperKit/SKIOSNetworkPlugin (= 0.87.0) 357 | - glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`) 358 | - RCT-Folly (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`) 359 | - RCTRequired (from `../node_modules/react-native/Libraries/RCTRequired`) 360 | - RCTTypeSafety (from `../node_modules/react-native/Libraries/TypeSafety`) 361 | - React (from `../node_modules/react-native/`) 362 | - React-callinvoker (from `../node_modules/react-native/ReactCommon/callinvoker`) 363 | - React-Core (from `../node_modules/react-native/`) 364 | - React-Core/DevSupport (from `../node_modules/react-native/`) 365 | - React-Core/RCTWebSocket (from `../node_modules/react-native/`) 366 | - React-CoreModules (from `../node_modules/react-native/React/CoreModules`) 367 | - React-cxxreact (from `../node_modules/react-native/ReactCommon/cxxreact`) 368 | - React-jsi (from `../node_modules/react-native/ReactCommon/jsi`) 369 | - React-jsiexecutor (from `../node_modules/react-native/ReactCommon/jsiexecutor`) 370 | - React-jsinspector (from `../node_modules/react-native/ReactCommon/jsinspector`) 371 | - React-perflogger (from `../node_modules/react-native/ReactCommon/reactperflogger`) 372 | - React-RCTActionSheet (from `../node_modules/react-native/Libraries/ActionSheetIOS`) 373 | - React-RCTAnimation (from `../node_modules/react-native/Libraries/NativeAnimation`) 374 | - React-RCTBlob (from `../node_modules/react-native/Libraries/Blob`) 375 | - React-RCTImage (from `../node_modules/react-native/Libraries/Image`) 376 | - React-RCTLinking (from `../node_modules/react-native/Libraries/LinkingIOS`) 377 | - React-RCTNetwork (from `../node_modules/react-native/Libraries/Network`) 378 | - React-RCTSettings (from `../node_modules/react-native/Libraries/Settings`) 379 | - React-RCTText (from `../node_modules/react-native/Libraries/Text`) 380 | - React-RCTVibration (from `../node_modules/react-native/Libraries/Vibration`) 381 | - React-runtimeexecutor (from `../node_modules/react-native/ReactCommon/runtimeexecutor`) 382 | - ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`) 383 | - Yoga (from `../node_modules/react-native/ReactCommon/yoga`) 384 | 385 | SPEC REPOS: 386 | trunk: 387 | - boost-for-react-native 388 | - CocoaAsyncSocket 389 | - Flipper 390 | - Flipper-DoubleConversion 391 | - Flipper-Folly 392 | - Flipper-Glog 393 | - Flipper-PeerTalk 394 | - Flipper-RSocket 395 | - FlipperKit 396 | - libevent 397 | - OpenSSL-Universal 398 | - YogaKit 399 | 400 | EXTERNAL SOURCES: 401 | DoubleConversion: 402 | :podspec: "../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec" 403 | FBLazyVector: 404 | :path: "../node_modules/react-native/Libraries/FBLazyVector" 405 | FBReactNativeSpec: 406 | :path: "../node_modules/react-native/React/FBReactNativeSpec" 407 | glog: 408 | :podspec: "../node_modules/react-native/third-party-podspecs/glog.podspec" 409 | RCT-Folly: 410 | :podspec: "../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec" 411 | RCTRequired: 412 | :path: "../node_modules/react-native/Libraries/RCTRequired" 413 | RCTTypeSafety: 414 | :path: "../node_modules/react-native/Libraries/TypeSafety" 415 | React: 416 | :path: "../node_modules/react-native/" 417 | React-callinvoker: 418 | :path: "../node_modules/react-native/ReactCommon/callinvoker" 419 | React-Core: 420 | :path: "../node_modules/react-native/" 421 | React-CoreModules: 422 | :path: "../node_modules/react-native/React/CoreModules" 423 | React-cxxreact: 424 | :path: "../node_modules/react-native/ReactCommon/cxxreact" 425 | React-jsi: 426 | :path: "../node_modules/react-native/ReactCommon/jsi" 427 | React-jsiexecutor: 428 | :path: "../node_modules/react-native/ReactCommon/jsiexecutor" 429 | React-jsinspector: 430 | :path: "../node_modules/react-native/ReactCommon/jsinspector" 431 | React-perflogger: 432 | :path: "../node_modules/react-native/ReactCommon/reactperflogger" 433 | React-RCTActionSheet: 434 | :path: "../node_modules/react-native/Libraries/ActionSheetIOS" 435 | React-RCTAnimation: 436 | :path: "../node_modules/react-native/Libraries/NativeAnimation" 437 | React-RCTBlob: 438 | :path: "../node_modules/react-native/Libraries/Blob" 439 | React-RCTImage: 440 | :path: "../node_modules/react-native/Libraries/Image" 441 | React-RCTLinking: 442 | :path: "../node_modules/react-native/Libraries/LinkingIOS" 443 | React-RCTNetwork: 444 | :path: "../node_modules/react-native/Libraries/Network" 445 | React-RCTSettings: 446 | :path: "../node_modules/react-native/Libraries/Settings" 447 | React-RCTText: 448 | :path: "../node_modules/react-native/Libraries/Text" 449 | React-RCTVibration: 450 | :path: "../node_modules/react-native/Libraries/Vibration" 451 | React-runtimeexecutor: 452 | :path: "../node_modules/react-native/ReactCommon/runtimeexecutor" 453 | ReactCommon: 454 | :path: "../node_modules/react-native/ReactCommon" 455 | Yoga: 456 | :path: "../node_modules/react-native/ReactCommon/yoga" 457 | 458 | SPEC CHECKSUMS: 459 | boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c 460 | CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99 461 | DoubleConversion: cf9b38bf0b2d048436d9a82ad2abe1404f11e7de 462 | FBLazyVector: e686045572151edef46010a6f819ade377dfeb4b 463 | FBReactNativeSpec: c68e33fc844720c2072f7a68e1c11bdfe2a05a64 464 | Flipper: 1bd2db48dcc31e4b167b9a33ec1df01c2ded4893 465 | Flipper-DoubleConversion: 38631e41ef4f9b12861c67d17cb5518d06badc41 466 | Flipper-Folly: 755929a4f851b2fb2c347d533a23f191b008554c 467 | Flipper-Glog: 1dfd6abf1e922806c52ceb8701a3599a79a200a6 468 | Flipper-PeerTalk: 116d8f857dc6ef55c7a5a75ea3ceaafe878aadc9 469 | Flipper-RSocket: 127954abe8b162fcaf68d2134d34dc2bd7076154 470 | FlipperKit: 651f50a42eb95c01b3e89a60996dd6aded529eeb 471 | glog: 73c2498ac6884b13ede40eda8228cb1eee9d9d62 472 | libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913 473 | OpenSSL-Universal: 1aa4f6a6ee7256b83db99ec1ccdaa80d10f9af9b 474 | RCT-Folly: ec7a233ccc97cc556cf7237f0db1ff65b986f27c 475 | RCTRequired: 6d3e854f0e7260a648badd0d44fc364bc9da9728 476 | RCTTypeSafety: c1f31d19349c6b53085766359caac425926fafaa 477 | React: bda6b6d7ae912de97d7a61aa5c160db24aa2ad69 478 | React-callinvoker: 9840ea7e8e88ed73d438edb725574820b29b5baa 479 | React-Core: b5e385da7ce5f16a220fc60fd0749eae2c6120f0 480 | React-CoreModules: 17071a4e2c5239b01585f4aa8070141168ab298f 481 | React-cxxreact: 9be7b6340ed9f7c53e53deca7779f07cd66525ba 482 | React-jsi: 67747b9722f6dab2ffe15b011bcf6b3f2c3f1427 483 | React-jsiexecutor: 80c46bd381fd06e418e0d4f53672dc1d1945c4c3 484 | React-jsinspector: cc614ec18a9ca96fd275100c16d74d62ee11f0ae 485 | React-perflogger: 25373e382fed75ce768a443822f07098a15ab737 486 | React-RCTActionSheet: af7796ba49ffe4ca92e7277a5d992d37203f7da5 487 | React-RCTAnimation: 6a2e76ab50c6f25b428d81b76a5a45351c4d77aa 488 | React-RCTBlob: 02a2887023e0eed99391b6445b2e23a2a6f9226d 489 | React-RCTImage: ce5bf8e7438f2286d9b646a05d6ab11f38b0323d 490 | React-RCTLinking: ccd20742de14e020cb5f99d5c7e0bf0383aefbd9 491 | React-RCTNetwork: dfb9d089ab0753e5e5f55fc4b1210858f7245647 492 | React-RCTSettings: b14aef2d83699e48b410fb7c3ba5b66cd3291ae2 493 | React-RCTText: 41a2e952dd9adc5caf6fb68ed46b275194d5da5f 494 | React-RCTVibration: 24600e3b1aaa77126989bc58b6747509a1ba14f3 495 | React-runtimeexecutor: a9904c6d0218fb9f8b19d6dd88607225927668f9 496 | ReactCommon: 149906e01aa51142707a10665185db879898e966 497 | Yoga: 575c581c63e0d35c9a83f4b46d01d63abc1100ac 498 | YogaKit: f782866e155069a2cca2517aafea43200b01fd5a 499 | 500 | PODFILE CHECKSUM: 870f4ec950d9fe950621c2bb0b9681f36415e8e0 501 | 502 | COCOAPODS: 1.10.1 503 | -------------------------------------------------------------------------------- /example/ios/example.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 54; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 11 | 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; }; 12 | AD0F37EFFB33AF9F720C5746 /* libPods-example.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 8E3F9DD7861D38FA3D1B8633 /* libPods-example.a */; }; 13 | FAA6DE282607FC1C0044CA6D /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = FAA6DE272607FC1C0044CA6D /* AppDelegate.swift */; }; 14 | /* End PBXBuildFile section */ 15 | 16 | /* Begin PBXContainerItemProxy section */ 17 | FAE31FCB265B9F5F007094C1 /* PBXContainerItemProxy */ = { 18 | isa = PBXContainerItemProxy; 19 | containerPortal = FAE31FC7265B9F5F007094C1 /* RNModuleTemplateModule.xcodeproj */; 20 | proxyType = 2; 21 | remoteGlobalIDString = FA0EFF60236CC8FB00069FA8; 22 | remoteInfo = RNModuleTemplateModule; 23 | }; 24 | /* End PBXContainerItemProxy section */ 25 | 26 | /* Begin PBXFileReference section */ 27 | 13B07F961A680F5B00A75B9A /* example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = example.app; sourceTree = BUILT_PRODUCTS_DIR; }; 28 | 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = example/Images.xcassets; sourceTree = ""; }; 29 | 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = example/Info.plist; sourceTree = ""; }; 30 | 3280BA3E22763ADD16C5AB44 /* Pods-example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-example.release.xcconfig"; path = "Target Support Files/Pods-example/Pods-example.release.xcconfig"; sourceTree = ""; }; 31 | 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = example/LaunchScreen.storyboard; sourceTree = ""; }; 32 | 8E3F9DD7861D38FA3D1B8633 /* libPods-example.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-example.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 33 | 9B4E3EE3226F263437D36C23 /* Pods-example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-example.debug.xcconfig"; path = "Target Support Files/Pods-example/Pods-example.debug.xcconfig"; sourceTree = ""; }; 34 | ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; 35 | FAA6DE272607FC1C0044CA6D /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = AppDelegate.swift; path = example/AppDelegate.swift; sourceTree = ""; }; 36 | FAA6DE2A2607FC480044CA6D /* example-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "example-Bridging-Header.h"; path = "example/example-Bridging-Header.h"; sourceTree = ""; }; 37 | FAE31FC7265B9F5F007094C1 /* RNModuleTemplateModule.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RNModuleTemplateModule.xcodeproj; path = ../../ios/RNModuleTemplateModule.xcodeproj; sourceTree = ""; }; 38 | /* End PBXFileReference section */ 39 | 40 | /* Begin PBXFrameworksBuildPhase section */ 41 | 13B07F8C1A680F5B00A75B9A /* Frameworks */ = { 42 | isa = PBXFrameworksBuildPhase; 43 | buildActionMask = 2147483647; 44 | files = ( 45 | AD0F37EFFB33AF9F720C5746 /* libPods-example.a in Frameworks */, 46 | ); 47 | runOnlyForDeploymentPostprocessing = 0; 48 | }; 49 | /* End PBXFrameworksBuildPhase section */ 50 | 51 | /* Begin PBXGroup section */ 52 | 13B07FAE1A68108700A75B9A /* example */ = { 53 | isa = PBXGroup; 54 | children = ( 55 | FAA6DE272607FC1C0044CA6D /* AppDelegate.swift */, 56 | 13B07FB51A68108700A75B9A /* Images.xcassets */, 57 | 13B07FB61A68108700A75B9A /* Info.plist */, 58 | 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */, 59 | FAA6DE2A2607FC480044CA6D /* example-Bridging-Header.h */, 60 | ); 61 | name = example; 62 | sourceTree = ""; 63 | }; 64 | 2D16E6871FA4F8E400B85C8A /* Frameworks */ = { 65 | isa = PBXGroup; 66 | children = ( 67 | ED297162215061F000B7C4FE /* JavaScriptCore.framework */, 68 | 8E3F9DD7861D38FA3D1B8633 /* libPods-example.a */, 69 | ); 70 | name = Frameworks; 71 | sourceTree = ""; 72 | }; 73 | 360A22F5C615B0814726ED20 /* Pods */ = { 74 | isa = PBXGroup; 75 | children = ( 76 | 9B4E3EE3226F263437D36C23 /* Pods-example.debug.xcconfig */, 77 | 3280BA3E22763ADD16C5AB44 /* Pods-example.release.xcconfig */, 78 | ); 79 | path = Pods; 80 | sourceTree = ""; 81 | }; 82 | 832341AE1AAA6A7D00B99B32 /* Libraries */ = { 83 | isa = PBXGroup; 84 | children = ( 85 | FAE31FC7265B9F5F007094C1 /* RNModuleTemplateModule.xcodeproj */, 86 | ); 87 | name = Libraries; 88 | sourceTree = ""; 89 | }; 90 | 83CBB9F61A601CBA00E9B192 = { 91 | isa = PBXGroup; 92 | children = ( 93 | 13B07FAE1A68108700A75B9A /* example */, 94 | 832341AE1AAA6A7D00B99B32 /* Libraries */, 95 | 83CBBA001A601CBA00E9B192 /* Products */, 96 | 2D16E6871FA4F8E400B85C8A /* Frameworks */, 97 | 360A22F5C615B0814726ED20 /* Pods */, 98 | ); 99 | indentWidth = 2; 100 | sourceTree = ""; 101 | tabWidth = 2; 102 | usesTabs = 0; 103 | }; 104 | 83CBBA001A601CBA00E9B192 /* Products */ = { 105 | isa = PBXGroup; 106 | children = ( 107 | 13B07F961A680F5B00A75B9A /* example.app */, 108 | ); 109 | name = Products; 110 | sourceTree = ""; 111 | }; 112 | FAE31FC8265B9F5F007094C1 /* Products */ = { 113 | isa = PBXGroup; 114 | children = ( 115 | FAE31FCC265B9F5F007094C1 /* libRNModuleTemplateModule.a */, 116 | ); 117 | name = Products; 118 | sourceTree = ""; 119 | }; 120 | /* End PBXGroup section */ 121 | 122 | /* Begin PBXNativeTarget section */ 123 | 13B07F861A680F5B00A75B9A /* example */ = { 124 | isa = PBXNativeTarget; 125 | buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "example" */; 126 | buildPhases = ( 127 | FC38D20E04E532CBA2334B19 /* [CP] Check Pods Manifest.lock */, 128 | FD10A7F022414F080027D42C /* Start Packager */, 129 | 13B07F871A680F5B00A75B9A /* Sources */, 130 | 13B07F8C1A680F5B00A75B9A /* Frameworks */, 131 | 13B07F8E1A680F5B00A75B9A /* Resources */, 132 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */, 133 | 714B709C747B4F12C02FABE2 /* [CP] Embed Pods Frameworks */, 134 | AA02DC49EF495A09357ABC49 /* [CP] Copy Pods Resources */, 135 | ); 136 | buildRules = ( 137 | ); 138 | dependencies = ( 139 | ); 140 | name = example; 141 | productName = example; 142 | productReference = 13B07F961A680F5B00A75B9A /* example.app */; 143 | productType = "com.apple.product-type.application"; 144 | }; 145 | /* End PBXNativeTarget section */ 146 | 147 | /* Begin PBXProject section */ 148 | 83CBB9F71A601CBA00E9B192 /* Project object */ = { 149 | isa = PBXProject; 150 | attributes = { 151 | LastUpgradeCheck = 1240; 152 | TargetAttributes = { 153 | 13B07F861A680F5B00A75B9A = { 154 | LastSwiftMigration = 1240; 155 | }; 156 | }; 157 | }; 158 | buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "example" */; 159 | compatibilityVersion = "Xcode 12.0"; 160 | developmentRegion = en; 161 | hasScannedForEncodings = 0; 162 | knownRegions = ( 163 | en, 164 | Base, 165 | ); 166 | mainGroup = 83CBB9F61A601CBA00E9B192; 167 | productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */; 168 | projectDirPath = ""; 169 | projectReferences = ( 170 | { 171 | ProductGroup = FAE31FC8265B9F5F007094C1 /* Products */; 172 | ProjectRef = FAE31FC7265B9F5F007094C1 /* RNModuleTemplateModule.xcodeproj */; 173 | }, 174 | ); 175 | projectRoot = ""; 176 | targets = ( 177 | 13B07F861A680F5B00A75B9A /* example */, 178 | ); 179 | }; 180 | /* End PBXProject section */ 181 | 182 | /* Begin PBXReferenceProxy section */ 183 | FAE31FCC265B9F5F007094C1 /* libRNModuleTemplateModule.a */ = { 184 | isa = PBXReferenceProxy; 185 | fileType = archive.ar; 186 | path = libRNModuleTemplateModule.a; 187 | remoteRef = FAE31FCB265B9F5F007094C1 /* PBXContainerItemProxy */; 188 | sourceTree = BUILT_PRODUCTS_DIR; 189 | }; 190 | /* End PBXReferenceProxy section */ 191 | 192 | /* Begin PBXResourcesBuildPhase section */ 193 | 13B07F8E1A680F5B00A75B9A /* Resources */ = { 194 | isa = PBXResourcesBuildPhase; 195 | buildActionMask = 2147483647; 196 | files = ( 197 | 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */, 198 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */, 199 | ); 200 | runOnlyForDeploymentPostprocessing = 0; 201 | }; 202 | /* End PBXResourcesBuildPhase section */ 203 | 204 | /* Begin PBXShellScriptBuildPhase section */ 205 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = { 206 | isa = PBXShellScriptBuildPhase; 207 | buildActionMask = 2147483647; 208 | files = ( 209 | ); 210 | inputPaths = ( 211 | ); 212 | name = "Bundle React Native code and images"; 213 | outputPaths = ( 214 | ); 215 | runOnlyForDeploymentPostprocessing = 0; 216 | shellPath = /bin/sh; 217 | shellScript = "set -e\n\nexport NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh\n"; 218 | }; 219 | 714B709C747B4F12C02FABE2 /* [CP] Embed Pods Frameworks */ = { 220 | isa = PBXShellScriptBuildPhase; 221 | buildActionMask = 2147483647; 222 | files = ( 223 | ); 224 | inputFileListPaths = ( 225 | "${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-frameworks-${CONFIGURATION}-input-files.xcfilelist", 226 | ); 227 | name = "[CP] Embed Pods Frameworks"; 228 | outputFileListPaths = ( 229 | "${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-frameworks-${CONFIGURATION}-output-files.xcfilelist", 230 | ); 231 | runOnlyForDeploymentPostprocessing = 0; 232 | shellPath = /bin/sh; 233 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-frameworks.sh\"\n"; 234 | showEnvVarsInLog = 0; 235 | }; 236 | AA02DC49EF495A09357ABC49 /* [CP] Copy Pods Resources */ = { 237 | isa = PBXShellScriptBuildPhase; 238 | buildActionMask = 2147483647; 239 | files = ( 240 | ); 241 | inputFileListPaths = ( 242 | "${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-resources-${CONFIGURATION}-input-files.xcfilelist", 243 | ); 244 | name = "[CP] Copy Pods Resources"; 245 | outputFileListPaths = ( 246 | "${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-resources-${CONFIGURATION}-output-files.xcfilelist", 247 | ); 248 | runOnlyForDeploymentPostprocessing = 0; 249 | shellPath = /bin/sh; 250 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-resources.sh\"\n"; 251 | showEnvVarsInLog = 0; 252 | }; 253 | FC38D20E04E532CBA2334B19 /* [CP] Check Pods Manifest.lock */ = { 254 | isa = PBXShellScriptBuildPhase; 255 | buildActionMask = 2147483647; 256 | files = ( 257 | ); 258 | inputFileListPaths = ( 259 | ); 260 | inputPaths = ( 261 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 262 | "${PODS_ROOT}/Manifest.lock", 263 | ); 264 | name = "[CP] Check Pods Manifest.lock"; 265 | outputFileListPaths = ( 266 | ); 267 | outputPaths = ( 268 | "$(DERIVED_FILE_DIR)/Pods-example-checkManifestLockResult.txt", 269 | ); 270 | runOnlyForDeploymentPostprocessing = 0; 271 | shellPath = /bin/sh; 272 | 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"; 273 | showEnvVarsInLog = 0; 274 | }; 275 | FD10A7F022414F080027D42C /* Start Packager */ = { 276 | isa = PBXShellScriptBuildPhase; 277 | buildActionMask = 2147483647; 278 | files = ( 279 | ); 280 | inputFileListPaths = ( 281 | ); 282 | inputPaths = ( 283 | ); 284 | name = "Start Packager"; 285 | outputFileListPaths = ( 286 | ); 287 | outputPaths = ( 288 | ); 289 | runOnlyForDeploymentPostprocessing = 0; 290 | shellPath = /bin/sh; 291 | 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"; 292 | showEnvVarsInLog = 0; 293 | }; 294 | /* End PBXShellScriptBuildPhase section */ 295 | 296 | /* Begin PBXSourcesBuildPhase section */ 297 | 13B07F871A680F5B00A75B9A /* Sources */ = { 298 | isa = PBXSourcesBuildPhase; 299 | buildActionMask = 2147483647; 300 | files = ( 301 | FAA6DE282607FC1C0044CA6D /* AppDelegate.swift in Sources */, 302 | ); 303 | runOnlyForDeploymentPostprocessing = 0; 304 | }; 305 | /* End PBXSourcesBuildPhase section */ 306 | 307 | /* Begin XCBuildConfiguration section */ 308 | 13B07F941A680F5B00A75B9A /* Debug */ = { 309 | isa = XCBuildConfiguration; 310 | baseConfigurationReference = 9B4E3EE3226F263437D36C23 /* Pods-example.debug.xcconfig */; 311 | buildSettings = { 312 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 313 | CLANG_ENABLE_MODULES = YES; 314 | CURRENT_PROJECT_VERSION = 1; 315 | ENABLE_BITCODE = NO; 316 | INFOPLIST_FILE = example/Info.plist; 317 | LD_RUNPATH_SEARCH_PATHS = ( 318 | "$(inherited)", 319 | "@executable_path/Frameworks", 320 | ); 321 | OTHER_LDFLAGS = ( 322 | "$(inherited)", 323 | "-ObjC", 324 | "-lc++", 325 | ); 326 | PRODUCT_BUNDLE_IDENTIFIER = "com.$(PRODUCT_NAME:rfc1034identifier:lower)"; 327 | PRODUCT_NAME = example; 328 | SWIFT_OBJC_BRIDGING_HEADER = "example/example-Bridging-Header.h"; 329 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 330 | SWIFT_VERSION = 5.0; 331 | VERSIONING_SYSTEM = "apple-generic"; 332 | }; 333 | name = Debug; 334 | }; 335 | 13B07F951A680F5B00A75B9A /* Release */ = { 336 | isa = XCBuildConfiguration; 337 | baseConfigurationReference = 3280BA3E22763ADD16C5AB44 /* Pods-example.release.xcconfig */; 338 | buildSettings = { 339 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 340 | CLANG_ENABLE_MODULES = YES; 341 | CURRENT_PROJECT_VERSION = 1; 342 | INFOPLIST_FILE = example/Info.plist; 343 | LD_RUNPATH_SEARCH_PATHS = ( 344 | "$(inherited)", 345 | "@executable_path/Frameworks", 346 | ); 347 | OTHER_LDFLAGS = ( 348 | "$(inherited)", 349 | "-ObjC", 350 | "-lc++", 351 | ); 352 | PRODUCT_BUNDLE_IDENTIFIER = "com.$(PRODUCT_NAME:rfc1034identifier:lower)"; 353 | PRODUCT_NAME = example; 354 | SWIFT_OBJC_BRIDGING_HEADER = "example/example-Bridging-Header.h"; 355 | SWIFT_VERSION = 5.0; 356 | VERSIONING_SYSTEM = "apple-generic"; 357 | }; 358 | name = Release; 359 | }; 360 | 83CBBA201A601CBA00E9B192 /* Debug */ = { 361 | isa = XCBuildConfiguration; 362 | buildSettings = { 363 | ALWAYS_SEARCH_USER_PATHS = NO; 364 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 365 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 366 | CLANG_CXX_LIBRARY = "libc++"; 367 | CLANG_ENABLE_MODULES = YES; 368 | CLANG_ENABLE_OBJC_ARC = YES; 369 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 370 | CLANG_WARN_BOOL_CONVERSION = YES; 371 | CLANG_WARN_COMMA = YES; 372 | CLANG_WARN_CONSTANT_CONVERSION = YES; 373 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 374 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 375 | CLANG_WARN_EMPTY_BODY = YES; 376 | CLANG_WARN_ENUM_CONVERSION = YES; 377 | CLANG_WARN_INFINITE_RECURSION = YES; 378 | CLANG_WARN_INT_CONVERSION = YES; 379 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 380 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 381 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 382 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 383 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 384 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 385 | CLANG_WARN_STRICT_PROTOTYPES = YES; 386 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 387 | CLANG_WARN_UNREACHABLE_CODE = YES; 388 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 389 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 390 | COPY_PHASE_STRIP = NO; 391 | ENABLE_STRICT_OBJC_MSGSEND = YES; 392 | ENABLE_TESTABILITY = YES; 393 | "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "arm64 "; 394 | GCC_C_LANGUAGE_STANDARD = gnu99; 395 | GCC_DYNAMIC_NO_PIC = NO; 396 | GCC_NO_COMMON_BLOCKS = YES; 397 | GCC_OPTIMIZATION_LEVEL = 0; 398 | GCC_PREPROCESSOR_DEFINITIONS = ( 399 | "DEBUG=1", 400 | "$(inherited)", 401 | ); 402 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 403 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 404 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 405 | GCC_WARN_UNDECLARED_SELECTOR = YES; 406 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 407 | GCC_WARN_UNUSED_FUNCTION = YES; 408 | GCC_WARN_UNUSED_VARIABLE = YES; 409 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 410 | LD_RUNPATH_SEARCH_PATHS = ( 411 | /usr/lib/swift, 412 | "$(inherited)", 413 | ); 414 | LIBRARY_SEARCH_PATHS = "\"$(inherited)\""; 415 | MTL_ENABLE_DEBUG_INFO = YES; 416 | ONLY_ACTIVE_ARCH = YES; 417 | OTHER_SWIFT_FLAGS = "-D DEBUG"; 418 | SDKROOT = iphoneos; 419 | }; 420 | name = Debug; 421 | }; 422 | 83CBBA211A601CBA00E9B192 /* Release */ = { 423 | isa = XCBuildConfiguration; 424 | buildSettings = { 425 | ALWAYS_SEARCH_USER_PATHS = NO; 426 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 427 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 428 | CLANG_CXX_LIBRARY = "libc++"; 429 | CLANG_ENABLE_MODULES = YES; 430 | CLANG_ENABLE_OBJC_ARC = YES; 431 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 432 | CLANG_WARN_BOOL_CONVERSION = YES; 433 | CLANG_WARN_COMMA = YES; 434 | CLANG_WARN_CONSTANT_CONVERSION = YES; 435 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 436 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 437 | CLANG_WARN_EMPTY_BODY = YES; 438 | CLANG_WARN_ENUM_CONVERSION = YES; 439 | CLANG_WARN_INFINITE_RECURSION = YES; 440 | CLANG_WARN_INT_CONVERSION = YES; 441 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 442 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 443 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 444 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 445 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 446 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 447 | CLANG_WARN_STRICT_PROTOTYPES = YES; 448 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 449 | CLANG_WARN_UNREACHABLE_CODE = YES; 450 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 451 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 452 | COPY_PHASE_STRIP = YES; 453 | ENABLE_NS_ASSERTIONS = NO; 454 | ENABLE_STRICT_OBJC_MSGSEND = YES; 455 | "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "arm64 "; 456 | GCC_C_LANGUAGE_STANDARD = gnu99; 457 | GCC_NO_COMMON_BLOCKS = YES; 458 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 459 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 460 | GCC_WARN_UNDECLARED_SELECTOR = YES; 461 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 462 | GCC_WARN_UNUSED_FUNCTION = YES; 463 | GCC_WARN_UNUSED_VARIABLE = YES; 464 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 465 | LD_RUNPATH_SEARCH_PATHS = ( 466 | /usr/lib/swift, 467 | "$(inherited)", 468 | ); 469 | LIBRARY_SEARCH_PATHS = "\"$(inherited)\""; 470 | MTL_ENABLE_DEBUG_INFO = NO; 471 | SDKROOT = iphoneos; 472 | SWIFT_COMPILATION_MODE = wholemodule; 473 | VALIDATE_PRODUCT = YES; 474 | }; 475 | name = Release; 476 | }; 477 | /* End XCBuildConfiguration section */ 478 | 479 | /* Begin XCConfigurationList section */ 480 | 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "example" */ = { 481 | isa = XCConfigurationList; 482 | buildConfigurations = ( 483 | 13B07F941A680F5B00A75B9A /* Debug */, 484 | 13B07F951A680F5B00A75B9A /* Release */, 485 | ); 486 | defaultConfigurationIsVisible = 0; 487 | defaultConfigurationName = Release; 488 | }; 489 | 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "example" */ = { 490 | isa = XCConfigurationList; 491 | buildConfigurations = ( 492 | 83CBBA201A601CBA00E9B192 /* Debug */, 493 | 83CBBA211A601CBA00E9B192 /* Release */, 494 | ); 495 | defaultConfigurationIsVisible = 0; 496 | defaultConfigurationName = Release; 497 | }; 498 | /* End XCConfigurationList section */ 499 | }; 500 | rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */; 501 | } 502 | -------------------------------------------------------------------------------- /example/ios/example.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/ios/example.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/example.xcodeproj/xcshareddata/xcschemes/example.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 45 | 51 | 52 | 53 | 54 | 60 | 62 | 68 | 69 | 70 | 71 | 73 | 74 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /example/ios/example.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /example/ios/example.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/example/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | #if DEBUG 3 | import FlipperKit 4 | #endif 5 | 6 | @UIApplicationMain 7 | class AppDelegate: UIResponder, UIApplicationDelegate, RCTBridgeDelegate { 8 | 9 | var window: UIWindow? 10 | 11 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 12 | initializeFlipper(with: application) 13 | 14 | let bridge = RCTBridge(delegate: self, launchOptions: launchOptions) 15 | let rootView = RCTRootView(bridge: bridge!, moduleName: "example", initialProperties: nil) 16 | 17 | if #available(iOS 13.0, *) { 18 | rootView.backgroundColor = UIColor.systemBackground 19 | } else { 20 | rootView.backgroundColor = UIColor.white 21 | } 22 | 23 | window = UIWindow(frame: UIScreen.main.bounds) 24 | let rootViewController = UIViewController() 25 | rootViewController.view = rootView 26 | window?.rootViewController = rootViewController 27 | window?.makeKeyAndVisible() 28 | 29 | return true 30 | } 31 | 32 | func sourceURL(for bridge: RCTBridge!) -> URL! { 33 | #if DEBUG 34 | return RCTBundleURLProvider.sharedSettings()?.jsBundleURL(forBundleRoot: "index", fallbackResource: nil) 35 | #else 36 | return Bundle.main.url(forResource: "main", withExtension: "jsbundle") 37 | #endif 38 | } 39 | 40 | private func initializeFlipper(with application: UIApplication) { 41 | #if DEBUG 42 | let client = FlipperClient.shared() 43 | let layoutDescriptionMapper = SKDescriptorMapper(defaults: ()) 44 | client?.add(FlipperKitLayoutPlugin(rootNode: application, with: layoutDescriptionMapper)) 45 | client?.add(FKUserDefaultsPlugin(suiteName: nil)) 46 | client?.add(FlipperKitReactPlugin()) 47 | client?.add(FlipperKitNetworkPlugin(networkAdapter: SKIOSNetworkAdapter())) 48 | client?.start() 49 | #endif 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /example/ios/example/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "scale" : "2x", 6 | "size" : "20x20" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "scale" : "3x", 11 | "size" : "20x20" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "scale" : "2x", 16 | "size" : "29x29" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "scale" : "3x", 21 | "size" : "29x29" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "scale" : "2x", 26 | "size" : "40x40" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "scale" : "3x", 31 | "size" : "40x40" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "scale" : "2x", 36 | "size" : "60x60" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "scale" : "3x", 41 | "size" : "60x60" 42 | }, 43 | { 44 | "idiom" : "ios-marketing", 45 | "scale" : "1x", 46 | "size" : "1024x1024" 47 | } 48 | ], 49 | "info" : { 50 | "author" : "xcode", 51 | "version" : 1 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /example/ios/example/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /example/ios/example/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | example 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(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 | $(CURRENT_PROJECT_VERSION) 25 | LSRequiresIPhoneOS 26 | 27 | NSAppTransportSecurity 28 | 29 | NSExceptionDomains 30 | 31 | localhost 32 | 33 | NSExceptionAllowsInsecureHTTPLoads 34 | 35 | 36 | 37 | 38 | NSLocationWhenInUseUsageDescription 39 | 40 | UILaunchStoryboardName 41 | LaunchScreen 42 | UIRequiredDeviceCapabilities 43 | 44 | armv7 45 | 46 | UISupportedInterfaceOrientations 47 | 48 | UIInterfaceOrientationPortrait 49 | UIInterfaceOrientationLandscapeLeft 50 | UIInterfaceOrientationLandscapeRight 51 | 52 | UIViewControllerBasedStatusBarAppearance 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /example/ios/example/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 24 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /example/ios/example/example-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 | 5 | #import 6 | #import 7 | #import 8 | -------------------------------------------------------------------------------- /example/metro.config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Metro configuration for React Native 3 | * https://github.com/facebook/react-native 4 | * 5 | * @format 6 | */ 7 | 8 | const path = require('path') 9 | const exclusionList = require('metro-config/src/defaults/exclusionList') 10 | 11 | const moduleRoot = path.resolve(__dirname, '..') 12 | 13 | module.exports = { 14 | watchFolders: [moduleRoot], 15 | resolver: { 16 | extraNodeModules: { 17 | react: path.resolve(__dirname, 'node_modules/react'), 18 | 'react-native': path.resolve(__dirname, 'node_modules/react-native'), 19 | }, 20 | blockList: exclusionList([ 21 | new RegExp(`${moduleRoot}/node_modules/react/.*`), 22 | new RegExp(`${moduleRoot}/node_modules/react-native/.*`), 23 | ]), 24 | }, 25 | transformer: { 26 | getTransformOptions: async () => ({ 27 | transform: { 28 | experimentalImportSupport: false, 29 | inlineRequires: true, 30 | }, 31 | }), 32 | }, 33 | } 34 | -------------------------------------------------------------------------------- /example/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "example", 3 | "version": "0.0.1", 4 | "private": true, 5 | "scripts": { 6 | "android": "react-native run-android", 7 | "compile": "tsc -p .", 8 | "ios": "react-native run-ios", 9 | "lint": "eslint . --ext .js,.jsx,.ts,.tsx", 10 | "start": "react-native start", 11 | "test": "jest" 12 | }, 13 | "dependencies": { 14 | "react": "^17.0.2", 15 | "react-native": "^0.64.2" 16 | }, 17 | "devDependencies": { 18 | "@babel/core": "^7.14.6", 19 | "@babel/runtime": "^7.14.6", 20 | "@react-native-community/eslint-config": "^3.0.0", 21 | "@types/jest": "^26.0.24", 22 | "@types/react-native": "^0.64.12", 23 | "@types/react-test-renderer": "^17.0.1", 24 | "babel-jest": "^26.6.3", 25 | "eslint": "^7.30.0", 26 | "eslint-plugin-simple-import-sort": "^7.0.0", 27 | "jest": "^26.6.3", 28 | "metro-react-native-babel-preset": "^0.66.1", 29 | "react-test-renderer": "^17.0.2", 30 | "typescript": "^4.3.5" 31 | }, 32 | "resolutions": { 33 | "@types/react": "^17" 34 | }, 35 | "jest": { 36 | "preset": "react-native", 37 | "moduleFileExtensions": [ 38 | "ts", 39 | "tsx", 40 | "js", 41 | "jsx", 42 | "json", 43 | "node" 44 | ] 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /example/src/App.tsx: -------------------------------------------------------------------------------- 1 | import React, { useState, useEffect } from 'react' 2 | import { Text } from 'react-native' 3 | import { StyleSheet, SafeAreaView, ActivityIndicator, View } from 'react-native' 4 | import { getListProvinceCode, getNcovInformation } from './services/api/api' 5 | import Dropdown, { Selected } from 'react-native-dropdown-enhanced' 6 | 7 | type ProvincePayload = { 8 | name: string 9 | 'hec-key': number 10 | } 11 | 12 | const App = () => { 13 | const [listProvince, setListProvince] = useState>([]) 14 | const [dataCovid, setDataCovid] = useState({}) 15 | const [isLoading, setIsLoading] = useState(true) 16 | const [information, setInformation] = useState({}) 17 | 18 | const requestGetListProvince = async () => { 19 | const dataProvince = await (await fetch(getListProvinceCode)).json() 20 | const dataNcov = await (await fetch(getNcovInformation)).json() 21 | setListProvince( 22 | dataProvince.key.map((item: ProvincePayload) => ({ 23 | label: item.name.replace(/-/g, ' ').toUpperCase(), 24 | value: item['hec-key'], 25 | })) 26 | ) 27 | setDataCovid(dataNcov) 28 | setIsLoading(false) 29 | } 30 | 31 | const onSelected = (selected: Selected) => { 32 | let target = dataCovid?.detail?.find( 33 | (item: any) => item['hc-key'] == selected.value 34 | ) 35 | setInformation(target) 36 | } 37 | 38 | useEffect(() => { 39 | requestGetListProvince() 40 | }, []) 41 | 42 | if (isLoading) 43 | return ( 44 | 45 | 46 | 47 | 48 | ) 49 | 50 | return ( 51 | 52 | 53 | CHOOSE PROVINCE: 54 | 61 | 62 | 63 | VIETNAM COVID-19 DATA 64 | 68 | 74 | 75 | 76 | ) 77 | } 78 | 79 | const styles = StyleSheet.create({ 80 | centerStyle: { 81 | flex: 1, 82 | justifyContent: 'center', 83 | alignItems: 'center', 84 | }, 85 | header: { 86 | width: '100%', 87 | flexDirection: 'row', 88 | justifyContent: 'space-between', 89 | alignItems: 'center', 90 | paddingHorizontal: 20, 91 | }, 92 | title: { 93 | fontWeight: '500', 94 | fontSize: 19, 95 | position: 'absolute', 96 | bottom: 0, 97 | marginTop: 30, 98 | }, 99 | text: { 100 | fontSize: 16, 101 | fontWeight: '500', 102 | }, 103 | }) 104 | 105 | export default App 106 | -------------------------------------------------------------------------------- /example/src/services/api/api.ts: -------------------------------------------------------------------------------- 1 | export const getListProvinceCode = 2 | 'https://api.apify.com/v2/key-value-stores/p3nS2Q9TUn6kUOriJ/records/LATEST?utm_source=j2team&utm_medium=url_shortener'; 3 | 4 | export const getNcovInformation = 5 | 'https://api.apify.com/v2/key-value-stores/ZsOpZgeg7dFS1rgfM/records/LATEST?utm_source=j2team&utm_medium=url_shortener'; 6 | -------------------------------------------------------------------------------- /example/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "baseUrl": ".", 4 | "esModuleInterop": true, 5 | "jsx": "react-native", 6 | "lib": ["ESNext"], 7 | "module": "CommonJS", 8 | "noEmit": true, 9 | "paths": { 10 | "react-native-dropdown-enhanced": ["../src"] 11 | }, 12 | "skipLibCheck": true, 13 | "strict": true, 14 | "target": "ESNext", 15 | }, 16 | "include": ["src"] 17 | } 18 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-native-dropdown-enhanced", 3 | "version": "1.1.4", 4 | "description": "A simply dropdown combine searchable for react native that works both for IOS and Android.", 5 | "homepage": "https://github.com/dthlg/react-native-dropdown-enhanced#readme", 6 | "main": "lib/index.js", 7 | "types": "lib/index.d.ts", 8 | "author": "Long Dao ", 9 | "license": "MIT", 10 | "files": [ 11 | "lib" 12 | ], 13 | "scripts": { 14 | "compile": "rm -rf lib && tsc -p . && npm run copy-assets", 15 | "lint": "eslint . --ext .js,.jsx,.ts,.tsx", 16 | "prepare": "yarn compile", 17 | "test": "jest", 18 | "copy-assets": "cp -rv src/assets/ lib/assets/" 19 | }, 20 | "devDependencies": { 21 | "@babel/core": "^7.14.6", 22 | "@babel/runtime": "^7.14.6", 23 | "@react-native-community/eslint-config": "^3.0.0", 24 | "@types/jest": "^26.0.24", 25 | "@types/react-native": "^0.64.12", 26 | "@types/react-test-renderer": "^17.0.1", 27 | "babel-jest": "^26.6.3", 28 | "eslint": "^7.30.0", 29 | "eslint-plugin-simple-import-sort": "^7.0.0", 30 | "jest": "^26.6.3", 31 | "metro-react-native-babel-preset": "^0.66.1", 32 | "react": "^17.0.2", 33 | "react-native": "^0.64.2", 34 | "react-test-renderer": "^17.0.2", 35 | "typescript": "^4.3.5" 36 | }, 37 | "peerDependencies": { 38 | "react": "*", 39 | "react-native": "*" 40 | }, 41 | "jest": { 42 | "preset": "react-native", 43 | "moduleFileExtensions": [ 44 | "ts", 45 | "tsx", 46 | "js", 47 | "jsx", 48 | "json", 49 | "node" 50 | ] 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/assets/ic_arrow_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lngdao/react-native-dropdown-enhanced/6d0af29d0753f1172ab8add9fce37ceb4ad06dc0/src/assets/ic_arrow_down.png -------------------------------------------------------------------------------- /src/assets/ic_tick.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lngdao/react-native-dropdown-enhanced/6d0af29d0753f1172ab8add9fce37ceb4ad06dc0/src/assets/ic_tick.png -------------------------------------------------------------------------------- /src/components/Dropdown.props.ts: -------------------------------------------------------------------------------- 1 | import { 2 | FlatListProps, 3 | ImageStyle, 4 | StyleProp, 5 | TextStyle, 6 | ViewStyle, 7 | } from 'react-native' 8 | 9 | export interface DropdownProps 10 | extends Omit, 'renderItem'> { 11 | data: Array 12 | defaultValue?: number | string 13 | onSelectedChange?: (selected: Selected) => void 14 | style?: StyleProp 15 | defaultLabel?: string 16 | itemSeparatorComponent?: React.ReactElement 17 | separatorStyle?: ViewStyle 18 | itemStyle?: StyleProp 19 | itemTextStyle?: StyleProp 20 | dropdownStyle?: StyleProp 21 | labelStyle?: StyleProp 22 | searchStyle?: StyleProp 23 | searchable?: boolean 24 | searchPlaceholder?: string 25 | activeTextColor?: string 26 | inactiveTextColor?: string 27 | showDropIcon?: boolean 28 | showTickIcon?: boolean 29 | tickIconStyle?: ImageStyle 30 | delayCalcPosition?: number 31 | } 32 | 33 | export type Selected = { 34 | label: string 35 | value: number | string 36 | } 37 | -------------------------------------------------------------------------------- /src/components/Dropdown.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react' 2 | import { useState, useEffect, useRef, useCallback } from 'react' 3 | import { 4 | View, 5 | Text, 6 | TouchableOpacity, 7 | Modal, 8 | StyleSheet, 9 | TextInput, 10 | Image, 11 | FlatList, 12 | TouchableWithoutFeedback, 13 | ListRenderItem, 14 | } from 'react-native' 15 | import { DropdownProps, Selected } from './Dropdown.props' 16 | 17 | type ContainerDimension = { 18 | width: number 19 | height: number 20 | px: number 21 | py: number 22 | } 23 | 24 | const SPACING = 10 25 | const DEFAULT_VALUE = 0 26 | 27 | const Dropdown = (props: DropdownProps) => { 28 | const { 29 | data, 30 | defaultValue, 31 | onSelectedChange, 32 | style, 33 | labelStyle, 34 | dropdownStyle, 35 | searchable, 36 | searchStyle, 37 | defaultLabel = 'All', 38 | itemStyle, 39 | itemTextStyle, 40 | searchPlaceholder = 'Type here', 41 | activeTextColor = 'orange', 42 | inactiveTextColor = 'black', 43 | itemSeparatorComponent, 44 | showDropIcon = true, 45 | separatorStyle, 46 | showTickIcon = false, 47 | tickIconStyle, 48 | delayCalcPosition = 200, 49 | ...flatListProps 50 | } = props 51 | 52 | const [selected, setSelected] = useState({ 53 | label: defaultLabel, 54 | value: '', 55 | }) 56 | const [dataDropdown, setDataDropdown] = useState>(data) 57 | const [dropdownVisible, setDropdownVisible] = useState(false) 58 | const [containerDimension, setContainerDimension] = 59 | React.useState({ 60 | width: DEFAULT_VALUE, 61 | height: DEFAULT_VALUE, 62 | px: DEFAULT_VALUE, 63 | py: DEFAULT_VALUE, 64 | }) 65 | const [isSearchActive, setIsSearchActive] = useState(false) 66 | const [textSearch, setTextSearch] = useState(data[0].label) 67 | const [isCalculatingPostition, setIsCalculatingPosition] = 68 | useState(true) 69 | const [currentOffset, setCurrentOffset] = useState( 70 | undefined 71 | ) 72 | const containerRef = useRef(null) 73 | const inputRef = useRef(null) 74 | const listRef = useRef(null) 75 | const currentOffsetRef = useRef(DEFAULT_VALUE) 76 | 77 | const handleOnLayout = () => { 78 | setTimeout(() => { 79 | containerRef.current?.measure((fx, fy, width, height, px, py) => { 80 | setContainerDimension(prev => ({ 81 | ...prev, 82 | width, 83 | height, 84 | px, 85 | py, 86 | })) 87 | }) 88 | }, delayCalcPosition) 89 | setIsCalculatingPosition(false) 90 | } 91 | 92 | const toggleDropdown = () => { 93 | if (searchable) { 94 | setTextSearch(selected.label) 95 | setIsSearchActive(!dropdownVisible) 96 | } 97 | setDropdownVisible(prev => !prev) 98 | } 99 | 100 | const onSearch = (text: string) => { 101 | setTextSearch(text) 102 | var matchingData = data.filter(item => item.label.search(text) != -1) 103 | setDataDropdown(matchingData) 104 | } 105 | 106 | const checkDefaultValue = () => { 107 | if (defaultValue) { 108 | let target = data.find(item => item.value == defaultValue) 109 | 110 | if (target) { 111 | setSelected(prev => ({ 112 | ...prev, 113 | label: target!.label, 114 | value: defaultValue, 115 | })) 116 | } 117 | } 118 | } 119 | 120 | useEffect(() => { 121 | if (dropdownVisible && currentOffset) { 122 | setTimeout(() => { 123 | listRef.current?.scrollToOffset({ 124 | offset: currentOffset, 125 | animated: false, 126 | }) 127 | }, 0) 128 | } 129 | }, [dropdownVisible]) 130 | 131 | useEffect(() => { 132 | // check default value 133 | checkDefaultValue() 134 | }, []) 135 | 136 | const renderDropdownItem: ListRenderItem = ({ item }) => { 137 | const dropdownItemView = ( 138 | 139 | 151 | {selected.value == item.value && showTickIcon && ( 152 | 156 | )} 157 | 158 | ) 159 | 160 | return ( 161 | { 163 | setCurrentOffset(currentOffsetRef.current) 164 | toggleDropdown() 165 | setSelected(item) 166 | !!onSelectedChange && onSelectedChange(item) 167 | searchable && setIsSearchActive(false) 168 | searchable && setDataDropdown(data) 169 | }} 170 | children={dropdownItemView} 171 | /> 172 | ) 173 | } 174 | 175 | const containerView = () => { 176 | const containerChild = 177 | searchable && isSearchActive ? ( 178 | 187 | ) : ( 188 | 193 | ) 194 | 195 | return ( 196 | 201 | {containerChild} 202 | {showDropIcon && ( 203 | 210 | )} 211 | 212 | ) 213 | } 214 | 215 | const dropdownWrapper = (cpn: JSX.Element) => { 216 | return !searchable ? ( 217 | setDropdownVisible(false)} 221 | > 222 | 229 | } 230 | /> 231 | 232 | ) : ( 233 | cpn 234 | ) 235 | } 236 | 237 | const keyExtractor = useCallback((_, index) => `${index}`, []) 238 | 239 | const separatorComponent = useCallback( 240 | () => 241 | itemSeparatorComponent || ( 242 | 243 | ), 244 | [] 245 | ) 246 | 247 | const renderDropdown = () => ( 248 | { 272 | currentOffsetRef.current = event.nativeEvent.contentOffset.y 273 | }} 274 | initialNumToRender={data.length} 275 | {...flatListProps} 276 | /> 277 | } 278 | /> 279 | ) 280 | 281 | return ( 282 | 283 | 288 | {dropdownWrapper(renderDropdown())} 289 | 290 | ) 291 | } 292 | 293 | const styles = StyleSheet.create({ 294 | containerStyle: { 295 | flexDirection: 'row', 296 | alignItems: 'center', 297 | justifyContent: 'space-between', 298 | borderRadius: 5, 299 | borderColor: '#CED4DA', 300 | borderWidth: 1, 301 | height: 50, 302 | padding: SPACING, 303 | }, 304 | label: { 305 | flex: 1, 306 | paddingRight: SPACING, 307 | }, 308 | ic_arrow: { 309 | width: 12, 310 | height: 12, 311 | }, 312 | searchStyle: { 313 | flex: 1, 314 | paddingRight: SPACING, 315 | }, 316 | dropdown: { 317 | zIndex: 20, 318 | position: 'absolute', 319 | borderRadius: 5, 320 | maxHeight: 200, 321 | backgroundColor: '#FFF', 322 | shadowColor: '#000', 323 | shadowOffset: { 324 | width: 0, 325 | height: 1, 326 | }, 327 | shadowOpacity: 0.22, 328 | shadowRadius: 2.22, 329 | elevation: 3, 330 | }, 331 | dropdownItem: { 332 | padding: SPACING, 333 | flexDirection: 'row', 334 | justifyContent: 'space-between', 335 | alignItems: 'center', 336 | }, 337 | separator: { 338 | flex: 1, 339 | height: 1, 340 | backgroundColor: '#CED4DA', 341 | marginHorizontal: SPACING, 342 | }, 343 | tickIcon: { 344 | width: 17, 345 | height: 17, 346 | tintColor: 'orange', 347 | }, 348 | }) 349 | 350 | export default Dropdown 351 | -------------------------------------------------------------------------------- /src/index.tsx: -------------------------------------------------------------------------------- 1 | import Dropdown from './components/Dropdown'; 2 | import { DropdownProps, Selected } from './components/Dropdown.props'; 3 | 4 | export { DropdownProps, Selected }; 5 | export default Dropdown; 6 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "declaration": true, 4 | "esModuleInterop": true, 5 | "jsx": "react-native", 6 | "lib": ["ESNext"], 7 | "module": "CommonJS", 8 | "noEmitOnError": true, 9 | "outDir": "./lib", 10 | "skipLibCheck": true, 11 | "sourceMap": true, 12 | "strict": true, 13 | "target": "ESNext", 14 | }, 15 | "exclude": ["**/__tests__/*"], 16 | "include": ["src"] 17 | } 18 | --------------------------------------------------------------------------------