├── app ├── .watchmanconfig ├── app │ ├── res │ │ ├── guide01.jpg │ │ ├── guide02.jpg │ │ ├── guide03.jpg │ │ ├── guide04.jpg │ │ ├── loading.jpg │ │ ├── home_sel.png │ │ ├── icon_bzzx.png │ │ ├── icon_dqbb.png │ │ ├── icon_gywm.png │ │ ├── icon_gzwm.png │ │ ├── icon_xxzx.png │ │ ├── icon_zfhy.png │ │ ├── recharge.png │ │ ├── withdraw.png │ │ ├── icon_arrow.png │ │ ├── tou_yirenzheng.png │ │ ├── opinion_feedback.png │ │ ├── tabbar_red_more.png │ │ ├── tabbar_white_home.png │ │ ├── tabbar_white_more.png │ │ ├── tou_weirenzheng.png │ │ ├── tabbar_red_account.png │ │ ├── tabbar_red_product.png │ │ ├── horizontal_gray_line.png │ │ ├── tabbar_white_account.png │ │ └── tabbar_white_product.png │ ├── root.js │ ├── store │ │ ├── configure-store.js │ │ └── AsyncStorage.js │ ├── pages │ │ ├── Home.js │ │ ├── GuidePage.js │ │ ├── Splash.js │ │ ├── Account.js │ │ ├── More.js │ │ └── Product.js │ ├── app.js │ └── containers │ │ └── MainContainer.js ├── .vscode │ ├── settings.json │ ├── launchReactNative.js │ ├── typings │ │ └── react │ │ │ ├── react-addons-create-fragment.d.ts │ │ │ ├── react-addons-pure-render-mixin.d.ts │ │ │ ├── react-addons-transition-group.d.ts │ │ │ ├── react-global.d.ts │ │ │ ├── react-addons-linked-state-mixin.d.ts │ │ │ ├── react-addons-update.d.ts │ │ │ ├── react-addons-css-transition-group.d.ts │ │ │ ├── react-addons-perf.d.ts │ │ │ ├── react-dom.d.ts │ │ │ └── react-addons-test-utils.d.ts │ └── launch.json ├── android │ ├── 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 │ │ │ │ │ └── app │ │ │ │ │ ├── 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 │ ├── settings.gradle │ ├── build.gradle │ ├── gradle.properties │ ├── gradlew.bat │ └── gradlew ├── .buckconfig ├── tsconfig.json ├── test.html ├── .babelrc ├── index.ios.js ├── index.android.js ├── ios │ ├── app │ │ ├── AppDelegate.h │ │ ├── main.m │ │ ├── Images.xcassets │ │ │ └── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ ├── AppDelegate.m │ │ ├── Info.plist │ │ └── Base.lproj │ │ │ └── LaunchScreen.xib │ ├── appTests │ │ ├── Info.plist │ │ └── appTests.m │ └── app.xcodeproj │ │ ├── xcshareddata │ │ └── xcschemes │ │ │ └── app.xcscheme │ │ └── project.pbxproj ├── .gitignore ├── package.json ├── .flowconfig ├── Button.js ├── HomeUI.js ├── LikeCount.js └── .deco │ └── metadata │ └── app │ └── pages │ └── Product.js.deco ├── 打包调试.md ├── .vscode └── launch.json ├── README.md ├── Redux 学习笔记.md ├── Text 组件练习.js ├── 携程界面.js ├── Navigator.js ├── image 组件.js └── Android原生项目移植 ReactNative.md /app/.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /app/app/res/guide01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenCoder/ReactNativeNote/HEAD/app/app/res/guide01.jpg -------------------------------------------------------------------------------- /app/app/res/guide02.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenCoder/ReactNativeNote/HEAD/app/app/res/guide02.jpg -------------------------------------------------------------------------------- /app/app/res/guide03.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenCoder/ReactNativeNote/HEAD/app/app/res/guide03.jpg -------------------------------------------------------------------------------- /app/app/res/guide04.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenCoder/ReactNativeNote/HEAD/app/app/res/guide04.jpg -------------------------------------------------------------------------------- /app/app/res/loading.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenCoder/ReactNativeNote/HEAD/app/app/res/loading.jpg -------------------------------------------------------------------------------- /app/app/res/home_sel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenCoder/ReactNativeNote/HEAD/app/app/res/home_sel.png -------------------------------------------------------------------------------- /app/app/res/icon_bzzx.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenCoder/ReactNativeNote/HEAD/app/app/res/icon_bzzx.png -------------------------------------------------------------------------------- /app/app/res/icon_dqbb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenCoder/ReactNativeNote/HEAD/app/app/res/icon_dqbb.png -------------------------------------------------------------------------------- /app/app/res/icon_gywm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenCoder/ReactNativeNote/HEAD/app/app/res/icon_gywm.png -------------------------------------------------------------------------------- /app/app/res/icon_gzwm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenCoder/ReactNativeNote/HEAD/app/app/res/icon_gzwm.png -------------------------------------------------------------------------------- /app/app/res/icon_xxzx.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenCoder/ReactNativeNote/HEAD/app/app/res/icon_xxzx.png -------------------------------------------------------------------------------- /app/app/res/icon_zfhy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenCoder/ReactNativeNote/HEAD/app/app/res/icon_zfhy.png -------------------------------------------------------------------------------- /app/app/res/recharge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenCoder/ReactNativeNote/HEAD/app/app/res/recharge.png -------------------------------------------------------------------------------- /app/app/res/withdraw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenCoder/ReactNativeNote/HEAD/app/app/res/withdraw.png -------------------------------------------------------------------------------- /app/app/res/icon_arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenCoder/ReactNativeNote/HEAD/app/app/res/icon_arrow.png -------------------------------------------------------------------------------- /app/app/res/tou_yirenzheng.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenCoder/ReactNativeNote/HEAD/app/app/res/tou_yirenzheng.png -------------------------------------------------------------------------------- /app/app/res/opinion_feedback.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenCoder/ReactNativeNote/HEAD/app/app/res/opinion_feedback.png -------------------------------------------------------------------------------- /app/app/res/tabbar_red_more.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenCoder/ReactNativeNote/HEAD/app/app/res/tabbar_red_more.png -------------------------------------------------------------------------------- /app/app/res/tabbar_white_home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenCoder/ReactNativeNote/HEAD/app/app/res/tabbar_white_home.png -------------------------------------------------------------------------------- /app/app/res/tabbar_white_more.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenCoder/ReactNativeNote/HEAD/app/app/res/tabbar_white_more.png -------------------------------------------------------------------------------- /app/app/res/tou_weirenzheng.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenCoder/ReactNativeNote/HEAD/app/app/res/tou_weirenzheng.png -------------------------------------------------------------------------------- /app/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | // 将设置放入此文件中以覆盖默认值和用户设置。 2 | { 3 | "editor.fontSize": 16, 4 | "files.autoSave": "afterDelay" 5 | } -------------------------------------------------------------------------------- /app/android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | app 4 | 5 | -------------------------------------------------------------------------------- /app/app/res/tabbar_red_account.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenCoder/ReactNativeNote/HEAD/app/app/res/tabbar_red_account.png -------------------------------------------------------------------------------- /app/app/res/tabbar_red_product.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenCoder/ReactNativeNote/HEAD/app/app/res/tabbar_red_product.png -------------------------------------------------------------------------------- /app/app/res/horizontal_gray_line.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenCoder/ReactNativeNote/HEAD/app/app/res/horizontal_gray_line.png -------------------------------------------------------------------------------- /app/app/res/tabbar_white_account.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenCoder/ReactNativeNote/HEAD/app/app/res/tabbar_white_account.png -------------------------------------------------------------------------------- /app/app/res/tabbar_white_product.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenCoder/ReactNativeNote/HEAD/app/app/res/tabbar_white_product.png -------------------------------------------------------------------------------- /app/.buckconfig: -------------------------------------------------------------------------------- 1 | 2 | [android] 3 | target = Google Inc.:Google APIs:23 4 | 5 | [maven_repositories] 6 | central = https://repo1.maven.org/maven2 7 | -------------------------------------------------------------------------------- /app/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenCoder/ReactNativeNote/HEAD/app/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /app/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 | -------------------------------------------------------------------------------- /app/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenCoder/ReactNativeNote/HEAD/app/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenCoder/ReactNativeNote/HEAD/app/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenCoder/ReactNativeNote/HEAD/app/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenCoder/ReactNativeNote/HEAD/app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/android/keystores/BUCK: -------------------------------------------------------------------------------- 1 | keystore( 2 | name = 'debug', 3 | store = 'debug.keystore', 4 | properties = 'debug.keystore.properties', 5 | visibility = [ 6 | 'PUBLIC', 7 | ], 8 | ) 9 | -------------------------------------------------------------------------------- /app/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "allowJs": true, 4 | "target": "ES6", 5 | "allowSyntheticDefaultImports": true 6 | }, 7 | "exclude": [ 8 | "node_modules" 9 | ] 10 | } -------------------------------------------------------------------------------- /app/test.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Title 6 | 7 | 8 | 打开 DemoApp 9 | 10 | -------------------------------------------------------------------------------- /app/android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'app' 2 | 3 | include ':app' 4 | include ':react-native-device-info' 5 | project(':react-native-device-info').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-device-info/android') 6 | -------------------------------------------------------------------------------- /app/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /app/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Wed Sep 14 15:17:17 CST 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip 7 | -------------------------------------------------------------------------------- /打包调试.md: -------------------------------------------------------------------------------- 1 | 2 | 1. 生成签名密钥 3 | >keytool -genkey -v -keystore my-release-key.keystore -alias my-key-alias -keyalg RAS -keysize 2048 -validity 10000 4 | 2. 将 jsBundle 打包进入 assets目录中 5 | > `curl -k "http://localhost:8081/index.android.bundle"> android/app/src/main/assets/index.android.bundle` 6 | 7 | 3. 进入 root目录下cd android/ 8 | >gradle assembleRelease -------------------------------------------------------------------------------- /app/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | "react-native" // this is required for debugging with react-native/packager/transformer 4 | ], 5 | "plugins": [], 6 | "sourceMaps": true // must be true react-native/packager/transformer using with node-module-debug 7 | // because of some bugs from vscode-node-debug & vscode-react-native, "sourceMaps" cannot be "inline" or "both" 8 | } -------------------------------------------------------------------------------- /app/app/root.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | import React from 'react'; 3 | //import {Provider} from 'react-redux'; 4 | import App from './app'; 5 | //import configureStore from './store/configure-store'; 6 | //const store =configureStore(); 7 | export default class Root extends React.Component{ 8 | render(){ 9 | return ( 10 | 11 | ) 12 | } 13 | } -------------------------------------------------------------------------------- /app/index.ios.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,WebView, 14 | 15 | } from 'react-native'; 16 | import GuidePage from './app/pages/GuidePage.js'; 17 | import Root from './app/root.js' 18 | 19 | AppRegistry.registerComponent('app', () => Root); 20 | 21 | -------------------------------------------------------------------------------- /app/index.android.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,WebView, 14 | 15 | } from 'react-native'; 16 | import GuidePage from './app/pages/GuidePage.js' 17 | 18 | import Root from './app/root.js' 19 | 20 | 21 | AppRegistry.registerComponent('app', () => Root); 22 | 23 | -------------------------------------------------------------------------------- /app/android/app/src/main/java/com/app/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.app; 2 | 3 | import com.facebook.react.ReactActivity; 4 | import com.learnium.RNDeviceInfo.RNDeviceInfo; 5 | 6 | public class MainActivity extends ReactActivity { 7 | 8 | /** 9 | * Returns the name of the main component registered from JavaScript. 10 | * This is used to schedule rendering of the component. 11 | */ 12 | @Override 13 | protected String getMainComponentName() { 14 | return "app"; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /app/.vscode/launchReactNative.js: -------------------------------------------------------------------------------- 1 | // This file is automatically generated by vscode-react-native@0.1.5 2 | // Please do not modify it manually. All changes will be lost. 3 | try { 4 | var path = require("path"); 5 | var Launcher = require("/Users/allen/.vscode/extensions/vsmobile.vscode-react-native-0.1.5/out/debugger/launcher.js").Launcher; 6 | new Launcher(path.resolve(__dirname, "..")).launch(); 7 | } catch (e) { 8 | throw new Error("Unable to launch application. Try deleting .vscode/launchReactNative.js and restarting vscode."); 9 | } -------------------------------------------------------------------------------- /app/ios/app/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 | -------------------------------------------------------------------------------- /app/ios/app/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 | -------------------------------------------------------------------------------- /app/.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/IJ 26 | # 27 | *.iml 28 | .idea 29 | .gradle 30 | local.properties 31 | 32 | # node.js 33 | # 34 | node_modules/ 35 | npm-debug.log 36 | 37 | # BUCK 38 | buck-out/ 39 | \.buckd/ 40 | android/app/libs 41 | android/keystores/debug.keystore 42 | -------------------------------------------------------------------------------- /app/app/store/configure-store.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by allen on 16/7/24. 3 | */ 4 | 'use strict'; 5 | import {createStore ,applyMiddleware} from 'redux'; 6 | 7 | import thunk from 'redux-thunk'; 8 | 9 | const middlewares =[thunk]; 10 | 11 | if (process.env.NODE_ENV==='development'){ 12 | const createLogger =require('redux-logger'); 13 | const logger = createLogger(); 14 | middlewares.push(logger); 15 | } 16 | const createStoreWithMiddleware =applyMiddleware(...middlewares)(createStore); 17 | export default function configureStore(initialState){ 18 | const store = createStoreWithMiddleware(rootReducer,initialState); 19 | return store; 20 | } -------------------------------------------------------------------------------- /app/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "app", 3 | "version": "0.0.1", 4 | "private": true, 5 | "scripts": { 6 | "start": "node node_modules/react-native/local-cli/cli.js start" 7 | }, 8 | "dependencies": { 9 | "react": "15.2.1", 10 | "react-native": "0.29.0", 11 | "react-native-device-info": "^0.9.3", 12 | "react-native-storage": "^0.1.2", 13 | "react-native-swiper": "^1.4.6", 14 | "react-native-tab-navigator": "^0.3.3", 15 | "react-redux": "^4.4.5", 16 | "redux": "^3.5.2", 17 | "redux-logger": "^2.6.1", 18 | "redux-thunk": "^2.1.0" 19 | }, 20 | "devDependencies": { 21 | "redux-devtools": "^3.3.1" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /app/.vscode/typings/react/react-addons-create-fragment.d.ts: -------------------------------------------------------------------------------- 1 | // Type definitions for React v0.14 (react-addons-create-fragment) 2 | // Project: http://facebook.github.io/react/ 3 | // Definitions by: Asana , AssureSign , Microsoft 4 | // Definitions: https://github.com/borisyankov/DefinitelyTyped 5 | 6 | /// 7 | 8 | declare namespace __React { 9 | namespace __Addons { 10 | export function createFragment(object: { [key: string]: ReactNode }): ReactFragment; 11 | } 12 | } 13 | 14 | declare module "react-addons-create-fragment" { 15 | export = __React.__Addons.createFragment; 16 | } 17 | -------------------------------------------------------------------------------- /app/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.1.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 | -------------------------------------------------------------------------------- /app/ios/app/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 | } -------------------------------------------------------------------------------- /app/.vscode/typings/react/react-addons-pure-render-mixin.d.ts: -------------------------------------------------------------------------------- 1 | // Type definitions for React v0.14 (react-addons-pure-render-mixin) 2 | // Project: http://facebook.github.io/react/ 3 | // Definitions by: Asana , AssureSign , Microsoft 4 | // Definitions: https://github.com/borisyankov/DefinitelyTyped 5 | 6 | /// 7 | 8 | declare namespace __React { 9 | interface PureRenderMixin extends Mixin {} 10 | 11 | namespace __Addons { 12 | export var PureRenderMixin: PureRenderMixin; 13 | } 14 | } 15 | 16 | declare module "react-addons-pure-render-mixin" { 17 | var PureRenderMixin: __React.PureRenderMixin; 18 | type PureRenderMixin = __React.PureRenderMixin; 19 | export = PureRenderMixin; 20 | } 21 | -------------------------------------------------------------------------------- /app/ios/appTests/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 | -------------------------------------------------------------------------------- /app/app/pages/Home.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by allen on 16/9/13. 3 | */ 4 | /** 5 | * Created by allen on 16/7/23. 6 | */ 7 | 'use strict' 8 | import React from 'react'; 9 | import { 10 | View, 11 | Text, 12 | WebView, 13 | StyleSheet 14 | } from 'react-native'; 15 | var DEFAULT_URL = "https://trade.juyoulicai.com/webapp/go!index.action"; 16 | export default class MainContainer extends React.Component { 17 | render() { 18 | return ( 19 | 25 | 26 | 27 | ) 28 | } 29 | } 30 | 31 | var styles = StyleSheet.create({ 32 | webview_style: { 33 | backgroundColor: '#00ff00' 34 | } 35 | }) -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "name": "Debug Android", 6 | "program": "${workspaceRoot}/.vscode/launchReactNative.js", 7 | "type": "reactnative", 8 | "request": "launch", 9 | "platform": "android", 10 | "internalDebuggerPort": 9090, 11 | "sourceMaps": true, 12 | "outDir": "${workspaceRoot}/.vscode/.react" 13 | }, 14 | { 15 | "name": "Debug iOS", 16 | "program": "${workspaceRoot}/.vscode/launchReactNative.js", 17 | "type": "reactnative", 18 | "request": "launch", 19 | "platform": "ios", 20 | "target": "iPhone 6", 21 | "internalDebuggerPort": 9090, 22 | "sourceMaps": true, 23 | "outDir": "${workspaceRoot}/.vscode/.react" 24 | } 25 | ] 26 | } -------------------------------------------------------------------------------- /app/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "name": "Debug Android", 6 | "program": "${workspaceRoot}/.vscode/launchReactNative.js", 7 | "type": "reactnative", 8 | "request": "launch", 9 | "platform": "android", 10 | "internalDebuggerPort": 9090, 11 | "sourceMaps": true, 12 | "outDir": "${workspaceRoot}/.vscode/.react" 13 | }, 14 | { 15 | "name": "Debug iOS", 16 | "program": "${workspaceRoot}/.vscode/launchReactNative.js", 17 | "type": "reactnative", 18 | "request": "launch", 19 | "platform": "ios", 20 | "target": "iPhone 5s", 21 | "internalDebuggerPort": 9090, 22 | "sourceMaps": true, 23 | "outDir": "${workspaceRoot}/.vscode/.react" 24 | } 25 | ] 26 | } -------------------------------------------------------------------------------- /app/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 | -------------------------------------------------------------------------------- /app/.vscode/typings/react/react-addons-transition-group.d.ts: -------------------------------------------------------------------------------- 1 | // Type definitions for React v0.14 (react-addons-transition-group) 2 | // Project: http://facebook.github.io/react/ 3 | // Definitions by: Asana , AssureSign , Microsoft 4 | // Definitions: https://github.com/borisyankov/DefinitelyTyped 5 | 6 | /// 7 | 8 | declare namespace __React { 9 | 10 | interface TransitionGroupProps { 11 | component?: ReactType; 12 | childFactory?: (child: ReactElement) => ReactElement; 13 | } 14 | 15 | type TransitionGroup = ComponentClass; 16 | 17 | namespace __Addons { 18 | export var TransitionGroup: __React.TransitionGroup; 19 | } 20 | } 21 | 22 | declare module "react-addons-transition-group" { 23 | var TransitionGroup: __React.TransitionGroup; 24 | type TransitionGroup = __React.TransitionGroup; 25 | export = TransitionGroup; 26 | } 27 | -------------------------------------------------------------------------------- /app/.vscode/typings/react/react-global.d.ts: -------------------------------------------------------------------------------- 1 | // Type definitions for React v0.14 (namespace) 2 | // Project: http://facebook.github.io/react/ 3 | // Definitions by: Asana , AssureSign , Microsoft 4 | // Definitions: https://github.com/borisyankov/DefinitelyTyped 5 | 6 | /// 7 | /// 8 | /// 9 | /// 10 | /// 11 | /// 12 | /// 13 | /// 14 | /// 15 | /// 16 | 17 | import React = __React; 18 | import ReactDOM = __React.__DOM; 19 | 20 | declare namespace __React { 21 | export import addons = __React.__Addons; 22 | } 23 | -------------------------------------------------------------------------------- /app/android/app/src/main/java/com/app/MainApplication.java: -------------------------------------------------------------------------------- 1 | package com.app; 2 | 3 | import android.app.Application; 4 | import android.util.Log; 5 | 6 | import com.facebook.react.ReactApplication; 7 | import com.facebook.react.ReactInstanceManager; 8 | import com.facebook.react.ReactNativeHost; 9 | import com.facebook.react.ReactPackage; 10 | import com.facebook.react.shell.MainReactPackage; 11 | 12 | import java.util.Arrays; 13 | import java.util.List; 14 | import com.learnium.RNDeviceInfo.RNDeviceInfo; 15 | public class MainApplication extends Application implements ReactApplication { 16 | 17 | private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) { 18 | @Override 19 | protected boolean getUseDeveloperSupport() { 20 | return BuildConfig.DEBUG; 21 | } 22 | 23 | @Override 24 | protected List getPackages() { 25 | return Arrays.asList( 26 | new RNDeviceInfo(), new MainReactPackage() 27 | ); 28 | } 29 | }; 30 | 31 | @Override 32 | public ReactNativeHost getReactNativeHost() { 33 | return mReactNativeHost; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /app/.vscode/typings/react/react-addons-linked-state-mixin.d.ts: -------------------------------------------------------------------------------- 1 | // Type definitions for React v0.14 (react-addons-linked-state-mixin) 2 | // Project: http://facebook.github.io/react/ 3 | // Definitions by: Asana , AssureSign , Microsoft 4 | // Definitions: https://github.com/borisyankov/DefinitelyTyped 5 | 6 | /// 7 | 8 | declare namespace __React { 9 | interface ReactLink { 10 | value: T; 11 | requestChange(newValue: T): void; 12 | } 13 | 14 | interface LinkedStateMixin extends Mixin { 15 | linkState(key: string): ReactLink; 16 | } 17 | 18 | interface HTMLAttributes { 19 | checkedLink?: ReactLink; 20 | valueLink?: ReactLink; 21 | } 22 | 23 | namespace __Addons { 24 | export var LinkedStateMixin: LinkedStateMixin; 25 | } 26 | } 27 | 28 | declare module "react-addons-linked-state-mixin" { 29 | var LinkedStateMixin: __React.LinkedStateMixin; 30 | type LinkedStateMixin = __React.LinkedStateMixin; 31 | export = LinkedStateMixin; 32 | } 33 | -------------------------------------------------------------------------------- /app/.vscode/typings/react/react-addons-update.d.ts: -------------------------------------------------------------------------------- 1 | // Type definitions for React v0.14 (react-addons-update) 2 | // Project: http://facebook.github.io/react/ 3 | // Definitions by: Asana , AssureSign , Microsoft 4 | // Definitions: https://github.com/borisyankov/DefinitelyTyped 5 | 6 | /// 7 | 8 | declare namespace __React { 9 | interface UpdateSpecCommand { 10 | $set?: any; 11 | $merge?: {}; 12 | $apply?(value: any): any; 13 | } 14 | 15 | interface UpdateSpecPath { 16 | [key: string]: UpdateSpec; 17 | } 18 | 19 | type UpdateSpec = UpdateSpecCommand | UpdateSpecPath; 20 | 21 | interface UpdateArraySpec extends UpdateSpecCommand { 22 | $push?: any[]; 23 | $unshift?: any[]; 24 | $splice?: any[][]; 25 | } 26 | 27 | namespace __Addons { 28 | export function update(value: any[], spec: UpdateArraySpec): any[]; 29 | export function update(value: {}, spec: UpdateSpec): any; 30 | } 31 | } 32 | 33 | declare module "react-addons-update" { 34 | export = __React.__Addons.update; 35 | } 36 | -------------------------------------------------------------------------------- /app/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 12 | 13 | 19 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /app/.flowconfig: -------------------------------------------------------------------------------- 1 | [ignore] 2 | 3 | # We fork some components by platform. 4 | .*/*.android.js 5 | 6 | # Ignore templates with `@flow` in header 7 | .*/local-cli/generator.* 8 | 9 | # Ignore malformed json 10 | .*/node_modules/y18n/test/.*\.json 11 | 12 | [include] 13 | 14 | [libs] 15 | node_modules/react-native/Libraries/react-native/react-native-interface.js 16 | node_modules/react-native/flow 17 | flow/ 18 | 19 | [options] 20 | module.system=haste 21 | 22 | esproposal.class_static_fields=enable 23 | esproposal.class_instance_fields=enable 24 | 25 | experimental.strict_type_args=true 26 | 27 | munge_underscores=true 28 | 29 | module.name_mapper='^image![a-zA-Z0-9$_-]+$' -> 'GlobalImageStub' 30 | 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' 31 | 32 | suppress_type=$FlowIssue 33 | suppress_type=$FlowFixMe 34 | suppress_type=$FixMe 35 | 36 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(2[0-7]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\) 37 | suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(2[0-7]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+ 38 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy 39 | 40 | [version] 41 | ^0.27.0 42 | -------------------------------------------------------------------------------- /app/Button.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by allen on 16/7/9. 3 | */ 4 | /** 5 | * Sample React Native App 6 | * https://github.com/facebook/react-native 7 | * @flow 8 | */ 9 | 10 | import React, { Component } from 'react'; 11 | import { 12 | AppRegistry, 13 | StyleSheet, 14 | Text, 15 | View, 16 | Image, 17 | TouchableNativeFeedback, 18 | 19 | 20 | } from 'react-native'; 21 | 22 | 23 | export default class Button extends Component { 24 | //开始 前进 后退 最后 25 | // 构造 26 | constructor(props) { 27 | super(props); 28 | // 初始状态 29 | this.state = {}; 30 | } 31 | 32 | _handlePress = ()=> { 33 | if (this.props.enabled && this.props.onPress) { 34 | this.props.onPress(); 35 | 36 | } 37 | } 38 | 39 | 40 | render(){ 41 | return( 42 | 43 | {this.props.text} 44 | 45 | ); 46 | } 47 | } 48 | const styles = StyleSheet.create({ 49 | button: { 50 | backgroundColor: 'rgba(0, 0, 0, 0.3)', 51 | margin: 2, 52 | height: 30, 53 | justifyContent: 'center', 54 | alignItems: 'center', 55 | }, 56 | buttonText: { 57 | color: 'white' 58 | } 59 | }); 60 | 61 | 62 | -------------------------------------------------------------------------------- /app/HomeUI.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by allen on 16/7/9. 3 | */ 4 | /** 5 | * Sample React Native App 6 | * https://github.com/facebook/react-native 7 | * @flow 8 | */ 9 | 10 | import React, { Component } from 'react'; 11 | import { 12 | AppRegistry, 13 | StyleSheet, 14 | Text, 15 | View, 16 | ListView, 17 | TouchableViewBackedScrollView, 18 | 19 | } from 'react-native'; 20 | export default class HomeUI extends Component{ 21 | 22 | constructor(props){ 23 | super(props); 24 | this.state ={ 25 | dataSource:new ListView.DataSource({ 26 | rowHasChanged:(row1,row2) =>row1!==row2, 27 | }), 28 | } 29 | } 30 | _pressButton(){ 31 | const { navigator} = this.props; 32 | } 33 | goBack(){ 34 | const {navigator} = this.props; 35 | if (navigator){ 36 | //返回上一页 37 | navigator.pop(); 38 | } 39 | 40 | } 41 | render(){ 42 | return( 43 | 44 | Welcome to React Native 东方耀 45 | 46 | ); 47 | } 48 | } 49 | const styles = StyleSheet.create({ 50 | container: { 51 | flex: 1, 52 | justifyContent: 'center', 53 | backgroundColor: '#F5FCFF', 54 | }, 55 | welcome: { 56 | fontSize: 20, 57 | textAlign: 'center', 58 | margin: 10, 59 | } 60 | }); 61 | 62 | 63 | -------------------------------------------------------------------------------- /app/ios/app/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 "RCTBundleURLProvider.h" 13 | #import "RCTRootView.h" 14 | 15 | @implementation AppDelegate 16 | 17 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 18 | { 19 | NSURL *jsCodeLocation; 20 | 21 | [[RCTBundleURLProvider sharedSettings] setDefaults]; 22 | jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil]; 23 | 24 | RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation 25 | moduleName:@"app" 26 | initialProperties:nil 27 | launchOptions:launchOptions]; 28 | rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1]; 29 | 30 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 31 | UIViewController *rootViewController = [UIViewController new]; 32 | rootViewController.view = rootView; 33 | self.window.rootViewController = rootViewController; 34 | [self.window makeKeyAndVisible]; 35 | return YES; 36 | } 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /app/.vscode/typings/react/react-addons-css-transition-group.d.ts: -------------------------------------------------------------------------------- 1 | // Type definitions for React v0.14 (react-addons-css-transition-group) 2 | // Project: http://facebook.github.io/react/ 3 | // Definitions by: Asana , AssureSign , Microsoft 4 | // Definitions: https://github.com/borisyankov/DefinitelyTyped 5 | 6 | /// 7 | /// 8 | 9 | declare namespace __React { 10 | interface CSSTransitionGroupTransitionName { 11 | enter: string; 12 | enterActive?: string; 13 | leave: string; 14 | leaveActive?: string; 15 | appear?: string; 16 | appearActive?: string; 17 | } 18 | 19 | interface CSSTransitionGroupProps extends TransitionGroupProps { 20 | transitionName: string | CSSTransitionGroupTransitionName; 21 | transitionAppear?: boolean; 22 | transitionAppearTimeout?: number; 23 | transitionEnter?: boolean; 24 | transitionEnterTimeout?: number; 25 | transitionLeave?: boolean; 26 | transitionLeaveTimeout?: number; 27 | } 28 | 29 | type CSSTransitionGroup = ComponentClass; 30 | 31 | namespace __Addons { 32 | export var CSSTransitionGroup: __React.CSSTransitionGroup; 33 | } 34 | } 35 | 36 | declare module "react-addons-css-transition-group" { 37 | var CSSTransitionGroup: __React.CSSTransitionGroup; 38 | type CSSTransitionGroup = __React.CSSTransitionGroup; 39 | export = CSSTransitionGroup; 40 | } 41 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ReactNative 学习笔记 2 | 3 | 1. folly::toJson: JSON object value was a Nan or INF 4 | 5 | > 移出项目中 style 包含:" alignItems: 'center' " 6 | 7 | 2. React-Native 引导页已经背景图 全屏覆盖展开 8 | 9 | ``` 10 | var {width,height,scale,fontScale} = 11 | Dimensions.get('window'); 12 | 13 | ``` 14 | > 用法: 15 | 16 | ```javascript 17 | 22 | ``` 23 | 24 | 25 | # [React Native 代码规范](https://github.com/ToAllen/react-native-coding-style) 26 | 27 | # ReactNative存储 28 | [AsyncStorage](http://reactnative.cn/docs/0.28/asyncstorage.html) 29 | # ReactNative IDE配置 30 | [VsCode 配置](http://www.jianshu.com/p/bdf36dd8bf58) 31 | 32 | # Android 项目中嵌入 ReactNative 模块 33 | [Android 项目中嵌入 ReactNative 模块](https://github.com/AllenCoder/ReactNativeNote/blob/master/Android%E5%8E%9F%E7%94%9F%E9%A1%B9%E7%9B%AE%E7%A7%BB%E6%A4%8D%20ReactNative.md) 34 | 35 | ## License 36 | ``` 37 | Copyright 2016 AllenCoder 38 | 39 | Licensed under the Apache License, Version 2.0 (the "License"); 40 | you may not use this file except in compliance with the License. 41 | You may obtain a copy of the License at 42 | 43 | http://www.apache.org/licenses/LICENSE-2.0 44 | 45 | Unless required by applicable law or agreed to in writing, software 46 | distributed under the License is distributed on an "AS IS" BASIS, 47 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 48 | See the License for the specific language governing permissions and 49 | limitations under the License. 50 | ``` -------------------------------------------------------------------------------- /app/.vscode/typings/react/react-addons-perf.d.ts: -------------------------------------------------------------------------------- 1 | // Type definitions for React v0.14 (react-addons-perf) 2 | // Project: http://facebook.github.io/react/ 3 | // Definitions by: Asana , AssureSign , Microsoft 4 | // Definitions: https://github.com/borisyankov/DefinitelyTyped 5 | 6 | /// 7 | 8 | declare namespace __React { 9 | interface ComponentPerfContext { 10 | current: string; 11 | owner: string; 12 | } 13 | 14 | interface NumericPerfContext { 15 | [key: string]: number; 16 | } 17 | 18 | interface Measurements { 19 | exclusive: NumericPerfContext; 20 | inclusive: NumericPerfContext; 21 | render: NumericPerfContext; 22 | counts: NumericPerfContext; 23 | writes: NumericPerfContext; 24 | displayNames: { 25 | [key: string]: ComponentPerfContext; 26 | }; 27 | totalTime: number; 28 | } 29 | 30 | namespace __Addons { 31 | namespace Perf { 32 | export function start(): void; 33 | export function stop(): void; 34 | export function printInclusive(measurements: Measurements[]): void; 35 | export function printExclusive(measurements: Measurements[]): void; 36 | export function printWasted(measurements: Measurements[]): void; 37 | export function printDOM(measurements: Measurements[]): void; 38 | export function getLastMeasurements(): Measurements[]; 39 | } 40 | } 41 | } 42 | 43 | declare module "react-addons-perf" { 44 | import Perf = __React.__Addons.Perf; 45 | export = Perf; 46 | } 47 | -------------------------------------------------------------------------------- /app/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.app', 50 | ) 51 | 52 | android_resource( 53 | name = 'res', 54 | res = 'src/main/res', 55 | package = 'com.app', 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 | -------------------------------------------------------------------------------- /app/ios/app/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | NSAppTransportSecurity 6 | 7 | NSAllowsArbitraryLoads 8 | 9 | 10 | CFBundleDevelopmentRegion 11 | en 12 | CFBundleExecutable 13 | $(EXECUTABLE_NAME) 14 | CFBundleIdentifier 15 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 16 | CFBundleInfoDictionaryVersion 17 | 6.0 18 | CFBundleName 19 | $(PRODUCT_NAME) 20 | CFBundlePackageType 21 | APPL 22 | CFBundleShortVersionString 23 | 1.0 24 | CFBundleSignature 25 | ???? 26 | CFBundleVersion 27 | 1 28 | LSRequiresIPhoneOS 29 | 30 | UILaunchStoryboardName 31 | LaunchScreen 32 | UIRequiredDeviceCapabilities 33 | 34 | armv7 35 | 36 | UISupportedInterfaceOrientations 37 | 38 | UIInterfaceOrientationPortrait 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UIViewControllerBasedStatusBarAppearance 43 | 44 | NSLocationWhenInUseUsageDescription 45 | 46 | NSAppTransportSecurity 47 | 48 | 49 | NSExceptionDomains 50 | 51 | localhost 52 | 53 | NSTemporaryExceptionAllowsInsecureHTTPLoads 54 | 55 | 56 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /app/LikeCount.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by allen on 16/7/9. 3 | */ 4 | /** 5 | * Sample React Native App 6 | * https://github.com/facebook/react-native 7 | * @flow 8 | */ 9 | 10 | import React, { Component } from 'react'; 11 | import { 12 | AppRegistry, 13 | StyleSheet, 14 | Text, 15 | View, 16 | Image, 17 | TouchableOpacity, 18 | 19 | } from 'react-native'; 20 | export default class LikeCount extends Component{ 21 | //喜欢数组件 22 | // 构造 23 | constructor(props) { 24 | super(props); 25 | // 初始状态 26 | this.state = { 27 | likes:0 28 | }; 29 | } 30 | 31 | onClick=()=>{ 32 | this.setState({likes:this.state.likes+1}) 33 | } 34 | 35 | render(){ 36 | //这是一个点赞的小图标,一个代码就搞定了 37 | const thumbsUp ='\uD83D\uDC4D'; 38 | return ( 39 | 40 | {thumbsUp+'Like'} 41 | 42 | 43 | 44 | {this.state.likes+'个喜欢数'} 45 | 46 | 47 | ); 48 | } 49 | 50 | } 51 | const styles = StyleSheet.create({ 52 | likeContainer: { 53 | flex: 1, 54 | justifyContent: 'center', 55 | backgroundColor: '#F5FCFF', 56 | }, 57 | welcome: { 58 | fontSize: 20, 59 | textAlign: 'center', 60 | margin: 10, 61 | }, 62 | instructions: { 63 | textAlign: 'center', 64 | color: '#333333', 65 | marginBottom: 5, 66 | }, 67 | image:{ 68 | width:100, 69 | height:60 70 | }, 71 | 72 | viewPager:{ 73 | flex:1 74 | }, 75 | buttonText:{ 76 | color:'#333333' 77 | }, 78 | likeButton:{ 79 | backgroundColor:'rgba(0,0,0,1)', 80 | }, 81 | likesText:{ 82 | fontSize: 20, 83 | color:'red', 84 | width:100, 85 | height:60, 86 | } 87 | }); 88 | 89 | 90 | -------------------------------------------------------------------------------- /app/app/app.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by allen on 16/7/23. 3 | */ 4 | import React, { Component } from 'react'; 5 | import { 6 | StyleSheet, 7 | Navigator,StatusBar, 8 | BackAndroid,View 9 | } from 'react-native'; 10 | import Splash from './pages/Splash.js'; 11 | var _navigator, isRemoved = false; 12 | export default class app extends Component{ 13 | // 构造 14 | constructor(props) { 15 | super(props); 16 | // 初始状态 17 | this.state = {}; 18 | this.renderScene = this.renderScene.bind(this); 19 | this.goBack = this.goBack.bind(this); 20 | BackAndroid.addEventListener('hardwareBackPress', this.goBack); 21 | } 22 | 23 | goBack() { 24 | return NaviGoBack(_navigator); 25 | } 26 | 27 | renderScene(route, navigator) { 28 | let Component = route.component; 29 | _navigator = navigator; 30 | if (route.name === 'WebViewPage') { 31 | BackAndroid.removeEventListener('hardwareBackPress', this.goBack); 32 | isRemoved = true; 33 | } else { 34 | if (isRemoved) { 35 | BackAndroid.addEventListener('hardwareBackPress', this.goBack); 36 | } 37 | } 38 | return ( 39 | 40 | ); 41 | } 42 | 43 | configureScene(route, routeStack) { 44 | return Navigator.SceneConfigs.PushFromRight; 45 | } 46 | 47 | render() { 48 | return ( 49 | 50 | 54 | 64 | 65 | ); 66 | } 67 | } 68 | 69 | let styles = StyleSheet.create({ 70 | navigator: { 71 | flex: 1 72 | } 73 | }); -------------------------------------------------------------------------------- /app/app/store/AsyncStorage.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by allen on 16/7/25. 3 | */ 4 | 'use strict' 5 | 6 | import Storage from 'react-native-storage'; 7 | //var STORAGE_KEY_ONE = '@AsyncStorageDemo:key_one'; 8 | //var STORAGE_KEY_MESSAGE = '@AsyncStorageDemo:key_message'; 9 | //module.exports ={ 10 | // _loadInitialState(){ 11 | // var value = AsyncStorage.getItem(STORAGE_KEY_ONE); 12 | // console.log("存储的数据是"+value) 13 | // value =1.0; 14 | // return value; 15 | // }, 16 | // async _saveValue( message){ 17 | // try { 18 | // await AsyncStorage.setItem(STORAGE_KEY_ONE, message); 19 | // 20 | // console.log("存储的数据是"+AsyncStorage.getItem(STORAGE_KEY_ONE)); 21 | // } catch (e) { 22 | // console.log("存储数据错误" + e) 23 | // } 24 | // }, 25 | // async _removeValue(){ 26 | // await AsyncStorage.removeItem(STORAGE_KEY_ONE); 27 | // } 28 | //} 29 | //var storage = new Storage({ 30 | // // 最大容量,默认值1000条数据循环存储 31 | // size: 1000, 32 | // 33 | // // 数据过期时间,默认一整天(1000 * 3600 * 24 毫秒),设为null则永不过期 34 | // defaultExpires: 1000 * 3600 * 24, 35 | // 36 | // // 读写时在内存中缓存数据。默认启用。 37 | // enableCache: true, 38 | // 39 | // // 如果storage中没有相应数据,或数据已过期, 40 | // // 则会调用相应的sync同步方法,无缝返回最新数据。 41 | // sync : { 42 | // // 同步方法的具体说明会在后文提到 43 | // } 44 | //}) 45 | //// 使用key来保存数据。这些数据一般是全局独有的,常常需要调用的。 46 | //// 除非你手动移除,这些数据会被永久保存,而且默认不会过期。 47 | //storage.save({ 48 | // key: 'loginState', //注意:请不要在key中使用_下划线符号! 49 | // rawData: { 50 | // from: 'some other site', 51 | // userid: 'some userid', 52 | // token: 'some token' 53 | // }, 54 | // 55 | // // 如果不指定过期时间,则会使用defaultExpires参数 56 | // // 如果设为null,则永不过期 57 | // expires: 1000 * 3600 58 | //}); 59 | // 60 | //// 读取 61 | //storage.load({ 62 | // key: 'loginState', 63 | // 64 | // // autoSync(默认为true)意味着在没有找到数据或数据过期时自动调用相应的同步方法 65 | // autoSync: true, 66 | // 67 | // // syncInBackground(默认为true)意味着如果数据过期, 68 | // // 在调用同步方法的同时先返回已经过期的数据。 69 | // // 设置为false的话,则始终强制返回同步方法提供的最新数据(当然会需要更多等待时间)。 70 | // syncInBackground: true 71 | //}).then(ret => { 72 | // //如果找到数据,则在then方法中返回 73 | // console.log(ret.userid); 74 | //}).catch(err => { 75 | // //如果没有找到数据且没有同步方法, 76 | // //或者有其他异常,则在catch中返回 77 | // console.warn(err); 78 | //}) -------------------------------------------------------------------------------- /app/ios/appTests/appTests.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 "RCTLog.h" 14 | #import "RCTRootView.h" 15 | 16 | #define TIMEOUT_SECONDS 600 17 | #define TEXT_TO_LOOK_FOR @"Welcome to React Native!" 18 | 19 | @interface appTests : XCTestCase 20 | 21 | @end 22 | 23 | @implementation appTests 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 | -------------------------------------------------------------------------------- /app/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 | -------------------------------------------------------------------------------- /app/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 | -------------------------------------------------------------------------------- /app/.vscode/typings/react/react-dom.d.ts: -------------------------------------------------------------------------------- 1 | // Type definitions for React v0.14 (react-dom) 2 | // Project: http://facebook.github.io/react/ 3 | // Definitions by: Asana , AssureSign , Microsoft 4 | // Definitions: https://github.com/borisyankov/DefinitelyTyped 5 | 6 | /// 7 | 8 | declare namespace __React { 9 | namespace __DOM { 10 | function findDOMNode(instance: ReactInstance): E; 11 | function findDOMNode(instance: ReactInstance): Element; 12 | 13 | function render

