├── .buckconfig ├── .eslintrc.js ├── .flowconfig ├── .gitattributes ├── .gitignore ├── .prettierrc.js ├── .watchmanconfig ├── README.md ├── __tests__ └── App.js ├── android ├── app │ ├── _BUCK │ ├── build.gradle │ ├── build_defs.bzl │ ├── debug.keystore │ ├── proguard-rules.pro │ └── src │ │ ├── debug │ │ └── AndroidManifest.xml │ │ └── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ └── com │ │ │ └── maxieernlab │ │ │ ├── MainActivity.java │ │ │ ├── MainApplication.java │ │ │ └── yoga │ │ │ ├── YogaActivity1.java │ │ │ └── YogaActivity2.java │ │ └── res │ │ ├── drawable-xxhdpi │ │ └── react_native.png │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ └── values │ │ ├── strings.xml │ │ └── styles.xml ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle ├── app.json ├── babel.config.js ├── images ├── 001.png ├── 002.png ├── 003.png ├── 004.png ├── 005.png ├── 006.png ├── 007.png ├── 008.png ├── 009.png ├── 010.png └── 011.png ├── index.js ├── ios ├── MaxieeRNLab-tvOS │ └── Info.plist ├── MaxieeRNLab-tvOSTests │ └── Info.plist ├── MaxieeRNLab.xcodeproj │ ├── contents.scworkspacedata │ ├── project.pbxproj │ └── xcshareddata │ │ └── xcschemes │ │ ├── MaxieeRNLab-tvOS.xcscheme │ │ └── MaxieeRNLab.xcscheme ├── MaxieeRNLab │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Base.lproj │ │ └── LaunchScreen.xib │ ├── Images.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ └── Contents.json │ ├── Info.plist │ └── main.m ├── MaxieeRNLabTests │ ├── Info.plist │ └── MaxieeRNLabTests.m └── Podfile ├── metro.config.js ├── package-lock.json ├── package.json ├── src ├── common │ ├── screen.js │ └── utils │ │ └── HomeUtils.js ├── config │ ├── actions.js │ └── store.js ├── demo │ ├── ChartDemo │ │ └── DemoLineChart.js │ ├── ChatDemo │ │ └── index.js │ ├── LoginDemo │ │ └── DemoLogin1.js │ ├── NavigationDemo │ │ ├── Custom │ │ │ └── BottomNavigation │ │ │ │ └── HeartBeatBottomNavi │ │ │ │ ├── HeartBeatBottomNavigation.js │ │ │ │ └── index.js │ │ ├── CustomHeader │ │ │ └── index.js │ │ ├── NavigationHello │ │ │ └── index.js │ │ ├── StackDemo │ │ │ └── index.js │ │ └── doc │ │ │ └── DocHelloNavigation.js │ ├── ReactNativeUIDemo │ │ ├── CheckBoxes │ │ │ └── index.js │ │ ├── DemoButton.js │ │ ├── DemoSimpleView.js │ │ ├── buttons │ │ │ └── GradientButton.js │ │ └── demos │ │ │ └── ReactNativeUIImage.js │ └── ReduxDemo │ │ └── demos │ │ └── ReduxTodo.js ├── pages │ ├── basic │ │ ├── RNBasicScrollView.js │ │ ├── RNScrollableTabView.js │ │ ├── RNThirdSwiper.js │ │ └── img │ │ │ ├── Swiper1.jpg │ │ │ ├── Swiper2.jpg │ │ │ ├── Swiper3.jpg │ │ │ └── Swiper4.jpg │ ├── demo │ │ ├── DemoHome.js │ │ ├── StopWatch │ │ │ └── StopWatchHome.js │ │ ├── meituan │ │ │ ├── MeituanHome.js │ │ │ ├── common │ │ │ │ └── MTAPI.js │ │ │ ├── home │ │ │ │ ├── MTHomeMenuItem.js │ │ │ │ ├── MTHomeMenuView.js │ │ │ │ └── MTHomeScene.js │ │ │ ├── img │ │ │ │ ├── home │ │ │ │ │ ├── bg_customReview_image_default.png │ │ │ │ │ ├── icon_deal_anytime_refund.png │ │ │ │ │ ├── icon_homepage_beauty_category.png │ │ │ │ │ ├── icon_homepage_default.png │ │ │ │ │ ├── icon_homepage_entertainment_category.png │ │ │ │ │ ├── icon_homepage_food_category.png │ │ │ │ │ ├── icon_homepage_foottreat_category.png │ │ │ │ │ ├── icon_homepage_hotel_category.png │ │ │ │ │ ├── icon_homepage_ktv_category.png │ │ │ │ │ ├── icon_homepage_life_service_category.png │ │ │ │ │ ├── icon_homepage_map.png │ │ │ │ │ ├── icon_homepage_map_old.png │ │ │ │ │ ├── icon_homepage_map_selected.png │ │ │ │ │ ├── icon_homepage_map_selected_old.png │ │ │ │ │ ├── icon_homepage_movie_category.png │ │ │ │ │ ├── icon_homepage_search.png │ │ │ │ │ ├── icon_homepage_shopping_category.png │ │ │ │ │ └── search_icon.png │ │ │ │ ├── mine │ │ │ │ │ ├── avatar.png │ │ │ │ │ ├── beauty_technician_v15.png │ │ │ │ │ ├── icon_mine_aboutmeituan.png │ │ │ │ │ ├── icon_mine_balance.png │ │ │ │ │ ├── icon_mine_collection.png │ │ │ │ │ ├── icon_mine_comment.png │ │ │ │ │ ├── icon_mine_customerService.png │ │ │ │ │ ├── icon_mine_friends.png │ │ │ │ │ ├── icon_mine_member.png │ │ │ │ │ ├── icon_mine_membercard.png │ │ │ │ │ ├── icon_mine_membercenter.png │ │ │ │ │ ├── icon_mine_mineorder.png │ │ │ │ │ ├── icon_mine_voucher.png │ │ │ │ │ ├── icon_mine_wallet.png │ │ │ │ │ ├── icon_navigation_item_message_white.png │ │ │ │ │ ├── icon_navigation_item_set_white.png │ │ │ │ │ ├── icon_user_avatar_anonymous.png │ │ │ │ │ └── icon_userreview_defaultavatar.png │ │ │ │ ├── order │ │ │ │ │ ├── order_tab_need_pay@2x.png │ │ │ │ │ ├── order_tab_need_review@2x.png │ │ │ │ │ ├── order_tab_need_use@2x.png │ │ │ │ │ └── order_tab_needoffer_aftersale@2x.png │ │ │ │ ├── public │ │ │ │ │ ├── cell_arrow.png │ │ │ │ │ ├── icon_food_merchant_address.png │ │ │ │ │ └── icon_navigation_item_share.png │ │ │ │ └── tabbar │ │ │ │ │ ├── tabbar_discover.png │ │ │ │ │ ├── tabbar_discover_selected.png │ │ │ │ │ ├── tabbar_homepage.png │ │ │ │ │ ├── tabbar_homepage_selected.png │ │ │ │ │ ├── tabbar_merchant.png │ │ │ │ │ ├── tabbar_merchant_selected.png │ │ │ │ │ ├── tabbar_mine.png │ │ │ │ │ ├── tabbar_mine_selected.png │ │ │ │ │ ├── tabbar_order.png │ │ │ │ │ └── tabbar_order_selected.png │ │ │ ├── mine │ │ │ │ ├── MTDetailCell.js │ │ │ │ └── MTMineScene.js │ │ │ ├── nearby │ │ │ │ ├── MTNearbyHeaderView.js │ │ │ │ └── MTNearbyScene.js │ │ │ └── widget │ │ │ │ └── GroupPrchaseCell.js │ │ ├── mylocation │ │ │ ├── Map.js │ │ │ └── MyLocationHome.js │ │ ├── twitter │ │ │ ├── TwitterHome.js │ │ │ ├── TwitterPost.js │ │ │ ├── TwitterTab.js │ │ │ └── img │ │ │ │ └── day3.png │ │ └── weather │ │ │ ├── WeatherHome.js │ │ │ └── img │ │ │ ├── w2.png │ │ │ └── w3.png │ ├── home │ │ ├── HomeBasic.js │ │ └── index.js │ └── template │ │ └── TemplateHome.js ├── reducers │ └── todo │ │ ├── actions │ │ ├── todo-add.js │ │ ├── todo-finish.js │ │ └── todo-unfinish.js │ │ └── reducer.js └── widgets │ ├── gridview │ ├── GridItem.js │ └── GridView.js │ ├── navi │ └── NavigationItem.js │ ├── tab │ └── bottom │ │ └── TabBarItem.js │ └── text │ └── Text.js └── yarn.lock /.buckconfig: -------------------------------------------------------------------------------- 1 | 2 | [android] 3 | target = Google Inc.:Google APIs:23 4 | 5 | [maven_repositories] 6 | central = https://repo1.maven.org/maven2 7 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | extends: '@react-native-community', 4 | }; -------------------------------------------------------------------------------- /.flowconfig: -------------------------------------------------------------------------------- 1 | [ignore] 2 | ; We fork some components by platform 3 | .*/*[.]android.js 4 | 5 | ; Ignore "BUCK" generated dirs 6 | /\.buckd/ 7 | 8 | ; Ignore polyfills 9 | node_modules/react-native/Libraries/polyfills/.* 10 | 11 | ; These should not be required directly 12 | ; require from fbjs/lib instead: require('fbjs/lib/warning') 13 | node_modules/warning/.* 14 | 15 | ; Flow doesn't support platforms 16 | .*/Libraries/Utilities/LoadingView.js 17 | 18 | [untyped] 19 | .*/node_modules/@react-native-community/cli/.*/.* 20 | 21 | [include] 22 | 23 | [libs] 24 | node_modules/react-native/Libraries/react-native/react-native-interface.js 25 | node_modules/react-native/flow/ 26 | 27 | [options] 28 | emoji=true 29 | 30 | esproposal.optional_chaining=enable 31 | esproposal.nullish_coalescing=enable 32 | 33 | module.file_ext=.js 34 | module.file_ext=.json 35 | module.file_ext=.ios.js 36 | 37 | munge_underscores=true 38 | 39 | module.name_mapper='^react-native$' -> '/node_modules/react-native/Libraries/react-native/react-native-implementation' 40 | module.name_mapper='^react-native/\(.*\)$' -> '/node_modules/react-native/\1' 41 | module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> '/node_modules/react-native/Libraries/Image/RelativeImageStub' 42 | 43 | suppress_type=$FlowIssue 44 | suppress_type=$FlowFixMe 45 | suppress_type=$FlowFixMeProps 46 | suppress_type=$FlowFixMeState 47 | 48 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\) 49 | suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)?:? #[0-9]+ 50 | suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError 51 | 52 | [lints] 53 | sketchy-null-number=warn 54 | sketchy-null-mixed=warn 55 | sketchy-number=warn 56 | untyped-type-import=warn 57 | nonstrict-import=warn 58 | deprecated-type=warn 59 | unsafe-getters-setters=warn 60 | inexact-spread=warn 61 | unnecessary-invariant=warn 62 | signature-verification-failure=warn 63 | deprecated-utility=error 64 | 65 | [strict] 66 | deprecated-type 67 | nonstrict-import 68 | sketchy-null 69 | unclear-type 70 | unsafe-getters-setters 71 | untyped-import 72 | untyped-type-import 73 | 74 | [version] 75 | ^0.105.0 -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.pbxproj -text 2 | -------------------------------------------------------------------------------- /.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 | 24 | # Android/IntelliJ 25 | # 26 | build/ 27 | .idea 28 | .gradle 29 | local.properties 30 | *.iml 31 | android/captures/* 32 | .project 33 | .classpath 34 | .settings 35 | 36 | # node.js 37 | # 38 | node_modules/ 39 | npm-debug.log 40 | yarn-error.log 41 | 42 | # BUCK 43 | buck-out/ 44 | \.buckd/ 45 | *.keystore 46 | !debug.keystore 47 | 48 | # fastlane 49 | # 50 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 51 | # screenshots whenever they are needed. 52 | # For more information about the recommended setup visit: 53 | # https://docs.fastlane.tools/best-practices/source-control/ 54 | 55 | */fastlane/report.xml 56 | */fastlane/Preview.html 57 | */fastlane/screenshots 58 | 59 | # Bundle artifact 60 | *.jsbundle 61 | 62 | # CocoaPods 63 | /ios/Pods/ -------------------------------------------------------------------------------- /.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | bracketSpacing: false, 3 | jsxBracketSameLine: true, 4 | singleQuote: true, 5 | trailingComma: 'all', 6 | }; -------------------------------------------------------------------------------- /.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

