├── .watchmanconfig ├── android ├── settings.gradle ├── app │ ├── src │ │ └── main │ │ │ ├── res │ │ │ ├── values │ │ │ │ ├── strings.xml │ │ │ │ └── styles.xml │ │ │ ├── mipmap-hdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ │ └── ic_launcher.png │ │ │ └── mipmap-xxhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── AndroidManifest.xml │ │ │ └── java │ │ │ └── com │ │ │ └── mocktmall │ │ │ └── MainActivity.java │ ├── proguard-rules.pro │ ├── react.gradle │ └── build.gradle ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── build.gradle ├── gradle.properties ├── gradlew.bat └── gradlew ├── Assets ├── starIcon.png └── readme │ ├── layout.gif │ ├── tabbar.gif │ ├── animation.gif │ ├── indexapp.gif │ ├── netInfo.gif │ ├── network.gif │ ├── textinput.gif │ ├── webview.gif │ └── cameraRoll.gif ├── components ├── lib │ ├── react-native-navigationbar │ │ ├── lib │ │ │ ├── add@3x.png │ │ │ ├── styles.js │ │ │ └── index.js │ │ ├── README.md │ │ └── package.json │ ├── Layout.js │ ├── List.js │ ├── Slider.js │ ├── slider.js │ ├── TabBarIOS.js │ ├── TextInput.js │ └── Image.js ├── utils │ └── copyKeys.js ├── customComponents │ ├── demoDetail.js │ └── demoList.js ├── webview │ └── slashhuang.js ├── localApi │ ├── NetInfo.js │ ├── CameraRoll.js │ ├── network.js │ └── Animation.js └── index.js ├── ios ├── mockTMall │ ├── Images.xcassets │ │ ├── BrandAsset.launchimage │ │ │ ├── landscape.png │ │ │ ├── landscape-1.png │ │ │ └── Contents.json │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── AppDelegate.h │ ├── main.m │ ├── Info.plist │ ├── AppDelegate.m │ └── Base.lproj │ │ └── LaunchScreen.xib ├── mockTMallTests │ ├── Info.plist │ └── mockTMallTests.m └── mockTMall.xcodeproj │ ├── xcshareddata │ └── xcschemes │ │ └── mockTMall.xcscheme │ └── project.pbxproj ├── package.json ├── .gitignore ├── README.md ├── index.android.js ├── index.ios.js ├── React Apis.md └── .flowconfig /.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'mockTMall' 2 | 3 | include ':app' 4 | -------------------------------------------------------------------------------- /Assets/starIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slashhuang/react-native-demo/HEAD/Assets/starIcon.png -------------------------------------------------------------------------------- /Assets/readme/layout.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slashhuang/react-native-demo/HEAD/Assets/readme/layout.gif -------------------------------------------------------------------------------- /Assets/readme/tabbar.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slashhuang/react-native-demo/HEAD/Assets/readme/tabbar.gif -------------------------------------------------------------------------------- /Assets/readme/animation.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slashhuang/react-native-demo/HEAD/Assets/readme/animation.gif -------------------------------------------------------------------------------- /Assets/readme/indexapp.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slashhuang/react-native-demo/HEAD/Assets/readme/indexapp.gif -------------------------------------------------------------------------------- /Assets/readme/netInfo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slashhuang/react-native-demo/HEAD/Assets/readme/netInfo.gif -------------------------------------------------------------------------------- /Assets/readme/network.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slashhuang/react-native-demo/HEAD/Assets/readme/network.gif -------------------------------------------------------------------------------- /Assets/readme/textinput.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slashhuang/react-native-demo/HEAD/Assets/readme/textinput.gif -------------------------------------------------------------------------------- /Assets/readme/webview.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slashhuang/react-native-demo/HEAD/Assets/readme/webview.gif -------------------------------------------------------------------------------- /Assets/readme/cameraRoll.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slashhuang/react-native-demo/HEAD/Assets/readme/cameraRoll.gif -------------------------------------------------------------------------------- /android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | mockTMall 3 | 4 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slashhuang/react-native-demo/HEAD/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slashhuang/react-native-demo/HEAD/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slashhuang/react-native-demo/HEAD/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slashhuang/react-native-demo/HEAD/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slashhuang/react-native-demo/HEAD/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /components/lib/react-native-navigationbar/lib/add@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slashhuang/react-native-demo/HEAD/components/lib/react-native-navigationbar/lib/add@3x.png -------------------------------------------------------------------------------- /ios/mockTMall/Images.xcassets/BrandAsset.launchimage/landscape.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slashhuang/react-native-demo/HEAD/ios/mockTMall/Images.xcassets/BrandAsset.launchimage/landscape.png -------------------------------------------------------------------------------- /ios/mockTMall/Images.xcassets/BrandAsset.launchimage/landscape-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slashhuang/react-native-demo/HEAD/ios/mockTMall/Images.xcassets/BrandAsset.launchimage/landscape-1.png -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip 6 | -------------------------------------------------------------------------------- /components/utils/copyKeys.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by slashhuang on 16/3/28. 3 | */ 4 | 5 | /** 6 | * [a,b,c]==> {a:'a',b:'b',c:'c'} 7 | * @param obj 8 | * @return {*} 9 | */ 10 | module.exports=function(obj){ 11 | return obj.reduce(function (pre,cur) { 12 | pre[cur]=cur; 13 | return pre; 14 | },{}) 15 | }; -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mockTMall", 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": "^0.14.7", 10 | "react-native": "^0.22.2", 11 | "react-native-navigation-bar": "^0.1.10", 12 | "react-native-swiper": "^1.4.3" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /.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 | .idea 28 | .gradle 29 | local.properties 30 | 31 | # node.js 32 | # 33 | node_modules/ 34 | npm-debug.log 35 | -------------------------------------------------------------------------------- /components/lib/react-native-navigationbar/README.md: -------------------------------------------------------------------------------- 1 | # react-native-navigationbar 2 | 一个为 iOS/Android 提供Navigationbar的库 3 | 4 | ## Install 5 | `npm install react-native-navigationbar --save` 6 | 7 | ## Usage 8 | 9 | Please go to the [demo](https://github.com/Bob1993/react-native-navigationbar/blob/master/Example/index.ios.js) in project 10 | **Dont worry, it's very easy to use. If you want to know more, please view the [source code of lib](https://github.com/Bob1993/react-native-navigationbar/blob/master/lib/index.js)** -------------------------------------------------------------------------------- /ios/mockTMall/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 | -------------------------------------------------------------------------------- /ios/mockTMall/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 | -------------------------------------------------------------------------------- /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:1.3.1' 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 "$projectDir/../../node_modules/react-native/android" 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /ios/mockTMall/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 | } -------------------------------------------------------------------------------- /ios/mockTMallTests/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 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 11 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /ios/mockTMall/Images.xcassets/BrandAsset.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "extent" : "full-screen", 5 | "idiom" : "iphone", 6 | "subtype" : "736h", 7 | "filename" : "landscape.png", 8 | "minimum-system-version" : "8.0", 9 | "orientation" : "portrait", 10 | "scale" : "3x" 11 | }, 12 | { 13 | "extent" : "full-screen", 14 | "idiom" : "iphone", 15 | "subtype" : "667h", 16 | "filename" : "landscape-1.png", 17 | "minimum-system-version" : "8.0", 18 | "orientation" : "portrait", 19 | "scale" : "2x" 20 | }, 21 | { 22 | "orientation" : "portrait", 23 | "idiom" : "iphone", 24 | "extent" : "full-screen", 25 | "minimum-system-version" : "7.0", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "orientation" : "portrait", 30 | "idiom" : "iphone", 31 | "extent" : "full-screen", 32 | "minimum-system-version" : "7.0", 33 | "subtype" : "retina4", 34 | "scale" : "2x" 35 | } 36 | ], 37 | "info" : { 38 | "version" : 1, 39 | "author" : "xcode" 40 | } 41 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## react-native-demo 2 | > 本项目综合了如下react-native组件 3 | 4 | - Navigator 路由 5 | - WebView 网页 6 | - TabBarIOS 导航切换栏 7 | - TouchableHighlight 点按动作 8 | - View 布局 9 | - Text 文本 10 | - react-native-swiper 图片浏览 11 | - 自定义组件 12 | 13 | > 本项目综合了如下react-native的API 14 | 15 | - Animated 动画 16 | - fetch 网络请求 17 | - Alert 模拟html的alert 18 | - CameraRoll 调用本地照片 19 | 20 | ### 使用 21 | ``` 22 | cd ios 23 | open mockTMall.xcodeproj 24 | 25 | ``` 26 | #### 效果图 27 | 28 | >主页入口-flex布局 29 | 30 | 31 | 32 | >WebView页面 33 | 34 | 35 | 36 | >TabBarIOS 37 | 38 | 39 | 40 | > Animated动画 41 | 42 | 43 | 44 | >TextInput 45 | 46 | 47 | 48 | >调用fetch网络请求 49 | 50 | 51 | 52 | >调用NetInfo获取网络状态 53 | 54 | 55 | 56 | >调用本地API 57 | 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /index.android.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Sample React Native App 3 | * https://github.com/facebook/react-native 4 | */ 5 | 6 | import React, { 7 | AppRegistry, 8 | Component, 9 | StyleSheet, 10 | Text, 11 | View 12 | } from 'react-native'; 13 | 14 | class mockTMall extends Component { 15 | render() { 16 | return ( 17 | 18 | 19 | Welcome to React Native! 20 | 21 | 22 | To get started, edit index.android.js 23 | 24 | 25 | Shake or press menu button for dev menu 26 | 27 | 28 | ); 29 | } 30 | } 31 | 32 | const styles = StyleSheet.create({ 33 | container: { 34 | flex: 1, 35 | justifyContent: 'center', 36 | alignItems: 'center', 37 | backgroundColor: '#F5FCFF', 38 | }, 39 | welcome: { 40 | fontSize: 20, 41 | textAlign: 'center', 42 | margin: 10, 43 | }, 44 | instructions: { 45 | textAlign: 'center', 46 | color: '#333333', 47 | marginBottom: 5, 48 | }, 49 | }); 50 | 51 | AppRegistry.registerComponent('mockTMall', () => mockTMall); 52 | -------------------------------------------------------------------------------- /android/app/src/main/java/com/mocktmall/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.mocktmall; 2 | 3 | import com.facebook.react.ReactActivity; 4 | import com.facebook.react.ReactPackage; 5 | import com.facebook.react.shell.MainReactPackage; 6 | 7 | import java.util.Arrays; 8 | import java.util.List; 9 | 10 | public class MainActivity extends ReactActivity { 11 | 12 | /** 13 | * Returns the name of the main component registered from JavaScript. 14 | * This is used to schedule rendering of the component. 15 | */ 16 | @Override 17 | protected String getMainComponentName() { 18 | return "mockTMall"; 19 | } 20 | 21 | /** 22 | * Returns whether dev mode should be enabled. 23 | * This enables e.g. the dev menu. 24 | */ 25 | @Override 26 | protected boolean getUseDeveloperSupport() { 27 | return BuildConfig.DEBUG; 28 | } 29 | 30 | /** 31 | * A list of packages used by the app. If the app uses additional views 32 | * or modules besides the default ones, add more packages here. 33 | */ 34 | @Override 35 | protected List getPackages() { 36 | return Arrays.asList( 37 | new MainReactPackage() 38 | ); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /index.ios.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Sample React Native App 3 | * https://github.com/facebook/react-native 4 | */ 5 | 6 | import React, { 7 | AppRegistry, 8 | Component, 9 | StyleSheet, 10 | Text, 11 | View, 12 | Navigator 13 | } from 'react-native'; 14 | 15 | import IndexPage from './components/index.js'; 16 | /** 17 | * API测试代码 18 | */ 19 | //import ApiTest from './components/test.js'; 20 | /*======= end =======*/ 21 | class mockTMall extends Component { 22 | render() { 23 | return ( 24 | { 33 | let gestureType = Navigator.SceneConfigs.HorizontalSwipeJump; 34 | gestureType.gestures.jumpForward=null; 35 | return gestureType 36 | }} 37 | renderScene={(route, navigator) => { 38 | let Component = route.component; 39 | return 40 | }}> 41 | 42 | ); 43 | } 44 | } 45 | 46 | 47 | 48 | AppRegistry.registerComponent('mockTMall', () => mockTMall); 49 | -------------------------------------------------------------------------------- /components/customComponents/demoDetail.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by slashhuang on 16/3/24. 3 | * 展示demo细节 4 | * 作为smartComponent传送props 5 | */ 6 | import React,{ 7 | View, 8 | Text, 9 | Component, 10 | PropTypes 11 | } from 'react-native' 12 | /** 13 | * 导航条,组件展示类是经过参数传递进来的 14 | */ 15 | import NavigationBar from '../lib/react-native-navigationbar/lib/index.js';//引入头部导航条 16 | 17 | export default class DemoView extends Component { 18 | constructor(props) { 19 | super(props); 20 | } 21 | 22 | static PropTypes = { 23 | targetComponent: PropTypes.func.isRequired 24 | }; 25 | 26 | render() { 27 | let RenderComponent = this.props.tabBar ? this.props.targetComponent : 28 | 29 | { 34 | console.log(this) 35 | 36 | this.props.navigator.pop() 37 | }} 38 | /> 39 | 40 | {this.props.targetComponent} 41 | 42 | 43 | return RenderComponent; 44 | } 45 | } -------------------------------------------------------------------------------- /components/lib/react-native-navigationbar/lib/styles.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | let React = require('react-native') 4 | 5 | module.exports = React.StyleSheet.create({ 6 | navbar: { 7 | // alignItems: 'center', 8 | justifyContent: 'center' 9 | }, 10 | 11 | backWrapper: { 12 | height: 20, 13 | width: 100, 14 | flex:1, 15 | justifyContent: 'center', 16 | alignItems:'center', 17 | position: 'absolute', 18 | left: 12 19 | }, 20 | 21 | icon: { 22 | position:'absolute', 23 | width: 14, 24 | height: 14, 25 | left: 2.5, 26 | top:3, 27 | borderLeftWidth: 2, 28 | borderBottomWidth: 2, 29 | transform: [{rotate: '45deg'}], 30 | }, 31 | 32 | title: { 33 | marginLeft: 110, 34 | marginRight:110, 35 | fontSize: 18, 36 | textAlign: 'center', 37 | alignSelf: 'center', 38 | justifyContent: 'center', 39 | }, 40 | 41 | actionBtn: { 42 | height: 20, 43 | flex: 1, 44 | position: 'absolute', 45 | right: 12 46 | }, 47 | 48 | actionIcon: { 49 | height: 35, 50 | width: 35, 51 | position: 'absolute', 52 | right: 3 53 | }, 54 | 55 | actionName: { 56 | marginRight:5, 57 | fontSize: 14, 58 | width:80, 59 | marginLeft:14, 60 | textAlign:'left', 61 | alignSelf: 'center', 62 | } 63 | }) 64 | -------------------------------------------------------------------------------- /ios/mockTMall/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | NSAppTransportSecurity 26 | 27 | NSAllowsArbitraryLoads 28 | 29 | 30 | NSLocationWhenInUseUsageDescription 31 | 32 | UIRequiredDeviceCapabilities 33 | 34 | armv7 35 | 36 | UISupportedInterfaceOrientations 37 | 38 | UIInterfaceOrientationPortrait 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UIViewControllerBasedStatusBarAppearance 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /components/lib/Layout.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by slashhuang on 16/3/24. 3 | * 布局layout 4 | */ 5 | 6 | import React, 7 | { 8 | View, 9 | Text, 10 | ScrollView, 11 | StyleSheet, 12 | Component, 13 | PropTypes, 14 | PixelRatio, 15 | TouchableHighlight 16 | } from 'react-native'; 17 | 18 | export default class LayoutExample extends Component{ 19 | constructor(props){ 20 | super(props); 21 | } 22 | static defaultProps={ 23 | }; 24 | static PropTypes={ 25 | }; 26 | renderContent(){ 27 | var word = 'FE futureTeam in dianping.com'; 28 | return {word.split('').reduce(function (pre,cur) { 29 | return pre+'\n'+word; 30 | },'')} 31 | } 32 | render(){ 33 | return ( 34 | 35 | 38 | {this.renderContent()} 39 | 40 | 41 | 42 | 模拟前端界面停留底部 43 | 44 | 45 | 46 | 47 | ); 48 | } 49 | } 50 | var layoutStyles = StyleSheet.create({ 51 | flex:{ 52 | flex:1 53 | }, 54 | tabbar:{ 55 | height:40, 56 | justifyContent:'center', 57 | alignItems:'center', 58 | backgroundColor:'oldlace' 59 | }, 60 | text:{ 61 | fontSize:16, 62 | textAlign:'center', 63 | } 64 | }); -------------------------------------------------------------------------------- /components/lib/List.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by slashhuang on 16/3/24. 3 | */ 4 | 5 | import React, 6 | { 7 | View, 8 | Text, 9 | StyleSheet, 10 | Component, 11 | PropTypes, 12 | PixelRatio, 13 | TouchableHighlight 14 | } from 'react-native'; 15 | 16 | export default class List extends Component{ 17 | constructor(props){ 18 | super(props); 19 | } 20 | static defaultProps={ 21 | title:'', 22 | touchCallback:function(){}, 23 | disabled:false, 24 | underlayColor: '#aaa', 25 | }; 26 | static PropTypes={ 27 | /** 28 | * 列表主题 29 | */ 30 | title:PropTypes.string, 31 | /** 32 | * 点按回调函数 33 | */ 34 | touchCallback:PropTypes.func, 35 | /** 36 | * 是否不允许点击 37 | */ 38 | disabled:PropTypes.bool, 39 | /** 40 | * 点按的背景色 41 | */ 42 | underlayColor:PropTypes.string, 43 | }; 44 | render(){ 45 | return ( 46 | 50 | 51 | {this.props.title} 52 | 53 | 54 | ); 55 | } 56 | } 57 | var listStyles = StyleSheet.create({ 58 | list_item:{ 59 | height:40, 60 | justifyContent:'center', 61 | alignItems:'center', 62 | marginHorizontal:10, 63 | borderBottomWidth:1/PixelRatio.get(),//set to min boder 64 | borderBottomColor:'#ddd' 65 | }, 66 | list_text:{ 67 | fontSize:16 68 | } 69 | }); -------------------------------------------------------------------------------- /React Apis.md: -------------------------------------------------------------------------------- 1 | ActivityIndicatorIOS 2 | ART 3 | DatePickerIOS 4 | DrawerLayoutAndroid 5 | Image 6 | ImageEditor 7 | ImageStore 8 | ListView 9 | MapView 10 | Modal 11 | Navigator 12 | NavigatorIOS 13 | Picker 14 | PickerIOS 15 | ProgressBarAndroid 16 | ProgressViewIOS 17 | ScrollView 18 | SegmentedControlIOS 19 | SliderIOS 20 | SnapshotViewIOS 21 | Switch 22 | PullToRefreshViewAndroid 23 | RecyclerViewBackedScrollView 24 | RefreshControl 25 | StatusBar 26 | SwitchAndroid 27 | SwitchIOS 28 | TabBarIOS 29 | Text 30 | TextInput 31 | ToastAndroid 32 | ToolbarAndroid 33 | Touchable 34 | TouchableHighlight 35 | TouchableNativeFeedback 36 | TouchableOpacity 37 | TouchableWithoutFeedback 38 | View 39 | ViewPagerAndroid 40 | WebView 41 | ActionSheetIOS 42 | AdSupportIOS 43 | Alert 44 | AlertIOS 45 | Animated 46 | AppRegistry 47 | AppState 48 | AppStateIOS 49 | AsyncStorage 50 | BackAndroid 51 | CameraRoll 52 | Clipboard 53 | DatePickerAndroid 54 | Dimensions 55 | Easing 56 | ImagePickerIOS 57 | IntentAndroid 58 | InteractionManager 59 | LayoutAnimation 60 | Linking 61 | LinkingIOS 62 | NavigationExperimental 63 | NetInfo 64 | PanResponder 65 | PixelRatio 66 | PushNotificationIOS 67 | Settings 68 | StatusBarIOS 69 | StyleSheet 70 | TimePickerAndroid 71 | UIManager 72 | Vibration 73 | VibrationIOS 74 | DeviceEventEmitter 75 | NativeAppEventEmitter 76 | NativeModules 77 | Platform 78 | processColor 79 | requireNativeComponent 80 | ColorPropType 81 | EdgeInsetsPropType 82 | PointPropType 83 | addons 84 | hasReactNativeInitialized 85 | Children 86 | Component 87 | PropTypes 88 | createClass 89 | createElement 90 | createFactory 91 | cloneElement 92 | _augmentElement 93 | findNodeHandle 94 | render 95 | unmountComponentAtNode 96 | unstable_batchedUpdates 97 | __spread 98 | unmountComponentAtNodeAndRemoveContainer 99 | isValidClass 100 | isValidElement 101 | renderComponent -------------------------------------------------------------------------------- /components/lib/react-native-navigationbar/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-native-navigationbar", 3 | "version": "0.1.3", 4 | "author": { 5 | "name": "poberWong" 6 | }, 7 | "main": "lib/index.js", 8 | "description": "navigationbar provided for navigator", 9 | "files": [ 10 | "lib" 11 | ], 12 | "bugs": { 13 | "url": "https://github.com/Bob1993/react-native-navigationbar", 14 | "email": "poberwong@gmail.com" 15 | }, 16 | "license": "MIT", 17 | "devDependencies": { 18 | "babel-eslint": "^4.1.6", 19 | "eslint": "^1.10.3", 20 | "eslint-config-standard": "^4.4.0", 21 | "eslint-config-standard-react": "^1.2.1", 22 | "eslint-plugin-react": "^3.15.0", 23 | "eslint-plugin-standard": "^1.3.1" 24 | }, 25 | "gitHead": "c16a5a955716363b4fd65007af7bc60a3a3b9de8", 26 | "_id": "react-native-navigationbar@0.1.3", 27 | "scripts": {}, 28 | "_shasum": "a4638c9d615da1ccd8e7c66a4d85ed1026e45771", 29 | "_from": "react-native-navigationbar@>=0.1.3 <0.2.0", 30 | "_npmVersion": "3.3.12", 31 | "_nodeVersion": "5.5.0", 32 | "_npmUser": { 33 | "name": "poberwong", 34 | "email": "bob1993.dev@gmail.com" 35 | }, 36 | "dist": { 37 | "shasum": "a4638c9d615da1ccd8e7c66a4d85ed1026e45771", 38 | "size": 2182, 39 | "noattachment": false, 40 | "tarball": "http://registry.npm.taobao.org/react-native-navigationbar/download/react-native-navigationbar-0.1.3.tgz" 41 | }, 42 | "maintainers": [ 43 | { 44 | "name": "poberwong", 45 | "email": "bob1993.dev@gmail.com" 46 | } 47 | ], 48 | "_npmOperationalInternal": { 49 | "host": "packages-5-east.internal.npmjs.com", 50 | "tmp": "tmp/react-native-navigationbar-0.1.3.tgz_1455594137536_0.9846151610836387" 51 | }, 52 | "directories": {}, 53 | "publish_time": 1455594141065, 54 | "_cnpm_publish_time": 1455594141065, 55 | "_resolved": "https://registry.npm.taobao.org/react-native-navigationbar/download/react-native-navigationbar-0.1.3.tgz" 56 | } 57 | -------------------------------------------------------------------------------- /.flowconfig: -------------------------------------------------------------------------------- 1 | [ignore] 2 | 3 | # We fork some components by platform. 4 | .*/*.web.js 5 | .*/*.android.js 6 | 7 | # Some modules have their own node_modules with overlap 8 | .*/node_modules/node-haste/.* 9 | 10 | # Ugh 11 | .*/node_modules/babel.* 12 | .*/node_modules/babylon.* 13 | .*/node_modules/invariant.* 14 | 15 | # Ignore react and fbjs where there are overlaps, but don't ignore 16 | # anything that react-native relies on 17 | .*/node_modules/fbjs/lib/Map.js 18 | .*/node_modules/fbjs/lib/fetch.js 19 | .*/node_modules/fbjs/lib/ExecutionEnvironment.js 20 | .*/node_modules/fbjs/lib/ErrorUtils.js 21 | 22 | # Flow has a built-in definition for the 'react' module which we prefer to use 23 | # over the currently-untyped source 24 | .*/node_modules/react/react.js 25 | .*/node_modules/react/lib/React.js 26 | .*/node_modules/react/lib/ReactDOM.js 27 | 28 | .*/__mocks__/.* 29 | .*/__tests__/.* 30 | 31 | .*/commoner/test/source/widget/share.js 32 | 33 | # Ignore commoner tests 34 | .*/node_modules/commoner/test/.* 35 | 36 | # See https://github.com/facebook/flow/issues/442 37 | .*/react-tools/node_modules/commoner/lib/reader.js 38 | 39 | # Ignore jest 40 | .*/node_modules/jest-cli/.* 41 | 42 | # Ignore Website 43 | .*/website/.* 44 | 45 | [include] 46 | 47 | [libs] 48 | node_modules/react-native/Libraries/react-native/react-native-interface.js 49 | 50 | [options] 51 | module.system=haste 52 | 53 | esproposal.class_static_fields=enable 54 | esproposal.class_instance_fields=enable 55 | 56 | munge_underscores=true 57 | 58 | module.name_mapper='^image![a-zA-Z0-9$_-]+$' -> 'GlobalImageStub' 59 | 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\)$' -> 'RelativeImageStub' 60 | 61 | suppress_type=$FlowIssue 62 | suppress_type=$FlowFixMe 63 | suppress_type=$FixMe 64 | 65 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(2[0-1]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\) 66 | suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(2[0-1]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+ 67 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy 68 | 69 | [version] 70 | 0.21.0 71 | -------------------------------------------------------------------------------- /ios/mockTMallTests/mockTMallTests.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 240 17 | #define TEXT_TO_LOOK_FOR @"Welcome to React Native!" 18 | 19 | @interface mockTMallTests : XCTestCase 20 | 21 | @end 22 | 23 | @implementation mockTMallTests 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 | -------------------------------------------------------------------------------- /ios/mockTMall/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 "RCTRootView.h" 13 | 14 | @implementation AppDelegate 15 | 16 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 17 | { 18 | NSURL *jsCodeLocation; 19 | 20 | /** 21 | * Loading JavaScript code - uncomment the one you want. 22 | * 23 | * OPTION 1 24 | * Load from development server. Start the server from the repository root: 25 | * 26 | * $ npm start 27 | * 28 | * To run on device, change `localhost` to the IP address of your computer 29 | * (you can get this by typing `ifconfig` into the terminal and selecting the 30 | * `inet` value under `en0:`) and make sure your computer and iOS device are 31 | * on the same Wi-Fi network. 32 | */ 33 | 34 | jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle?platform=ios&dev=true"]; 35 | 36 | /** 37 | * OPTION 2 38 | * Load from pre-bundled file on disk. The static bundle is automatically 39 | * generated by the "Bundle React Native code and images" build step when 40 | * running the project on an actual device or running the project on the 41 | * simulator in the "Release" build configuration. 42 | */ 43 | 44 | // jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; 45 | /** 46 | * 睡眠1秒 47 | */ 48 | sleep(2); 49 | RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation 50 | moduleName:@"mockTMall" 51 | initialProperties:nil 52 | launchOptions:launchOptions]; 53 | 54 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 55 | UIViewController *rootViewController = [UIViewController new]; 56 | rootViewController.view = rootView; 57 | self.window.rootViewController = rootViewController; 58 | [self.window makeKeyAndVisible]; 59 | return YES; 60 | } 61 | 62 | @end 63 | -------------------------------------------------------------------------------- /components/lib/Slider.js: -------------------------------------------------------------------------------- 1 | var React = require('react-native') 2 | var Swiper = require('react-native-swiper') 3 | var { 4 | StyleSheet, 5 | View, 6 | Image, 7 | } = React 8 | 9 | var styles = StyleSheet.create({ 10 | wrapper: { 11 | }, 12 | slide: { 13 | flex: 1, 14 | justifyContent: 'center', 15 | backgroundColor: 'transparent', 16 | }, 17 | image: { 18 | flex: 1, 19 | } 20 | }); 21 | 22 | var swiper = React.createClass({ 23 | render: function() { 24 | return ( 25 | 26 | } 32 | activeDot={} 33 | paginationStyle={{ 34 | position: 'absolute', 35 | bottom: 10, 36 | left: 0, 37 | right: 0, 38 | flexDirection: 'row', 39 | flex: 1, 40 | justifyContent: 'center', 41 | alignItems: 'center', 42 | backgroundColor:'transparent' 43 | }} 44 | > 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | ) 57 | } 58 | }) 59 | 60 | module.exports = swiper 61 | -------------------------------------------------------------------------------- /components/lib/slider.js: -------------------------------------------------------------------------------- 1 | var React = require('react-native') 2 | var Swiper = require('react-native-swiper') 3 | var { 4 | StyleSheet, 5 | View, 6 | Image, 7 | } = React 8 | 9 | var styles = StyleSheet.create({ 10 | wrapper: { 11 | }, 12 | slide: { 13 | flex: 1, 14 | justifyContent: 'center', 15 | backgroundColor: 'transparent', 16 | }, 17 | image: { 18 | flex: 1, 19 | } 20 | }); 21 | 22 | var swiper = React.createClass({ 23 | render: function() { 24 | return ( 25 | 26 | } 32 | activeDot={} 33 | paginationStyle={{ 34 | position: 'absolute', 35 | bottom: 10, 36 | left: 0, 37 | right: 0, 38 | flexDirection: 'row', 39 | flex: 1, 40 | justifyContent: 'center', 41 | alignItems: 'center', 42 | backgroundColor:'transparent' 43 | }} 44 | > 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | ) 57 | } 58 | }) 59 | 60 | module.exports = swiper 61 | -------------------------------------------------------------------------------- /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 | 30 | # Do not strip any method/class that is annotated with @DoNotStrip 31 | -keep @com.facebook.proguard.annotations.DoNotStrip class * 32 | -keepclassmembers class * { 33 | @com.facebook.proguard.annotations.DoNotStrip *; 34 | } 35 | 36 | -keepclassmembers @com.facebook.proguard.annotations.KeepGettersAndSetters class * { 37 | void set*(***); 38 | *** get*(); 39 | } 40 | 41 | -keep class * extends com.facebook.react.bridge.JavaScriptModule { *; } 42 | -keep class * extends com.facebook.react.bridge.NativeModule { *; } 43 | -keepclassmembers,includedescriptorclasses class * { native ; } 44 | -keepclassmembers class * { @com.facebook.react.uimanager.UIProp ; } 45 | -keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactProp ; } 46 | -keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactPropGroup ; } 47 | 48 | -dontwarn com.facebook.react.** 49 | 50 | # okhttp 51 | 52 | -keepattributes Signature 53 | -keepattributes *Annotation* 54 | -keep class com.squareup.okhttp.** { *; } 55 | -keep interface com.squareup.okhttp.** { *; } 56 | -dontwarn com.squareup.okhttp.** 57 | 58 | # okio 59 | 60 | -keep class sun.misc.Unsafe { *; } 61 | -dontwarn java.nio.file.* 62 | -dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement 63 | -dontwarn okio.** 64 | 65 | # stetho 66 | 67 | -dontwarn com.facebook.stetho.** 68 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /components/webview/slashhuang.js: -------------------------------------------------------------------------------- 1 | import NavigationBar from '../lib/react-native-navigationbar/lib/index.js'; 2 | 3 | import React,{ 4 | View, 5 | WebView, 6 | Component, 7 | StyleSheet, 8 | PropTypes, 9 | ProgressViewIOS//进度条 10 | } from 'react-native'; 11 | 12 | var TimerMixin = require('react-timer-mixin'); 13 | export default class Blog extends Component{ 14 | constructor(props){ 15 | super(props); 16 | this.state={ 17 | progress:0, 18 | loaded:false, 19 | hideProgress:false 20 | } 21 | } 22 | static defaultProps={ 23 | url:'http://slashhuang.github.io/',//默认加载我的博客哈 24 | }; 25 | static propTypes={ 26 | url:PropTypes.string 27 | }; 28 | getProgress(offset) { 29 | //通过某种方式让progress递增至π/2 30 | var progress = this.state.progress + offset; 31 | //这种函数逼近,让状态条显示更逼真 32 | var calculateLimitation = Math.sin(progress/(progress+150)*(Math.PI/2))%1 33 | return calculateLimitation 34 | } 35 | updateProgress() { 36 | var progress = this.state.progress + 1; 37 | //触发progress重新渲染 38 | this.setState({ progress }); 39 | //推至下个进程调用progress^_^ 40 | if(!this.state.loaded){ 41 | this.requestAnimationFrame(() => this.updateProgress()); 42 | }else{ 43 | this.setState({ progress:100000000 }); 44 | this.setTimeout(()=>{ 45 | this.requestAnimationFrame(() => { 46 | this.setState({hideProgress:true}) 47 | }); 48 | },500) 49 | } 50 | } 51 | hideProgressBar(){ 52 | this.setState({ 53 | loaded:true 54 | }) 55 | } 56 | componentDidMount() { 57 | this.updateProgress(); 58 | } 59 | renderWebViewProgressBar(){ 60 | if(this.state.hideProgress){ 61 | return null 62 | }else{ 63 | return 64 | } 65 | 66 | } 67 | render(){ 68 | return ( 69 | 70 | {this.props.navigator.pop()}} 75 | backName={'首页'} 76 | actionIcon={true} 77 | barBottomThickness={0}/> 78 | 79 | {this.renderWebViewProgressBar.call(this)} 80 | 81 | 84 | 85 | ) 86 | } 87 | } 88 | //增加timer mixin 89 | Object.assign(Blog.prototype,TimerMixin); 90 | 91 | let webViewStyles = StyleSheet.create({ 92 | progressBar:{ 93 | position:'absolute', 94 | height:2, 95 | left:0, 96 | right:0, 97 | top:62 98 | } 99 | }); -------------------------------------------------------------------------------- /components/customComponents/demoList.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by slashhuang on 16/3/24. 3 | * demo入口 4 | */ 5 | import React,{ 6 | View, 7 | Text, 8 | Component 9 | } from 'react-native' 10 | import DemoView from './demoDetail.js';//demo展示窗口 11 | import NavigationBar from '../lib/react-native-navigationbar/lib/index.js';//引入头部导航条 12 | /** 13 | * 组件测试 14 | */ 15 | import List from '../lib/List.js';//引入列表组件 16 | import TextInputDemo from '../lib/TextInput.js';//引入输入框组件 17 | import SliderGroup from '../lib/Slider.js';//引入图片浏览插件 18 | import ImageDemo from '../lib/Image.js';//引入图片布局 19 | import TabBarExample from '../lib/TabBarIOS.js';//引入导航切换 20 | import LayoutExample from '../lib/Layout.js';//引入布局组件 21 | /** 22 | * API测试 23 | */ 24 | import AnimationExample from '../localApi/Animation.js';//引入动画组件API 25 | import CameraRollDemo from '../localApi/CameraRoll.js';//引入本地图片库API 26 | import httpDemo from '../localApi/network.js';//引入网络请求API 27 | import NetInfoDemo from '../localApi/NetInfo.js';//引入判断网络状态API 28 | 29 | export default class CustomComponents extends Component{ 30 | constructor(props){ 31 | super(props); 32 | } 33 | 34 | /** 35 | * react默认把最后一个参数处理成ResponderSyntheticEvent 36 | * @param name 37 | * @param RenderComponent 38 | * @param tabBar 39 | */ 40 | passPropsParam(name,RenderComponent,bool){ 41 | this.props.navigator.push({ 42 | component:DemoView, 43 | backNavName:'查看IOS组件', 44 | title:name, 45 | targetComponent:||null, 46 | tabBar:bool||false 47 | }) 48 | } 49 | render(){ 50 | return( 51 | 52 | {this.props.navigator.pop()}} 57 | /> 58 | this.passPropsParam.call(this,'flex布局',LayoutExample)} 60 | /> 61 | this.passPropsParam.call(this,'照片浏览',SliderGroup)}/> 63 | this.passPropsParam.call(this,'输入框',TextInputDemo)} 65 | /> 66 | this.passPropsParam.call(this,'图片布局',ImageDemo)} 68 | /> 69 | this.passPropsParam.call(this,'tab切换',TabBarExample,true)} 71 | /> 72 | this.passPropsParam.call(this,'ReactNative动画',AnimationExample)} 74 | /> 75 | this.passPropsParam.call(this,'获取本地图片',CameraRollDemo)} 77 | /> 78 | this.passPropsParam.call(this,'获取Github信息',httpDemo)} 80 | /> 81 | this.passPropsParam.call(this,'获取APP网络状态',NetInfoDemo)} 83 | /> 84 | 85 | ); 86 | } 87 | } -------------------------------------------------------------------------------- /ios/mockTMall/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 | -------------------------------------------------------------------------------- /components/localApi/NetInfo.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by slashhuang on 16/4/5. 3 | */ 4 | import React,{ 5 | NetInfo, 6 | Text, 7 | View, 8 | TouchableHighlight, 9 | StyleSheet, 10 | PixelRatio, 11 | Component 12 | } from 'react-native'; 13 | var TimerMixin = require('react-timer-mixin'); 14 | 15 | export default class NetInfoDemo extends Component{ 16 | constructor(){ 17 | super(); 18 | this.state={ 19 | info:'', 20 | isConnected:false 21 | } 22 | } 23 | handleConnectivityChange(reach) { 24 | this.setState({ 25 | info:reach 26 | }) 27 | } 28 | handleConnecChange(reach) { 29 | this.setTimeout( 30 | ()=>{ 31 | this.setState({ 32 | isConnected:reach 33 | }) 34 | } ,200 35 | ) 36 | } 37 | 38 | /** 39 | * none - 设备处于离线状态。 40 | * wifi - 设备处于联网状态且通过wifi链接,或者是一个iOS的模拟器。 41 | * cell - 设备是通过Edge、3G、WiMax或是LTE网络联网的。 42 | * unknown - 发生错误,网络状况不可知 43 | */ 44 | fetchNetInfo(){ 45 | NetInfo.fetch().done((reach) => { 46 | /** 47 | * 事实上,this的指向没有变 48 | */ 49 | this.setState({ 50 | info:reach 51 | }) 52 | }); 53 | } 54 | componentDidMount(){ 55 | /** 56 | * 是否联网 57 | */ 58 | NetInfo.isConnected.fetch().done((isConnected) => { 59 | this.setState({isConnected:isConnected}); 60 | }); 61 | /** 62 | * 添加onchange事件 63 | */ 64 | NetInfo.addEventListener( 65 | 'change', 66 | this.handleConnectivityChange.bind(this) 67 | ); 68 | NetInfo.isConnected.addEventListener( 69 | 'change', 70 | this.handleConnecChange.bind(this) 71 | ); 72 | } 73 | render(){ 74 | return ( 75 | 76 | 81 | 点击获取当前网络信息 82 | 83 | 85 | 86 | 联网状态:{this.state.isConnected?'已联网':'无网络'} 87 | 88 | 89 | 90 | 目前的网络类型是 91 | 92 | 93 | {this.state.info} 94 | 95 | 96 | toggle网络开关进行测试 99 | 100 | 101 | ) 102 | 103 | } 104 | } 105 | Object.assign(NetInfoDemo.prototype,TimerMixin); 106 | 107 | var netInfoStyle=StyleSheet.create({ 108 | clickPart:{ 109 | height:40, 110 | borderTopColor:'#ddd', 111 | borderTopWidth:1/PixelRatio.get(), 112 | borderBottomColor:'#ddd', 113 | borderBottomWidth:1/PixelRatio.get(), 114 | justifyContent:'center', 115 | alignItems:'center' 116 | }, 117 | center:{ 118 | justifyContent:'center', 119 | alignItems:'center', 120 | height:40, 121 | marginHorizontal:70, 122 | marginTop:80, 123 | borderBottomColor:'tomato', 124 | borderBottomWidth:1/PixelRatio.get(), 125 | }, 126 | text:{ 127 | fontSize:17 128 | } 129 | }); 130 | -------------------------------------------------------------------------------- /components/lib/react-native-navigationbar/lib/index.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | // Module dependencies 4 | let React = require('react-native') 5 | let styles = require('./styles') 6 | 7 | let { 8 | Text, 9 | View, 10 | Image, 11 | TouchableOpacity, 12 | PropTypes 13 | } = React 14 | 15 | const STATUS_BAR_HEIGHT = 20 16 | const NAV_BAR_HEIGHT = 44 17 | 18 | module.exports = React.createClass({ 19 | 20 | propTypes: { 21 | title: PropTypes.string, 22 | backFunc: PropTypes.func, 23 | tintColor: PropTypes.string, 24 | titleTextColor: PropTypes.string, 25 | barTintColor: PropTypes.string, 26 | actionIcon: PropTypes.bool, 27 | actionName: PropTypes.string, 28 | actionFunc: PropTypes.func, 29 | actionTextColor: PropTypes.string, 30 | backHidden: PropTypes.bool, 31 | statusbarPadding: PropTypes.bool, 32 | backColor: PropTypes.string, 33 | barBottomColor: PropTypes.string, 34 | barBottomThickness: PropTypes.number, 35 | /** 36 | * 是否显示上个层级的名字 37 | */ 38 | IsBackText: PropTypes.bool, 39 | /** 40 | * 自定义上个层级的名字 41 | */ 42 | backName: PropTypes.string, 43 | barOpacity: PropTypes.number, 44 | barStyle: PropTypes.number // add extended style for navigationBar 45 | }, 46 | 47 | getDefaultProps () { // 返回默认的一些属性值 48 | return { 49 | title: 'title', 50 | backFunc () {}, 51 | tintColor: '#777', 52 | backColor: '#777', 53 | titleTextColor: '#333', 54 | barTintColor: 'white', 55 | actionIcon: false, 56 | actionName: '', 57 | actionFunc () {}, 58 | actionTextColor: '#666', 59 | backHidden: false, // 控制是否出现左侧菜单 60 | IsBackText: false, // 控制是选择icon还是text 61 | backName: 'back', 62 | backTextColor: '#666', 63 | statusbarPadding: true, 64 | barBottomColor: '#d4d4d4', 65 | barBottomThickness: 0.5, 66 | barOpacity: 1, 67 | barStyle: 0 68 | } 69 | }, 70 | 71 | render () { 72 | return ( 73 | 83 | { 84 | !this.props.backHidden 85 | ? 88 | 89 | 90 | { this.props.IsBackText? 91 | 92 | 93 | {this.props.backName} 94 | 95 | :null 96 | 97 | } 98 | : null 99 | } 100 | {this.props.title} 101 | { 102 | this.props.actionName 103 | ? 104 | {this.props.actionName} 105 | : null 106 | } 107 | { 108 | this.props.actionIcon 109 | ? 110 | 111 | : null 112 | } 113 | 114 | ) 115 | } 116 | }) 117 | -------------------------------------------------------------------------------- /components/lib/TabBarIOS.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var React = require('react-native'); 4 | var { 5 | tabBarStylesheet, 6 | TabBarIOS, 7 | Text, 8 | View, 9 | StyleSheet 10 | } = React; 11 | import NavigationBar from '../lib/react-native-navigationbar/lib/index.js';//引入头部导航条 12 | import copyKeys from '../utils/copyKeys.js'; 13 | 14 | class TabBarExample extends React.Component{ 15 | constructor(props){ 16 | super(); 17 | this.state = { 18 | selectedTab: '自定义', 19 | notifCount: 0, 20 | presses: 0 21 | }; 22 | /** 23 | * 系统自带的icon 24 | */ 25 | this.tabIndicator = copyKeys([ 26 | 'bookmarks', 27 | 'contacts', 28 | 'downloads', 29 | 'favorites', 30 | 'featured', 31 | 'history', 32 | 'more', 33 | 'most-recent', 34 | 'most-viewed', 35 | 'recents', 36 | 'search', 37 | 'top-rated']); 38 | this._renderContent = this._renderContent.bind(this); 39 | } 40 | _renderContent(color, pageText,num) { 41 | return ( 42 | 43 | { 48 | this.props.navigator.pop() 49 | }} 50 | /> 51 | 52 | {pageText} 53 | {num} re-renders of the {pageText} 54 | 55 | 56 | 57 | )} 58 | _renderProps(type,otherState={}){ 59 | let tabIndicator = this.tabIndicator; 60 | let sysBool = tabIndicator.hasOwnProperty(type); 61 | let iconSet = sysBool?{systemIcon:type}:{}; 62 | return { 63 | title: type, 64 | ...iconSet, 65 | selected: this.state.selectedTab === type, 66 | onPress: () => { 67 | this.setState({ 68 | selectedTab: type, 69 | ...otherState 70 | }); 71 | } 72 | } 73 | } 74 | render() { 75 | return ( 76 | 79 | 80 | 84 | {this._renderContent('azure', '使用azure背景色,自定义icon')} 85 | 86 | 87 | 89 | {this._renderContent('sandybrown', '使用sandybrown作为背景色')} 90 | 91 | 92 | 94 | {this._renderContent('mintcream', '使用mintcream作为背景色')} 95 | 96 | 97 | 0 ? this.state.notifCount : undefined}> 100 | {this._renderContent('cornsilk', '使用cornsilk作为背景色', this.state.notifCount)} 101 | 102 | 103 | 105 | {this._renderContent('lavender', '使用lavender作为背景色', this.state.presses)} 106 | 107 | 108 | 109 | )} 110 | }; 111 | 112 | var tabBarStyles = StyleSheet.create({ 113 | tabContent: { 114 | flex: 1, 115 | alignItems: 'center' 116 | }, 117 | tabText: { 118 | color: '#111', 119 | margin: 50, 120 | fontSize:17 121 | } 122 | }); 123 | 124 | module.exports = TabBarExample; -------------------------------------------------------------------------------- /android/app/react.gradle: -------------------------------------------------------------------------------- 1 | import org.apache.tools.ant.taskdefs.condition.Os 2 | 3 | def config = project.hasProperty("react") ? project.react : []; 4 | 5 | def bundleAssetName = config.bundleAssetName ?: "index.android.bundle" 6 | def entryFile = config.entryFile ?: "index.android.js" 7 | 8 | // because elvis operator 9 | def elvisFile(thing) { 10 | return thing ? file(thing) : null; 11 | } 12 | 13 | def reactRoot = elvisFile(config.root) ?: file("../../") 14 | def inputExcludes = config.inputExcludes ?: ["android/**", "ios/**"] 15 | 16 | void runBefore(String dependentTaskName, Task task) { 17 | Task dependentTask = tasks.findByPath(dependentTaskName); 18 | if (dependentTask != null) { 19 | dependentTask.dependsOn task 20 | } 21 | } 22 | 23 | gradle.projectsEvaluated { 24 | // Grab all build types and product flavors 25 | def buildTypes = android.buildTypes.collect { type -> type.name } 26 | def productFlavors = android.productFlavors.collect { flavor -> flavor.name } 27 | 28 | // When no product flavors defined, use empty 29 | if (!productFlavors) productFlavors.add('') 30 | 31 | productFlavors.each { productFlavorName -> 32 | buildTypes.each { buildTypeName -> 33 | // Create variant and target names 34 | def targetName = "${productFlavorName.capitalize()}${buildTypeName.capitalize()}" 35 | def targetPath = productFlavorName ? 36 | "${productFlavorName}/${buildTypeName}" : 37 | "${buildTypeName}" 38 | 39 | // React js bundle directories 40 | def jsBundleDirConfigName = "jsBundleDir${targetName}" 41 | def jsBundleDir = elvisFile(config."$jsBundleDirConfigName") ?: 42 | file("$buildDir/intermediates/assets/${targetPath}") 43 | 44 | def resourcesDirConfigName = "resourcesDir${targetName}" 45 | def resourcesDir = elvisFile(config."${resourcesDirConfigName}") ?: 46 | file("$buildDir/intermediates/res/merged/${targetPath}") 47 | def jsBundleFile = file("$jsBundleDir/$bundleAssetName") 48 | 49 | // Bundle task name for variant 50 | def bundleJsAndAssetsTaskName = "bundle${targetName}JsAndAssets" 51 | 52 | def currentBundleTask = tasks.create( 53 | name: bundleJsAndAssetsTaskName, 54 | type: Exec) { 55 | group = "react" 56 | description = "bundle JS and assets for ${targetName}." 57 | 58 | // Create dirs if they are not there (e.g. the "clean" task just ran) 59 | doFirst { 60 | jsBundleDir.mkdirs() 61 | resourcesDir.mkdirs() 62 | } 63 | 64 | // Set up inputs and outputs so gradle can cache the result 65 | inputs.files fileTree(dir: reactRoot, excludes: inputExcludes) 66 | outputs.dir jsBundleDir 67 | outputs.dir resourcesDir 68 | 69 | // Set up the call to the react-native cli 70 | workingDir reactRoot 71 | 72 | // Set up dev mode 73 | def devEnabled = !targetName.toLowerCase().contains("release") 74 | if (Os.isFamily(Os.FAMILY_WINDOWS)) { 75 | commandLine "cmd", "/c", "react-native", "bundle", "--platform", "android", "--dev", "${devEnabled}", 76 | "--entry-file", entryFile, "--bundle-output", jsBundleFile, "--assets-dest", resourcesDir 77 | } else { 78 | commandLine "react-native", "bundle", "--platform", "android", "--dev", "${devEnabled}", 79 | "--entry-file", entryFile, "--bundle-output", jsBundleFile, "--assets-dest", resourcesDir 80 | } 81 | 82 | enabled config."bundleIn${targetName}" || 83 | config."bundleIn${buildTypeName.capitalize()}" ?: 84 | targetName.toLowerCase().contains("release") 85 | } 86 | 87 | // Hook bundle${productFlavor}${buildType}JsAndAssets into the android build process 88 | currentBundleTask.dependsOn("merge${targetName}Resources") 89 | currentBundleTask.dependsOn("merge${targetName}Assets") 90 | 91 | runBefore("processArmeabi-v7a${targetName}Resources", currentBundleTask) 92 | runBefore("processX86${targetName}Resources", currentBundleTask) 93 | runBefore("processUniversal${targetName}Resources", currentBundleTask) 94 | runBefore("process${targetName}Resources", currentBundleTask) 95 | } 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /components/lib/TextInput.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by slashhuang on 16/3/25. 3 | */ 4 | import React,{ 5 | Component, 6 | TextInput, 7 | View, 8 | StyleSheet, 9 | PixelRatio, 10 | Text 11 | } from 'react-native'; 12 | /** 13 | * 最低像素值iphone 6模拟器上 14 | * //0.5 15 | */ 16 | const minPix = 1/PixelRatio.get() 17 | console.log(minPix); 18 | export default class TextInputDemo extends Component{ 19 | constructor(props){ 20 | super(props); 21 | this.state={ 22 | text:'hell world' 23 | } 24 | } 25 | renderType(props){ 26 | return( 27 | 28 | 29 | 33 | 34 | 35 | 36 | {props.keyboardType} 37 | 38 | 39 | ) 40 | 41 | } 42 | render(){ 43 | return ( 44 | 45 | {this.renderType({ 46 | keyboardType:'numeric', 47 | returnKeyType:'default', 48 | autoFocus:true, 49 | maxLength:10, 50 | placeholder:"自动聚焦,默认UI展现", 51 | onChangeText:(text)=>{ 52 | //参数为text 53 | if(text.length>5){ 54 | alert(`length has already pass 5,text is ${ text }`) 55 | }} 56 | })} 57 | {this.renderType({ 58 | accessibilityLabel:`Write a status update`, 59 | keyboardType:'phone-pad', 60 | returnKeyType:'send', 61 | keyboardAppearance:'light', 62 | placeholder:"选择输入的文字颜色", 63 | placeholderTextColor:'green', 64 | selectionColor:'green', 65 | onSubmitEditing:()=>{ 66 | alert('submit') 67 | } 68 | } 69 | )} 70 | {this.renderType({ 71 | keyboardType:'default', 72 | returnKeyType:'go', 73 | placeholder:"键盘下为go,选择文本操作", 74 | placeholderTextColor:'lightcoral', 75 | onFocus:(e)=>{ 76 | console.log(e); 77 | alert('focused') 78 | } 79 | } 80 | )} 81 | {this.renderType({ 82 | keyboardType:'default', 83 | returnKeyType:'search', 84 | keyboardAppearance:'dark', 85 | placeholder:"改变键盘样式", 86 | placeholderTextColor:'peru' 87 | } 88 | )} 89 | {this.renderType({ 90 | keyboardType:'email-address', 91 | returnKeyType:'next', 92 | keyboardAppearance:'dark', 93 | placeholder:"不可编辑", 94 | placeholderTextColor:'lightslategray', 95 | editable:false 96 | } 97 | )} 98 | 99 | ) 100 | } 101 | } 102 | /** 103 | * 一部分CSS的经验是,布局样式都加在View组件上 104 | * 1、TextInput支持margin布局,由于是封装的原生的。所以必须给予容器一定的宽度。 105 | * 浏览器中原生的input默认会有一定的宽度,但是TextInput是没有的,需要手动添加。 106 | * 2、样式编写要按照标签特性进行归类,保证UI的正确渲染 107 | */ 108 | const TextInputStyle= StyleSheet.create({ 109 | container:{ 110 | flex:1, 111 | justifyContent:'center', 112 | alignItems:'center', 113 | height:30, 114 | flexDirection:'row', 115 | margin:5 116 | }, 117 | textInput:{ 118 | height: 30, 119 | flex:1, 120 | borderColor: 'gray', 121 | borderWidth: minPix, 122 | marginTop:5, 123 | paddingHorizontal:3 124 | }, 125 | searchBtn:{ 126 | marginTop:5, 127 | marginLeft:-10, 128 | width:100, 129 | height:30, 130 | justifyContent:'center', 131 | alignItems:'center', 132 | backgroundColor:'deepskyblue' 133 | }, 134 | text:{ 135 | color:'white', 136 | fontSize:14, 137 | fontWeight:'bold' 138 | } 139 | }); -------------------------------------------------------------------------------- /ios/mockTMall.xcodeproj/xcshareddata/xcschemes/mockTMall.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 | -------------------------------------------------------------------------------- /components/localApi/CameraRoll.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 使用链接库 3 | * 并不是所有的APP都需要使用全部的原生功能,包含支持全部特性的代码会增大应用的体积 4 | * @type {ReactNative|exports|module.exports} 5 | * 操作链接:http://reactnative.cn/docs/0.22/linking-libraries-ios.html#content 6 | */ 7 | const React = require('react-native'); 8 | 9 | const { 10 | StyleSheet, 11 | Text, 12 | View, 13 | ScrollView, 14 | Image, 15 | CameraRoll, 16 | Component, 17 | Alert, 18 | TouchableOpacity, 19 | PixelRatio 20 | } = React; 21 | /** 22 | * 若在外层容器定义alignItems和justifyContent会导致里面的内容按照内容自动缩放, 23 | * 难以产生块级元素的效果 24 | */ 25 | const styles = StyleSheet.create({ 26 | container: { 27 | flex: 1, 28 | backgroundColor: '#F5FCFF', 29 | //alignItems:'center', 30 | //justifyContent:'center' 31 | }, 32 | textButton: { 33 | flex:1, 34 | backgroundColor:'#fff', 35 | height:40, 36 | justifyContent: 'center', 37 | alignItems:'center', 38 | borderTopColor:'#ddd', 39 | borderTopWidth:1/PixelRatio.get(), 40 | borderBottomColor:'#ddd', 41 | borderBottomWidth:1/PixelRatio.get() 42 | }, 43 | image: { 44 | width: 100, 45 | height: 100, 46 | margin: 10 47 | } 48 | }); 49 | 50 | export default class CameraRollDemo extends Component{ 51 | constructor() { 52 | super(); 53 | this.state = { 54 | images: [], 55 | num:0 56 | }; 57 | } 58 | fetchLocalImages() { 59 | let that = this; 60 | const fetchParams = { 61 | first: 5 62 | }; 63 | 64 | /** 65 | * 参数格式 66 | * The number of photos wanted in reverse order of the photo application 67 | * (i.e. most recent first for SavedPhotos). 68 | * 69 | * first: ReactPropTypes.number.isRequired, 70 | 71 | /** 72 | * A cursor that matches `page_info { end_cursor }` returned from a previous 73 | * call to `getPhotos` 74 | * 75 | * after: ReactPropTypes.string, 76 | 77 | /** 78 | * Specifies which group types to filter the results to. 79 | * 80 | * groupTypes: ReactPropTypes.oneOf(GROUP_TYPES_OPTIONS), 81 | 82 | /** 83 | * Specifies filter on group names, like 'Recent Photos' or custom album 84 | * titles. 85 | * 86 | * groupName: ReactPropTypes.string, 87 | 88 | /** 89 | * Specifies filter on asset type 90 | * 91 | * assetType: ReactPropTypes.oneOf(ASSET_TYPE_OPTIONS), 92 | 93 | /** 94 | * Filter by mimetype (e.g. image/jpeg). 95 | * 96 | * mimeTypes: ReactPropTypes.arrayOf(ReactPropTypes.string) 97 | */ 98 | CameraRoll.getPhotos(fetchParams).then(that.storeImages.bind(that)).catch(that.logImageError.bind(that)); 99 | } 100 | storeImages(data) { 101 | let that=this; 102 | const assets = data.edges; 103 | const images = assets.map((asset) => asset.node.image); 104 | Alert.alert('','获取本地图片成功',[{text:'ok',onPress:()=>{ 105 | that.setState({ 106 | num:assets.length 107 | }) 108 | 109 | }}]); 110 | this.setState({ 111 | images: images, 112 | }); 113 | } 114 | 115 | logImageError(err) { 116 | /** 117 | * arguments[0]title 118 | * arguments[1]message 119 | * arguments[2]options:{text:string,onPress:'callback',style:['cancel','destructive','default']} 120 | */ 121 | console.error(err); 122 | Alert.alert( 123 | '', 124 | 'err happened', 125 | [ 126 | {text: 'Cancel', onPress: () => Alert.alert('Cancel=> Pressed'), style: 'cancel'}, 127 | {text: 'OK', onPress: () => Alert.alert('ok=> Pressed'),style:'destructive'} 128 | ] 129 | ) 130 | } 131 | 132 | render() { 133 | return ( 134 | 135 | 137 | 138 | 点击获取本地图片 139 | 140 | { 141 | !this.state.num?null:( 142 | 143 | 共获取到{this.state.num}张图 144 | ) 145 | } 146 | 147 | 148 | 149 | 150 | { this.state.images.map((image) => ) } 151 | 152 | 153 | 154 | 155 | ); 156 | } 157 | } -------------------------------------------------------------------------------- /components/localApi/network.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by slashhuang on 16/3/31. 3 | */ 4 | 5 | import React ,{ 6 | Component, 7 | View, 8 | TouchableOpacity, 9 | StyleSheet, 10 | Text, 11 | PixelRatio, 12 | Image, 13 | ActivityIndicatorIOS, 14 | Alert 15 | } from 'react-native'; 16 | import TimerMixin from 'react-timer-mixin'; 17 | /** 18 | * RN内置fetch,已经通过标准委员会,并在chrome中内置实现 19 | */ 20 | export default class httpDemo extends Component{ 21 | constructor(){ 22 | super(); 23 | this.state={ 24 | futureTeam:null, 25 | slashHuang:null 26 | } 27 | } 28 | /** 29 | * info设计成了state的key 30 | * @param info 31 | */ 32 | async getInfo(type){ 33 | const urlPrefix = 'https://api.github.com'; 34 | //由于有type作为key,不必担心闭包引起的变量冲突问题 35 | // 仅仅针对某个key进行state状态的改变 36 | let targetState={}; 37 | targetState[type]={}; 38 | let fetchUrl = urlPrefix+''; 39 | switch (type){ 40 | case 'futureTeam': 41 | fetchUrl+= '/orgs/future-team'; 42 | break; 43 | case 'slashHuang': 44 | fetchUrl+= '/users/slashHuang'; 45 | break; 46 | } 47 | targetState[type].loading=true; 48 | //执行对应条目的loading 49 | this.setState(targetState); 50 | /** 51 | * 模拟网络请求 52 | */ 53 | this.setTimeout(()=>{ 54 | fetch(fetchUrl,{method: 'GET'}) 55 | .then((response)=>response.json()) 56 | .then((responseText)=> { 57 | Object.assign(targetState[type],responseText,{loading:false}); 58 | this.setState(targetState)}) 59 | .catch((e)=>{ 60 | Alert.alert('出错了'); 61 | Object.assign(targetState[type],{loading:false}); 62 | this.setState(targetState) 63 | })},500); 64 | } 65 | 66 | /** 67 | * 处理加载 68 | */ 69 | renderLoading(){ 70 | 71 | return ( 72 | 73 | ) 74 | 75 | } 76 | /** 77 | * 处理信息 78 | */ 79 | renderDetail(info){ 80 | 81 | return ( 82 | 83 | 85 | 86 | blog地址: {info['blog']} 87 | 88 | 89 | location地址: {info['location']||''} 90 | 91 | 92 | 开源项目数: {info['public_repos']||''} 93 | 94 | ) 95 | } 96 | renderInfo(type){ 97 | let info=this.state[type]; 98 | //键值大于1表明有信息返回 99 | let infoReady = info && Object.keys(info).length>1; 100 | let renderLoading =info && info.loading?this.renderLoading():null; 101 | return ( 102 | 103 | 106 | 107 | 点击获取{type}的信息 108 | 109 | 110 | {/* 111 | 优先渲染info,其次才在界面上显示加载图标 112 | */} 113 | {infoReady?this.renderDetail(info):renderLoading} 114 | 115 | ) 116 | } 117 | render(){ 118 | return ( 119 | 120 | { this.renderInfo.call(this,'futureTeam')} 121 | { this.renderInfo.call(this,'slashHuang')} 122 | ) 123 | } 124 | } 125 | /** 126 | * 自动在component unmount的时候,去除time操作 127 | */ 128 | Object.assign(httpDemo.prototype,TimerMixin); 129 | 130 | let httpStyles= StyleSheet.create({ 131 | container:{ 132 | flex:1 133 | }, 134 | centerStyle:{ 135 | justifyContent:'center', 136 | alignItems:'center' 137 | }, 138 | clickPart:{ 139 | height:40, 140 | borderTopColor:'#ddd', 141 | borderTopWidth:1/PixelRatio.get(), 142 | borderBottomColor:'#ddd', 143 | borderBottomWidth:1/PixelRatio.get(), 144 | justifyContent:'center', 145 | alignItems:'center' 146 | }, 147 | infoPart:{ 148 | justifyContent:'flex-start', 149 | alignItems:'center', 150 | backgroundColor:'aliceblue' 151 | }, 152 | textStyle:{ 153 | fontSize:16, 154 | lineHeight:20, 155 | textShadowColor:'dimgray' 156 | } 157 | }); -------------------------------------------------------------------------------- /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: "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 | */ 61 | 62 | apply from: "react.gradle" 63 | 64 | /** 65 | * Set this to true to create two separate APKs instead of one: 66 | * - An APK that only works on ARM devices 67 | * - An APK that only works on x86 devices 68 | * The advantage is the size of the APK is reduced by about 4MB. 69 | * Upload all the APKs to the Play Store and people will download 70 | * the correct one based on the CPU architecture of their device. 71 | */ 72 | def enableSeparateBuildPerCPUArchitecture = false 73 | 74 | /** 75 | * Run Proguard to shrink the Java bytecode in release builds. 76 | */ 77 | def enableProguardInReleaseBuilds = false 78 | 79 | android { 80 | compileSdkVersion 23 81 | buildToolsVersion "23.0.1" 82 | 83 | defaultConfig { 84 | applicationId "com.mocktmall" 85 | minSdkVersion 16 86 | targetSdkVersion 22 87 | versionCode 1 88 | versionName "1.0" 89 | ndk { 90 | abiFilters "armeabi-v7a", "x86" 91 | } 92 | } 93 | splits { 94 | abi { 95 | reset() 96 | enable enableSeparateBuildPerCPUArchitecture 97 | universalApk false // If true, also generate a universal APK 98 | include "armeabi-v7a", "x86" 99 | } 100 | } 101 | buildTypes { 102 | release { 103 | minifyEnabled enableProguardInReleaseBuilds 104 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" 105 | } 106 | } 107 | // applicationVariants are e.g. debug, release 108 | applicationVariants.all { variant -> 109 | variant.outputs.each { output -> 110 | // For each separate APK per architecture, set a unique version code as described here: 111 | // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits 112 | def versionCodes = ["armeabi-v7a":1, "x86":2] 113 | def abi = output.getFilter(OutputFile.ABI) 114 | if (abi != null) { // null for the universal-debug, universal-release variants 115 | output.versionCodeOverride = 116 | versionCodes.get(abi) * 1048576 + defaultConfig.versionCode 117 | } 118 | } 119 | } 120 | } 121 | 122 | dependencies { 123 | compile fileTree(dir: "libs", include: ["*.jar"]) 124 | compile "com.android.support:appcompat-v7:23.0.1" 125 | compile "com.facebook.react:react-native:+" // From node_modules 126 | } 127 | -------------------------------------------------------------------------------- /components/lib/Image.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by slashhuang on 16/3/25. 3 | */ 4 | 5 | import React,{ 6 | Component, 7 | StyleSheet, 8 | Image, 9 | Text, 10 | View, 11 | ActivityIndicatorIOS 12 | } from 'react-native'; 13 | 14 | var NetworkImageExample = React.createClass({ 15 | getInitialState: function() { 16 | return { 17 | error: false, 18 | loading: true, 19 | progress: 0 20 | }; 21 | }, 22 | getDefaultProps: function(){ 23 | return { 24 | source:{uri:'http://www.pp3.cn/uploads/allimg/111120/1029163a1-5.jpg'} 25 | } 26 | }, 27 | render: function() { 28 | var loader = this.state.loading ? 29 | 30 | 31 | 32 | {this.state.progress||999}% 33 | 34 | 39 | 40 | : null; 41 | return this.state.error ? 42 | {'error happened'} : 43 | 44 | {/* 45 | this.setState({loading: true})} 49 | onError={(e) => this.setState({error: e.nativeEvent.error, loading: false})} 50 | onProgress={(e) => this.setState({progress: Math.round(100 * e.nativeEvent.loaded / e.nativeEvent.total)})} 51 | onLoad={() => setTimeout(()=>this.setState({loading: false, error: false}),2000)} /> 52 | */} 53 | {loader} 54 | 55 | } 56 | }); 57 | 58 | class NetworkImageCallbackExample extends Component{ 59 | constructor(props) { 60 | super(props); 61 | this.state = { 62 | events: [], 63 | mountTime: new Date(), 64 | }; 65 | } 66 | static defaultProps={ 67 | source:{uri:'http://www.deskcar.com/desktop/else/2012517235524/18.jpg'} 68 | }; 69 | componentWillMount(){ 70 | this.setState({mountTime: new Date()}); 71 | } 72 | _loadEventFired(event) { 73 | /** 74 | * 在回调函数中仅仅设置events,优化了性能 75 | */ 76 | this.setState((state) => { 77 | return state.events = [...state.events, event]; 78 | }); 79 | } 80 | render(){ 81 | var { mountTime } = this.state; 82 | return ( 83 | 84 | 85 | this._loadEventFired(`✔ onLoadStart (+${new Date() - mountTime}ms)`)} 88 | onLoad={() => this._loadEventFired(`✔ onLoad (+${new Date() - mountTime}ms)`)} 89 | onLoadEnd={() => this._loadEventFired(`✔ onLoadEnd (+${new Date() - mountTime}ms)`)} 90 | /> 91 | 92 | 93 | 94 | {this.state.events.join(' ')} 95 | 96 | 97 | ) 98 | } 99 | } 100 | export default class ImageDemo extends Component{ 101 | constructor(props){ 102 | super(props); 103 | } 104 | render(){ 105 | return ( 106 | 107 | 108 | 109 | ) 110 | } 111 | } 112 | let styles=StyleSheet.create({ 113 | container:{ 114 | height:200, 115 | backgroundColor:'rgba(255,255,255,0.3)' 116 | }, 117 | text:{ 118 | fontSize:12, 119 | color:'sienna' 120 | }, 121 | base: { 122 | flex:1, 123 | backgroundColor:'rgba(255,255,255,0.3)' 124 | }, 125 | flexCenter:{ 126 | flex:1, 127 | justifyContent:'center', 128 | alignItems:'center' 129 | }, 130 | row: { 131 | flexDirection: 'row', 132 | }, 133 | leftMargin: { 134 | marginLeft: 10, 135 | }, 136 | background: { 137 | backgroundColor: '#222222' 138 | }, 139 | sectionText: { 140 | marginVertical: 6, 141 | }, 142 | nestedText: { 143 | marginLeft: 12, 144 | marginTop: 20, 145 | backgroundColor: 'transparent', 146 | color: 'white' 147 | }, 148 | resizeMode: { 149 | width: 90, 150 | height: 60, 151 | borderWidth: 0.5, 152 | borderColor: 'black' 153 | }, 154 | resizeModeText: { 155 | fontSize: 11, 156 | marginBottom: 3, 157 | }, 158 | icon: { 159 | width: 15, 160 | height: 15, 161 | }, 162 | horizontal: { 163 | flexDirection: 'row', 164 | }, 165 | gif: { 166 | flex: 1, 167 | height: 200, 168 | }, 169 | base64: { 170 | flex: 1, 171 | height: 50, 172 | resizeMode: 'contain', 173 | } 174 | }); 175 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /components/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by slashhuang on 16/3/22. 3 | */ 4 | import React,{ 5 | View, 6 | Component, 7 | StyleSheet, 8 | Text, 9 | Image, 10 | TouchableHighlight, 11 | Animated, 12 | Navigator 13 | } from 'react-native'; 14 | 15 | //引入博客webview 16 | import Blog from './webview/slashhuang.js'; 17 | //引入自定义的IOS组件界面 18 | import CustomComponents from './customComponents/demoList.js'; 19 | 20 | class HomePage extends Component { 21 | constructor(props) { 22 | super(props); 23 | this.touchConfigs={ 24 | underlayColor:'#222',//触摸操作,显示的底层颜色 25 | delayLongPress:1000//延迟长按相应时间 26 | }; 27 | this.state={ 28 | fadeAnim:new Animated.Value(0.3) 29 | } 30 | } 31 | 32 | /** 33 | * 增加对animation属性的测试 34 | */ 35 | componentDidMount() { 36 | Animated.timing( // Uses easing functions 37 | this.state.fadeAnim, // The value to drive 38 | { 39 | toValue: 1, // Target 40 | duration: 1000, // Configuration 41 | } 42 | ).start(); // Don't forget start! 43 | } 44 | jumpToWebWiew(url,title){ 45 | /** 46 | * @ TODO 改变navigation title颜色 47 | */ 48 | this.props.navigator.push({ 49 | component:Blog, 50 | url:url, 51 | title:title 52 | }) 53 | } 54 | jumpToCustomItems(){ 55 | this.props.navigator.push({ 56 | component:CustomComponents, 57 | title:'查看自定义IOS组件' 58 | }) 59 | 60 | } 61 | /** 62 | * resizeMode只有contain cover stretch 63 | * @return {XML} 64 | */ 65 | render() { 66 | const slash = 'http://slashhuang.github.io'; 67 | const team ='http://uedfamily.com'; 68 | return ( 69 | 70 | 74 | 78 | 79 | 作者:slashhuang 80 | 81 | 82 | 83 | 84 | - 这个React Native开发的APP集成了RN提供的主要组件{'\n'} 87 | - 语法采用ECMAScript6{'\n'} 88 | - 功能点包括WebView,TabBar,图片浏览,进度条,动画{'\n'} 89 | - 可以在这个demo基础上进行二次开发 90 | 91 | 作者:slashhuang 92 | 93 | 94 | 98 | 99 | 查看future-team技术博客 100 | 101 | 102 | 103 | 107 | 108 | 查看踩坑过程 109 | 110 | 111 | 112 | 117 | 查看IOS组件 118 | 119 | 120 | 121 | ); 122 | } 123 | }; 124 | /** 125 | * 心得1:flexDirection在react-native中默认是垂直布局的 126 | */ 127 | var styles = StyleSheet.create({ 128 | container:{ 129 | flex:1, 130 | flexDirection:'column' 131 | }, 132 | headerWrapper:{ 133 | flex:3, 134 | backgroundColor:'#ddd' 135 | }, 136 | content:{ 137 | flex:5, 138 | backgroundColor:'#000' 139 | }, 140 | image:{ 141 | flex:1 142 | }, 143 | composerView:{ 144 | position:'absolute', 145 | bottom:0, 146 | left:0, 147 | right:0, 148 | height:30, 149 | backgroundColor:'#000', 150 | opacity:0.5, 151 | alignItems:'center' 152 | }, 153 | author:{ 154 | position:'absolute', 155 | right:20, 156 | marginTop:4, 157 | fontSize:12, 158 | color:'#fff' 159 | }, 160 | idioms:{ 161 | flex:2, 162 | paddingHorizontal:10, 163 | paddingVertical:17, 164 | marginTop:17, 165 | marginBottom:17, 166 | backgroundColor: '#434243', 167 | alignItems: 'center', 168 | justifyContent: 'flex-start', 169 | }, 170 | personalText:{ 171 | color:'#fff', 172 | fontSize:14, 173 | lineHeight:17 174 | }, 175 | dateAuthor: { 176 | fontSize: 14, 177 | color: 'white', 178 | position: 'absolute', 179 | left: 16, 180 | bottom: 18 181 | }, 182 | touchHighLight:{ 183 | flex:1, 184 | marginBottom:10, 185 | backgroundColor: '#434243', 186 | alignItems: 'center', 187 | justifyContent: 'center' 188 | }, 189 | textHint: { 190 | fontSize: 14, 191 | color: 'white' 192 | } 193 | }); 194 | export default HomePage; 195 | -------------------------------------------------------------------------------- /components/localApi/Animation.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | import React from 'react-native' 3 | var { 4 | StyleSheet, 5 | View, 6 | Component, 7 | Animated,//动画组件用来创造流畅、强大、并且易于构建和维护的动画。把它绑定到组件的一个或多个样式属性上。然后可以通过动画驱动它 8 | Image, 9 | TouchableHighlight, 10 | Text 11 | } = React; 12 | /** 13 | * Animation本质上就是样式,完全可以参照css3的学习方式。 14 | * React Native动画默认提供了基础的一些效果,例如spring中的tension等。 15 | * 在写UI界面的时候,基本可以将注意点放在transform数组里面。 16 | * 样式自动在绑定的数值发生变化时候,进行帧的渲染。 17 | */ 18 | class AnimationDemo extends Component { 19 | constructor (...args) { 20 | super(...args) 21 | this.state = ({ 22 | isPlaying: true, 23 | fadeAnimLogo: new Animated.Value(0), // 设置动画初始值,生成Value对象 24 | fadeAnimText0: new Animated.Value(0), 25 | fadeAnimText1: new Animated.Value(0), 26 | fadeAnimLayout: new Animated.Value(1), 27 | animtext:new Animated.Value(1) 28 | }) 29 | } 30 | componentDidMount () { 31 | let timing = Animated.timing; 32 | //序列化动画 33 | Animated.sequence([ 34 | timing(this.state.fadeAnimLogo, { 35 | toValue: 1, 36 | duration: 800 37 | }), 38 | timing(this.state.fadeAnimText0, { 39 | toValue: 1, 40 | duration: 800 41 | }), 42 | timing(this.state.fadeAnimText1, { 43 | toValue: 1, 44 | duration: 800 45 | }), 46 | Animated.spring(this.state.animtext, { 47 | //它会在toValue值更新的同时跟踪当前的速度状态,以确保动画连贯 48 | toValue: 0, // Returns to the start 49 | velocity: 3, // Velocity makes it move 50 | tension: -10, // Slow 51 | friction: 1, // Oscillate a lot 52 | }) 53 | 54 | ]).start(() => { 55 | setTimeout(() =>{ 56 | this.setState({isPlaying:false}) 57 | this._hideWelcome(); 58 | } , 0); 59 | }); 60 | 61 | } 62 | 63 | _hideWelcome () { 64 | if (this.state.isPlaying) { 65 | return 66 | } 67 | /** 68 | * 添加Animated属性的UI类会不断监听数据变化,并刷新界面 69 | * 把动画数值绑定到属性上,然后在每帧去执行原生更新 70 | */ 71 | Animated.timing( 72 | this.state.fadeAnimLayout, 73 | { 74 | toValue: 0.8, 75 | duration: 1000 76 | }).start() 77 | } 78 | 79 | render () { 80 | return ( 81 | 82 | {this._welcome()} 83 | 84 | ) 85 | } 86 | 87 | _welcome () { 88 | return ( 89 | 91 | 102 | 103 | 104 | 105 | 106 | 114 | Supported by: future-team 115 | 116 | 117 | 125 | written by: slashHuang 126 | 127 | 128 | 152 | {this.state.isPlaying?'我动了':'我动完了'}! 153 | 154 | 155 | ) 156 | } 157 | } 158 | 159 | var styles = StyleSheet.create({ 160 | container: { 161 | flex: 1 162 | }, 163 | content: { 164 | backgroundColor: '#eee', 165 | flex: 1 166 | }, 167 | indicatorWrapper: { 168 | flex: 1, 169 | backgroundColor:'black' 170 | }, 171 | footerText: { 172 | color: '#aaaaaa', 173 | fontSize: 22 174 | } 175 | }); 176 | 177 | export default AnimationDemo 178 | -------------------------------------------------------------------------------- /ios/mockTMall.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */; }; 11 | 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */; }; 12 | 00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */; }; 13 | 00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */; }; 14 | 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */; }; 15 | 00E356F31AD99517003FC87E /* mockTMallTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* mockTMallTests.m */; }; 16 | 133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 78C398B91ACF4ADC00677621 /* libRCTLinking.a */; }; 17 | 139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */; }; 18 | 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */; }; 19 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; }; 20 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 21 | 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; 22 | 146834051AC3E58100842450 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; }; 23 | 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; }; 24 | CC153B151CABC93E0005FB0C /* libRCTCameraRoll.a in Frameworks */ = {isa = PBXBuildFile; fileRef = CC153B0B1CABC8E50005FB0C /* libRCTCameraRoll.a */; }; 25 | /* End PBXBuildFile section */ 26 | 27 | /* Begin PBXContainerItemProxy section */ 28 | 00C302AB1ABCB8CE00DB3ED1 /* PBXContainerItemProxy */ = { 29 | isa = PBXContainerItemProxy; 30 | containerPortal = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */; 31 | proxyType = 2; 32 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 33 | remoteInfo = RCTActionSheet; 34 | }; 35 | 00C302B91ABCB90400DB3ED1 /* PBXContainerItemProxy */ = { 36 | isa = PBXContainerItemProxy; 37 | containerPortal = 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */; 38 | proxyType = 2; 39 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 40 | remoteInfo = RCTGeolocation; 41 | }; 42 | 00C302BF1ABCB91800DB3ED1 /* PBXContainerItemProxy */ = { 43 | isa = PBXContainerItemProxy; 44 | containerPortal = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */; 45 | proxyType = 2; 46 | remoteGlobalIDString = 58B5115D1A9E6B3D00147676; 47 | remoteInfo = RCTImage; 48 | }; 49 | 00C302DB1ABCB9D200DB3ED1 /* PBXContainerItemProxy */ = { 50 | isa = PBXContainerItemProxy; 51 | containerPortal = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */; 52 | proxyType = 2; 53 | remoteGlobalIDString = 58B511DB1A9E6C8500147676; 54 | remoteInfo = RCTNetwork; 55 | }; 56 | 00C302E31ABCB9EE00DB3ED1 /* PBXContainerItemProxy */ = { 57 | isa = PBXContainerItemProxy; 58 | containerPortal = 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */; 59 | proxyType = 2; 60 | remoteGlobalIDString = 832C81801AAF6DEF007FA2F7; 61 | remoteInfo = RCTVibration; 62 | }; 63 | 00E356F41AD99517003FC87E /* PBXContainerItemProxy */ = { 64 | isa = PBXContainerItemProxy; 65 | containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */; 66 | proxyType = 1; 67 | remoteGlobalIDString = 13B07F861A680F5B00A75B9A; 68 | remoteInfo = mockTMall; 69 | }; 70 | 139105C01AF99BAD00B5F7CC /* PBXContainerItemProxy */ = { 71 | isa = PBXContainerItemProxy; 72 | containerPortal = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */; 73 | proxyType = 2; 74 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 75 | remoteInfo = RCTSettings; 76 | }; 77 | 139FDEF31B06529B00C62182 /* PBXContainerItemProxy */ = { 78 | isa = PBXContainerItemProxy; 79 | containerPortal = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */; 80 | proxyType = 2; 81 | remoteGlobalIDString = 3C86DF461ADF2C930047B81A; 82 | remoteInfo = RCTWebSocket; 83 | }; 84 | 146834031AC3E56700842450 /* PBXContainerItemProxy */ = { 85 | isa = PBXContainerItemProxy; 86 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 87 | proxyType = 2; 88 | remoteGlobalIDString = 83CBBA2E1A601D0E00E9B192; 89 | remoteInfo = React; 90 | }; 91 | 78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */ = { 92 | isa = PBXContainerItemProxy; 93 | containerPortal = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */; 94 | proxyType = 2; 95 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 96 | remoteInfo = RCTLinking; 97 | }; 98 | 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */ = { 99 | isa = PBXContainerItemProxy; 100 | containerPortal = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */; 101 | proxyType = 2; 102 | remoteGlobalIDString = 58B5119B1A9E6C1200147676; 103 | remoteInfo = RCTText; 104 | }; 105 | CC153B0A1CABC8E50005FB0C /* PBXContainerItemProxy */ = { 106 | isa = PBXContainerItemProxy; 107 | containerPortal = CC153B051CABC8E40005FB0C /* RCTCameraRoll.xcodeproj */; 108 | proxyType = 2; 109 | remoteGlobalIDString = 58B5115D1A9E6B3D00147676; 110 | remoteInfo = RCTCameraRoll; 111 | }; 112 | /* End PBXContainerItemProxy section */ 113 | 114 | /* Begin PBXFileReference section */ 115 | 008F07F21AC5B25A0029DE68 /* main.jsbundle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = main.jsbundle; sourceTree = ""; }; 116 | 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTActionSheet.xcodeproj; path = "../node_modules/react-native/Libraries/ActionSheetIOS/RCTActionSheet.xcodeproj"; sourceTree = ""; }; 117 | 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTGeolocation.xcodeproj; path = "../node_modules/react-native/Libraries/Geolocation/RCTGeolocation.xcodeproj"; sourceTree = ""; }; 118 | 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTImage.xcodeproj; path = "../node_modules/react-native/Libraries/Image/RCTImage.xcodeproj"; sourceTree = ""; }; 119 | 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTNetwork.xcodeproj; path = "../node_modules/react-native/Libraries/Network/RCTNetwork.xcodeproj"; sourceTree = ""; }; 120 | 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTVibration.xcodeproj; path = "../node_modules/react-native/Libraries/Vibration/RCTVibration.xcodeproj"; sourceTree = ""; }; 121 | 00E356EE1AD99517003FC87E /* mockTMallTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = mockTMallTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 122 | 00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 123 | 00E356F21AD99517003FC87E /* mockTMallTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = mockTMallTests.m; sourceTree = ""; }; 124 | 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTSettings.xcodeproj; path = "../node_modules/react-native/Libraries/Settings/RCTSettings.xcodeproj"; sourceTree = ""; }; 125 | 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTWebSocket.xcodeproj; path = "../node_modules/react-native/Libraries/WebSocket/RCTWebSocket.xcodeproj"; sourceTree = ""; }; 126 | 13B07F961A680F5B00A75B9A /* mockTMall.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = mockTMall.app; sourceTree = BUILT_PRODUCTS_DIR; }; 127 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = mockTMall/AppDelegate.h; sourceTree = ""; }; 128 | 13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = mockTMall/AppDelegate.m; sourceTree = ""; }; 129 | 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = mockTMall/Images.xcassets; sourceTree = ""; }; 130 | 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = mockTMall/Info.plist; sourceTree = ""; }; 131 | 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = mockTMall/main.m; sourceTree = ""; }; 132 | 146833FF1AC3E56700842450 /* React.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = React.xcodeproj; path = "../node_modules/react-native/React/React.xcodeproj"; sourceTree = ""; }; 133 | 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = "../node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj"; sourceTree = ""; }; 134 | 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "../node_modules/react-native/Libraries/Text/RCTText.xcodeproj"; sourceTree = ""; }; 135 | CC153B051CABC8E40005FB0C /* RCTCameraRoll.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTCameraRoll.xcodeproj; path = "../node_modules/react-native/Libraries/CameraRoll/RCTCameraRoll.xcodeproj"; sourceTree = ""; }; 136 | /* End PBXFileReference section */ 137 | 138 | /* Begin PBXFrameworksBuildPhase section */ 139 | 00E356EB1AD99517003FC87E /* Frameworks */ = { 140 | isa = PBXFrameworksBuildPhase; 141 | buildActionMask = 2147483647; 142 | files = ( 143 | ); 144 | runOnlyForDeploymentPostprocessing = 0; 145 | }; 146 | 13B07F8C1A680F5B00A75B9A /* Frameworks */ = { 147 | isa = PBXFrameworksBuildPhase; 148 | buildActionMask = 2147483647; 149 | files = ( 150 | CC153B151CABC93E0005FB0C /* libRCTCameraRoll.a in Frameworks */, 151 | 146834051AC3E58100842450 /* libReact.a in Frameworks */, 152 | 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */, 153 | 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */, 154 | 00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */, 155 | 133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */, 156 | 00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */, 157 | 139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */, 158 | 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */, 159 | 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */, 160 | 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */, 161 | ); 162 | runOnlyForDeploymentPostprocessing = 0; 163 | }; 164 | /* End PBXFrameworksBuildPhase section */ 165 | 166 | /* Begin PBXGroup section */ 167 | 00C302A81ABCB8CE00DB3ED1 /* Products */ = { 168 | isa = PBXGroup; 169 | children = ( 170 | 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */, 171 | ); 172 | name = Products; 173 | sourceTree = ""; 174 | }; 175 | 00C302B61ABCB90400DB3ED1 /* Products */ = { 176 | isa = PBXGroup; 177 | children = ( 178 | 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */, 179 | ); 180 | name = Products; 181 | sourceTree = ""; 182 | }; 183 | 00C302BC1ABCB91800DB3ED1 /* Products */ = { 184 | isa = PBXGroup; 185 | children = ( 186 | 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */, 187 | ); 188 | name = Products; 189 | sourceTree = ""; 190 | }; 191 | 00C302D41ABCB9D200DB3ED1 /* Products */ = { 192 | isa = PBXGroup; 193 | children = ( 194 | 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */, 195 | ); 196 | name = Products; 197 | sourceTree = ""; 198 | }; 199 | 00C302E01ABCB9EE00DB3ED1 /* Products */ = { 200 | isa = PBXGroup; 201 | children = ( 202 | 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */, 203 | ); 204 | name = Products; 205 | sourceTree = ""; 206 | }; 207 | 00E356EF1AD99517003FC87E /* mockTMallTests */ = { 208 | isa = PBXGroup; 209 | children = ( 210 | 00E356F21AD99517003FC87E /* mockTMallTests.m */, 211 | 00E356F01AD99517003FC87E /* Supporting Files */, 212 | ); 213 | path = mockTMallTests; 214 | sourceTree = ""; 215 | }; 216 | 00E356F01AD99517003FC87E /* Supporting Files */ = { 217 | isa = PBXGroup; 218 | children = ( 219 | 00E356F11AD99517003FC87E /* Info.plist */, 220 | ); 221 | name = "Supporting Files"; 222 | sourceTree = ""; 223 | }; 224 | 139105B71AF99BAD00B5F7CC /* Products */ = { 225 | isa = PBXGroup; 226 | children = ( 227 | 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */, 228 | ); 229 | name = Products; 230 | sourceTree = ""; 231 | }; 232 | 139FDEE71B06529A00C62182 /* Products */ = { 233 | isa = PBXGroup; 234 | children = ( 235 | 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */, 236 | ); 237 | name = Products; 238 | sourceTree = ""; 239 | }; 240 | 13B07FAE1A68108700A75B9A /* mockTMall */ = { 241 | isa = PBXGroup; 242 | children = ( 243 | 008F07F21AC5B25A0029DE68 /* main.jsbundle */, 244 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */, 245 | 13B07FB01A68108700A75B9A /* AppDelegate.m */, 246 | 13B07FB51A68108700A75B9A /* Images.xcassets */, 247 | 13B07FB61A68108700A75B9A /* Info.plist */, 248 | 13B07FB71A68108700A75B9A /* main.m */, 249 | ); 250 | name = mockTMall; 251 | sourceTree = ""; 252 | }; 253 | 146834001AC3E56700842450 /* Products */ = { 254 | isa = PBXGroup; 255 | children = ( 256 | 146834041AC3E56700842450 /* libReact.a */, 257 | ); 258 | name = Products; 259 | sourceTree = ""; 260 | }; 261 | 78C398B11ACF4ADC00677621 /* Products */ = { 262 | isa = PBXGroup; 263 | children = ( 264 | 78C398B91ACF4ADC00677621 /* libRCTLinking.a */, 265 | ); 266 | name = Products; 267 | sourceTree = ""; 268 | }; 269 | 832341AE1AAA6A7D00B99B32 /* Libraries */ = { 270 | isa = PBXGroup; 271 | children = ( 272 | CC153B051CABC8E40005FB0C /* RCTCameraRoll.xcodeproj */, 273 | 146833FF1AC3E56700842450 /* React.xcodeproj */, 274 | 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */, 275 | 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */, 276 | 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */, 277 | 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */, 278 | 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */, 279 | 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */, 280 | 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */, 281 | 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */, 282 | 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */, 283 | ); 284 | name = Libraries; 285 | sourceTree = ""; 286 | }; 287 | 832341B11AAA6A8300B99B32 /* Products */ = { 288 | isa = PBXGroup; 289 | children = ( 290 | 832341B51AAA6A8300B99B32 /* libRCTText.a */, 291 | ); 292 | name = Products; 293 | sourceTree = ""; 294 | }; 295 | 83CBB9F61A601CBA00E9B192 = { 296 | isa = PBXGroup; 297 | children = ( 298 | 13B07FAE1A68108700A75B9A /* mockTMall */, 299 | 832341AE1AAA6A7D00B99B32 /* Libraries */, 300 | 00E356EF1AD99517003FC87E /* mockTMallTests */, 301 | 83CBBA001A601CBA00E9B192 /* Products */, 302 | ); 303 | indentWidth = 2; 304 | sourceTree = ""; 305 | tabWidth = 2; 306 | }; 307 | 83CBBA001A601CBA00E9B192 /* Products */ = { 308 | isa = PBXGroup; 309 | children = ( 310 | 13B07F961A680F5B00A75B9A /* mockTMall.app */, 311 | 00E356EE1AD99517003FC87E /* mockTMallTests.xctest */, 312 | ); 313 | name = Products; 314 | sourceTree = ""; 315 | }; 316 | CC153B061CABC8E40005FB0C /* Products */ = { 317 | isa = PBXGroup; 318 | children = ( 319 | CC153B0B1CABC8E50005FB0C /* libRCTCameraRoll.a */, 320 | ); 321 | name = Products; 322 | sourceTree = ""; 323 | }; 324 | /* End PBXGroup section */ 325 | 326 | /* Begin PBXNativeTarget section */ 327 | 00E356ED1AD99517003FC87E /* mockTMallTests */ = { 328 | isa = PBXNativeTarget; 329 | buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "mockTMallTests" */; 330 | buildPhases = ( 331 | 00E356EA1AD99517003FC87E /* Sources */, 332 | 00E356EB1AD99517003FC87E /* Frameworks */, 333 | 00E356EC1AD99517003FC87E /* Resources */, 334 | ); 335 | buildRules = ( 336 | ); 337 | dependencies = ( 338 | 00E356F51AD99517003FC87E /* PBXTargetDependency */, 339 | ); 340 | name = mockTMallTests; 341 | productName = mockTMallTests; 342 | productReference = 00E356EE1AD99517003FC87E /* mockTMallTests.xctest */; 343 | productType = "com.apple.product-type.bundle.unit-test"; 344 | }; 345 | 13B07F861A680F5B00A75B9A /* mockTMall */ = { 346 | isa = PBXNativeTarget; 347 | buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "mockTMall" */; 348 | buildPhases = ( 349 | 13B07F871A680F5B00A75B9A /* Sources */, 350 | 13B07F8C1A680F5B00A75B9A /* Frameworks */, 351 | 13B07F8E1A680F5B00A75B9A /* Resources */, 352 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */, 353 | ); 354 | buildRules = ( 355 | ); 356 | dependencies = ( 357 | ); 358 | name = mockTMall; 359 | productName = "Hello World"; 360 | productReference = 13B07F961A680F5B00A75B9A /* mockTMall.app */; 361 | productType = "com.apple.product-type.application"; 362 | }; 363 | /* End PBXNativeTarget section */ 364 | 365 | /* Begin PBXProject section */ 366 | 83CBB9F71A601CBA00E9B192 /* Project object */ = { 367 | isa = PBXProject; 368 | attributes = { 369 | LastUpgradeCheck = 0610; 370 | ORGANIZATIONNAME = Facebook; 371 | TargetAttributes = { 372 | 00E356ED1AD99517003FC87E = { 373 | CreatedOnToolsVersion = 6.2; 374 | TestTargetID = 13B07F861A680F5B00A75B9A; 375 | }; 376 | }; 377 | }; 378 | buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "mockTMall" */; 379 | compatibilityVersion = "Xcode 3.2"; 380 | developmentRegion = English; 381 | hasScannedForEncodings = 0; 382 | knownRegions = ( 383 | en, 384 | Base, 385 | ); 386 | mainGroup = 83CBB9F61A601CBA00E9B192; 387 | productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */; 388 | projectDirPath = ""; 389 | projectReferences = ( 390 | { 391 | ProductGroup = 00C302A81ABCB8CE00DB3ED1 /* Products */; 392 | ProjectRef = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */; 393 | }, 394 | { 395 | ProductGroup = CC153B061CABC8E40005FB0C /* Products */; 396 | ProjectRef = CC153B051CABC8E40005FB0C /* RCTCameraRoll.xcodeproj */; 397 | }, 398 | { 399 | ProductGroup = 00C302B61ABCB90400DB3ED1 /* Products */; 400 | ProjectRef = 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */; 401 | }, 402 | { 403 | ProductGroup = 00C302BC1ABCB91800DB3ED1 /* Products */; 404 | ProjectRef = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */; 405 | }, 406 | { 407 | ProductGroup = 78C398B11ACF4ADC00677621 /* Products */; 408 | ProjectRef = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */; 409 | }, 410 | { 411 | ProductGroup = 00C302D41ABCB9D200DB3ED1 /* Products */; 412 | ProjectRef = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */; 413 | }, 414 | { 415 | ProductGroup = 139105B71AF99BAD00B5F7CC /* Products */; 416 | ProjectRef = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */; 417 | }, 418 | { 419 | ProductGroup = 832341B11AAA6A8300B99B32 /* Products */; 420 | ProjectRef = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */; 421 | }, 422 | { 423 | ProductGroup = 00C302E01ABCB9EE00DB3ED1 /* Products */; 424 | ProjectRef = 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */; 425 | }, 426 | { 427 | ProductGroup = 139FDEE71B06529A00C62182 /* Products */; 428 | ProjectRef = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */; 429 | }, 430 | { 431 | ProductGroup = 146834001AC3E56700842450 /* Products */; 432 | ProjectRef = 146833FF1AC3E56700842450 /* React.xcodeproj */; 433 | }, 434 | ); 435 | projectRoot = ""; 436 | targets = ( 437 | 13B07F861A680F5B00A75B9A /* mockTMall */, 438 | 00E356ED1AD99517003FC87E /* mockTMallTests */, 439 | ); 440 | }; 441 | /* End PBXProject section */ 442 | 443 | /* Begin PBXReferenceProxy section */ 444 | 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */ = { 445 | isa = PBXReferenceProxy; 446 | fileType = archive.ar; 447 | path = libRCTActionSheet.a; 448 | remoteRef = 00C302AB1ABCB8CE00DB3ED1 /* PBXContainerItemProxy */; 449 | sourceTree = BUILT_PRODUCTS_DIR; 450 | }; 451 | 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */ = { 452 | isa = PBXReferenceProxy; 453 | fileType = archive.ar; 454 | path = libRCTGeolocation.a; 455 | remoteRef = 00C302B91ABCB90400DB3ED1 /* PBXContainerItemProxy */; 456 | sourceTree = BUILT_PRODUCTS_DIR; 457 | }; 458 | 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */ = { 459 | isa = PBXReferenceProxy; 460 | fileType = archive.ar; 461 | path = libRCTImage.a; 462 | remoteRef = 00C302BF1ABCB91800DB3ED1 /* PBXContainerItemProxy */; 463 | sourceTree = BUILT_PRODUCTS_DIR; 464 | }; 465 | 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */ = { 466 | isa = PBXReferenceProxy; 467 | fileType = archive.ar; 468 | path = libRCTNetwork.a; 469 | remoteRef = 00C302DB1ABCB9D200DB3ED1 /* PBXContainerItemProxy */; 470 | sourceTree = BUILT_PRODUCTS_DIR; 471 | }; 472 | 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */ = { 473 | isa = PBXReferenceProxy; 474 | fileType = archive.ar; 475 | path = libRCTVibration.a; 476 | remoteRef = 00C302E31ABCB9EE00DB3ED1 /* PBXContainerItemProxy */; 477 | sourceTree = BUILT_PRODUCTS_DIR; 478 | }; 479 | 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */ = { 480 | isa = PBXReferenceProxy; 481 | fileType = archive.ar; 482 | path = libRCTSettings.a; 483 | remoteRef = 139105C01AF99BAD00B5F7CC /* PBXContainerItemProxy */; 484 | sourceTree = BUILT_PRODUCTS_DIR; 485 | }; 486 | 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */ = { 487 | isa = PBXReferenceProxy; 488 | fileType = archive.ar; 489 | path = libRCTWebSocket.a; 490 | remoteRef = 139FDEF31B06529B00C62182 /* PBXContainerItemProxy */; 491 | sourceTree = BUILT_PRODUCTS_DIR; 492 | }; 493 | 146834041AC3E56700842450 /* libReact.a */ = { 494 | isa = PBXReferenceProxy; 495 | fileType = archive.ar; 496 | path = libReact.a; 497 | remoteRef = 146834031AC3E56700842450 /* PBXContainerItemProxy */; 498 | sourceTree = BUILT_PRODUCTS_DIR; 499 | }; 500 | 78C398B91ACF4ADC00677621 /* libRCTLinking.a */ = { 501 | isa = PBXReferenceProxy; 502 | fileType = archive.ar; 503 | path = libRCTLinking.a; 504 | remoteRef = 78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */; 505 | sourceTree = BUILT_PRODUCTS_DIR; 506 | }; 507 | 832341B51AAA6A8300B99B32 /* libRCTText.a */ = { 508 | isa = PBXReferenceProxy; 509 | fileType = archive.ar; 510 | path = libRCTText.a; 511 | remoteRef = 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */; 512 | sourceTree = BUILT_PRODUCTS_DIR; 513 | }; 514 | CC153B0B1CABC8E50005FB0C /* libRCTCameraRoll.a */ = { 515 | isa = PBXReferenceProxy; 516 | fileType = archive.ar; 517 | path = libRCTCameraRoll.a; 518 | remoteRef = CC153B0A1CABC8E50005FB0C /* PBXContainerItemProxy */; 519 | sourceTree = BUILT_PRODUCTS_DIR; 520 | }; 521 | /* End PBXReferenceProxy section */ 522 | 523 | /* Begin PBXResourcesBuildPhase section */ 524 | 00E356EC1AD99517003FC87E /* Resources */ = { 525 | isa = PBXResourcesBuildPhase; 526 | buildActionMask = 2147483647; 527 | files = ( 528 | ); 529 | runOnlyForDeploymentPostprocessing = 0; 530 | }; 531 | 13B07F8E1A680F5B00A75B9A /* Resources */ = { 532 | isa = PBXResourcesBuildPhase; 533 | buildActionMask = 2147483647; 534 | files = ( 535 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */, 536 | ); 537 | runOnlyForDeploymentPostprocessing = 0; 538 | }; 539 | /* End PBXResourcesBuildPhase section */ 540 | 541 | /* Begin PBXShellScriptBuildPhase section */ 542 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = { 543 | isa = PBXShellScriptBuildPhase; 544 | buildActionMask = 2147483647; 545 | files = ( 546 | ); 547 | inputPaths = ( 548 | ); 549 | name = "Bundle React Native code and images"; 550 | outputPaths = ( 551 | ); 552 | runOnlyForDeploymentPostprocessing = 0; 553 | shellPath = /bin/sh; 554 | shellScript = "export NODE_BINARY=node\n../node_modules/react-native/packager/react-native-xcode.sh"; 555 | }; 556 | /* End PBXShellScriptBuildPhase section */ 557 | 558 | /* Begin PBXSourcesBuildPhase section */ 559 | 00E356EA1AD99517003FC87E /* Sources */ = { 560 | isa = PBXSourcesBuildPhase; 561 | buildActionMask = 2147483647; 562 | files = ( 563 | 00E356F31AD99517003FC87E /* mockTMallTests.m in Sources */, 564 | ); 565 | runOnlyForDeploymentPostprocessing = 0; 566 | }; 567 | 13B07F871A680F5B00A75B9A /* Sources */ = { 568 | isa = PBXSourcesBuildPhase; 569 | buildActionMask = 2147483647; 570 | files = ( 571 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */, 572 | 13B07FC11A68108700A75B9A /* main.m in Sources */, 573 | ); 574 | runOnlyForDeploymentPostprocessing = 0; 575 | }; 576 | /* End PBXSourcesBuildPhase section */ 577 | 578 | /* Begin PBXTargetDependency section */ 579 | 00E356F51AD99517003FC87E /* PBXTargetDependency */ = { 580 | isa = PBXTargetDependency; 581 | target = 13B07F861A680F5B00A75B9A /* mockTMall */; 582 | targetProxy = 00E356F41AD99517003FC87E /* PBXContainerItemProxy */; 583 | }; 584 | /* End PBXTargetDependency section */ 585 | 586 | /* Begin XCBuildConfiguration section */ 587 | 00E356F61AD99517003FC87E /* Debug */ = { 588 | isa = XCBuildConfiguration; 589 | buildSettings = { 590 | BUNDLE_LOADER = "$(TEST_HOST)"; 591 | FRAMEWORK_SEARCH_PATHS = ( 592 | "$(SDKROOT)/Developer/Library/Frameworks", 593 | "$(inherited)", 594 | ); 595 | GCC_PREPROCESSOR_DEFINITIONS = ( 596 | "DEBUG=1", 597 | "$(inherited)", 598 | ); 599 | INFOPLIST_FILE = mockTMallTests/Info.plist; 600 | IPHONEOS_DEPLOYMENT_TARGET = 8.2; 601 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 602 | PRODUCT_NAME = "$(TARGET_NAME)"; 603 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/mockTMall.app/mockTMall"; 604 | }; 605 | name = Debug; 606 | }; 607 | 00E356F71AD99517003FC87E /* Release */ = { 608 | isa = XCBuildConfiguration; 609 | buildSettings = { 610 | BUNDLE_LOADER = "$(TEST_HOST)"; 611 | COPY_PHASE_STRIP = NO; 612 | FRAMEWORK_SEARCH_PATHS = ( 613 | "$(SDKROOT)/Developer/Library/Frameworks", 614 | "$(inherited)", 615 | ); 616 | INFOPLIST_FILE = mockTMallTests/Info.plist; 617 | IPHONEOS_DEPLOYMENT_TARGET = 8.2; 618 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 619 | PRODUCT_NAME = "$(TARGET_NAME)"; 620 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/mockTMall.app/mockTMall"; 621 | }; 622 | name = Release; 623 | }; 624 | 13B07F941A680F5B00A75B9A /* Debug */ = { 625 | isa = XCBuildConfiguration; 626 | buildSettings = { 627 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 628 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = BrandAsset; 629 | DEAD_CODE_STRIPPING = NO; 630 | HEADER_SEARCH_PATHS = ( 631 | "$(inherited)", 632 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 633 | "$(SRCROOT)/../node_modules/react-native/React/**", 634 | ); 635 | INFOPLIST_FILE = mockTMall/Info.plist; 636 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 637 | OTHER_LDFLAGS = "-ObjC"; 638 | PRODUCT_NAME = mockTMall; 639 | }; 640 | name = Debug; 641 | }; 642 | 13B07F951A680F5B00A75B9A /* Release */ = { 643 | isa = XCBuildConfiguration; 644 | buildSettings = { 645 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 646 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = BrandAsset; 647 | HEADER_SEARCH_PATHS = ( 648 | "$(inherited)", 649 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 650 | "$(SRCROOT)/../node_modules/react-native/React/**", 651 | ); 652 | INFOPLIST_FILE = mockTMall/Info.plist; 653 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 654 | OTHER_LDFLAGS = "-ObjC"; 655 | PRODUCT_NAME = mockTMall; 656 | }; 657 | name = Release; 658 | }; 659 | 83CBBA201A601CBA00E9B192 /* Debug */ = { 660 | isa = XCBuildConfiguration; 661 | buildSettings = { 662 | ALWAYS_SEARCH_USER_PATHS = NO; 663 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 664 | CLANG_CXX_LIBRARY = "libc++"; 665 | CLANG_ENABLE_MODULES = YES; 666 | CLANG_ENABLE_OBJC_ARC = YES; 667 | CLANG_WARN_BOOL_CONVERSION = YES; 668 | CLANG_WARN_CONSTANT_CONVERSION = YES; 669 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 670 | CLANG_WARN_EMPTY_BODY = YES; 671 | CLANG_WARN_ENUM_CONVERSION = YES; 672 | CLANG_WARN_INT_CONVERSION = YES; 673 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 674 | CLANG_WARN_UNREACHABLE_CODE = YES; 675 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 676 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 677 | COPY_PHASE_STRIP = NO; 678 | ENABLE_STRICT_OBJC_MSGSEND = YES; 679 | GCC_C_LANGUAGE_STANDARD = gnu99; 680 | GCC_DYNAMIC_NO_PIC = NO; 681 | GCC_OPTIMIZATION_LEVEL = 0; 682 | GCC_PREPROCESSOR_DEFINITIONS = ( 683 | "DEBUG=1", 684 | "$(inherited)", 685 | ); 686 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 687 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 688 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 689 | GCC_WARN_UNDECLARED_SELECTOR = YES; 690 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 691 | GCC_WARN_UNUSED_FUNCTION = YES; 692 | GCC_WARN_UNUSED_VARIABLE = YES; 693 | HEADER_SEARCH_PATHS = ( 694 | "$(inherited)", 695 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 696 | "$(SRCROOT)/../node_modules/react-native/React/**", 697 | ); 698 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 699 | MTL_ENABLE_DEBUG_INFO = YES; 700 | ONLY_ACTIVE_ARCH = YES; 701 | SDKROOT = iphoneos; 702 | }; 703 | name = Debug; 704 | }; 705 | 83CBBA211A601CBA00E9B192 /* Release */ = { 706 | isa = XCBuildConfiguration; 707 | buildSettings = { 708 | ALWAYS_SEARCH_USER_PATHS = NO; 709 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 710 | CLANG_CXX_LIBRARY = "libc++"; 711 | CLANG_ENABLE_MODULES = YES; 712 | CLANG_ENABLE_OBJC_ARC = YES; 713 | CLANG_WARN_BOOL_CONVERSION = YES; 714 | CLANG_WARN_CONSTANT_CONVERSION = YES; 715 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 716 | CLANG_WARN_EMPTY_BODY = YES; 717 | CLANG_WARN_ENUM_CONVERSION = YES; 718 | CLANG_WARN_INT_CONVERSION = YES; 719 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 720 | CLANG_WARN_UNREACHABLE_CODE = YES; 721 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 722 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 723 | COPY_PHASE_STRIP = YES; 724 | ENABLE_NS_ASSERTIONS = NO; 725 | ENABLE_STRICT_OBJC_MSGSEND = YES; 726 | GCC_C_LANGUAGE_STANDARD = gnu99; 727 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 728 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 729 | GCC_WARN_UNDECLARED_SELECTOR = YES; 730 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 731 | GCC_WARN_UNUSED_FUNCTION = YES; 732 | GCC_WARN_UNUSED_VARIABLE = YES; 733 | HEADER_SEARCH_PATHS = ( 734 | "$(inherited)", 735 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 736 | "$(SRCROOT)/../node_modules/react-native/React/**", 737 | ); 738 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 739 | MTL_ENABLE_DEBUG_INFO = NO; 740 | SDKROOT = iphoneos; 741 | VALIDATE_PRODUCT = YES; 742 | }; 743 | name = Release; 744 | }; 745 | /* End XCBuildConfiguration section */ 746 | 747 | /* Begin XCConfigurationList section */ 748 | 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "mockTMallTests" */ = { 749 | isa = XCConfigurationList; 750 | buildConfigurations = ( 751 | 00E356F61AD99517003FC87E /* Debug */, 752 | 00E356F71AD99517003FC87E /* Release */, 753 | ); 754 | defaultConfigurationIsVisible = 0; 755 | defaultConfigurationName = Release; 756 | }; 757 | 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "mockTMall" */ = { 758 | isa = XCConfigurationList; 759 | buildConfigurations = ( 760 | 13B07F941A680F5B00A75B9A /* Debug */, 761 | 13B07F951A680F5B00A75B9A /* Release */, 762 | ); 763 | defaultConfigurationIsVisible = 0; 764 | defaultConfigurationName = Release; 765 | }; 766 | 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "mockTMall" */ = { 767 | isa = XCConfigurationList; 768 | buildConfigurations = ( 769 | 83CBBA201A601CBA00E9B192 /* Debug */, 770 | 83CBBA211A601CBA00E9B192 /* Release */, 771 | ); 772 | defaultConfigurationIsVisible = 0; 773 | defaultConfigurationName = Release; 774 | }; 775 | /* End XCConfigurationList section */ 776 | }; 777 | rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */; 778 | } 779 | --------------------------------------------------------------------------------