( 14 | element: DOMElement

, 15 | container: Element, 16 | callback?: (element: Element) => any): Element; 17 | function render( 18 | element: ClassicElement

, 19 | container: Element, 20 | callback?: (component: ClassicComponent) => any): ClassicComponent; 21 | function render( 22 | element: ReactElement

, 23 | container: Element, 24 | callback?: (component: Component) => any): Component; 25 | 26 | function unmountComponentAtNode(container: Element): boolean; 27 | 28 | var version: string; 29 | 30 | function unstable_batchedUpdates(callback: (a: A, b: B) => any, a: A, b: B): void; 31 | function unstable_batchedUpdates(callback: (a: A) => any, a: A): void; 32 | function unstable_batchedUpdates(callback: () => any): void; 33 | 34 | function unstable_renderSubtreeIntoContainer

( 35 | parentComponent: Component, 36 | nextElement: DOMElement

, 37 | container: Element, 38 | callback?: (element: Element) => any): Element; 39 | function unstable_renderSubtreeIntoContainer( 40 | parentComponent: Component, 41 | nextElement: ClassicElement

, 42 | container: Element, 43 | callback?: (component: ClassicComponent) => any): ClassicComponent; 44 | function unstable_renderSubtreeIntoContainer( 45 | parentComponent: Component, 46 | nextElement: ReactElement

, 47 | container: Element, 48 | callback?: (component: Component) => any): Component; 49 | } 50 | 51 | namespace __DOMServer { 52 | function renderToString(element: ReactElement): string; 53 | function renderToStaticMarkup(element: ReactElement): string; 54 | var version: string; 55 | } 56 | } 57 | 58 | declare module "react-dom" { 59 | import DOM = __React.__DOM; 60 | export = DOM; 61 | } 62 | 63 | declare module "react-dom/server" { 64 | import DOMServer = __React.__DOMServer; 65 | export = DOMServer; 66 | } 67 | -------------------------------------------------------------------------------- /app/app/pages/GuidePage.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by allen on 16/7/23. 3 | */ 4 | import React, { Component } from 'react'; 5 | import { 6 | AppRegistry, 7 | StyleSheet, 8 | View, 9 | Image, 10 | Dimensions, 11 | TouchableHighlight 12 | } from 'react-native'; 13 | import Swiper from 'react-native-swiper'; 14 | var width = Dimensions.get('window').width; 15 | var height = Dimensions.get('window').height; 16 | export default class GuidePage extends Component { 17 | 18 | _PressButton(){ 19 | alert("跳转新的一页"); 20 | } 21 | render() { 22 | return ( 23 | } 25 | activeDot={}> 26 | 27 | 29 | 30 | 31 | 33 | 34 | 35 | 37 | 38 | 39 | 40 | 42 | 43 | 44 | 45 | ) 46 | } 47 | 48 | } 49 | const styles = StyleSheet.create({ 50 | flex: { 51 | flex: 1 52 | }, 53 | container: { 54 | flex: 1, 55 | justifyContent: 'center', 56 | alignItems: 'center', 57 | backgroundColor: '#F5FCFF', 58 | }, 59 | welcome: { 60 | fontSize: 20, 61 | textAlign: 'center', 62 | margin: 10, 63 | }, 64 | instructions: { 65 | textAlign: 'center', 66 | color: '#333333', 67 | marginBottom: 5, 68 | }, 69 | wrapper: {}, 70 | slide1: { 71 | flex: 1, 72 | justifyContent: 'center', 73 | alignItems: 'center', 74 | backgroundColor: '#9DD6EB', 75 | }, 76 | slide2: { 77 | flex: 1, 78 | justifyContent: 'center', 79 | alignItems: 'center', 80 | backgroundColor: '#97CAE5', 81 | }, 82 | slide3: { 83 | flex: 1, 84 | justifyContent: 'center', 85 | alignItems: 'center', 86 | backgroundColor: '#92BBD9', 87 | }, 88 | text: { 89 | color: '#fff', 90 | fontSize: 30, 91 | fontWeight: 'bold', 92 | } 93 | }); -------------------------------------------------------------------------------- /Redux 学习笔记.md: -------------------------------------------------------------------------------- 1 | # 1. Redux 是什么? 2 | 3 | 4 | ReactNative 架构Redux研究 5 | 字数1067 阅读5379 评论4 喜欢15 6 | 参考文档:http://camsong.github.io/redux-in-chinese/index.html 7 | 参考Demo:https://github.com/alinz/example-react-native-redux 8 | 参考文档 http://www.jianshu.com/p/14933fd9c312 9 | 10 | 01. ReactNative 架构Redux研究.jpg 11 | Redux是当前最热门的React架构。它的出现主要是为了修补Facebook官方推荐架构Flux的不足。 12 | [!![alt](http://upload-images.jianshu.io/upload_images/80690-2c073cb2c2cf1010.jpg?imageMogr2/auto-orient/strip%7CimageView2/2)] 13 | 14 | 02. Redux开发环境搭建.jpg 15 | Redux开发环境搭建非常简单。需要注意的是,由于目前React-Native 0.17.0 的兼容性不好,建议大家先用0.16.0,并关注0.18.0的更新。 16 | 17 | 18 | 03. Redux 三个要点.jpg 19 | Redux为了达到对组件state的控制,禁止直接修改state,而是通过action触发reducers的方式来更新state树。 20 | 21 | 22 | 04. Redux概览.jpg 23 | Redux的主要工作在store上。通过store持有状态树,监听、分发action。 24 | 25 | 26 | 05. Redux 三原则.jpg 27 | State只读,可能让人比较费解。Redux并不直接修改state树,而是创建state树副本,更新后,直接替换旧的state树。 28 | 29 | 30 | 06. Rx 异步流.jpg 31 | Rx与Redux配合良好,可以把Redux store作为可观察变量处理。 32 | 33 | 34 | 07. Action.jpg 35 | Action是Redux处理数据的开始。数据的任何变化都应该有相应的Action。 36 | 37 | 38 | 08. Reducer.jpg 39 | Reducer是数据的处理中心。编写完成后,它应该作为一种黑盒的存在。 40 | 41 | 42 | 09. Reducer 更新State.jpg 43 | 通过Object.assign创建state副本后再进行修改,不要直接修改原state。 44 | 45 | 46 | 10. Reducer 合成.jpg 47 | 通过子Reducer函数管理不同的分组数据,最后合成唯一一棵state树。 48 | 49 | 50 | 11. Store 职责.jpg 51 | Store负责对整个state树进行管理。通过监听action,实现数据的传递。 52 | 53 | 54 | 12. Store 创建、监听、分发.jpg 55 | 组件卸载时,要注意停止store的监听,以免影响性能。 56 | 57 | 58 | 13. 数据流.jpg 59 | 数据流从用户行为触发的action开始。 60 | Action->Store->Reducer->Store->UI。 61 | 62 | 63 | 14. React-Redux.jpg 64 | Redux是独立的库,需要通过React-Redux库实现与React Native的配合使用。 65 | 设计组件的层次结构,主要搞清楚不同的组件需要处理什么数据,实现什么功能的回调。 66 | 67 | 68 | 15.React 连接到Redux.jpg 69 | Redux通过Provider和connect两个组件,实现与React的连接。 70 | 71 | 72 | 16. 完整的 ReactNative APP文件结构.jpg 73 | Redux的主要工作在容器组件上。Actions和Reducers都是纯函数。 74 | 75 | 76 | 17. Redux APP 结构.jpg 77 | store和 connect这层是开发调试时的主要对象。 78 | 79 | 80 | 18. 异步Action.jpg 81 | 异步Action,一般需要提供三种以上的状态Action。 82 | 83 | 84 | 19.state 结构.jpg 85 | 通过ID引用数据,可以实现更简洁清晰的数据结构。 86 | 87 | 88 | 20. redux-thunk.jpg 89 | 中间件技术,通过切片组合,使得action传递过程中可以实现更多的控制。 90 | 91 | 92 | 21.Fetch.jpg 93 | Fetch是更简洁清晰的请求方式。 94 | 95 | 96 | 22.服务端渲染:异步 action creator.jpg 97 | 直接在action creator里dispatch 请求action,将使得业务逻辑更连贯。 98 | 99 | 100 | 23.处理异步Action的选择.jpg 101 | Thunk middleware是目前最多人使用的方案。 102 | 103 | 104 | 24.异步数据流.jpg 105 | 异步数据流通过使用异步中间件包装store的dispatch方法来实现。最终要返回一个普通对象的action,重回同步数据流。 106 | 107 | 108 | 25.中间件 Middleware.jpg 109 | 链式组合,使得代码逻辑更简单清晰。 110 | 111 | 112 | 26.Middleware 的演化.jpg 113 | 中间件可以层层叠加,非常灵活地修改功能函数的功能。 114 | 115 | 116 | 27. Redux迁移-Flux 项目.jpg 117 | 迁移的关键工作在于把Flux store重写为Redux 的reducer。 118 | 119 | 120 | 28.减少样板代码.jpg 121 | 通过上面的原则,可以使Redux App的代码更易于维护。 122 | 123 | 124 | 29.服务端渲染.jpg 125 | 服务端渲染可以进一步提升React 的性能。 126 | 127 | 128 | 30.Redux 测试.jpg 129 | Action 和 Reducer都是纯函数,使得测试可以覆盖到更多代码。 130 | 131 | 132 | 31.计算衍生数据.jpg 133 | Reselect 可以省去数据不必要的重新计算。 134 | 135 | 136 | 32.实现撤销历史.jpg 137 | 通过同时维护三个数据域来实现撤销与重做。 138 | 139 | 140 | 33. Redux Undo.jpg 141 | Redux-undo使得撤销重做更容易实现。 142 | 143 | 如果你有任何问题想找我交流,可以到我的支付宝经费群来找我:) -------------------------------------------------------------------------------- /Text 组件练习.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 | Image, 11 | StyleSheet, 12 | Text, 13 | View, 14 | ListView, 15 | PixelRatio, 16 | TouchableOpacity 17 | } from 'react-native'; 18 | const Header = require('./header'); 19 | class AwesomeProject extends Component { 20 | 21 | render() { 22 | return ( 23 |

