├── .babelrc ├── .buckconfig ├── .editorconfig ├── .eslintrc ├── .flowconfig ├── .gitattributes ├── .gitignore ├── .watchmanconfig ├── README.md ├── __tests__ ├── index.android.js └── index.ios.js ├── android ├── app │ ├── BUCK │ ├── build.gradle │ ├── proguard-rules.pro │ └── src │ │ └── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ └── com │ │ │ └── buger │ │ │ ├── MainActivity.java │ │ │ └── MainApplication.java │ │ └── res │ │ ├── mipmap-hdpi │ │ └── ic_launcher.png │ │ ├── mipmap-mdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxhdpi │ │ └── ic_launcher.png │ │ └── values │ │ ├── strings.xml │ │ └── styles.xml ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── keystores │ ├── BUCK │ └── debug.keystore.properties └── settings.gradle ├── app.json ├── app ├── components │ ├── Button.js │ ├── CallOnceInInterval.js │ ├── ImageGallery.js │ ├── NetworkLoading.js │ ├── Touchable.js │ └── index.js ├── containers │ ├── Account.js │ ├── AddPage.js │ ├── Detail.js │ ├── Home.js │ ├── Loading.js │ ├── Login.js │ └── home │ │ └── Cell.js ├── images │ ├── aboutMe.png │ ├── add.png │ ├── assign.png │ ├── att.png │ ├── back.jpg │ ├── back.png │ ├── close.png │ ├── close_white.png │ ├── commentup.png │ ├── down.png │ ├── header_back.jpg │ ├── house.png │ ├── launcher.png │ ├── lib.png │ ├── login_back.jpg │ ├── logo.jpg │ ├── logout.png │ ├── person.png │ ├── pingluna.png │ ├── pinlun.png │ ├── shang.png │ ├── subm3it.png │ ├── submi1t.png │ ├── submit.png │ ├── timg.jpg │ └── up.png ├── index.js ├── models │ ├── app.js │ └── home.js ├── router.js ├── services │ ├── api.js │ └── auth.js └── utils │ ├── dva.js │ ├── index.js │ ├── request.js │ └── storage.js ├── demo.gif ├── index.js ├── ios ├── buger-tvOS │ └── Info.plist ├── buger-tvOSTests │ └── Info.plist ├── buger.xcodeproj │ ├── project.pbxproj │ └── xcshareddata │ │ └── xcschemes │ │ ├── buger-tvOS.xcscheme │ │ └── buger.xcscheme ├── buger │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Base.lproj │ │ └── LaunchScreen.xib │ ├── Images.xcassets │ │ ├── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ ├── ic_launcher-1.png │ │ │ └── ic_launcher.png │ │ └── Contents.json │ ├── Info.plist │ └── main.m └── bugerTests │ ├── Info.plist │ └── bugerTests.m ├── jsconfig.json ├── package-lock.json ├── package.json └── yarn.lock /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["react-native"], 3 | "plugins": [ 4 | "transform-decorators-legacy", 5 | ["import", { "libraryName": "antd-mobile-rn" }] 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /.buckconfig: -------------------------------------------------------------------------------- 1 | 2 | [android] 3 | target = Google Inc.:Google APIs:23 4 | 5 | [maven_repositories] 6 | central = https://repo1.maven.org/maven2 7 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | end_of_line = lf 7 | indent_size = 2 8 | indent_style = space 9 | insert_final_newline = true 10 | max_line_length = 80 11 | trim_trailing_whitespace = true 12 | 13 | [*.md] 14 | max_line_length = 0 15 | trim_trailing_whitespace = false 16 | -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "parser": "babel-eslint", 3 | "env": { 4 | "browser": true 5 | }, 6 | "extends": [ 7 | "airbnb", 8 | "prettier", 9 | "prettier/react" 10 | ], 11 | "plugins": [ 12 | "react", 13 | "jsx-a11y", 14 | "import", 15 | "prettier" 16 | ], 17 | "globals": { 18 | "__DEV__": true 19 | }, 20 | "rules": { 21 | "arrow-parens": 0, 22 | "no-unused-vars": 0, 23 | "global-require": 0, 24 | "linebreak-style": 0, 25 | "import/prefer-default-export": 0, 26 | "react/jsx-boolean-value":0, 27 | "no-console": 0, 28 | "no-mixed-operators": 0, 29 | "no-use-before-define": 0, 30 | "radix": 0, 31 | "react/destructuring-assignment": 0, 32 | "react/jsx-filename-extension": 0, 33 | "react/prop-types": 0, 34 | "semi": [2, "never"] 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /.flowconfig: -------------------------------------------------------------------------------- 1 | [ignore] 2 | ; We fork some components by platform 3 | .*/*[.]android.js 4 | 5 | ; Ignore "BUCK" generated dirs 6 | /\.buckd/ 7 | 8 | ; Ignore unexpected extra "@providesModule" 9 | .*/node_modules/.*/node_modules/fbjs/.* 10 | 11 | ; Ignore duplicate module providers 12 | ; For RN Apps installed via npm, "Libraries" folder is inside 13 | ; "node_modules/react-native" but in the source repo it is in the root 14 | .*/Libraries/react-native/React.js 15 | 16 | ; Ignore polyfills 17 | .*/Libraries/polyfills/.* 18 | 19 | ; Ignore metro 20 | .*/node_modules/metro/.* 21 | 22 | [include] 23 | 24 | [libs] 25 | node_modules/react-native/Libraries/react-native/react-native-interface.js 26 | node_modules/react-native/flow/ 27 | node_modules/react-native/flow-github/ 28 | 29 | [options] 30 | emoji=true 31 | 32 | module.system=haste 33 | 34 | munge_underscores=true 35 | 36 | module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub' 37 | 38 | module.file_ext=.js 39 | module.file_ext=.jsx 40 | module.file_ext=.json 41 | module.file_ext=.native.js 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[a-z,_]*\\)?)\\) 49 | suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+ 50 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy 51 | suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError 52 | 53 | [version] 54 | ^0.67.0 55 | -------------------------------------------------------------------------------- /.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 | 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 | -------------------------------------------------------------------------------- /.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## 功能描述 2 | 3 | 基于React Native开发的简易版Jira Bug管理APP。 4 | 本人是测试,故而应用主要服务于测试过程中的,Bug新建,状态管理,回归备注,附件查看等测试流程。 5 | 一改了之前常规管理应用的列表到详情式设计,新版本采用更为直观的瀑布流式设计,使我们像刷朋友圈似的刷Bug单。结合PC上的收藏过滤器使用,可以让我们更准确的获取需要的信息列表。 6 | 7 | ## 功能演示 8 | ![image](https://github.com/t880216t/buger/blob/Buger_v3.0.0/demo.gif) 9 | 10 | ## 开发环境: 11 | 12 | + 本应用基于[react-native 0.55.4](http://facebook.github.io/react-native)开发 13 | + 用[react-native-dva-starter](https://github.com/nihgwu/react-native-dva-starter)脚手架创建 14 | + 采用了[dva-core 1.3.0](https://github.com/dvajs/dva/tree/dva-core%401.3.0)作为数据流管理框架 15 | + 部分控件来自[antd-mobile-rn 2.2.1](https://rn.mobile.ant.design/index-cn)组件库 16 | + 使用[react-navigation 2.5.1](https://reactnavigation.org/)导航框架 17 | + 兼容了IOS及Android大部分主流机型 18 | 19 | ## 项目结构简介 20 | ``` js 21 | ├── __tests__ // jest测试脚本 22 | ├── android // 安卓原生文件 23 | ├── app 24 | │ ├── components // 通用组件 25 | │ ├── containers // 应用文件 26 | │ ├── images // 静态资源文件 27 | │ ├── models // 封装了redux的models 28 | │ ├── services // 请求api 29 | │ ├── utils 30 | │ ├── dva.js // dva核心 31 | │ ├── request.js // 封装的fetch请求 32 | │ ├── storage.js // 本地存储封装 33 | │ └── index.js // 工具封装集合 34 | │ ├── router.js // 路由配置 35 | │ └── index.js // 注册model 36 | ├── ios // 苹果原生文件 37 | ├── index.js // 入口文件 38 | ├── app.json // 应用名配置 39 | ├── .eslintrc // eslint语法限制配置 40 | ├── .flowconfig // flow语法配置 41 | ├── .gitignore // git上传配置 42 | ├── .babelrc // babel按需加载配置 43 | ├── README.md // 我 44 | └── package.json // npm应用包清单 45 | 46 | ``` 47 | 48 | ## 历史版本 49 | + 2018-8 v3.0.0 50 | 使用dva架构重构,移除了部分功能,优化了界面样式及稳定性 51 | 52 | + 2017-11 v2.0.0 53 | 集成了任务管理及工作日志等功能 54 | 55 | + 2017-8 v1.0.0 56 | 初始版本 57 | 58 | ## 联系方式 59 | 60 | 562746248@qq.com 61 | 62 | -------------------------------------------------------------------------------- /__tests__/index.android.js: -------------------------------------------------------------------------------- 1 | import 'react-native'; 2 | import React from 'react'; 3 | import Index from '../index.android.js'; 4 | 5 | // Note: test renderer must be required after react-native. 6 | import renderer from 'react-test-renderer'; 7 | 8 | it('renders correctly', () => { 9 | const tree = renderer.create( 10 | 11 | ); 12 | }); 13 | -------------------------------------------------------------------------------- /__tests__/index.ios.js: -------------------------------------------------------------------------------- 1 | import 'react-native'; 2 | import React from 'react'; 3 | import Index from '../index.ios.js'; 4 | 5 | // Note: test renderer must be required after react-native. 6 | import renderer from 'react-test-renderer'; 7 | 8 | it('renders correctly', () => { 9 | const tree = renderer.create( 10 | 11 | ); 12 | }); 13 | -------------------------------------------------------------------------------- /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 | lib_deps = [] 12 | 13 | for jarfile in glob(['libs/*.jar']): 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 | 21 | for aarfile in glob(['libs/*.aar']): 22 | name = 'aars__' + aarfile[aarfile.rindex('/') + 1: aarfile.rindex('.aar')] 23 | lib_deps.append(':' + name) 24 | android_prebuilt_aar( 25 | name = name, 26 | aar = aarfile, 27 | ) 28 | 29 | android_library( 30 | name = "all-libs", 31 | exported_deps = lib_deps, 32 | ) 33 | 34 | android_library( 35 | name = "app-code", 36 | srcs = glob([ 37 | "src/main/java/**/*.java", 38 | ]), 39 | deps = [ 40 | ":all-libs", 41 | ":build_config", 42 | ":res", 43 | ], 44 | ) 45 | 46 | android_build_config( 47 | name = "build_config", 48 | package = "com.buger", 49 | ) 50 | 51 | android_resource( 52 | name = "res", 53 | package = "com.buger", 54 | res = "src/main/res", 55 | ) 56 | 57 | android_binary( 58 | name = "app", 59 | keystore = "//android/keystores:debug", 60 | manifest = "src/main/AndroidManifest.xml", 61 | package_type = "debug", 62 | deps = [ 63 | ":app-code", 64 | ], 65 | ) 66 | -------------------------------------------------------------------------------- /android/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "com.android.application" 2 | 3 | import com.android.build.OutputFile 4 | 5 | /** 6 | * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets 7 | * and bundleReleaseJsAndAssets). 8 | * These basically call `react-native bundle` with the correct arguments during the Android build 9 | * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the 10 | * bundle directly from the development server. Below you can see all the possible configurations 11 | * and their defaults. If you decide to add a configuration block, make sure to add it before the 12 | * `apply from: "../../node_modules/react-native/react.gradle"` line. 13 | * 14 | * project.ext.react = [ 15 | * // the name of the generated asset file containing your JS bundle 16 | * bundleAssetName: "index.android.bundle", 17 | * 18 | * // the entry file for bundle generation 19 | * entryFile: "index.android.js", 20 | * 21 | * // whether to bundle JS and assets in debug mode 22 | * bundleInDebug: false, 23 | * 24 | * // whether to bundle JS and assets in release mode 25 | * bundleInRelease: true, 26 | * 27 | * // whether to bundle JS and assets in another build variant (if configured). 28 | * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants 29 | * // The configuration property can be in the following formats 30 | * // 'bundleIn${productFlavor}${buildType}' 31 | * // 'bundleIn${buildType}' 32 | * // bundleInFreeDebug: true, 33 | * // bundleInPaidRelease: true, 34 | * // bundleInBeta: true, 35 | * 36 | * // whether to disable dev mode in custom build variants (by default only disabled in release) 37 | * // for example: to disable dev mode in the staging build type (if configured) 38 | * devDisabledInStaging: true, 39 | * // The configuration property can be in the following formats 40 | * // 'devDisabledIn${productFlavor}${buildType}' 41 | * // 'devDisabledIn${buildType}' 42 | * 43 | * // the root of your project, i.e. where "package.json" lives 44 | * root: "../../", 45 | * 46 | * // where to put the JS bundle asset in debug mode 47 | * jsBundleDirDebug: "$buildDir/intermediates/assets/debug", 48 | * 49 | * // where to put the JS bundle asset in release mode 50 | * jsBundleDirRelease: "$buildDir/intermediates/assets/release", 51 | * 52 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 53 | * // require('./image.png')), in debug mode 54 | * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug", 55 | * 56 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 57 | * // require('./image.png')), in release mode 58 | * resourcesDirRelease: "$buildDir/intermediates/res/merged/release", 59 | * 60 | * // by default the gradle tasks are skipped if none of the JS files or assets change; this means 61 | * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to 62 | * // date; if you have any other folders that you want to ignore for performance reasons (gradle 63 | * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/ 64 | * // for example, you might want to remove it from here. 65 | * inputExcludes: ["android/**", "ios/**"], 66 | * 67 | * // override which node gets called and with what additional arguments 68 | * nodeExecutableAndArgs: ["node"], 69 | * 70 | * // supply additional arguments to the packager 71 | * extraPackagerArgs: [] 72 | * ] 73 | */ 74 | 75 | project.ext.react = [ 76 | entryFile: "index.js" 77 | ] 78 | 79 | apply from: "../../node_modules/react-native/react.gradle" 80 | 81 | /** 82 | * Set this to true to create two separate APKs instead of one: 83 | * - An APK that only works on ARM devices 84 | * - An APK that only works on x86 devices 85 | * The advantage is the size of the APK is reduced by about 4MB. 86 | * Upload all the APKs to the Play Store and people will download 87 | * the correct one based on the CPU architecture of their device. 88 | */ 89 | def enableSeparateBuildPerCPUArchitecture = false 90 | 91 | /** 92 | * Run Proguard to shrink the Java bytecode in release builds. 93 | */ 94 | def enableProguardInReleaseBuilds = false 95 | 96 | android { 97 | compileSdkVersion 23 98 | buildToolsVersion "23.0.1" 99 | 100 | defaultConfig { 101 | applicationId "com.buger" 102 | minSdkVersion 16 103 | targetSdkVersion 22 104 | versionCode 1 105 | versionName "1.0" 106 | ndk { 107 | abiFilters "armeabi-v7a", "x86" 108 | } 109 | } 110 | splits { 111 | abi { 112 | reset() 113 | enable enableSeparateBuildPerCPUArchitecture 114 | universalApk false // If true, also generate a universal APK 115 | include "armeabi-v7a", "x86" 116 | } 117 | } 118 | signingConfigs { 119 | release { 120 | keyAlias "key0" 121 | keyPassword "t880216t" 122 | storeFile file("buger_key.jks") 123 | storePassword "t880216t" 124 | } 125 | } 126 | buildTypes { 127 | release { 128 | minifyEnabled enableProguardInReleaseBuilds 129 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" 130 | signingConfig signingConfigs.release 131 | } 132 | } 133 | // applicationVariants are e.g. debug, release 134 | applicationVariants.all { variant -> 135 | variant.outputs.each { output -> 136 | // For each separate APK per architecture, set a unique version code as described here: 137 | // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits 138 | def versionCodes = ["armeabi-v7a": 1, "x86": 2] 139 | def abi = output.getFilter(OutputFile.ABI) 140 | if (abi != null) { // null for the universal-debug, universal-release variants 141 | output.versionCodeOverride = 142 | versionCodes.get(abi) * 1048576 + defaultConfig.versionCode 143 | } 144 | } 145 | } 146 | } 147 | 148 | dependencies { 149 | compile fileTree(dir: "libs", include: ["*.jar"]) 150 | compile "com.android.support:appcompat-v7:23.0.1" 151 | compile "com.facebook.react:react-native:+" // From node_modules 152 | } 153 | 154 | // Run this once to be able to run the application with BUCK 155 | // puts all compile dependencies into folder libs for BUCK to use 156 | task copyDownloadableDepsToLibs(type: Copy) { 157 | from configurations.compile 158 | into 'libs' 159 | } 160 | -------------------------------------------------------------------------------- /android/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | 19 | # Disabling obfuscation is useful if you collect stack traces from production crashes 20 | # (unless you are using a system that supports de-obfuscate the stack traces). 21 | -dontobfuscate 22 | 23 | # React Native 24 | 25 | # Keep our interfaces so they can be used by other ProGuard rules. 26 | # See http://sourceforge.net/p/proguard/bugs/466/ 27 | -keep,allowobfuscation @interface com.facebook.proguard.annotations.DoNotStrip 28 | -keep,allowobfuscation @interface com.facebook.proguard.annotations.KeepGettersAndSetters 29 | -keep,allowobfuscation @interface com.facebook.common.internal.DoNotStrip 30 | 31 | # Do not strip any method/class that is annotated with @DoNotStrip 32 | -keep @com.facebook.proguard.annotations.DoNotStrip class * 33 | -keep @com.facebook.common.internal.DoNotStrip class * 34 | -keepclassmembers class * { 35 | @com.facebook.proguard.annotations.DoNotStrip *; 36 | @com.facebook.common.internal.DoNotStrip *; 37 | } 38 | 39 | -keepclassmembers @com.facebook.proguard.annotations.KeepGettersAndSetters class * { 40 | void set*(***); 41 | *** get*(); 42 | } 43 | 44 | -keep class * extends com.facebook.react.bridge.JavaScriptModule { *; } 45 | -keep class * extends com.facebook.react.bridge.NativeModule { *; } 46 | -keepclassmembers,includedescriptorclasses class * { native ; } 47 | -keepclassmembers class * { @com.facebook.react.uimanager.UIProp ; } 48 | -keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactProp ; } 49 | -keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactPropGroup ; } 50 | 51 | -dontwarn com.facebook.react.** 52 | 53 | # TextLayoutBuilder uses a non-public Android constructor within StaticLayout. 54 | # See libs/proxy/src/main/java/com/facebook/fbui/textlayoutbuilder/proxy for details. 55 | -dontwarn android.text.StaticLayout 56 | 57 | # okhttp 58 | 59 | -keepattributes Signature 60 | -keepattributes *Annotation* 61 | -keep class okhttp3.** { *; } 62 | -keep interface okhttp3.** { *; } 63 | -dontwarn okhttp3.** 64 | 65 | # okio 66 | 67 | -keep class sun.misc.Unsafe { *; } 68 | -dontwarn java.nio.file.* 69 | -dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement 70 | -dontwarn okio.** 71 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 13 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /android/app/src/main/java/com/buger/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.buger; 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 "buger"; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /android/app/src/main/java/com/buger/MainApplication.java: -------------------------------------------------------------------------------- 1 | package com.buger; 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 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t880216t/buger/6db7698f7f9a613da31fa397c87684feaf55d96d/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t880216t/buger/6db7698f7f9a613da31fa397c87684feaf55d96d/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t880216t/buger/6db7698f7f9a613da31fa397c87684feaf55d96d/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t880216t/buger/6db7698f7f9a613da31fa397c87684feaf55d96d/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | buger 3 | 4 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | ## Project-wide Gradle settings. 2 | # 3 | # For more details on how to configure your build environment visit 4 | # http://www.gradle.org/docs/current/userguide/build_environment.html 5 | # 6 | # Specifies the JVM arguments used for the daemon process. 7 | # The setting is particularly useful for tweaking memory settings. 8 | # Default value: -Xmx1024m -XX:MaxPermSize=256m 9 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 10 | # 11 | # When configured, Gradle will run in incubating parallel mode. 12 | # This option should only be used with decoupled projects. More details, visit 13 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 14 | # org.gradle.parallel=true 15 | #Thu Aug 23 14:07:00 CST 2018 16 | systemProp.http.proxyPort=8080 17 | android.useDeprecatedNdk=true 18 | systemProp.http.proxyUser=chenjian0112 19 | systemProp.http.proxyPassword=Nj123456 20 | systemProp.https.proxyPassword=Nj123456 21 | systemProp.https.proxyHost=192.168.16.232 22 | systemProp.http.proxyHost=192.168.16.232 23 | systemProp.https.proxyPort=8080 24 | systemProp.https.proxyUser=chenjian0112 25 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t880216t/buger/6db7698f7f9a613da31fa397c87684feaf55d96d/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-2.14.1-all.zip 6 | -------------------------------------------------------------------------------- /android/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # For Cygwin, ensure paths are in UNIX format before anything is touched. 46 | if $cygwin ; then 47 | [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` 48 | fi 49 | 50 | # Attempt to set APP_HOME 51 | # Resolve links: $0 may be a link 52 | PRG="$0" 53 | # Need this for relative symlinks. 54 | while [ -h "$PRG" ] ; do 55 | ls=`ls -ld "$PRG"` 56 | link=`expr "$ls" : '.*-> \(.*\)$'` 57 | if expr "$link" : '/.*' > /dev/null; then 58 | PRG="$link" 59 | else 60 | PRG=`dirname "$PRG"`"/$link" 61 | fi 62 | done 63 | SAVED="`pwd`" 64 | cd "`dirname \"$PRG\"`/" >&- 65 | APP_HOME="`pwd -P`" 66 | cd "$SAVED" >&- 67 | 68 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 69 | 70 | # Determine the Java command to use to start the JVM. 71 | if [ -n "$JAVA_HOME" ] ; then 72 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 73 | # IBM's JDK on AIX uses strange locations for the executables 74 | JAVACMD="$JAVA_HOME/jre/sh/java" 75 | else 76 | JAVACMD="$JAVA_HOME/bin/java" 77 | fi 78 | if [ ! -x "$JAVACMD" ] ; then 79 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 80 | 81 | Please set the JAVA_HOME variable in your environment to match the 82 | location of your Java installation." 83 | fi 84 | else 85 | JAVACMD="java" 86 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 87 | 88 | Please set the JAVA_HOME variable in your environment to match the 89 | location of your Java installation." 90 | fi 91 | 92 | # Increase the maximum file descriptors if we can. 93 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 94 | MAX_FD_LIMIT=`ulimit -H -n` 95 | if [ $? -eq 0 ] ; then 96 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 97 | MAX_FD="$MAX_FD_LIMIT" 98 | fi 99 | ulimit -n $MAX_FD 100 | if [ $? -ne 0 ] ; then 101 | warn "Could not set maximum file descriptor limit: $MAX_FD" 102 | fi 103 | else 104 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 105 | fi 106 | fi 107 | 108 | # For Darwin, add options to specify how the application appears in the dock 109 | if $darwin; then 110 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 111 | fi 112 | 113 | # For Cygwin, switch paths to Windows format before running java 114 | if $cygwin ; then 115 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 116 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 158 | function splitJvmOpts() { 159 | JVM_OPTS=("$@") 160 | } 161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 163 | 164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 165 | -------------------------------------------------------------------------------- /android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /android/keystores/BUCK: -------------------------------------------------------------------------------- 1 | keystore( 2 | name = "debug", 3 | properties = "debug.keystore.properties", 4 | store = "debug.keystore", 5 | visibility = [ 6 | "PUBLIC", 7 | ], 8 | ) 9 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'buger' 2 | 3 | include ':app' 4 | -------------------------------------------------------------------------------- /app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "buger", 3 | "displayName": "buger" 4 | } -------------------------------------------------------------------------------- /app/components/Button.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { StyleSheet, Text } from 'react-native' 3 | 4 | import Touchable from './Touchable' 5 | 6 | export const Button = ({ text, children, style, textStyle, ...rest }) => ( 7 | 8 | {text || children} 9 | 10 | ) 11 | 12 | const styles = StyleSheet.create({ 13 | button: { 14 | paddingVertical: 6, 15 | paddingHorizontal: 12, 16 | borderRadius: 3, 17 | backgroundColor: '#fff', 18 | alignItems: 'center', 19 | justifyContent: 'center', 20 | borderColor: '#037aff', 21 | borderWidth: StyleSheet.hairlineWidth, 22 | }, 23 | text: { 24 | fontSize: 16, 25 | color: '#037aff', 26 | }, 27 | }) 28 | 29 | export default Button 30 | -------------------------------------------------------------------------------- /app/components/CallOnceInInterval.js: -------------------------------------------------------------------------------- 1 | let isCalled = false 2 | let timer 3 | 4 | let CallOnceInInterval 5 | /** 6 | * @param functionTobeCalled 被包装的方法 7 | * @param interval 时间间隔,可省略,默认600毫秒 8 | */ 9 | export default (CallOnceInInterval = (functionTobeCalled, interval = 3000) => { 10 | if (!isCalled) { 11 | isCalled = true 12 | clearTimeout(timer) 13 | timer = setTimeout(() => { 14 | isCalled = false 15 | }, interval) 16 | return functionTobeCalled() 17 | } 18 | }) 19 | -------------------------------------------------------------------------------- /app/components/ImageGallery.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-underscore-dangle,prefer-const,class-methods-use-this,react/sort-comp */ 2 | import React, { PureComponent, Fragment } from 'react' 3 | import { 4 | View, 5 | Text, 6 | TouchableOpacity, 7 | StatusBar, 8 | Dimensions, 9 | StyleSheet, 10 | Modal, 11 | Image, 12 | Platform, 13 | ActivityIndicator, 14 | } from 'react-native' 15 | import Gallery from 'react-native-image-gallery' 16 | 17 | export default class ImageGallery extends PureComponent { 18 | constructor(props) { 19 | super(props) 20 | this.state = { 21 | index: 0, 22 | images: [], 23 | show: false, 24 | current: this.props.current || 0, 25 | } 26 | this.onChangeImage = this.onChangeImage.bind(this) 27 | this.formatImageList = this.formatImageList.bind(this) 28 | } 29 | 30 | componentWillMount() { 31 | this.formatImageList(this.props.imgList) 32 | } 33 | 34 | formatImageList(images) { 35 | let list = [] 36 | images.forEach(item => { 37 | let uri = '' 38 | if (item.mimeType === 'image/png' || item.mimeType === 'image/jpeg') { 39 | uri = item.content 40 | let newItem = {} 41 | newItem.source = {} 42 | newItem.source.uri = uri 43 | list.push(newItem) 44 | } else if (item.mimeType === 'multipart/form-data') { 45 | if ( 46 | item.filename.indexOf('jpg') > -1 || 47 | item.filename.indexOf('jpeg') > -1 || 48 | item.filename.indexOf('png') > -1 49 | ) { 50 | uri = item.thumbnail 51 | let newItem = {} 52 | newItem.source = {} 53 | newItem.source.uri = uri 54 | list.push(newItem) 55 | } 56 | } 57 | }) 58 | this.setState({ images: list }) 59 | } 60 | 61 | renderImage(imageProps, dimensions) { 62 | const { width, height } = dimensions || {} 63 | // Display the loader until the dimensions are available, which means the image 64 | // has been loaded 65 | return width && height ? : 66 | } 67 | 68 | onChangeImage(index) { 69 | this.setState({ index }) 70 | } 71 | 72 | renderError() { 73 | return ( 74 | 82 | 83 | This image cannot be displayed... 84 | 85 | 86 | ) 87 | } 88 | 89 | galleryCount() { 90 | const { index, images } = this.state 91 | return ( 92 | 93 | 94 | 95 | {index + 1}/{images.length} 96 | 97 | 98 | 99 | ) 100 | } 101 | 102 | closeGallery() { 103 | this.setState({ 104 | show: false, 105 | index: 0, 106 | current: 0, 107 | }) 108 | 109 | if (Platform.OS === 'android') { 110 | StatusBar.setBackgroundColor('#000') 111 | } else { 112 | StatusBar.setHidden(false) 113 | } 114 | } 115 | 116 | openGallery(index, imageList) { 117 | let params = { 118 | show: true, 119 | index, 120 | current: index, 121 | } 122 | 123 | let open = () => { 124 | this.setState(params) 125 | if (Platform.OS === 'android') { 126 | StatusBar.setBackgroundColor('#000') 127 | } else { 128 | StatusBar.setHidden(true) 129 | } 130 | } 131 | 132 | if (imageList) { 133 | this._imageWithToken(imageList, () => { 134 | open() 135 | }) 136 | } else { 137 | open() 138 | } 139 | } 140 | 141 | render() { 142 | return ( 143 | 144 | this.closeGallery()} 149 | > 150 | this.closeGallery()}> 151 | 155 | 156 | 157 | {this.state.show && ( 158 | 168 | 169 | 170 | } 171 | flatListProps={{ 172 | initialNumToRender: 10, 173 | // keyExtractor: (item, index) => index.toString(), 174 | initialScrollIndex: this.state.current, 175 | getItemLayout: (data, index) => ({ 176 | length: Dimensions.get('screen').width, 177 | offset: Dimensions.get('screen').width * index, 178 | index, 179 | }), 180 | }} 181 | /> 182 | )} 183 | 184 | {this.galleryCount()} 185 | 186 | 187 | ) 188 | } 189 | } 190 | 191 | const s = StyleSheet.create({ 192 | wrap: { 193 | position: 'absolute', 194 | top: 0, 195 | left: 0, 196 | right: 0, 197 | bottom: 0, 198 | zIndex: 99, 199 | flex: 1, 200 | backgroundColor: 'transparent', 201 | }, 202 | load: { 203 | flex: 1, 204 | justifyContent: 'center', 205 | alignItems: 'center', 206 | }, 207 | close: { 208 | position: 'absolute', 209 | right: 15, 210 | top: 27, 211 | zIndex: 100, 212 | width: 30, 213 | height: 30, 214 | alignItems: 'center', 215 | justifyContent: 'center', 216 | backgroundColor: 'white', 217 | borderRadius: 15, 218 | }, 219 | countWrap: { 220 | bottom: 40, 221 | width: '100%', 222 | position: 'absolute', 223 | justifyContent: 'center', 224 | flexDirection: 'row', 225 | }, 226 | count: { 227 | display: 'flex', 228 | paddingHorizontal: 11, 229 | paddingVertical: 5, 230 | borderRadius: 15, 231 | flexShrink: 1, 232 | backgroundColor: 'rgba(34, 34, 34, 0.5)', 233 | overflow: 'hidden', 234 | }, 235 | }) 236 | -------------------------------------------------------------------------------- /app/components/NetworkLoading.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable prefer-destructuring,no-undef-init,import/newline-after-import */ 2 | import React from 'react' 3 | import { View, StyleSheet, ActivityIndicator, Dimensions } from 'react-native' 4 | import RootSiblings from 'react-native-root-siblings' 5 | const width = Dimensions.get('window').width 6 | const height = Dimensions.get('window').height 7 | 8 | let sibling = undefined 9 | 10 | const Loading = { 11 | show: () => { 12 | sibling = new RootSiblings( 13 | ( 14 | 15 | 16 | 17 | 18 | 19 | ) 20 | ) 21 | }, 22 | 23 | hidden: () => { 24 | if (sibling instanceof RootSiblings) { 25 | sibling.destroy() 26 | } 27 | }, 28 | } 29 | 30 | const styles = StyleSheet.create({ 31 | maskStyle: { 32 | position: 'absolute', 33 | backgroundColor: 'rgba(0, 0, 0, 0.3)', 34 | width, 35 | height, 36 | alignItems: 'center', 37 | justifyContent: 'center', 38 | }, 39 | backViewStyle: { 40 | backgroundColor: '#111', 41 | width: 120, 42 | height: 100, 43 | justifyContent: 'center', 44 | alignItems: 'center', 45 | borderRadius: 5, 46 | }, 47 | }) 48 | 49 | export { Loading } 50 | -------------------------------------------------------------------------------- /app/components/Touchable.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | 3 | import { TouchableOpacity } from 'react-native' 4 | 5 | const Touchable = props => 6 | 7 | export default Touchable 8 | -------------------------------------------------------------------------------- /app/components/index.js: -------------------------------------------------------------------------------- 1 | export { default as Button } from './Button' 2 | export { default as Touchable } from './Touchable' 3 | -------------------------------------------------------------------------------- /app/containers/Account.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react' 2 | import { StyleSheet, View, Image } from 'react-native' 3 | import { connect } from 'react-redux' 4 | 5 | import { Button } from '../components' 6 | 7 | import { createAction, NavigationActions } from '../utils' 8 | 9 | @connect(({ app }) => ({ ...app })) 10 | class Account extends Component { 11 | static navigationOptions = { 12 | tabBarLabel: 'Account', 13 | tabBarIcon: ({ focused, tintColor }) => ( 14 | 18 | ), 19 | } 20 | 21 | gotoLogin = () => { 22 | this.props.dispatch(NavigationActions.navigate({ routeName: 'Login' })) 23 | } 24 | 25 | logout = () => { 26 | this.props.dispatch(createAction('app/logout')()) 27 | } 28 | 29 | render() { 30 | const { login } = this.props 31 | return ( 32 | 33 | {login ? ( 34 |