MaxieeRNLab

2 | 3 |

4 | My React Native learning experiences
5 | Awesome React Native demos. 6 |

7 | 8 | MaxieeRNLab is my learning experiences of React Native. This project includes many aspect of developing a React 9 | Native: 10 | 11 | - A better understand of React Native Framework 12 | - Yoga layout engine 13 | - BatchedBridge message queue 14 | - React Navigation with react-navigation 15 | - stack navigator 16 | - material top tab navigator 17 | - custom bottom navigation with center button 18 | - Redux 19 | - Todo demo 20 | - UI 21 | - usage of react-native-paper 22 | - usage of react-native-elements 23 | 24 | ## Screenshots 25 | 26 | |HomePage|Yoga Layout Engine|Stack Navigator| 27 | |--|--|---| 28 | |![](./images/001.png)|![](./images/002.png)|![](./images/003.png)| 29 | |Redux Todo 1|Redux Todo 2|Custom Bottom Navigator| 30 | |![](./images/004.png)|![](./images/005.png)|![](./images/006.png)| 31 | |Material Top Tab|Image|Buttons| 32 | |![](./images/007.png)|![](./images/008.png)|![](./images/009.png)| 33 | |Chat Demo|Line Chart Demo|| 34 | |![](./images/010.png)|![](./images/011.png)|| -------------------------------------------------------------------------------- /__tests__/App.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @format 3 | */ 4 | 5 | import 'react-native'; 6 | import React from 'react'; 7 | import App from '../App'; 8 | 9 | // Note: test renderer must be required after react-native. 10 | import renderer from 'react-test-renderer'; 11 | 12 | it('renders correctly', () => { 13 | renderer.create(); 14 | }); 15 | -------------------------------------------------------------------------------- /android/app/_BUCK: -------------------------------------------------------------------------------- 1 | # To learn about Buck see [Docs](https://buckbuild.com/). 2 | # To run your application with Buck: 3 | # - install Buck 4 | # - `npm start` - to start the packager 5 | # - `cd android` 6 | # - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"` 7 | # - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck 8 | # - `buck install -r android/app` - compile, install and run application 9 | # 10 | 11 | load(":build_defs.bzl", "create_aar_targets", "create_jar_targets") 12 | 13 | lib_deps = [] 14 | 15 | create_aar_targets(glob(["libs/*.aar"])) 16 | 17 | create_jar_targets(glob(["libs/*.jar"])) 18 | 19 | android_library( 20 | name = "all-libs", 21 | exported_deps = lib_deps, 22 | ) 23 | 24 | android_library( 25 | name = "app-code", 26 | srcs = glob([ 27 | "src/main/java/**/*.java", 28 | ]), 29 | deps = [ 30 | ":all-libs", 31 | ":build_config", 32 | ":res", 33 | ], 34 | ) 35 | 36 | android_build_config( 37 | name = "build_config", 38 | package = "com.maxieernlab", 39 | ) 40 | 41 | android_resource( 42 | name = "res", 43 | package = "com.maxieernlab", 44 | res = "src/main/res", 45 | ) 46 | 47 | android_binary( 48 | name = "app", 49 | keystore = "//android/keystores:debug", 50 | manifest = "src/main/AndroidManifest.xml", 51 | package_type = "debug", 52 | deps = [ 53 | ":app-code", 54 | ], 55 | ) 56 | -------------------------------------------------------------------------------- /android/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "com.android.application" 2 | 3 | import com.android.build.OutputFile 4 | 5 | /** 6 | * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets 7 | * and bundleReleaseJsAndAssets). 8 | * These basically call `react-native bundle` with the correct arguments during the Android build 9 | * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the 10 | * bundle directly from the development server. Below you can see all the possible configurations 11 | * and their defaults. If you decide to add a configuration block, make sure to add it before the 12 | * `apply from: "../../node_modules/react-native/react.gradle"` line. 13 | * 14 | * project.ext.react = [ 15 | * // the name of the generated asset file containing your JS bundle 16 | * bundleAssetName: "index.android.bundle", 17 | * 18 | * // https://facebook.github.io/react-native/docs/performance#enable-the-ram-format 19 | * bundleCommand: "ram-bundle", 20 | * 21 | * // the entry file for bundle generation 22 | * entryFile: "index.android.js", 23 | * 24 | * // whether to bundle JS and assets in debug mode 25 | * bundleInDebug: false, 26 | * 27 | * // whether to bundle JS and assets in release mode 28 | * bundleInRelease: true, 29 | * 30 | * // whether to bundle JS and assets in another build variant (if configured). 31 | * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants 32 | * // The configuration property can be in the following formats 33 | * // 'bundleIn${productFlavor}${buildType}' 34 | * // 'bundleIn${buildType}' 35 | * // bundleInFreeDebug: true, 36 | * // bundleInPaidRelease: true, 37 | * // bundleInBeta: true, 38 | * 39 | * // whether to disable dev mode in custom build variants (by default only disabled in release) 40 | * // for example: to disable dev mode in the staging build type (if configured) 41 | * devDisabledInStaging: true, 42 | * // The configuration property can be in the following formats 43 | * // 'devDisabledIn${productFlavor}${buildType}' 44 | * // 'devDisabledIn${buildType}' 45 | * 46 | * // the root of your project, i.e. where "package.json" lives 47 | * root: "../../", 48 | * 49 | * // where to put the JS bundle asset in debug mode 50 | * jsBundleDirDebug: "$buildDir/intermediates/assets/debug", 51 | * 52 | * // where to put the JS bundle asset in release mode 53 | * jsBundleDirRelease: "$buildDir/intermediates/assets/release", 54 | * 55 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 56 | * // require('./image.png')), in debug mode 57 | * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug", 58 | * 59 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 60 | * // require('./image.png')), in release mode 61 | * resourcesDirRelease: "$buildDir/intermediates/res/merged/release", 62 | * 63 | * // by default the gradle tasks are skipped if none of the JS files or assets change; this means 64 | * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to 65 | * // date; if you have any other folders that you want to ignore for performance reasons (gradle 66 | * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/ 67 | * // for example, you might want to remove it from here. 68 | * inputExcludes: ["android/**", "ios/**"], 69 | * 70 | * // override which node gets called and with what additional arguments 71 | * nodeExecutableAndArgs: ["node"], 72 | * 73 | * // supply additional arguments to the packager 74 | * extraPackagerArgs: [] 75 | * ] 76 | */ 77 | 78 | project.ext.react = [ 79 | entryFile: "index.js", 80 | enableHermes: false, // clean and rebuild if changing 81 | ] 82 | 83 | apply from: "../../node_modules/react-native/react.gradle" 84 | 85 | project.ext.vectoricons = [ 86 | iconFontNames: [ 'Ionicons.ttf'] // Name of the font files you want to copy 87 | ] 88 | 89 | apply from: "../../node_modules/react-native-vector-icons/fonts.gradle" 90 | 91 | /** 92 | * Set this to true to create two separate APKs instead of one: 93 | * - An APK that only works on ARM devices 94 | * - An APK that only works on x86 devices 95 | * The advantage is the size of the APK is reduced by about 4MB. 96 | * Upload all the APKs to the Play Store and people will download 97 | * the correct one based on the CPU architecture of their device. 98 | */ 99 | def enableSeparateBuildPerCPUArchitecture = false 100 | 101 | /** 102 | * Run Proguard to shrink the Java bytecode in release builds. 103 | */ 104 | def enableProguardInReleaseBuilds = false 105 | 106 | /** 107 | * The preferred build flavor of JavaScriptCore. 108 | * 109 | * For example, to use the international variant, you can use: 110 | * `def jscFlavor = 'org.webkit:android-jsc-intl:+'` 111 | * 112 | * The international variant includes ICU i18n library and necessary data 113 | * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that 114 | * give correct results when using with locales other than en-US. Note that 115 | * this variant is about 6MiB larger per architecture than default. 116 | */ 117 | def jscFlavor = 'org.webkit:android-jsc:+' 118 | 119 | /** 120 | * Whether to enable the Hermes VM. 121 | * 122 | * This should be set on project.ext.react and mirrored here. If it is not set 123 | * on project.ext.react, JavaScript will not be compiled to Hermes Bytecode 124 | * and the benefits of using Hermes will therefore be sharply reduced. 125 | */ 126 | def enableHermes = project.ext.react.get("enableHermes", false); 127 | 128 | android { 129 | compileSdkVersion rootProject.ext.compileSdkVersion 130 | 131 | compileOptions { 132 | sourceCompatibility JavaVersion.VERSION_1_8 133 | targetCompatibility JavaVersion.VERSION_1_8 134 | } 135 | 136 | defaultConfig { 137 | applicationId "com.maxieernlab" 138 | minSdkVersion rootProject.ext.minSdkVersion 139 | targetSdkVersion rootProject.ext.targetSdkVersion 140 | versionCode 1 141 | versionName "1.0" 142 | } 143 | splits { 144 | abi { 145 | reset() 146 | enable enableSeparateBuildPerCPUArchitecture 147 | universalApk false // If true, also generate a universal APK 148 | include "armeabi-v7a", "x86", "arm64-v8a", "x86_64" 149 | } 150 | } 151 | 152 | signingConfigs { 153 | debug { 154 | storeFile file('debug.keystore') 155 | storePassword 'android' 156 | keyAlias 'androiddebugkey' 157 | keyPassword 'android' 158 | } 159 | } 160 | 161 | buildTypes { 162 | debug { 163 | signingConfig signingConfigs.debug 164 | } 165 | release { 166 | // Caution! In production, you need to generate your own keystore file. 167 | // see https://facebook.github.io/react-native/docs/signed-apk-android. 168 | signingConfig signingConfigs.debug 169 | minifyEnabled enableProguardInReleaseBuilds 170 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" 171 | } 172 | } 173 | // applicationVariants are e.g. debug, release 174 | applicationVariants.all { variant -> 175 | variant.outputs.each { output -> 176 | // For each separate APK per architecture, set a unique version code as described here: 177 | // https://developer.android.com/studio/build/configure-apk-splits.html 178 | def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4] 179 | def abi = output.getFilter(OutputFile.ABI) 180 | if (abi != null) { // null for the universal-debug, universal-release variants 181 | output.versionCodeOverride = 182 | versionCodes.get(abi) * 1048576 + defaultConfig.versionCode 183 | } 184 | } 185 | } 186 | } 187 | 188 | dependencies { 189 | implementation fileTree(dir: "libs", include: ["*.jar"]) 190 | implementation "com.facebook.react:react-native:+" // From node_modules 191 | if (enableHermes) { 192 | def hermesPath = "../../node_modules/hermes-engine/android/"; 193 | debugImplementation files(hermesPath + "hermes-debug.aar") 194 | releaseImplementation files(hermesPath + "hermes-release.aar") 195 | } else { 196 | implementation jscFlavor 197 | } 198 | } 199 | 200 | // Run this once to be able to run the application with _BUCK 201 | // puts all compile dependencies into folder libs for _BUCK to use 202 | task copyDownloadableDepsToLibs(type: Copy) { 203 | from configurations.compile 204 | into 'libs' 205 | } 206 | 207 | apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project) -------------------------------------------------------------------------------- /android/app/build_defs.bzl: -------------------------------------------------------------------------------- 1 | """Helper definitions to glob .aar and .jar targets""" 2 | 3 | def create_aar_targets(aarfiles): 4 | for aarfile in aarfiles: 5 | name = "aars__" + aarfile[aarfile.rindex("/") + 1:aarfile.rindex(".aar")] 6 | lib_deps.append(":" + name) 7 | android_prebuilt_aar( 8 | name = name, 9 | aar = aarfile, 10 | ) 11 | 12 | def create_jar_targets(jarfiles): 13 | for jarfile in jarfiles: 14 | name = "jars__" + jarfile[jarfile.rindex("/") + 1:jarfile.rindex(".jar")] 15 | lib_deps.append(":" + name) 16 | prebuilt_jar( 17 | name = name, 18 | binary_jar = jarfile, 19 | ) 20 | -------------------------------------------------------------------------------- /android/app/debug.keystore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxiee/MaxieeRNLab/f84cb575b2c81a0c80a66305f4296595225e0643/android/app/debug.keystore -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 15 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /android/app/src/main/java/com/maxieernlab/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.maxieernlab; 2 | 3 | import com.facebook.react.ReactActivity; 4 | import com.facebook.react.ReactActivityDelegate; 5 | import com.facebook.react.ReactRootView; 6 | import com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView; 7 | 8 | public class MainActivity extends ReactActivity { 9 | 10 | /** 11 | * Returns the name of the main component registered from JavaScript. 12 | * This is used to schedule rendering of the component. 13 | */ 14 | @Override 15 | protected String getMainComponentName() { 16 | return "MaxieeRNLab"; 17 | } 18 | 19 | @Override 20 | protected ReactActivityDelegate createReactActivityDelegate() { 21 | return new ReactActivityDelegate(this, getMainComponentName()) { 22 | @Override 23 | protected ReactRootView createRootView() { 24 | return new RNGestureHandlerEnabledRootView(MainActivity.this); 25 | } 26 | }; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /android/app/src/main/java/com/maxieernlab/MainApplication.java: -------------------------------------------------------------------------------- 1 | package com.maxieernlab; 2 | 3 | import android.app.Application; 4 | import android.content.Context; 5 | 6 | import com.facebook.react.PackageList; 7 | import com.facebook.react.ReactApplication; 8 | import com.facebook.react.ReactNativeHost; 9 | import com.facebook.react.ReactPackage; 10 | import com.facebook.soloader.SoLoader; 11 | 12 | import java.lang.reflect.InvocationTargetException; 13 | import java.util.List; 14 | 15 | public class MainApplication extends Application implements ReactApplication { 16 | 17 | private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) { 18 | @Override 19 | public boolean getUseDeveloperSupport() { 20 | return BuildConfig.DEBUG; 21 | } 22 | 23 | @Override 24 | protected List getPackages() { 25 | List packages = new PackageList(this).getPackages(); 26 | return packages; 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 | initializeFlipper(this); // Remove this line if you don't want Flipper enabled 45 | } 46 | 47 | /** 48 | * Loads Flipper in React Native templates. 49 | * 50 | * @param context 51 | */ 52 | private static void initializeFlipper(Context context) { 53 | if (BuildConfig.DEBUG) { 54 | try { 55 | /* 56 | We use reflection here to pick up the class that initializes Flipper, 57 | since Flipper library is not available in release mode 58 | */ 59 | Class aClass = Class.forName("com.facebook.flipper.ReactNativeFlipper"); 60 | aClass.getMethod("initializeFlipper", Context.class).invoke(null, context); 61 | } catch (ClassNotFoundException e) { 62 | e.printStackTrace(); 63 | } catch (NoSuchMethodException e) { 64 | e.printStackTrace(); 65 | } catch (IllegalAccessException e) { 66 | e.printStackTrace(); 67 | } catch (InvocationTargetException e) { 68 | e.printStackTrace(); 69 | } 70 | } 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /android/app/src/main/java/com/maxieernlab/yoga/YogaActivity1.java: -------------------------------------------------------------------------------- 1 | package com.maxieernlab.yoga; 2 | 3 | import android.graphics.Color; 4 | import android.os.Bundle; 5 | import android.util.Log; 6 | import android.view.View; 7 | import android.view.ViewGroup; 8 | import android.widget.FrameLayout; 9 | 10 | import androidx.appcompat.app.AppCompatActivity; 11 | 12 | import com.facebook.yoga.YogaEdge; 13 | import com.facebook.yoga.YogaFlexDirection; 14 | import com.facebook.yoga.YogaNode; 15 | import com.facebook.yoga.YogaNodeJNIFinalizer; 16 | 17 | import java.util.ArrayList; 18 | 19 | import javax.annotation.Nullable; 20 | 21 | public class YogaActivity1 extends AppCompatActivity { 22 | private static final int VIEW_WIDTH = 200; 23 | 24 | private float screenHeight; 25 | private float screenWidth; 26 | 27 | private ArrayList poolView = new ArrayList<>(); 28 | private ArrayList poolNode = new ArrayList<>(); 29 | 30 | private String[][] colors = new String[][] { 31 | new String[] { "#d50000", "#ff1744", "#ff5252", "#ff8a80" }, 32 | new String[] { "#c51162", "#f50057", "#ff4081", "#ff80ab" }, 33 | new String[] { "#aa00ff", "#d500f9", "#e040fb", "#ea80fc" }, 34 | new String[] { "#6200ea", "#651fff", "#7c4dff", "#b388ff" } 35 | }; 36 | 37 | @Override 38 | protected void onCreate(@Nullable Bundle savedInstanceState) { 39 | super.onCreate(savedInstanceState); 40 | 41 | FrameLayout container = new FrameLayout(this); 42 | 43 | screenWidth = getWindowManager().getDefaultDisplay().getWidth(); 44 | screenHeight = getWindowManager().getDefaultDisplay().getHeight(); 45 | log("Screen size = (%f, %f)", screenWidth, screenHeight); 46 | 47 | YogaNode root = new YogaNodeJNIFinalizer(); 48 | root.setWidth(screenWidth); 49 | root.setHeight(screenHeight); 50 | root.setFlexDirection(YogaFlexDirection.COLUMN); 51 | 52 | log("start"); 53 | createRow1(root, 0); 54 | createRow1(root, 1); 55 | createRow1(root, 2); 56 | createRow1(root, 3); 57 | 58 | root.calculateLayout(screenWidth, screenHeight); 59 | 60 | for (int i = 0; i < poolView.size(); i++) { 61 | View v = poolView.get(i); 62 | YogaNode n = poolNode.get(i); 63 | YogaNode r = n.getOwner(); 64 | v.setX(r.getLayoutX() + n.getLayoutX()); 65 | v.setY(r.getLayoutY() + n.getLayoutY()); 66 | log("v%d position=(%f, %f)", 67 | i, 68 | r.getLayoutX() + n.getLayoutX(), 69 | r.getLayoutY() + n.getLayoutY()); 70 | container.addView(v); 71 | } 72 | 73 | log("end"); 74 | 75 | setContentView(container); 76 | } 77 | 78 | private void createRow1(YogaNode root, int index) { 79 | log("create index = " + index); 80 | YogaNode row = new YogaNodeJNIFinalizer(); 81 | row.setHeight(VIEW_WIDTH); 82 | row.setWidth(VIEW_WIDTH * 4); 83 | row.setFlexDirection(YogaFlexDirection.ROW); 84 | row.setMargin(YogaEdge.ALL, 20); 85 | 86 | for (int i = 0; i < 4; i++) { 87 | YogaNode n = new YogaNodeJNIFinalizer(); 88 | n.setWidth(VIEW_WIDTH); 89 | n.setHeight(VIEW_WIDTH); 90 | View v = createView(colors[index][i]); 91 | row.addChildAt(n, i); 92 | poolNode.add(n); 93 | poolView.add(v); 94 | } 95 | 96 | root.addChildAt(row, index); 97 | } 98 | 99 | private View createView(String color) { 100 | View v = new View(this); 101 | v.setBackgroundColor(Color.parseColor(color)); 102 | ViewGroup.LayoutParams lp = new FrameLayout.LayoutParams(VIEW_WIDTH, VIEW_WIDTH); 103 | v.setLayoutParams(lp); 104 | return v; 105 | } 106 | 107 | private void log(String template, Object... objects) { 108 | Log.d("max-yoga", String.format(template, objects)); 109 | } 110 | } -------------------------------------------------------------------------------- /android/app/src/main/java/com/maxieernlab/yoga/YogaActivity2.java: -------------------------------------------------------------------------------- 1 | package com.maxieernlab.yoga; 2 | 3 | import android.graphics.Color; 4 | import android.os.Bundle; 5 | import android.view.View; 6 | import android.view.ViewGroup; 7 | import android.widget.FrameLayout; 8 | 9 | import androidx.appcompat.app.AppCompatActivity; 10 | 11 | import com.facebook.yoga.YogaEdge; 12 | import com.facebook.yoga.YogaFlexDirection; 13 | import com.facebook.yoga.YogaNode; 14 | import com.facebook.yoga.YogaNodeJNIFinalizer; 15 | 16 | import javax.annotation.Nullable; 17 | 18 | public class YogaActivity2 extends AppCompatActivity { 19 | private static final int VIEW_WIDTH = 200; 20 | 21 | @Override 22 | protected void onCreate(@Nullable Bundle savedInstanceState) { 23 | super.onCreate(savedInstanceState); 24 | 25 | FrameLayout container = new FrameLayout(this); 26 | 27 | /** 28 | * 纯布局数值计算 29 | */ 30 | 31 | float screenWidth = getWindowManager().getDefaultDisplay().getWidth(); 32 | float screenHeight = getWindowManager().getDefaultDisplay().getHeight(); 33 | 34 | YogaNode root = new YogaNodeJNIFinalizer(); 35 | root.setWidth(screenWidth); 36 | root.setHeight(screenHeight); 37 | root.setFlexDirection(YogaFlexDirection.ROW); 38 | 39 | YogaNode rect1 = new YogaNodeJNIFinalizer(); 40 | rect1.setHeight(VIEW_WIDTH); 41 | rect1.setWidth(VIEW_WIDTH); 42 | rect1.setMargin(YogaEdge.ALL, 20); 43 | 44 | YogaNode rect2 = new YogaNodeJNIFinalizer(); 45 | rect2.setHeight(VIEW_WIDTH); 46 | rect2.setWidth(VIEW_WIDTH); 47 | rect2.setMargin(YogaEdge.ALL, 20); 48 | 49 | YogaNode rect3 = new YogaNodeJNIFinalizer(); 50 | rect3.setHeight(VIEW_WIDTH); 51 | rect3.setWidth(VIEW_WIDTH); 52 | rect3.setMargin(YogaEdge.ALL, 20); 53 | 54 | root.addChildAt(rect1, 0); 55 | root.addChildAt(rect2, 1); 56 | root.addChildAt(rect3, 2); 57 | 58 | // 给定屏幕长宽,求解屏幕元素位置 59 | root.calculateLayout(screenWidth, screenHeight); 60 | 61 | /** 62 | * Android 视图创建于定位 63 | */ 64 | ViewGroup.LayoutParams lp = new FrameLayout.LayoutParams(VIEW_WIDTH, VIEW_WIDTH); 65 | 66 | View v1 = new View(this); 67 | v1.setLayoutParams(lp); 68 | v1.setBackgroundColor(Color.parseColor("#d50000")); 69 | 70 | View v2 = new View(this); 71 | v2.setLayoutParams(lp); 72 | v2.setBackgroundColor(Color.parseColor("#ff1744")); 73 | 74 | View v3 = new View(this); 75 | v3.setLayoutParams(lp); 76 | v3.setBackgroundColor(Color.parseColor("#ff5252")); 77 | 78 | container.addView(v1); 79 | container.addView(v2); 80 | container.addView(v3); 81 | 82 | v1.setX(rect1.getLayoutX()); 83 | v1.setY(rect1.getLayoutY()); 84 | v2.setX(rect2.getLayoutX()); 85 | v2.setY(rect2.getLayoutY()); 86 | v3.setX(rect3.getLayoutX()); 87 | v3.setY(rect3.getLayoutY()); 88 | 89 | setContentView(container); 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-xxhdpi/react_native.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxiee/MaxieeRNLab/f84cb575b2c81a0c80a66305f4296595225e0643/android/app/src/main/res/drawable-xxhdpi/react_native.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxiee/MaxieeRNLab/f84cb575b2c81a0c80a66305f4296595225e0643/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxiee/MaxieeRNLab/f84cb575b2c81a0c80a66305f4296595225e0643/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxiee/MaxieeRNLab/f84cb575b2c81a0c80a66305f4296595225e0643/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxiee/MaxieeRNLab/f84cb575b2c81a0c80a66305f4296595225e0643/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxiee/MaxieeRNLab/f84cb575b2c81a0c80a66305f4296595225e0643/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxiee/MaxieeRNLab/f84cb575b2c81a0c80a66305f4296595225e0643/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxiee/MaxieeRNLab/f84cb575b2c81a0c80a66305f4296595225e0643/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxiee/MaxieeRNLab/f84cb575b2c81a0c80a66305f4296595225e0643/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxiee/MaxieeRNLab/f84cb575b2c81a0c80a66305f4296595225e0643/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxiee/MaxieeRNLab/f84cb575b2c81a0c80a66305f4296595225e0643/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | MaxieeRNLab 3 | 4 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | ext { 5 | buildToolsVersion = "28.0.3" 6 | minSdkVersion = 16 7 | compileSdkVersion = 28 8 | targetSdkVersion = 28 9 | } 10 | repositories { 11 | google() 12 | jcenter() 13 | } 14 | dependencies { 15 | classpath("com.android.tools.build:gradle:3.4.2") 16 | 17 | // NOTE: Do not place your application dependencies here; they belong 18 | // in the individual module build.gradle files 19 | } 20 | } 21 | 22 | allprojects { 23 | repositories { 24 | mavenLocal() 25 | maven { 26 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm 27 | url("$rootDir/../node_modules/react-native/android") 28 | } 29 | maven { 30 | // Android JSC is installed from npm 31 | url("$rootDir/../node_modules/jsc-android/dist") 32 | } 33 | google() 34 | jcenter() 35 | maven { url 'https://jitpack.io' } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /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 | android.useAndroidX=true 20 | # Automatically convert third-party libraries to use AndroidX 21 | android.enableJetifier=true -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxiee/MaxieeRNLab/f84cb575b2c81a0c80a66305f4296595225e0643/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /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-5.5-all.zip -------------------------------------------------------------------------------- /android/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | # 4 | # Copyright 2015 the original author or authors. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ############################################################################## 20 | ## 21 | ## Gradle start up script for UN*X 22 | ## 23 | ############################################################################## 24 | 25 | # Attempt to set APP_HOME 26 | # Resolve links: $0 may be a link 27 | PRG="$0" 28 | # Need this for relative symlinks. 29 | while [ -h "$PRG" ] ; do 30 | ls=`ls -ld "$PRG"` 31 | link=`expr "$ls" : '.*-> \(.*\)$'` 32 | if expr "$link" : '/.*' > /dev/null; then 33 | PRG="$link" 34 | else 35 | PRG=`dirname "$PRG"`"/$link" 36 | fi 37 | done 38 | SAVED="`pwd`" 39 | cd "`dirname \"$PRG\"`/" >/dev/null 40 | APP_HOME="`pwd -P`" 41 | cd "$SAVED" >/dev/null 42 | 43 | APP_NAME="Gradle" 44 | APP_BASE_NAME=`basename "$0"` 45 | 46 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 47 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' 48 | 49 | # Use the maximum available, or set MAX_FD != -1 to use that value. 50 | MAX_FD="maximum" 51 | 52 | warn () { 53 | echo "$*" 54 | } 55 | 56 | die () { 57 | echo 58 | echo "$*" 59 | echo 60 | exit 1 61 | } 62 | 63 | # OS specific support (must be 'true' or 'false'). 64 | cygwin=false 65 | msys=false 66 | darwin=false 67 | nonstop=false 68 | case "`uname`" in 69 | CYGWIN* ) 70 | cygwin=true 71 | ;; 72 | Darwin* ) 73 | darwin=true 74 | ;; 75 | MINGW* ) 76 | msys=true 77 | ;; 78 | NONSTOP* ) 79 | nonstop=true 80 | ;; 81 | esac 82 | 83 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 84 | 85 | # Determine the Java command to use to start the JVM. 86 | if [ -n "$JAVA_HOME" ] ; then 87 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 88 | # IBM's JDK on AIX uses strange locations for the executables 89 | JAVACMD="$JAVA_HOME/jre/sh/java" 90 | else 91 | JAVACMD="$JAVA_HOME/bin/java" 92 | fi 93 | if [ ! -x "$JAVACMD" ] ; then 94 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 95 | 96 | Please set the JAVA_HOME variable in your environment to match the 97 | location of your Java installation." 98 | fi 99 | else 100 | JAVACMD="java" 101 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 102 | 103 | Please set the JAVA_HOME variable in your environment to match the 104 | location of your Java installation." 105 | fi 106 | 107 | # Increase the maximum file descriptors if we can. 108 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 109 | MAX_FD_LIMIT=`ulimit -H -n` 110 | if [ $? -eq 0 ] ; then 111 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 112 | MAX_FD="$MAX_FD_LIMIT" 113 | fi 114 | ulimit -n $MAX_FD 115 | if [ $? -ne 0 ] ; then 116 | warn "Could not set maximum file descriptor limit: $MAX_FD" 117 | fi 118 | else 119 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 120 | fi 121 | fi 122 | 123 | # For Darwin, add options to specify how the application appears in the dock 124 | if $darwin; then 125 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 126 | fi 127 | 128 | # For Cygwin, switch paths to Windows format before running java 129 | if $cygwin ; then 130 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 131 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 132 | JAVACMD=`cygpath --unix "$JAVACMD"` 133 | 134 | # We build the pattern for arguments to be converted via cygpath 135 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 136 | SEP="" 137 | for dir in $ROOTDIRSRAW ; do 138 | ROOTDIRS="$ROOTDIRS$SEP$dir" 139 | SEP="|" 140 | done 141 | OURCYGPATTERN="(^($ROOTDIRS))" 142 | # Add a user-defined pattern to the cygpath arguments 143 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 144 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 145 | fi 146 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 147 | i=0 148 | for arg in "$@" ; do 149 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 150 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 151 | 152 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 153 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 154 | else 155 | eval `echo args$i`="\"$arg\"" 156 | fi 157 | i=$((i+1)) 158 | done 159 | case $i in 160 | (0) set -- ;; 161 | (1) set -- "$args0" ;; 162 | (2) set -- "$args0" "$args1" ;; 163 | (3) set -- "$args0" "$args1" "$args2" ;; 164 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 165 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 166 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 167 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 168 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 169 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 170 | esac 171 | fi 172 | 173 | # Escape application args 174 | save () { 175 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done 176 | echo " " 177 | } 178 | APP_ARGS=$(save "$@") 179 | 180 | # Collect all arguments for the java command, following the shell quoting and substitution rules 181 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" 182 | 183 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong 184 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then 185 | cd "$(dirname "$0")" 186 | fi 187 | 188 | exec "$JAVACMD" "$@" 189 | -------------------------------------------------------------------------------- /android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem http://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%" == "" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%" == "" set DIRNAME=. 29 | set APP_BASE_NAME=%~n0 30 | set APP_HOME=%DIRNAME% 31 | 32 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 33 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 34 | 35 | @rem Find java.exe 36 | if defined JAVA_HOME goto findJavaFromJavaHome 37 | 38 | set JAVA_EXE=java.exe 39 | %JAVA_EXE% -version >NUL 2>&1 40 | if "%ERRORLEVEL%" == "0" goto init 41 | 42 | echo. 43 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 44 | echo. 45 | echo Please set the JAVA_HOME variable in your environment to match the 46 | echo location of your Java installation. 47 | 48 | goto fail 49 | 50 | :findJavaFromJavaHome 51 | set JAVA_HOME=%JAVA_HOME:"=% 52 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 53 | 54 | if exist "%JAVA_EXE%" goto init 55 | 56 | echo. 57 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 58 | echo. 59 | echo Please set the JAVA_HOME variable in your environment to match the 60 | echo location of your Java installation. 61 | 62 | goto fail 63 | 64 | :init 65 | @rem Get command-line arguments, handling Windows variants 66 | 67 | if not "%OS%" == "Windows_NT" goto win9xME_args 68 | 69 | :win9xME_args 70 | @rem Slurp the command line arguments. 71 | set CMD_LINE_ARGS= 72 | set _SKIP=2 73 | 74 | :win9xME_args_slurp 75 | if "x%~1" == "x" goto execute 76 | 77 | set CMD_LINE_ARGS=%* 78 | 79 | :execute 80 | @rem Setup the command line 81 | 82 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 83 | 84 | @rem Execute Gradle 85 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 86 | 87 | :end 88 | @rem End local scope for the variables with windows NT shell 89 | if "%ERRORLEVEL%"=="0" goto mainEnd 90 | 91 | :fail 92 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 93 | rem the _cmd.exe /c_ return code! 94 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 95 | exit /b 1 96 | 97 | :mainEnd 98 | if "%OS%"=="Windows_NT" endlocal 99 | 100 | :omega 101 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'MaxieeRNLab' 2 | apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings) 3 | 4 | include ':app' 5 | -------------------------------------------------------------------------------- /app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "MaxieeRNLab", 3 | "displayName": "MaxieeRNLab" 4 | } -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: ['module:metro-react-native-babel-preset'] 3 | } 4 | -------------------------------------------------------------------------------- /images/001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxiee/MaxieeRNLab/f84cb575b2c81a0c80a66305f4296595225e0643/images/001.png -------------------------------------------------------------------------------- /images/002.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxiee/MaxieeRNLab/f84cb575b2c81a0c80a66305f4296595225e0643/images/002.png -------------------------------------------------------------------------------- /images/003.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxiee/MaxieeRNLab/f84cb575b2c81a0c80a66305f4296595225e0643/images/003.png -------------------------------------------------------------------------------- /images/004.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxiee/MaxieeRNLab/f84cb575b2c81a0c80a66305f4296595225e0643/images/004.png -------------------------------------------------------------------------------- /images/005.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxiee/MaxieeRNLab/f84cb575b2c81a0c80a66305f4296595225e0643/images/005.png -------------------------------------------------------------------------------- /images/006.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxiee/MaxieeRNLab/f84cb575b2c81a0c80a66305f4296595225e0643/images/006.png -------------------------------------------------------------------------------- /images/007.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxiee/MaxieeRNLab/f84cb575b2c81a0c80a66305f4296595225e0643/images/007.png -------------------------------------------------------------------------------- /images/008.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxiee/MaxieeRNLab/f84cb575b2c81a0c80a66305f4296595225e0643/images/008.png -------------------------------------------------------------------------------- /images/009.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxiee/MaxieeRNLab/f84cb575b2c81a0c80a66305f4296595225e0643/images/009.png -------------------------------------------------------------------------------- /images/010.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxiee/MaxieeRNLab/f84cb575b2c81a0c80a66305f4296595225e0643/images/010.png -------------------------------------------------------------------------------- /images/011.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxiee/MaxieeRNLab/f84cb575b2c81a0c80a66305f4296595225e0643/images/011.png -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @format 3 | */ 4 | import React from "react"; 5 | import {AppRegistry, YellowBox} from 'react-native'; 6 | import App from './src/pages/home'; 7 | import {name as appName} from './app.json'; 8 | import { Provider } from 'react-redux' 9 | import store from './src/config/store'; 10 | 11 | 12 | YellowBox.ignoreWarnings([ 13 | 'Require cycle:', 14 | ]); 15 | 16 | class ConnectedApp extends React.Component { 17 | render() { 18 | return 19 | 20 | 21 | } 22 | } 23 | 24 | AppRegistry.registerComponent(appName, () => ConnectedApp); 25 | -------------------------------------------------------------------------------- /ios/MaxieeRNLab-tvOS/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 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 | NSExceptionDomains 28 | 29 | localhost 30 | 31 | NSExceptionAllowsInsecureHTTPLoads 32 | 33 | 34 | 35 | 36 | NSLocationWhenInUseUsageDescription 37 | 38 | UILaunchStoryboardName 39 | LaunchScreen 40 | UIRequiredDeviceCapabilities 41 | 42 | armv7 43 | 44 | UISupportedInterfaceOrientations 45 | 46 | UIInterfaceOrientationPortrait 47 | UIInterfaceOrientationLandscapeLeft 48 | UIInterfaceOrientationLandscapeRight 49 | 50 | UIViewControllerBasedStatusBarAppearance 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /ios/MaxieeRNLab-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 | -------------------------------------------------------------------------------- /ios/MaxieeRNLab.xcodeproj/contents.scworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | -------------------------------------------------------------------------------- /ios/MaxieeRNLab.xcodeproj/xcshareddata/xcschemes/MaxieeRNLab-tvOS.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 43 | 49 | 50 | 51 | 52 | 53 | 58 | 59 | 61 | 67 | 68 | 69 | 70 | 71 | 77 | 78 | 79 | 80 | 81 | 82 | 92 | 94 | 100 | 101 | 102 | 103 | 104 | 105 | 111 | 113 | 119 | 120 | 121 | 122 | 124 | 125 | 128 | 129 | 130 | -------------------------------------------------------------------------------- /ios/MaxieeRNLab.xcodeproj/xcshareddata/xcschemes/MaxieeRNLab.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 43 | 49 | 50 | 51 | 52 | 53 | 58 | 59 | 61 | 67 | 68 | 69 | 70 | 71 | 77 | 78 | 79 | 80 | 81 | 82 | 92 | 94 | 100 | 101 | 102 | 103 | 104 | 105 | 111 | 113 | 119 | 120 | 121 | 122 | 124 | 125 | 128 | 129 | 130 | -------------------------------------------------------------------------------- /ios/MaxieeRNLab/AppDelegate.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Facebook, Inc. and its affiliates. 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 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (nonatomic, strong) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /ios/MaxieeRNLab/AppDelegate.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Facebook, Inc. and its affiliates. 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 | RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions]; 18 | RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge 19 | moduleName:@"MaxieeRNLab" 20 | initialProperties:nil]; 21 | 22 | rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1]; 23 | 24 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 25 | UIViewController *rootViewController = [UIViewController new]; 26 | rootViewController.view = rootView; 27 | self.window.rootViewController = rootViewController; 28 | [self.window makeKeyAndVisible]; 29 | return YES; 30 | } 31 | 32 | - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge 33 | { 34 | #if DEBUG 35 | return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil]; 36 | #else 37 | return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; 38 | #endif 39 | } 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /ios/MaxieeRNLab/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 24 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /ios/MaxieeRNLab/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/MaxieeRNLab/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /ios/MaxieeRNLab/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | MaxieeRNLab 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSRequiresIPhoneOS 26 | 27 | NSAppTransportSecurity 28 | 29 | NSAllowsArbitraryLoads 30 | 31 | NSExceptionDomains 32 | 33 | localhost 34 | 35 | NSExceptionAllowsInsecureHTTPLoads 36 | 37 | 38 | 39 | 40 | NSLocationWhenInUseUsageDescription 41 | 42 | UILaunchStoryboardName 43 | LaunchScreen 44 | UIRequiredDeviceCapabilities 45 | 46 | armv7 47 | 48 | UISupportedInterfaceOrientations 49 | 50 | UIInterfaceOrientationPortrait 51 | UIInterfaceOrientationLandscapeLeft 52 | UIInterfaceOrientationLandscapeRight 53 | 54 | UIViewControllerBasedStatusBarAppearance 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /ios/MaxieeRNLab/main.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Facebook, Inc. and its affiliates. 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 | -------------------------------------------------------------------------------- /ios/MaxieeRNLabTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 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 | -------------------------------------------------------------------------------- /ios/MaxieeRNLabTests/MaxieeRNLabTests.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Facebook, Inc. and its affiliates. 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 | #import 10 | 11 | #import 12 | #import 13 | 14 | #define TIMEOUT_SECONDS 600 15 | #define TEXT_TO_LOOK_FOR @"Welcome to React Native!" 16 | 17 | @interface MaxieeRNLabTests : XCTestCase 18 | 19 | @end 20 | 21 | @implementation MaxieeRNLabTests 22 | 23 | - (BOOL)findSubviewInView:(UIView *)view matching:(BOOL(^)(UIView *view))test 24 | { 25 | if (test(view)) { 26 | return YES; 27 | } 28 | for (UIView *subview in [view subviews]) { 29 | if ([self findSubviewInView:subview matching:test]) { 30 | return YES; 31 | } 32 | } 33 | return NO; 34 | } 35 | 36 | - (void)testRendersWelcomeScreen 37 | { 38 | UIViewController *vc = [[[RCTSharedApplication() delegate] window] rootViewController]; 39 | NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS]; 40 | BOOL foundElement = NO; 41 | 42 | __block NSString *redboxError = nil; 43 | #ifdef DEBUG 44 | RCTSetLogFunction(^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) { 45 | if (level >= RCTLogLevelError) { 46 | redboxError = message; 47 | } 48 | }); 49 | #endif 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 | #ifdef DEBUG 64 | RCTSetLogFunction(RCTDefaultLogFunction); 65 | #endif 66 | 67 | XCTAssertNil(redboxError, @"RedBox error: %@", redboxError); 68 | XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS); 69 | } 70 | 71 | 72 | @end 73 | -------------------------------------------------------------------------------- /ios/Podfile: -------------------------------------------------------------------------------- 1 | platform :ios, '9.0' 2 | require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' 3 | 4 | target 'MaxieeRNLab' do 5 | # Pods for RnDiffApp 6 | pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector" 7 | pod 'FBReactNativeSpec', :path => "../node_modules/react-native/Libraries/FBReactNativeSpec" 8 | pod 'RCTRequired', :path => "../node_modules/react-native/Libraries/RCTRequired" 9 | pod 'RCTTypeSafety', :path => "../node_modules/react-native/Libraries/TypeSafety" 10 | pod 'React', :path => '../node_modules/react-native/' 11 | pod 'React-Core', :path => '../node_modules/react-native/' 12 | pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules' 13 | pod 'React-Core/DevSupport', :path => '../node_modules/react-native/' 14 | pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS' 15 | pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation' 16 | pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob' 17 | pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image' 18 | pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS' 19 | pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network' 20 | pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings' 21 | pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text' 22 | pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration' 23 | pod 'React-Core/RCTWebSocket', :path => '../node_modules/react-native/' 24 | pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact' 25 | pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi' 26 | pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor' 27 | pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector' 28 | pod 'ReactCommon/jscallinvoker', :path => "../node_modules/react-native/ReactCommon" 29 | pod 'ReactCommon/turbomodule/core', :path => "../node_modules/react-native/ReactCommon" 30 | pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga' 31 | pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec' 32 | pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec' 33 | pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec' 34 | 35 | target 'RnDiffAppTests' do 36 | inherit! :search_paths 37 | # Pods for testing 38 | end 39 | use_native_modules! 40 | end 41 | 42 | target 'RnDiffApp-tvOS' do 43 | # Pods for RnDiffApp-tvOS 44 | target 'RnDiffApp-tvOSTests' do 45 | inherit! :search_paths 46 | # Pods for testing 47 | end 48 | 49 | end -------------------------------------------------------------------------------- /metro.config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Metro configuration for React Native 3 | * https://github.com/facebook/react-native 4 | * 5 | * @format 6 | */ 7 | module.exports = { 8 | transformer: { 9 | getTransformOptions: async () => ({ 10 | transform: { 11 | experimentalImportSupport: false, 12 | inlineRequires: false, 13 | }, 14 | }), 15 | }, 16 | }; -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "MaxieeRNLab", 3 | "version": "0.0.1", 4 | "private": true, 5 | "scripts": { 6 | "android": "react-native run-android", 7 | "ios": "react-native run-ios", 8 | "start": "react-native start", 9 | "test": "jest", 10 | "lint": "eslint ." 11 | }, 12 | "dependencies": { 13 | "@react-native-community/masked-view": "^0.1.7", 14 | "@react-navigation/bottom-tabs": "^5.2.4", 15 | "@react-navigation/material-top-tabs": "^5.1.7", 16 | "@react-navigation/native": "^5.1.3", 17 | "@react-navigation/stack": "^5.2.8", 18 | "react": "^16.9.0", 19 | "react-native": "^0.61.5", 20 | "react-native-chart-kit": "^5.2.0", 21 | "react-native-elements": "^1.2.7", 22 | "react-native-gesture-handler": "^1.6.1", 23 | "react-native-gifted-chat": "^0.13.0", 24 | "react-native-intent-launcher": "^0.2.0", 25 | "react-native-linear-gradient": "^2.5.4", 26 | "react-native-maps": "^0.27.1", 27 | "react-native-markdown-renderer": "^3.2.8", 28 | "react-native-page-control": "^1.1.1", 29 | "react-native-paper": "^3.6.0", 30 | "react-native-reanimated": "^1.7.1", 31 | "react-native-safe-area-context": "^0.7.3", 32 | "react-native-screens": "^2.4.0", 33 | "react-native-scrollable-tab-view": "^1.0.0", 34 | "react-native-svg": "^9.3.7", 35 | "react-native-swiper": "^1.6.0-rc.3", 36 | "react-native-tab-view": "^2.13.0", 37 | "react-native-ui-kitten": "^3.1.2", 38 | "react-native-vector-icons": "^6.3.0", 39 | "react-native-viewpager": "^0.2.13", 40 | "react-navigation-stack": "^2.3.6", 41 | "react-redux": "^6.0.1", 42 | "redux": "^4.0.1", 43 | "redux-thunk": "^2.3.0" 44 | }, 45 | "devDependencies": { 46 | "@babel/core": "^7.6.2", 47 | "@babel/runtime": "^7.6.2", 48 | "@react-native-community/eslint-config": "0.0.5", 49 | "babel-jest": "^24.9.0", 50 | "jest": "^24.9.0", 51 | "metro-react-native-babel-preset": "^0.56.0", 52 | "react-test-renderer": "^16.9.0" 53 | }, 54 | "jest": { 55 | "preset": "react-native" 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/common/screen.js: -------------------------------------------------------------------------------- 1 | import { Dimensions, Platform, PixelRatio } from 'react-native' 2 | 3 | export default { 4 | width: Dimensions.get('window').width, 5 | height: Dimensions.get('window').height, 6 | onePixel: 1 / PixelRatio.get(), 7 | statusBarHeight: (Platform.OS === 'ios' ? 20 : 0) 8 | } -------------------------------------------------------------------------------- /src/common/utils/HomeUtils.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Text } from 'react-native-elements'; 3 | 4 | export function createHeader(title) { 5 | return {title} 8 | } -------------------------------------------------------------------------------- /src/config/actions.js: -------------------------------------------------------------------------------- 1 | export const ACTION_TODO_ADD = "TODO_ADD"; 2 | export const ACTION_TODO_FINISH = "TODO_FINISH"; 3 | export const ACTION_TODO_UNFINISH = "TODO_UNFINISH"; -------------------------------------------------------------------------------- /src/config/store.js: -------------------------------------------------------------------------------- 1 | import { combineReducers, createStore, applyMiddleware } from "redux"; 2 | import todo from '../reducers/todo/reducer'; 3 | import thunk from 'redux-thunk'; 4 | 5 | const rootReducer = combineReducers({ 6 | todo 7 | }); 8 | 9 | const store = createStore( 10 | rootReducer, 11 | applyMiddleware(thunk) 12 | ); 13 | 14 | export default store; -------------------------------------------------------------------------------- /src/demo/ChartDemo/DemoLineChart.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { LineChart } from 'react-native-chart-kit' 3 | import { Dimensions } from 'react-native'; 4 | 5 | 6 | export default () => { 7 | return ( 8 | `rgba(255, 255, 255, ${opacity})`, 30 | style: { 31 | borderRadius: 16 32 | } 33 | }} 34 | bezier 35 | style={{ 36 | marginVertical: 8, 37 | borderRadius: 16 38 | }} 39 | /> 40 | ) 41 | } -------------------------------------------------------------------------------- /src/demo/ChatDemo/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import {GiftedChat, Actions, Bubble, SystemMessage} from 'react-native-gifted-chat'; 3 | import { View, Text, Button } from 'react-native'; 4 | import GradientButton from '../ReactNativeUIDemo/buttons/GradientButton' 5 | 6 | let messages = [ 7 | { 8 | _id: 2, 9 | text: "World!", 10 | createdAt: new Date(Date.UTC(2019, 3, 1, 1, 0, 0)), 11 | user: { 12 | _id: 2, 13 | name: "Judy" 14 | }, 15 | sent: true, 16 | received: true 17 | }, 18 | { 19 | _id: 1, 20 | text: "hello", 21 | createdAt: new Date(Date.UTC(2019, 3, 1, 2, 0, 0)), 22 | user: { 23 | _id: 1, 24 | name: "MaxieeBot" 25 | }, 26 | sent: true, 27 | received: true 28 | }, { 29 | _id: 3, 30 | text: 'I am system message', 31 | createdAt: new Date(Date.UTC(2019,32, 1, 3, 0, 0)), 32 | system: true, 33 | } 34 | ] 35 | 36 | export default class ChatDemo extends React.Component { 37 | 38 | state = { 39 | messages: messages, 40 | } 41 | 42 | constructor(props) { 43 | super(props) 44 | 45 | this.onSend = this.onSend.bind(this) 46 | this.renderCustomActions = this.renderCustomActions.bind(this) 47 | this.renderBubble = this.renderBubble.bind(this) 48 | this.renderCustomView = this.renderCustomView.bind(this) 49 | } 50 | 51 | onSend(messages = []) { 52 | this.setState((previousState) => { 53 | return { 54 | messages: GiftedChat.append(previousState.messages, messages) 55 | } 56 | }) 57 | } 58 | 59 | renderCustomActions(props) { 60 | const options = { 61 | 'Action 1': (props) => { 62 | props.onSend({ 63 | comp: 29 | 30 | 33 | Add Todo 34 | 35 | this.setState({ 40 | dialogInputTodoName: text 41 | })} /> 42 | 43 | 44 | 45 | 61 | 62 | 63 | 64 | { 65 | todo.todos.map((v,index) => ( 66 | { 71 | v.finished ? "DONE" : "TODO" 72 | }} 73 | right={props => } /> 79 | )) 80 | } 81 | 82 | 83 | } 84 | } 85 | 86 | const mapStateToProps = ({todo}) => ({todo}) 87 | const actions = {todoAdd, todoFinish, todoUnfinish} 88 | 89 | export default connect(mapStateToProps, actions)(Component) -------------------------------------------------------------------------------- /src/pages/basic/RNBasicScrollView.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { View, Text, ScrollView, StyleSheet } from 'react-native'; 3 | import { Heading2 } from '../../widgets/text/Text'; 4 | import PageControl from 'react-native-page-control'; 5 | import screen from '../../common/screen'; 6 | 7 | const styles = StyleSheet.create({ 8 | scrollView: { 9 | height: 100, 10 | borderWidth: 1, 11 | borderColor: 'red' 12 | }, 13 | heading: { 14 | margin: 10 15 | } 16 | }); 17 | 18 | export default class RNBasicScrollView extends React.Component { 19 | constructor(props) { 20 | super(props); 21 | 22 | this.state = { 23 | currentPage: 0 24 | } 25 | } 26 | 27 | onScroll(e) { 28 | let x = e.nativeEvent.contentOffset.x; 29 | let currentPage = Math.round(x / screen.width); 30 | 31 | if (this.state.currentPage != currentPage) { 32 | this.setState({ 33 | currentPage: currentPage 34 | }) 35 | } 36 | } 37 | 38 | render() { 39 | let items = [] 40 | 41 | for (let i = 0; i < 10; i++) { 42 | items.push({i}) 50 | } 51 | 52 | return ( 53 | 54 | Basic ScrollView 55 | 56 | {items} 57 | 58 | Horizontal ScrollView 59 | 60 | {items} 61 | 62 | PagingEnabled ScrollView 63 | this.onScroll(e)}> 65 | {items} 66 | {items} 67 | 68 | 75 | 76 | ) 77 | } 78 | } -------------------------------------------------------------------------------- /src/pages/basic/RNScrollableTabView.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { View } from 'react-native'; 3 | import { Heading2 } from '../../widgets/text/Text'; 4 | import ScrollableTabView from 'react-native-scrollable-tab-view'; 5 | import screen from '../../common/screen'; 6 | 7 | const SimpleTab = () => 8 | 9 | 10 | 11 | 12 | 13 | export default (props) => { 14 | return ( 15 | 16 | Simple 17 | 18 | 19 | ) 20 | } -------------------------------------------------------------------------------- /src/pages/basic/RNThirdSwiper.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { Text, View, ScrollView, StyleSheet, Button, Image } from 'react-native'; 3 | import Swiper from 'react-native-swiper' 4 | import { createStackNavigator } from '@react-navigation/stack'; 5 | import GridView from '../../widgets/gridview/GridView'; 6 | import Icon from 'react-native-vector-icons/Ionicons'; 7 | 8 | const styles = StyleSheet.create({ 9 | slide1: { 10 | flex: 1, 11 | justifyContent: 'center', 12 | alignItems: 'center', 13 | backgroundColor: '#9DD6EB' 14 | }, 15 | slide2: { 16 | flex: 1, 17 | justifyContent: 'center', 18 | alignItems: 'center', 19 | backgroundColor: '#97CAE5' 20 | }, 21 | slide3: { 22 | flex: 1, 23 | justifyContent: 'center', 24 | alignItems: 'center', 25 | backgroundColor: '#92BBD9' 26 | }, 27 | text: { 28 | color: '#fff', 29 | fontSize: 30, 30 | fontWeight: 'bold' 31 | }, 32 | slide: { 33 | flex: 1, 34 | justifyContent: 'center', 35 | alignItems: 'center', 36 | }, 37 | }) 38 | 39 | const BasicDemo = () => { 40 | return ( 41 | 42 | 43 | Hello Swiper 44 | 45 | 46 | Beautiful 47 | 48 | 49 | And simple 50 | 51 | 52 | ) 53 | } 54 | 55 | const VerticalDemo = () => { 56 | return ( 57 | 58 | 59 | Hello Swiper 60 | 61 | 62 | Beautiful 63 | 64 | 65 | And simple 66 | 67 | 68 | ) 69 | } 70 | 71 | const ImageDemo = () => { 72 | return ( 73 | 74 | 83 | } 84 | activeDot={ 85 | 92 | } 93 | paginationStyle={{ 94 | bottom: -23, 95 | left: null, 96 | right: 10 97 | }}> 98 | Aussie tourist dies at Bali hotel}> 99 | 100 | 101 | Big lie behind Nine’s new show}> 102 | 103 | 104 | Why Stone split from Garfield}> 105 | 106 | 107 | Learn from Kim K to land that job}> 108 | 109 | 110 | 111 | 112 | ) 113 | } 114 | 115 | const HomeDemo = (props) => { 116 | let infos = [ 117 | { 118 | title: "Basic", 119 | subtitle: "", 120 | icon: , 121 | onPress: () => props.navigation.push('Basic') 122 | }, 123 | { 124 | title: "Vertical", 125 | subtitle: "autoplay", 126 | icon: , 127 | onPress: () => props.navigation.push('Vertical') 128 | }, 129 | { 130 | title: "Image", 131 | subtitle: "", 132 | icon: , 133 | onPress: () => props.navigation.push('Image') 134 | }, 135 | ]; 136 | 137 | return ( 138 | 139 | infos[index].onPress()}/> 142 | 143 | ) 144 | } 145 | 146 | const Stack = createStackNavigator(); 147 | 148 | export default () => { 149 | return ( 150 | 151 | 154 | 157 | 160 | 163 | 164 | ) 165 | } 166 | 167 | // const Stack = createStackNavigator({ 168 | // Home: HomeDemo, 169 | // Basic: BasicDemo, 170 | // Vertical: VerticalDemo, 171 | // Image: ImageDemo 172 | // }, { 173 | // headerMode: "none" 174 | // }); 175 | 176 | // export default Stack; -------------------------------------------------------------------------------- /src/pages/basic/img/Swiper1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxiee/MaxieeRNLab/f84cb575b2c81a0c80a66305f4296595225e0643/src/pages/basic/img/Swiper1.jpg -------------------------------------------------------------------------------- /src/pages/basic/img/Swiper2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxiee/MaxieeRNLab/f84cb575b2c81a0c80a66305f4296595225e0643/src/pages/basic/img/Swiper2.jpg -------------------------------------------------------------------------------- /src/pages/basic/img/Swiper3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxiee/MaxieeRNLab/f84cb575b2c81a0c80a66305f4296595225e0643/src/pages/basic/img/Swiper3.jpg -------------------------------------------------------------------------------- /src/pages/basic/img/Swiper4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxiee/MaxieeRNLab/f84cb575b2c81a0c80a66305f4296595225e0643/src/pages/basic/img/Swiper4.jpg -------------------------------------------------------------------------------- /src/pages/demo/DemoHome.js: -------------------------------------------------------------------------------- 1 | import React, {PureComponent} from 'react'; 2 | import { ScrollView, View } from 'react-native'; 3 | import { Button } from 'react-native-elements'; 4 | 5 | export default class DemoHome extends PureComponent { 6 | static navigationOptions = { 7 | title: 'Demos' 8 | } 9 | 10 | render() { 11 | return ( 12 | 13 | 14 | 15 | 16 | 17 |