24 | 25 | 26 | 27 | 28 | 32 | 33 | ); 34 | } 35 | 36 | 37 | } 38 | class ImportantNew extends Component { 39 | show(title) { 40 | alert(title); 41 | } 42 | 43 | render() { 44 | 45 | var news = []; 46 | for (var i in this.props.news) { 47 | var text = ( 48 | {this.props.news[i]} 53 | ); 54 | news.push(text); 55 | } 56 | return ( 57 | 今日要闻 58 | {news} 59 | 60 | ); 61 | } 62 | } 63 | class List extends Component { 64 | render() { 65 | return ( 66 | {this.props.title} 67 | ); 68 | }; 69 | } 70 | const styles = StyleSheet.create({ 71 | container: { 72 | marginTop: 200, 73 | marginLeft: 5, 74 | marginRight: 5, 75 | height: 84, 76 | flexDirection: 'row', 77 | borderRadius: 5, 78 | padding: 2, 79 | backgroundColor: '#FF0067', 80 | 81 | }, 82 | list_item: { 83 | height: 40, 84 | marginLeft: 10, 85 | marginRight: 10, 86 | borderBottomWidth: 1, 87 | borderBottomColor: "#ddd", 88 | justifyContent: 'center', 89 | }, 90 | list_item_font: { 91 | fontSize: 16, 92 | }, 93 | new_title: { 94 | fontSize: 20, 95 | fontWeight: 'bold', 96 | color: '#CD1D1C', 97 | marginLeft: 10, 98 | marginTop: 15 99 | }, 100 | news_item: { 101 | marginLeft: 10, 102 | marginRight: 10, 103 | fontSize: 15, 104 | lineHeight: 40 105 | } 106 | 107 | }); 108 | 109 | AppRegistry.registerComponent('AwesomeProject', () => AwesomeProject); 110 | -------------------------------------------------------------------------------- /携程界面.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 | Image, 11 | StyleSheet, 12 | Text, 13 | View, 14 | ListView, 15 | PixelRatio, 16 | TouchableOpacity 17 | } from 'react-native'; 18 | class AwesomeProject extends Component { 19 | 20 | render() { 21 | return ( 22 | 23 | 酒店 24 | 25 | 26 | 27 | 海外酒店 28 | 29 | 30 | 31 | 特惠酒店 32 | 33 | 34 | 35 | 36 | 团购 37 | 38 | 39 | 40 | 客栈。公寓 41 | 42 | 43 | 44 | ); 45 | } 46 | 47 | 48 | } 49 | const styles = StyleSheet.create({ 50 | container: { 51 | marginTop: 200, 52 | marginLeft: 5, 53 | marginRight: 5, 54 | height: 84, 55 | flexDirection: 'row', 56 | borderRadius: 5, 57 | padding: 2, 58 | backgroundColor: '#FF0067', 59 | 60 | }, 61 | item: { 62 | flex: 1, 63 | height: 80, 64 | }, 65 | center: { 66 | justifyContent: 'center', 67 | alignItems: 'center' 68 | }, 69 | font:{ 70 | color:'#fff', 71 | fontSize:16, 72 | fontWeight:'bold' 73 | }, 74 | flex: { 75 | flex: 1 76 | }, 77 | lineLeftRight:{ 78 | borderColor:'#fff', 79 | borderLeftWidth:1/PixelRatio.get(), 80 | borderRightWidth:1/PixelRatio.get() 81 | }, 82 | lineCenter:{ 83 | borderBottomWidth:1/PixelRatio.get(), 84 | borderColor:'#fff' 85 | }, 86 | welcome: { 87 | fontSize: 20, 88 | textAlign: 'center', 89 | margin: 10, 90 | }, 91 | instructions: { 92 | textAlign: 'center', 93 | color: '#333333', 94 | marginBottom: 5, 95 | }, 96 | thumbnail: { 97 | width: 53, 98 | height: 81, 99 | }, 100 | rightContainer: { 101 | flex: 1, 102 | }, 103 | title: { 104 | fontSize: 20, 105 | marginBottom: 8, 106 | textAlign: 'center', 107 | }, 108 | year: { 109 | textAlign: 'center', 110 | }, 111 | listView: { 112 | paddingTop: 20, 113 | backgroundColor: '#F5FCFF', 114 | }, 115 | button: { 116 | height: 40, 117 | width: 400, 118 | backgroundColor: 'green', 119 | justifyContent: 'center', 120 | }, 121 | buttonText: { 122 | textAlign: 'center', 123 | color: 'white' 124 | } 125 | 126 | }); 127 | 128 | AppRegistry.registerComponent('AwesomeProject', () => AwesomeProject); 129 | -------------------------------------------------------------------------------- /app/ios/app/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 | -------------------------------------------------------------------------------- /app/app/containers/MainContainer.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by allen on 16/7/23. 3 | */ 4 | 'use strict' 5 | import React,{Component} from 'react'; 6 | import { 7 | View, 8 | Text, 9 | Image, 10 | StyleSheet, 11 | Dimensions, 12 | StatusBar 13 | } from 'react-native'; 14 | import TabNavigator from 'react-native-tab-navigator'; 15 | import Home from '../pages/Home'; 16 | import Product from '../pages/Product'; 17 | import Account from '../pages/Account'; 18 | import More from '../pages/More'; 19 | var height = Dimensions.get('window').height; 20 | export default class MainContainer extends Component { 21 | constructor(props) { 22 | super(props); 23 | this.state = { 24 | selectedTab:'home' 25 | 26 | }; 27 | console.log(this.state.selectedTab); 28 | } 29 | 30 | render() { 31 | 32 | return ( 33 | 34 | 35 | } 41 | renderSelectedIcon={() => } 42 | onPress={() => this.setState({ selectedTab: 'home' })}> 43 | 44 | 45 | } 51 | renderSelectedIcon={() => } 52 | onPress={() => this.setState({ selectedTab: 'product' })}> 53 | 54 | 55 | } 61 | renderSelectedIcon={() => } 62 | onPress={() => this.setState({ selectedTab: 'account' })}> 63 | 64 | 65 | } 71 | renderSelectedIcon={() => } 72 | onPress={() => this.setState({ selectedTab: 'more' })}> 73 | 74 | 75 | 76 | ); 77 | } 78 | } 79 | const styles=StyleSheet.create({ 80 | iconStyle:{ 81 | width:26, 82 | height:26, 83 | }, 84 | textStyle:{ 85 | color:'#838c93', 86 | }, 87 | selectedTextStyle:{ 88 | color:'black', 89 | } 90 | }); -------------------------------------------------------------------------------- /app/app/pages/Splash.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | import React from 'react'; 3 | import { 4 | Dimensions, 5 | Image, 6 | InteractionManager 7 | 8 | } from 'react-native'; 9 | import MainContainer from '../containers/MainContainer.js' 10 | import GuidePage from '../pages/GuidePage'; 11 | /** 12 | * 对象解构赋值 13 | * @type {*|Object} 14 | */ 15 | var {width,height,scale,fontScale} = Dimensions.get('window'); 16 | import Storage from 'react-native-storage'; 17 | var storge = new Storage(); 18 | var DeviceInfo = require('react-native-device-info'); 19 | var version ; 20 | export default class Splash extends React.Component { 21 | constructor(props) { 22 | super(props); 23 | 24 | 25 | } 26 | 27 | componentDidMount() { 28 | 29 | console.log("Device Unique ID", DeviceInfo.getUniqueID()); // e.g. FCDBD8EF-62FC-4ECB-B2F5-92C9E79AC7F9 30 | // * note this is IDFV on iOS so it will change if all apps from the current apps vendor have been previously uninstalled 31 | 32 | console.log("Device Manufacturer", DeviceInfo.getManufacturer()); // e.g. Apple 33 | 34 | console.log("Device Model", DeviceInfo.getModel()); // e.g. iPhone 6 35 | 36 | console.log("Device ID", DeviceInfo.getDeviceId()); // e.g. iPhone7,2 / or the board on Android e.g. goldfish 37 | 38 | console.log("Device Name", DeviceInfo.getSystemName()); // e.g. iPhone OS 39 | 40 | console.log("Device Version", DeviceInfo.getSystemVersion()); // e.g. 9.0 41 | 42 | console.log("Bundle Id", DeviceInfo.getBundleId()); // e.g. com.learnium.mobile 43 | 44 | console.log("Build Number", DeviceInfo.getBuildNumber()); // e.g. 89 45 | 46 | console.log("App Version", DeviceInfo.getVersion()); // e.g. 1.1.0 47 | 48 | console.log("App Version (Readable)", DeviceInfo.getReadableVersion()); // e.g. 1.1.0.89 49 | 50 | console.log("Device Name", DeviceInfo.getDeviceName()); // e.g. Becca's iPhone 6 51 | 52 | console.log("User Agent", DeviceInfo.getUserAgent()); // e.g. Dalvik/2.1.0 (Linux; U; Android 5.1; Google Nexus 4 - 5.1.0 - API 22 - 768x1280 Build/LMY47D) 53 | 54 | 55 | const {navigator} = this.props; 56 | storge.load({ 57 | key:'AppVersion', 58 | autoSync:true, 59 | }).then(ret =>{ 60 | version = ret.AppVersion; 61 | console.log(JSON.stringify(version)) 62 | }).catch(err => { 63 | // 如果没有找到数据且没有同步方法, 64 | // 或者有其他异常,则在catch中返回 65 | console.warn(err); 66 | }) 67 | 68 | this.timer = setTimeout(()=> { 69 | InteractionManager.runAfterInteractions(() => { 70 | if (version ===DeviceInfo.getVersion()){ 71 | navigator.resetTo({ 72 | component: MainContainer, 73 | name: 'Main' 74 | }); 75 | }else{ 76 | storge.save({ 77 | key:'AppVersion', 78 | rawData:{ 79 | AppVersion:DeviceInfo.getVersion(), 80 | } 81 | , 82 | expires:null 83 | }); 84 | navigator.resetTo({ 85 | component: GuidePage, 86 | name: 'GuidePage' 87 | }); 88 | console.log(DeviceInfo.getVersion()); 89 | 90 | } 91 | 92 | }); 93 | }, 1000) 94 | } 95 | 96 | componentWillUnMount() { 97 | this.timer && clearTimeout(this.timer); 98 | } 99 | 100 | render() { 101 | return ( 102 | 105 | ); 106 | } 107 | 108 | } -------------------------------------------------------------------------------- /Navigator.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 | Image, 11 | StyleSheet, 12 | Text, 13 | View, 14 | ListView, 15 | PixelRatio, 16 | TouchableOpacity, 17 | Navigator, 18 | ScrollView 19 | } from 'react-native'; 20 | const Header = require('./header'); 21 | 22 | class AwesomeProject extends Component { 23 | 24 | render() { 25 | let defaultName = 'List'; 26 | let defaultComponent = List; 27 | return ( 28 | { 31 | return Navigator.SceneConfigs.VerticalDownSwipeJump; 32 | }} 33 | renderScene={(route, navigator) => { 34 | let Component = route.component; 35 | return 36 | }} /> 37 | ); 38 | } 39 | 40 | } 41 | class List extends Component { 42 | // 构造 43 | constructor(props) { 44 | super(props); 45 | // 初始状态 46 | this.state = { 47 | id: 1, 48 | author: null 49 | }; 50 | } 51 | 52 | _pressButton() { 53 | const {navigator }= this.props; 54 | if (navigator) { 55 | navigator.push({ 56 | name: 'Detail', 57 | component: Detail, 58 | parms: { 59 | id: this.state.id, 60 | getUser: function (user) { 61 | self.setState({ 62 | user: user 63 | }); 64 | } 65 | 66 | } 67 | }) 68 | } 69 | 70 | } 71 | 72 | render() { 73 | return( 74 | 作者是: {this.state.author } 75 | 豪华游轮三日游 76 | 豪华游轮三日游 77 | ); 78 | } 79 | } 80 | class Detail extends Component { 81 | // 构造 82 | constructor(props) { 83 | super(props); 84 | // 初始状态 85 | this.state = {}; 86 | } 87 | 88 | _pressButton() { 89 | const {navigator }= this.props; 90 | if (navigator) { 91 | navigator.pop(); 92 | } 93 | 94 | } 95 | 96 | render() { 97 | return( 98 | 点我可以弹回去 99 | ); 100 | } 101 | } 102 | const styles = StyleSheet.create({ 103 | container: { 104 | marginTop: 200, 105 | marginLeft: 5, 106 | marginRight: 5, 107 | height: 84, 108 | flexDirection: 'row', 109 | borderRadius: 5, 110 | padding: 2, 111 | backgroundColor: '#FF0067', 112 | 113 | }, 114 | list_item: { 115 | height: 40, 116 | marginLeft: 10, 117 | marginRight: 10, 118 | borderBottomWidth: 1, 119 | borderBottomColor: "#ddd", 120 | justifyContent: 'center', 121 | }, 122 | list_item_font: { 123 | fontSize: 16, 124 | }, 125 | new_title: { 126 | fontSize: 20, 127 | fontWeight: 'bold', 128 | color: '#CD1D1C', 129 | marginLeft: 10, 130 | marginTop: 15 131 | }, 132 | news_item: { 133 | marginLeft: 10, 134 | marginRight: 10, 135 | fontSize: 15, 136 | lineHeight: 40 137 | } 138 | 139 | }); 140 | 141 | AppRegistry.registerComponent('AwesomeProject', () => AwesomeProject); 142 | -------------------------------------------------------------------------------- /app/app/pages/Account.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by allen on 16/7/23. 3 | */ 4 | 'use strict' 5 | import React from 'react'; 6 | import { 7 | View, 8 | Text, 9 | ScrollView, 10 | RefreshControl, 11 | StyleSheet, 12 | Image 13 | } from 'react-native'; 14 | export default class Account extends React.Component { 15 | // 构造 16 | constructor(props) { 17 | super(props); 18 | // 初始状态 19 | this.state = { 20 | isRefreshing: false, 21 | }; 22 | } 23 | 24 | render() { 25 | return ( 26 | 35 | }> 36 | 37 | 38 | 39 | 137****5872 40 | 41 | 42 | 0优惠卷 43 | 44 | 0瓜币 45 | 46 | 47 | 48 | 49 | 50 | 51 | 账户提现 52 | 53 | 54 | 55 | 账户充值 56 | 57 | 58 | 59 | ) 60 | } 61 | 62 | _onRefresh() { 63 | //this.state({ 64 | // isRefreshing: true 65 | // } 66 | //) 67 | setTimeout(() => { 68 | // 准备下拉刷新的5条数据 69 | const rowData = Array.from(new Array(5)) 70 | .map((val, i) => ({ 71 | text: '刷新行 ' + (+this.state.loaded + i) 72 | })) 73 | .concat(this.state.rowData); 74 | 75 | this.setState({ 76 | loaded: this.state.loaded + 5, 77 | isRefreshing: false, 78 | rowData: rowData, 79 | }); 80 | }, 5000); 81 | } 82 | } 83 | const styles = StyleSheet.create({ 84 | scrollview: { 85 | flex: 1, 86 | }, 87 | horization: { 88 | flexDirection: 'row', 89 | alignItems: 'center', 90 | }, 91 | view: { 92 | alignItems: 'center', 93 | flexDirection: 'row', 94 | justifyContent: 'center' 95 | }, 96 | phoneText: { 97 | marginTop: 10, 98 | color: 'white', 99 | fontSize: 14 100 | }, 101 | couponText: { 102 | color: 'white', 103 | fontSize: 12, 104 | justifyContent: 'center', 105 | flex: 1, 106 | textAlign: 'center' 107 | }, 108 | Image: { 109 | marginTop: 12, 110 | justifyContent: 'center', 111 | width: 60, 112 | height: 60 113 | }, 114 | center: { 115 | alignItems: 'center', 116 | justifyContent: 'center', 117 | }, 118 | rechargeText:{ 119 | color: 'black', 120 | fontSize: 15, 121 | justifyContent: 'center', 122 | flex: 1, 123 | marginLeft:9, 124 | textAlign: 'center' 125 | } 126 | }); -------------------------------------------------------------------------------- /app/ios/app.xcodeproj/xcshareddata/xcschemes/app.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 44 | 45 | 47 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 65 | 66 | 75 | 77 | 83 | 84 | 85 | 86 | 87 | 88 | 94 | 96 | 102 | 103 | 104 | 105 | 107 | 108 | 111 | 112 | 113 | -------------------------------------------------------------------------------- /app/app/pages/More.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by allen on 16/9/13. 3 | */ 4 | /** 5 | * Created by allen on 16/7/23. 6 | */ 7 | 'use strict' 8 | import React from 'react'; 9 | import { 10 | View, 11 | Text, 12 | StyleSheet, 13 | Image 14 | } from 'react-native'; 15 | export default class MainContainer extends React.Component { 16 | render() { 17 | return ( 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 消息中心 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 帮助中心 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 转发好友 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 联系我们 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 意见反馈 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 检查更新 72 | 73 | 74 | 75 | 76 | 77 | ) 78 | } 79 | } 80 | const styles = StyleSheet.create({ 81 | lin: { 82 | flexDirection: 'column' 83 | }, 84 | horizontal: { 85 | backgroundColor: 'white', 86 | flexDirection: 'row', 87 | height: 44, 88 | alignSelf:'center', 89 | alignItems:'center' 90 | }, 91 | text: { 92 | fontSize: 16, 93 | color: '#333333', 94 | flex: 1, 95 | textAlign: 'left', 96 | marginLeft:14 97 | }, 98 | Image: { 99 | width: 22, 100 | height: 23, 101 | marginLeft: 15 102 | }, 103 | arrow:{ 104 | height:23, 105 | width:22, 106 | marginRight:15 107 | }, 108 | gray_line:{ 109 | height:0.5, 110 | marginLeft:16, 111 | flexDirection: 'row' 112 | }, 113 | line:{ 114 | height:0.5, 115 | flexDirection: 'row' 116 | }, 117 | top12:{ 118 | height:12, 119 | backgroundColor:'#f1f1f1' 120 | } 121 | 122 | }); -------------------------------------------------------------------------------- /app/app/pages/Product.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by allen on 16/7/23. 3 | */ 4 | 'use strict' 5 | 6 | import React,{Component} from 'react'; 7 | import { 8 | ScrollView, 9 | StyleSheet, 10 | RefreshControl, 11 | Text, 12 | View, 13 | StatusBar 14 | } from 'react-native' 15 | 16 | const styles = StyleSheet.create({ 17 | row: { 18 | borderColor: "#eee", 19 | borderWidth: 5, 20 | padding: 16, 21 | backgroundColor: 'white', 22 | flexDirection: "column" 23 | }, 24 | horziation: { 25 | flexDirection: 'row', 26 | alignItems: 'flex-end', 27 | flex: 1 28 | }, 29 | title_left: { 30 | color: '#3c76b8', 31 | fontSize: 14, 32 | justifyContent: 'space-between', 33 | flex: 1, 34 | alignSelf: 'flex-start', 35 | textAlign: 'center' 36 | } 37 | , 38 | left: { 39 | color: '#333333', 40 | fontSize: 12, 41 | justifyContent: 'space-between', 42 | flex: 1, 43 | alignSelf: 'flex-start', 44 | textAlign: 'left' 45 | }, 46 | center: { 47 | color: '#333333', 48 | fontSize: 12, 49 | justifyContent: 'space-between', 50 | flex: 1, 51 | alignSelf: 'center', 52 | textAlign: 'center' 53 | }, 54 | right: { 55 | color: '#333333', 56 | fontSize: 12, 57 | justifyContent: 'space-between', 58 | flex: 1, 59 | alignSelf: 'flex-end', 60 | textAlign: 'right' 61 | }, 62 | text: { 63 | color: '#333333', 64 | fontSize: 15, 65 | textAlign: 'left', 66 | justifyContent: 'flex-start' 67 | }, 68 | symbolen: { 69 | color: '#333333', 70 | fontSize: 12, 71 | marginLeft: 8, 72 | 73 | }, 74 | scrollview: { 75 | flex: 1, 76 | }, 77 | marginleft5: { 78 | marginTop: 5 79 | } 80 | }); 81 | 82 | export default class Row extends Component { 83 | 84 | 85 | // 构造 86 | constructor(props) { 87 | super(props); 88 | // 初始状态 89 | this.state = { 90 | symbolcn: "欧元", 91 | symbolen: "EURUSD", 92 | sell: "1.2333", 93 | buy: "1.354", 94 | sub: "1.233" 95 | }; 96 | } 97 | 98 | _onClick() { 99 | this.props.onClick(this.props.data); 100 | } 101 | 102 | render() { 103 | return ( 104 | 105 | 106 | 107 | {this.state.symbolcn} 108 | {this.state.symbolen} 109 | 110 | 111 | 112 | {this.state.sub} 113 | {this.state.buy} 114 | {this.state.sell} 115 | 116 | 117 | ); 118 | } 119 | }; 120 | 121 | export default class product extends Component { 122 | // 构造 123 | constructor(props) { 124 | super(props); 125 | // 初始状态 126 | this.state = { 127 | isRefreshing: false, 128 | loaded: 0, 129 | rowData: Array.from(new Array(20)).map( 130 | (val, i) => ({text: '初始行 ' + i})) 131 | }; 132 | } 133 | 134 | render() { 135 | const rows = this.state.rowData.map((row, ii) => { 136 | return ; 137 | }); 138 | return ( 139 | 143 | 152 | }> 153 | 154 | 155 | 名称 156 | 买涨价 157 | 买跌价 158 | 159 | {rows} 160 | 161 | 162 | 163 | ); 164 | } 165 | 166 | _onRefresh() { 167 | //this.state({ 168 | // isRefreshing: true 169 | // } 170 | //) 171 | setTimeout(() => { 172 | // 准备下拉刷新的5条数据 173 | const rowData = Array.from(new Array(5)) 174 | .map((val, i) => ({ 175 | text: '刷新行 ' + (+this.state.loaded + i) 176 | })) 177 | .concat(this.state.rowData); 178 | 179 | this.setState({ 180 | loaded: this.state.loaded + 5, 181 | isRefreshing: false, 182 | rowData: rowData, 183 | }); 184 | }, 5000); 185 | } 186 | } 187 | -------------------------------------------------------------------------------- /app/.deco/metadata/app/pages/Product.js.deco: -------------------------------------------------------------------------------- 1 | { 2 | "liveValues": [ 3 | { 4 | "range": { 5 | "from": { 6 | "line": 21, 7 | "ch": 21 8 | }, 9 | "to": { 10 | "line": 21, 11 | "ch": 40 12 | } 13 | }, 14 | "editWith": "colorPicker", 15 | "type": "string", 16 | "name": "BorderColor" 17 | }, 18 | { 19 | "range": { 20 | "from": { 21 | "line": 24, 22 | "ch": 25 23 | }, 24 | "to": { 25 | "line": 24, 26 | "ch": 34 27 | } 28 | }, 29 | "editWith": "colorPicker", 30 | "type": "string", 31 | "name": "BackgroundColor" 32 | }, 33 | { 34 | "range": { 35 | "from": { 36 | "line": 26, 37 | "ch": 23 38 | }, 39 | "to": { 40 | "line": 26, 41 | "ch": 31 42 | } 43 | }, 44 | "editWith": "dropdown", 45 | "dropdownOptions": "FlexDirection", 46 | "type": "string", 47 | "name": "FlexDirection" 48 | }, 49 | { 50 | "range": { 51 | "from": { 52 | "line": 36, 53 | "ch": 15 54 | }, 55 | "to": { 56 | "line": 36, 57 | "ch": 21 58 | } 59 | }, 60 | "editWith": "colorPicker", 61 | "type": "string", 62 | "name": "Color" 63 | }, 64 | { 65 | "range": { 66 | "from": { 67 | "line": 40, 68 | "ch": 15 69 | }, 70 | "to": { 71 | "line": 40, 72 | "ch": 21 73 | } 74 | }, 75 | "editWith": "colorPicker", 76 | "type": "string", 77 | "name": "Color" 78 | }, 79 | { 80 | "range": { 81 | "from": { 82 | "line": 79, 83 | "ch": 29 84 | }, 85 | "to": { 86 | "line": 79, 87 | "ch": 36 88 | } 89 | }, 90 | "editWith": "colorPicker", 91 | "type": "string", 92 | "name": "Color", 93 | "group": "TEXT" 94 | }, 95 | { 96 | "range": { 97 | "from": { 98 | "line": 80, 99 | "ch": 32 100 | }, 101 | "to": { 102 | "line": 80, 103 | "ch": 34 104 | } 105 | }, 106 | "type": "number", 107 | "name": "FontSize", 108 | "group": "TEXT" 109 | }, 110 | { 111 | "range": { 112 | "from": { 113 | "line": 81, 114 | "ch": 34 115 | }, 116 | "to": { 117 | "line": 81, 118 | "ch": 42 119 | } 120 | }, 121 | "editWith": "dropdown", 122 | "dropdownOptions": "FontWeight", 123 | "type": "string", 124 | "name": "FontWeight", 125 | "group": "TEXT" 126 | }, 127 | { 128 | "range": { 129 | "from": { 130 | "line": 82, 131 | "ch": 34 132 | }, 133 | "to": { 134 | "line": 82, 135 | "ch": 50 136 | } 137 | }, 138 | "editWith": "dropdown", 139 | "dropdownOptions": "FontFamily", 140 | "type": "string", 141 | "name": "FontFamily", 142 | "group": "TEXT" 143 | }, 144 | { 145 | "range": { 146 | "from": { 147 | "line": 106, 148 | "ch": 19 149 | }, 150 | "to": { 151 | "line": 106, 152 | "ch": 21 153 | } 154 | }, 155 | "type": "number", 156 | "name": "Padding", 157 | "group": "TOGGLE CONTAINER" 158 | }, 159 | { 160 | "range": { 161 | "from": { 162 | "line": 107, 163 | "ch": 15 164 | }, 165 | "to": { 166 | "line": 107, 167 | "ch": 27 168 | } 169 | }, 170 | "editWith": "dropdown", 171 | "dropdownOptions": [ 172 | "horizontal", 173 | "vertical" 174 | ], 175 | "type": "string", 176 | "name": "Orientation", 177 | "group": "TOGGLE CONTAINER" 178 | }, 179 | { 180 | "range": { 181 | "from": { 182 | "line": 108, 183 | "ch": 11 184 | }, 185 | "to": { 186 | "line": 108, 187 | "ch": 13 188 | } 189 | }, 190 | "type": "number", 191 | "name": "Spacing", 192 | "group": "TOGGLE CONTAINER" 193 | }, 194 | { 195 | "range": { 196 | "from": { 197 | "line": 114, 198 | "ch": 13 199 | }, 200 | "to": { 201 | "line": 114, 202 | "ch": 30 203 | } 204 | }, 205 | "editWith": "colorPicker", 206 | "type": "string", 207 | "name": "Color", 208 | "group": "TOGGLE ITEM" 209 | }, 210 | { 211 | "range": { 212 | "from": { 213 | "line": 115, 214 | "ch": 23 215 | }, 216 | "to": { 217 | "line": 115, 218 | "ch": 41 219 | } 220 | }, 221 | "editWith": "colorPicker", 222 | "type": "string", 223 | "name": "BackgroundColor", 224 | "group": "TOGGLE ITEM" 225 | }, 226 | { 227 | "range": { 228 | "from": { 229 | "line": 116, 230 | "ch": 19 231 | }, 232 | "to": { 233 | "line": 116, 234 | "ch": 40 235 | } 236 | }, 237 | "editWith": "colorPicker", 238 | "type": "string", 239 | "name": "BorderColor", 240 | "group": "TOGGLE ITEM" 241 | }, 242 | { 243 | "range": { 244 | "from": { 245 | "line": 117, 246 | "ch": 19 247 | }, 248 | "to": { 249 | "line": 117, 250 | "ch": 40 251 | } 252 | }, 253 | "editWith": "colorPicker", 254 | "type": "string", 255 | "name": "ActiveColor", 256 | "group": "TOGGLE ITEM" 257 | }, 258 | { 259 | "range": { 260 | "from": { 261 | "line": 118, 262 | "ch": 29 263 | }, 264 | "to": { 265 | "line": 118, 266 | "ch": 46 267 | } 268 | }, 269 | "editWith": "colorPicker", 270 | "type": "string", 271 | "name": "ActiveBackgroundColor", 272 | "group": "TOGGLE ITEM" 273 | }, 274 | { 275 | "range": { 276 | "from": { 277 | "line": 119, 278 | "ch": 20 279 | }, 280 | "to": { 281 | "line": 119, 282 | "ch": 21 283 | } 284 | }, 285 | "type": "number", 286 | "name": "BorderRadius", 287 | "group": "TOGGLE ITEM" 288 | } 289 | ] 290 | } -------------------------------------------------------------------------------- /app/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 | -------------------------------------------------------------------------------- /app/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.app" 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 project(':react-native-device-info') 130 | compile fileTree(dir: "libs", include: ["*.jar"]) 131 | compile "com.android.support:appcompat-v7:23.0.1" 132 | compile "com.facebook.react:react-native:+" // From node_modules 133 | } 134 | 135 | // Run this once to be able to run the application with BUCK 136 | // puts all compile dependencies into folder libs for BUCK to use 137 | task copyDownloadableDepsToLibs(type: Copy) { 138 | from configurations.compile 139 | into 'libs' 140 | } 141 | -------------------------------------------------------------------------------- /app/.vscode/typings/react/react-addons-test-utils.d.ts: -------------------------------------------------------------------------------- 1 | // Type definitions for React v0.14 (react-addons-test-utils) 2 | // Project: http://facebook.github.io/react/ 3 | // Definitions by: Asana , AssureSign , Microsoft 4 | // Definitions: https://github.com/borisyankov/DefinitelyTyped 5 | 6 | /// 7 | 8 | declare namespace __React { 9 | interface SyntheticEventData { 10 | altKey?: boolean; 11 | button?: number; 12 | buttons?: number; 13 | clientX?: number; 14 | clientY?: number; 15 | changedTouches?: TouchList; 16 | charCode?: boolean; 17 | clipboardData?: DataTransfer; 18 | ctrlKey?: boolean; 19 | deltaMode?: number; 20 | deltaX?: number; 21 | deltaY?: number; 22 | deltaZ?: number; 23 | detail?: number; 24 | getModifierState?(key: string): boolean; 25 | key?: string; 26 | keyCode?: number; 27 | locale?: string; 28 | location?: number; 29 | metaKey?: boolean; 30 | pageX?: number; 31 | pageY?: number; 32 | relatedTarget?: EventTarget; 33 | repeat?: boolean; 34 | screenX?: number; 35 | screenY?: number; 36 | shiftKey?: boolean; 37 | targetTouches?: TouchList; 38 | touches?: TouchList; 39 | view?: AbstractView; 40 | which?: number; 41 | } 42 | 43 | interface EventSimulator { 44 | (element: Element, eventData?: SyntheticEventData): void; 45 | (component: Component, eventData?: SyntheticEventData): void; 46 | } 47 | 48 | interface MockedComponentClass { 49 | new(): any; 50 | } 51 | 52 | class ShallowRenderer { 53 | getRenderOutput>(): E; 54 | getRenderOutput(): ReactElement; 55 | render(element: ReactElement, context?: any): void; 56 | unmount(): void; 57 | } 58 | 59 | namespace __Addons { 60 | namespace TestUtils { 61 | namespace Simulate { 62 | export var blur: EventSimulator; 63 | export var change: EventSimulator; 64 | export var click: EventSimulator; 65 | export var cut: EventSimulator; 66 | export var doubleClick: EventSimulator; 67 | export var drag: EventSimulator; 68 | export var dragEnd: EventSimulator; 69 | export var dragEnter: EventSimulator; 70 | export var dragExit: EventSimulator; 71 | export var dragLeave: EventSimulator; 72 | export var dragOver: EventSimulator; 73 | export var dragStart: EventSimulator; 74 | export var drop: EventSimulator; 75 | export var focus: EventSimulator; 76 | export var input: EventSimulator; 77 | export var keyDown: EventSimulator; 78 | export var keyPress: EventSimulator; 79 | export var keyUp: EventSimulator; 80 | export var mouseDown: EventSimulator; 81 | export var mouseEnter: EventSimulator; 82 | export var mouseLeave: EventSimulator; 83 | export var mouseMove: EventSimulator; 84 | export var mouseOut: EventSimulator; 85 | export var mouseOver: EventSimulator; 86 | export var mouseUp: EventSimulator; 87 | export var paste: EventSimulator; 88 | export var scroll: EventSimulator; 89 | export var submit: EventSimulator; 90 | export var touchCancel: EventSimulator; 91 | export var touchEnd: EventSimulator; 92 | export var touchMove: EventSimulator; 93 | export var touchStart: EventSimulator; 94 | export var wheel: EventSimulator; 95 | } 96 | 97 | export function renderIntoDocument( 98 | element: DOMElement): Element; 99 | export function renderIntoDocument

( 100 | element: ReactElement

): Component; 101 | export function renderIntoDocument>( 102 | element: ReactElement): C; 103 | 104 | export function mockComponent( 105 | mocked: MockedComponentClass, mockTagName?: string): typeof TestUtils; 106 | 107 | export function isElementOfType( 108 | element: ReactElement, type: ReactType): boolean; 109 | export function isDOMComponent(instance: ReactInstance): boolean; 110 | export function isCompositeComponent(instance: ReactInstance): boolean; 111 | export function isCompositeComponentWithType( 112 | instance: ReactInstance, 113 | type: ComponentClass): boolean; 114 | 115 | export function findAllInRenderedTree( 116 | root: Component, 117 | fn: (i: ReactInstance) => boolean): ReactInstance[]; 118 | 119 | export function scryRenderedDOMComponentsWithClass( 120 | root: Component, 121 | className: string): Element[]; 122 | export function findRenderedDOMComponentWithClass( 123 | root: Component, 124 | className: string): Element; 125 | 126 | export function scryRenderedDOMComponentsWithTag( 127 | root: Component, 128 | tagName: string): Element[]; 129 | export function findRenderedDOMComponentWithTag( 130 | root: Component, 131 | tagName: string): Element; 132 | 133 | export function scryRenderedComponentsWithType

( 134 | root: Component, 135 | type: ComponentClass

): Component[]; 136 | export function scryRenderedComponentsWithType>( 137 | root: Component, 138 | type: ComponentClass): C[]; 139 | 140 | export function findRenderedComponentWithType

( 141 | root: Component, 142 | type: ComponentClass

): Component; 143 | export function findRenderedComponentWithType>( 144 | root: Component, 145 | type: ComponentClass): C; 146 | 147 | export function createRenderer(): ShallowRenderer; 148 | } 149 | } 150 | } 151 | 152 | declare module "react-addons-test-utils" { 153 | import TestUtils = __React.__Addons.TestUtils; 154 | export = TestUtils; 155 | } 156 | -------------------------------------------------------------------------------- /image 组件.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 | Image, 11 | StyleSheet, 12 | Text, 13 | View, 14 | ListView, 15 | PixelRatio, 16 | TouchableOpacity, 17 | Navigator, 18 | ScrollView,TextInput,TouchableHighlight, 19 | } from 'react-native'; 20 | var onePT = 1 / PixelRatio.get(); //最小的像素密度 21 | const Header = require('./header'); 22 | var imgs = ['http://www.baidu.com/img/bd_logo1.png', 23 | 'http://c.hiphotos.baidu.com/image/h%3D200/sign=89c6743711ce36d3bd0484300af23a24/ae51f3deb48f8c54469d4dc23e292df5e1fe7f95.jpg', 24 | 'http://e.hiphotos.baidu.com/image/h%3D200/sign=5f6ab3f5d00735fa8ef049b9ae500f9f/29381f30e924b8995d7368d66a061d950b7bf695.jpg', 25 | 'http://g.hiphotos.baidu.com/image/pic/item/96dda144ad345982f4c3f47c08f431adcaef8496.jpg']; 26 | class AwesomeProject extends Component { 27 | 28 | render() { 29 | return ( 30 | 31 | 32 | 33 | ); 34 | } 35 | 36 | } 37 | class MyImage extends Component { 38 | // 构造 39 | constructor(props) { 40 | super(props); 41 | // 初始状态 42 | this.state = { 43 | count: 0, 44 | imgs: this.props.imgs 45 | }; 46 | } 47 | 48 | goPreview() { 49 | var count = this.state.count; 50 | count--; 51 | if (count > 0) { 52 | this.setState({ 53 | count: count 54 | 55 | }) 56 | 57 | } 58 | } 59 | 60 | goNext() { 61 | var count = this.state.count; 62 | count++; 63 | console.log(this.state.imgs.size) 64 | if (count < this.state.imgs.size) { 65 | this.setState({ 66 | count: count 67 | 68 | }) 69 | } 70 | } 71 | 72 | render() { 73 | return ( 74 | 75 | 78 | 79 | 80 | 81 | 82 | 83 | 上一张 84 | 85 | 86 | 下一张 87 | 88 | 89 | ); 90 | } 91 | } 92 | class HightComponet extends Component { 93 | show(val) { 94 | alert(val); 95 | } 96 | 97 | render() { 98 | return ( 99 | 100 | 101 | 欢迎学习 102 | 103 | 104 | 欢迎学习 105 | 106 | 107 | 欢迎学习 108 | 109 | 110 | ) 111 | } 112 | 113 | } 114 | class SearchText extends Component { 115 | 116 | 117 | // 构造 118 | constructor(props) { 119 | super(props); 120 | // 初始状态 121 | this.state = { 122 | show: false, 123 | value: null 124 | }; 125 | } 126 | 127 | hide(val) { 128 | this.setState({ 129 | show: false, 130 | value: val 131 | }) 132 | } 133 | 134 | getValue(text) { 135 | this.setState({ 136 | show: true, 137 | value: text 138 | }); 139 | } 140 | 141 | render() { 142 | return ( 143 | 144 | 145 | 151 | 152 | 153 | 154 | 搜索 155 | 156 | 157 | 158 | 159 | { 160 | this.state.show ? 161 | 162 | 164 | {this.state.value}加我 QQ 165 | 166 | 168 | {this.state.value}加我 QQ 169 | 170 | 172 | {this.state.value}加我 QQ 173 | 174 | 176 | {this.state.value}加我 QQ 177 | 178 | : null 179 | } 180 | 181 | 182 | ); 183 | } 184 | } 185 | 186 | class Detail extends Component { 187 | // 构造 188 | constructor(props) { 189 | super(props); 190 | // 初始状态 191 | this.state = {}; 192 | } 193 | 194 | _pressButton() { 195 | const {navigator }= this.props; 196 | if (navigator) { 197 | navigator.pop(); 198 | } 199 | 200 | } 201 | 202 | render() { 203 | return ( 204 | 点我可以弹回去 205 | ); 206 | } 207 | } 208 | const styles = StyleSheet.create({ 209 | container: { 210 | marginTop: 200, 211 | marginLeft: 5, 212 | marginRight: 5, 213 | height: 84, 214 | flexDirection: 'row', 215 | borderRadius: 5, 216 | padding: 2, 217 | backgroundColor: '#FF0067', 218 | 219 | }, 220 | list_item: { 221 | height: 40, 222 | marginLeft: 10, 223 | marginRight: 10, 224 | borderBottomWidth: 1, 225 | borderBottomColor: "#ddd", 226 | justifyContent: 'center', 227 | }, 228 | list_item_font: { 229 | fontSize: 16, 230 | }, 231 | new_title: { 232 | fontSize: 20, 233 | fontWeight: 'bold', 234 | color: '#CD1D1C', 235 | marginLeft: 10, 236 | marginTop: 15 237 | }, 238 | news_item: { 239 | marginLeft: 10, 240 | marginRight: 10, 241 | fontSize: 15, 242 | lineHeight: 40 243 | }, 244 | flex: { 245 | flex: 1 246 | }, 247 | flexDirection: { 248 | flexDirection: 'row' 249 | }, 250 | topStatus: { 251 | marginTop: 25 252 | }, 253 | input: { 254 | height: 45, 255 | borderColor: 'red', 256 | borderWidth: 1, 257 | marginLeft: 10, 258 | paddingLeft: 10, 259 | borderRadius: 5 260 | }, 261 | btn: { 262 | width: 45, 263 | marginLeft: -5, 264 | marginRight: 5, 265 | backgroundColor: '#23BEFF', 266 | height: 50, 267 | justifyContent: 'center', 268 | alignItems: 'center' 269 | }, 270 | search: { 271 | color: '#fff', 272 | fontSize: 15, 273 | fontWeight: 'bold' 274 | }, 275 | topStatus: {}, 276 | flexDirection: { 277 | flexDirection: 'row' 278 | }, 279 | btns: { 280 | flexDirection: 'row', 281 | marginTop: 20, 282 | justifyContent: 'center' 283 | }, 284 | img: { 285 | height: 150, 286 | width: 300, 287 | borderRadius:5, 288 | resizeMode : 'cover' 289 | 290 | }, 291 | image: { 292 | borderWidth: 1, 293 | height: 150, 294 | width: 300, 295 | justifyContent:'center', 296 | marginLeft:30, 297 | marginRight:30 298 | } 299 | 300 | 301 | }); 302 | 303 | AppRegistry.registerComponent('AwesomeProject', () => AwesomeProject); 304 | -------------------------------------------------------------------------------- /Android原生项目移植 ReactNative.md: -------------------------------------------------------------------------------- 1 | # 1.在原有 Android 项目中嵌入 ReactNative 模块 2 | 3 | >ReactNative的发展已经进入了很多开发者视野,作为一名原生开发者更是对 RN 充满了无限的好奇和期待, 4 | 本节将详细讲述如何将一个原生的 Android App 项目嵌入最新的 RN 模块 5 | 6 | 7 | 8 | ## 1. 准备开始 9 | 10 | 1. 一个已有的 Android 原生项目 11 | 2. 已经配置好的原生 Android 开发环境和 node.js已经 RN 环境 12 | 3. 改造之后的流程图 13 | ![图片](http://7xs9qs.com1.z0.glb.clouddn.com/01.png?imageView2/1/w/600/h/400/interlace/0/q/96|watermark/2/text/aHR0cHM6Ly9naXRodWIuY29tL0FsbGVuQ29kZXI=/font/5a6L5L2T/fontsize/500/fill/I0Y3RjdGNw==/dissolve/100/gravity/SouthEast/dx/10/dy/10) 14 | 15 | ## 2.开始改造 16 | 1. *在原生 Android 项目的在app/build.gradle文件中,添加React Native依赖:* 17 | 18 | 19 | ``` 20 | compile"com.facebook.react:react-native:+ 21 | ``` 22 | 23 | 2. *加入.so 库* 24 | 25 | ``` 26 | ndk { 27 | abiFilters "armeabi-v7a", "x86" 28 | } 29 | ``` 30 | 31 | 3. *在工程目录下找到工程的 build.gradle文件中,添加 maven依赖* 32 | 33 | ``` 34 | allprojects { 35 | repositories { 36 | jcenter() 37 | maven { 38 | // All of React Native (JS, Android binaries) is installed from npm 39 | url "$rootDir/node_modules/react-native/android" 40 | } 41 | } 42 | } 43 | ``` 44 | 45 | 3. 在 app 目录里添加需要的权限 46 | ``` 47 | 48 | /**设置调试 的权限**/ 49 | 50 | ``` 51 | 4.添加 FaceBook 的 ReactNative 调试的 activity 52 | ``` 53 | 54 | ``` 55 | # 2. 编写原生的 ReactNative 模块 ,废话不多说,直接上代码 56 | 57 | ```java 58 | package com.allen.reactapp; 59 | 60 | import android.app.Activity; 61 | import android.os.Bundle; 62 | 63 | import com.facebook.react.LifecycleState; 64 | import com.facebook.react.ReactInstanceManager; 65 | import com.facebook.react.ReactRootView; 66 | import com.facebook.react.modules.core.DefaultHardwareBackBtnHandler; 67 | import com.facebook.react.shell.MainReactPackage; 68 | 69 | /** 70 | * 作者: allen on 16/7/31. 71 | */ 72 | public class MyReactActivity extends Activity implements DefaultHardwareBackBtnHandler { 73 | private ReactRootView mReactRootView; 74 | private ReactInstanceManager mReactInstanceManager; 75 | 76 | @Override 77 | protected void onCreate(Bundle savedInstanceState) { 78 | super.onCreate(savedInstanceState); 79 | 80 | mReactRootView = new ReactRootView(this); 81 | mReactInstanceManager = ReactInstanceManager.builder() 82 | .setApplication(getApplication()) 83 | .setBundleAssetName("index.android.bundle") 84 | .setJSMainModuleName("index.android") 85 | .addPackage(new MainReactPackage()) 86 | /** 87 | * http://stackoverflow.com/questions/37951246/react-native-cannot-find-development-server-integrating-existing-android-app 88 | * 调试模式下,建议直接写成 true 吧,我就因为这个错误,调了两天原因 89 | */ 90 | // .setUseDeveloperSupport(BuildConfig.DEBUG) 91 | .setUseDeveloperSupport(true) 92 | .setInitialLifecycleState(LifecycleState.RESUMED) 93 | .build(); 94 | mReactRootView.startReactApplication(mReactInstanceManager, "myreactactivity", null); 95 | 96 | setContentView(mReactRootView); 97 | } 98 | 99 | @Override 100 | public void invokeDefaultOnBackPressed() { 101 | super.onBackPressed(); 102 | } 103 | @Override 104 | protected void onPause() { 105 | super.onPause(); 106 | 107 | if (mReactInstanceManager != null) { 108 | mReactInstanceManager.onHostPause(); 109 | } 110 | } 111 | 112 | @Override 113 | protected void onResume() { 114 | super.onResume(); 115 | 116 | if (mReactInstanceManager != null) { 117 | mReactInstanceManager.onHostResume(this, this); 118 | } 119 | } 120 | 121 | @Override 122 | public void onBackPressed() { 123 | if (mReactInstanceManager != null) { 124 | mReactInstanceManager.onBackPressed(); 125 | } else { 126 | super.onBackPressed(); 127 | } 128 | } 129 | 130 | 131 | } 132 | 133 | 134 | 135 | ``` 136 | 137 | ## 到此为止我们的Android项目Activity和配置文件以及完成了最基本的配置方法了。 138 | 139 | 140 | ======================================================================== 141 | 142 | ======================================================================== 143 | # 3. 下面配置工程项目的 RN开发环境 144 | 1. 先后顺序依次执行一下命令 145 | ``` 146 | $ npm init 147 | ``` 148 | >该命令会创建一个package.json文件,并且提示我们输入一些信息,默认不输入即可,不过name必须要为全英文小写哦, 149 | 150 | ##然后再依次去执行以下命令 151 | ``` 152 | $ npm install --save react 153 | $ npm install --save react-native 154 | $ curl -o .flowconfig https://raw.githubusercontent.com/facebook/react-native/master/.flowconfig 155 | ``` 156 | 157 | 创建完成后,去工程目录下修改 *package.json* 158 | 在scripts标签那边添加如下代码: 159 | ``` 160 | "start":"node_modules/react-native/packager/packager.sh" 161 | ``` 162 | ![package_json](http://7xs9qs.com1.z0.glb.clouddn.com/package_json.png) 163 | # 3. 工程目录下创建 index.android.js 由于是测试代码直接 Copy FaceBook 的源码 164 | ``` 165 | 166 | 167 | /** 168 | * Sample React Native App 169 | * https://github.com/facebook/react-native 170 | * @flow 171 | */ 172 | 173 | import React, { Component } from 'react'; 174 | import { 175 | AppRegistry, 176 | StyleSheet, 177 | Text, 178 | View 179 | } from 'react-native'; 180 | 181 | class AwesomeProject extends Component { 182 | render() { 183 | return ( 184 | 185 | 186 | Welcome to React Native! 187 | 188 | 189 | 我是 原生项目嵌入的 ReactNative 190 | 191 | 192 | Press Cmd+R to reload,{'\n'} 193 | Cmd+D or shake for dev menu 194 | 195 | 196 | ); 197 | } 198 | } 199 | 200 | const styles = StyleSheet.create({ 201 | container: { 202 | flex: 1, 203 | justifyContent: 'center', 204 | alignItems: 'center', 205 | backgroundColor: '#F5FCFF', 206 | }, 207 | welcome: { 208 | fontSize: 20, 209 | textAlign: 'center', 210 | margin: 10, 211 | }, 212 | instructions: { 213 | textAlign: 'center', 214 | color: '#333333', 215 | marginBottom: 5, 216 | }, 217 | }); 218 | 219 | AppRegistry.registerComponent('myreactactivity', () => AwesomeProject); 220 | 221 | 222 | ``` 223 | 224 | > 注意:此处需要修改注册的入口 保持一致,我的是 *my_react_activity* 225 | 226 | # 4.检查以上所有步骤,有无遗漏,如果正常,接下来就可以顺利的运行你的混合 APP 了,如果还不行,你需要检查你的姿势是否正确? 227 | 228 | 运行你的 APP 229 | 230 | 1. 在项目的工程路径运行以下命令来启动你的开发服务器 231 | 232 | ``` 233 | react-native start 234 | ``` 235 | 或者执行 236 | 237 | ``` 238 | npm start 239 | ``` 240 | 2. android studio 调试你的 APP 241 | 3. 演示效果图 242 | 243 | 244 | 245 | =================== 246 | 247 | 248 | 249 | ## 错误解决: 250 | 251 | ``` 252 | Process: com.allen.reactapp, PID: 20469 253 | java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.RuntimeException: Could not connect to development server. 254 | Try the following to fix the issue: 255 | Ensure that the packager server is running 256 | Ensure that your device/emulator is connected to your machine and has USB debugging enabled - run 'adb devices' to see a list of connected devices 257 | If you're on a physical device connected to the same machine, run 'adb reverse tcp:8081 tcp:8081' to forward requests from your device 258 | If your device is on the same Wi-Fi network, set 'Debug server host & port for device' in 'Dev settings' to y 259 | at com.facebook.react.ReactInstanceManagerImpl.createReactContext(ReactInstanceManagerImpl.java:911) 260 | at com.facebook.react.ReactInstanceManagerImpl.access$700(ReactInstanceManagerImpl.java:100) 261 | at com.facebook.react.ReactInstanceManagerImpl$ReactContextInitAsyncTask.doInBackground(ReactInstanceManagerImpl.java:197) 262 | at com.facebook.react.ReactInstanceManagerImpl$ReactContextInitAsyncTask.doInBackground(ReactInstanceManagerImpl.java:180) 263 | at android.os.AsyncTask$2.call(AsyncTask.java:295) 264 | at java.util.concurrent.FutureTask.run(FutureTask.java:237) 265 | at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234) 266 | at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) 267 | at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) 268 | at java.lang.Thread.run(Thread.java:818) 269 | Caused by: java.util.concurrent.ExecutionException: java.lang.RuntimeException: Could not connect to development server. 270 | Try the following to fix the issue: 271 | Ensure that the packager server is running 272 | Ensure that your device/emulator is connected to your machine and has USB debugging enabled - run 'adb devices' to see a list of connected devices 273 | If you're on a physical device connected to the same machine, run 'adb reverse tcp:8081 tcp:8081' to forward requests from your device 274 | If your device is on the same Wi-Fi network, set 'Debug server host & port for device' in 'Dev settings' to y 275 | at com.facebook.react.common.futures.SimpleSettableFuture.get(SimpleSettableFuture.java:68) 276 | at com.facebook.react.ReactInstanceManagerImpl.createReactContext(ReactInstanceManagerImpl.java:882) 277 | ... 9 more 278 | Caused by: java.lang.RuntimeException: Could not connect to development server. 279 | Try the following to fix the issue: 280 | Ensure that the packager server is running 281 | Ensure that your device/emulator is connected to your machine and has USB debugging enabled - run 'adb devices' to see a list of connected devices 282 | ``` 283 | > 解决办法: 284 | > .setUseDeveloperSupport(true) *调试模式下,建议直接写成 true 吧,* 285 | 286 | 签名打包混合 APP 287 | 1. 将 js 文件存入 bundle 一起打包 288 | 执行命令: 289 | ``` 290 | curl -k "http://localhost:8081/index.android.bundle"> reactapp/src/main/assets/index.android.bundle 291 | ``` 292 | 执行完命令成功,在 assets目录应该看到 index.android.bundle文件 293 | 294 | Android studio 执行打包过程,作为一名 Android 老司机我就不再具体描述了 295 | > [原 Android 移植 React Native 项目地址](https://github.com/AllenCoder/AndroidDevCoder/tree/master/reactapp) -------------------------------------------------------------------------------- /app/ios/app.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | /* Begin PBXBuildFile section */ 9 | 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */; }; 10 | 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */; }; 11 | 00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */; }; 12 | 00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */; }; 13 | 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */; }; 14 | 00E356F31AD99517003FC87E /* appTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* appTests.m */; }; 15 | 133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 78C398B91ACF4ADC00677621 /* libRCTLinking.a */; }; 16 | 139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */; }; 17 | 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */; }; 18 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; }; 19 | 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; }; 20 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 21 | 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; 22 | 140ED2AC1D01E1AD002B40FF /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; }; 23 | 146834051AC3E58100842450 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; }; 24 | 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; }; 25 | 9F53BADF1D3BD37200CA2CB2 /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB61A68108700A75B9A /* Info.plist */; }; 26 | A57D426D200E40B8AD794162 /* libRNDeviceInfo.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1163C0F728BC4697AE7A8B3F /* libRNDeviceInfo.a */; }; 27 | /* End PBXBuildFile section */ 28 | 29 | /* Begin PBXContainerItemProxy section */ 30 | 00C302AB1ABCB8CE00DB3ED1 /* PBXContainerItemProxy */ = { 31 | isa = PBXContainerItemProxy; 32 | containerPortal = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */; 33 | proxyType = 2; 34 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 35 | remoteInfo = RCTActionSheet; 36 | }; 37 | 00C302B91ABCB90400DB3ED1 /* PBXContainerItemProxy */ = { 38 | isa = PBXContainerItemProxy; 39 | containerPortal = 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */; 40 | proxyType = 2; 41 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 42 | remoteInfo = RCTGeolocation; 43 | }; 44 | 00C302BF1ABCB91800DB3ED1 /* PBXContainerItemProxy */ = { 45 | isa = PBXContainerItemProxy; 46 | containerPortal = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */; 47 | proxyType = 2; 48 | remoteGlobalIDString = 58B5115D1A9E6B3D00147676; 49 | remoteInfo = RCTImage; 50 | }; 51 | 00C302DB1ABCB9D200DB3ED1 /* PBXContainerItemProxy */ = { 52 | isa = PBXContainerItemProxy; 53 | containerPortal = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */; 54 | proxyType = 2; 55 | remoteGlobalIDString = 58B511DB1A9E6C8500147676; 56 | remoteInfo = RCTNetwork; 57 | }; 58 | 00C302E31ABCB9EE00DB3ED1 /* PBXContainerItemProxy */ = { 59 | isa = PBXContainerItemProxy; 60 | containerPortal = 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */; 61 | proxyType = 2; 62 | remoteGlobalIDString = 832C81801AAF6DEF007FA2F7; 63 | remoteInfo = RCTVibration; 64 | }; 65 | 00E356F41AD99517003FC87E /* PBXContainerItemProxy */ = { 66 | isa = PBXContainerItemProxy; 67 | containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */; 68 | proxyType = 1; 69 | remoteGlobalIDString = 13B07F861A680F5B00A75B9A; 70 | remoteInfo = app; 71 | }; 72 | 139105C01AF99BAD00B5F7CC /* PBXContainerItemProxy */ = { 73 | isa = PBXContainerItemProxy; 74 | containerPortal = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */; 75 | proxyType = 2; 76 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 77 | remoteInfo = RCTSettings; 78 | }; 79 | 139FDEF31B06529B00C62182 /* PBXContainerItemProxy */ = { 80 | isa = PBXContainerItemProxy; 81 | containerPortal = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */; 82 | proxyType = 2; 83 | remoteGlobalIDString = 3C86DF461ADF2C930047B81A; 84 | remoteInfo = RCTWebSocket; 85 | }; 86 | 146834031AC3E56700842450 /* PBXContainerItemProxy */ = { 87 | isa = PBXContainerItemProxy; 88 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 89 | proxyType = 2; 90 | remoteGlobalIDString = 83CBBA2E1A601D0E00E9B192; 91 | remoteInfo = React; 92 | }; 93 | 78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */ = { 94 | isa = PBXContainerItemProxy; 95 | containerPortal = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */; 96 | proxyType = 2; 97 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 98 | remoteInfo = RCTLinking; 99 | }; 100 | 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */ = { 101 | isa = PBXContainerItemProxy; 102 | containerPortal = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */; 103 | proxyType = 2; 104 | remoteGlobalIDString = 58B5119B1A9E6C1200147676; 105 | remoteInfo = RCTText; 106 | }; 107 | /* End PBXContainerItemProxy section */ 108 | 109 | /* Begin PBXFileReference section */ 110 | 008F07F21AC5B25A0029DE68 /* main.jsbundle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = main.jsbundle; sourceTree = ""; }; 111 | 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTActionSheet.xcodeproj; path = "../node_modules/react-native/Libraries/ActionSheetIOS/RCTActionSheet.xcodeproj"; sourceTree = ""; }; 112 | 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTGeolocation.xcodeproj; path = "../node_modules/react-native/Libraries/Geolocation/RCTGeolocation.xcodeproj"; sourceTree = ""; }; 113 | 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTImage.xcodeproj; path = "../node_modules/react-native/Libraries/Image/RCTImage.xcodeproj"; sourceTree = ""; }; 114 | 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTNetwork.xcodeproj; path = "../node_modules/react-native/Libraries/Network/RCTNetwork.xcodeproj"; sourceTree = ""; }; 115 | 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTVibration.xcodeproj; path = "../node_modules/react-native/Libraries/Vibration/RCTVibration.xcodeproj"; sourceTree = ""; }; 116 | 00E356EE1AD99517003FC87E /* appTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = appTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 117 | 00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 118 | 00E356F21AD99517003FC87E /* appTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = appTests.m; sourceTree = ""; }; 119 | 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTSettings.xcodeproj; path = "../node_modules/react-native/Libraries/Settings/RCTSettings.xcodeproj"; sourceTree = ""; }; 120 | 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTWebSocket.xcodeproj; path = "../node_modules/react-native/Libraries/WebSocket/RCTWebSocket.xcodeproj"; sourceTree = ""; }; 121 | 13B07F961A680F5B00A75B9A /* app.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = app.app; sourceTree = BUILT_PRODUCTS_DIR; }; 122 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = app/AppDelegate.h; sourceTree = ""; }; 123 | 13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = app/AppDelegate.m; sourceTree = ""; }; 124 | 13B07FB21A68108700A75B9A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 125 | 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = app/Images.xcassets; sourceTree = ""; }; 126 | 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = app/Info.plist; sourceTree = ""; }; 127 | 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = app/main.m; sourceTree = ""; }; 128 | 146833FF1AC3E56700842450 /* React.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = React.xcodeproj; path = "../node_modules/react-native/React/React.xcodeproj"; sourceTree = ""; }; 129 | 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = "../node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj"; sourceTree = ""; }; 130 | 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "../node_modules/react-native/Libraries/Text/RCTText.xcodeproj"; sourceTree = ""; }; 131 | 11C18AB188AB4B729AEB052B /* RNDeviceInfo.xcodeproj */ = {isa = PBXFileReference; name = "RNDeviceInfo.xcodeproj"; path = "../node_modules/react-native-device-info/RNDeviceInfo.xcodeproj"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = wrapper.pb-project; explicitFileType = undefined; includeInIndex = 0; }; 132 | 1163C0F728BC4697AE7A8B3F /* libRNDeviceInfo.a */ = {isa = PBXFileReference; name = "libRNDeviceInfo.a"; path = "libRNDeviceInfo.a"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = archive.ar; explicitFileType = undefined; includeInIndex = 0; }; 133 | /* End PBXFileReference section */ 134 | 135 | /* Begin PBXFrameworksBuildPhase section */ 136 | 00E356EB1AD99517003FC87E /* Frameworks */ = { 137 | isa = PBXFrameworksBuildPhase; 138 | buildActionMask = 2147483647; 139 | files = ( 140 | 140ED2AC1D01E1AD002B40FF /* libReact.a in Frameworks */, 141 | ); 142 | runOnlyForDeploymentPostprocessing = 0; 143 | }; 144 | 13B07F8C1A680F5B00A75B9A /* Frameworks */ = { 145 | isa = PBXFrameworksBuildPhase; 146 | buildActionMask = 2147483647; 147 | files = ( 148 | 146834051AC3E58100842450 /* libReact.a in Frameworks */, 149 | 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */, 150 | 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */, 151 | 00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */, 152 | 133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */, 153 | 00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */, 154 | 139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */, 155 | 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */, 156 | 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */, 157 | 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */, 158 | A57D426D200E40B8AD794162 /* libRNDeviceInfo.a in Frameworks */, 159 | ); 160 | runOnlyForDeploymentPostprocessing = 0; 161 | }; 162 | /* End PBXFrameworksBuildPhase section */ 163 | 164 | /* Begin PBXGroup section */ 165 | 00C302A81ABCB8CE00DB3ED1 /* Products */ = { 166 | isa = PBXGroup; 167 | children = ( 168 | 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */, 169 | ); 170 | name = Products; 171 | sourceTree = ""; 172 | }; 173 | 00C302B61ABCB90400DB3ED1 /* Products */ = { 174 | isa = PBXGroup; 175 | children = ( 176 | 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */, 177 | ); 178 | name = Products; 179 | sourceTree = ""; 180 | }; 181 | 00C302BC1ABCB91800DB3ED1 /* Products */ = { 182 | isa = PBXGroup; 183 | children = ( 184 | 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */, 185 | ); 186 | name = Products; 187 | sourceTree = ""; 188 | }; 189 | 00C302D41ABCB9D200DB3ED1 /* Products */ = { 190 | isa = PBXGroup; 191 | children = ( 192 | 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */, 193 | ); 194 | name = Products; 195 | sourceTree = ""; 196 | }; 197 | 00C302E01ABCB9EE00DB3ED1 /* Products */ = { 198 | isa = PBXGroup; 199 | children = ( 200 | 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */, 201 | ); 202 | name = Products; 203 | sourceTree = ""; 204 | }; 205 | 00E356EF1AD99517003FC87E /* appTests */ = { 206 | isa = PBXGroup; 207 | children = ( 208 | 00E356F21AD99517003FC87E /* appTests.m */, 209 | 00E356F01AD99517003FC87E /* Supporting Files */, 210 | ); 211 | path = appTests; 212 | sourceTree = ""; 213 | }; 214 | 00E356F01AD99517003FC87E /* Supporting Files */ = { 215 | isa = PBXGroup; 216 | children = ( 217 | 00E356F11AD99517003FC87E /* Info.plist */, 218 | ); 219 | name = "Supporting Files"; 220 | sourceTree = ""; 221 | }; 222 | 139105B71AF99BAD00B5F7CC /* Products */ = { 223 | isa = PBXGroup; 224 | children = ( 225 | 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */, 226 | ); 227 | name = Products; 228 | sourceTree = ""; 229 | }; 230 | 139FDEE71B06529A00C62182 /* Products */ = { 231 | isa = PBXGroup; 232 | children = ( 233 | 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */, 234 | ); 235 | name = Products; 236 | sourceTree = ""; 237 | }; 238 | 13B07FAE1A68108700A75B9A /* app */ = { 239 | isa = PBXGroup; 240 | children = ( 241 | 008F07F21AC5B25A0029DE68 /* main.jsbundle */, 242 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */, 243 | 13B07FB01A68108700A75B9A /* AppDelegate.m */, 244 | 13B07FB51A68108700A75B9A /* Images.xcassets */, 245 | 13B07FB61A68108700A75B9A /* Info.plist */, 246 | 13B07FB11A68108700A75B9A /* LaunchScreen.xib */, 247 | 13B07FB71A68108700A75B9A /* main.m */, 248 | ); 249 | name = app; 250 | sourceTree = ""; 251 | }; 252 | 146834001AC3E56700842450 /* Products */ = { 253 | isa = PBXGroup; 254 | children = ( 255 | 146834041AC3E56700842450 /* libReact.a */, 256 | ); 257 | name = Products; 258 | sourceTree = ""; 259 | }; 260 | 78C398B11ACF4ADC00677621 /* Products */ = { 261 | isa = PBXGroup; 262 | children = ( 263 | 78C398B91ACF4ADC00677621 /* libRCTLinking.a */, 264 | ); 265 | name = Products; 266 | sourceTree = ""; 267 | }; 268 | 832341AE1AAA6A7D00B99B32 /* Libraries */ = { 269 | isa = PBXGroup; 270 | children = ( 271 | 146833FF1AC3E56700842450 /* React.xcodeproj */, 272 | 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */, 273 | 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */, 274 | 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */, 275 | 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */, 276 | 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */, 277 | 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */, 278 | 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */, 279 | 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */, 280 | 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */, 281 | 11C18AB188AB4B729AEB052B /* RNDeviceInfo.xcodeproj */, 282 | ); 283 | name = Libraries; 284 | sourceTree = ""; 285 | }; 286 | 832341B11AAA6A8300B99B32 /* Products */ = { 287 | isa = PBXGroup; 288 | children = ( 289 | 832341B51AAA6A8300B99B32 /* libRCTText.a */, 290 | ); 291 | name = Products; 292 | sourceTree = ""; 293 | }; 294 | 83CBB9F61A601CBA00E9B192 = { 295 | isa = PBXGroup; 296 | children = ( 297 | 13B07FAE1A68108700A75B9A /* app */, 298 | 832341AE1AAA6A7D00B99B32 /* Libraries */, 299 | 00E356EF1AD99517003FC87E /* appTests */, 300 | 83CBBA001A601CBA00E9B192 /* Products */, 301 | ); 302 | indentWidth = 2; 303 | sourceTree = ""; 304 | tabWidth = 2; 305 | }; 306 | 83CBBA001A601CBA00E9B192 /* Products */ = { 307 | isa = PBXGroup; 308 | children = ( 309 | 13B07F961A680F5B00A75B9A /* app.app */, 310 | 00E356EE1AD99517003FC87E /* appTests.xctest */, 311 | ); 312 | name = Products; 313 | sourceTree = ""; 314 | }; 315 | /* End PBXGroup section */ 316 | 317 | /* Begin PBXNativeTarget section */ 318 | 00E356ED1AD99517003FC87E /* appTests */ = { 319 | isa = PBXNativeTarget; 320 | buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "appTests" */; 321 | buildPhases = ( 322 | 00E356EA1AD99517003FC87E /* Sources */, 323 | 00E356EB1AD99517003FC87E /* Frameworks */, 324 | 00E356EC1AD99517003FC87E /* Resources */, 325 | ); 326 | buildRules = ( 327 | ); 328 | dependencies = ( 329 | 00E356F51AD99517003FC87E /* PBXTargetDependency */, 330 | ); 331 | name = appTests; 332 | productName = appTests; 333 | productReference = 00E356EE1AD99517003FC87E /* appTests.xctest */; 334 | productType = "com.apple.product-type.bundle.unit-test"; 335 | }; 336 | 13B07F861A680F5B00A75B9A /* app */ = { 337 | isa = PBXNativeTarget; 338 | buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "app" */; 339 | buildPhases = ( 340 | 13B07F871A680F5B00A75B9A /* Sources */, 341 | 13B07F8C1A680F5B00A75B9A /* Frameworks */, 342 | 13B07F8E1A680F5B00A75B9A /* Resources */, 343 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */, 344 | ); 345 | buildRules = ( 346 | ); 347 | dependencies = ( 348 | ); 349 | name = app; 350 | productName = "Hello World"; 351 | productReference = 13B07F961A680F5B00A75B9A /* app.app */; 352 | productType = "com.apple.product-type.application"; 353 | }; 354 | /* End PBXNativeTarget section */ 355 | 356 | /* Begin PBXProject section */ 357 | 83CBB9F71A601CBA00E9B192 /* Project object */ = { 358 | isa = PBXProject; 359 | attributes = { 360 | LastUpgradeCheck = 610; 361 | ORGANIZATIONNAME = Facebook; 362 | TargetAttributes = { 363 | 00E356ED1AD99517003FC87E = { 364 | CreatedOnToolsVersion = 6.2; 365 | TestTargetID = 13B07F861A680F5B00A75B9A; 366 | }; 367 | }; 368 | }; 369 | buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "app" */; 370 | compatibilityVersion = "Xcode 3.2"; 371 | developmentRegion = English; 372 | hasScannedForEncodings = 0; 373 | knownRegions = ( 374 | en, 375 | Base, 376 | ); 377 | mainGroup = 83CBB9F61A601CBA00E9B192; 378 | productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */; 379 | projectDirPath = ""; 380 | projectReferences = ( 381 | { 382 | ProductGroup = 00C302A81ABCB8CE00DB3ED1 /* Products */; 383 | ProjectRef = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */; 384 | }, 385 | { 386 | ProductGroup = 00C302B61ABCB90400DB3ED1 /* Products */; 387 | ProjectRef = 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */; 388 | }, 389 | { 390 | ProductGroup = 00C302BC1ABCB91800DB3ED1 /* Products */; 391 | ProjectRef = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */; 392 | }, 393 | { 394 | ProductGroup = 78C398B11ACF4ADC00677621 /* Products */; 395 | ProjectRef = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */; 396 | }, 397 | { 398 | ProductGroup = 00C302D41ABCB9D200DB3ED1 /* Products */; 399 | ProjectRef = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */; 400 | }, 401 | { 402 | ProductGroup = 139105B71AF99BAD00B5F7CC /* Products */; 403 | ProjectRef = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */; 404 | }, 405 | { 406 | ProductGroup = 832341B11AAA6A8300B99B32 /* Products */; 407 | ProjectRef = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */; 408 | }, 409 | { 410 | ProductGroup = 00C302E01ABCB9EE00DB3ED1 /* Products */; 411 | ProjectRef = 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */; 412 | }, 413 | { 414 | ProductGroup = 139FDEE71B06529A00C62182 /* Products */; 415 | ProjectRef = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */; 416 | }, 417 | { 418 | ProductGroup = 146834001AC3E56700842450 /* Products */; 419 | ProjectRef = 146833FF1AC3E56700842450 /* React.xcodeproj */; 420 | }, 421 | ); 422 | projectRoot = ""; 423 | targets = ( 424 | 13B07F861A680F5B00A75B9A /* app */, 425 | 00E356ED1AD99517003FC87E /* appTests */, 426 | ); 427 | }; 428 | /* End PBXProject section */ 429 | 430 | /* Begin PBXReferenceProxy section */ 431 | 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */ = { 432 | isa = PBXReferenceProxy; 433 | fileType = archive.ar; 434 | path = libRCTActionSheet.a; 435 | remoteRef = 00C302AB1ABCB8CE00DB3ED1 /* PBXContainerItemProxy */; 436 | sourceTree = BUILT_PRODUCTS_DIR; 437 | }; 438 | 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */ = { 439 | isa = PBXReferenceProxy; 440 | fileType = archive.ar; 441 | path = libRCTGeolocation.a; 442 | remoteRef = 00C302B91ABCB90400DB3ED1 /* PBXContainerItemProxy */; 443 | sourceTree = BUILT_PRODUCTS_DIR; 444 | }; 445 | 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */ = { 446 | isa = PBXReferenceProxy; 447 | fileType = archive.ar; 448 | path = libRCTImage.a; 449 | remoteRef = 00C302BF1ABCB91800DB3ED1 /* PBXContainerItemProxy */; 450 | sourceTree = BUILT_PRODUCTS_DIR; 451 | }; 452 | 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */ = { 453 | isa = PBXReferenceProxy; 454 | fileType = archive.ar; 455 | path = libRCTNetwork.a; 456 | remoteRef = 00C302DB1ABCB9D200DB3ED1 /* PBXContainerItemProxy */; 457 | sourceTree = BUILT_PRODUCTS_DIR; 458 | }; 459 | 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */ = { 460 | isa = PBXReferenceProxy; 461 | fileType = archive.ar; 462 | path = libRCTVibration.a; 463 | remoteRef = 00C302E31ABCB9EE00DB3ED1 /* PBXContainerItemProxy */; 464 | sourceTree = BUILT_PRODUCTS_DIR; 465 | }; 466 | 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */ = { 467 | isa = PBXReferenceProxy; 468 | fileType = archive.ar; 469 | path = libRCTSettings.a; 470 | remoteRef = 139105C01AF99BAD00B5F7CC /* PBXContainerItemProxy */; 471 | sourceTree = BUILT_PRODUCTS_DIR; 472 | }; 473 | 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */ = { 474 | isa = PBXReferenceProxy; 475 | fileType = archive.ar; 476 | path = libRCTWebSocket.a; 477 | remoteRef = 139FDEF31B06529B00C62182 /* PBXContainerItemProxy */; 478 | sourceTree = BUILT_PRODUCTS_DIR; 479 | }; 480 | 146834041AC3E56700842450 /* libReact.a */ = { 481 | isa = PBXReferenceProxy; 482 | fileType = archive.ar; 483 | path = libReact.a; 484 | remoteRef = 146834031AC3E56700842450 /* PBXContainerItemProxy */; 485 | sourceTree = BUILT_PRODUCTS_DIR; 486 | }; 487 | 78C398B91ACF4ADC00677621 /* libRCTLinking.a */ = { 488 | isa = PBXReferenceProxy; 489 | fileType = archive.ar; 490 | path = libRCTLinking.a; 491 | remoteRef = 78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */; 492 | sourceTree = BUILT_PRODUCTS_DIR; 493 | }; 494 | 832341B51AAA6A8300B99B32 /* libRCTText.a */ = { 495 | isa = PBXReferenceProxy; 496 | fileType = archive.ar; 497 | path = libRCTText.a; 498 | remoteRef = 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */; 499 | sourceTree = BUILT_PRODUCTS_DIR; 500 | }; 501 | /* End PBXReferenceProxy section */ 502 | 503 | /* Begin PBXResourcesBuildPhase section */ 504 | 00E356EC1AD99517003FC87E /* Resources */ = { 505 | isa = PBXResourcesBuildPhase; 506 | buildActionMask = 2147483647; 507 | files = ( 508 | ); 509 | runOnlyForDeploymentPostprocessing = 0; 510 | }; 511 | 13B07F8E1A680F5B00A75B9A /* Resources */ = { 512 | isa = PBXResourcesBuildPhase; 513 | buildActionMask = 2147483647; 514 | files = ( 515 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */, 516 | 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */, 517 | 9F53BADF1D3BD37200CA2CB2 /* Info.plist in Resources */, 518 | ); 519 | runOnlyForDeploymentPostprocessing = 0; 520 | }; 521 | /* End PBXResourcesBuildPhase section */ 522 | 523 | /* Begin PBXShellScriptBuildPhase section */ 524 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = { 525 | isa = PBXShellScriptBuildPhase; 526 | buildActionMask = 2147483647; 527 | files = ( 528 | ); 529 | inputPaths = ( 530 | ); 531 | name = "Bundle React Native code and images"; 532 | outputPaths = ( 533 | ); 534 | runOnlyForDeploymentPostprocessing = 0; 535 | shellPath = /bin/sh; 536 | shellScript = "export NODE_BINARY=node\n../node_modules/react-native/packager/react-native-xcode.sh"; 537 | }; 538 | /* End PBXShellScriptBuildPhase section */ 539 | 540 | /* Begin PBXSourcesBuildPhase section */ 541 | 00E356EA1AD99517003FC87E /* Sources */ = { 542 | isa = PBXSourcesBuildPhase; 543 | buildActionMask = 2147483647; 544 | files = ( 545 | 00E356F31AD99517003FC87E /* appTests.m in Sources */, 546 | ); 547 | runOnlyForDeploymentPostprocessing = 0; 548 | }; 549 | 13B07F871A680F5B00A75B9A /* Sources */ = { 550 | isa = PBXSourcesBuildPhase; 551 | buildActionMask = 2147483647; 552 | files = ( 553 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */, 554 | 13B07FC11A68108700A75B9A /* main.m in Sources */, 555 | ); 556 | runOnlyForDeploymentPostprocessing = 0; 557 | }; 558 | /* End PBXSourcesBuildPhase section */ 559 | 560 | /* Begin PBXTargetDependency section */ 561 | 00E356F51AD99517003FC87E /* PBXTargetDependency */ = { 562 | isa = PBXTargetDependency; 563 | target = 13B07F861A680F5B00A75B9A /* app */; 564 | targetProxy = 00E356F41AD99517003FC87E /* PBXContainerItemProxy */; 565 | }; 566 | /* End PBXTargetDependency section */ 567 | 568 | /* Begin PBXVariantGroup section */ 569 | 13B07FB11A68108700A75B9A /* LaunchScreen.xib */ = { 570 | isa = PBXVariantGroup; 571 | children = ( 572 | 13B07FB21A68108700A75B9A /* Base */, 573 | ); 574 | name = LaunchScreen.xib; 575 | path = app; 576 | sourceTree = ""; 577 | }; 578 | /* End PBXVariantGroup section */ 579 | 580 | /* Begin XCBuildConfiguration section */ 581 | 00E356F61AD99517003FC87E /* Debug */ = { 582 | isa = XCBuildConfiguration; 583 | buildSettings = { 584 | BUNDLE_LOADER = "$(TEST_HOST)"; 585 | GCC_PREPROCESSOR_DEFINITIONS = ( 586 | "DEBUG=1", 587 | "$(inherited)", 588 | ); 589 | INFOPLIST_FILE = appTests/Info.plist; 590 | IPHONEOS_DEPLOYMENT_TARGET = 8.2; 591 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 592 | PRODUCT_NAME = "$(TARGET_NAME)"; 593 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/app.app/app"; 594 | LIBRARY_SEARCH_PATHS = ( 595 | "$(inherited)", 596 | "\"$(SRCROOT)/$(TARGET_NAME)\"", 597 | ); 598 | }; 599 | name = Debug; 600 | }; 601 | 00E356F71AD99517003FC87E /* Release */ = { 602 | isa = XCBuildConfiguration; 603 | buildSettings = { 604 | BUNDLE_LOADER = "$(TEST_HOST)"; 605 | COPY_PHASE_STRIP = NO; 606 | INFOPLIST_FILE = appTests/Info.plist; 607 | IPHONEOS_DEPLOYMENT_TARGET = 8.2; 608 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 609 | PRODUCT_NAME = "$(TARGET_NAME)"; 610 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/app.app/app"; 611 | LIBRARY_SEARCH_PATHS = ( 612 | "$(inherited)", 613 | "\"$(SRCROOT)/$(TARGET_NAME)\"", 614 | ); 615 | }; 616 | name = Release; 617 | }; 618 | 13B07F941A680F5B00A75B9A /* Debug */ = { 619 | isa = XCBuildConfiguration; 620 | buildSettings = { 621 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 622 | DEAD_CODE_STRIPPING = NO; 623 | HEADER_SEARCH_PATHS = ( 624 | "$(inherited)", 625 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 626 | "$(SRCROOT)/../node_modules/react-native/React/**", 627 | "$(SRCROOT)/../node_modules/react-native-device-info/RNDeviceInfo", 628 | ); 629 | INFOPLIST_FILE = app/Info.plist; 630 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 631 | OTHER_LDFLAGS = ( 632 | "$(inherited)", 633 | "-ObjC", 634 | "-lc++", 635 | ); 636 | PRODUCT_NAME = app; 637 | }; 638 | name = Debug; 639 | }; 640 | 13B07F951A680F5B00A75B9A /* Release */ = { 641 | isa = XCBuildConfiguration; 642 | buildSettings = { 643 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 644 | HEADER_SEARCH_PATHS = ( 645 | "$(inherited)", 646 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 647 | "$(SRCROOT)/../node_modules/react-native/React/**", 648 | "$(SRCROOT)/../node_modules/react-native-device-info/RNDeviceInfo", 649 | ); 650 | INFOPLIST_FILE = app/Info.plist; 651 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 652 | OTHER_LDFLAGS = ( 653 | "$(inherited)", 654 | "-ObjC", 655 | "-lc++", 656 | ); 657 | PRODUCT_NAME = app; 658 | }; 659 | name = Release; 660 | }; 661 | 83CBBA201A601CBA00E9B192 /* Debug */ = { 662 | isa = XCBuildConfiguration; 663 | buildSettings = { 664 | ALWAYS_SEARCH_USER_PATHS = NO; 665 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 666 | CLANG_CXX_LIBRARY = "libc++"; 667 | CLANG_ENABLE_MODULES = YES; 668 | CLANG_ENABLE_OBJC_ARC = YES; 669 | CLANG_WARN_BOOL_CONVERSION = YES; 670 | CLANG_WARN_CONSTANT_CONVERSION = YES; 671 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 672 | CLANG_WARN_EMPTY_BODY = YES; 673 | CLANG_WARN_ENUM_CONVERSION = YES; 674 | CLANG_WARN_INT_CONVERSION = YES; 675 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 676 | CLANG_WARN_UNREACHABLE_CODE = YES; 677 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 678 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 679 | COPY_PHASE_STRIP = NO; 680 | ENABLE_STRICT_OBJC_MSGSEND = YES; 681 | GCC_C_LANGUAGE_STANDARD = gnu99; 682 | GCC_DYNAMIC_NO_PIC = NO; 683 | GCC_OPTIMIZATION_LEVEL = 0; 684 | GCC_PREPROCESSOR_DEFINITIONS = ( 685 | "DEBUG=1", 686 | "$(inherited)", 687 | ); 688 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 689 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 690 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 691 | GCC_WARN_UNDECLARED_SELECTOR = YES; 692 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 693 | GCC_WARN_UNUSED_FUNCTION = YES; 694 | GCC_WARN_UNUSED_VARIABLE = YES; 695 | HEADER_SEARCH_PATHS = ( 696 | "$(inherited)", 697 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 698 | "$(SRCROOT)/../node_modules/react-native/React/**", 699 | "$(SRCROOT)/../node_modules/react-native-device-info/RNDeviceInfo", 700 | ); 701 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 702 | MTL_ENABLE_DEBUG_INFO = YES; 703 | ONLY_ACTIVE_ARCH = YES; 704 | SDKROOT = iphoneos; 705 | }; 706 | name = Debug; 707 | }; 708 | 83CBBA211A601CBA00E9B192 /* Release */ = { 709 | isa = XCBuildConfiguration; 710 | buildSettings = { 711 | ALWAYS_SEARCH_USER_PATHS = NO; 712 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 713 | CLANG_CXX_LIBRARY = "libc++"; 714 | CLANG_ENABLE_MODULES = YES; 715 | CLANG_ENABLE_OBJC_ARC = YES; 716 | CLANG_WARN_BOOL_CONVERSION = YES; 717 | CLANG_WARN_CONSTANT_CONVERSION = YES; 718 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 719 | CLANG_WARN_EMPTY_BODY = YES; 720 | CLANG_WARN_ENUM_CONVERSION = YES; 721 | CLANG_WARN_INT_CONVERSION = YES; 722 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 723 | CLANG_WARN_UNREACHABLE_CODE = YES; 724 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 725 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 726 | COPY_PHASE_STRIP = YES; 727 | ENABLE_NS_ASSERTIONS = NO; 728 | ENABLE_STRICT_OBJC_MSGSEND = YES; 729 | GCC_C_LANGUAGE_STANDARD = gnu99; 730 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 731 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 732 | GCC_WARN_UNDECLARED_SELECTOR = YES; 733 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 734 | GCC_WARN_UNUSED_FUNCTION = YES; 735 | GCC_WARN_UNUSED_VARIABLE = YES; 736 | HEADER_SEARCH_PATHS = ( 737 | "$(inherited)", 738 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 739 | "$(SRCROOT)/../node_modules/react-native/React/**", 740 | "$(SRCROOT)/../node_modules/react-native-device-info/RNDeviceInfo", 741 | ); 742 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 743 | MTL_ENABLE_DEBUG_INFO = NO; 744 | SDKROOT = iphoneos; 745 | VALIDATE_PRODUCT = YES; 746 | }; 747 | name = Release; 748 | }; 749 | /* End XCBuildConfiguration section */ 750 | 751 | /* Begin XCConfigurationList section */ 752 | 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "appTests" */ = { 753 | isa = XCConfigurationList; 754 | buildConfigurations = ( 755 | 00E356F61AD99517003FC87E /* Debug */, 756 | 00E356F71AD99517003FC87E /* Release */, 757 | ); 758 | defaultConfigurationIsVisible = 0; 759 | defaultConfigurationName = Release; 760 | }; 761 | 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "app" */ = { 762 | isa = XCConfigurationList; 763 | buildConfigurations = ( 764 | 13B07F941A680F5B00A75B9A /* Debug */, 765 | 13B07F951A680F5B00A75B9A /* Release */, 766 | ); 767 | defaultConfigurationIsVisible = 0; 768 | defaultConfigurationName = Release; 769 | }; 770 | 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "app" */ = { 771 | isa = XCConfigurationList; 772 | buildConfigurations = ( 773 | 83CBBA201A601CBA00E9B192 /* Debug */, 774 | 83CBBA211A601CBA00E9B192 /* Release */, 775 | ); 776 | defaultConfigurationIsVisible = 0; 777 | defaultConfigurationName = Release; 778 | }; 779 | /* End XCConfigurationList section */ 780 | }; 781 | rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */; 782 | } 783 | --------------------------------------------------------------------------------