├── src ├── .watchmanconfig ├── .gitattributes ├── .babelrc ├── app.json ├── android │ ├── settings.gradle │ ├── app │ │ ├── src │ │ │ └── main │ │ │ │ ├── res │ │ │ │ ├── values │ │ │ │ │ ├── strings.xml │ │ │ │ │ └── styles.xml │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ └── mipmap-xxhdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── tadpole │ │ │ │ │ ├── MainActivity.java │ │ │ │ │ └── MainApplication.java │ │ │ │ └── AndroidManifest.xml │ │ ├── BUCK │ │ ├── proguard-rules.pro │ │ └── build.gradle │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── keystores │ │ ├── debug.keystore.properties │ │ └── BUCK │ ├── build.gradle │ ├── gradle.properties │ ├── gradlew.bat │ └── gradlew ├── resources │ └── images │ │ ├── play.png │ │ ├── pause.png │ │ ├── return.png │ │ ├── src │ │ └── miss.jpg │ │ └── tabs │ │ ├── home_v.png │ │ ├── home_x.png │ │ ├── mine_v.png │ │ ├── mine_x.png │ │ ├── bought_v.png │ │ ├── bought_x.png │ │ ├── headset_v.png │ │ └── headset_x.png ├── ios │ ├── tadpole │ │ ├── Images.xcassets │ │ │ ├── Contents.json │ │ │ └── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ ├── AppDelegate.h │ │ ├── main.m │ │ ├── AppDelegate.m │ │ ├── Info.plist │ │ └── Base.lproj │ │ │ └── LaunchScreen.xib │ ├── tadpoleTests │ │ ├── Info.plist │ │ └── tadpoleTests.m │ ├── tadpole-tvOSTests │ │ └── Info.plist │ ├── tadpole-tvOS │ │ └── Info.plist │ └── tadpole.xcodeproj │ │ ├── xcshareddata │ │ └── xcschemes │ │ │ ├── tadpole.xcscheme │ │ │ └── tadpole-tvOS.xcscheme │ │ └── project.pbxproj ├── .buckconfig ├── index.js ├── views │ ├── play.js │ ├── mine.js │ ├── bought.js │ ├── headset.js │ ├── signIns │ │ ├── signIn.js │ │ └── signInOrUp.js │ ├── home │ │ └── topShow.js │ └── home.js ├── package.json ├── .gitignore ├── .flowconfig ├── components │ ├── loading.js │ ├── common.js │ ├── header.js │ ├── customTabBar.js │ └── playButton.js └── App.js ├── .gitattributes ├── doc └── demo.gif ├── README.md └── .gitignore /src/.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.pbxproj -text 2 | -------------------------------------------------------------------------------- /src/.gitattributes: -------------------------------------------------------------------------------- 1 | *.pbxproj -text 2 | -------------------------------------------------------------------------------- /src/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["react-native"] 3 | } 4 | -------------------------------------------------------------------------------- /doc/demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/afresh/tadpole/HEAD/doc/demo.gif -------------------------------------------------------------------------------- /src/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tadpole", 3 | "displayName": "tadpole" 4 | } -------------------------------------------------------------------------------- /src/android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'tadpole' 2 | 3 | include ':app' 4 | -------------------------------------------------------------------------------- /src/resources/images/play.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/afresh/tadpole/HEAD/src/resources/images/play.png -------------------------------------------------------------------------------- /src/resources/images/pause.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/afresh/tadpole/HEAD/src/resources/images/pause.png -------------------------------------------------------------------------------- /src/resources/images/return.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/afresh/tadpole/HEAD/src/resources/images/return.png -------------------------------------------------------------------------------- /src/resources/images/src/miss.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/afresh/tadpole/HEAD/src/resources/images/src/miss.jpg -------------------------------------------------------------------------------- /src/resources/images/tabs/home_v.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/afresh/tadpole/HEAD/src/resources/images/tabs/home_v.png -------------------------------------------------------------------------------- /src/resources/images/tabs/home_x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/afresh/tadpole/HEAD/src/resources/images/tabs/home_x.png -------------------------------------------------------------------------------- /src/resources/images/tabs/mine_v.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/afresh/tadpole/HEAD/src/resources/images/tabs/mine_v.png -------------------------------------------------------------------------------- /src/resources/images/tabs/mine_x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/afresh/tadpole/HEAD/src/resources/images/tabs/mine_x.png -------------------------------------------------------------------------------- /src/resources/images/tabs/bought_v.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/afresh/tadpole/HEAD/src/resources/images/tabs/bought_v.png -------------------------------------------------------------------------------- /src/resources/images/tabs/bought_x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/afresh/tadpole/HEAD/src/resources/images/tabs/bought_x.png -------------------------------------------------------------------------------- /src/resources/images/tabs/headset_v.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/afresh/tadpole/HEAD/src/resources/images/tabs/headset_v.png -------------------------------------------------------------------------------- /src/resources/images/tabs/headset_x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/afresh/tadpole/HEAD/src/resources/images/tabs/headset_x.png -------------------------------------------------------------------------------- /src/android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | tadpole 3 | 4 | -------------------------------------------------------------------------------- /src/ios/tadpole/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/afresh/tadpole/HEAD/src/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /src/.buckconfig: -------------------------------------------------------------------------------- 1 | 2 | [android] 3 | target = Google Inc.:Google APIs:23 4 | 5 | [maven_repositories] 6 | central = https://repo1.maven.org/maven2 7 | -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | import { AppRegistry } from 'react-native'; 2 | import App from './App'; 3 | 4 | AppRegistry.registerComponent('tadpole', () => App); 5 | -------------------------------------------------------------------------------- /src/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/afresh/tadpole/HEAD/src/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /src/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/afresh/tadpole/HEAD/src/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /src/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/afresh/tadpole/HEAD/src/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /src/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/afresh/tadpole/HEAD/src/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /src/android/keystores/debug.keystore.properties: -------------------------------------------------------------------------------- 1 | key.store=debug.keystore 2 | key.alias=androiddebugkey 3 | key.store.password=android 4 | key.alias.password=android 5 | -------------------------------------------------------------------------------- /src/android/keystores/BUCK: -------------------------------------------------------------------------------- 1 | keystore( 2 | name = "debug", 3 | properties = "debug.keystore.properties", 4 | store = "debug.keystore", 5 | visibility = [ 6 | "PUBLIC", 7 | ], 8 | ) 9 | -------------------------------------------------------------------------------- /src/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip 6 | -------------------------------------------------------------------------------- /src/ios/tadpole/AppDelegate.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #import 9 | 10 | @interface AppDelegate : UIResponder 11 | 12 | @property (nonatomic, strong) UIWindow *window; 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /src/ios/tadpole/main.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #import 9 | 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/android/app/src/main/java/com/tadpole/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.tadpole; 2 | 3 | import com.facebook.react.ReactActivity; 4 | 5 | public class MainActivity extends ReactActivity { 6 | 7 | /** 8 | * Returns the name of the main component registered from JavaScript. 9 | * This is used to schedule rendering of the component. 10 | */ 11 | @Override 12 | protected String getMainComponentName() { 13 | return "tadpole"; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # tadpole 2 | 3 | > 经过本人精心的实践和整理,从实际项目中提取出主要架构和组件后,在GitHub上提交了新的项目模板[react-native-boilerplate-dolphin](https://github.com/afresh/react-native-boilerplate-dolphin),欢迎star和交流。 4 | 5 | #### 项目介绍 6 | tadpole,基于react-native开发的项目框架,可以直接用来二次开发。 7 | 8 | ![demo](https://github.com/afresh/tadpole/blob/master/doc/demo.gif) 9 | 10 | #### 软件架构 11 | 基于react-native开发的项目框架,可以直接用来二次开发。 12 | 13 | #### 安装教程 14 | 15 | $ npm install 16 | 17 | $ react-native run-android 18 | 19 | #### 使用说明 20 | 21 | 【搭建react-native项目框架】中文文档地址:https://blog.csdn.net/klo220/article/details/80496949 22 | -------------------------------------------------------------------------------- /src/views/play.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by 媲美爱 on 2018-05-28. 3 | */ 4 | 5 | import React, { Component } from 'react'; 6 | import { 7 | // Platform, 8 | StyleSheet, 9 | View, 10 | Text, 11 | } from 'react-native'; 12 | 13 | export default class PlayScreen extends Component { 14 | constructor(props){ 15 | super(props); 16 | } 17 | 18 | render() { 19 | return ( 20 | 21 | 22 | this is PlayScreen. 23 | 24 | 25 | ) 26 | } 27 | } -------------------------------------------------------------------------------- /src/views/mine.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by 媲美爱 on 2018-05-25. 3 | */ 4 | 5 | import React, { Component } from 'react'; 6 | import { 7 | // Platform, 8 | StyleSheet, 9 | View, 10 | Text, 11 | } from 'react-native'; 12 | 13 | export default class MineTabScreen extends Component { 14 | constructor(props){ 15 | super(props); 16 | } 17 | 18 | render() { 19 | return ( 20 | 21 | 22 | this is MineTabScreen. 23 | 24 | 25 | ) 26 | } 27 | } -------------------------------------------------------------------------------- /src/views/bought.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by 媲美爱 on 2018-05-25. 3 | */ 4 | 5 | import React, { Component } from 'react'; 6 | import { 7 | // Platform, 8 | StyleSheet, 9 | View, 10 | Text, 11 | } from 'react-native'; 12 | 13 | export default class BoughtTabScreen extends Component { 14 | constructor(props){ 15 | super(props); 16 | } 17 | 18 | render() { 19 | return ( 20 | 21 | 22 | this is BoughtTabScreen. 23 | 24 | 25 | ) 26 | } 27 | } -------------------------------------------------------------------------------- /src/views/headset.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by 媲美爱 on 2018-05-25. 3 | */ 4 | 5 | import React, { Component } from 'react'; 6 | import { 7 | // Platform, 8 | StyleSheet, 9 | View, 10 | Text, 11 | } from 'react-native'; 12 | 13 | export default class HeadsetTabScreen extends Component { 14 | constructor(props){ 15 | super(props); 16 | } 17 | 18 | render() { 19 | return ( 20 | 21 | 22 | this is HeadsetTabScreen. 23 | 24 | 25 | ) 26 | } 27 | } -------------------------------------------------------------------------------- /src/views/signIns/signIn.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by 媲美爱 on 2018-05-26. 3 | */ 4 | 5 | import React, { Component } from 'react'; 6 | import { 7 | // Platform, 8 | StyleSheet, 9 | View, 10 | Text, 11 | } from 'react-native'; 12 | 13 | export default class SignInScreen extends Component { 14 | constructor(props){ 15 | super(props); 16 | } 17 | 18 | render() { 19 | return ( 20 | 21 | 22 | this is SignInScreen. 23 | 24 | 25 | ) 26 | } 27 | } -------------------------------------------------------------------------------- /src/views/signIns/signInOrUp.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by 媲美爱 on 2018-05-26. 3 | */ 4 | 5 | import React, { Component } from 'react'; 6 | import { 7 | // Platform, 8 | StyleSheet, 9 | View, 10 | Text, 11 | } from 'react-native'; 12 | 13 | export default class SignInOrUpScreen extends Component { 14 | constructor(props){ 15 | super(props); 16 | } 17 | 18 | render() { 19 | return ( 20 | 21 | 22 | this is SignInOrUpScreen. 23 | 24 | 25 | ) 26 | } 27 | } -------------------------------------------------------------------------------- /src/android/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | repositories { 5 | jcenter() 6 | } 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:2.2.3' 9 | 10 | // NOTE: Do not place your application dependencies here; they belong 11 | // in the individual module build.gradle files 12 | } 13 | } 14 | 15 | allprojects { 16 | repositories { 17 | mavenLocal() 18 | jcenter() 19 | maven { 20 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm 21 | url "$rootDir/../node_modules/react-native/android" 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/ios/tadpole/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 | } -------------------------------------------------------------------------------- /src/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tadpole", 3 | "version": "0.0.1", 4 | "private": true, 5 | "scripts": { 6 | "start": "node node_modules/react-native/local-cli/cli.js start", 7 | "test": "jest" 8 | }, 9 | "dependencies": { 10 | "npm": "^6.1.0", 11 | "prop-types": "^15.6.1", 12 | "react": "16.3.1", 13 | "react-native": "0.55.4", 14 | "react-native-action-button": "^2.8.4", 15 | "react-native-easy-toast": "^1.1.0", 16 | "react-native-router-flux": "^4.0.0-beta.31", 17 | "react-native-scrollable-tab-view": "^0.8.0" 18 | }, 19 | "devDependencies": { 20 | "babel-jest": "23.0.0", 21 | "babel-preset-react-native": "4.0.0", 22 | "jest": "23.0.0", 23 | "react-test-renderer": "16.3.1" 24 | }, 25 | "jest": { 26 | "preset": "react-native" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/ios/tadpoleTests/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 | -------------------------------------------------------------------------------- /src/ios/tadpole-tvOSTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /src/views/home/topShow.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by 媲美爱 on 2018-05-29. 3 | */ 4 | 5 | import React, { Component } from 'react'; 6 | import { 7 | // Platform, 8 | StyleSheet, 9 | View, 10 | Text, 11 | } from 'react-native'; 12 | //第三方插件 13 | import { Actions } from 'react-native-router-flux'; 14 | //自定义组件 15 | import Common from '../../components/common'; //公共类 16 | import Header from '../../components/header'; //头部导航 17 | 18 | export default class TopShowScreen extends Component { 19 | constructor(props){ 20 | super(props); 21 | } 22 | 23 | render() { 24 | return ( 25 | 26 |
27 | 28 | this is TopShowScreen. 29 | 30 | 31 | ) 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # Xcode 6 | # 7 | build/ 8 | *.pbxuser 9 | !default.pbxuser 10 | *.mode1v3 11 | !default.mode1v3 12 | *.mode2v3 13 | !default.mode2v3 14 | *.perspectivev3 15 | !default.perspectivev3 16 | xcuserdata 17 | *.xccheckout 18 | *.moved-aside 19 | DerivedData 20 | *.hmap 21 | *.ipa 22 | *.xcuserstate 23 | project.xcworkspace 24 | 25 | # Android/IntelliJ 26 | # 27 | build/ 28 | .idea 29 | .gradle 30 | local.properties 31 | *.iml 32 | 33 | # node.js 34 | # 35 | node_modules/ 36 | npm-debug.log 37 | yarn-error.log 38 | 39 | # BUCK 40 | buck-out/ 41 | \.buckd/ 42 | *.keystore 43 | 44 | # fastlane 45 | # 46 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 47 | # screenshots whenever they are needed. 48 | # For more information about the recommended setup visit: 49 | # https://docs.fastlane.tools/best-practices/source-control/ 50 | 51 | */fastlane/report.xml 52 | */fastlane/Preview.html 53 | */fastlane/screenshots 54 | 55 | # Bundle artifact 56 | *.jsbundle 57 | -------------------------------------------------------------------------------- /src/.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # Xcode 6 | # 7 | build/ 8 | *.pbxuser 9 | !default.pbxuser 10 | *.mode1v3 11 | !default.mode1v3 12 | *.mode2v3 13 | !default.mode2v3 14 | *.perspectivev3 15 | !default.perspectivev3 16 | xcuserdata 17 | *.xccheckout 18 | *.moved-aside 19 | DerivedData 20 | *.hmap 21 | *.ipa 22 | *.xcuserstate 23 | project.xcworkspace 24 | 25 | # Android/IntelliJ 26 | # 27 | build/ 28 | .idea 29 | .gradle 30 | local.properties 31 | *.iml 32 | 33 | # node.js 34 | # 35 | node_modules/ 36 | npm-debug.log 37 | yarn-error.log 38 | 39 | # BUCK 40 | buck-out/ 41 | \.buckd/ 42 | *.keystore 43 | 44 | # fastlane 45 | # 46 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 47 | # screenshots whenever they are needed. 48 | # For more information about the recommended setup visit: 49 | # https://docs.fastlane.tools/best-practices/source-control/ 50 | 51 | */fastlane/report.xml 52 | */fastlane/Preview.html 53 | */fastlane/screenshots 54 | 55 | # Bundle artifact 56 | *.jsbundle 57 | -------------------------------------------------------------------------------- /src/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 13 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /src/android/app/src/main/java/com/tadpole/MainApplication.java: -------------------------------------------------------------------------------- 1 | package com.tadpole; 2 | 3 | import android.app.Application; 4 | 5 | import com.facebook.react.ReactApplication; 6 | import com.facebook.react.ReactNativeHost; 7 | import com.facebook.react.ReactPackage; 8 | import com.facebook.react.shell.MainReactPackage; 9 | import com.facebook.soloader.SoLoader; 10 | 11 | import java.util.Arrays; 12 | import java.util.List; 13 | 14 | public class MainApplication extends Application implements ReactApplication { 15 | 16 | private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) { 17 | @Override 18 | public boolean getUseDeveloperSupport() { 19 | return BuildConfig.DEBUG; 20 | } 21 | 22 | @Override 23 | protected List getPackages() { 24 | return Arrays.asList( 25 | new MainReactPackage() 26 | ); 27 | } 28 | 29 | @Override 30 | protected String getJSMainModuleName() { 31 | return "index"; 32 | } 33 | }; 34 | 35 | @Override 36 | public ReactNativeHost getReactNativeHost() { 37 | return mReactNativeHost; 38 | } 39 | 40 | @Override 41 | public void onCreate() { 42 | super.onCreate(); 43 | SoLoader.init(this, /* native exopackage */ false); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/ios/tadpole/AppDelegate.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #import "AppDelegate.h" 9 | 10 | #import 11 | #import 12 | 13 | @implementation AppDelegate 14 | 15 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 16 | { 17 | NSURL *jsCodeLocation; 18 | 19 | jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil]; 20 | 21 | RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation 22 | moduleName:@"tadpole" 23 | initialProperties:nil 24 | launchOptions:launchOptions]; 25 | rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1]; 26 | 27 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 28 | UIViewController *rootViewController = [UIViewController new]; 29 | rootViewController.view = rootView; 30 | self.window.rootViewController = rootViewController; 31 | [self.window makeKeyAndVisible]; 32 | return YES; 33 | } 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /src/views/home.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by 媲美爱 on 2018-05-25. 3 | */ 4 | 5 | import React, { Component } from 'react'; 6 | import { 7 | StyleSheet, 8 | View, 9 | Text, 10 | Button, 11 | } from 'react-native'; 12 | //第三方插件 13 | import { Actions } from 'react-native-router-flux'; 14 | 15 | export default class HomeTabScreen extends Component { 16 | constructor(props){ 17 | super(props); 18 | } 19 | 20 | _showLoading() { 21 | global.showLoading(); 22 | setTimeout(()=>{ 23 | global.closeLoading(); 24 | },500) 25 | } 26 | 27 | render() { 28 | return ( 29 | 30 | 31 | this is HomeTabScreen. 32 | 33 | 34 |