From ceb35185ade827baa333efba46e79d61af6ccd29 Mon Sep 17 00:00:00 2001 From: xwenliang Date: Thu, 7 Dec 2017 18:25:41 +0800 Subject: [PATCH] update PickerTest --- README.md | 4 +- example/PickerTest/.babelrc | 3 + example/PickerTest/.flowconfig | 92 +-- example/PickerTest/.gitattributes | 1 + example/PickerTest/.gitignore | 19 +- example/PickerTest/PickerTest.js | 229 +++++++ example/PickerTest/__tests__/App.js | 12 + example/PickerTest/android/app/BUCK | 53 +- example/PickerTest/android/app/build.gradle | 17 +- .../PickerTest/android/app/proguard-rules.pro | 4 + .../android/app/src/main/AndroidManifest.xml | 3 +- .../java/com/pickertest/MainApplication.java | 18 +- .../app/src/main/res/values/strings.xml | 1 - example/PickerTest/android/build.gradle | 2 +- .../gradle/wrapper/gradle-wrapper.properties | 2 +- example/PickerTest/android/keystores/BUCK | 12 +- example/PickerTest/android/settings.gradle | 4 +- example/PickerTest/app.json | 4 + example/PickerTest/index.android.js | 4 - example/PickerTest/index.ios.js | 4 - example/PickerTest/index.js | 232 +------ .../PickerTest/ios/PickerTest-tvOS/Info.plist | 54 ++ .../ios/PickerTest-tvOSTests/Info.plist | 24 + .../ios/PickerTest.xcodeproj/project.pbxproj | 625 ++++++++++++++++-- .../xcschemes/PickerTest-tvOS.xcscheme | 129 ++++ .../xcschemes/PickerTest.xcscheme | 27 +- .../PickerTest/ios/PickerTest/AppDelegate.m | 6 +- .../PickerTest/Images.xcassets/Contents.json | 6 + example/PickerTest/ios/PickerTest/Info.plist | 4 +- .../ios/PickerTestTests/PickerTestTests.m | 6 +- example/PickerTest/package.json | 16 +- index.js | 54 +- package.json | 2 +- 33 files changed, 1225 insertions(+), 448 deletions(-) create mode 100644 example/PickerTest/.babelrc create mode 100644 example/PickerTest/.gitattributes create mode 100644 example/PickerTest/PickerTest.js create mode 100644 example/PickerTest/__tests__/App.js create mode 100644 example/PickerTest/app.json delete mode 100644 example/PickerTest/index.android.js delete mode 100644 example/PickerTest/index.ios.js create mode 100644 example/PickerTest/ios/PickerTest-tvOS/Info.plist create mode 100644 example/PickerTest/ios/PickerTest-tvOSTests/Info.plist create mode 100644 example/PickerTest/ios/PickerTest.xcodeproj/xcshareddata/xcschemes/PickerTest-tvOS.xcscheme create mode 100644 example/PickerTest/ios/PickerTest/Images.xcassets/Contents.json diff --git a/README.md b/README.md index e1e9537..16079cb 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ #### Step 1 - install -``` +```javascript npm install react-native-picker --save ``` @@ -190,4 +190,4 @@ $ pod install ] ``` -### For pure javascript version -> [v3.0.5](https://github.com/beefe/react-native-picker/tree/pure-javascript-version) +### For pure javascript version -> [v3.0.5](https://github.com/beefe/react-native-picker/tree/pure-javascript-version) diff --git a/example/PickerTest/.babelrc b/example/PickerTest/.babelrc new file mode 100644 index 0000000..a9ce136 --- /dev/null +++ b/example/PickerTest/.babelrc @@ -0,0 +1,3 @@ +{ + "presets": ["react-native"] +} diff --git a/example/PickerTest/.flowconfig b/example/PickerTest/.flowconfig index 8e838d9..2f13324 100644 --- a/example/PickerTest/.flowconfig +++ b/example/PickerTest/.flowconfig @@ -1,94 +1,48 @@ [ignore] +; We fork some components by platform +.*/*[.]android.js -# We fork some components by platform. -.*/*.web.js -.*/*.android.js +; Ignore "BUCK" generated dirs +/\.buckd/ -# Some modules have their own node_modules with overlap -.*/node_modules/node-haste/.* +; Ignore unexpected extra "@providesModule" +.*/node_modules/.*/node_modules/fbjs/.* -# Ugh -.*/node_modules/babel.* -.*/node_modules/babylon.* -.*/node_modules/invariant.* - -# Ignore react and fbjs where there are overlaps, but don't ignore -# anything that react-native relies on -.*/node_modules/fbjs/lib/Map.js -.*/node_modules/fbjs/lib/ErrorUtils.js - -# Flow has a built-in definition for the 'react' module which we prefer to use -# over the currently-untyped source -.*/node_modules/react/react.js -.*/node_modules/react/lib/React.js -.*/node_modules/react/lib/ReactDOM.js - -.*/__mocks__/.* -.*/__tests__/.* - -.*/commoner/test/source/widget/share.js - -# Ignore commoner tests -.*/node_modules/commoner/test/.* - -# See https://github.com/facebook/flow/issues/442 -.*/react-tools/node_modules/commoner/lib/reader.js - -# Ignore jest -.*/node_modules/jest-cli/.* - -# Ignore Website -.*/website/.* - -# Ignore generators -.*/local-cli/generator.* - -# Ignore BUCK generated folders -.*\.buckd/ - -.*/node_modules/is-my-json-valid/test/.*\.json -.*/node_modules/iconv-lite/encodings/tables/.*\.json -.*/node_modules/y18n/test/.*\.json -.*/node_modules/spdx-license-ids/spdx-license-ids.json -.*/node_modules/spdx-exceptions/index.json -.*/node_modules/resolve/test/subdirs/node_modules/a/b/c/x.json -.*/node_modules/resolve/lib/core.json -.*/node_modules/jsonparse/samplejson/.*\.json -.*/node_modules/json5/test/.*\.json -.*/node_modules/ua-parser-js/test/.*\.json -.*/node_modules/builtin-modules/builtin-modules.json -.*/node_modules/binary-extensions/binary-extensions.json -.*/node_modules/url-regex/tlds.json -.*/node_modules/joi/.*\.json -.*/node_modules/isemail/.*\.json -.*/node_modules/tr46/.*\.json +; Ignore duplicate module providers +; For RN Apps installed via npm, "Libraries" folder is inside +; "node_modules/react-native" but in the source repo it is in the root +.*/Libraries/react-native/React.js +; Ignore polyfills +.*/Libraries/polyfills/.* [include] [libs] node_modules/react-native/Libraries/react-native/react-native-interface.js -node_modules/react-native/flow -flow/ +node_modules/react-native/flow/ [options] -module.system=haste +emoji=true -esproposal.class_static_fields=enable -esproposal.class_instance_fields=enable +module.system=haste munge_underscores=true -module.name_mapper='^image![a-zA-Z0-9$_-]+$' -> 'GlobalImageStub' 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' suppress_type=$FlowIssue suppress_type=$FlowFixMe +suppress_type=$FlowFixMeProps +suppress_type=$FlowFixMeState suppress_type=$FixMe -suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(2[0-4]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\) -suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(2[0-4]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+ +suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(5[0-7]\\|[1-4][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\) +suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(5[0-7]\\|[1-4][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+ suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy +suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError + +unsafe.enable_getters_and_setters=true [version] -0.24.0 +^0.57.0 diff --git a/example/PickerTest/.gitattributes b/example/PickerTest/.gitattributes new file mode 100644 index 0000000..d42ff18 --- /dev/null +++ b/example/PickerTest/.gitattributes @@ -0,0 +1 @@ +*.pbxproj -text diff --git a/example/PickerTest/.gitignore b/example/PickerTest/.gitignore index 42c9490..0826423 100644 --- a/example/PickerTest/.gitignore +++ b/example/PickerTest/.gitignore @@ -22,19 +22,32 @@ DerivedData *.xcuserstate project.xcworkspace -# Android/IJ +# Android/IntelliJ # +build/ .idea .gradle local.properties +*.iml # node.js # node_modules/ npm-debug.log +yarn-error.log # BUCK buck-out/ \.buckd/ -android/app/libs -android/keystores/debug.keystore +*.keystore + +# fastlane +# +# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the +# screenshots whenever they are needed. +# For more information about the recommended setup visit: +# https://docs.fastlane.tools/best-practices/source-control/ + +*/fastlane/report.xml +*/fastlane/Preview.html +*/fastlane/screenshots diff --git a/example/PickerTest/PickerTest.js b/example/PickerTest/PickerTest.js new file mode 100644 index 0000000..59666aa --- /dev/null +++ b/example/PickerTest/PickerTest.js @@ -0,0 +1,229 @@ +/** + * Bootstrap of PickerTest + */ + +import React, {Component} from 'react'; +import { + View, + Text, + TextInput, + TouchableOpacity, + Dimensions +} from 'react-native'; + +import Picker from 'react-native-picker'; +import area from './area.json'; + +export default class PickerTest extends Component { + + constructor(props, context) { + super(props, context); + } + + _createDateData() { + let date = []; + for(let i=1970;i<2020;i++){ + let month = []; + for(let j = 1;j<13;j++){ + let day = []; + if(j === 2){ + for(let k=1;k<29;k++){ + day.push(k+'日'); + } + //Leap day for years that are divisible by 4, such as 2000, 2004 + if(i%4 === 0){ + day.push(29+'日'); + } + } + else if(j in {1:1, 3:1, 5:1, 7:1, 8:1, 10:1, 12:1}){ + for(let k=1;k<32;k++){ + day.push(k+'日'); + } + } + else{ + for(let k=1;k<31;k++){ + day.push(k+'日'); + } + } + let _month = {}; + _month[j+'月'] = day; + month.push(_month); + } + let _date = {}; + _date[i+'年'] = month; + date.push(_date); + } + return date; + } + + _createAreaData() { + let data = []; + let len = area.length; + for(let i=0;i { + console.log('date', pickedValue, pickedIndex); + }, + onPickerCancel: (pickedValue, pickedIndex) => { + console.log('date', pickedValue, pickedIndex); + }, + onPickerSelect: (pickedValue, pickedIndex) => { + console.log('date', pickedValue, pickedIndex); + } + }); + Picker.show(); + } + + _showAreaPicker() { + Picker.init({ + pickerData: this._createAreaData(), + selectedValue: ['河北', '唐山', '古冶区'], + onPickerConfirm: pickedValue => { + console.log('area', pickedValue); + }, + onPickerCancel: pickedValue => { + console.log('area', pickedValue); + }, + onPickerSelect: pickedValue => { + //Picker.select(['山东', '青岛', '黄岛区']) + console.log('area', pickedValue); + } + }); + Picker.show(); + } + + _showTimePicker() { + let years = [], + months = [], + days = [], + hours = [], + minutes = []; + + for(let i=1;i<51;i++){ + years.push(i+1980); + } + for(let i=1;i<13;i++){ + months.push(i); + hours.push(i); + } + for(let i=1;i<32;i++){ + days.push(i); + } + for(let i=1;i<61;i++){ + minutes.push(i); + } + let pickerData = [years, months, days, ['am', 'pm'], hours, minutes]; + let date = new Date(); + let selectedValue = [ + date.getFullYear(), + date.getMonth()+1, + date.getDate(), + date.getHours() > 11 ? 'pm' : 'am', + date.getHours() === 12 ? 12 : date.getHours()%12, + date.getMinutes() + ]; + Picker.init({ + pickerData, + selectedValue, + pickerTitleText: 'Select Date and Time', + wheelFlex: [2, 1, 1, 2, 1, 1], + onPickerConfirm: pickedValue => { + console.log('area', pickedValue); + }, + onPickerCancel: pickedValue => { + console.log('area', pickedValue); + }, + onPickerSelect: pickedValue => { + let targetValue = [...pickedValue]; + if(parseInt(targetValue[1]) === 2){ + if(targetValue[0]%4 === 0 && targetValue[2] > 29){ + targetValue[2] = 29; + } + else if(targetValue[0]%4 !== 0 && targetValue[2] > 28){ + targetValue[2] = 28; + } + } + else if(targetValue[1] in {4:1, 6:1, 9:1, 11:1} && targetValue[2] > 30){ + targetValue[2] = 30; + + } + // forbidden some value such as some 2.29, 4.31, 6.31... + if(JSON.stringify(targetValue) !== JSON.stringify(pickedValue)){ + // android will return String all the time,but we put Number into picker at first + // so we need to convert them to Number again + targetValue.map((v, k) => { + if(k !== 3){ + targetValue[k] = parseInt(v); + } + }); + Picker.select(targetValue); + pickedValue = targetValue; + } + } + }); + Picker.show(); + } + + _toggle() { + Picker.toggle(); + } + + _isPickerShow(){ + Picker.isPickerShow(status => { + alert(status); + }); + } + + render() { + return ( + + + DatePicker + + + TimePicker + + + AreaPicker + + + toggle + + + isPickerShow + + + + ); + } +}; \ No newline at end of file diff --git a/example/PickerTest/__tests__/App.js b/example/PickerTest/__tests__/App.js new file mode 100644 index 0000000..d0b9ee3 --- /dev/null +++ b/example/PickerTest/__tests__/App.js @@ -0,0 +1,12 @@ +import 'react-native'; +import React from 'react'; +import App from '../App'; + +// Note: test renderer must be required after react-native. +import renderer from 'react-test-renderer'; + +it('renders correctly', () => { + const tree = renderer.create( + + ); +}); diff --git a/example/PickerTest/android/app/BUCK b/example/PickerTest/android/app/BUCK index 653e71c..f1aac4b 100644 --- a/example/PickerTest/android/app/BUCK +++ b/example/PickerTest/android/app/BUCK @@ -1,5 +1,3 @@ -import re - # To learn about Buck see [Docs](https://buckbuild.com/). # To run your application with Buck: # - install Buck @@ -11,8 +9,9 @@ import re # lib_deps = [] + for jarfile in glob(['libs/*.jar']): - name = 'jars__' + re.sub(r'^.*/([^/]+)\.jar$', r'\1', jarfile) + name = 'jars__' + jarfile[jarfile.rindex('/') + 1: jarfile.rindex('.jar')] lib_deps.append(':' + name) prebuilt_jar( name = name, @@ -20,7 +19,7 @@ for jarfile in glob(['libs/*.jar']): ) for aarfile in glob(['libs/*.aar']): - name = 'aars__' + re.sub(r'^.*/([^/]+)\.aar$', r'\1', aarfile) + name = 'aars__' + aarfile[aarfile.rindex('/') + 1: aarfile.rindex('.aar')] lib_deps.append(':' + name) android_prebuilt_aar( name = name, @@ -28,39 +27,39 @@ for aarfile in glob(['libs/*.aar']): ) android_library( - name = 'all-libs', - exported_deps = lib_deps + name = "all-libs", + exported_deps = lib_deps, ) android_library( - name = 'app-code', - srcs = glob([ - 'src/main/java/**/*.java', - ]), - deps = [ - ':all-libs', - ':build_config', - ':res', - ], + name = "app-code", + srcs = glob([ + "src/main/java/**/*.java", + ]), + deps = [ + ":all-libs", + ":build_config", + ":res", + ], ) android_build_config( - name = 'build_config', - package = 'com.pickertest', + name = "build_config", + package = "com.pickertest", ) android_resource( - name = 'res', - res = 'src/main/res', - package = 'com.pickertest', + name = "res", + package = "com.pickertest", + res = "src/main/res", ) android_binary( - name = 'app', - package_type = 'debug', - manifest = 'src/main/AndroidManifest.xml', - keystore = '//android/keystores:debug', - deps = [ - ':app-code', - ], + name = "app", + keystore = "//android/keystores:debug", + manifest = "src/main/AndroidManifest.xml", + package_type = "debug", + deps = [ + ":app-code", + ], ) diff --git a/example/PickerTest/android/app/build.gradle b/example/PickerTest/android/app/build.gradle index 20167c9..7a64d08 100644 --- a/example/PickerTest/android/app/build.gradle +++ b/example/PickerTest/android/app/build.gradle @@ -33,6 +33,13 @@ import com.android.build.OutputFile * // bundleInPaidRelease: true, * // bundleInBeta: true, * + * // whether to disable dev mode in custom build variants (by default only disabled in release) + * // for example: to disable dev mode in the staging build type (if configured) + * devDisabledInStaging: true, + * // The configuration property can be in the following formats + * // 'devDisabledIn${productFlavor}${buildType}' + * // 'devDisabledIn${buildType}' + * * // the root of your project, i.e. where "package.json" lives * root: "../../", * @@ -58,13 +65,17 @@ import com.android.build.OutputFile * inputExcludes: ["android/**", "ios/**"], * * // override which node gets called and with what additional arguments - * nodeExecutableAndArgs: ["node"] + * nodeExecutableAndArgs: ["node"], * * // supply additional arguments to the packager * extraPackagerArgs: [] * ] */ +project.ext.react = [ + entryFile: "index.js" +] + apply from: "../../node_modules/react-native/react.gradle" /** @@ -135,6 +146,6 @@ dependencies { // Run this once to be able to run the application with BUCK // puts all compile dependencies into folder libs for BUCK to use task copyDownloadableDepsToLibs(type: Copy) { - from configurations.compile - into 'libs' + from configurations.compile + into 'libs' } diff --git a/example/PickerTest/android/app/proguard-rules.pro b/example/PickerTest/android/app/proguard-rules.pro index 48361a9..6e8516c 100644 --- a/example/PickerTest/android/app/proguard-rules.pro +++ b/example/PickerTest/android/app/proguard-rules.pro @@ -50,6 +50,10 @@ -dontwarn com.facebook.react.** +# TextLayoutBuilder uses a non-public Android constructor within StaticLayout. +# See libs/proxy/src/main/java/com/facebook/fbui/textlayoutbuilder/proxy for details. +-dontwarn android.text.StaticLayout + # okhttp -keepattributes Signature diff --git a/example/PickerTest/android/app/src/main/AndroidManifest.xml b/example/PickerTest/android/app/src/main/AndroidManifest.xml index 947ea8a..b398c69 100644 --- a/example/PickerTest/android/app/src/main/AndroidManifest.xml +++ b/example/PickerTest/android/app/src/main/AndroidManifest.xml @@ -19,7 +19,8 @@ + android:configChanges="keyboard|keyboardHidden|orientation|screenSize" + android:windowSoftInputMode="adjustResize"> diff --git a/example/PickerTest/android/app/src/main/java/com/pickertest/MainApplication.java b/example/PickerTest/android/app/src/main/java/com/pickertest/MainApplication.java index 9813b89..a85e97d 100644 --- a/example/PickerTest/android/app/src/main/java/com/pickertest/MainApplication.java +++ b/example/PickerTest/android/app/src/main/java/com/pickertest/MainApplication.java @@ -1,14 +1,13 @@ package com.pickertest; import android.app.Application; -import android.util.Log; import com.facebook.react.ReactApplication; import com.beefe.picker.PickerViewPackage; -import com.facebook.react.ReactInstanceManager; import com.facebook.react.ReactNativeHost; import com.facebook.react.ReactPackage; import com.facebook.react.shell.MainReactPackage; +import com.facebook.soloader.SoLoader; import java.util.Arrays; import java.util.List; @@ -17,7 +16,7 @@ public class MainApplication extends Application implements ReactApplication { private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) { @Override - protected boolean getUseDeveloperSupport() { + public boolean getUseDeveloperSupport() { return BuildConfig.DEBUG; } @@ -28,10 +27,21 @@ public class MainApplication extends Application implements ReactApplication { new PickerViewPackage() ); } + + @Override + protected String getJSMainModuleName() { + return "index"; + } }; @Override public ReactNativeHost getReactNativeHost() { - return mReactNativeHost; + return mReactNativeHost; + } + + @Override + public void onCreate() { + super.onCreate(); + SoLoader.init(this, /* native exopackage */ false); } } diff --git a/example/PickerTest/android/app/src/main/res/values/strings.xml b/example/PickerTest/android/app/src/main/res/values/strings.xml index f27af60..73222bb 100644 --- a/example/PickerTest/android/app/src/main/res/values/strings.xml +++ b/example/PickerTest/android/app/src/main/res/values/strings.xml @@ -1,4 +1,3 @@ - PickerTest diff --git a/example/PickerTest/android/build.gradle b/example/PickerTest/android/build.gradle index fcba4c5..eed9972 100644 --- a/example/PickerTest/android/build.gradle +++ b/example/PickerTest/android/build.gradle @@ -5,7 +5,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:1.3.1' + classpath 'com.android.tools.build:gradle:2.2.3' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/example/PickerTest/android/gradle/wrapper/gradle-wrapper.properties b/example/PickerTest/android/gradle/wrapper/gradle-wrapper.properties index b9fbfab..dbdc05d 100644 --- a/example/PickerTest/android/gradle/wrapper/gradle-wrapper.properties +++ b/example/PickerTest/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip diff --git a/example/PickerTest/android/keystores/BUCK b/example/PickerTest/android/keystores/BUCK index 15da20e..88e4c31 100644 --- a/example/PickerTest/android/keystores/BUCK +++ b/example/PickerTest/android/keystores/BUCK @@ -1,8 +1,8 @@ keystore( - name = 'debug', - store = 'debug.keystore', - properties = 'debug.keystore.properties', - visibility = [ - 'PUBLIC', - ], + name = "debug", + properties = "debug.keystore.properties", + store = "debug.keystore", + visibility = [ + "PUBLIC", + ], ) diff --git a/example/PickerTest/android/settings.gradle b/example/PickerTest/android/settings.gradle index f7f9ddd..9535d2a 100644 --- a/example/PickerTest/android/settings.gradle +++ b/example/PickerTest/android/settings.gradle @@ -1,5 +1,5 @@ rootProject.name = 'PickerTest' - -include ':app' include ':react-native-picker' project(':react-native-picker').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-picker/android') + +include ':app' diff --git a/example/PickerTest/app.json b/example/PickerTest/app.json new file mode 100644 index 0000000..6d62e59 --- /dev/null +++ b/example/PickerTest/app.json @@ -0,0 +1,4 @@ +{ + "name": "PickerTest", + "displayName": "PickerTest" +} \ No newline at end of file diff --git a/example/PickerTest/index.android.js b/example/PickerTest/index.android.js deleted file mode 100644 index 48d635e..0000000 --- a/example/PickerTest/index.android.js +++ /dev/null @@ -1,4 +0,0 @@ -/** - * react-native-picker example for android - */ -import './index.js'; \ No newline at end of file diff --git a/example/PickerTest/index.ios.js b/example/PickerTest/index.ios.js deleted file mode 100644 index d6eee65..0000000 --- a/example/PickerTest/index.ios.js +++ /dev/null @@ -1,4 +0,0 @@ -/** - * react-native-picker example for ios - */ -import './index.js'; \ No newline at end of file diff --git a/example/PickerTest/index.js b/example/PickerTest/index.js index 4183c5a..fdc1fe1 100644 --- a/example/PickerTest/index.js +++ b/example/PickerTest/index.js @@ -1,232 +1,4 @@ -/** - * Bootstrap of PickerTest - */ - -import React, {Component} from 'react'; -import { - AppRegistry, - View, - Text, - TextInput, - TouchableOpacity, - Dimensions -} from 'react-native'; - -import Picker from 'react-native-picker'; -import area from './area.json'; - -class PickerTest extends Component { - - constructor(props, context) { - super(props, context); - } - - _createDateData() { - let date = []; - for(let i=1950;i<2050;i++){ - let month = []; - for(let j = 1;j<13;j++){ - let day = []; - if(j === 2){ - for(let k=1;k<29;k++){ - day.push(k+'日'); - } - //Leap day for years that are divisible by 4, such as 2000, 2004 - if(i%4 === 0){ - day.push(29+'日'); - } - } - else if(j in {1:1, 3:1, 5:1, 7:1, 8:1, 10:1, 12:1}){ - for(let k=1;k<32;k++){ - day.push(k+'日'); - } - } - else{ - for(let k=1;k<31;k++){ - day.push(k+'日'); - } - } - let _month = {}; - _month[j+'月'] = day; - month.push(_month); - } - let _date = {}; - _date[i+'年'] = month; - date.push(_date); - } - return date; - } - - _createAreaData() { - let data = []; - let len = area.length; - for(let i=0;i { - console.log('date', pickedValue, pickedIndex); - }, - onPickerCancel: (pickedValue, pickedIndex) => { - console.log('date', pickedValue, pickedIndex); - }, - onPickerSelect: (pickedValue, pickedIndex) => { - console.log('date', pickedValue, pickedIndex); - } - }); - Picker.show(); - } - - _showAreaPicker() { - Picker.init({ - pickerData: this._createAreaData(), - selectedValue: ['河北', '唐山', '古冶区'], - onPickerConfirm: pickedValue => { - console.log('area', pickedValue); - }, - onPickerCancel: pickedValue => { - console.log('area', pickedValue); - }, - onPickerSelect: pickedValue => { - //Picker.select(['山东', '青岛', '黄岛区']) - console.log('area', pickedValue); - } - }); - Picker.show(); - } - - _showTimePicker() { - let years = [], - months = [], - days = [], - hours = [], - minutes = []; - - for(let i=1;i<51;i++){ - years.push(i+1980); - } - for(let i=1;i<13;i++){ - months.push(i); - hours.push(i); - } - for(let i=1;i<32;i++){ - days.push(i); - } - for(let i=1;i<61;i++){ - minutes.push(i); - } - let pickerData = [years, months, days, ['am', 'pm'], hours, minutes]; - let date = new Date(); - let selectedValue = [ - [date.getFullYear()], - [date.getMonth()+1], - [date.getDate()], - [date.getHours() > 11 ? 'pm' : 'am'], - [date.getHours() === 12 ? 12 : date.getHours()%12], - [date.getMinutes()] - ]; - Picker.init({ - pickerData, - selectedValue, - pickerTitleText: 'Select Date and Time', - wheelFlex: [2, 1, 1, 2, 1, 1], - onPickerConfirm: pickedValue => { - console.log('area', pickedValue); - }, - onPickerCancel: pickedValue => { - console.log('area', pickedValue); - }, - onPickerSelect: pickedValue => { - let targetValue = [...pickedValue]; - if(parseInt(targetValue[1]) === 2){ - if(targetValue[0]%4 === 0 && targetValue[2] > 29){ - targetValue[2] = 29; - } - else if(targetValue[0]%4 !== 0 && targetValue[2] > 28){ - targetValue[2] = 28; - } - } - else if(targetValue[1] in {4:1, 6:1, 9:1, 11:1} && targetValue[2] > 30){ - targetValue[2] = 30; - - } - // forbidden some value such as some 2.29, 4.31, 6.31... - if(JSON.stringify(targetValue) !== JSON.stringify(pickedValue)){ - // android will return String all the time,but we put Number into picker at first - // so we need to convert them to Number again - targetValue.map((v, k) => { - if(k !== 3){ - targetValue[k] = parseInt(v); - } - }); - Picker.select(targetValue); - pickedValue = targetValue; - } - } - }); - Picker.show(); - } - - _toggle() { - Picker.toggle(); - } - - _isPickerShow(){ - Picker.isPickerShow(status => { - alert(status); - }); - } - - render() { - return ( - - - DatePicker - - - TimePicker - - - AreaPicker - - - toggle - - - isPickerShow - - - - ); - } -}; +import { AppRegistry } from 'react-native'; +import PickerTest from './PickerTest'; AppRegistry.registerComponent('PickerTest', () => PickerTest); diff --git a/example/PickerTest/ios/PickerTest-tvOS/Info.plist b/example/PickerTest/ios/PickerTest-tvOS/Info.plist new file mode 100644 index 0000000..2fb6a11 --- /dev/null +++ b/example/PickerTest/ios/PickerTest-tvOS/Info.plist @@ -0,0 +1,54 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UIViewControllerBasedStatusBarAppearance + + NSLocationWhenInUseUsageDescription + + NSAppTransportSecurity + + + NSExceptionDomains + + localhost + + NSExceptionAllowsInsecureHTTPLoads + + + + + + diff --git a/example/PickerTest/ios/PickerTest-tvOSTests/Info.plist b/example/PickerTest/ios/PickerTest-tvOSTests/Info.plist new file mode 100644 index 0000000..886825c --- /dev/null +++ b/example/PickerTest/ios/PickerTest-tvOSTests/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/example/PickerTest/ios/PickerTest.xcodeproj/project.pbxproj b/example/PickerTest/ios/PickerTest.xcodeproj/project.pbxproj index 0dbae7b..eec0008 100644 --- a/example/PickerTest/ios/PickerTest.xcodeproj/project.pbxproj +++ b/example/PickerTest/ios/PickerTest.xcodeproj/project.pbxproj @@ -5,7 +5,6 @@ }; objectVersion = 46; objects = { - /* Begin PBXBuildFile section */ 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */; }; 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */; }; @@ -22,8 +21,22 @@ 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; 140ED2AC1D01E1AD002B40FF /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; }; 146834051AC3E58100842450 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; }; - 4166227E001449A3BF2B31BB /* libRCTBEEPickerManager.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C4E031C45A2D4A2FBD2BD3AD /* libRCTBEEPickerManager.a */; }; + 2D02E4BC1E0B4A80006451C7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; }; + 2D02E4BD1E0B4A84006451C7 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; + 2D02E4BF1E0B4AB3006451C7 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; + 2D02E4C21E0B4AEC006451C7 /* libRCTAnimation-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5E9157351DD0AC6500FF2AA8 /* libRCTAnimation-tvOS.a */; }; + 2D02E4C31E0B4AEC006451C7 /* libRCTImage-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3E841DF850E9000B6D8A /* libRCTImage-tvOS.a */; }; + 2D02E4C41E0B4AEC006451C7 /* libRCTLinking-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3E881DF850E9000B6D8A /* libRCTLinking-tvOS.a */; }; + 2D02E4C51E0B4AEC006451C7 /* libRCTNetwork-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3E8C1DF850E9000B6D8A /* libRCTNetwork-tvOS.a */; }; + 2D02E4C61E0B4AEC006451C7 /* libRCTSettings-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3E901DF850E9000B6D8A /* libRCTSettings-tvOS.a */; }; + 2D02E4C71E0B4AEC006451C7 /* libRCTText-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3E941DF850E9000B6D8A /* libRCTText-tvOS.a */; }; + 2D02E4C81E0B4AEC006451C7 /* libRCTWebSocket-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3E991DF850E9000B6D8A /* libRCTWebSocket-tvOS.a */; }; + 2D02E4C91E0B4AEC006451C7 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3EA31DF850E9000B6D8A /* libReact.a */; }; + 2DCD954D1E0B4F2C00145EB5 /* PickerTestTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* PickerTestTests.m */; }; + 5E9157361DD0AC6A00FF2AA8 /* libRCTAnimation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5E9157331DD0AC6500FF2AA8 /* libRCTAnimation.a */; }; 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; }; + ADBDB9381DFEBF1600ED6528 /* libRCTBlob.a in Frameworks */ = {isa = PBXBuildFile; fileRef = ADBDB9271DFEBF0700ED6528 /* libRCTBlob.a */; }; + 3874DA5F21CD465D9E5FA1B6 /* libRCTBEEPickerManager.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A19D256015574FD78B272EDA /* libRCTBEEPickerManager.a */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -90,6 +103,118 @@ remoteGlobalIDString = 83CBBA2E1A601D0E00E9B192; remoteInfo = React; }; + 2D02E4911E0B4A5D006451C7 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 2D02E47A1E0B4A5D006451C7; + remoteInfo = "PickerTest-tvOS"; + }; + 3DAD3E831DF850E9000B6D8A /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 2D2A283A1D9B042B00D4039D; + remoteInfo = "RCTImage-tvOS"; + }; + 3DAD3E871DF850E9000B6D8A /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 2D2A28471D9B043800D4039D; + remoteInfo = "RCTLinking-tvOS"; + }; + 3DAD3E8B1DF850E9000B6D8A /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 2D2A28541D9B044C00D4039D; + remoteInfo = "RCTNetwork-tvOS"; + }; + 3DAD3E8F1DF850E9000B6D8A /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 2D2A28611D9B046600D4039D; + remoteInfo = "RCTSettings-tvOS"; + }; + 3DAD3E931DF850E9000B6D8A /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 2D2A287B1D9B048500D4039D; + remoteInfo = "RCTText-tvOS"; + }; + 3DAD3E981DF850E9000B6D8A /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 2D2A28881D9B049200D4039D; + remoteInfo = "RCTWebSocket-tvOS"; + }; + 3DAD3EA21DF850E9000B6D8A /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 2D2A28131D9B038B00D4039D; + remoteInfo = "React-tvOS"; + }; + 3DAD3EA41DF850E9000B6D8A /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 3D3C059A1DE3340900C268FA; + remoteInfo = yoga; + }; + 3DAD3EA61DF850E9000B6D8A /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 3D3C06751DE3340C00C268FA; + remoteInfo = "yoga-tvOS"; + }; + 3DAD3EA81DF850E9000B6D8A /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 3D3CD9251DE5FBEC00167DC4; + remoteInfo = cxxreact; + }; + 3DAD3EAA1DF850E9000B6D8A /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 3D3CD9321DE5FBEE00167DC4; + remoteInfo = "cxxreact-tvOS"; + }; + 3DAD3EAC1DF850E9000B6D8A /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 3D3CD90B1DE5FBD600167DC4; + remoteInfo = jschelpers; + }; + 3DAD3EAE1DF850E9000B6D8A /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 3D3CD9181DE5FBD800167DC4; + remoteInfo = "jschelpers-tvOS"; + }; + 5E9157321DD0AC6500FF2AA8 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 134814201AA4EA6300B7C361; + remoteInfo = RCTAnimation; + }; + 5E9157341DD0AC6500FF2AA8 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 2D2A28201D9B03D100D4039D; + remoteInfo = "RCTAnimation-tvOS"; + }; 78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */; @@ -104,12 +229,12 @@ remoteGlobalIDString = 58B5119B1A9E6C1200147676; remoteInfo = RCTText; }; - D8FD166B1D90078200508B34 /* PBXContainerItemProxy */ = { + ADBDB9261DFEBF0700ED6528 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 61B8CE8F838D4F69BDD6233C /* RCTBEEPickerManager.xcodeproj */; + containerPortal = ADBDB91F1DFEBF0600ED6528 /* RCTBlob.xcodeproj */; proxyType = 2; - remoteGlobalIDString = 17D41E551D7EE0CA0031415E; - remoteInfo = RCTBEEPickerManager; + remoteGlobalIDString = 358F4ED71D1E81A9004DF814; + remoteInfo = RCTBlob; }; /* End PBXContainerItemProxy section */ @@ -133,10 +258,14 @@ 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = PickerTest/Info.plist; sourceTree = ""; }; 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = PickerTest/main.m; sourceTree = ""; }; 146833FF1AC3E56700842450 /* React.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = React.xcodeproj; path = "../node_modules/react-native/React/React.xcodeproj"; sourceTree = ""; }; - 61B8CE8F838D4F69BDD6233C /* RCTBEEPickerManager.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = RCTBEEPickerManager.xcodeproj; path = "../node_modules/react-native-picker/ios/RCTBEEPickerManager.xcodeproj"; sourceTree = ""; }; + 2D02E47B1E0B4A5D006451C7 /* PickerTest-tvOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "PickerTest-tvOS.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 2D02E4901E0B4A5D006451C7 /* PickerTest-tvOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "PickerTest-tvOSTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTAnimation.xcodeproj; path = "../node_modules/react-native/Libraries/NativeAnimation/RCTAnimation.xcodeproj"; sourceTree = ""; }; 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = "../node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj"; sourceTree = ""; }; 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "../node_modules/react-native/Libraries/Text/RCTText.xcodeproj"; sourceTree = ""; }; - C4E031C45A2D4A2FBD2BD3AD /* libRCTBEEPickerManager.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRCTBEEPickerManager.a; sourceTree = ""; }; + ADBDB91F1DFEBF0600ED6528 /* RCTBlob.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTBlob.xcodeproj; path = "../node_modules/react-native/Libraries/Blob/RCTBlob.xcodeproj"; sourceTree = ""; }; + 62084A3DA0E44393833AEE25 /* RCTBEEPickerManager.xcodeproj */ = {isa = PBXFileReference; name = "RCTBEEPickerManager.xcodeproj"; path = "../node_modules/react-native-picker/ios/RCTBEEPickerManager.xcodeproj"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = wrapper.pb-project; explicitFileType = undefined; includeInIndex = 0; }; + A19D256015574FD78B272EDA /* libRCTBEEPickerManager.a */ = {isa = PBXFileReference; name = "libRCTBEEPickerManager.a"; path = "libRCTBEEPickerManager.a"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = archive.ar; explicitFileType = undefined; includeInIndex = 0; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -152,7 +281,10 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + ADBDB9381DFEBF1600ED6528 /* libRCTBlob.a in Frameworks */, + 5E9157361DD0AC6A00FF2AA8 /* libRCTAnimation.a in Frameworks */, 146834051AC3E58100842450 /* libReact.a in Frameworks */, + 5E9157361DD0AC6A00FF2AA8 /* libRCTAnimation.a in Frameworks */, 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */, 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */, 00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */, @@ -162,7 +294,29 @@ 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */, 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */, 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */, - 4166227E001449A3BF2B31BB /* libRCTBEEPickerManager.a in Frameworks */, + 3874DA5F21CD465D9E5FA1B6 /* libRCTBEEPickerManager.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 2D02E4781E0B4A5D006451C7 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 2D02E4C91E0B4AEC006451C7 /* libReact.a in Frameworks */, + 2D02E4C21E0B4AEC006451C7 /* libRCTAnimation-tvOS.a in Frameworks */, + 2D02E4C31E0B4AEC006451C7 /* libRCTImage-tvOS.a in Frameworks */, + 2D02E4C41E0B4AEC006451C7 /* libRCTLinking-tvOS.a in Frameworks */, + 2D02E4C51E0B4AEC006451C7 /* libRCTNetwork-tvOS.a in Frameworks */, + 2D02E4C61E0B4AEC006451C7 /* libRCTSettings-tvOS.a in Frameworks */, + 2D02E4C71E0B4AEC006451C7 /* libRCTText-tvOS.a in Frameworks */, + 2D02E4C81E0B4AEC006451C7 /* libRCTWebSocket-tvOS.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 2D02E48D1E0B4A5D006451C7 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( ); runOnlyForDeploymentPostprocessing = 0; }; @@ -189,6 +343,7 @@ isa = PBXGroup; children = ( 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */, + 3DAD3E841DF850E9000B6D8A /* libRCTImage-tvOS.a */, ); name = Products; sourceTree = ""; @@ -197,6 +352,7 @@ isa = PBXGroup; children = ( 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */, + 3DAD3E8C1DF850E9000B6D8A /* libRCTNetwork-tvOS.a */, ); name = Products; sourceTree = ""; @@ -230,6 +386,7 @@ isa = PBXGroup; children = ( 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */, + 3DAD3E901DF850E9000B6D8A /* libRCTSettings-tvOS.a */, ); name = Products; sourceTree = ""; @@ -238,6 +395,7 @@ isa = PBXGroup; children = ( 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */, + 3DAD3E991DF850E9000B6D8A /* libRCTWebSocket-tvOS.a */, ); name = Products; sourceTree = ""; @@ -260,6 +418,23 @@ isa = PBXGroup; children = ( 146834041AC3E56700842450 /* libReact.a */, + 3DAD3EA31DF850E9000B6D8A /* libReact.a */, + 3DAD3EA51DF850E9000B6D8A /* libyoga.a */, + 3DAD3EA71DF850E9000B6D8A /* libyoga.a */, + 3DAD3EA91DF850E9000B6D8A /* libcxxreact.a */, + 3DAD3EAB1DF850E9000B6D8A /* libcxxreact.a */, + 3DAD3EAD1DF850E9000B6D8A /* libjschelpers.a */, + 3DAD3EAF1DF850E9000B6D8A /* libjschelpers.a */, + 3DAD3EA31DF850E9000B6D8A /* libReact-tvOS.a */, + ); + name = Products; + sourceTree = ""; + }; + 5E91572E1DD0AC6500FF2AA8 /* Products */ = { + isa = PBXGroup; + children = ( + 5E9157331DD0AC6500FF2AA8 /* libRCTAnimation.a */, + 5E9157351DD0AC6500FF2AA8 /* libRCTAnimation-tvOS.a */, ); name = Products; sourceTree = ""; @@ -268,6 +443,7 @@ isa = PBXGroup; children = ( 78C398B91ACF4ADC00677621 /* libRCTLinking.a */, + 3DAD3E881DF850E9000B6D8A /* libRCTLinking-tvOS.a */, ); name = Products; sourceTree = ""; @@ -275,8 +451,10 @@ 832341AE1AAA6A7D00B99B32 /* Libraries */ = { isa = PBXGroup; children = ( + 5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */, 146833FF1AC3E56700842450 /* React.xcodeproj */, 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */, + ADBDB91F1DFEBF0600ED6528 /* RCTBlob.xcodeproj */, 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */, 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */, 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */, @@ -285,7 +463,7 @@ 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */, 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */, 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */, - 61B8CE8F838D4F69BDD6233C /* RCTBEEPickerManager.xcodeproj */, + 62084A3DA0E44393833AEE25 /* RCTBEEPickerManager.xcodeproj */, ); name = Libraries; sourceTree = ""; @@ -294,6 +472,7 @@ isa = PBXGroup; children = ( 832341B51AAA6A8300B99B32 /* libRCTText.a */, + 3DAD3E941DF850E9000B6D8A /* libRCTText-tvOS.a */, ); name = Products; sourceTree = ""; @@ -309,20 +488,23 @@ indentWidth = 2; sourceTree = ""; tabWidth = 2; + usesTabs = 0; }; 83CBBA001A601CBA00E9B192 /* Products */ = { isa = PBXGroup; children = ( 13B07F961A680F5B00A75B9A /* PickerTest.app */, 00E356EE1AD99517003FC87E /* PickerTestTests.xctest */, + 2D02E47B1E0B4A5D006451C7 /* PickerTest-tvOS.app */, + 2D02E4901E0B4A5D006451C7 /* PickerTest-tvOSTests.xctest */, ); name = Products; sourceTree = ""; }; - D8FD16671D90078200508B34 /* Products */ = { + ADBDB9201DFEBF0600ED6528 /* Products */ = { isa = PBXGroup; children = ( - D8FD166C1D90078200508B34 /* libRCTBEEPickerManager.a */, + ADBDB9271DFEBF0700ED6528 /* libRCTBlob.a */, ); name = Products; sourceTree = ""; @@ -366,6 +548,42 @@ productReference = 13B07F961A680F5B00A75B9A /* PickerTest.app */; productType = "com.apple.product-type.application"; }; + 2D02E47A1E0B4A5D006451C7 /* PickerTest-tvOS */ = { + isa = PBXNativeTarget; + buildConfigurationList = 2D02E4BA1E0B4A5E006451C7 /* Build configuration list for PBXNativeTarget "PickerTest-tvOS" */; + buildPhases = ( + 2D02E4771E0B4A5D006451C7 /* Sources */, + 2D02E4781E0B4A5D006451C7 /* Frameworks */, + 2D02E4791E0B4A5D006451C7 /* Resources */, + 2D02E4CB1E0B4B27006451C7 /* Bundle React Native Code And Images */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "PickerTest-tvOS"; + productName = "PickerTest-tvOS"; + productReference = 2D02E47B1E0B4A5D006451C7 /* PickerTest-tvOS.app */; + productType = "com.apple.product-type.application"; + }; + 2D02E48F1E0B4A5D006451C7 /* PickerTest-tvOSTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 2D02E4BB1E0B4A5E006451C7 /* Build configuration list for PBXNativeTarget "PickerTest-tvOSTests" */; + buildPhases = ( + 2D02E48C1E0B4A5D006451C7 /* Sources */, + 2D02E48D1E0B4A5D006451C7 /* Frameworks */, + 2D02E48E1E0B4A5D006451C7 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 2D02E4921E0B4A5D006451C7 /* PBXTargetDependency */, + ); + name = "PickerTest-tvOSTests"; + productName = "PickerTest-tvOSTests"; + productReference = 2D02E4901E0B4A5D006451C7 /* PickerTest-tvOSTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ @@ -379,6 +597,15 @@ CreatedOnToolsVersion = 6.2; TestTargetID = 13B07F861A680F5B00A75B9A; }; + 2D02E47A1E0B4A5D006451C7 = { + CreatedOnToolsVersion = 8.2.1; + ProvisioningStyle = Automatic; + }; + 2D02E48F1E0B4A5D006451C7 = { + CreatedOnToolsVersion = 8.2.1; + ProvisioningStyle = Automatic; + TestTargetID = 2D02E47A1E0B4A5D006451C7; + }; }; }; buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "PickerTest" */; @@ -398,8 +625,12 @@ ProjectRef = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */; }, { - ProductGroup = D8FD16671D90078200508B34 /* Products */; - ProjectRef = 61B8CE8F838D4F69BDD6233C /* RCTBEEPickerManager.xcodeproj */; + ProductGroup = 5E91572E1DD0AC6500FF2AA8 /* Products */; + ProjectRef = 5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */; + }, + { + ProductGroup = ADBDB9201DFEBF0600ED6528 /* Products */; + ProjectRef = ADBDB91F1DFEBF0600ED6528 /* RCTBlob.xcodeproj */; }, { ProductGroup = 00C302B61ABCB90400DB3ED1 /* Products */; @@ -442,6 +673,8 @@ targets = ( 13B07F861A680F5B00A75B9A /* PickerTest */, 00E356ED1AD99517003FC87E /* PickerTestTests */, + 2D02E47A1E0B4A5D006451C7 /* PickerTest-tvOS */, + 2D02E48F1E0B4A5D006451C7 /* PickerTest-tvOSTests */, ); }; /* End PBXProject section */ @@ -503,6 +736,111 @@ remoteRef = 146834031AC3E56700842450 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; + 3DAD3E841DF850E9000B6D8A /* libRCTImage-tvOS.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libRCTImage-tvOS.a"; + remoteRef = 3DAD3E831DF850E9000B6D8A /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 3DAD3E881DF850E9000B6D8A /* libRCTLinking-tvOS.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libRCTLinking-tvOS.a"; + remoteRef = 3DAD3E871DF850E9000B6D8A /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 3DAD3E8C1DF850E9000B6D8A /* libRCTNetwork-tvOS.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libRCTNetwork-tvOS.a"; + remoteRef = 3DAD3E8B1DF850E9000B6D8A /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 3DAD3E901DF850E9000B6D8A /* libRCTSettings-tvOS.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libRCTSettings-tvOS.a"; + remoteRef = 3DAD3E8F1DF850E9000B6D8A /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 3DAD3E941DF850E9000B6D8A /* libRCTText-tvOS.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libRCTText-tvOS.a"; + remoteRef = 3DAD3E931DF850E9000B6D8A /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 3DAD3E991DF850E9000B6D8A /* libRCTWebSocket-tvOS.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libRCTWebSocket-tvOS.a"; + remoteRef = 3DAD3E981DF850E9000B6D8A /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 3DAD3EA31DF850E9000B6D8A /* libReact-tvOS.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libReact-tvOS.a"; + remoteRef = 3DAD3EA21DF850E9000B6D8A /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 3DAD3EA51DF850E9000B6D8A /* libyoga.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libyoga.a; + remoteRef = 3DAD3EA41DF850E9000B6D8A /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 3DAD3EA71DF850E9000B6D8A /* libyoga.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libyoga.a; + remoteRef = 3DAD3EA61DF850E9000B6D8A /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 3DAD3EA91DF850E9000B6D8A /* libcxxreact.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libcxxreact.a; + remoteRef = 3DAD3EA81DF850E9000B6D8A /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 3DAD3EAB1DF850E9000B6D8A /* libcxxreact.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libcxxreact.a; + remoteRef = 3DAD3EAA1DF850E9000B6D8A /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 3DAD3EAD1DF850E9000B6D8A /* libjschelpers.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libjschelpers.a; + remoteRef = 3DAD3EAC1DF850E9000B6D8A /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 3DAD3EAF1DF850E9000B6D8A /* libjschelpers.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libjschelpers.a; + remoteRef = 3DAD3EAE1DF850E9000B6D8A /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 5E9157331DD0AC6500FF2AA8 /* libRCTAnimation.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libRCTAnimation.a; + remoteRef = 5E9157321DD0AC6500FF2AA8 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 5E9157351DD0AC6500FF2AA8 /* libRCTAnimation-tvOS.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libRCTAnimation-tvOS.a"; + remoteRef = 5E9157341DD0AC6500FF2AA8 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; 78C398B91ACF4ADC00677621 /* libRCTLinking.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; @@ -517,11 +855,11 @@ remoteRef = 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - D8FD166C1D90078200508B34 /* libRCTBEEPickerManager.a */ = { + ADBDB9271DFEBF0700ED6528 /* libRCTBlob.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; - path = libRCTBEEPickerManager.a; - remoteRef = D8FD166B1D90078200508B34 /* PBXContainerItemProxy */; + path = libRCTBlob.a; + remoteRef = ADBDB9261DFEBF0700ED6528 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXReferenceProxy section */ @@ -543,6 +881,21 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 2D02E4791E0B4A5D006451C7 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 2D02E4BD1E0B4A84006451C7 /* Images.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 2D02E48E1E0B4A5D006451C7 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ @@ -558,7 +911,21 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "export NODE_BINARY=node\n../node_modules/react-native/packager/react-native-xcode.sh"; + shellScript = "export NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh"; + }; + 2D02E4CB1E0B4B27006451C7 /* Bundle React Native Code And Images */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Bundle React Native Code And Images"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "export NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh"; }; /* End PBXShellScriptBuildPhase section */ @@ -580,6 +947,23 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 2D02E4771E0B4A5D006451C7 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 2D02E4BF1E0B4AB3006451C7 /* main.m in Sources */, + 2D02E4BC1E0B4A80006451C7 /* AppDelegate.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 2D02E48C1E0B4A5D006451C7 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 2DCD954D1E0B4F2C00145EB5 /* PickerTestTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ @@ -588,6 +972,11 @@ target = 13B07F861A680F5B00A75B9A /* PickerTest */; targetProxy = 00E356F41AD99517003FC87E /* PBXContainerItemProxy */; }; + 2D02E4921E0B4A5D006451C7 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 2D02E47A1E0B4A5D006451C7 /* PickerTest-tvOS */; + targetProxy = 2D02E4911E0B4A5D006451C7 /* PBXContainerItemProxy */; + }; /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ @@ -612,14 +1001,22 @@ "$(inherited)", ); INFOPLIST_FILE = PickerTestTests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 8.2; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + OTHER_LDFLAGS = ( + "-ObjC", + "-lc++", + ); + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/PickerTest.app/PickerTest"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", "\"$(SRCROOT)/$(TARGET_NAME)\"", ); - PRODUCT_NAME = "$(TARGET_NAME)"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/PickerTest.app/PickerTest"; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + "$(SRCROOT)/../node_modules/react-native-picker/ios/RCTBEEPickerManager", + ); }; name = Debug; }; @@ -629,14 +1026,22 @@ BUNDLE_LOADER = "$(TEST_HOST)"; COPY_PHASE_STRIP = NO; INFOPLIST_FILE = PickerTestTests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 8.2; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + OTHER_LDFLAGS = ( + "-ObjC", + "-lc++", + ); + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/PickerTest.app/PickerTest"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", "\"$(SRCROOT)/$(TARGET_NAME)\"", ); - PRODUCT_NAME = "$(TARGET_NAME)"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/PickerTest.app/PickerTest"; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + "$(SRCROOT)/../node_modules/react-native-picker/ios/RCTBEEPickerManager", + ); }; name = Release; }; @@ -644,13 +1049,8 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CURRENT_PROJECT_VERSION = 1; DEAD_CODE_STRIPPING = NO; - HEADER_SEARCH_PATHS = ( - "$(inherited)", - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, - "$(SRCROOT)/../node_modules/react-native/React/**", - "$(SRCROOT)/../node_modules/react-native-picker/ios/RCTBEEPickerManager", - ); INFOPLIST_FILE = PickerTest/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; OTHER_LDFLAGS = ( @@ -659,6 +1059,11 @@ "-lc++", ); PRODUCT_NAME = PickerTest; + VERSIONING_SYSTEM = "apple-generic"; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + "$(SRCROOT)/../node_modules/react-native-picker/ios/RCTBEEPickerManager", + ); }; name = Debug; }; @@ -666,20 +1071,138 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CURRENT_PROJECT_VERSION = 1; + INFOPLIST_FILE = PickerTest/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + OTHER_LDFLAGS = ( + "$(inherited)", + "-ObjC", + "-lc++", + ); + PRODUCT_NAME = PickerTest; + VERSIONING_SYSTEM = "apple-generic"; HEADER_SEARCH_PATHS = ( "$(inherited)", - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, - "$(SRCROOT)/../node_modules/react-native/React/**", "$(SRCROOT)/../node_modules/react-native-picker/ios/RCTBEEPickerManager", ); - INFOPLIST_FILE = PickerTest/Info.plist; + }; + name = Release; + }; + 2D02E4971E0B4A5E006451C7 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image"; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + CLANG_ANALYZER_NONNULL = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_TESTABILITY = YES; + GCC_NO_COMMON_BLOCKS = YES; + INFOPLIST_FILE = "PickerTest-tvOS/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; OTHER_LDFLAGS = ( + "-ObjC", + "-lc++", + ); + PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.REACT.PickerTest-tvOS"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = appletvos; + TARGETED_DEVICE_FAMILY = 3; + TVOS_DEPLOYMENT_TARGET = 9.2; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "\"$(SRCROOT)/$(TARGET_NAME)\"", + ); + HEADER_SEARCH_PATHS = ( "$(inherited)", + "$(SRCROOT)/../node_modules/react-native-picker/ios/RCTBEEPickerManager", + ); + }; + name = Debug; + }; + 2D02E4981E0B4A5E006451C7 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image"; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + CLANG_ANALYZER_NONNULL = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + GCC_NO_COMMON_BLOCKS = YES; + INFOPLIST_FILE = "PickerTest-tvOS/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + OTHER_LDFLAGS = ( "-ObjC", "-lc++", ); - PRODUCT_NAME = PickerTest; + PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.REACT.PickerTest-tvOS"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = appletvos; + TARGETED_DEVICE_FAMILY = 3; + TVOS_DEPLOYMENT_TARGET = 9.2; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "\"$(SRCROOT)/$(TARGET_NAME)\"", + ); + HEADER_SEARCH_PATHS = ( + "$(inherited)", + "$(SRCROOT)/../node_modules/react-native-picker/ios/RCTBEEPickerManager", + ); + }; + name = Release; + }; + 2D02E4991E0B4A5E006451C7 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CLANG_ANALYZER_NONNULL = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_TESTABILITY = YES; + GCC_NO_COMMON_BLOCKS = YES; + INFOPLIST_FILE = "PickerTest-tvOSTests/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.REACT.PickerTest-tvOSTests"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = appletvos; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/PickerTest-tvOS.app/PickerTest-tvOS"; + TVOS_DEPLOYMENT_TARGET = 10.1; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "\"$(SRCROOT)/$(TARGET_NAME)\"", + ); + }; + name = Debug; + }; + 2D02E49A1E0B4A5E006451C7 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CLANG_ANALYZER_NONNULL = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + GCC_NO_COMMON_BLOCKS = YES; + INFOPLIST_FILE = "PickerTest-tvOSTests/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.REACT.PickerTest-tvOSTests"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = appletvos; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/PickerTest-tvOS.app/PickerTest-tvOS"; + TVOS_DEPLOYMENT_TARGET = 10.1; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "\"$(SRCROOT)/$(TARGET_NAME)\"", + ); }; name = Release; }; @@ -717,13 +1240,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = ( - "$(inherited)", - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, - "$(SRCROOT)/../node_modules/react-native/React/**", - "$(SRCROOT)/../node_modules/react-native-picker/ios/RCTBEEPickerManager", - ); - IPHONEOS_DEPLOYMENT_TARGET = 7.0; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -758,13 +1275,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = ( - "$(inherited)", - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, - "$(SRCROOT)/../node_modules/react-native/React/**", - "$(SRCROOT)/../node_modules/react-native-picker/ios/RCTBEEPickerManager", - ); - IPHONEOS_DEPLOYMENT_TARGET = 7.0; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; VALIDATE_PRODUCT = YES; @@ -792,6 +1303,24 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + 2D02E4BA1E0B4A5E006451C7 /* Build configuration list for PBXNativeTarget "PickerTest-tvOS" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 2D02E4971E0B4A5E006451C7 /* Debug */, + 2D02E4981E0B4A5E006451C7 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 2D02E4BB1E0B4A5E006451C7 /* Build configuration list for PBXNativeTarget "PickerTest-tvOSTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 2D02E4991E0B4A5E006451C7 /* Debug */, + 2D02E49A1E0B4A5E006451C7 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "PickerTest" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/example/PickerTest/ios/PickerTest.xcodeproj/xcshareddata/xcschemes/PickerTest-tvOS.xcscheme b/example/PickerTest/ios/PickerTest.xcodeproj/xcshareddata/xcschemes/PickerTest-tvOS.xcscheme new file mode 100644 index 0000000..9457a79 --- /dev/null +++ b/example/PickerTest/ios/PickerTest.xcodeproj/xcshareddata/xcschemes/PickerTest-tvOS.xcscheme @@ -0,0 +1,129 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/example/PickerTest/ios/PickerTest.xcodeproj/xcshareddata/xcschemes/PickerTest.xcscheme b/example/PickerTest/ios/PickerTest.xcodeproj/xcshareddata/xcschemes/PickerTest.xcscheme index 9ff53db..fddb3be 100644 --- a/example/PickerTest/ios/PickerTest.xcodeproj/xcshareddata/xcschemes/PickerTest.xcscheme +++ b/example/PickerTest/ios/PickerTest.xcodeproj/xcshareddata/xcschemes/PickerTest.xcscheme @@ -3,9 +3,23 @@ LastUpgradeVersion = "0620" version = "1.3"> + + + + + shouldUseLaunchSchemeArgsEnv = "YES"> @@ -62,15 +76,18 @@ ReferencedContainer = "container:PickerTest.xcodeproj"> + + @@ -86,10 +103,10 @@ diff --git a/example/PickerTest/ios/PickerTest/AppDelegate.m b/example/PickerTest/ios/PickerTest/AppDelegate.m index e5eb3e8..db1f59a 100644 --- a/example/PickerTest/ios/PickerTest/AppDelegate.m +++ b/example/PickerTest/ios/PickerTest/AppDelegate.m @@ -9,8 +9,8 @@ #import "AppDelegate.h" -#import "RCTBundleURLProvider.h" -#import "RCTRootView.h" +#import +#import @implementation AppDelegate @@ -18,7 +18,7 @@ { NSURL *jsCodeLocation; - jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil]; + jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil]; RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation moduleName:@"PickerTest" diff --git a/example/PickerTest/ios/PickerTest/Images.xcassets/Contents.json b/example/PickerTest/ios/PickerTest/Images.xcassets/Contents.json new file mode 100644 index 0000000..2d92bd5 --- /dev/null +++ b/example/PickerTest/ios/PickerTest/Images.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/example/PickerTest/ios/PickerTest/Info.plist b/example/PickerTest/ios/PickerTest/Info.plist index e98ebb0..d955e4a 100644 --- a/example/PickerTest/ios/PickerTest/Info.plist +++ b/example/PickerTest/ios/PickerTest/Info.plist @@ -4,6 +4,8 @@ CFBundleDevelopmentRegion en + CFBundleDisplayName + PickerTest CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier @@ -45,7 +47,7 @@ localhost - NSTemporaryExceptionAllowsInsecureHTTPLoads + NSExceptionAllowsInsecureHTTPLoads diff --git a/example/PickerTest/ios/PickerTestTests/PickerTestTests.m b/example/PickerTest/ios/PickerTestTests/PickerTestTests.m index f2b1b8c..a7558f0 100644 --- a/example/PickerTest/ios/PickerTestTests/PickerTestTests.m +++ b/example/PickerTest/ios/PickerTestTests/PickerTestTests.m @@ -10,8 +10,8 @@ #import #import -#import "RCTLog.h" -#import "RCTRootView.h" +#import +#import #define TIMEOUT_SECONDS 600 #define TEXT_TO_LOOK_FOR @"Welcome to React Native!" @@ -37,7 +37,7 @@ - (void)testRendersWelcomeScreen { - UIViewController *vc = [[[[UIApplication sharedApplication] delegate] window] rootViewController]; + UIViewController *vc = [[[RCTSharedApplication() delegate] window] rootViewController]; NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS]; BOOL foundElement = NO; diff --git a/example/PickerTest/package.json b/example/PickerTest/package.json index 7975d5e..18e31a1 100644 --- a/example/PickerTest/package.json +++ b/example/PickerTest/package.json @@ -3,11 +3,21 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node_modules/react-native/packager/packager.sh" + "start": "node node_modules/react-native/local-cli/cli.js start", + "test": "jest" }, "dependencies": { - "react": "15.3.1", - "react-native": "^0.32.0", + "react": "16.0.0", + "react-native": "^0.51.0", "react-native-picker": "github:beefe/react-native-picker" + }, + "devDependencies": { + "babel-jest": "21.2.0", + "babel-preset-react-native": "4.0.0", + "jest": "21.2.1", + "react-test-renderer": "16.0.0" + }, + "jest": { + "preset": "react-native" } } diff --git a/index.js b/index.js index a4706b7..e1902b8 100644 --- a/index.js +++ b/index.js @@ -4,36 +4,38 @@ import { NativeAppEventEmitter } from 'react-native'; -let ios = Platform.OS === 'ios'; -let android = Platform.OS === 'android'; -let Picker = NativeModules.BEEPickerManager; +const ios = Platform.OS === 'ios'; +const android = Platform.OS === 'android'; +const Picker = NativeModules.BEEPickerManager; +const options = { + isLoop: false, + pickerConfirmBtnText: 'confirm', + pickerCancelBtnText: 'cancel', + pickerTitleText: 'pls select', + pickerConfirmBtnColor: [1, 186, 245, 1], + pickerCancelBtnColor: [1, 186, 245, 1], + pickerTitleColor: [20, 20, 20, 1], + pickerToolBarBg: [232, 232, 232, 1], + pickerBg: [196, 199, 206, 1], + wheelFlex: [1, 1, 1], + pickerData: [], + selectedValue: [], + onPickerConfirm(){}, + onPickerCancel(){}, + onPickerSelect(){}, + pickerToolBarFontSize: 16, + pickerFontSize: 16, + pickerFontColor: [31, 31 ,31, 1] +}; export default { - init(options){ - let opt = { - isLoop: false, - pickerConfirmBtnText: 'confirm', - pickerCancelBtnText: 'cancel', - pickerTitleText: 'pls select', - pickerConfirmBtnColor: [1, 186, 245, 1], - pickerCancelBtnColor: [1, 186, 245, 1], - pickerTitleColor: [20, 20, 20, 1], - pickerToolBarBg: [232, 232, 232, 1], - pickerBg: [196, 199, 206, 1], - wheelFlex: [1, 1, 1], - pickerData: [], - selectedValue: [], - onPickerConfirm(){}, - onPickerCancel(){}, - onPickerSelect(){}, - //4.0.12 add - pickerToolBarFontSize: 16, - pickerFontSize: 16, - pickerFontColor: [31, 31 ,31, 1], - ...options + init(params){ + const opt = { + ...options, + ...params }; - let fnConf = { + const fnConf = { confirm: opt.onPickerConfirm, cancel: opt.onPickerCancel, select: opt.onPickerSelect diff --git a/package.json b/package.json index 6350194..4a25e0e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-picker", - "version": "4.3.0", + "version": "4.3.1", "description": "A Native Picker with high performance.", "main": "index.js", "types": "index.d.ts", -- 2.26.2