├── example ├── .watchmanconfig ├── .gitattributes ├── .babelrc ├── app.json ├── android │ ├── settings.gradle │ ├── app │ │ ├── src │ │ │ └── main │ │ │ │ ├── res │ │ │ │ ├── values │ │ │ │ │ ├── strings.xml │ │ │ │ │ └── styles.xml │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ └── mipmap-xxhdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── demo │ │ │ │ │ ├── MainActivity.java │ │ │ │ │ └── MainApplication.java │ │ │ │ └── AndroidManifest.xml │ │ ├── BUCK │ │ ├── proguard-rules.pro │ │ └── build.gradle │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── keystores │ │ ├── debug.keystore.properties │ │ └── BUCK │ ├── build.gradle │ ├── gradle.properties │ ├── gradlew.bat │ └── gradlew ├── images │ ├── flower.png │ └── heart.png ├── .buckconfig ├── __tests__ │ ├── index.ios.js │ └── index.android.js ├── ios │ ├── Demo │ │ ├── AppDelegate.h │ │ ├── main.m │ │ ├── Images.xcassets │ │ │ └── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ ├── AppDelegate.m │ │ ├── Info.plist │ │ └── Base.lproj │ │ │ └── LaunchScreen.xib │ ├── DemoTests │ │ ├── Info.plist │ │ └── DemoTests.m │ ├── Demo-tvOSTests │ │ └── Info.plist │ ├── Demo-tvOS │ │ └── Info.plist │ └── Demo.xcodeproj │ │ ├── xcshareddata │ │ └── xcschemes │ │ │ ├── Demo.xcscheme │ │ │ └── Demo-tvOS.xcscheme │ │ └── project.pbxproj ├── package.json ├── .gitignore ├── .flowconfig ├── index.js └── ModalDropdown.js ├── .npmignore ├── docs ├── demo_1.gif ├── demo_2.gif ├── demo_3.gif └── demo_4.gif ├── expo-example ├── assets │ ├── icon.png │ ├── splash.png │ └── favicon.png ├── images │ ├── flower.png │ └── heart.png ├── babel.config.js ├── .expo-shared │ └── assets.json ├── .gitignore ├── app.json ├── package.json ├── App.js └── ModalDropdown.js ├── .gitignore ├── index.js ├── .github └── workflows │ ├── node.js.yml │ └── npm-publish.yml ├── LICENSE ├── package.json ├── README.md └── components └── ModalDropdown.js /example/.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /example/.gitattributes: -------------------------------------------------------------------------------- 1 | *.pbxproj -text 2 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | .idea 2 | .npmignore 3 | example 4 | docs -------------------------------------------------------------------------------- /example/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["react-native"] 3 | } -------------------------------------------------------------------------------- /example/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Demo", 3 | "displayName": "Demo" 4 | } -------------------------------------------------------------------------------- /example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'Demo' 2 | 3 | include ':app' 4 | -------------------------------------------------------------------------------- /docs/demo_1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siemiatj/react-native-modal-dropdown/HEAD/docs/demo_1.gif -------------------------------------------------------------------------------- /docs/demo_2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siemiatj/react-native-modal-dropdown/HEAD/docs/demo_2.gif -------------------------------------------------------------------------------- /docs/demo_3.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siemiatj/react-native-modal-dropdown/HEAD/docs/demo_3.gif -------------------------------------------------------------------------------- /docs/demo_4.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siemiatj/react-native-modal-dropdown/HEAD/docs/demo_4.gif -------------------------------------------------------------------------------- /example/images/flower.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siemiatj/react-native-modal-dropdown/HEAD/example/images/flower.png -------------------------------------------------------------------------------- /example/images/heart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siemiatj/react-native-modal-dropdown/HEAD/example/images/heart.png -------------------------------------------------------------------------------- /expo-example/assets/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siemiatj/react-native-modal-dropdown/HEAD/expo-example/assets/icon.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | Demo 3 | 4 | -------------------------------------------------------------------------------- /expo-example/assets/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siemiatj/react-native-modal-dropdown/HEAD/expo-example/assets/splash.png -------------------------------------------------------------------------------- /expo-example/images/flower.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siemiatj/react-native-modal-dropdown/HEAD/expo-example/images/flower.png -------------------------------------------------------------------------------- /expo-example/images/heart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siemiatj/react-native-modal-dropdown/HEAD/expo-example/images/heart.png -------------------------------------------------------------------------------- /expo-example/assets/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siemiatj/react-native-modal-dropdown/HEAD/expo-example/assets/favicon.png -------------------------------------------------------------------------------- /example/.buckconfig: -------------------------------------------------------------------------------- 1 | 2 | [android] 3 | target = Google Inc.:Google APIs:23 4 | 5 | [maven_repositories] 6 | central = https://repo1.maven.org/maven2 7 | -------------------------------------------------------------------------------- /expo-example/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = function(api) { 2 | api.cache(true); 3 | return { 4 | presets: ['babel-preset-expo'], 5 | }; 6 | }; 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # IDE 6 | .idea 7 | 8 | node_modules 9 | npm-debug.log 10 | package-lock.json 11 | example/package-lock.json 12 | -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siemiatj/react-native-modal-dropdown/HEAD/example/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /example/android/keystores/debug.keystore.properties: -------------------------------------------------------------------------------- 1 | key.store=debug.keystore 2 | key.alias=androiddebugkey 3 | key.store.password=android 4 | key.alias.password=android 5 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siemiatj/react-native-modal-dropdown/HEAD/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siemiatj/react-native-modal-dropdown/HEAD/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siemiatj/react-native-modal-dropdown/HEAD/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/siemiatj/react-native-modal-dropdown/HEAD/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by sohobloo on 16/9/14. 3 | */ 4 | 5 | import ModalDropdown from './components/ModalDropdown'; 6 | export default ModalDropdown; 7 | module.exports = ModalDropdown; 8 | -------------------------------------------------------------------------------- /example/android/keystores/BUCK: -------------------------------------------------------------------------------- 1 | keystore( 2 | name = 'debug', 3 | store = 'debug.keystore', 4 | properties = 'debug.keystore.properties', 5 | visibility = [ 6 | 'PUBLIC', 7 | ], 8 | ) 9 | -------------------------------------------------------------------------------- /expo-example/.expo-shared/assets.json: -------------------------------------------------------------------------------- 1 | { 2 | "12bb71342c6255bbf50437ec8f4441c083f47cdb74bd89160c15e4f43e52a1cb": true, 3 | "40b842e832070c58deac6aa9e08fa459302ee3f9da492c7e77d93d2fbf4a56fd": true 4 | } 5 | -------------------------------------------------------------------------------- /expo-example/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/**/* 2 | .expo/* 3 | npm-debug.* 4 | *.jks 5 | *.p8 6 | *.p12 7 | *.key 8 | *.mobileprovision 9 | *.orig.* 10 | web-build/ 11 | 12 | # macOS 13 | .DS_Store 14 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip 6 | -------------------------------------------------------------------------------- /example/__tests__/index.ios.js: -------------------------------------------------------------------------------- 1 | import 'react-native'; 2 | import React from 'react'; 3 | import Index from '../index.ios.js'; 4 | 5 | // Note: test renderer must be required after react-native. 6 | import renderer from 'react-test-renderer'; 7 | 8 | it('renders correctly', () => { 9 | const tree = renderer.create( 10 | 11 | ); 12 | }); 13 | -------------------------------------------------------------------------------- /example/__tests__/index.android.js: -------------------------------------------------------------------------------- 1 | import 'react-native'; 2 | import React from 'react'; 3 | import Index from '../index.android.js'; 4 | 5 | // Note: test renderer must be required after react-native. 6 | import renderer from 'react-test-renderer'; 7 | 8 | it('renders correctly', () => { 9 | const tree = renderer.create( 10 | 11 | ); 12 | }); 13 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/com/demo/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.demo; 2 | 3 | import com.facebook.react.ReactActivity; 4 | 5 | public class MainActivity extends ReactActivity { 6 | 7 | /** 8 | * Returns the name of the main component registered from JavaScript. 9 | * This is used to schedule rendering of the component. 10 | */ 11 | @Override 12 | protected String getMainComponentName() { 13 | return "Demo"; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /example/ios/Demo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | @interface AppDelegate : UIResponder 13 | 14 | @property (nonatomic, strong) UIWindow *window; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /expo-example/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "expo": { 3 | "name": "Expo Demo", 4 | "slug": "expo-demo", 5 | "version": "1.0.0", 6 | "orientation": "portrait", 7 | "icon": "./assets/icon.png", 8 | "splash": { 9 | "image": "./assets/splash.png", 10 | "resizeMode": "contain", 11 | "backgroundColor": "#ffffff" 12 | }, 13 | "updates": { 14 | "fallbackToCacheTimeout": 0 15 | }, 16 | "assetBundlePatterns": [ 17 | "**/*" 18 | ], 19 | "ios": { 20 | "supportsTablet": true 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /expo-example/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "main": "node_modules/expo/AppEntry.js", 3 | "scripts": { 4 | "start": "expo start", 5 | "android": "expo start --android", 6 | "ios": "expo start --ios", 7 | "eject": "expo eject" 8 | }, 9 | "dependencies": { 10 | "expo": "^44.0.0", 11 | "expo-status-bar": "~1.2.0", 12 | "react": "17.0.1", 13 | "react-dom": "17.0.1", 14 | "react-native": "0.64.3" 15 | }, 16 | "devDependencies": { 17 | "@babel/core": "^7.12.9", 18 | "babel-preset-expo": "9.0.2" 19 | }, 20 | "private": true 21 | } 22 | -------------------------------------------------------------------------------- /example/ios/Demo/main.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | #import "AppDelegate.h" 13 | 14 | int main(int argc, char * argv[]) { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /example/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-native-modal-dropdown-demo", 3 | "version": "0.6.2", 4 | "description": "A demo for react-native-modal-dropdown component.", 5 | "homepage": "https://github.com/sohobloo/react-native-modal-dropdown", 6 | "license": "MIT", 7 | "author": "sohobloo (https://github.com/sohobloo)", 8 | "dependencies": { 9 | "react": "^16.2.0", 10 | "react-native": "^0.64.0", 11 | "react-native-modal-dropdown": "latest" 12 | }, 13 | "scripts": { 14 | "start": "node node_modules/react-native/local-cli/cli.js start" 15 | }, 16 | "private": true 17 | } 18 | -------------------------------------------------------------------------------- /example/android/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | repositories { 5 | jcenter() 6 | } 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:2.2.3' 9 | 10 | // NOTE: Do not place your application dependencies here; they belong 11 | // in the individual module build.gradle files 12 | } 13 | } 14 | 15 | allprojects { 16 | repositories { 17 | mavenLocal() 18 | jcenter() 19 | maven { 20 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm 21 | url "$rootDir/../node_modules/react-native/android" 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /example/ios/Demo/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /example/ios/DemoTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /example/ios/Demo-tvOSTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /.github/workflows/node.js.yml: -------------------------------------------------------------------------------- 1 | # This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node 2 | # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions 3 | 4 | name: Node.js CI 5 | 6 | on: 7 | push: 8 | branches: [ master ] 9 | pull_request: 10 | branches: [ master ] 11 | 12 | jobs: 13 | build: 14 | 15 | runs-on: ubuntu-latest 16 | 17 | strategy: 18 | matrix: 19 | node-version: [10.x, 12.x, 14.x] 20 | 21 | steps: 22 | - uses: actions/checkout@v2 23 | - name: Use Node.js ${{ matrix.node-version }} 24 | uses: actions/setup-node@v1 25 | with: 26 | node-version: ${{ matrix.node-version }} 27 | - run: npm i 28 | - run: npm ci 29 | - run: npm run build --if-present 30 | - run: npm test 31 | -------------------------------------------------------------------------------- /example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true 19 | 20 | android.useDeprecatedNdk=true 21 | -------------------------------------------------------------------------------- /example/.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # Xcode 6 | # 7 | build/ 8 | *.pbxuser 9 | !default.pbxuser 10 | *.mode1v3 11 | !default.mode1v3 12 | *.mode2v3 13 | !default.mode2v3 14 | *.perspectivev3 15 | !default.perspectivev3 16 | xcuserdata 17 | *.xccheckout 18 | *.moved-aside 19 | DerivedData 20 | *.hmap 21 | *.ipa 22 | *.xcuserstate 23 | project.xcworkspace 24 | 25 | # Android/IntelliJ 26 | # 27 | build/ 28 | .idea 29 | .gradle 30 | local.properties 31 | *.iml 32 | 33 | # node.js 34 | # 35 | node_modules/ 36 | npm-debug.log 37 | yarn-error.log 38 | 39 | # BUCK 40 | buck-out/ 41 | \.buckd/ 42 | *.keystore 43 | 44 | # fastlane 45 | # 46 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 47 | # screenshots whenever they are needed. 48 | # For more information about the recommended setup visit: 49 | # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md 50 | 51 | fastlane/report.xml 52 | fastlane/Preview.html 53 | fastlane/screenshots 54 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 sohobloo 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 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-native-modal-dropdown", 3 | "version": "1.0.2", 4 | "description": "A react-native dropdown component for both iOS and Android.", 5 | "keywords": [ 6 | "react", 7 | "react-component", 8 | "react-native", 9 | "react-native-component", 10 | "ios", 11 | "android", 12 | "modal", 13 | "dropdown", 14 | "picker", 15 | "select", 16 | "selector", 17 | "option" 18 | ], 19 | "homepage": "https://github.com/siemiatj/react-native-modal-dropdown", 20 | "bugs": { 21 | "url": "https://github.com/siemiatj/react-native-modal-dropdown/issues", 22 | "email": "kuba@saskla.cz" 23 | }, 24 | "license": "MIT", 25 | "author": "sohobloo (https://github.com/sohobloo)", 26 | "contributors": [ 27 | "sasklacz (https://saskla.cz)" 28 | ], 29 | "main": "index.js", 30 | "repository": { 31 | "type": "git", 32 | "url": "https://github.com/siemiatj/react-native-modal-dropdown.git" 33 | }, 34 | "dependencies": { 35 | "prop-types": "^15.6.0" 36 | }, 37 | "scripts": { 38 | "test": "echo \"no test specified\" && exit 0" 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/com/demo/MainApplication.java: -------------------------------------------------------------------------------- 1 | package com.demo; 2 | 3 | import android.app.Application; 4 | 5 | import com.facebook.react.ReactApplication; 6 | import com.facebook.react.ReactNativeHost; 7 | import com.facebook.react.ReactPackage; 8 | import com.facebook.react.shell.MainReactPackage; 9 | import com.facebook.soloader.SoLoader; 10 | 11 | import java.util.Arrays; 12 | import java.util.List; 13 | 14 | public class MainApplication extends Application implements ReactApplication { 15 | 16 | private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) { 17 | @Override 18 | protected String getJSMainModuleName() { return "index"; } 19 | 20 | @Override 21 | public boolean getUseDeveloperSupport() { 22 | return BuildConfig.DEBUG; 23 | } 24 | 25 | @Override 26 | protected List getPackages() { 27 | return Arrays.asList( 28 | new MainReactPackage() 29 | ); 30 | } 31 | }; 32 | 33 | @Override 34 | public ReactNativeHost getReactNativeHost() { 35 | return mReactNativeHost; 36 | } 37 | 38 | @Override 39 | public void onCreate() { 40 | super.onCreate(); 41 | SoLoader.init(this, /* native exopackage */ false); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 12 | 13 | 19 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /.github/workflows/npm-publish.yml: -------------------------------------------------------------------------------- 1 | # This workflow will run tests using node and then publish a package to GitHub Packages when a release is created 2 | # For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages 3 | 4 | name: Node.js Package 5 | 6 | on: 7 | release: 8 | types: [created] 9 | 10 | jobs: 11 | build: 12 | runs-on: ubuntu-latest 13 | steps: 14 | - uses: actions/checkout@v2 15 | - uses: actions/setup-node@v1 16 | with: 17 | node-version: 12 18 | - run: npm ci 19 | - run: npm test 20 | 21 | publish-npm: 22 | needs: build 23 | runs-on: ubuntu-latest 24 | steps: 25 | - uses: actions/checkout@v2 26 | - uses: actions/setup-node@v1 27 | with: 28 | node-version: 12 29 | registry-url: https://registry.npmjs.org/ 30 | - run: npm ci 31 | - run: npm publish 32 | env: 33 | NODE_AUTH_TOKEN: ${{secrets.npm_token}} 34 | 35 | publish-gpr: 36 | needs: build 37 | runs-on: ubuntu-latest 38 | steps: 39 | - uses: actions/checkout@v2 40 | - uses: actions/setup-node@v1 41 | with: 42 | node-version: 12 43 | registry-url: https://npm.pkg.github.com/ 44 | - run: npm ci 45 | - run: npm publish 46 | env: 47 | NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} 48 | -------------------------------------------------------------------------------- /example/ios/Demo/AppDelegate.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import "AppDelegate.h" 11 | 12 | #import 13 | #import 14 | 15 | @implementation AppDelegate 16 | 17 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 18 | { 19 | NSURL *jsCodeLocation; 20 | 21 | jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil]; 22 | 23 | RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation 24 | moduleName:@"Demo" 25 | initialProperties:nil 26 | launchOptions:launchOptions]; 27 | rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1]; 28 | 29 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 30 | UIViewController *rootViewController = [UIViewController new]; 31 | rootViewController.view = rootView; 32 | self.window.rootViewController = rootViewController; 33 | [self.window makeKeyAndVisible]; 34 | return YES; 35 | } 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /example/.flowconfig: -------------------------------------------------------------------------------- 1 | [ignore] 2 | ; We fork some components by platform 3 | .*/*[.]android.js 4 | 5 | ; Ignore "BUCK" generated dirs 6 | /\.buckd/ 7 | 8 | ; Ignore unexpected extra "@providesModule" 9 | .*/node_modules/.*/node_modules/fbjs/.* 10 | 11 | ; Ignore duplicate module providers 12 | ; For RN Apps installed via npm, "Libraries" folder is inside 13 | ; "node_modules/react-native" but in the source repo it is in the root 14 | .*/Libraries/react-native/React.js 15 | .*/Libraries/react-native/ReactNative.js 16 | 17 | [include] 18 | 19 | [libs] 20 | node_modules/react-native/Libraries/react-native/react-native-interface.js 21 | node_modules/react-native/flow 22 | flow/ 23 | 24 | [options] 25 | emoji=true 26 | 27 | module.system=haste 28 | 29 | experimental.strict_type_args=true 30 | 31 | munge_underscores=true 32 | 33 | module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub' 34 | 35 | suppress_type=$FlowIssue 36 | suppress_type=$FlowFixMe 37 | suppress_type=$FixMe 38 | 39 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(3[0-8]\\|[1-2][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\) 40 | suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(3[0-8]\\|1[0-9]\\|[1-2][0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+ 41 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy 42 | 43 | unsafe.enable_getters_and_setters=true 44 | 45 | [version] 46 | ^0.38.0 47 | -------------------------------------------------------------------------------- /example/android/app/BUCK: -------------------------------------------------------------------------------- 1 | import re 2 | 3 | # To learn about Buck see [Docs](https://buckbuild.com/). 4 | # To run your application with Buck: 5 | # - install Buck 6 | # - `npm start` - to start the packager 7 | # - `cd android` 8 | # - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"` 9 | # - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck 10 | # - `buck install -r android/app` - compile, install and run application 11 | # 12 | 13 | lib_deps = [] 14 | for jarfile in glob(['libs/*.jar']): 15 | name = 'jars__' + re.sub(r'^.*/([^/]+)\.jar$', r'\1', jarfile) 16 | lib_deps.append(':' + name) 17 | prebuilt_jar( 18 | name = name, 19 | binary_jar = jarfile, 20 | ) 21 | 22 | for aarfile in glob(['libs/*.aar']): 23 | name = 'aars__' + re.sub(r'^.*/([^/]+)\.aar$', r'\1', aarfile) 24 | lib_deps.append(':' + name) 25 | android_prebuilt_aar( 26 | name = name, 27 | aar = aarfile, 28 | ) 29 | 30 | android_library( 31 | name = 'all-libs', 32 | exported_deps = lib_deps 33 | ) 34 | 35 | android_library( 36 | name = 'app-code', 37 | srcs = glob([ 38 | 'src/main/java/**/*.java', 39 | ]), 40 | deps = [ 41 | ':all-libs', 42 | ':build_config', 43 | ':res', 44 | ], 45 | ) 46 | 47 | android_build_config( 48 | name = 'build_config', 49 | package = 'com.demo', 50 | ) 51 | 52 | android_resource( 53 | name = 'res', 54 | res = 'src/main/res', 55 | package = 'com.demo', 56 | ) 57 | 58 | android_binary( 59 | name = 'app', 60 | package_type = 'debug', 61 | manifest = 'src/main/AndroidManifest.xml', 62 | keystore = '//android/keystores:debug', 63 | deps = [ 64 | ':app-code', 65 | ], 66 | ) 67 | -------------------------------------------------------------------------------- /example/ios/Demo-tvOS/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UIViewControllerBasedStatusBarAppearance 38 | 39 | NSLocationWhenInUseUsageDescription 40 | 41 | NSAppTransportSecurity 42 | 43 | 44 | NSExceptionDomains 45 | 46 | localhost 47 | 48 | NSExceptionAllowsInsecureHTTPLoads 49 | 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /example/ios/Demo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | Demo 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSRequiresIPhoneOS 26 | 27 | UILaunchStoryboardName 28 | LaunchScreen 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UIViewControllerBasedStatusBarAppearance 40 | 41 | NSLocationWhenInUseUsageDescription 42 | 43 | NSAppTransportSecurity 44 | 45 | 46 | NSExceptionDomains 47 | 48 | localhost 49 | 50 | NSExceptionAllowsInsecureHTTPLoads 51 | 52 | 53 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /example/ios/DemoTests/DemoTests.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | #import 12 | 13 | #import 14 | #import 15 | 16 | #define TIMEOUT_SECONDS 600 17 | #define TEXT_TO_LOOK_FOR @"Welcome to React Native!" 18 | 19 | @interface DemoTests : XCTestCase 20 | 21 | @end 22 | 23 | @implementation DemoTests 24 | 25 | - (BOOL)findSubviewInView:(UIView *)view matching:(BOOL(^)(UIView *view))test 26 | { 27 | if (test(view)) { 28 | return YES; 29 | } 30 | for (UIView *subview in [view subviews]) { 31 | if ([self findSubviewInView:subview matching:test]) { 32 | return YES; 33 | } 34 | } 35 | return NO; 36 | } 37 | 38 | - (void)testRendersWelcomeScreen 39 | { 40 | UIViewController *vc = [[[[UIApplication sharedApplication] delegate] window] rootViewController]; 41 | NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS]; 42 | BOOL foundElement = NO; 43 | 44 | __block NSString *redboxError = nil; 45 | RCTSetLogFunction(^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) { 46 | if (level >= RCTLogLevelError) { 47 | redboxError = message; 48 | } 49 | }); 50 | 51 | while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) { 52 | [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 53 | [[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 54 | 55 | foundElement = [self findSubviewInView:vc.view matching:^BOOL(UIView *view) { 56 | if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) { 57 | return YES; 58 | } 59 | return NO; 60 | }]; 61 | } 62 | 63 | RCTSetLogFunction(RCTDefaultLogFunction); 64 | 65 | XCTAssertNil(redboxError, @"RedBox error: %@", redboxError); 66 | XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS); 67 | } 68 | 69 | 70 | @end 71 | -------------------------------------------------------------------------------- /example/android/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | 19 | # Disabling obfuscation is useful if you collect stack traces from production crashes 20 | # (unless you are using a system that supports de-obfuscate the stack traces). 21 | -dontobfuscate 22 | 23 | # React Native 24 | 25 | # Keep our interfaces so they can be used by other ProGuard rules. 26 | # See http://sourceforge.net/p/proguard/bugs/466/ 27 | -keep,allowobfuscation @interface com.facebook.proguard.annotations.DoNotStrip 28 | -keep,allowobfuscation @interface com.facebook.proguard.annotations.KeepGettersAndSetters 29 | -keep,allowobfuscation @interface com.facebook.common.internal.DoNotStrip 30 | 31 | # Do not strip any method/class that is annotated with @DoNotStrip 32 | -keep @com.facebook.proguard.annotations.DoNotStrip class * 33 | -keep @com.facebook.common.internal.DoNotStrip class * 34 | -keepclassmembers class * { 35 | @com.facebook.proguard.annotations.DoNotStrip *; 36 | @com.facebook.common.internal.DoNotStrip *; 37 | } 38 | 39 | -keepclassmembers @com.facebook.proguard.annotations.KeepGettersAndSetters class * { 40 | void set*(***); 41 | *** get*(); 42 | } 43 | 44 | -keep class * extends com.facebook.react.bridge.JavaScriptModule { *; } 45 | -keep class * extends com.facebook.react.bridge.NativeModule { *; } 46 | -keepclassmembers,includedescriptorclasses class * { native ; } 47 | -keepclassmembers class * { @com.facebook.react.uimanager.UIProp ; } 48 | -keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactProp ; } 49 | -keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactPropGroup ; } 50 | 51 | -dontwarn com.facebook.react.** 52 | 53 | # okhttp 54 | 55 | -keepattributes Signature 56 | -keepattributes *Annotation* 57 | -keep class okhttp3.** { *; } 58 | -keep interface okhttp3.** { *; } 59 | -dontwarn okhttp3.** 60 | 61 | # okio 62 | 63 | -keep class sun.misc.Unsafe { *; } 64 | -dontwarn java.nio.file.* 65 | -dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement 66 | -dontwarn okio.** 67 | -------------------------------------------------------------------------------- /example/android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /example/ios/Demo/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 21 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /example/ios/Demo.xcodeproj/xcshareddata/xcschemes/Demo.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 43 | 49 | 50 | 51 | 52 | 53 | 58 | 59 | 61 | 67 | 68 | 69 | 70 | 71 | 77 | 78 | 79 | 80 | 81 | 82 | 92 | 94 | 100 | 101 | 102 | 103 | 104 | 105 | 111 | 113 | 119 | 120 | 121 | 122 | 124 | 125 | 128 | 129 | 130 | -------------------------------------------------------------------------------- /example/ios/Demo.xcodeproj/xcshareddata/xcschemes/Demo-tvOS.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 43 | 49 | 50 | 51 | 52 | 53 | 58 | 59 | 61 | 67 | 68 | 69 | 70 | 71 | 77 | 78 | 79 | 80 | 81 | 82 | 92 | 94 | 100 | 101 | 102 | 103 | 104 | 105 | 111 | 113 | 119 | 120 | 121 | 122 | 124 | 125 | 128 | 129 | 130 | -------------------------------------------------------------------------------- /example/android/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # For Cygwin, ensure paths are in UNIX format before anything is touched. 46 | if $cygwin ; then 47 | [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` 48 | fi 49 | 50 | # Attempt to set APP_HOME 51 | # Resolve links: $0 may be a link 52 | PRG="$0" 53 | # Need this for relative symlinks. 54 | while [ -h "$PRG" ] ; do 55 | ls=`ls -ld "$PRG"` 56 | link=`expr "$ls" : '.*-> \(.*\)$'` 57 | if expr "$link" : '/.*' > /dev/null; then 58 | PRG="$link" 59 | else 60 | PRG=`dirname "$PRG"`"/$link" 61 | fi 62 | done 63 | SAVED="`pwd`" 64 | cd "`dirname \"$PRG\"`/" >&- 65 | APP_HOME="`pwd -P`" 66 | cd "$SAVED" >&- 67 | 68 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 69 | 70 | # Determine the Java command to use to start the JVM. 71 | if [ -n "$JAVA_HOME" ] ; then 72 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 73 | # IBM's JDK on AIX uses strange locations for the executables 74 | JAVACMD="$JAVA_HOME/jre/sh/java" 75 | else 76 | JAVACMD="$JAVA_HOME/bin/java" 77 | fi 78 | if [ ! -x "$JAVACMD" ] ; then 79 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 80 | 81 | Please set the JAVA_HOME variable in your environment to match the 82 | location of your Java installation." 83 | fi 84 | else 85 | JAVACMD="java" 86 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 87 | 88 | Please set the JAVA_HOME variable in your environment to match the 89 | location of your Java installation." 90 | fi 91 | 92 | # Increase the maximum file descriptors if we can. 93 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 94 | MAX_FD_LIMIT=`ulimit -H -n` 95 | if [ $? -eq 0 ] ; then 96 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 97 | MAX_FD="$MAX_FD_LIMIT" 98 | fi 99 | ulimit -n $MAX_FD 100 | if [ $? -ne 0 ] ; then 101 | warn "Could not set maximum file descriptor limit: $MAX_FD" 102 | fi 103 | else 104 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 105 | fi 106 | fi 107 | 108 | # For Darwin, add options to specify how the application appears in the dock 109 | if $darwin; then 110 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 111 | fi 112 | 113 | # For Cygwin, switch paths to Windows format before running java 114 | if $cygwin ; then 115 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 116 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 158 | function splitJvmOpts() { 159 | JVM_OPTS=("$@") 160 | } 161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 163 | 164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 165 | -------------------------------------------------------------------------------- /example/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "com.android.application" 2 | 3 | import com.android.build.OutputFile 4 | 5 | /** 6 | * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets 7 | * and bundleReleaseJsAndAssets). 8 | * These basically call `react-native bundle` with the correct arguments during the Android build 9 | * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the 10 | * bundle directly from the development server. Below you can see all the possible configurations 11 | * and their defaults. If you decide to add a configuration block, make sure to add it before the 12 | * `apply from: "../../node_modules/react-native/react.gradle"` line. 13 | * 14 | * project.ext.react = [ 15 | * // the name of the generated asset file containing your JS bundle 16 | * bundleAssetName: "index.android.bundle", 17 | * 18 | * // the entry file for bundle generation 19 | * entryFile: "index.android.js", 20 | * 21 | * // whether to bundle JS and assets in debug mode 22 | * bundleInDebug: false, 23 | * 24 | * // whether to bundle JS and assets in release mode 25 | * bundleInRelease: true, 26 | * 27 | * // whether to bundle JS and assets in another build variant (if configured). 28 | * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants 29 | * // The configuration property can be in the following formats 30 | * // 'bundleIn${productFlavor}${buildType}' 31 | * // 'bundleIn${buildType}' 32 | * // bundleInFreeDebug: true, 33 | * // bundleInPaidRelease: true, 34 | * // bundleInBeta: true, 35 | * 36 | * // the root of your project, i.e. where "package.json" lives 37 | * root: "../../", 38 | * 39 | * // where to put the JS bundle asset in debug mode 40 | * jsBundleDirDebug: "$buildDir/intermediates/assets/debug", 41 | * 42 | * // where to put the JS bundle asset in release mode 43 | * jsBundleDirRelease: "$buildDir/intermediates/assets/release", 44 | * 45 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 46 | * // require('./image.png')), in debug mode 47 | * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug", 48 | * 49 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 50 | * // require('./image.png')), in release mode 51 | * resourcesDirRelease: "$buildDir/intermediates/res/merged/release", 52 | * 53 | * // by default the gradle tasks are skipped if none of the JS files or assets change; this means 54 | * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to 55 | * // date; if you have any other folders that you want to ignore for performance reasons (gradle 56 | * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/ 57 | * // for example, you might want to remove it from here. 58 | * inputExcludes: ["android/**", "ios/**"], 59 | * 60 | * // override which node gets called and with what additional arguments 61 | * nodeExecutableAndArgs: ["node"] 62 | * 63 | * // supply additional arguments to the packager 64 | * extraPackagerArgs: [] 65 | * ] 66 | */ 67 | 68 | apply from: "../../node_modules/react-native/react.gradle" 69 | 70 | /** 71 | * Set this to true to create two separate APKs instead of one: 72 | * - An APK that only works on ARM devices 73 | * - An APK that only works on x86 devices 74 | * The advantage is the size of the APK is reduced by about 4MB. 75 | * Upload all the APKs to the Play Store and people will download 76 | * the correct one based on the CPU architecture of their device. 77 | */ 78 | def enableSeparateBuildPerCPUArchitecture = false 79 | 80 | /** 81 | * Run Proguard to shrink the Java bytecode in release builds. 82 | */ 83 | def enableProguardInReleaseBuilds = false 84 | 85 | android { 86 | compileSdkVersion 23 87 | buildToolsVersion "23.0.1" 88 | 89 | defaultConfig { 90 | applicationId "com.demo" 91 | minSdkVersion 16 92 | targetSdkVersion 22 93 | versionCode 1 94 | versionName "1.0" 95 | ndk { 96 | abiFilters "armeabi-v7a", "x86" 97 | } 98 | } 99 | splits { 100 | abi { 101 | reset() 102 | enable enableSeparateBuildPerCPUArchitecture 103 | universalApk false // If true, also generate a universal APK 104 | include "armeabi-v7a", "x86" 105 | } 106 | } 107 | buildTypes { 108 | release { 109 | minifyEnabled enableProguardInReleaseBuilds 110 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" 111 | } 112 | } 113 | // applicationVariants are e.g. debug, release 114 | applicationVariants.all { variant -> 115 | variant.outputs.each { output -> 116 | // For each separate APK per architecture, set a unique version code as described here: 117 | // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits 118 | def versionCodes = ["armeabi-v7a":1, "x86":2] 119 | def abi = output.getFilter(OutputFile.ABI) 120 | if (abi != null) { // null for the universal-debug, universal-release variants 121 | output.versionCodeOverride = 122 | versionCodes.get(abi) * 1048576 + defaultConfig.versionCode 123 | } 124 | } 125 | } 126 | } 127 | 128 | dependencies { 129 | compile fileTree(dir: "libs", include: ["*.jar"]) 130 | compile "com.android.support:appcompat-v7:23.0.1" 131 | compile "com.facebook.react:react-native:+" // From node_modules 132 | } 133 | 134 | // Run this once to be able to run the application with BUCK 135 | // puts all compile dependencies into folder libs for BUCK to use 136 | task copyDownloadableDepsToLibs(type: Copy) { 137 | from configurations.compile 138 | into 'libs' 139 | } 140 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![npm version](https://badge.fury.io/js/react-native-modal-dropdown.svg)](https://badge.fury.io/js/react-native-modal-dropdown) 2 | 3 | # react-native-modal-dropdown 4 | A react-native dropdown/picker/selector component for both Android & iOS. 5 | 6 | This is the most up to date fork of https://github.com/sohobloo/react-native-modal-dropdown and will be maintained. A discussion about that can be found here: https://github.com/sohobloo/react-native-modal-dropdown/issues/251 7 | 8 | ## Features 9 | - Pure JS. 10 | - Compatible with both iOS and Android. 11 | - Auto position. (Won't be covered or clipped by the edge of screen.) 12 | - Zero configuration. (Options are needed of course or a loading indicator will show.) 13 | - Highly customizable. 14 | - Controllable with API by code. (Show/Hide/Select) 15 | - Change everything into a dropdown list trigger. 16 | 17 | ## Demo 18 | Demo 1 Demo 2 Demo 3 19 | 20 | You can find them in the example. 21 | 22 | ## Update History 23 | 24 | ### v1.0.2 25 | - Fixed Issue when initialScrollIndex failed. Added missing props: ref, getItemLayout, onScrollToIndexFailed 26 | - Added keySearchObject option for search objects of array option 27 | 28 | ### v1.0.1 29 | - small fixes and more styling custimizations allowed 30 | 31 | ### v1.0.0 32 | - took over the package and merged user's PRs 33 | 34 | ### v0.7.0 35 | - Quick fix for react native 0.60. (Thanks to [@ibtesamlatif2997](https://github.com/ibtesamlatif2997)) 36 | 37 | [Full update history list](https://github.com/sohobloo/react-native-modal-dropdown/wiki/Update-History) 38 | 39 | ## Installation 40 | ```sh 41 | npm i --save react-native-modal-dropdown 42 | ``` 43 | or 44 | ```sh 45 | yarn add react-native-modal-dropdown 46 | ``` 47 | 48 | ## Usage 49 | ### Basic 50 | Import this module: 51 | ```javascript 52 | import ModalDropdown from 'react-native-modal-dropdown'; 53 | ``` 54 | Use as a component: 55 | ```javascript 56 | 57 | ``` 58 | Use as a wrapper / container: 59 | ```javascript 60 | 61 | ... 62 | 63 | ``` 64 | 65 | ### Customization 66 | Give the style props as your choice: 67 | - `style`: Change the style of the button (basic mode) / container (wrapper mode). 68 | - `textStyle`: Change the style of text of the button. *Invalid in wrapper mode.* 69 | - `dropdownStyle`: Change the style of dropdown container. 70 | 71 | You can also render your option row and row separator by implement `renderRow` and `renderSeparator` function. 72 | 73 | ## API 74 | ### Props 75 | Prop | Type | Optional | Default | Description 76 | ------------------- | -------- | -------- | --------- | ----------- 77 | `disabled` | bool | Yes | false | disable / enable the component. 78 | `defaultIndex` | number | Yes | -1 | Init selected index. `-1`: None is selected. **This only change the highlight of the dropdown row, you have to give a `defaultValue` to change the init text.** 79 | `defaultValue` | string | Yes | Please select... | Init text of the button. **Invalid in wrapper mode.** 80 | `options` | array | Yes | | Options. **The dropdown will show a loading indicator if `options` is `null`/`undefined`.** 81 | `animated` | bool | Yes | true | Disable / enable fade animation. 82 | `isFullWidth` | bool | Yes | false | Disable / enable is dropdown render as full width. 83 | `showsVerticalScrollIndicator` | bool | Yes | true | Show / hide vertical scroll indicator. 84 | `saveScrollPosition` | bool | Yes | true | Sets the scroll position to selected index. 85 | `style` | object | Yes | | Style of the button. 86 | `textStyle` | object | Yes | | Style of the button text. **Invalid in wrapper mode.** 87 | `defaultTextStyle` | object | Yes | | Overried Style of the button text for default value. **Invalid in wrapper mode.** 88 | `dropdownStyle` | object | Yes | | Style of the dropdown list. 89 | `dropdownTextStyle` | object | Yes | | Style of the dropdown option text. 90 | `dropdownTextHighlightStyle` | object | Yes | | Style of the dropdown selected option text. 91 | `dropdownTextProps` | object | Yes | | Add custom props to the dropdown option text 92 | `adjustFrame` | func | Yes | | This is a callback after the frame of the dropdown have been calculated and before showing. You will receive a style object as argument with some of the props like `width` `height` `top` `left` and `right`. Change them to appropriate values that accord with your requirement and **make the new style as the return value of this function**. 93 | `renderRow` | func | Yes | | Customize render option rows: `function(option,index,isSelected)` **Will render a default row if `null`/`undefined`.** 94 | `renderRowComponent`| Component | Yes | `TouchableOpacity` for iOS and `TouchableHighlight` for Android | Customize the touchable component of the rows 95 | `renderRowProps` | object | Yes | | Add custom props to the touchable component of the rows 96 | `renderSeparator` | func | Yes | | Customize render dropdown list separators. **Will render a default thin gray line if `null`/`undefined`.** 97 | `renderButtonText` | func | Yes | | Use this to extract and return text from option object. This text will show on button after option selected. **Invalid in wrapper mode.** 98 | `renderRowText` | func | Yes | | Use this to extract and return text from option object. This text will show on row **Invalid in wrapper mode.** 99 | `renderButtonComponent`| Component | Yes | `TouchableOpacity` | Customize the touchable component of the button 100 | `renderRightComponent`| Component | Yes | `View` | Custom component/Image to display on right side as dropdown icon 101 | `renderButtonProps` | object | Yes | | Add custom props to the touchable component of the button 102 | `onDropdownWillShow`| func | Yes | | Trigger when dropdown will show by touching the button. **Return `false` can cancel the event.** 103 | `onDropdownWillHide`| func | Yes | | Trigger when dropdown will hide by touching the button. **Return `false` can cancel the event.** 104 | `onSelect` | func | Yes | | Trigger when option row touched with selected `index` and `value`. **Return `false` can cancel the event.** 105 | `accessible` | bool | Yes | true | Set accessibility of dropdown modal and dropdown rows 106 | `keyboardShouldPersistTaps` | enum('always', 'never', 'handled') | Yes | 'never' | See react-native `ScrollView` props 107 | `multipleSelect` | bool | Yes | false | Remove event closing modal when calling onSelect. 108 | `dropdownListProps` | object | Yes | null | FlatList props 109 | `showSearch` | bool | Yes | false | Setting showSearch to true will render the list header with a search 110 | `renderSearch` | Component | Yes | null | Allows to pass search component (required `showSearch` props ) 111 | `keySearchObject` | string | Yes | 'label' | If your option is an array containing objects, option will find element via `keySearchObject` 112 | `buttonAndRightComponentContainerStyle` | object | Yes | | Prop to style the container View of the `` and the `` 113 | 114 | ### Methods 115 | Method | Description 116 | ----------------- | ----------- 117 | `show()` | Show the dropdown. **Won't trigger `onDropdownWillShow`.** 118 | `hide()` | Hide the dropdown. **Won't trigger `onDropdownWillHide`.** 119 | `select(idx)` | Select the specified option of the `idx`. Select `-1` will reset it to display `defaultValue`. **Won't trigger `onSelect`.** 120 | 121 | ## Next version 122 | Any suggestion is welcome. 123 | -------------------------------------------------------------------------------- /example/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Sample React Native App 3 | * https://github.com/facebook/react-native 4 | * @flow 5 | */ 6 | 7 | import React, {Component} from 'react'; 8 | import { 9 | AppRegistry, 10 | StyleSheet, 11 | Text, 12 | View, 13 | Image, 14 | TouchableOpacity, 15 | TouchableHighlight, 16 | ScrollView, 17 | } from 'react-native'; 18 | 19 | // import ModalDropdown from 'react-native-modal-dropdown'; 20 | import ModalDropdown from './ModalDropdown'; 21 | 22 | const DEMO_OPTIONS_1 = ['option 1', 'option 2', 'option 3', 'option 4', 'option 5', 'option 6', 'option 7', 'option 8', 'option 9']; 23 | const DEMO_OPTIONS_2 = [ 24 | {"name": "Rex", "age": 30}, 25 | {"name": "Mary", "age": 25}, 26 | {"name": "John", "age": 41}, 27 | {"name": "Jim", "age": 22}, 28 | {"name": "Susan", "age": 52}, 29 | {"name": "Brent", "age": 33}, 30 | {"name": "Alex", "age": 16}, 31 | {"name": "Ian", "age": 20}, 32 | {"name": "Phil", "age": 24}, 33 | ]; 34 | 35 | class Demo extends Component { 36 | constructor(props) { 37 | super(props); 38 | 39 | this.state = { 40 | dropdown_4_options: null, 41 | dropdown_4_defaultValue: 'loading...', 42 | dropdown_6_icon_heart: true, 43 | }; 44 | } 45 | 46 | render() { 47 | const dropdown_6_icon = this.state.dropdown_6_icon_heart ? require('./images/heart.png') : require('./images/flower.png'); 48 | return ( 49 | 50 | 51 | 52 | 55 | this._dropdown_6_onSelect(idx, value)}> 58 | 61 | 62 | 63 | 64 | this._dropdown_2_renderButtonText(rowData)} 70 | renderRow={this._dropdown_2_renderRow.bind(this)} 71 | renderSeparator={(sectionID, rowID, adjacentRowHighlighted) => this._dropdown_2_renderSeparator(sectionID, rowID, adjacentRowHighlighted)} 72 | /> 73 | { 74 | this.refs.dropdown_2.select(0); 75 | }}> 76 | 77 | select Rex 78 | 79 | 80 | 81 | 82 | 83 | this._scrollView = el} 84 | style={styles.scrollView} 85 | contentContainerStyle={styles.contentContainer} 86 | showsVerticalScrollIndicator={true} 87 | scrollEventThrottle={1}> 88 | 89 | {'Scroll view example.'} 90 | 91 | this._dropdown_3 = el} 92 | style={styles.dropdown_3} 93 | options={DEMO_OPTIONS_1} 94 | adjustFrame={style => this._dropdown_3_adjustFrame(style)} 95 | dropdownTextStyle={styles.dropdown_3_dropdownTextStyle} 96 | dropdownTextHighlightStyle={styles.dropdown_3_dropdownTextHighlightStyle} 97 | /> 98 | 99 | 100 | 101 | 102 | this._dropdown_4_onSelect(idx, value)} 110 | /> 111 | 112 | 113 | 114 | 115 | {'Show dropdown'} 116 | 117 | 118 | this._dropdown_5_select(2)}> 119 | 120 | {'Select the 3rd option'} 121 | 122 | 123 | this._dropdown_5_select(-1)}> 124 | 125 | {'Clear selection'} 126 | 127 | 128 | this._dropdown_5 = el} 129 | style={styles.dropdown_5} 130 | options={['Select me to hide', `I can't be selected`, 'I can only be selected outside']} 131 | defaultValue='Try the Show button above' 132 | onDropdownWillShow={this._dropdown_5_willShow.bind(this)} 133 | onDropdownWillHide={this._dropdown_5_willHide.bind(this)} 134 | onSelect={this._dropdown_5_onSelect.bind(this)} 135 | /> 136 | 137 | 138 | 139 | ); 140 | } 141 | 142 | _dropdown_2_renderButtonText(rowData) { 143 | const {name, age} = rowData; 144 | return `${name} - ${age}`; 145 | } 146 | 147 | _dropdown_2_renderRow(rowData, rowID, highlighted) { 148 | let icon = highlighted ? require('./images/heart.png') : require('./images/flower.png'); 149 | let evenRow = rowID % 2; 150 | return ( 151 | 152 | 153 | 157 | 158 | {`${rowData.name} (${rowData.age})`} 159 | 160 | 161 | 162 | ); 163 | } 164 | 165 | _dropdown_2_renderSeparator(sectionID, rowID, adjacentRowHighlighted) { 166 | if (rowID == DEMO_OPTIONS_1.length - 1) return; 167 | let key = `spr_${rowID}`; 168 | return (); 171 | } 172 | 173 | _dropdown_3_adjustFrame(style) { 174 | console.log(`frameStyle={width:${style.width}, height:${style.height}, top:${style.top}, left:${style.left}, right:${style.right}}`); 175 | style.top -= 15; 176 | style.left += 150; 177 | return style; 178 | } 179 | 180 | _dropdown_4_willShow() { 181 | setTimeout(() => this.setState({ 182 | dropdown_4_options: DEMO_OPTIONS_1, 183 | dropdown_4_defaultValue: 'loaded', 184 | }), 2000); 185 | } 186 | 187 | _dropdown_4_willHide() { 188 | this.setState({ 189 | dropdown_4_options: null, 190 | dropdown_4_defaultValue: 'loading', 191 | }); 192 | } 193 | 194 | _dropdown_4_onSelect(idx, value) { 195 | // BUG: alert in a modal will auto dismiss and causes crash after reload and touch. @sohobloo 2016-12-1 196 | //alert(`idx=${idx}, value='${value}'`); 197 | console.debug(`idx=${idx}, value='${value}'`); 198 | } 199 | 200 | _dropdown_5_show() { 201 | this._dropdown_5 && this._dropdown_5.show(); 202 | } 203 | 204 | _dropdown_5_select(idx) { 205 | this._dropdown_5 && this._dropdown_5.select(idx); 206 | } 207 | 208 | _dropdown_5_willShow() { 209 | return false; 210 | } 211 | 212 | _dropdown_5_willHide() { 213 | let idx = this._dropdown_5_idx; 214 | this._dropdown_5_idx = undefined; 215 | return idx == 0; 216 | } 217 | 218 | _dropdown_5_onSelect(idx, value) { 219 | this._dropdown_5_idx = idx; 220 | if (this._dropdown_5_idx != 0) { 221 | return false; 222 | } 223 | } 224 | 225 | _dropdown_6_onSelect(idx, value) { 226 | this.setState({ 227 | dropdown_6_icon_heart: !this.state.dropdown_6_icon_heart, 228 | }) 229 | } 230 | } 231 | 232 | const styles = StyleSheet.create({ 233 | container: { 234 | flex: 1, 235 | }, 236 | row: { 237 | flex: 1, 238 | flexDirection: 'row', 239 | }, 240 | cell: { 241 | flex: 1, 242 | borderWidth: StyleSheet.hairlineWidth, 243 | }, 244 | scrollView: { 245 | flex: 1, 246 | }, 247 | contentContainer: { 248 | height: 500, 249 | paddingVertical: 100, 250 | paddingLeft: 20, 251 | }, 252 | textButton: { 253 | color: 'deepskyblue', 254 | borderWidth: StyleSheet.hairlineWidth, 255 | borderColor: 'deepskyblue', 256 | margin: 2, 257 | }, 258 | 259 | dropdown_1: { 260 | flex: 1, 261 | top: 32, 262 | left: 8, 263 | }, 264 | dropdown_2: { 265 | alignSelf: 'flex-end', 266 | width: 150, 267 | marginTop: 32, 268 | right: 8, 269 | borderWidth: 0, 270 | borderRadius: 3, 271 | backgroundColor: 'cornflowerblue', 272 | }, 273 | dropdown_2_text: { 274 | marginVertical: 10, 275 | marginHorizontal: 6, 276 | fontSize: 18, 277 | color: 'white', 278 | textAlign: 'center', 279 | textAlignVertical: 'center', 280 | }, 281 | dropdown_2_dropdown: { 282 | width: 150, 283 | height: 300, 284 | borderColor: 'cornflowerblue', 285 | borderWidth: 2, 286 | borderRadius: 3, 287 | }, 288 | dropdown_2_row: { 289 | flexDirection: 'row', 290 | height: 40, 291 | alignItems: 'center', 292 | }, 293 | dropdown_2_image: { 294 | marginLeft: 4, 295 | width: 30, 296 | height: 30, 297 | }, 298 | dropdown_2_row_text: { 299 | marginHorizontal: 4, 300 | fontSize: 16, 301 | color: 'navy', 302 | textAlignVertical: 'center', 303 | }, 304 | dropdown_2_separator: { 305 | height: 1, 306 | backgroundColor: 'cornflowerblue', 307 | }, 308 | dropdown_3: { 309 | width: 150, 310 | borderColor: 'lightgray', 311 | borderWidth: 1, 312 | borderRadius: 1, 313 | }, 314 | dropdown_3_dropdownTextStyle: { 315 | backgroundColor: '#000', 316 | color: '#fff' 317 | }, 318 | dropdown_3_dropdownTextHighlightStyle: { 319 | backgroundColor: '#fff', 320 | color: '#000' 321 | }, 322 | dropdown_4: { 323 | margin: 8, 324 | borderColor: 'lightgray', 325 | borderWidth: 1, 326 | borderRadius: 1, 327 | }, 328 | dropdown_4_dropdown: { 329 | width: 100, 330 | }, 331 | dropdown_5: { 332 | margin: 8, 333 | borderColor: 'lightgray', 334 | borderWidth: 1, 335 | borderRadius: 1, 336 | }, 337 | dropdown_6: { 338 | flex: 1, 339 | left: 8, 340 | }, 341 | dropdown_6_image: { 342 | width: 40, 343 | height: 40, 344 | }, 345 | }); 346 | 347 | AppRegistry.registerComponent('Demo', () => Demo); 348 | -------------------------------------------------------------------------------- /expo-example/App.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Sample React Native App 3 | * https://github.com/facebook/react-native 4 | * @flow 5 | */ 6 | 7 | import React, {Component} from 'react'; 8 | import { 9 | StyleSheet, 10 | Text, 11 | View, 12 | Image, 13 | TouchableOpacity, 14 | TouchableHighlight, 15 | ScrollView, 16 | } from 'react-native'; 17 | import { StatusBar } from 'expo-status-bar'; 18 | 19 | // import ModalDropdown from 'react-native-modal-dropdown'; 20 | import ModalDropdown from './ModalDropdown'; 21 | 22 | const DEMO_OPTIONS_1 = ['option 1', 'option 2', 'option 3', 'option 4', 'option 5', 'option 6', 'option 7', 'option 8', 'option 9']; 23 | const DEMO_OPTIONS_2 = [ 24 | {"name": "Rex", "age": 30}, 25 | {"name": "Mary", "age": 25}, 26 | {"name": "John", "age": 41}, 27 | {"name": "Jim", "age": 22}, 28 | {"name": "Susan", "age": 52}, 29 | {"name": "Brent", "age": 33}, 30 | {"name": "Alex", "age": 16}, 31 | {"name": "Ian", "age": 20}, 32 | {"name": "Phil", "age": 24}, 33 | ]; 34 | 35 | class App extends Component { 36 | constructor(props) { 37 | super(props); 38 | 39 | this.state = { 40 | dropdown_4_options: [], 41 | dropdown_4_defaultValue: 'loading...', 42 | dropdown_6_icon_heart: true, 43 | }; 44 | } 45 | 46 | render() { 47 | const dropdown_6_icon = this.state.dropdown_6_icon_heart ? require('./images/heart.png') : require('./images/flower.png'); 48 | return ( 49 | 50 | 51 | 52 | 53 | 58 | this._dropdown_6_onSelect(idx, value)}> 61 | 64 | 65 | 66 | 67 | this._dropdown_2_renderButtonText(rowData)} 73 | renderRow={this._dropdown_2_renderRow.bind(this)} 74 | renderRowComponent={TouchableHighlight} 75 | renderSeparator={(sectionID, rowID, adjacentRowHighlighted) => this._dropdown_2_renderSeparator(sectionID, rowID, adjacentRowHighlighted)} 76 | /> 77 | { 78 | this.refs.dropdown_2.select(0); 79 | }}> 80 | 81 | select Rex 82 | 83 | 84 | 85 | 86 | 87 | this._scrollView = el} 88 | style={styles.scrollView} 89 | contentContainerStyle={styles.contentContainer} 90 | showsVerticalScrollIndicator={true} 91 | scrollEventThrottle={1}> 92 | 93 | {'Scroll view example.'} 94 | 95 | this._dropdown_3 = el} 96 | style={styles.dropdown_3} 97 | options={DEMO_OPTIONS_1} 98 | adjustFrame={style => this._dropdown_3_adjustFrame(style)} 99 | dropdownTextStyle={styles.dropdown_3_dropdownTextStyle} 100 | dropdownTextHighlightStyle={styles.dropdown_3_dropdownTextHighlightStyle} 101 | /> 102 | 103 | 104 | 105 | 106 | this._dropdown_4_onSelect(idx, value)} 114 | /> 115 | 116 | 117 | 118 | 119 | {'Show dropdown'} 120 | 121 | 122 | this._dropdown_5_select(2)}> 123 | 124 | {'Select the 3rd option'} 125 | 126 | 127 | this._dropdown_5_select(-1)}> 128 | 129 | {'Clear selection'} 130 | 131 | 132 | this._dropdown_5 = el} 133 | style={styles.dropdown_5} 134 | options={['Select me to hide', `I can't be selected`, 'I can only be selected outside']} 135 | defaultValue='Try the Show button above' 136 | onDropdownWillShow={this._dropdown_5_willShow.bind(this)} 137 | onDropdownWillHide={this._dropdown_5_willHide.bind(this)} 138 | onSelect={this._dropdown_5_onSelect.bind(this)} 139 | /> 140 | 141 | 142 | 143 | ); 144 | } 145 | 146 | _dropdown_2_renderButtonText(rowData) { 147 | const {name, age} = rowData; 148 | return `${name} - ${age}`; 149 | } 150 | 151 | _dropdown_2_renderRow(rowData, rowID, highlighted) { 152 | let icon = highlighted ? require('./images/heart.png') : require('./images/flower.png'); 153 | let evenRow = rowID % 2; 154 | return ( 155 | 156 | 160 | 161 | {`${rowData.name} (${rowData.age})`} 162 | 163 | 164 | ); 165 | } 166 | 167 | _dropdown_2_renderSeparator(sectionID, rowID, adjacentRowHighlighted) { 168 | if (rowID == DEMO_OPTIONS_1.length - 1) return; 169 | let key = `spr_${rowID}`; 170 | return (); 173 | } 174 | 175 | _dropdown_3_adjustFrame(style) { 176 | console.log(`frameStyle={width:${style.width}, height:${style.height}, top:${style.top}, left:${style.left}, right:${style.right}}`); 177 | style.top -= 15; 178 | style.left += 150; 179 | return style; 180 | } 181 | 182 | _dropdown_4_willShow() { 183 | setTimeout(() => this.setState({ 184 | dropdown_4_options: DEMO_OPTIONS_1, 185 | dropdown_4_defaultValue: 'loaded', 186 | }), 2000); 187 | } 188 | 189 | _dropdown_4_willHide() { 190 | this.setState({ 191 | dropdown_4_options: [], 192 | dropdown_4_defaultValue: 'loading', 193 | }); 194 | } 195 | 196 | _dropdown_4_onSelect(idx, value) { 197 | // BUG: alert in a modal will auto dismiss and causes crash after reload and touch. @sohobloo 2016-12-1 198 | //alert(`idx=${idx}, value='${value}'`); 199 | console.debug(`idx=${idx}, value='${value}'`); 200 | } 201 | 202 | _dropdown_5_show() { 203 | this._dropdown_5 && this._dropdown_5.show(); 204 | } 205 | 206 | _dropdown_5_select(idx) { 207 | this._dropdown_5 && this._dropdown_5.select(idx); 208 | } 209 | 210 | _dropdown_5_willShow() { 211 | return false; 212 | } 213 | 214 | _dropdown_5_willHide() { 215 | let idx = this._dropdown_5_idx; 216 | this._dropdown_5_idx = undefined; 217 | return idx == 0; 218 | } 219 | 220 | _dropdown_5_onSelect(idx, value) { 221 | this._dropdown_5_idx = idx; 222 | if (this._dropdown_5_idx != 0) { 223 | return false; 224 | } 225 | } 226 | 227 | _dropdown_6_onSelect(idx, value) { 228 | this.setState({ 229 | dropdown_6_icon_heart: !this.state.dropdown_6_icon_heart, 230 | }) 231 | } 232 | } 233 | 234 | const styles = StyleSheet.create({ 235 | container: { 236 | flex: 1, 237 | }, 238 | row: { 239 | flex: 1, 240 | flexDirection: 'row', 241 | }, 242 | cell: { 243 | flex: 1, 244 | borderWidth: StyleSheet.hairlineWidth, 245 | }, 246 | scrollView: { 247 | flex: 1, 248 | }, 249 | contentContainer: { 250 | height: 500, 251 | paddingVertical: 100, 252 | paddingLeft: 20, 253 | }, 254 | textButton: { 255 | color: 'deepskyblue', 256 | borderWidth: StyleSheet.hairlineWidth, 257 | borderColor: 'deepskyblue', 258 | margin: 2, 259 | }, 260 | 261 | dropdown_1: { 262 | flex: 1, 263 | top: 32, 264 | left: 8, 265 | }, 266 | dropdown_2: { 267 | alignSelf: 'flex-end', 268 | width: 150, 269 | marginTop: 32, 270 | right: 8, 271 | borderWidth: 0, 272 | borderRadius: 3, 273 | backgroundColor: 'cornflowerblue', 274 | }, 275 | dropdown_2_text: { 276 | marginVertical: 10, 277 | marginHorizontal: 6, 278 | fontSize: 18, 279 | color: 'white', 280 | textAlign: 'center', 281 | textAlignVertical: 'center', 282 | }, 283 | dropdown_2_dropdown: { 284 | width: 150, 285 | height: 300, 286 | borderColor: 'cornflowerblue', 287 | borderWidth: 2, 288 | borderRadius: 3, 289 | }, 290 | dropdown_2_row: { 291 | flexDirection: 'row', 292 | height: 40, 293 | alignItems: 'center', 294 | }, 295 | dropdown_2_image: { 296 | marginLeft: 4, 297 | width: 30, 298 | height: 30, 299 | }, 300 | dropdown_2_row_text: { 301 | marginHorizontal: 4, 302 | fontSize: 16, 303 | color: 'navy', 304 | textAlignVertical: 'center', 305 | }, 306 | dropdown_2_separator: { 307 | height: 1, 308 | backgroundColor: 'cornflowerblue', 309 | }, 310 | dropdown_3: { 311 | width: 150, 312 | borderColor: 'lightgray', 313 | borderWidth: 1, 314 | borderRadius: 1, 315 | }, 316 | dropdown_3_dropdownTextStyle: { 317 | backgroundColor: '#000', 318 | color: '#fff' 319 | }, 320 | dropdown_3_dropdownTextHighlightStyle: { 321 | backgroundColor: '#fff', 322 | color: '#000' 323 | }, 324 | dropdown_4: { 325 | margin: 8, 326 | borderColor: 'lightgray', 327 | borderWidth: 1, 328 | borderRadius: 1, 329 | }, 330 | dropdown_4_dropdown: { 331 | width: 100, 332 | }, 333 | dropdown_5: { 334 | margin: 8, 335 | borderColor: 'lightgray', 336 | borderWidth: 1, 337 | borderRadius: 1, 338 | }, 339 | dropdown_6: { 340 | flex: 1, 341 | left: 8, 342 | }, 343 | dropdown_6_image: { 344 | width: 40, 345 | height: 40, 346 | }, 347 | }); 348 | 349 | export default App; 350 | -------------------------------------------------------------------------------- /expo-example/ModalDropdown.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import { 3 | StyleSheet, 4 | Dimensions, 5 | View, 6 | Text, 7 | TouchableWithoutFeedback, 8 | TouchableNativeFeedback, 9 | TouchableOpacity, 10 | TouchableHighlight, 11 | Modal, 12 | ActivityIndicator, 13 | FlatList, 14 | Platform 15 | } from 'react-native'; 16 | import PropTypes from 'prop-types'; 17 | 18 | const TOUCHABLE_ELEMENTS = [ 19 | 'TouchableHighlight', 20 | 'TouchableOpacity', 21 | 'TouchableWithoutFeedback', 22 | 'TouchableNativeFeedback', 23 | ]; 24 | 25 | export default class ModalDropdown extends Component { 26 | static propTypes = { 27 | disabled: PropTypes.bool, 28 | multipleSelect: PropTypes.bool, 29 | scrollEnabled: PropTypes.bool, 30 | saveScrollPosition: PropTypes.bool, 31 | defaultIndex: PropTypes.number, 32 | defaultValue: PropTypes.string, 33 | options: PropTypes.array.isRequired, 34 | accessible: PropTypes.bool, 35 | animated: PropTypes.bool, 36 | showsVerticalScrollIndicator: PropTypes.bool, 37 | keyboardShouldPersistTaps: PropTypes.string, 38 | style: PropTypes.oneOfType([ 39 | PropTypes.number, 40 | PropTypes.object, 41 | PropTypes.array, 42 | ]), 43 | textStyle: PropTypes.oneOfType([ 44 | PropTypes.number, 45 | PropTypes.object, 46 | PropTypes.array, 47 | ]), 48 | dropdownStyle: PropTypes.oneOfType([ 49 | PropTypes.number, 50 | PropTypes.object, 51 | PropTypes.array, 52 | ]), 53 | dropdownTextStyle: PropTypes.oneOfType([ 54 | PropTypes.number, 55 | PropTypes.object, 56 | PropTypes.array, 57 | ]), 58 | dropdownTextHighlightStyle: PropTypes.oneOfType([ 59 | PropTypes.number, 60 | PropTypes.object, 61 | PropTypes.array, 62 | ]), 63 | adjustFrame: PropTypes.func, 64 | renderRow: PropTypes.func, 65 | renderRowComponent: PropTypes.oneOfType([ 66 | PropTypes.func, 67 | PropTypes.object, 68 | ]), 69 | renderRowProps: PropTypes.object, 70 | renderSeparator: PropTypes.func, 71 | renderButtonText: PropTypes.func, 72 | renderButtonComponent: PropTypes.oneOfType([ 73 | PropTypes.func, 74 | PropTypes.object, 75 | ]), 76 | renderButtonProps: PropTypes.object, 77 | onDropdownWillShow: PropTypes.func, 78 | onDropdownWillHide: PropTypes.func, 79 | onSelect: PropTypes.func, 80 | }; 81 | 82 | static defaultProps = { 83 | disabled: false, 84 | multipleSelect: false, 85 | scrollEnabled: true, 86 | saveScrollPosition: true, 87 | defaultIndex: -1, 88 | defaultValue: 'Please select...', 89 | animated: true, 90 | showsVerticalScrollIndicator: true, 91 | keyboardShouldPersistTaps: 'never', 92 | renderRowComponent: Platform.OS === 'ios' ? TouchableOpacity : TouchableHighlight, 93 | renderButtonComponent: TouchableOpacity, 94 | }; 95 | 96 | constructor(props) { 97 | super(props); 98 | this._button = null; 99 | this._buttonFrame = null; 100 | 101 | this.state = { 102 | accessible: !!props.accessible, 103 | loading: !props.options, 104 | showDropdown: false, 105 | buttonText: props.defaultValue, 106 | selectedIndex: props.defaultIndex, 107 | }; 108 | } 109 | 110 | static getDerivedStateFromProps(nextProps, state) { 111 | let {selectedIndex, loading} = state; 112 | const {defaultIndex, defaultValue, options} = nextProps; 113 | let newState = null; 114 | 115 | if (selectedIndex < 0) { 116 | selectedIndex = defaultIndex; 117 | newState = { 118 | selectedIndex: selectedIndex 119 | }; 120 | if (selectedIndex < 0) { 121 | newState.buttonText = defaultValue; 122 | } 123 | } 124 | 125 | if (!loading !== !options) { 126 | if (!newState) { 127 | newState = {}; 128 | } 129 | newState.loading = !options; 130 | } 131 | return newState; 132 | } 133 | 134 | render() { 135 | return ( 136 | 137 | {this._renderButton()} 138 | {this._renderModal()} 139 | 140 | ); 141 | } 142 | 143 | _updatePosition(callback) { 144 | if (this._button && this._button.measure) { 145 | this._button.measure((fx, fy, width, height, px, py) => { 146 | this._buttonFrame = { 147 | x: px, 148 | y: py, 149 | w: width, 150 | h: height, 151 | }; 152 | callback && callback(); 153 | }); 154 | } 155 | } 156 | 157 | show() { 158 | this._updatePosition(() => { 159 | this.setState({ 160 | showDropdown: true, 161 | }); 162 | }); 163 | } 164 | 165 | hide() { 166 | this.setState({ 167 | showDropdown: false, 168 | }); 169 | } 170 | 171 | select(idx) { 172 | const { 173 | defaultValue, 174 | options, 175 | defaultIndex, 176 | renderButtonText, 177 | } = this.props; 178 | let value = defaultValue; 179 | 180 | if (idx == null || !options || idx >= options.length) { 181 | idx = defaultIndex; 182 | } 183 | if (idx >= 0) { 184 | value = renderButtonText 185 | ? renderButtonText(options[idx]) 186 | : options[idx].toString(); 187 | } 188 | 189 | this.setState({ 190 | buttonText: value, 191 | selectedIndex: idx, 192 | }); 193 | } 194 | 195 | _renderButton() { 196 | const { 197 | disabled, 198 | accessible, 199 | children, 200 | textStyle, 201 | renderButtonComponent, 202 | renderButtonProps, 203 | } = this.props; 204 | const ButtonTouchable = renderButtonComponent; 205 | const { buttonText } = this.state; 206 | 207 | return ( 208 | (this._button = button)} 210 | disabled={disabled} 211 | accessible={accessible} 212 | onPress={this._onButtonPress} 213 | {...renderButtonProps} 214 | > 215 | {children || ( 216 | 217 | 218 | {buttonText} 219 | 220 | 221 | )} 222 | 223 | ); 224 | } 225 | 226 | _onButtonPress = () => { 227 | const { onDropdownWillShow } = this.props; 228 | 229 | if (!onDropdownWillShow || onDropdownWillShow() !== false) { 230 | this.show(); 231 | } 232 | }; 233 | 234 | _renderModal() { 235 | const { animated, accessible, dropdownStyle } = this.props; 236 | const { showDropdown, loading } = this.state; 237 | 238 | if (showDropdown && this._buttonFrame) { 239 | const frameStyle = this._calcPosition(); 240 | const animationType = animated ? 'fade' : 'none'; 241 | 242 | return ( 243 | 256 | 261 | 262 | 263 | {loading ? this._renderLoading() : this._renderDropdown()} 264 | 265 | 266 | 267 | 268 | ); 269 | } 270 | } 271 | 272 | _calcPosition() { 273 | const { dropdownStyle, style, adjustFrame } = this.props; 274 | const dimensions = Dimensions.get('window'); 275 | const windowWidth = dimensions.width; 276 | const windowHeight = dimensions.height; 277 | const dropdownHeight = 278 | (dropdownStyle && StyleSheet.flatten(dropdownStyle).height) || 279 | StyleSheet.flatten(styles.dropdown).height; 280 | const bottomSpace = 281 | windowHeight - this._buttonFrame.y - this._buttonFrame.h; 282 | const rightSpace = windowWidth - this._buttonFrame.x; 283 | const showInBottom = 284 | bottomSpace >= dropdownHeight || bottomSpace >= this._buttonFrame.y; 285 | const showInLeft = rightSpace >= this._buttonFrame.x; 286 | const positionStyle = { 287 | height: dropdownHeight, 288 | top: showInBottom 289 | ? this._buttonFrame.y + this._buttonFrame.h 290 | : Math.max(0, this._buttonFrame.y - dropdownHeight), 291 | }; 292 | 293 | if (showInLeft) { 294 | positionStyle.left = this._buttonFrame.x; 295 | } else { 296 | const dropdownWidth = 297 | (dropdownStyle && StyleSheet.flatten(dropdownStyle).width) || 298 | (style && StyleSheet.flatten(style).width) || -1; 299 | 300 | if (dropdownWidth !== -1) { 301 | positionStyle.width = dropdownWidth; 302 | } 303 | 304 | positionStyle.right = rightSpace - this._buttonFrame.w; 305 | } 306 | 307 | return adjustFrame ? adjustFrame(positionStyle) : positionStyle; 308 | } 309 | 310 | _onRequestClose = () => { 311 | const { onDropdownWillHide } = this.props; 312 | if (!onDropdownWillHide || onDropdownWillHide() !== false) { 313 | this.hide(); 314 | } 315 | }; 316 | 317 | _onModalPress = () => { 318 | const { onDropdownWillHide } = this.props; 319 | if (!onDropdownWillHide || onDropdownWillHide() !== false) { 320 | this.hide(); 321 | } 322 | }; 323 | 324 | _renderLoading = () => { 325 | return ; 326 | }; 327 | 328 | _renderDropdown() { 329 | const { 330 | scrollEnabled, 331 | saveScrollPosition, 332 | renderSeparator, 333 | showsVerticalScrollIndicator, 334 | keyboardShouldPersistTaps, 335 | options, 336 | } = this.props; 337 | 338 | const { selectedIndex } = this.state; 339 | 340 | return ( 341 | (`key-${i}`)} 347 | renderItem={this._renderItem} 348 | ItemSeparatorComponent={renderSeparator || this._renderSeparator} 349 | automaticallyAdjustContentInsets={false} 350 | showsVerticalScrollIndicator={showsVerticalScrollIndicator} 351 | keyboardShouldPersistTaps={keyboardShouldPersistTaps} 352 | /> 353 | ); 354 | } 355 | 356 | _renderItem = ({ item, index, separators }) => { 357 | const { 358 | renderRow, 359 | renderRowComponent, 360 | renderRowProps, 361 | dropdownTextStyle, 362 | dropdownTextHighlightStyle, 363 | accessible, 364 | dropdownTextProps, 365 | } = this.props; 366 | const RowTouchable = renderRowComponent; 367 | const { selectedIndex } = this.state; 368 | const key = `row_${index}`; 369 | const highlighted = index === selectedIndex; 370 | 371 | const row = !renderRow ? ( 372 | 381 | {item} 382 | 383 | ) : ( 384 | renderRow(item, index, highlighted) 385 | ); 386 | 387 | const touchableProps = { 388 | key, 389 | accessible, 390 | onPress: () => this._onRowPress(item, index, separators), 391 | ...renderRowProps 392 | }; 393 | 394 | return {row}; 395 | }; 396 | 397 | _onRowPress(rowData, rowID, highlightRow) { 398 | const { 399 | onSelect, 400 | renderButtonText, 401 | onDropdownWillHide, 402 | multipleSelect 403 | } = this.props; 404 | 405 | if (!onSelect || onSelect(rowID, rowData) !== false) { 406 | const value = 407 | (renderButtonText && renderButtonText(rowData)) || rowData.toString(); 408 | 409 | this.setState({ 410 | buttonText: value, 411 | selectedIndex: rowID, 412 | }); 413 | } 414 | 415 | if (!multipleSelect && 416 | (!onDropdownWillHide || onDropdownWillHide() !== false) 417 | ) { 418 | this.setState({ 419 | showDropdown: false, 420 | }); 421 | } 422 | } 423 | 424 | _renderSeparator = ({ leadingItem = '' }) => { 425 | const key = `spr_${leadingItem}`; 426 | 427 | return ; 428 | }; 429 | } 430 | 431 | const styles = StyleSheet.create({ 432 | button: { 433 | justifyContent: 'center', 434 | }, 435 | buttonText: { 436 | fontSize: 12, 437 | }, 438 | modal: { 439 | flexGrow: 1, 440 | }, 441 | dropdown: { 442 | position: 'absolute', 443 | height: (33 + StyleSheet.hairlineWidth) * 5, 444 | borderWidth: StyleSheet.hairlineWidth, 445 | borderColor: 'lightgray', 446 | borderRadius: 2, 447 | backgroundColor: 'white', 448 | justifyContent: 'center', 449 | }, 450 | loading: { 451 | alignSelf: 'center', 452 | }, 453 | list: { 454 | // flexGrow: 1, 455 | }, 456 | rowText: { 457 | paddingHorizontal: 6, 458 | paddingVertical: 10, 459 | fontSize: 11, 460 | color: 'gray', 461 | backgroundColor: 'white', 462 | textAlignVertical: 'center', 463 | }, 464 | highlightedRowText: { 465 | color: 'black', 466 | }, 467 | separator: { 468 | height: StyleSheet.hairlineWidth, 469 | backgroundColor: 'lightgray', 470 | }, 471 | }); 472 | -------------------------------------------------------------------------------- /example/ModalDropdown.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import { 3 | StyleSheet, 4 | Dimensions, 5 | View, 6 | Text, 7 | TouchableWithoutFeedback, 8 | TouchableNativeFeedback, 9 | TouchableOpacity, 10 | TouchableHighlight, 11 | Modal, 12 | ActivityIndicator, 13 | FlatList, 14 | } from 'react-native'; 15 | import PropTypes from 'prop-types'; 16 | 17 | const TOUCHABLE_ELEMENTS = [ 18 | 'TouchableHighlight', 19 | 'TouchableOpacity', 20 | 'TouchableWithoutFeedback', 21 | 'TouchableNativeFeedback', 22 | ]; 23 | 24 | export default class ModalDropdown extends Component { 25 | static propTypes = { 26 | disabled: PropTypes.bool, 27 | multipleSelect: PropTypes.bool, 28 | scrollEnabled: PropTypes.bool, 29 | defaultIndex: PropTypes.number, 30 | defaultValue: PropTypes.string, 31 | options: PropTypes.array.isRequired, 32 | accessible: PropTypes.bool, 33 | animated: PropTypes.bool, 34 | showsVerticalScrollIndicator: PropTypes.bool, 35 | keyboardShouldPersistTaps: PropTypes.string, 36 | style: PropTypes.oneOfType([ 37 | PropTypes.number, 38 | PropTypes.object, 39 | PropTypes.array, 40 | ]), 41 | textStyle: PropTypes.oneOfType([ 42 | PropTypes.number, 43 | PropTypes.object, 44 | PropTypes.array, 45 | ]), 46 | dropdownStyle: PropTypes.oneOfType([ 47 | PropTypes.number, 48 | PropTypes.object, 49 | PropTypes.array, 50 | ]), 51 | dropdownTextStyle: PropTypes.oneOfType([ 52 | PropTypes.number, 53 | PropTypes.object, 54 | PropTypes.array, 55 | ]), 56 | dropdownTextHighlightStyle: PropTypes.oneOfType([ 57 | PropTypes.number, 58 | PropTypes.object, 59 | PropTypes.array, 60 | ]), 61 | adjustFrame: PropTypes.func, 62 | renderRow: PropTypes.func, 63 | renderSeparator: PropTypes.func, 64 | renderButtonText: PropTypes.func, 65 | onDropdownWillShow: PropTypes.func, 66 | onDropdownWillHide: PropTypes.func, 67 | onSelect: PropTypes.func, 68 | }; 69 | 70 | static defaultProps = { 71 | disabled: false, 72 | multipleSelect: false, 73 | scrollEnabled: true, 74 | defaultIndex: -1, 75 | defaultValue: 'Please select...', 76 | options: null, 77 | animated: true, 78 | showsVerticalScrollIndicator: true, 79 | keyboardShouldPersistTaps: 'never', 80 | }; 81 | 82 | constructor(props) { 83 | super(props); 84 | this._button = null; 85 | this._buttonFrame = null; 86 | 87 | this.state = { 88 | accessible: !!props.accessible, 89 | loading: !props.options, 90 | showDropdown: false, 91 | buttonText: props.defaultValue, 92 | selectedIndex: props.defaultIndex, 93 | }; 94 | } 95 | 96 | static getDerivedStateFromProps(nextProps, state) { 97 | let {selectedIndex, loading} = state; 98 | const {defaultIndex, defaultValue, options} = nextProps; 99 | let newState = null; 100 | 101 | if (selectedIndex < 0) { 102 | selectedIndex = defaultIndex; 103 | newState = { 104 | selectedIndex: selectedIndex 105 | }; 106 | if (selectedIndex < 0) { 107 | newState.buttonText = defaultValue; 108 | } 109 | } 110 | 111 | if (!loading !== !options) { 112 | if (!newState) { 113 | newState = {}; 114 | } 115 | newState.loading = !options; 116 | } 117 | return newState; 118 | } 119 | 120 | render() { 121 | return ( 122 | 123 | {this._renderButton()} 124 | {this._renderModal()} 125 | 126 | ); 127 | } 128 | 129 | _updatePosition(callback) { 130 | if (this._button && this._button.measure) { 131 | this._button.measure((fx, fy, width, height, px, py) => { 132 | this._buttonFrame = { 133 | x: px, 134 | y: py, 135 | w: width, 136 | h: height, 137 | }; 138 | callback && callback(); 139 | }); 140 | } 141 | } 142 | 143 | show() { 144 | this._updatePosition(() => { 145 | this.setState({ 146 | showDropdown: true, 147 | }); 148 | }); 149 | } 150 | 151 | hide() { 152 | this.setState({ 153 | showDropdown: false, 154 | }); 155 | } 156 | 157 | select(idx) { 158 | const { 159 | defaultValue, 160 | options, 161 | defaultIndex, 162 | renderButtonText, 163 | } = this.props; 164 | let value = defaultValue; 165 | 166 | if (idx == null || !options || idx >= options.length) { 167 | idx = defaultIndex; 168 | } 169 | if (idx >= 0) { 170 | value = renderButtonText 171 | ? renderButtonText(options[idx]) 172 | : options[idx].toString(); 173 | } 174 | 175 | this.setState({ 176 | buttonText: value, 177 | selectedIndex: idx, 178 | }); 179 | } 180 | 181 | _renderButton() { 182 | const { disabled, accessible, children, textStyle } = this.props; 183 | const { buttonText } = this.state; 184 | 185 | return ( 186 | (this._button = button)} 188 | disabled={disabled} 189 | accessible={accessible} 190 | onPress={this._onButtonPress} 191 | > 192 | {children || ( 193 | 194 | 195 | {buttonText} 196 | 197 | 198 | )} 199 | 200 | ); 201 | } 202 | 203 | _onButtonPress = () => { 204 | const { onDropdownWillShow } = this.props; 205 | 206 | if (!onDropdownWillShow || onDropdownWillShow() !== false) { 207 | this.show(); 208 | } 209 | }; 210 | 211 | _renderModal() { 212 | const { animated, accessible, dropdownStyle } = this.props; 213 | const { showDropdown, loading } = this.state; 214 | 215 | if (showDropdown && this._buttonFrame) { 216 | const frameStyle = this._calcPosition(); 217 | const animationType = animated ? 'fade' : 'none'; 218 | 219 | return ( 220 | 233 | 238 | 239 | 240 | {loading ? this._renderLoading() : this._renderDropdown()} 241 | 242 | 243 | 244 | 245 | ); 246 | } 247 | } 248 | 249 | _calcPosition() { 250 | const { dropdownStyle, style, adjustFrame } = this.props; 251 | const dimensions = Dimensions.get('window'); 252 | const windowWidth = dimensions.width; 253 | const windowHeight = dimensions.height; 254 | const dropdownHeight = 255 | (dropdownStyle && StyleSheet.flatten(dropdownStyle).height) || 256 | StyleSheet.flatten(styles.dropdown).height; 257 | const bottomSpace = 258 | windowHeight - this._buttonFrame.y - this._buttonFrame.h; 259 | const rightSpace = windowWidth - this._buttonFrame.x; 260 | const showInBottom = 261 | bottomSpace >= dropdownHeight || bottomSpace >= this._buttonFrame.y; 262 | const showInLeft = rightSpace >= this._buttonFrame.x; 263 | const positionStyle = { 264 | height: dropdownHeight, 265 | top: showInBottom 266 | ? this._buttonFrame.y + this._buttonFrame.h 267 | : Math.max(0, this._buttonFrame.y - dropdownHeight), 268 | }; 269 | 270 | if (showInLeft) { 271 | positionStyle.left = this._buttonFrame.x; 272 | } else { 273 | const dropdownWidth = 274 | (dropdownStyle && StyleSheet.flatten(dropdownStyle).width) || 275 | (style && StyleSheet.flatten(style).width) || -1; 276 | 277 | if (dropdownWidth !== -1) { 278 | positionStyle.width = dropdownWidth; 279 | } 280 | 281 | positionStyle.right = rightSpace - this._buttonFrame.w; 282 | } 283 | 284 | return adjustFrame ? adjustFrame(positionStyle) : positionStyle; 285 | } 286 | 287 | _onRequestClose = () => { 288 | const { onDropdownWillHide } = this.props; 289 | if (!onDropdownWillHide || onDropdownWillHide() !== false) { 290 | this.hide(); 291 | } 292 | }; 293 | 294 | _onModalPress = () => { 295 | const { onDropdownWillHide } = this.props; 296 | if (!onDropdownWillHide || onDropdownWillHide() !== false) { 297 | this.hide(); 298 | } 299 | }; 300 | 301 | _renderLoading = () => { 302 | return ; 303 | }; 304 | 305 | _renderDropdown() { 306 | const { 307 | scrollEnabled, 308 | renderSeparator, 309 | showsVerticalScrollIndicator, 310 | keyboardShouldPersistTaps, 311 | options, 312 | } = this.props; 313 | 314 | return ( 315 | (`key-${i}`)} 320 | renderItem={this._renderItem} 321 | ItemSeparatorComponent={renderSeparator || this._renderSeparator} 322 | automaticallyAdjustContentInsets={false} 323 | showsVerticalScrollIndicator={showsVerticalScrollIndicator} 324 | keyboardShouldPersistTaps={keyboardShouldPersistTaps} 325 | /> 326 | ); 327 | } 328 | 329 | _renderItem = ({ item, index, separators }) => { 330 | const { 331 | renderRow, 332 | dropdownTextStyle, 333 | dropdownTextHighlightStyle, 334 | accessible, 335 | } = this.props; 336 | const { selectedIndex } = this.state; 337 | const key = `row_${index}`; 338 | const highlighted = index === selectedIndex; 339 | 340 | const row = !renderRow ? ( 341 | 349 | {item} 350 | 351 | ) : ( 352 | renderRow(item, index, highlighted) 353 | ); 354 | const preservedProps = { 355 | key, 356 | accessible, 357 | onPress: () => this._onRowPress(item, index, separators), 358 | }; 359 | 360 | if (TOUCHABLE_ELEMENTS.find(name => name === row.type.displayName)) { 361 | const props = { ...row.props }; 362 | props.key = preservedProps.key; 363 | props.onPress = preservedProps.onPress; 364 | const { children } = row.props; 365 | 366 | switch (row.type.displayName) { 367 | case 'TouchableHighlight': { 368 | return {children}; 369 | } 370 | case 'TouchableOpacity': { 371 | return {children}; 372 | } 373 | case 'TouchableWithoutFeedback': { 374 | return ( 375 | 376 | {children} 377 | 378 | ); 379 | } 380 | case 'TouchableNativeFeedback': { 381 | return ( 382 | 383 | {children} 384 | 385 | ); 386 | } 387 | default: 388 | break; 389 | } 390 | } 391 | 392 | return {row}; 393 | }; 394 | 395 | _onRowPress(rowData, rowID, highlightRow) { 396 | const { 397 | onSelect, 398 | renderButtonText, 399 | onDropdownWillHide, 400 | multipleSelect 401 | } = this.props; 402 | 403 | if (!onSelect || onSelect(rowID, rowData) !== false) { 404 | const value = 405 | (renderButtonText && renderButtonText(rowData)) || rowData.toString(); 406 | 407 | this.setState({ 408 | buttonText: value, 409 | selectedIndex: rowID, 410 | }); 411 | } 412 | 413 | if (!multipleSelect && 414 | (!onDropdownWillHide || onDropdownWillHide() !== false) 415 | ) { 416 | this.setState({ 417 | showDropdown: false, 418 | }); 419 | } 420 | } 421 | 422 | _renderSeparator = ({ leadingItem = '' }) => { 423 | const key = `spr_${leadingItem}`; 424 | 425 | return ; 426 | }; 427 | } 428 | 429 | const styles = StyleSheet.create({ 430 | button: { 431 | justifyContent: 'center', 432 | }, 433 | buttonText: { 434 | fontSize: 12, 435 | }, 436 | modal: { 437 | flexGrow: 1, 438 | }, 439 | dropdown: { 440 | position: 'absolute', 441 | height: (33 + StyleSheet.hairlineWidth) * 5, 442 | borderWidth: StyleSheet.hairlineWidth, 443 | borderColor: 'lightgray', 444 | borderRadius: 2, 445 | backgroundColor: 'white', 446 | justifyContent: 'center', 447 | }, 448 | loading: { 449 | alignSelf: 'center', 450 | }, 451 | list: { 452 | // flexGrow: 1, 453 | }, 454 | rowText: { 455 | paddingHorizontal: 6, 456 | paddingVertical: 10, 457 | fontSize: 11, 458 | color: 'gray', 459 | backgroundColor: 'white', 460 | textAlignVertical: 'center', 461 | }, 462 | highlightedRowText: { 463 | color: 'black', 464 | }, 465 | separator: { 466 | height: StyleSheet.hairlineWidth, 467 | backgroundColor: 'lightgray', 468 | }, 469 | }); 470 | -------------------------------------------------------------------------------- /components/ModalDropdown.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import { 3 | StyleSheet, 4 | Dimensions, 5 | View, 6 | Text, 7 | TouchableWithoutFeedback, 8 | TouchableOpacity, 9 | TouchableHighlight, 10 | Modal, 11 | ActivityIndicator, 12 | FlatList, 13 | Platform, 14 | TextInput, 15 | I18nManager 16 | } from 'react-native'; 17 | import PropTypes from 'prop-types'; 18 | 19 | const TOUCHABLE_ELEMENTS = [ 20 | 'TouchableHighlight', 21 | 'TouchableOpacity', 22 | 'TouchableWithoutFeedback', 23 | 'TouchableNativeFeedback', 24 | ]; 25 | 26 | export default class ModalDropdown extends Component { 27 | static propTypes = { 28 | disabled: PropTypes.bool, 29 | multipleSelect: PropTypes.bool, 30 | scrollEnabled: PropTypes.bool, 31 | saveScrollPosition: PropTypes.bool, 32 | defaultIndex: PropTypes.number, 33 | defaultValue: PropTypes.string, 34 | options: PropTypes.array, 35 | accessible: PropTypes.bool, 36 | animated: PropTypes.bool, 37 | isFullWidth: PropTypes.bool, 38 | showsVerticalScrollIndicator: PropTypes.bool, 39 | keyboardShouldPersistTaps: PropTypes.string, 40 | showSearch: PropTypes.bool, 41 | keySearchObject: PropTypes.string, 42 | renderSearch: PropTypes.oneOfType([ 43 | PropTypes.func, 44 | PropTypes.object, 45 | ]), 46 | searchInputStyle: PropTypes.oneOfType([ 47 | PropTypes.number, 48 | PropTypes.object, 49 | PropTypes.array, 50 | ]), 51 | searchPlaceholder: PropTypes.string, 52 | style: PropTypes.oneOfType([ 53 | PropTypes.number, 54 | PropTypes.object, 55 | PropTypes.array, 56 | ]), 57 | textStyle: PropTypes.oneOfType([ 58 | PropTypes.number, 59 | PropTypes.object, 60 | PropTypes.array, 61 | ]), 62 | defaultTextStyle: PropTypes.oneOfType([ 63 | PropTypes.number, 64 | PropTypes.object, 65 | PropTypes.array, 66 | ]), 67 | dropdownStyle: PropTypes.oneOfType([ 68 | PropTypes.number, 69 | PropTypes.object, 70 | PropTypes.array, 71 | ]), 72 | dropdownTextStyle: PropTypes.oneOfType([ 73 | PropTypes.number, 74 | PropTypes.object, 75 | PropTypes.array, 76 | ]), 77 | dropdownTextHighlightStyle: PropTypes.oneOfType([ 78 | PropTypes.number, 79 | PropTypes.object, 80 | PropTypes.array, 81 | ]), 82 | dropdownListProps: PropTypes.object, 83 | dropdownTextProps: PropTypes.object, 84 | adjustFrame: PropTypes.func, 85 | renderRow: PropTypes.func, 86 | renderRowComponent: PropTypes.oneOfType([ 87 | PropTypes.func, 88 | PropTypes.object, 89 | ]), 90 | renderRowProps: PropTypes.object, 91 | renderSeparator: PropTypes.func, 92 | renderButtonText: PropTypes.func, 93 | renderRowText: PropTypes.func, 94 | renderButtonComponent: PropTypes.oneOfType([ 95 | PropTypes.func, 96 | PropTypes.object, 97 | ]), 98 | renderRightComponent: PropTypes.oneOfType([ 99 | PropTypes.func, 100 | PropTypes.object, 101 | ]), 102 | renderButtonProps: PropTypes.object, 103 | onDropdownWillShow: PropTypes.func, 104 | onDropdownWillHide: PropTypes.func, 105 | onSelect: PropTypes.func, 106 | numberOfLines: PropTypes.number 107 | }; 108 | 109 | static defaultProps = { 110 | disabled: false, 111 | multipleSelect: false, 112 | scrollEnabled: true, 113 | saveScrollPosition: true, 114 | defaultIndex: -1, 115 | defaultValue: 'Please select...', 116 | animated: true, 117 | isFullWidth: false, 118 | showsVerticalScrollIndicator: true, 119 | keyboardShouldPersistTaps: 'never', 120 | showSearch: false, 121 | searchPlaceholder: "Search", 122 | keySearchObject: 'label', 123 | renderRowComponent: Platform.OS === 'ios' ? TouchableOpacity : TouchableHighlight, 124 | renderButtonComponent: TouchableOpacity, 125 | renderRightComponent: View, 126 | numberOfLines: 1 127 | }; 128 | 129 | constructor(props) { 130 | super(props); 131 | this._button = null; 132 | this._buttonFrame = null; 133 | 134 | this.state = { 135 | accessible: !!props.accessible, 136 | loading: !props.options, 137 | showDropdown: false, 138 | buttonText: props.defaultValue, 139 | selectedIndex: props.defaultIndex, 140 | options: props.options, 141 | searchValue: '', 142 | }; 143 | } 144 | 145 | static getDerivedStateFromProps(nextProps, state) { 146 | let { selectedIndex, loading } = state; 147 | const { defaultIndex, defaultValue, options } = nextProps; 148 | let newState = null; 149 | 150 | if (selectedIndex < 0) { 151 | selectedIndex = defaultIndex; 152 | newState = { 153 | selectedIndex: selectedIndex 154 | }; 155 | if (selectedIndex < 0) { 156 | newState.buttonText = defaultValue; 157 | } 158 | } 159 | 160 | if (!loading !== !options) { 161 | if (!newState) { 162 | newState = {}; 163 | } 164 | newState.loading = !options; 165 | } 166 | // this compare only checks an array with no data, doesnt deep check, this comparison use for get api 167 | if (options !== state.options) { 168 | newState.options = options 169 | } 170 | return newState; 171 | } 172 | 173 | render() { 174 | return ( 175 | 176 | {this._renderButton()} 177 | {this._renderModal()} 178 | 179 | ); 180 | } 181 | 182 | _updatePosition(callback) { 183 | if (this._button && this._button.measure) { 184 | this._button.measure((fx, fy, width, height, px, py) => { 185 | this._buttonFrame = { 186 | x: px, 187 | y: py, 188 | w: width, 189 | h: height, 190 | }; 191 | callback && callback(); 192 | }); 193 | } 194 | } 195 | 196 | show() { 197 | this._updatePosition(() => { 198 | this.setState({ 199 | showDropdown: true, 200 | }); 201 | }); 202 | } 203 | 204 | hide() { 205 | this.setState({ 206 | showDropdown: false, 207 | }); 208 | } 209 | 210 | select(idx) { 211 | const { 212 | defaultValue, 213 | options, 214 | defaultIndex, 215 | renderButtonText, 216 | } = this.props; 217 | let value = defaultValue; 218 | 219 | if (idx == null || !options || idx >= options.length) { 220 | idx = defaultIndex; 221 | } 222 | if (idx >= 0) { 223 | value = renderButtonText 224 | ? renderButtonText(options[idx]) 225 | : options[idx].toString(); 226 | } 227 | 228 | this.setState({ 229 | buttonText: value, 230 | selectedIndex: idx, 231 | }); 232 | } 233 | 234 | _renderButton() { 235 | const { 236 | disabled, 237 | accessible, 238 | children, 239 | textStyle, 240 | defaultTextStyle, 241 | renderButtonComponent, 242 | renderButtonProps, 243 | renderRightComponent, 244 | buttonAndRightComponentContainerStyle, 245 | numberOfLines, 246 | } = this.props; 247 | const ButtonTouchable = renderButtonComponent; 248 | const RightComponent = renderRightComponent; 249 | const { buttonText, selectedIndex } = this.state; 250 | const buttonTextStyle = selectedIndex < 0 ? [textStyle, defaultTextStyle] : textStyle; 251 | return ( 252 | (this._button = button)} 254 | disabled={disabled} 255 | accessible={accessible} 256 | onPress={this._onButtonPress} 257 | {...renderButtonProps} 258 | > 259 | {children || ( 260 | 261 | 262 | {buttonText} 263 | 264 | 265 | 266 | )} 267 | 268 | ); 269 | } 270 | 271 | _onButtonPress = () => { 272 | const { onDropdownWillShow } = this.props; 273 | 274 | if (!onDropdownWillShow || onDropdownWillShow() !== false) { 275 | this.show(); 276 | } 277 | }; 278 | 279 | _renderModal() { 280 | const { animated, accessible, dropdownStyle } = this.props; 281 | const { showDropdown, loading } = this.state; 282 | 283 | if (showDropdown && this._buttonFrame) { 284 | const frameStyle = this._calcPosition(); 285 | const animationType = animated ? 'fade' : 'none'; 286 | 287 | return ( 288 | 301 | 306 | 307 | 308 | {loading ? this._renderLoading() : this._renderDropdown()} 309 | 310 | 311 | 312 | 313 | ); 314 | } 315 | } 316 | 317 | _calcPosition() { 318 | const { dropdownStyle, style, adjustFrame, isFullWidth } = this.props; 319 | const dimensions = Dimensions.get('window'); 320 | const windowWidth = dimensions.width; 321 | const windowHeight = dimensions.height; 322 | const dropdownHeight = 323 | (dropdownStyle && StyleSheet.flatten(dropdownStyle).height) || 324 | StyleSheet.flatten(styles.dropdown).height; 325 | const bottomSpace = 326 | windowHeight - this._buttonFrame.y - this._buttonFrame.h; 327 | const rightSpace = windowWidth - this._buttonFrame.x; 328 | const showInBottom = 329 | bottomSpace >= dropdownHeight || bottomSpace >= this._buttonFrame.y; 330 | const showInLeft = rightSpace >= this._buttonFrame.x; 331 | const positionStyle = { 332 | height: dropdownHeight, 333 | top: showInBottom 334 | ? this._buttonFrame.y + this._buttonFrame.h 335 | : Math.max(0, this._buttonFrame.y - dropdownHeight), 336 | }; 337 | 338 | if (showInLeft) { 339 | positionStyle.left = this._buttonFrame.x; 340 | if (isFullWidth) { 341 | positionStyle.right = rightSpace - this._buttonFrame.w; 342 | } 343 | } else { 344 | const dropdownWidth = 345 | (dropdownStyle && StyleSheet.flatten(dropdownStyle).width) || 346 | (style && StyleSheet.flatten(style).width) || -1; 347 | 348 | if (dropdownWidth !== -1) { 349 | positionStyle.width = dropdownWidth; 350 | } 351 | 352 | positionStyle.right = rightSpace - this._buttonFrame.w; 353 | } 354 | 355 | return adjustFrame ? adjustFrame(positionStyle) : positionStyle; 356 | } 357 | 358 | _onRequestClose = () => { 359 | const { onDropdownWillHide } = this.props; 360 | if (!onDropdownWillHide || onDropdownWillHide() !== false) { 361 | this.hide(); 362 | } 363 | }; 364 | 365 | _onModalPress = () => { 366 | const { onDropdownWillHide } = this.props; 367 | if (!onDropdownWillHide || onDropdownWillHide() !== false) { 368 | this.hide(); 369 | } 370 | }; 371 | 372 | _renderLoading = () => { 373 | return ; 374 | }; 375 | 376 | _renderSearchInput = () => { 377 | const { 378 | showSearch, 379 | renderSearch, 380 | searchInputStyle, 381 | searchPlaceholder, 382 | options: initialOptions, 383 | keySearchObject, 384 | } = this.props; 385 | 386 | if (!showSearch) return null; 387 | if (renderSearch) return renderSearch; 388 | 389 | const { buttonText, searchValue } = this.state; 390 | 391 | return ( 392 | { 395 | let filteredOptions = initialOptions; 396 | 397 | if (text) { 398 | filteredOptions = initialOptions.filter((option) => { 399 | return typeof option === 'object' && option !== null 400 | ? option?.[keySearchObject]?.toLowerCase().includes(text.toLowerCase().trim()) 401 | : option.toLowerCase().includes(text.toLowerCase().trim()) 402 | } 403 | ); 404 | } 405 | 406 | this.setState({ 407 | searchValue: text, 408 | options: filteredOptions, 409 | selectedIndex: filteredOptions.indexOf(buttonText) 410 | }) 411 | }} 412 | value={searchValue} 413 | placeholder={searchPlaceholder} 414 | /> 415 | ); 416 | }; 417 | 418 | _renderDropdown() { 419 | const { 420 | scrollEnabled, 421 | saveScrollPosition, 422 | renderSeparator, 423 | showsVerticalScrollIndicator, 424 | keyboardShouldPersistTaps, 425 | dropdownListProps, 426 | } = this.props; 427 | const { selectedIndex } = this.state; 428 | const { options } = this.state; 429 | 430 | return ( 431 | { return {length: 33 + StyleSheet.hairlineWidth, index, offset: (33 + StyleSheet.hairlineWidth) * index} }} 434 | data={options} 435 | ref={component => (this.flatList = component)} 436 | scrollEnabled={scrollEnabled} 437 | initialScrollIndex={saveScrollPosition ? selectedIndex : -1} 438 | style={styles.list} 439 | keyExtractor={(item, i) => (`key-${i}`)} 440 | renderItem={this._renderItem} 441 | ItemSeparatorComponent={renderSeparator || this._renderSeparator} 442 | automaticallyAdjustContentInsets={false} 443 | showsVerticalScrollIndicator={showsVerticalScrollIndicator} 444 | keyboardShouldPersistTaps={keyboardShouldPersistTaps} 445 | ListHeaderComponent={ dropdownListProps.ListHeaderComponent? dropdownListProps.ListHeaderComponent: this._renderSearchInput} 446 | onScrollToIndexFailed={info => { 447 | const wait = new Promise(resolve => setTimeout(resolve, 500)); 448 | wait.then(() => { 449 | this.flatList.scrollToIndex({ index: info.index, animated: true }); 450 | }); 451 | }} 452 | /> 453 | ); 454 | } 455 | 456 | _renderItem = ({ item, index, separators }) => { 457 | const { 458 | renderRow, 459 | renderRowComponent, 460 | renderRowProps, 461 | dropdownTextStyle, 462 | dropdownTextHighlightStyle, 463 | accessible, 464 | dropdownTextProps, 465 | renderRowText 466 | } = this.props; 467 | const RowTouchable = renderRowComponent; 468 | const { selectedIndex } = this.state; 469 | const key = `row_${index}`; 470 | const highlighted = index === selectedIndex; 471 | const value = 472 | (renderRowText && renderRowText(item)) || item.toString(); 473 | const row = !renderRow ? ( 474 | 484 | {value} 485 | 486 | ) : ( 487 | renderRow(item, index, highlighted) 488 | ); 489 | 490 | const touchableProps = { 491 | key, 492 | accessible, 493 | onPress: () => this._onRowPress(item, index, separators), 494 | ...renderRowProps 495 | }; 496 | 497 | return {row}; 498 | }; 499 | 500 | _onRowPress(rowData, rowID, highlightRow) { 501 | const { 502 | onSelect, 503 | renderButtonText, 504 | onDropdownWillHide, 505 | multipleSelect 506 | } = this.props; 507 | 508 | if (!onSelect || onSelect(rowID, rowData) !== false) { 509 | const value = 510 | (renderButtonText && renderButtonText(rowData)) || rowData.toString(); 511 | this.setState({ 512 | buttonText: value, 513 | selectedIndex: rowID, 514 | }); 515 | } 516 | 517 | if (!multipleSelect && 518 | (!onDropdownWillHide || onDropdownWillHide() !== false) 519 | ) { 520 | this.setState({ 521 | showDropdown: false, 522 | }); 523 | } 524 | } 525 | 526 | _renderSeparator = ({ leadingItem = '' }) => { 527 | const key = `spr_${leadingItem}`; 528 | 529 | return ; 530 | }; 531 | } 532 | 533 | const styles = StyleSheet.create({ 534 | button: { 535 | // justifyContent: 'center', 536 | flexDirection: 'row', 537 | alignItems: 'center' 538 | }, 539 | buttonText: { 540 | fontSize: 12, 541 | }, 542 | modal: { 543 | flexGrow: 1, 544 | flexDirection: I18nManager.isRTL ? 'row-reverse' : 'row' 545 | }, 546 | dropdown: { 547 | position: 'absolute', 548 | height: (33 + StyleSheet.hairlineWidth) * 5, 549 | borderWidth: StyleSheet.hairlineWidth, 550 | borderColor: 'lightgray', 551 | borderRadius: 2, 552 | backgroundColor: 'white', 553 | justifyContent: 'center', 554 | }, 555 | loading: { 556 | alignSelf: 'center', 557 | }, 558 | list: { 559 | // flexGrow: 1, 560 | }, 561 | rowText: { 562 | paddingHorizontal: 6, 563 | paddingVertical: 10, 564 | fontSize: 11, 565 | color: 'gray', 566 | backgroundColor: 'white', 567 | textAlignVertical: 'center', 568 | }, 569 | highlightedRowText: { 570 | color: 'black', 571 | }, 572 | separator: { 573 | height: StyleSheet.hairlineWidth, 574 | backgroundColor: 'lightgray', 575 | }, 576 | searchInput: { 577 | borderColor: 'gray', 578 | borderWidth: StyleSheet.hairlineWidth, 579 | fontSize: 11, 580 | paddingHorizontal: 6, 581 | paddingVertical: 10, 582 | } 583 | }); 584 | -------------------------------------------------------------------------------- /example/ios/Demo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */; }; 11 | 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */; }; 12 | 00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */; }; 13 | 00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */; }; 14 | 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */; }; 15 | 00E356F31AD99517003FC87E /* DemoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* DemoTests.m */; }; 16 | 133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 78C398B91ACF4ADC00677621 /* libRCTLinking.a */; }; 17 | 139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */; }; 18 | 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */; }; 19 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; }; 20 | 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; }; 21 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 22 | 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; 23 | 140ED2AC1D01E1AD002B40FF /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; }; 24 | 146834051AC3E58100842450 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; }; 25 | 2D02E4BC1E0B4A80006451C7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; }; 26 | 2D02E4BD1E0B4A84006451C7 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 27 | 2D02E4BF1E0B4AB3006451C7 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; 28 | 2D02E4C21E0B4AEC006451C7 /* libRCTAnimation-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5E9157351DD0AC6500FF2AA8 /* libRCTAnimation-tvOS.a */; }; 29 | 2D02E4C31E0B4AEC006451C7 /* libRCTImage-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3E841DF850E9000B6D8A /* libRCTImage-tvOS.a */; }; 30 | 2D02E4C41E0B4AEC006451C7 /* libRCTLinking-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3E881DF850E9000B6D8A /* libRCTLinking-tvOS.a */; }; 31 | 2D02E4C51E0B4AEC006451C7 /* libRCTNetwork-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3E8C1DF850E9000B6D8A /* libRCTNetwork-tvOS.a */; }; 32 | 2D02E4C61E0B4AEC006451C7 /* libRCTSettings-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3E901DF850E9000B6D8A /* libRCTSettings-tvOS.a */; }; 33 | 2D02E4C71E0B4AEC006451C7 /* libRCTText-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3E941DF850E9000B6D8A /* libRCTText-tvOS.a */; }; 34 | 2D02E4C81E0B4AEC006451C7 /* libRCTWebSocket-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3E991DF850E9000B6D8A /* libRCTWebSocket-tvOS.a */; }; 35 | 2D02E4C91E0B4AEC006451C7 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3EA31DF850E9000B6D8A /* libReact.a */; }; 36 | 2DCD954D1E0B4F2C00145EB5 /* DemoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* DemoTests.m */; }; 37 | 5E9157361DD0AC6A00FF2AA8 /* libRCTAnimation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5E9157331DD0AC6500FF2AA8 /* libRCTAnimation.a */; }; 38 | 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; }; 39 | /* End PBXBuildFile section */ 40 | 41 | /* Begin PBXContainerItemProxy section */ 42 | 00C302AB1ABCB8CE00DB3ED1 /* PBXContainerItemProxy */ = { 43 | isa = PBXContainerItemProxy; 44 | containerPortal = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */; 45 | proxyType = 2; 46 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 47 | remoteInfo = RCTActionSheet; 48 | }; 49 | 00C302B91ABCB90400DB3ED1 /* PBXContainerItemProxy */ = { 50 | isa = PBXContainerItemProxy; 51 | containerPortal = 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */; 52 | proxyType = 2; 53 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 54 | remoteInfo = RCTGeolocation; 55 | }; 56 | 00C302BF1ABCB91800DB3ED1 /* PBXContainerItemProxy */ = { 57 | isa = PBXContainerItemProxy; 58 | containerPortal = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */; 59 | proxyType = 2; 60 | remoteGlobalIDString = 58B5115D1A9E6B3D00147676; 61 | remoteInfo = RCTImage; 62 | }; 63 | 00C302DB1ABCB9D200DB3ED1 /* PBXContainerItemProxy */ = { 64 | isa = PBXContainerItemProxy; 65 | containerPortal = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */; 66 | proxyType = 2; 67 | remoteGlobalIDString = 58B511DB1A9E6C8500147676; 68 | remoteInfo = RCTNetwork; 69 | }; 70 | 00C302E31ABCB9EE00DB3ED1 /* PBXContainerItemProxy */ = { 71 | isa = PBXContainerItemProxy; 72 | containerPortal = 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */; 73 | proxyType = 2; 74 | remoteGlobalIDString = 832C81801AAF6DEF007FA2F7; 75 | remoteInfo = RCTVibration; 76 | }; 77 | 00E356F41AD99517003FC87E /* PBXContainerItemProxy */ = { 78 | isa = PBXContainerItemProxy; 79 | containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */; 80 | proxyType = 1; 81 | remoteGlobalIDString = 13B07F861A680F5B00A75B9A; 82 | remoteInfo = Demo; 83 | }; 84 | 139105C01AF99BAD00B5F7CC /* PBXContainerItemProxy */ = { 85 | isa = PBXContainerItemProxy; 86 | containerPortal = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */; 87 | proxyType = 2; 88 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 89 | remoteInfo = RCTSettings; 90 | }; 91 | 139FDEF31B06529B00C62182 /* PBXContainerItemProxy */ = { 92 | isa = PBXContainerItemProxy; 93 | containerPortal = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */; 94 | proxyType = 2; 95 | remoteGlobalIDString = 3C86DF461ADF2C930047B81A; 96 | remoteInfo = RCTWebSocket; 97 | }; 98 | 146834031AC3E56700842450 /* PBXContainerItemProxy */ = { 99 | isa = PBXContainerItemProxy; 100 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 101 | proxyType = 2; 102 | remoteGlobalIDString = 83CBBA2E1A601D0E00E9B192; 103 | remoteInfo = React; 104 | }; 105 | 2D02E4911E0B4A5D006451C7 /* PBXContainerItemProxy */ = { 106 | isa = PBXContainerItemProxy; 107 | containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */; 108 | proxyType = 1; 109 | remoteGlobalIDString = 2D02E47A1E0B4A5D006451C7; 110 | remoteInfo = "Demo-tvOS"; 111 | }; 112 | 3DAD3E831DF850E9000B6D8A /* PBXContainerItemProxy */ = { 113 | isa = PBXContainerItemProxy; 114 | containerPortal = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */; 115 | proxyType = 2; 116 | remoteGlobalIDString = 2D2A283A1D9B042B00D4039D; 117 | remoteInfo = "RCTImage-tvOS"; 118 | }; 119 | 3DAD3E871DF850E9000B6D8A /* PBXContainerItemProxy */ = { 120 | isa = PBXContainerItemProxy; 121 | containerPortal = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */; 122 | proxyType = 2; 123 | remoteGlobalIDString = 2D2A28471D9B043800D4039D; 124 | remoteInfo = "RCTLinking-tvOS"; 125 | }; 126 | 3DAD3E8B1DF850E9000B6D8A /* PBXContainerItemProxy */ = { 127 | isa = PBXContainerItemProxy; 128 | containerPortal = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */; 129 | proxyType = 2; 130 | remoteGlobalIDString = 2D2A28541D9B044C00D4039D; 131 | remoteInfo = "RCTNetwork-tvOS"; 132 | }; 133 | 3DAD3E8F1DF850E9000B6D8A /* PBXContainerItemProxy */ = { 134 | isa = PBXContainerItemProxy; 135 | containerPortal = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */; 136 | proxyType = 2; 137 | remoteGlobalIDString = 2D2A28611D9B046600D4039D; 138 | remoteInfo = "RCTSettings-tvOS"; 139 | }; 140 | 3DAD3E931DF850E9000B6D8A /* PBXContainerItemProxy */ = { 141 | isa = PBXContainerItemProxy; 142 | containerPortal = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */; 143 | proxyType = 2; 144 | remoteGlobalIDString = 2D2A287B1D9B048500D4039D; 145 | remoteInfo = "RCTText-tvOS"; 146 | }; 147 | 3DAD3E981DF850E9000B6D8A /* PBXContainerItemProxy */ = { 148 | isa = PBXContainerItemProxy; 149 | containerPortal = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */; 150 | proxyType = 2; 151 | remoteGlobalIDString = 2D2A28881D9B049200D4039D; 152 | remoteInfo = "RCTWebSocket-tvOS"; 153 | }; 154 | 3DAD3EA21DF850E9000B6D8A /* PBXContainerItemProxy */ = { 155 | isa = PBXContainerItemProxy; 156 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 157 | proxyType = 2; 158 | remoteGlobalIDString = 2D2A28131D9B038B00D4039D; 159 | remoteInfo = "React-tvOS"; 160 | }; 161 | 3DAD3EA41DF850E9000B6D8A /* PBXContainerItemProxy */ = { 162 | isa = PBXContainerItemProxy; 163 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 164 | proxyType = 2; 165 | remoteGlobalIDString = 3D3C059A1DE3340900C268FA; 166 | remoteInfo = yoga; 167 | }; 168 | 3DAD3EA61DF850E9000B6D8A /* PBXContainerItemProxy */ = { 169 | isa = PBXContainerItemProxy; 170 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 171 | proxyType = 2; 172 | remoteGlobalIDString = 3D3C06751DE3340C00C268FA; 173 | remoteInfo = "yoga-tvOS"; 174 | }; 175 | 3DAD3EA81DF850E9000B6D8A /* PBXContainerItemProxy */ = { 176 | isa = PBXContainerItemProxy; 177 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 178 | proxyType = 2; 179 | remoteGlobalIDString = 3D3CD9251DE5FBEC00167DC4; 180 | remoteInfo = cxxreact; 181 | }; 182 | 3DAD3EAA1DF850E9000B6D8A /* PBXContainerItemProxy */ = { 183 | isa = PBXContainerItemProxy; 184 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 185 | proxyType = 2; 186 | remoteGlobalIDString = 3D3CD9321DE5FBEE00167DC4; 187 | remoteInfo = "cxxreact-tvOS"; 188 | }; 189 | 3DAD3EAC1DF850E9000B6D8A /* PBXContainerItemProxy */ = { 190 | isa = PBXContainerItemProxy; 191 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 192 | proxyType = 2; 193 | remoteGlobalIDString = 3D3CD90B1DE5FBD600167DC4; 194 | remoteInfo = jschelpers; 195 | }; 196 | 3DAD3EAE1DF850E9000B6D8A /* PBXContainerItemProxy */ = { 197 | isa = PBXContainerItemProxy; 198 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 199 | proxyType = 2; 200 | remoteGlobalIDString = 3D3CD9181DE5FBD800167DC4; 201 | remoteInfo = "jschelpers-tvOS"; 202 | }; 203 | 3DD02A47202D9E8A00D42CFB /* PBXContainerItemProxy */ = { 204 | isa = PBXContainerItemProxy; 205 | containerPortal = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */; 206 | proxyType = 2; 207 | remoteGlobalIDString = 3DBE0D001F3B181A0099AA32; 208 | remoteInfo = fishhook; 209 | }; 210 | 3DD02A49202D9E8A00D42CFB /* PBXContainerItemProxy */ = { 211 | isa = PBXContainerItemProxy; 212 | containerPortal = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */; 213 | proxyType = 2; 214 | remoteGlobalIDString = 3DBE0D0D1F3B181C0099AA32; 215 | remoteInfo = "fishhook-tvOS"; 216 | }; 217 | 3DD02A5B202D9E8A00D42CFB /* PBXContainerItemProxy */ = { 218 | isa = PBXContainerItemProxy; 219 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 220 | proxyType = 2; 221 | remoteGlobalIDString = EBF21BDC1FC498900052F4D5; 222 | remoteInfo = jsinspector; 223 | }; 224 | 3DD02A5D202D9E8A00D42CFB /* PBXContainerItemProxy */ = { 225 | isa = PBXContainerItemProxy; 226 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 227 | proxyType = 2; 228 | remoteGlobalIDString = EBF21BFA1FC4989A0052F4D5; 229 | remoteInfo = "jsinspector-tvOS"; 230 | }; 231 | 3DD02A5F202D9E8A00D42CFB /* PBXContainerItemProxy */ = { 232 | isa = PBXContainerItemProxy; 233 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 234 | proxyType = 2; 235 | remoteGlobalIDString = 139D7ECE1E25DB7D00323FB7; 236 | remoteInfo = "third-party"; 237 | }; 238 | 3DD02A61202D9E8A00D42CFB /* PBXContainerItemProxy */ = { 239 | isa = PBXContainerItemProxy; 240 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 241 | proxyType = 2; 242 | remoteGlobalIDString = 3D383D3C1EBD27B6005632C8; 243 | remoteInfo = "third-party-tvOS"; 244 | }; 245 | 3DD02A63202D9E8A00D42CFB /* PBXContainerItemProxy */ = { 246 | isa = PBXContainerItemProxy; 247 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 248 | proxyType = 2; 249 | remoteGlobalIDString = 139D7E881E25C6D100323FB7; 250 | remoteInfo = "double-conversion"; 251 | }; 252 | 3DD02A65202D9E8A00D42CFB /* PBXContainerItemProxy */ = { 253 | isa = PBXContainerItemProxy; 254 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 255 | proxyType = 2; 256 | remoteGlobalIDString = 3D383D621EBD27B9005632C8; 257 | remoteInfo = "double-conversion-tvOS"; 258 | }; 259 | 3DD02A67202D9E8A00D42CFB /* PBXContainerItemProxy */ = { 260 | isa = PBXContainerItemProxy; 261 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 262 | proxyType = 2; 263 | remoteGlobalIDString = 9936F3131F5F2E4B0010BF04; 264 | remoteInfo = privatedata; 265 | }; 266 | 3DD02A69202D9E8A00D42CFB /* PBXContainerItemProxy */ = { 267 | isa = PBXContainerItemProxy; 268 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 269 | proxyType = 2; 270 | remoteGlobalIDString = 9936F32F1F5F2E5B0010BF04; 271 | remoteInfo = "privatedata-tvOS"; 272 | }; 273 | 5E9157321DD0AC6500FF2AA8 /* PBXContainerItemProxy */ = { 274 | isa = PBXContainerItemProxy; 275 | containerPortal = 5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */; 276 | proxyType = 2; 277 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 278 | remoteInfo = RCTAnimation; 279 | }; 280 | 5E9157341DD0AC6500FF2AA8 /* PBXContainerItemProxy */ = { 281 | isa = PBXContainerItemProxy; 282 | containerPortal = 5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */; 283 | proxyType = 2; 284 | remoteGlobalIDString = 2D2A28201D9B03D100D4039D; 285 | remoteInfo = "RCTAnimation-tvOS"; 286 | }; 287 | 78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */ = { 288 | isa = PBXContainerItemProxy; 289 | containerPortal = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */; 290 | proxyType = 2; 291 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 292 | remoteInfo = RCTLinking; 293 | }; 294 | 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */ = { 295 | isa = PBXContainerItemProxy; 296 | containerPortal = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */; 297 | proxyType = 2; 298 | remoteGlobalIDString = 58B5119B1A9E6C1200147676; 299 | remoteInfo = RCTText; 300 | }; 301 | /* End PBXContainerItemProxy section */ 302 | 303 | /* Begin PBXFileReference section */ 304 | 008F07F21AC5B25A0029DE68 /* main.jsbundle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = main.jsbundle; sourceTree = ""; }; 305 | 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTActionSheet.xcodeproj; path = "../node_modules/react-native/Libraries/ActionSheetIOS/RCTActionSheet.xcodeproj"; sourceTree = ""; }; 306 | 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTGeolocation.xcodeproj; path = "../node_modules/react-native/Libraries/Geolocation/RCTGeolocation.xcodeproj"; sourceTree = ""; }; 307 | 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTImage.xcodeproj; path = "../node_modules/react-native/Libraries/Image/RCTImage.xcodeproj"; sourceTree = ""; }; 308 | 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTNetwork.xcodeproj; path = "../node_modules/react-native/Libraries/Network/RCTNetwork.xcodeproj"; sourceTree = ""; }; 309 | 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTVibration.xcodeproj; path = "../node_modules/react-native/Libraries/Vibration/RCTVibration.xcodeproj"; sourceTree = ""; }; 310 | 00E356EE1AD99517003FC87E /* DemoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = DemoTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 311 | 00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 312 | 00E356F21AD99517003FC87E /* DemoTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DemoTests.m; sourceTree = ""; }; 313 | 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTSettings.xcodeproj; path = "../node_modules/react-native/Libraries/Settings/RCTSettings.xcodeproj"; sourceTree = ""; }; 314 | 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTWebSocket.xcodeproj; path = "../node_modules/react-native/Libraries/WebSocket/RCTWebSocket.xcodeproj"; sourceTree = ""; }; 315 | 13B07F961A680F5B00A75B9A /* Demo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Demo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 316 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = Demo/AppDelegate.h; sourceTree = ""; }; 317 | 13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = Demo/AppDelegate.m; sourceTree = ""; }; 318 | 13B07FB21A68108700A75B9A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 319 | 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = Demo/Images.xcassets; sourceTree = ""; }; 320 | 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = Demo/Info.plist; sourceTree = ""; }; 321 | 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = Demo/main.m; sourceTree = ""; }; 322 | 146833FF1AC3E56700842450 /* React.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = React.xcodeproj; path = "../node_modules/react-native/React/React.xcodeproj"; sourceTree = ""; }; 323 | 2D02E47B1E0B4A5D006451C7 /* Demo-tvOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Demo-tvOS.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 324 | 2D02E4901E0B4A5D006451C7 /* Demo-tvOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Demo-tvOSTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 325 | 5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTAnimation.xcodeproj; path = "../node_modules/react-native/Libraries/NativeAnimation/RCTAnimation.xcodeproj"; sourceTree = ""; }; 326 | 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = "../node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj"; sourceTree = ""; }; 327 | 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "../node_modules/react-native/Libraries/Text/RCTText.xcodeproj"; sourceTree = ""; }; 328 | /* End PBXFileReference section */ 329 | 330 | /* Begin PBXFrameworksBuildPhase section */ 331 | 00E356EB1AD99517003FC87E /* Frameworks */ = { 332 | isa = PBXFrameworksBuildPhase; 333 | buildActionMask = 2147483647; 334 | files = ( 335 | 140ED2AC1D01E1AD002B40FF /* libReact.a in Frameworks */, 336 | ); 337 | runOnlyForDeploymentPostprocessing = 0; 338 | }; 339 | 13B07F8C1A680F5B00A75B9A /* Frameworks */ = { 340 | isa = PBXFrameworksBuildPhase; 341 | buildActionMask = 2147483647; 342 | files = ( 343 | 146834051AC3E58100842450 /* libReact.a in Frameworks */, 344 | 5E9157361DD0AC6A00FF2AA8 /* libRCTAnimation.a in Frameworks */, 345 | 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */, 346 | 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */, 347 | 00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */, 348 | 133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */, 349 | 00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */, 350 | 139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */, 351 | 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */, 352 | 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */, 353 | 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */, 354 | ); 355 | runOnlyForDeploymentPostprocessing = 0; 356 | }; 357 | 2D02E4781E0B4A5D006451C7 /* Frameworks */ = { 358 | isa = PBXFrameworksBuildPhase; 359 | buildActionMask = 2147483647; 360 | files = ( 361 | 2D02E4C91E0B4AEC006451C7 /* libReact.a in Frameworks */, 362 | 2D02E4C21E0B4AEC006451C7 /* libRCTAnimation-tvOS.a in Frameworks */, 363 | 2D02E4C31E0B4AEC006451C7 /* libRCTImage-tvOS.a in Frameworks */, 364 | 2D02E4C41E0B4AEC006451C7 /* libRCTLinking-tvOS.a in Frameworks */, 365 | 2D02E4C51E0B4AEC006451C7 /* libRCTNetwork-tvOS.a in Frameworks */, 366 | 2D02E4C61E0B4AEC006451C7 /* libRCTSettings-tvOS.a in Frameworks */, 367 | 2D02E4C71E0B4AEC006451C7 /* libRCTText-tvOS.a in Frameworks */, 368 | 2D02E4C81E0B4AEC006451C7 /* libRCTWebSocket-tvOS.a in Frameworks */, 369 | ); 370 | runOnlyForDeploymentPostprocessing = 0; 371 | }; 372 | 2D02E48D1E0B4A5D006451C7 /* Frameworks */ = { 373 | isa = PBXFrameworksBuildPhase; 374 | buildActionMask = 2147483647; 375 | files = ( 376 | ); 377 | runOnlyForDeploymentPostprocessing = 0; 378 | }; 379 | /* End PBXFrameworksBuildPhase section */ 380 | 381 | /* Begin PBXGroup section */ 382 | 00C302A81ABCB8CE00DB3ED1 /* Products */ = { 383 | isa = PBXGroup; 384 | children = ( 385 | 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */, 386 | ); 387 | name = Products; 388 | sourceTree = ""; 389 | }; 390 | 00C302B61ABCB90400DB3ED1 /* Products */ = { 391 | isa = PBXGroup; 392 | children = ( 393 | 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */, 394 | ); 395 | name = Products; 396 | sourceTree = ""; 397 | }; 398 | 00C302BC1ABCB91800DB3ED1 /* Products */ = { 399 | isa = PBXGroup; 400 | children = ( 401 | 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */, 402 | 3DAD3E841DF850E9000B6D8A /* libRCTImage-tvOS.a */, 403 | ); 404 | name = Products; 405 | sourceTree = ""; 406 | }; 407 | 00C302D41ABCB9D200DB3ED1 /* Products */ = { 408 | isa = PBXGroup; 409 | children = ( 410 | 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */, 411 | 3DAD3E8C1DF850E9000B6D8A /* libRCTNetwork-tvOS.a */, 412 | ); 413 | name = Products; 414 | sourceTree = ""; 415 | }; 416 | 00C302E01ABCB9EE00DB3ED1 /* Products */ = { 417 | isa = PBXGroup; 418 | children = ( 419 | 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */, 420 | ); 421 | name = Products; 422 | sourceTree = ""; 423 | }; 424 | 00E356EF1AD99517003FC87E /* DemoTests */ = { 425 | isa = PBXGroup; 426 | children = ( 427 | 00E356F21AD99517003FC87E /* DemoTests.m */, 428 | 00E356F01AD99517003FC87E /* Supporting Files */, 429 | ); 430 | path = DemoTests; 431 | sourceTree = ""; 432 | }; 433 | 00E356F01AD99517003FC87E /* Supporting Files */ = { 434 | isa = PBXGroup; 435 | children = ( 436 | 00E356F11AD99517003FC87E /* Info.plist */, 437 | ); 438 | name = "Supporting Files"; 439 | sourceTree = ""; 440 | }; 441 | 139105B71AF99BAD00B5F7CC /* Products */ = { 442 | isa = PBXGroup; 443 | children = ( 444 | 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */, 445 | 3DAD3E901DF850E9000B6D8A /* libRCTSettings-tvOS.a */, 446 | ); 447 | name = Products; 448 | sourceTree = ""; 449 | }; 450 | 139FDEE71B06529A00C62182 /* Products */ = { 451 | isa = PBXGroup; 452 | children = ( 453 | 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */, 454 | 3DAD3E991DF850E9000B6D8A /* libRCTWebSocket-tvOS.a */, 455 | 3DD02A48202D9E8A00D42CFB /* libfishhook.a */, 456 | 3DD02A4A202D9E8A00D42CFB /* libfishhook-tvOS.a */, 457 | ); 458 | name = Products; 459 | sourceTree = ""; 460 | }; 461 | 13B07FAE1A68108700A75B9A /* Demo */ = { 462 | isa = PBXGroup; 463 | children = ( 464 | 008F07F21AC5B25A0029DE68 /* main.jsbundle */, 465 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */, 466 | 13B07FB01A68108700A75B9A /* AppDelegate.m */, 467 | 13B07FB51A68108700A75B9A /* Images.xcassets */, 468 | 13B07FB61A68108700A75B9A /* Info.plist */, 469 | 13B07FB11A68108700A75B9A /* LaunchScreen.xib */, 470 | 13B07FB71A68108700A75B9A /* main.m */, 471 | ); 472 | name = Demo; 473 | sourceTree = ""; 474 | }; 475 | 146834001AC3E56700842450 /* Products */ = { 476 | isa = PBXGroup; 477 | children = ( 478 | 146834041AC3E56700842450 /* libReact.a */, 479 | 3DAD3EA31DF850E9000B6D8A /* libReact.a */, 480 | 3DAD3EA51DF850E9000B6D8A /* libyoga.a */, 481 | 3DAD3EA71DF850E9000B6D8A /* libyoga.a */, 482 | 3DAD3EA91DF850E9000B6D8A /* libcxxreact.a */, 483 | 3DAD3EAB1DF850E9000B6D8A /* libcxxreact.a */, 484 | 3DAD3EAD1DF850E9000B6D8A /* libjschelpers.a */, 485 | 3DAD3EAF1DF850E9000B6D8A /* libjschelpers.a */, 486 | 3DD02A5C202D9E8A00D42CFB /* libjsinspector.a */, 487 | 3DD02A5E202D9E8A00D42CFB /* libjsinspector-tvOS.a */, 488 | 3DD02A60202D9E8A00D42CFB /* libthird-party.a */, 489 | 3DD02A62202D9E8A00D42CFB /* libthird-party.a */, 490 | 3DD02A64202D9E8A00D42CFB /* libdouble-conversion.a */, 491 | 3DD02A66202D9E8A00D42CFB /* libdouble-conversion.a */, 492 | 3DD02A68202D9E8A00D42CFB /* libprivatedata.a */, 493 | 3DD02A6A202D9E8A00D42CFB /* libprivatedata-tvOS.a */, 494 | ); 495 | name = Products; 496 | sourceTree = ""; 497 | }; 498 | 5E91572E1DD0AC6500FF2AA8 /* Products */ = { 499 | isa = PBXGroup; 500 | children = ( 501 | 5E9157331DD0AC6500FF2AA8 /* libRCTAnimation.a */, 502 | 5E9157351DD0AC6500FF2AA8 /* libRCTAnimation-tvOS.a */, 503 | ); 504 | name = Products; 505 | sourceTree = ""; 506 | }; 507 | 78C398B11ACF4ADC00677621 /* Products */ = { 508 | isa = PBXGroup; 509 | children = ( 510 | 78C398B91ACF4ADC00677621 /* libRCTLinking.a */, 511 | 3DAD3E881DF850E9000B6D8A /* libRCTLinking-tvOS.a */, 512 | ); 513 | name = Products; 514 | sourceTree = ""; 515 | }; 516 | 832341AE1AAA6A7D00B99B32 /* Libraries */ = { 517 | isa = PBXGroup; 518 | children = ( 519 | 5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */, 520 | 146833FF1AC3E56700842450 /* React.xcodeproj */, 521 | 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */, 522 | 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */, 523 | 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */, 524 | 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */, 525 | 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */, 526 | 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */, 527 | 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */, 528 | 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */, 529 | 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */, 530 | ); 531 | name = Libraries; 532 | sourceTree = ""; 533 | }; 534 | 832341B11AAA6A8300B99B32 /* Products */ = { 535 | isa = PBXGroup; 536 | children = ( 537 | 832341B51AAA6A8300B99B32 /* libRCTText.a */, 538 | 3DAD3E941DF850E9000B6D8A /* libRCTText-tvOS.a */, 539 | ); 540 | name = Products; 541 | sourceTree = ""; 542 | }; 543 | 83CBB9F61A601CBA00E9B192 = { 544 | isa = PBXGroup; 545 | children = ( 546 | 13B07FAE1A68108700A75B9A /* Demo */, 547 | 832341AE1AAA6A7D00B99B32 /* Libraries */, 548 | 00E356EF1AD99517003FC87E /* DemoTests */, 549 | 83CBBA001A601CBA00E9B192 /* Products */, 550 | ); 551 | indentWidth = 2; 552 | sourceTree = ""; 553 | tabWidth = 2; 554 | }; 555 | 83CBBA001A601CBA00E9B192 /* Products */ = { 556 | isa = PBXGroup; 557 | children = ( 558 | 13B07F961A680F5B00A75B9A /* Demo.app */, 559 | 00E356EE1AD99517003FC87E /* DemoTests.xctest */, 560 | 2D02E47B1E0B4A5D006451C7 /* Demo-tvOS.app */, 561 | 2D02E4901E0B4A5D006451C7 /* Demo-tvOSTests.xctest */, 562 | ); 563 | name = Products; 564 | sourceTree = ""; 565 | }; 566 | /* End PBXGroup section */ 567 | 568 | /* Begin PBXNativeTarget section */ 569 | 00E356ED1AD99517003FC87E /* DemoTests */ = { 570 | isa = PBXNativeTarget; 571 | buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "DemoTests" */; 572 | buildPhases = ( 573 | 00E356EA1AD99517003FC87E /* Sources */, 574 | 00E356EB1AD99517003FC87E /* Frameworks */, 575 | 00E356EC1AD99517003FC87E /* Resources */, 576 | ); 577 | buildRules = ( 578 | ); 579 | dependencies = ( 580 | 00E356F51AD99517003FC87E /* PBXTargetDependency */, 581 | ); 582 | name = DemoTests; 583 | productName = DemoTests; 584 | productReference = 00E356EE1AD99517003FC87E /* DemoTests.xctest */; 585 | productType = "com.apple.product-type.bundle.unit-test"; 586 | }; 587 | 13B07F861A680F5B00A75B9A /* Demo */ = { 588 | isa = PBXNativeTarget; 589 | buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "Demo" */; 590 | buildPhases = ( 591 | 13B07F871A680F5B00A75B9A /* Sources */, 592 | 13B07F8C1A680F5B00A75B9A /* Frameworks */, 593 | 13B07F8E1A680F5B00A75B9A /* Resources */, 594 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */, 595 | ); 596 | buildRules = ( 597 | ); 598 | dependencies = ( 599 | ); 600 | name = Demo; 601 | productName = "Hello World"; 602 | productReference = 13B07F961A680F5B00A75B9A /* Demo.app */; 603 | productType = "com.apple.product-type.application"; 604 | }; 605 | 2D02E47A1E0B4A5D006451C7 /* Demo-tvOS */ = { 606 | isa = PBXNativeTarget; 607 | buildConfigurationList = 2D02E4BA1E0B4A5E006451C7 /* Build configuration list for PBXNativeTarget "Demo-tvOS" */; 608 | buildPhases = ( 609 | 2D02E4771E0B4A5D006451C7 /* Sources */, 610 | 2D02E4781E0B4A5D006451C7 /* Frameworks */, 611 | 2D02E4791E0B4A5D006451C7 /* Resources */, 612 | 2D02E4CB1E0B4B27006451C7 /* Bundle React Native Code And Images */, 613 | ); 614 | buildRules = ( 615 | ); 616 | dependencies = ( 617 | ); 618 | name = "Demo-tvOS"; 619 | productName = "Demo-tvOS"; 620 | productReference = 2D02E47B1E0B4A5D006451C7 /* Demo-tvOS.app */; 621 | productType = "com.apple.product-type.application"; 622 | }; 623 | 2D02E48F1E0B4A5D006451C7 /* Demo-tvOSTests */ = { 624 | isa = PBXNativeTarget; 625 | buildConfigurationList = 2D02E4BB1E0B4A5E006451C7 /* Build configuration list for PBXNativeTarget "Demo-tvOSTests" */; 626 | buildPhases = ( 627 | 2D02E48C1E0B4A5D006451C7 /* Sources */, 628 | 2D02E48D1E0B4A5D006451C7 /* Frameworks */, 629 | 2D02E48E1E0B4A5D006451C7 /* Resources */, 630 | ); 631 | buildRules = ( 632 | ); 633 | dependencies = ( 634 | 2D02E4921E0B4A5D006451C7 /* PBXTargetDependency */, 635 | ); 636 | name = "Demo-tvOSTests"; 637 | productName = "Demo-tvOSTests"; 638 | productReference = 2D02E4901E0B4A5D006451C7 /* Demo-tvOSTests.xctest */; 639 | productType = "com.apple.product-type.bundle.unit-test"; 640 | }; 641 | /* End PBXNativeTarget section */ 642 | 643 | /* Begin PBXProject section */ 644 | 83CBB9F71A601CBA00E9B192 /* Project object */ = { 645 | isa = PBXProject; 646 | attributes = { 647 | LastUpgradeCheck = 0610; 648 | ORGANIZATIONNAME = Facebook; 649 | TargetAttributes = { 650 | 00E356ED1AD99517003FC87E = { 651 | CreatedOnToolsVersion = 6.2; 652 | TestTargetID = 13B07F861A680F5B00A75B9A; 653 | }; 654 | 2D02E47A1E0B4A5D006451C7 = { 655 | CreatedOnToolsVersion = 8.2.1; 656 | ProvisioningStyle = Automatic; 657 | }; 658 | 2D02E48F1E0B4A5D006451C7 = { 659 | CreatedOnToolsVersion = 8.2.1; 660 | ProvisioningStyle = Automatic; 661 | TestTargetID = 2D02E47A1E0B4A5D006451C7; 662 | }; 663 | }; 664 | }; 665 | buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "Demo" */; 666 | compatibilityVersion = "Xcode 3.2"; 667 | developmentRegion = English; 668 | hasScannedForEncodings = 0; 669 | knownRegions = ( 670 | en, 671 | Base, 672 | ); 673 | mainGroup = 83CBB9F61A601CBA00E9B192; 674 | productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */; 675 | projectDirPath = ""; 676 | projectReferences = ( 677 | { 678 | ProductGroup = 00C302A81ABCB8CE00DB3ED1 /* Products */; 679 | ProjectRef = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */; 680 | }, 681 | { 682 | ProductGroup = 5E91572E1DD0AC6500FF2AA8 /* Products */; 683 | ProjectRef = 5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */; 684 | }, 685 | { 686 | ProductGroup = 00C302B61ABCB90400DB3ED1 /* Products */; 687 | ProjectRef = 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */; 688 | }, 689 | { 690 | ProductGroup = 00C302BC1ABCB91800DB3ED1 /* Products */; 691 | ProjectRef = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */; 692 | }, 693 | { 694 | ProductGroup = 78C398B11ACF4ADC00677621 /* Products */; 695 | ProjectRef = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */; 696 | }, 697 | { 698 | ProductGroup = 00C302D41ABCB9D200DB3ED1 /* Products */; 699 | ProjectRef = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */; 700 | }, 701 | { 702 | ProductGroup = 139105B71AF99BAD00B5F7CC /* Products */; 703 | ProjectRef = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */; 704 | }, 705 | { 706 | ProductGroup = 832341B11AAA6A8300B99B32 /* Products */; 707 | ProjectRef = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */; 708 | }, 709 | { 710 | ProductGroup = 00C302E01ABCB9EE00DB3ED1 /* Products */; 711 | ProjectRef = 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */; 712 | }, 713 | { 714 | ProductGroup = 139FDEE71B06529A00C62182 /* Products */; 715 | ProjectRef = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */; 716 | }, 717 | { 718 | ProductGroup = 146834001AC3E56700842450 /* Products */; 719 | ProjectRef = 146833FF1AC3E56700842450 /* React.xcodeproj */; 720 | }, 721 | ); 722 | projectRoot = ""; 723 | targets = ( 724 | 13B07F861A680F5B00A75B9A /* Demo */, 725 | 00E356ED1AD99517003FC87E /* DemoTests */, 726 | 2D02E47A1E0B4A5D006451C7 /* Demo-tvOS */, 727 | 2D02E48F1E0B4A5D006451C7 /* Demo-tvOSTests */, 728 | ); 729 | }; 730 | /* End PBXProject section */ 731 | 732 | /* Begin PBXReferenceProxy section */ 733 | 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */ = { 734 | isa = PBXReferenceProxy; 735 | fileType = archive.ar; 736 | path = libRCTActionSheet.a; 737 | remoteRef = 00C302AB1ABCB8CE00DB3ED1 /* PBXContainerItemProxy */; 738 | sourceTree = BUILT_PRODUCTS_DIR; 739 | }; 740 | 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */ = { 741 | isa = PBXReferenceProxy; 742 | fileType = archive.ar; 743 | path = libRCTGeolocation.a; 744 | remoteRef = 00C302B91ABCB90400DB3ED1 /* PBXContainerItemProxy */; 745 | sourceTree = BUILT_PRODUCTS_DIR; 746 | }; 747 | 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */ = { 748 | isa = PBXReferenceProxy; 749 | fileType = archive.ar; 750 | path = libRCTImage.a; 751 | remoteRef = 00C302BF1ABCB91800DB3ED1 /* PBXContainerItemProxy */; 752 | sourceTree = BUILT_PRODUCTS_DIR; 753 | }; 754 | 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */ = { 755 | isa = PBXReferenceProxy; 756 | fileType = archive.ar; 757 | path = libRCTNetwork.a; 758 | remoteRef = 00C302DB1ABCB9D200DB3ED1 /* PBXContainerItemProxy */; 759 | sourceTree = BUILT_PRODUCTS_DIR; 760 | }; 761 | 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */ = { 762 | isa = PBXReferenceProxy; 763 | fileType = archive.ar; 764 | path = libRCTVibration.a; 765 | remoteRef = 00C302E31ABCB9EE00DB3ED1 /* PBXContainerItemProxy */; 766 | sourceTree = BUILT_PRODUCTS_DIR; 767 | }; 768 | 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */ = { 769 | isa = PBXReferenceProxy; 770 | fileType = archive.ar; 771 | path = libRCTSettings.a; 772 | remoteRef = 139105C01AF99BAD00B5F7CC /* PBXContainerItemProxy */; 773 | sourceTree = BUILT_PRODUCTS_DIR; 774 | }; 775 | 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */ = { 776 | isa = PBXReferenceProxy; 777 | fileType = archive.ar; 778 | path = libRCTWebSocket.a; 779 | remoteRef = 139FDEF31B06529B00C62182 /* PBXContainerItemProxy */; 780 | sourceTree = BUILT_PRODUCTS_DIR; 781 | }; 782 | 146834041AC3E56700842450 /* libReact.a */ = { 783 | isa = PBXReferenceProxy; 784 | fileType = archive.ar; 785 | path = libReact.a; 786 | remoteRef = 146834031AC3E56700842450 /* PBXContainerItemProxy */; 787 | sourceTree = BUILT_PRODUCTS_DIR; 788 | }; 789 | 3DAD3E841DF850E9000B6D8A /* libRCTImage-tvOS.a */ = { 790 | isa = PBXReferenceProxy; 791 | fileType = archive.ar; 792 | path = "libRCTImage-tvOS.a"; 793 | remoteRef = 3DAD3E831DF850E9000B6D8A /* PBXContainerItemProxy */; 794 | sourceTree = BUILT_PRODUCTS_DIR; 795 | }; 796 | 3DAD3E881DF850E9000B6D8A /* libRCTLinking-tvOS.a */ = { 797 | isa = PBXReferenceProxy; 798 | fileType = archive.ar; 799 | path = "libRCTLinking-tvOS.a"; 800 | remoteRef = 3DAD3E871DF850E9000B6D8A /* PBXContainerItemProxy */; 801 | sourceTree = BUILT_PRODUCTS_DIR; 802 | }; 803 | 3DAD3E8C1DF850E9000B6D8A /* libRCTNetwork-tvOS.a */ = { 804 | isa = PBXReferenceProxy; 805 | fileType = archive.ar; 806 | path = "libRCTNetwork-tvOS.a"; 807 | remoteRef = 3DAD3E8B1DF850E9000B6D8A /* PBXContainerItemProxy */; 808 | sourceTree = BUILT_PRODUCTS_DIR; 809 | }; 810 | 3DAD3E901DF850E9000B6D8A /* libRCTSettings-tvOS.a */ = { 811 | isa = PBXReferenceProxy; 812 | fileType = archive.ar; 813 | path = "libRCTSettings-tvOS.a"; 814 | remoteRef = 3DAD3E8F1DF850E9000B6D8A /* PBXContainerItemProxy */; 815 | sourceTree = BUILT_PRODUCTS_DIR; 816 | }; 817 | 3DAD3E941DF850E9000B6D8A /* libRCTText-tvOS.a */ = { 818 | isa = PBXReferenceProxy; 819 | fileType = archive.ar; 820 | path = "libRCTText-tvOS.a"; 821 | remoteRef = 3DAD3E931DF850E9000B6D8A /* PBXContainerItemProxy */; 822 | sourceTree = BUILT_PRODUCTS_DIR; 823 | }; 824 | 3DAD3E991DF850E9000B6D8A /* libRCTWebSocket-tvOS.a */ = { 825 | isa = PBXReferenceProxy; 826 | fileType = archive.ar; 827 | path = "libRCTWebSocket-tvOS.a"; 828 | remoteRef = 3DAD3E981DF850E9000B6D8A /* PBXContainerItemProxy */; 829 | sourceTree = BUILT_PRODUCTS_DIR; 830 | }; 831 | 3DAD3EA31DF850E9000B6D8A /* libReact.a */ = { 832 | isa = PBXReferenceProxy; 833 | fileType = archive.ar; 834 | path = libReact.a; 835 | remoteRef = 3DAD3EA21DF850E9000B6D8A /* PBXContainerItemProxy */; 836 | sourceTree = BUILT_PRODUCTS_DIR; 837 | }; 838 | 3DAD3EA51DF850E9000B6D8A /* libyoga.a */ = { 839 | isa = PBXReferenceProxy; 840 | fileType = archive.ar; 841 | path = libyoga.a; 842 | remoteRef = 3DAD3EA41DF850E9000B6D8A /* PBXContainerItemProxy */; 843 | sourceTree = BUILT_PRODUCTS_DIR; 844 | }; 845 | 3DAD3EA71DF850E9000B6D8A /* libyoga.a */ = { 846 | isa = PBXReferenceProxy; 847 | fileType = archive.ar; 848 | path = libyoga.a; 849 | remoteRef = 3DAD3EA61DF850E9000B6D8A /* PBXContainerItemProxy */; 850 | sourceTree = BUILT_PRODUCTS_DIR; 851 | }; 852 | 3DAD3EA91DF850E9000B6D8A /* libcxxreact.a */ = { 853 | isa = PBXReferenceProxy; 854 | fileType = archive.ar; 855 | path = libcxxreact.a; 856 | remoteRef = 3DAD3EA81DF850E9000B6D8A /* PBXContainerItemProxy */; 857 | sourceTree = BUILT_PRODUCTS_DIR; 858 | }; 859 | 3DAD3EAB1DF850E9000B6D8A /* libcxxreact.a */ = { 860 | isa = PBXReferenceProxy; 861 | fileType = archive.ar; 862 | path = libcxxreact.a; 863 | remoteRef = 3DAD3EAA1DF850E9000B6D8A /* PBXContainerItemProxy */; 864 | sourceTree = BUILT_PRODUCTS_DIR; 865 | }; 866 | 3DAD3EAD1DF850E9000B6D8A /* libjschelpers.a */ = { 867 | isa = PBXReferenceProxy; 868 | fileType = archive.ar; 869 | path = libjschelpers.a; 870 | remoteRef = 3DAD3EAC1DF850E9000B6D8A /* PBXContainerItemProxy */; 871 | sourceTree = BUILT_PRODUCTS_DIR; 872 | }; 873 | 3DAD3EAF1DF850E9000B6D8A /* libjschelpers.a */ = { 874 | isa = PBXReferenceProxy; 875 | fileType = archive.ar; 876 | path = libjschelpers.a; 877 | remoteRef = 3DAD3EAE1DF850E9000B6D8A /* PBXContainerItemProxy */; 878 | sourceTree = BUILT_PRODUCTS_DIR; 879 | }; 880 | 3DD02A48202D9E8A00D42CFB /* libfishhook.a */ = { 881 | isa = PBXReferenceProxy; 882 | fileType = archive.ar; 883 | path = libfishhook.a; 884 | remoteRef = 3DD02A47202D9E8A00D42CFB /* PBXContainerItemProxy */; 885 | sourceTree = BUILT_PRODUCTS_DIR; 886 | }; 887 | 3DD02A4A202D9E8A00D42CFB /* libfishhook-tvOS.a */ = { 888 | isa = PBXReferenceProxy; 889 | fileType = archive.ar; 890 | path = "libfishhook-tvOS.a"; 891 | remoteRef = 3DD02A49202D9E8A00D42CFB /* PBXContainerItemProxy */; 892 | sourceTree = BUILT_PRODUCTS_DIR; 893 | }; 894 | 3DD02A5C202D9E8A00D42CFB /* libjsinspector.a */ = { 895 | isa = PBXReferenceProxy; 896 | fileType = archive.ar; 897 | path = libjsinspector.a; 898 | remoteRef = 3DD02A5B202D9E8A00D42CFB /* PBXContainerItemProxy */; 899 | sourceTree = BUILT_PRODUCTS_DIR; 900 | }; 901 | 3DD02A5E202D9E8A00D42CFB /* libjsinspector-tvOS.a */ = { 902 | isa = PBXReferenceProxy; 903 | fileType = archive.ar; 904 | path = "libjsinspector-tvOS.a"; 905 | remoteRef = 3DD02A5D202D9E8A00D42CFB /* PBXContainerItemProxy */; 906 | sourceTree = BUILT_PRODUCTS_DIR; 907 | }; 908 | 3DD02A60202D9E8A00D42CFB /* libthird-party.a */ = { 909 | isa = PBXReferenceProxy; 910 | fileType = archive.ar; 911 | path = "libthird-party.a"; 912 | remoteRef = 3DD02A5F202D9E8A00D42CFB /* PBXContainerItemProxy */; 913 | sourceTree = BUILT_PRODUCTS_DIR; 914 | }; 915 | 3DD02A62202D9E8A00D42CFB /* libthird-party.a */ = { 916 | isa = PBXReferenceProxy; 917 | fileType = archive.ar; 918 | path = "libthird-party.a"; 919 | remoteRef = 3DD02A61202D9E8A00D42CFB /* PBXContainerItemProxy */; 920 | sourceTree = BUILT_PRODUCTS_DIR; 921 | }; 922 | 3DD02A64202D9E8A00D42CFB /* libdouble-conversion.a */ = { 923 | isa = PBXReferenceProxy; 924 | fileType = archive.ar; 925 | path = "libdouble-conversion.a"; 926 | remoteRef = 3DD02A63202D9E8A00D42CFB /* PBXContainerItemProxy */; 927 | sourceTree = BUILT_PRODUCTS_DIR; 928 | }; 929 | 3DD02A66202D9E8A00D42CFB /* libdouble-conversion.a */ = { 930 | isa = PBXReferenceProxy; 931 | fileType = archive.ar; 932 | path = "libdouble-conversion.a"; 933 | remoteRef = 3DD02A65202D9E8A00D42CFB /* PBXContainerItemProxy */; 934 | sourceTree = BUILT_PRODUCTS_DIR; 935 | }; 936 | 3DD02A68202D9E8A00D42CFB /* libprivatedata.a */ = { 937 | isa = PBXReferenceProxy; 938 | fileType = archive.ar; 939 | path = libprivatedata.a; 940 | remoteRef = 3DD02A67202D9E8A00D42CFB /* PBXContainerItemProxy */; 941 | sourceTree = BUILT_PRODUCTS_DIR; 942 | }; 943 | 3DD02A6A202D9E8A00D42CFB /* libprivatedata-tvOS.a */ = { 944 | isa = PBXReferenceProxy; 945 | fileType = archive.ar; 946 | path = "libprivatedata-tvOS.a"; 947 | remoteRef = 3DD02A69202D9E8A00D42CFB /* PBXContainerItemProxy */; 948 | sourceTree = BUILT_PRODUCTS_DIR; 949 | }; 950 | 5E9157331DD0AC6500FF2AA8 /* libRCTAnimation.a */ = { 951 | isa = PBXReferenceProxy; 952 | fileType = archive.ar; 953 | path = libRCTAnimation.a; 954 | remoteRef = 5E9157321DD0AC6500FF2AA8 /* PBXContainerItemProxy */; 955 | sourceTree = BUILT_PRODUCTS_DIR; 956 | }; 957 | 5E9157351DD0AC6500FF2AA8 /* libRCTAnimation-tvOS.a */ = { 958 | isa = PBXReferenceProxy; 959 | fileType = archive.ar; 960 | path = "libRCTAnimation-tvOS.a"; 961 | remoteRef = 5E9157341DD0AC6500FF2AA8 /* PBXContainerItemProxy */; 962 | sourceTree = BUILT_PRODUCTS_DIR; 963 | }; 964 | 78C398B91ACF4ADC00677621 /* libRCTLinking.a */ = { 965 | isa = PBXReferenceProxy; 966 | fileType = archive.ar; 967 | path = libRCTLinking.a; 968 | remoteRef = 78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */; 969 | sourceTree = BUILT_PRODUCTS_DIR; 970 | }; 971 | 832341B51AAA6A8300B99B32 /* libRCTText.a */ = { 972 | isa = PBXReferenceProxy; 973 | fileType = archive.ar; 974 | path = libRCTText.a; 975 | remoteRef = 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */; 976 | sourceTree = BUILT_PRODUCTS_DIR; 977 | }; 978 | /* End PBXReferenceProxy section */ 979 | 980 | /* Begin PBXResourcesBuildPhase section */ 981 | 00E356EC1AD99517003FC87E /* Resources */ = { 982 | isa = PBXResourcesBuildPhase; 983 | buildActionMask = 2147483647; 984 | files = ( 985 | ); 986 | runOnlyForDeploymentPostprocessing = 0; 987 | }; 988 | 13B07F8E1A680F5B00A75B9A /* Resources */ = { 989 | isa = PBXResourcesBuildPhase; 990 | buildActionMask = 2147483647; 991 | files = ( 992 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */, 993 | 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */, 994 | ); 995 | runOnlyForDeploymentPostprocessing = 0; 996 | }; 997 | 2D02E4791E0B4A5D006451C7 /* Resources */ = { 998 | isa = PBXResourcesBuildPhase; 999 | buildActionMask = 2147483647; 1000 | files = ( 1001 | 2D02E4BD1E0B4A84006451C7 /* Images.xcassets in Resources */, 1002 | ); 1003 | runOnlyForDeploymentPostprocessing = 0; 1004 | }; 1005 | 2D02E48E1E0B4A5D006451C7 /* Resources */ = { 1006 | isa = PBXResourcesBuildPhase; 1007 | buildActionMask = 2147483647; 1008 | files = ( 1009 | ); 1010 | runOnlyForDeploymentPostprocessing = 0; 1011 | }; 1012 | /* End PBXResourcesBuildPhase section */ 1013 | 1014 | /* Begin PBXShellScriptBuildPhase section */ 1015 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = { 1016 | isa = PBXShellScriptBuildPhase; 1017 | buildActionMask = 2147483647; 1018 | files = ( 1019 | ); 1020 | inputPaths = ( 1021 | ); 1022 | name = "Bundle React Native code and images"; 1023 | outputPaths = ( 1024 | ); 1025 | runOnlyForDeploymentPostprocessing = 0; 1026 | shellPath = /bin/sh; 1027 | shellScript = "export NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh"; 1028 | }; 1029 | 2D02E4CB1E0B4B27006451C7 /* Bundle React Native Code And Images */ = { 1030 | isa = PBXShellScriptBuildPhase; 1031 | buildActionMask = 2147483647; 1032 | files = ( 1033 | ); 1034 | inputPaths = ( 1035 | ); 1036 | name = "Bundle React Native Code And Images"; 1037 | outputPaths = ( 1038 | ); 1039 | runOnlyForDeploymentPostprocessing = 0; 1040 | shellPath = /bin/sh; 1041 | shellScript = "export NODE_BINARY=node\n../node_modules/react-native/packager/react-native-xcode.sh"; 1042 | }; 1043 | /* End PBXShellScriptBuildPhase section */ 1044 | 1045 | /* Begin PBXSourcesBuildPhase section */ 1046 | 00E356EA1AD99517003FC87E /* Sources */ = { 1047 | isa = PBXSourcesBuildPhase; 1048 | buildActionMask = 2147483647; 1049 | files = ( 1050 | 00E356F31AD99517003FC87E /* DemoTests.m in Sources */, 1051 | ); 1052 | runOnlyForDeploymentPostprocessing = 0; 1053 | }; 1054 | 13B07F871A680F5B00A75B9A /* Sources */ = { 1055 | isa = PBXSourcesBuildPhase; 1056 | buildActionMask = 2147483647; 1057 | files = ( 1058 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */, 1059 | 13B07FC11A68108700A75B9A /* main.m in Sources */, 1060 | ); 1061 | runOnlyForDeploymentPostprocessing = 0; 1062 | }; 1063 | 2D02E4771E0B4A5D006451C7 /* Sources */ = { 1064 | isa = PBXSourcesBuildPhase; 1065 | buildActionMask = 2147483647; 1066 | files = ( 1067 | 2D02E4BF1E0B4AB3006451C7 /* main.m in Sources */, 1068 | 2D02E4BC1E0B4A80006451C7 /* AppDelegate.m in Sources */, 1069 | ); 1070 | runOnlyForDeploymentPostprocessing = 0; 1071 | }; 1072 | 2D02E48C1E0B4A5D006451C7 /* Sources */ = { 1073 | isa = PBXSourcesBuildPhase; 1074 | buildActionMask = 2147483647; 1075 | files = ( 1076 | 2DCD954D1E0B4F2C00145EB5 /* DemoTests.m in Sources */, 1077 | ); 1078 | runOnlyForDeploymentPostprocessing = 0; 1079 | }; 1080 | /* End PBXSourcesBuildPhase section */ 1081 | 1082 | /* Begin PBXTargetDependency section */ 1083 | 00E356F51AD99517003FC87E /* PBXTargetDependency */ = { 1084 | isa = PBXTargetDependency; 1085 | target = 13B07F861A680F5B00A75B9A /* Demo */; 1086 | targetProxy = 00E356F41AD99517003FC87E /* PBXContainerItemProxy */; 1087 | }; 1088 | 2D02E4921E0B4A5D006451C7 /* PBXTargetDependency */ = { 1089 | isa = PBXTargetDependency; 1090 | target = 2D02E47A1E0B4A5D006451C7 /* Demo-tvOS */; 1091 | targetProxy = 2D02E4911E0B4A5D006451C7 /* PBXContainerItemProxy */; 1092 | }; 1093 | /* End PBXTargetDependency section */ 1094 | 1095 | /* Begin PBXVariantGroup section */ 1096 | 13B07FB11A68108700A75B9A /* LaunchScreen.xib */ = { 1097 | isa = PBXVariantGroup; 1098 | children = ( 1099 | 13B07FB21A68108700A75B9A /* Base */, 1100 | ); 1101 | name = LaunchScreen.xib; 1102 | path = Demo; 1103 | sourceTree = ""; 1104 | }; 1105 | /* End PBXVariantGroup section */ 1106 | 1107 | /* Begin XCBuildConfiguration section */ 1108 | 00E356F61AD99517003FC87E /* Debug */ = { 1109 | isa = XCBuildConfiguration; 1110 | buildSettings = { 1111 | BUNDLE_LOADER = "$(TEST_HOST)"; 1112 | GCC_PREPROCESSOR_DEFINITIONS = ( 1113 | "DEBUG=1", 1114 | "$(inherited)", 1115 | ); 1116 | INFOPLIST_FILE = DemoTests/Info.plist; 1117 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 1118 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 1119 | OTHER_LDFLAGS = ( 1120 | "-ObjC", 1121 | "-lc++", 1122 | ); 1123 | PRODUCT_NAME = "$(TARGET_NAME)"; 1124 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Demo.app/Demo"; 1125 | }; 1126 | name = Debug; 1127 | }; 1128 | 00E356F71AD99517003FC87E /* Release */ = { 1129 | isa = XCBuildConfiguration; 1130 | buildSettings = { 1131 | BUNDLE_LOADER = "$(TEST_HOST)"; 1132 | COPY_PHASE_STRIP = NO; 1133 | INFOPLIST_FILE = DemoTests/Info.plist; 1134 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 1135 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 1136 | OTHER_LDFLAGS = ( 1137 | "-ObjC", 1138 | "-lc++", 1139 | ); 1140 | PRODUCT_NAME = "$(TARGET_NAME)"; 1141 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Demo.app/Demo"; 1142 | }; 1143 | name = Release; 1144 | }; 1145 | 13B07F941A680F5B00A75B9A /* Debug */ = { 1146 | isa = XCBuildConfiguration; 1147 | buildSettings = { 1148 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 1149 | CURRENT_PROJECT_VERSION = 1; 1150 | DEAD_CODE_STRIPPING = NO; 1151 | INFOPLIST_FILE = Demo/Info.plist; 1152 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 1153 | OTHER_LDFLAGS = ( 1154 | "$(inherited)", 1155 | "-ObjC", 1156 | "-lc++", 1157 | ); 1158 | PRODUCT_NAME = Demo; 1159 | VERSIONING_SYSTEM = "apple-generic"; 1160 | }; 1161 | name = Debug; 1162 | }; 1163 | 13B07F951A680F5B00A75B9A /* Release */ = { 1164 | isa = XCBuildConfiguration; 1165 | buildSettings = { 1166 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 1167 | CURRENT_PROJECT_VERSION = 1; 1168 | INFOPLIST_FILE = Demo/Info.plist; 1169 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 1170 | OTHER_LDFLAGS = ( 1171 | "$(inherited)", 1172 | "-ObjC", 1173 | "-lc++", 1174 | ); 1175 | PRODUCT_NAME = Demo; 1176 | VERSIONING_SYSTEM = "apple-generic"; 1177 | }; 1178 | name = Release; 1179 | }; 1180 | 2D02E4971E0B4A5E006451C7 /* Debug */ = { 1181 | isa = XCBuildConfiguration; 1182 | buildSettings = { 1183 | ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image"; 1184 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 1185 | CLANG_ANALYZER_NONNULL = YES; 1186 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 1187 | CLANG_WARN_INFINITE_RECURSION = YES; 1188 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 1189 | DEBUG_INFORMATION_FORMAT = dwarf; 1190 | ENABLE_TESTABILITY = YES; 1191 | GCC_NO_COMMON_BLOCKS = YES; 1192 | INFOPLIST_FILE = "Demo-tvOS/Info.plist"; 1193 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 1194 | OTHER_LDFLAGS = ( 1195 | "-ObjC", 1196 | "-lc++", 1197 | ); 1198 | PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.REACT.Demo-tvOS"; 1199 | PRODUCT_NAME = "$(TARGET_NAME)"; 1200 | SDKROOT = appletvos; 1201 | TARGETED_DEVICE_FAMILY = 3; 1202 | TVOS_DEPLOYMENT_TARGET = 9.2; 1203 | }; 1204 | name = Debug; 1205 | }; 1206 | 2D02E4981E0B4A5E006451C7 /* Release */ = { 1207 | isa = XCBuildConfiguration; 1208 | buildSettings = { 1209 | ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image"; 1210 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 1211 | CLANG_ANALYZER_NONNULL = YES; 1212 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 1213 | CLANG_WARN_INFINITE_RECURSION = YES; 1214 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 1215 | COPY_PHASE_STRIP = NO; 1216 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 1217 | GCC_NO_COMMON_BLOCKS = YES; 1218 | INFOPLIST_FILE = "Demo-tvOS/Info.plist"; 1219 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 1220 | OTHER_LDFLAGS = ( 1221 | "-ObjC", 1222 | "-lc++", 1223 | ); 1224 | PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.REACT.Demo-tvOS"; 1225 | PRODUCT_NAME = "$(TARGET_NAME)"; 1226 | SDKROOT = appletvos; 1227 | TARGETED_DEVICE_FAMILY = 3; 1228 | TVOS_DEPLOYMENT_TARGET = 9.2; 1229 | }; 1230 | name = Release; 1231 | }; 1232 | 2D02E4991E0B4A5E006451C7 /* Debug */ = { 1233 | isa = XCBuildConfiguration; 1234 | buildSettings = { 1235 | BUNDLE_LOADER = "$(TEST_HOST)"; 1236 | CLANG_ANALYZER_NONNULL = YES; 1237 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 1238 | CLANG_WARN_INFINITE_RECURSION = YES; 1239 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 1240 | DEBUG_INFORMATION_FORMAT = dwarf; 1241 | ENABLE_TESTABILITY = YES; 1242 | GCC_NO_COMMON_BLOCKS = YES; 1243 | INFOPLIST_FILE = "Demo-tvOSTests/Info.plist"; 1244 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 1245 | PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.REACT.Demo-tvOSTests"; 1246 | PRODUCT_NAME = "$(TARGET_NAME)"; 1247 | SDKROOT = appletvos; 1248 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Demo-tvOS.app/Demo-tvOS"; 1249 | TVOS_DEPLOYMENT_TARGET = 10.1; 1250 | }; 1251 | name = Debug; 1252 | }; 1253 | 2D02E49A1E0B4A5E006451C7 /* Release */ = { 1254 | isa = XCBuildConfiguration; 1255 | buildSettings = { 1256 | BUNDLE_LOADER = "$(TEST_HOST)"; 1257 | CLANG_ANALYZER_NONNULL = YES; 1258 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 1259 | CLANG_WARN_INFINITE_RECURSION = YES; 1260 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 1261 | COPY_PHASE_STRIP = NO; 1262 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 1263 | GCC_NO_COMMON_BLOCKS = YES; 1264 | INFOPLIST_FILE = "Demo-tvOSTests/Info.plist"; 1265 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 1266 | PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.REACT.Demo-tvOSTests"; 1267 | PRODUCT_NAME = "$(TARGET_NAME)"; 1268 | SDKROOT = appletvos; 1269 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Demo-tvOS.app/Demo-tvOS"; 1270 | TVOS_DEPLOYMENT_TARGET = 10.1; 1271 | }; 1272 | name = Release; 1273 | }; 1274 | 83CBBA201A601CBA00E9B192 /* Debug */ = { 1275 | isa = XCBuildConfiguration; 1276 | buildSettings = { 1277 | ALWAYS_SEARCH_USER_PATHS = NO; 1278 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 1279 | CLANG_CXX_LIBRARY = "libc++"; 1280 | CLANG_ENABLE_MODULES = YES; 1281 | CLANG_ENABLE_OBJC_ARC = YES; 1282 | CLANG_WARN_BOOL_CONVERSION = YES; 1283 | CLANG_WARN_CONSTANT_CONVERSION = YES; 1284 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 1285 | CLANG_WARN_EMPTY_BODY = YES; 1286 | CLANG_WARN_ENUM_CONVERSION = YES; 1287 | CLANG_WARN_INT_CONVERSION = YES; 1288 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 1289 | CLANG_WARN_UNREACHABLE_CODE = YES; 1290 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 1291 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 1292 | COPY_PHASE_STRIP = NO; 1293 | ENABLE_STRICT_OBJC_MSGSEND = YES; 1294 | GCC_C_LANGUAGE_STANDARD = gnu99; 1295 | GCC_DYNAMIC_NO_PIC = NO; 1296 | GCC_OPTIMIZATION_LEVEL = 0; 1297 | GCC_PREPROCESSOR_DEFINITIONS = ( 1298 | "DEBUG=1", 1299 | "$(inherited)", 1300 | ); 1301 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 1302 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 1303 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 1304 | GCC_WARN_UNDECLARED_SELECTOR = YES; 1305 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 1306 | GCC_WARN_UNUSED_FUNCTION = YES; 1307 | GCC_WARN_UNUSED_VARIABLE = YES; 1308 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 1309 | MTL_ENABLE_DEBUG_INFO = YES; 1310 | ONLY_ACTIVE_ARCH = YES; 1311 | SDKROOT = iphoneos; 1312 | }; 1313 | name = Debug; 1314 | }; 1315 | 83CBBA211A601CBA00E9B192 /* Release */ = { 1316 | isa = XCBuildConfiguration; 1317 | buildSettings = { 1318 | ALWAYS_SEARCH_USER_PATHS = NO; 1319 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 1320 | CLANG_CXX_LIBRARY = "libc++"; 1321 | CLANG_ENABLE_MODULES = YES; 1322 | CLANG_ENABLE_OBJC_ARC = YES; 1323 | CLANG_WARN_BOOL_CONVERSION = YES; 1324 | CLANG_WARN_CONSTANT_CONVERSION = YES; 1325 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 1326 | CLANG_WARN_EMPTY_BODY = YES; 1327 | CLANG_WARN_ENUM_CONVERSION = YES; 1328 | CLANG_WARN_INT_CONVERSION = YES; 1329 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 1330 | CLANG_WARN_UNREACHABLE_CODE = YES; 1331 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 1332 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 1333 | COPY_PHASE_STRIP = YES; 1334 | ENABLE_NS_ASSERTIONS = NO; 1335 | ENABLE_STRICT_OBJC_MSGSEND = YES; 1336 | GCC_C_LANGUAGE_STANDARD = gnu99; 1337 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 1338 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 1339 | GCC_WARN_UNDECLARED_SELECTOR = YES; 1340 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 1341 | GCC_WARN_UNUSED_FUNCTION = YES; 1342 | GCC_WARN_UNUSED_VARIABLE = YES; 1343 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 1344 | MTL_ENABLE_DEBUG_INFO = NO; 1345 | SDKROOT = iphoneos; 1346 | VALIDATE_PRODUCT = YES; 1347 | }; 1348 | name = Release; 1349 | }; 1350 | /* End XCBuildConfiguration section */ 1351 | 1352 | /* Begin XCConfigurationList section */ 1353 | 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "DemoTests" */ = { 1354 | isa = XCConfigurationList; 1355 | buildConfigurations = ( 1356 | 00E356F61AD99517003FC87E /* Debug */, 1357 | 00E356F71AD99517003FC87E /* Release */, 1358 | ); 1359 | defaultConfigurationIsVisible = 0; 1360 | defaultConfigurationName = Release; 1361 | }; 1362 | 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "Demo" */ = { 1363 | isa = XCConfigurationList; 1364 | buildConfigurations = ( 1365 | 13B07F941A680F5B00A75B9A /* Debug */, 1366 | 13B07F951A680F5B00A75B9A /* Release */, 1367 | ); 1368 | defaultConfigurationIsVisible = 0; 1369 | defaultConfigurationName = Release; 1370 | }; 1371 | 2D02E4BA1E0B4A5E006451C7 /* Build configuration list for PBXNativeTarget "Demo-tvOS" */ = { 1372 | isa = XCConfigurationList; 1373 | buildConfigurations = ( 1374 | 2D02E4971E0B4A5E006451C7 /* Debug */, 1375 | 2D02E4981E0B4A5E006451C7 /* Release */, 1376 | ); 1377 | defaultConfigurationIsVisible = 0; 1378 | defaultConfigurationName = Release; 1379 | }; 1380 | 2D02E4BB1E0B4A5E006451C7 /* Build configuration list for PBXNativeTarget "Demo-tvOSTests" */ = { 1381 | isa = XCConfigurationList; 1382 | buildConfigurations = ( 1383 | 2D02E4991E0B4A5E006451C7 /* Debug */, 1384 | 2D02E49A1E0B4A5E006451C7 /* Release */, 1385 | ); 1386 | defaultConfigurationIsVisible = 0; 1387 | defaultConfigurationName = Release; 1388 | }; 1389 | 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "Demo" */ = { 1390 | isa = XCConfigurationList; 1391 | buildConfigurations = ( 1392 | 83CBBA201A601CBA00E9B192 /* Debug */, 1393 | 83CBBA211A601CBA00E9B192 /* Release */, 1394 | ); 1395 | defaultConfigurationIsVisible = 0; 1396 | defaultConfigurationName = Release; 1397 | }; 1398 | /* End XCConfigurationList section */ 1399 | }; 1400 | rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */; 1401 | } 1402 | --------------------------------------------------------------------------------