├── .babelrc ├── .buckconfig ├── .codeclimate.yml ├── .eslintrc ├── .flowconfig ├── .gitattributes ├── .gitignore ├── .travis.yml ├── .travis └── secrets.tar.enc ├── .watchmanconfig ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── Reading_Logo.png ├── android ├── app │ ├── BUCK │ ├── build.gradle │ ├── proguard-rules.pro │ ├── react.gradle │ └── src │ │ └── main │ │ ├── AndroidManifest.xml │ │ ├── assets │ │ └── fonts │ │ │ └── Ionicons.ttf │ │ ├── java │ │ └── com │ │ │ └── reading │ │ │ ├── MainActivity.java │ │ │ ├── MainApplication.java │ │ │ ├── ReactNativeJSCrashReceiver.java │ │ │ ├── ReadingNativeModuleCallExceptionHandler.java │ │ │ └── wxapi │ │ │ └── WXEntryActivity.java │ │ └── res │ │ ├── layout │ │ └── launch_screen.xml │ │ ├── mipmap-hdpi │ │ └── ic_launcher.png │ │ ├── mipmap-mdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.png │ │ └── launch_screen.png │ │ ├── mipmap-xxhdpi │ │ └── ic_launcher.png │ │ └── values │ │ ├── colors.xml │ │ ├── strings.xml │ │ └── styles.xml ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── keystores │ ├── BUCK │ └── debug.keystore.properties ├── reading.iml └── settings.gradle ├── app.json ├── app ├── actions │ ├── category.js │ └── read.js ├── components │ ├── Button.js │ ├── GridView.js │ ├── ImageButton.js │ ├── Loading.js │ └── LoadingView.js ├── constants │ ├── ActionTypes.js │ └── Urls.js ├── containers │ ├── CategoryContainer.js │ └── MainContainer.js ├── img │ ├── about_logo.png │ ├── arrow_left.png │ ├── share_icon_moments.png │ ├── share_icon_wechat.png │ └── splash.png ├── pages │ ├── About │ │ └── About.js │ ├── Category │ │ └── Category.js │ ├── Feedback │ │ └── Feedback.js │ ├── ItemDetail │ │ └── WebViewPage.js │ ├── MainPage │ │ ├── EmptyView.js │ │ ├── Footer.js │ │ ├── ItemCell.js │ │ ├── ItemListView.js │ │ └── Main.js │ └── Splash.js ├── reducers │ ├── category.js │ ├── index.js │ └── read.js ├── root.js ├── sagas │ ├── _spec_ │ │ ├── category.spec.js │ │ └── read.spec.js │ ├── category.js │ ├── index.js │ └── read.js ├── store │ └── configure-store.js └── utils │ ├── FontUtil.js │ ├── FormatUtil.js │ ├── ItemsUtil.js │ ├── NavigationUtil.js │ ├── RequestUtil.js │ ├── ToastUtil.js │ └── UrlUtil.js ├── index.js ├── ios ├── Bugly.framework │ ├── Bugly │ ├── Headers │ │ ├── Bugly.h │ │ ├── BuglyConfig.h │ │ └── BuglyLog.h │ └── Modules │ │ └── module.modulemap ├── reading-tvOS │ └── Info.plist ├── reading.xcodeproj │ ├── project.pbxproj │ └── xcshareddata │ │ └── xcschemes │ │ ├── reading-tvOS.xcscheme │ │ └── reading.xcscheme └── reading │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Fonts │ └── Ionicons.ttf │ ├── Images.xcassets │ ├── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── Icon-40.png │ │ ├── Icon-40@2x.png │ │ ├── Icon-40@3x.png │ │ ├── Icon-60@2x.png │ │ ├── Icon-60@3x.png │ │ ├── Icon-76.png │ │ ├── Icon-76@2x.png │ │ ├── Icon-83.5@2x.png │ │ ├── Icon-Small.png │ │ ├── Icon-Small@2x.png │ │ └── Icon-Small@3x.png │ ├── Contents.json │ └── LaunchImage.launchimage │ │ ├── Contents.json │ │ ├── Default-568h@2x.png │ │ ├── Default-Portrait~ipad.png │ │ ├── Default-Portrait~ipad@2x.png │ │ ├── Default@2x.png │ │ ├── launch_screen@2x.png │ │ └── launch_screen@3x.png │ ├── Info.plist │ └── main.m ├── package.json ├── screenshot ├── iReading_Article.png ├── iReading_Category.png ├── iReading_Main.png ├── iReading_iOS_Main.png └── iReading_iOS_Share.png ├── scripts └── fix-build-version.js ├── tsconfig.json └── yarn.lock /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["react-native"] 3 | } 4 | -------------------------------------------------------------------------------- /.buckconfig: -------------------------------------------------------------------------------- 1 | 2 | [android] 3 | target = Google Inc.:Google APIs:23 4 | 5 | [maven_repositories] 6 | central = https://repo1.maven.org/maven2 7 | -------------------------------------------------------------------------------- /.codeclimate.yml: -------------------------------------------------------------------------------- 1 | engines: 2 | eslint: 3 | enabled: true 4 | config: 5 | config: ./.eslintrc 6 | ratings: 7 | paths: 8 | - app/** 9 | - "**.js" -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "airbnb", 3 | "env": { 4 | "browser": true, 5 | "node": true, 6 | "jest": true 7 | }, 8 | "parser": "babel-eslint", 9 | "rules": { 10 | "comma-dangle": 0, 11 | "react/prop-types": 0, 12 | "no-use-before-define": 0, 13 | "radix": 0, 14 | "global-require": 0, 15 | "no-param-reassign": 0, 16 | "no-console": 0, 17 | "react/jsx-filename-extension": 0, 18 | "no-plusplus": 0, 19 | "react/require-default-props": 0, 20 | "react/forbid-prop-types": 0, 21 | "prefer-destructuring": 0, 22 | "react/jsx-no-bind": 0 23 | } 24 | } -------------------------------------------------------------------------------- /.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 | unsafe.enable_getters_and_setters=true 54 | 55 | [version] 56 | ^0.61.0 57 | -------------------------------------------------------------------------------- /.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 | android/app/reading.keystore 33 | 34 | # node.js 35 | # 36 | node_modules/ 37 | npm-debug.log 38 | yarn-error.log 39 | 40 | # BUCK 41 | buck-out/ 42 | \.buckd/ 43 | *.keystore 44 | 45 | # Others 46 | .vscode/ 47 | typings/ 48 | 49 | # fastlane 50 | # 51 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 52 | # screenshots whenever they are needed. 53 | # For more information about the recommended setup visit: 54 | # https://docs.fastlane.tools/best-practices/source-control/ 55 | 56 | */fastlane/report.xml 57 | */fastlane/Preview.html 58 | */fastlane/screenshots 59 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | matrix: 2 | include: 3 | - os: osx 4 | language: objective-c 5 | sudo: false 6 | osx_image: xcode9 7 | env: TEST_TYPE=ios 8 | - os: linux 9 | language: android 10 | sudo: required 11 | jdk: oraclejdk8 12 | env: TEST_TYPE=android 13 | android: 14 | components: 15 | - tools 16 | - tools 17 | # The BuildTools version used by your project 18 | - build-tools-26.0.1 19 | - build-tools-25.0.3 20 | - build-tools-25.0.2 21 | - build-tools-23.0.1 22 | # The SDK version used to compile your project 23 | - android-26 24 | - android-25 25 | - android-23 26 | - extra-android-m2repository 27 | - extra-android-support 28 | - os: osx 29 | language: node_js 30 | sudo: false 31 | node_js: 6 32 | env: TEST_TYPE=js 33 | env: 34 | global: 35 | - PROJECT_MOBILE=reading 36 | addons: 37 | code_climate: 38 | repo_token: $CODE_CLIMATE_TOKEN 39 | before_cache: 40 | - rm -f android/.gradle/caches/modules-2/modules-2.lock 41 | - rm -fr android/.gradle/caches/*/plugin-resolution/ 42 | cache: 43 | yarn: true 44 | directories: 45 | - node_modules 46 | - android/.gradle/caches 47 | - android/.gradle/wrapper 48 | before_install: 49 | - if [[ $TRAVIS_PULL_REQUEST == 'false' ]]; then openssl aes-256-cbc -K $encrypted_549897007358_key -iv $encrypted_549897007358_iv 50 | -in .travis/secrets.tar.enc -out secrets.tar -d ; fi 51 | - if [[ $TRAVIS_PULL_REQUEST == 'false' ]]; then tar xvf secrets.tar ; fi 52 | - if [[ $TEST_TYPE == 'android' ]] && [[ $TRAVIS_PULL_REQUEST == 'false' ]]; then mv gradle.properties android ; fi 53 | - if [[ $TEST_TYPE == 'android' ]] && [[ $TRAVIS_PULL_REQUEST == 'false' ]]; then mv reading.keystore android/app ; fi 54 | - if [[ $TEST_TYPE != 'js' ]]; then curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.6/install.sh | bash ; fi 55 | - if [[ $TEST_TYPE != 'js' ]]; then source ~/.bashrc ; fi 56 | - if [[ $TEST_TYPE != 'js' ]]; then nvm install 6 ; fi 57 | - if [[ $TEST_TYPE != 'js' ]]; then curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.3.2 ; fi 58 | - if [[ $TEST_TYPE != 'js' ]]; then export PATH=$HOME/.yarn/bin:$PATH ; fi 59 | install: 60 | - if [[ $TEST_TYPE == 'android' ]] && [[ $TRAVIS_PULL_REQUEST == 'false' ]]; then gem install fir-cli ; fi 61 | - rm -Rf "${TMPDIR}/jest_preprocess_cache" 62 | - yarn config set spin=false 63 | - yarn config set progress=false 64 | - travis_wait yarn install 65 | branches: 66 | only: 67 | - master 68 | script: 69 | - if [[ $TEST_TYPE == 'js' ]]; then yarn lint ; fi 70 | - if [[ $TEST_TYPE == 'js' ]]; then yarn test ; fi 71 | - if [[ $TEST_TYPE == 'ios' ]]; then xcodebuild -project ios/$PROJECT_MOBILE.xcodeproj 72 | -scheme $PROJECT_MOBILE -sdk iphonesimulator11.0 -configuration Debug CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO clean build ; fi 73 | - if [ $TEST_TYPE == 'android' ] && [ $TRAVIS_PULL_REQUEST == 'false' ]; then cd android && ./gradlew clean && ./gradlew resguardRelease --stacktrace ; fi 74 | - if [ $TEST_TYPE == 'android' ] && [ $TRAVIS_PULL_REQUEST != 'false' ]; then cd android && ./gradlew clean && ./gradlew assembleDebug --stacktrace ; fi 75 | after_success: 76 | - if [ $TEST_TYPE == 'android' ] && [ $TRAVIS_PULL_REQUEST == 'false' ]; then fir p 77 | $HOME/build/attentiveness/reading/android/app/build/outputs/apk/AndResGuard_app-armeabi-v7a-release/app-armeabi-v7a-release_aligned_signed.apk 78 | -T $FIR_TOKEN -c "$TRAVIS_TAG" ; fi 79 | -------------------------------------------------------------------------------- /.travis/secrets.tar.enc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/listenzz/reading/50f9d9e53cb11a8a3a0e872a487e1658b54f9d62/.travis/secrets.tar.enc -------------------------------------------------------------------------------- /.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to Reading 2 | 3 | Reading is an open source project write in React Native. 4 | 5 | >No Profit, No Advertisement, Only Feelings 6 | 7 | ## Development Process 8 | 9 | ### Pull Requests 10 | 11 | Please submit your pull request on the *master* branch. 12 | 13 | *Before* submitting a pull request, please make sure the following is done… 14 | 15 | 1. Fork the repo and create your branch from `master`. 16 | 2. Add the copyright notice to the top of any new files you've added. 17 | 3. **Format your code** (`npm run format`) 18 | 4. **Make sure your code lints** (`npm run lint`). 19 | 5. Squash your commits (`git rebase -i`). 20 | 21 | #### Copyright Notice for files 22 | 23 | Copy and paste this to the top of your new file(s): 24 | 25 | ```JS 26 | /** 27 | * 28 | * Copyright 2016-present reading 29 | * 30 | * Licensed under the Apache License, Version 2.0 (the "License"); 31 | * you may not use this file except in compliance with the License. 32 | * You may obtain a copy of the License at 33 | * 34 | * http://www.apache.org/licenses/LICENSE-2.0 35 | * 36 | * Unless required by applicable law or agreed to in writing, software 37 | * distributed under the License is distributed on an "AS IS" BASIS, 38 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 39 | * See the License for the specific language governing permissions and 40 | * limitations under the License. 41 | * 42 | */ 43 | ``` 44 | 45 | ## License 46 | 47 | By contributing to Reading, you agree that your contributions will be licensed under its Apache License, Version 2.0. 48 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright {yyyy} {name of copyright owner} 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | 203 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # iReading 2 | 3 | ![iReading_Logo](./Reading_Logo.png) 4 | 5 | [![Build Status](https://travis-ci.org/attentiveness/reading.svg?branch=master)](https://travis-ci.org/attentiveness/reading) 6 | [![Code Climate](https://codeclimate.com/github/attentiveness/reading/badges/gpa.svg)](https://codeclimate.com/github/attentiveness/reading) 7 | [![Join the chat at https://gitter.im/attentiveness/reading](https://badges.gitter.im/attentiveness/reading.svg)](https://gitter.im/attentiveness/reading) 8 | [![License Apache2.0](https://img.shields.io/hexpm/l/plug.svg)](https://raw.githubusercontent.com/attentiveness/reading/master/LICENSE) 9 | [![GitHub release](https://img.shields.io/github/release/attentiveness/reading.svg?maxAge=2592000?style=flat-square)](https://github.com/attentiveness/reading/releases) 10 | [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/attentiveness/reading/pulls) 11 | 12 | iReading App Write In React-Native(Studying and Programing) 13 | 14 | **Support: Android 4.1 (API 16)+ IOS(8.0+)** 15 | 16 | > No Profit, No Advertisement, Only Feelings 17 | 18 | ## Screenshot 19 | 20 | ![iReading_Main](./screenshot/iReading_Main.png) 21 | ![iReading_Article](./screenshot/iReading_Article.png) 22 | ![iReading_Category](./screenshot/iReading_Category.png) 23 | ![iReading_IOS_Main](./screenshot/iReading_iOS_Main.png) 24 | ![iReading_IOS_Share](./screenshot/iReading_iOS_Share.png) 25 | 26 | ## Download 27 | 28 | ### β Version(master branch) 29 | 30 | *Android:* [Download iReading](http://fir.im/w7gu) 31 | 32 | ### From Android Market(Old) 33 | 34 | *360 Android Market:* [Download iReading](http://zhushou.360.cn/detail/index/soft_id/3217938?recrefer=SE_D_Reading) 35 | 36 | *Wandou Labs:* [Download iReading](http://www.wandoujia.com/apps/com.reading) 37 | 38 | ### From App Store(Old) 39 | 40 | [Download iReading](https://itunes.apple.com/cn/app/ireading/id1135411121?l=zh&ls=1&mt=8) 41 | 42 | ## Application Architecture 43 | 44 | - [Microsoft Code Push](https://github.com/Microsoft/react-native-code-push) for dynamic update. 45 | - [Redux](https://github.com/reactjs/redux) is a predictable state container for reading application, together with [React Native](https://github.com/facebook/react-native). 46 | - [Redux-Saga](https://github.com/yelouafi/redux-saga/) is a library that aims to make side effects in reading application easier and better. 47 | - [react-navigation](https://github.com/react-community/react-navigation) is an extensible yet easy-to-use navigation solution, can also be used across React and React Native projects allowing for a higher degree of shared code. 48 | - [Jest](https://facebook.github.io/jest/) for testing [React Native](https://github.com/facebook/react-native) components and UT. 49 | - [Eslint](https://github.com/eslint/eslint) is a tool for identifying and reporting on patterns found in reading application code. 50 | - [react-native-exceptions-manager](https://github.com/Richard-Cao/react-native-exceptions-manager) for handling crashes in release version. 51 | 52 | ## Development Workflow 53 | 54 | ### Step One 55 | 56 | ``` 57 | yarn(or npm) install -g react-native-cli 58 | ``` 59 | ### Step Two 60 | 61 | ``` 62 | yarn(or npm) install 63 | ``` 64 | ### Step Three 65 | 66 | ``` 67 | react-native start 68 | ``` 69 | ### Run Test 70 | 71 | ``` 72 | yarn(or npm) test 73 | ``` 74 | 75 | ### Format Code 76 | 77 | ``` 78 | yarn(or npm run) format 79 | ``` 80 | 81 | ### Run Lint 82 | 83 | ``` 84 | yarn(or npm run) lint 85 | ``` 86 | 87 | ## Release Note 88 | 89 | [Reading Release Note](https://github.com/attentiveness/reading/releases) 90 | 91 | ## Contributing 92 | 93 | **For more information about contributing PRs and issues, see our [Contribution Guidelines](https://github.com/attentiveness/reading/blob/master/CONTRIBUTING.md).** 94 | 95 | ## License 96 | 97 | Apache License 2.0 98 | -------------------------------------------------------------------------------- /Reading_Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/listenzz/reading/50f9d9e53cb11a8a3a0e872a487e1658b54f9d62/Reading_Logo.png -------------------------------------------------------------------------------- /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.reading", 49 | ) 50 | 51 | android_resource( 52 | name = "res", 53 | package = "com.reading", 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 | apply plugin: 'AndResGuard' 3 | 4 | import com.android.build.OutputFile 5 | 6 | /** 7 | * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets 8 | * and bundleReleaseJsAndAssets). 9 | * These basically call `react-native bundle` with the correct arguments during the Android build 10 | * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the 11 | * bundle directly from the development server. Below you can see all the possible configurations 12 | * and their defaults. If you decide to add a configuration block, make sure to add it before the 13 | * `apply from: "../../node_modules/react-native/react.gradle"` line. 14 | * 15 | * project.ext.react = [ 16 | * // the name of the generated asset file containing your JS bundle 17 | * bundleAssetName: "index.android.bundle", 18 | * 19 | * // the entry file for bundle generation 20 | * entryFile: "index.android.js", 21 | * 22 | * // whether to bundle JS and assets in debug mode 23 | * bundleInDebug: false, 24 | * 25 | * // whether to bundle JS and assets in release mode 26 | * bundleInRelease: true, 27 | * 28 | * // whether to bundle JS and assets in another build variant (if configured). 29 | * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants 30 | * // The configuration property can be in the following formats 31 | * // 'bundleIn${productFlavor}${buildType}' 32 | * // 'bundleIn${buildType}' 33 | * // bundleInFreeDebug: true, 34 | * // bundleInPaidRelease: true, 35 | * // bundleInBeta: true, 36 | * 37 | * // whether to disable dev mode in custom build variants (by default only disabled in release) 38 | * // for example: to disable dev mode in the staging build type (if configured) 39 | * devDisabledInStaging: true, 40 | * // The configuration property can be in the following formats 41 | * // 'devDisabledIn${productFlavor}${buildType}' 42 | * // 'devDisabledIn${buildType}' 43 | * 44 | * // the root of your project, i.e. where "package.json" lives 45 | * root: "../../", 46 | * 47 | * // where to put the JS bundle asset in debug mode 48 | * jsBundleDirDebug: "$buildDir/intermediates/assets/debug", 49 | * 50 | * // where to put the JS bundle asset in release mode 51 | * jsBundleDirRelease: "$buildDir/intermediates/assets/release", 52 | * 53 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 54 | * // require('./image.png')), in debug mode 55 | * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug", 56 | * 57 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 58 | * // require('./image.png')), in release mode 59 | * resourcesDirRelease: "$buildDir/intermediates/res/merged/release", 60 | * 61 | * // by default the gradle tasks are skipped if none of the JS files or assets change; this means 62 | * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to 63 | * // date; if you have any other folders that you want to ignore for performance reasons (gradle 64 | * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/ 65 | * // for example, you might want to remove it from here. 66 | * inputExcludes: ["android/**", "ios/**"], 67 | * 68 | * // override which node gets called and with what additional arguments 69 | * nodeExecutableAndArgs: ["node"], 70 | * 71 | * // supply additional arguments to the packager 72 | * extraPackagerArgs: [] 73 | * ] 74 | */ 75 | 76 | project.ext.react = [ 77 | root: "../../", 78 | entryFile: "index.js", 79 | bundleInRelease : true, 80 | ] 81 | apply from: "../../node_modules/react-native/react.gradle" 82 | apply from: "../../node_modules/react-native-code-push/android/codepush.gradle" 83 | project.ext.vectoricons = [ 84 | iconFontNames: ['Ionicons.ttf'] // Name of the font files you want to copy 85 | ] 86 | apply from: "../../node_modules/react-native-vector-icons/fonts.gradle" 87 | 88 | /** 89 | * Set this to true to create two separate APKs instead of one: 90 | * - An APK that only works on ARM devices 91 | * - An APK that only works on x86 devices 92 | * The advantage is the size of the APK is reduced by about 4MB. 93 | * Upload all the APKs to the Play Store and people will download 94 | * the correct one based on the CPU architecture of their device. 95 | */ 96 | def enableSeparateBuildPerCPUArchitecture = true 97 | 98 | /** 99 | * Run Proguard to shrink the Java bytecode in release builds. 100 | */ 101 | def enableProguardInReleaseBuilds = true 102 | 103 | // Android studio bug hack 104 | if (System.properties['os.name'].contains("Mac")) { 105 | project.ext.react.nodeExecutableAndArgs = ["/usr/local/bin/node"] 106 | } 107 | 108 | android { 109 | compileSdkVersion rootProject.ext.compileSdkVersion 110 | buildToolsVersion rootProject.ext.buildToolsVersion 111 | useLibrary 'org.apache.http.legacy' 112 | 113 | defaultConfig { 114 | applicationId "com.reading" 115 | minSdkVersion rootProject.ext.minSdkVersion 116 | targetSdkVersion rootProject.ext.targetSdkVersion 117 | versionCode 7 118 | versionName "2.1.0" 119 | ndk { 120 | abiFilters "armeabi-v7a", "x86" 121 | } 122 | } 123 | signingConfigs { 124 | release { 125 | storeFile file(READING_RELEASE_STORE_FILE) 126 | storePassword READING_RELEASE_STORE_PASSWORD 127 | keyAlias READING_RELEASE_KEY_ALIAS 128 | keyPassword READING_RELEASE_KEY_PASSWORD 129 | } 130 | } 131 | splits { 132 | abi { 133 | enable enableSeparateBuildPerCPUArchitecture 134 | universalApk false // Also generate an universal APK 135 | reset() 136 | include "armeabi-v7a", "x86" 137 | } 138 | } 139 | buildTypes { 140 | debug { 141 | buildConfigField "String", "CODEPUSH_KEY", '"U7ZF2kYt5EzV14JyIB22SLRhQ2KBV1Ifekvul"' 142 | } 143 | release { 144 | minifyEnabled enableProguardInReleaseBuilds 145 | zipAlignEnabled true 146 | pseudoLocalesEnabled true 147 | buildConfigField "String", "CODEPUSH_KEY", '"RGOUfyINiLicZnld67aD0nrbRvyLV1Ifekvul"' 148 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" 149 | signingConfig signingConfigs.release 150 | } 151 | } 152 | // applicationVariants are e.g. debug, release 153 | applicationVariants.all { variant -> 154 | variant.outputs.each { output -> 155 | // For each separate APK per architecture, set a unique version code as described here: 156 | // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits 157 | def versionCodes = ["armeabi-v7a": 1, "x86": 2] 158 | def abi = output.getFilter(OutputFile.ABI) 159 | if (abi != null) { // null for the universal-debug, universal-release variants 160 | output.versionCodeOverride = 161 | versionCodes.get(abi) * 1048576 + defaultConfig.versionCode 162 | } 163 | } 164 | } 165 | } 166 | 167 | andResGuard { // ./gradlew resguard[BuildType | Flavor] 168 | // mappingFile = file("./resource_mapping.txt") 169 | mappingFile = null 170 | // It will be invalid when you sign apk with schemeV2 171 | use7zip = true 172 | useSign = true 173 | // it will keep the origin path of your resources when it's true 174 | keepRoot = false 175 | // add .R.drawable.icon into whitelist. 176 | whiteList = [ 177 | "com.reading.R.drawable.ic_launcher", 178 | "com.reading.R.drawable.app_img*", 179 | "com.reading.R.drawable.node_modules*", 180 | // for react-native-code-push 181 | "R.string.CODE_PUSH_APK_BUILD_TIME" 182 | ] 183 | compressFilePattern = [ 184 | "*.png", 185 | "*.jpg", 186 | "*.jpeg", 187 | "*.gif", 188 | "resources.arsc" 189 | ] 190 | sevenzip { 191 | artifact = 'com.tencent.mm:SevenZip:1.2.6' 192 | //在设置sevenzip时, 你只需设置artifact或path. 支持同时设置,总以path的值为优先 193 | //path = "/usr/local/bin/7za" 194 | } 195 | } 196 | 197 | dependencies { 198 | compile project(':react-native-modal-translucent') 199 | compile project(':react-native-navigation-hybrid') 200 | compile project(':react-native-splash-screen') 201 | compile fileTree(dir: "libs", include: ["*.jar"]) 202 | //noinspection GradleCompatible 203 | compile "com.android.support:appcompat-v7:$rootProject.supportLibraryVersion" 204 | compile "com.facebook.react:react-native:+" //From node_modules 205 | compile 'com.tencent.bugly:crashreport:latest.release' 206 | compile project(':RCTWeChat') 207 | compile project(':react-native-code-push') 208 | compile project(':RNDeviceInfo') 209 | compile project(':react-native-vector-icons') 210 | compile project(':react-native-exceptions-manager') 211 | 212 | 213 | configurations.all { 214 | resolutionStrategy.eachDependency { DependencyResolveDetails details -> 215 | def requested = details.requested 216 | if (requested.group == 'com.android.support') { 217 | if (!requested.name.startsWith("multidex")) { 218 | details.useVersion rootProject.supportLibraryVersion 219 | } 220 | } 221 | } 222 | } 223 | 224 | } 225 | 226 | // Run this once to be able to run the application with BUCK 227 | // puts all compile dependencies into folder libs for BUCK to use 228 | task copyDownloadableDepsToLibs(type: Copy) { 229 | from configurations.compile 230 | into 'libs' 231 | } 232 | -------------------------------------------------------------------------------- /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 | -keep class android.text {* ;} 58 | -dontwarn android.text.* 59 | 60 | -keep class com.facebook.react.bridge.CatalystInstanceImpl { *; } 61 | -keep class com.facebook.react.bridge.JavaScriptExecutor { *; } 62 | -keep class com.facebook.react.bridge.queue.NativeRunnable { *; } 63 | -keep class com.facebook.react.bridge.ReadableType { *; } 64 | 65 | # okhttp 66 | 67 | -keepattributes Signature 68 | -keepattributes *Annotation* 69 | -keep class okhttp3.** { *; } 70 | -keep interface okhttp3.** { *; } 71 | -dontwarn okhttp3.** 72 | 73 | # okio 74 | 75 | -keep class sun.misc.Unsafe { *; } 76 | -dontwarn java.nio.file.* 77 | -dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement 78 | -dontwarn okio.** 79 | 80 | -keep class com.facebook.imagepipeline.animated.factory.AnimatedFactoryImpl { 81 | public AnimatedFactoryImpl(com.facebook.imagepipeline.bitmaps.PlatformBitmapFactory, com.facebook.imagepipeline.core.ExecutorSupplier); 82 | } 83 | 84 | -keep class com.tencent.mm.sdk.** { 85 | *; 86 | } 87 | 88 | -dontwarn com.tencent.bugly.** 89 | -keep public class com.tencent.bugly.**{*;} 90 | 91 | -ignorewarnings -------------------------------------------------------------------------------- /android/app/react.gradle: -------------------------------------------------------------------------------- 1 | import org.apache.tools.ant.taskdefs.condition.Os 2 | 3 | def config = project.hasProperty("react") ? project.react : []; 4 | 5 | def bundleAssetName = config.bundleAssetName ?: "index.android.bundle" 6 | def entryFile = config.entryFile ?: "index.android.js" 7 | 8 | // because elvis operator 9 | def elvisFile(thing) { 10 | return thing ? file(thing) : null; 11 | } 12 | 13 | def reactRoot = elvisFile(config.root) ?: file("../../") 14 | def inputExcludes = config.inputExcludes ?: ["android/**", "ios/**"] 15 | 16 | void runBefore(String dependentTaskName, Task task) { 17 | Task dependentTask = tasks.findByPath(dependentTaskName); 18 | if (dependentTask != null) { 19 | dependentTask.dependsOn task 20 | } 21 | } 22 | 23 | gradle.projectsEvaluated { 24 | // Grab all build types and product flavors 25 | def buildTypes = android.buildTypes.collect { type -> type.name } 26 | def productFlavors = android.productFlavors.collect { flavor -> flavor.name } 27 | 28 | // When no product flavors defined, use empty 29 | if (!productFlavors) productFlavors.add('') 30 | 31 | productFlavors.each { productFlavorName -> 32 | buildTypes.each { buildTypeName -> 33 | // Create variant and target names 34 | def targetName = "${productFlavorName.capitalize()}${buildTypeName.capitalize()}" 35 | def targetPath = productFlavorName ? 36 | "${productFlavorName}/${buildTypeName}" : 37 | "${buildTypeName}" 38 | 39 | // React js bundle directories 40 | def jsBundleDirConfigName = "jsBundleDir${targetName}" 41 | def jsBundleDir = elvisFile(config."$jsBundleDirConfigName") ?: 42 | file("$buildDir/intermediates/assets/${targetPath}") 43 | 44 | def resourcesDirConfigName = "resourcesDir${targetName}" 45 | def resourcesDir = elvisFile(config."${resourcesDirConfigName}") ?: 46 | file("$buildDir/intermediates/res/merged/${targetPath}") 47 | def jsBundleFile = file("$jsBundleDir/$bundleAssetName") 48 | 49 | // Bundle task name for variant 50 | def bundleJsAndAssetsTaskName = "bundle${targetName}JsAndAssets" 51 | 52 | def currentBundleTask = tasks.create( 53 | name: bundleJsAndAssetsTaskName, 54 | type: Exec) { 55 | group = "react" 56 | description = "bundle JS and assets for ${targetName}." 57 | 58 | // Create dirs if they are not there (e.g. the "clean" task just ran) 59 | doFirst { 60 | jsBundleDir.mkdirs() 61 | resourcesDir.mkdirs() 62 | } 63 | 64 | // Set up inputs and outputs so gradle can cache the result 65 | inputs.files fileTree(dir: reactRoot, excludes: inputExcludes) 66 | outputs.dir jsBundleDir 67 | outputs.dir resourcesDir 68 | 69 | // Set up the call to the react-native cli 70 | workingDir reactRoot 71 | 72 | // Set up dev mode 73 | def devEnabled = !targetName.toLowerCase().contains("release") 74 | if (Os.isFamily(Os.FAMILY_WINDOWS)) { 75 | commandLine "cmd", "/c", "node", "node_modules/react-native/local-cli/cli.js", "bundle", "--platform", "android", "--dev", "${devEnabled}", 76 | "--entry-file", entryFile, "--bundle-output", jsBundleFile, "--assets-dest", resourcesDir 77 | } else { 78 | commandLine "node", "node_modules/react-native/local-cli/cli.js", "bundle", "--platform", "android", "--dev", "${devEnabled}", 79 | "--entry-file", entryFile, "--bundle-output", jsBundleFile, "--assets-dest", resourcesDir 80 | } 81 | 82 | enabled config."bundleIn${targetName}" || 83 | config."bundleIn${buildTypeName.capitalize()}" ?: 84 | targetName.toLowerCase().contains("release") 85 | } 86 | 87 | // Hook bundle${productFlavor}${buildType}JsAndAssets into the android build process 88 | currentBundleTask.dependsOn("merge${targetName}Resources") 89 | currentBundleTask.dependsOn("merge${targetName}Assets") 90 | 91 | runBefore("processArmeabi-v7a${targetName}Resources", currentBundleTask) 92 | runBefore("processX86${targetName}Resources", currentBundleTask) 93 | runBefore("processUniversal${targetName}Resources", currentBundleTask) 94 | runBefore("process${targetName}Resources", currentBundleTask) 95 | } 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 13 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/Ionicons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/listenzz/reading/50f9d9e53cb11a8a3a0e872a487e1658b54f9d62/android/app/src/main/assets/fonts/Ionicons.ttf -------------------------------------------------------------------------------- /android/app/src/main/java/com/reading/MainActivity.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2016-present reading 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.reading; 18 | 19 | import android.os.Bundle; 20 | 21 | import com.facebook.react.ReactActivity; 22 | import com.navigationhybrid.ReactAppCompatActivity; 23 | 24 | import org.devio.rn.splashscreen.SplashScreen; 25 | 26 | public class MainActivity extends ReactAppCompatActivity { 27 | 28 | @Override 29 | protected void onCreate(Bundle savedInstanceState) { 30 | SplashScreen.show(this, true); 31 | super.onCreate(savedInstanceState); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /android/app/src/main/java/com/reading/MainApplication.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2016-present reading 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.reading; 18 | 19 | import android.app.Application; 20 | 21 | import com.facebook.infer.annotation.Assertions; 22 | import com.facebook.react.ReactApplication; 23 | import me.listenzz.modal.TranslucentModalReactPackage; 24 | import com.navigationhybrid.NavigationHybridPackage; 25 | import com.facebook.react.ReactInstanceManager; 26 | import com.facebook.react.ReactInstanceManagerBuilder; 27 | import com.facebook.react.ReactNativeHost; 28 | import com.facebook.react.ReactPackage; 29 | import com.facebook.react.common.LifecycleState; 30 | import com.facebook.react.shell.MainReactPackage; 31 | import com.facebook.soloader.SoLoader; 32 | import com.learnium.RNDeviceInfo.RNDeviceInfo; 33 | import com.microsoft.codepush.react.CodePush; 34 | import com.navigationhybrid.ReactBridgeManager; 35 | import com.oblador.vectoricons.VectorIconsPackage; 36 | import com.richardcao.exceptionsmanager.react.ExceptionsManager; 37 | import com.tencent.bugly.crashreport.CrashReport; 38 | import com.theweflex.react.WeChatPackage; 39 | 40 | import org.devio.rn.splashscreen.SplashScreenReactPackage; 41 | 42 | import java.util.ArrayList; 43 | import java.util.Arrays; 44 | import java.util.List; 45 | 46 | import javax.annotation.Nullable; 47 | 48 | public class MainApplication extends Application implements ReactApplication { 49 | @Override 50 | public void onCreate() { 51 | super.onCreate(); 52 | SoLoader.init(this, /* native exopackage */ false); 53 | 54 | ReactBridgeManager bridgeManager = ReactBridgeManager.instance; 55 | bridgeManager.install(getReactNativeHost()); 56 | 57 | if (!BuildConfig.DEBUG) { 58 | CrashReport.initCrashReport(getApplicationContext(), "900019562", false); 59 | } 60 | } 61 | 62 | private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) { 63 | 64 | @Override 65 | protected ReactInstanceManager createReactInstanceManager() { 66 | ReactInstanceManagerBuilder builder = ReactInstanceManager.builder() 67 | .setApplication(getApplication()) 68 | .setJSMainModulePath(getJSMainModuleName()) 69 | .setUseDeveloperSupport(getUseDeveloperSupport()) 70 | .setRedBoxHandler(getRedBoxHandler()) 71 | .setUIImplementationProvider(getUIImplementationProvider()) 72 | .setInitialLifecycleState(LifecycleState.BEFORE_CREATE) 73 | .setNativeModuleCallExceptionHandler( 74 | new ReadingNativeModuleCallExceptionHandler()); 75 | 76 | for (ReactPackage reactPackage : getPackages()) { 77 | builder.addPackage(reactPackage); 78 | } 79 | 80 | String jsBundleFile = getJSBundleFile(); 81 | if (jsBundleFile != null) { 82 | builder.setJSBundleFile(jsBundleFile); 83 | } else { 84 | builder.setBundleAssetName(Assertions.assertNotNull(getBundleAssetName())); 85 | } 86 | return builder.build(); 87 | } 88 | 89 | @Override 90 | public boolean getUseDeveloperSupport() { 91 | return BuildConfig.DEBUG; 92 | } 93 | 94 | @Nullable 95 | @Override 96 | protected String getJSBundleFile() { 97 | return CodePush.getJSBundleFile(); 98 | } 99 | 100 | @Override 101 | protected String getJSMainModuleName() { 102 | return "index"; 103 | } 104 | 105 | @Override 106 | protected List getPackages() { 107 | List packages = Arrays.asList( 108 | new MainReactPackage(), 109 | new TranslucentModalReactPackage(), 110 | new NavigationHybridPackage(), 111 | new SplashScreenReactPackage(), 112 | new WeChatPackage(), 113 | new CodePush(BuildConfig.CODEPUSH_KEY, MainApplication.this, BuildConfig.DEBUG), 114 | new RNDeviceInfo(), 115 | new VectorIconsPackage()); 116 | ArrayList packageList = new ArrayList<>(packages); 117 | if (!BuildConfig.DEBUG) { 118 | packageList.add(new ExceptionsManager()); 119 | } 120 | return packageList; 121 | } 122 | }; 123 | 124 | @Override 125 | public ReactNativeHost getReactNativeHost() { 126 | return mReactNativeHost; 127 | } 128 | } 129 | -------------------------------------------------------------------------------- /android/app/src/main/java/com/reading/ReactNativeJSCrashReceiver.java: -------------------------------------------------------------------------------- 1 | package com.reading; 2 | 3 | import android.content.BroadcastReceiver; 4 | import android.content.Context; 5 | import android.content.Intent; 6 | 7 | import com.tencent.bugly.crashreport.CrashReport; 8 | 9 | /** 10 | * Created by caolicheng on 2016/9/29. 11 | */ 12 | 13 | public class ReactNativeJSCrashReceiver extends BroadcastReceiver { 14 | @Override 15 | public void onReceive(Context context, Intent intent) { 16 | if (intent.getAction().equals("com.richardcao.android.REACT_NATIVE_CRASH_REPORT_ACTION")) { 17 | Throwable js = (Throwable) intent.getSerializableExtra("JavascriptException"); 18 | Throwable e = (Throwable) intent.getSerializableExtra("Exception"); 19 | if (js != null) { 20 | CrashReport.postCatchedException(js); 21 | } 22 | if (e != null) { 23 | CrashReport.postCatchedException(e); 24 | } 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /android/app/src/main/java/com/reading/ReadingNativeModuleCallExceptionHandler.java: -------------------------------------------------------------------------------- 1 | package com.reading; 2 | 3 | import com.facebook.react.bridge.NativeModuleCallExceptionHandler; 4 | import com.tencent.bugly.crashreport.CrashReport; 5 | 6 | /** 7 | * Created by caolicheng on 2016/10/25. 8 | */ 9 | 10 | public class ReadingNativeModuleCallExceptionHandler implements NativeModuleCallExceptionHandler { 11 | @Override 12 | public void handleException(Exception e) { 13 | CrashReport.postCatchedException(e); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /android/app/src/main/java/com/reading/wxapi/WXEntryActivity.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2016-present reading 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.reading.wxapi; 18 | 19 | import android.app.Activity; 20 | import android.os.Bundle; 21 | 22 | import com.theweflex.react.WeChatModule; 23 | 24 | /** 25 | * Created by richardcao on 16/1/28. 26 | */ 27 | public class WXEntryActivity extends Activity { 28 | @Override 29 | protected void onCreate(Bundle savedInstanceState) { 30 | super.onCreate(savedInstanceState); 31 | WeChatModule.handleIntent(getIntent()); 32 | finish(); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /android/app/src/main/res/layout/launch_screen.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/listenzz/reading/50f9d9e53cb11a8a3a0e872a487e1658b54f9d62/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/listenzz/reading/50f9d9e53cb11a8a3a0e872a487e1658b54f9d62/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/listenzz/reading/50f9d9e53cb11a8a3a0e872a487e1658b54f9d62/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/launch_screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/listenzz/reading/50f9d9e53cb11a8a3a0e872a487e1658b54f9d62/android/app/src/main/res/mipmap-xhdpi/launch_screen.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/listenzz/reading/50f9d9e53cb11a8a3a0e872a487e1658b54f9d62/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3e9ce9 4 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | iReading 3 | 4 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 13 | 14 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /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 | google() 7 | } 8 | 9 | dependencies { 10 | classpath 'com.android.tools.build:gradle:3.0.1' 11 | classpath 'com.tencent.mm:AndResGuard-gradle-plugin:1.2.10' 12 | // NOTE: Do not place your application dependencies here; they belong 13 | // in the individual module build.gradle files 14 | } 15 | } 16 | 17 | allprojects { 18 | repositories { 19 | jcenter() 20 | google() 21 | maven { 22 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm 23 | url "$rootDir/../node_modules/react-native/android" 24 | } 25 | } 26 | } 27 | 28 | ext { 29 | // sdk and tools 30 | minSdkVersion = 16 31 | targetSdkVersion = 27 32 | compileSdkVersion = 27 33 | buildToolsVersion = '27.0.2' 34 | supportLibraryVersion = '27.1.1' 35 | } 36 | -------------------------------------------------------------------------------- /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 | org.gradle.jvmargs=-Xmx1536m 15 | 16 | # When configured, Gradle will run in incubating parallel mode. 17 | # This option should only be used with decoupled projects. More details, visit 18 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 19 | # org.gradle.parallel=true 20 | 21 | android.useDeprecatedNdk=true 22 | # android.enableAapt2=false 23 | 24 | READING_RELEASE_STORE_FILE=reading.keystore 25 | READING_RELEASE_KEY_ALIAS=reading 26 | READING_RELEASE_STORE_PASSWORD=jiushigan 27 | READING_RELEASE_KEY_PASSWORD=jiushigan 28 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/listenzz/reading/50f9d9e53cb11a8a3a0e872a487e1658b54f9d62/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Feb 12 17:39:04 CST 2018 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip 7 | -------------------------------------------------------------------------------- /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/reading.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'reading' 2 | include ':react-native-modal-translucent' 3 | project(':react-native-modal-translucent').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-modal-translucent/android') 4 | include ':react-native-navigation-hybrid' 5 | project(':react-native-navigation-hybrid').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-navigation-hybrid/android') 6 | include ':react-native-splash-screen' 7 | project(':react-native-splash-screen').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-splash-screen/android') 8 | 9 | include ':app', ':RCTWeChat', ':react-native-code-push', ':RNDeviceInfo', ':react-native-vector-icons', ':react-native-exceptions-manager' 10 | project(':RCTWeChat').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-wechat/android') 11 | project(':react-native-code-push').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-code-push/android/app') 12 | project(':RNDeviceInfo').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-device-info/android') 13 | project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android') 14 | project(':react-native-exceptions-manager').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-exceptions-manager/android/app') -------------------------------------------------------------------------------- /app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "reading", 3 | "displayName": "iReading" 4 | } -------------------------------------------------------------------------------- /app/actions/category.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * Copyright 2016-present reading 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | import * as types from '../constants/ActionTypes'; 19 | 20 | export function requestTypeList() { 21 | return { 22 | type: types.REQUEST_TYPE_LIST 23 | }; 24 | } 25 | 26 | export function fetchTypeList() { 27 | return { 28 | type: types.FETCH_TYPE_LIST 29 | }; 30 | } 31 | 32 | export function receiveTypeList(typeList) { 33 | return { 34 | type: types.RECEIVE_TYPE_LIST, 35 | typeList 36 | }; 37 | } 38 | -------------------------------------------------------------------------------- /app/actions/read.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * Copyright 2016-present reading 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | import * as types from '../constants/ActionTypes'; 19 | 20 | export function requestArticleList( 21 | isRefreshing, 22 | loading, 23 | typeId, 24 | isLoadMore, 25 | page = 1 26 | ) { 27 | return { 28 | type: types.REQUEST_ARTICLE_LIST, 29 | isRefreshing, 30 | loading, 31 | isLoadMore, 32 | typeId, 33 | page 34 | }; 35 | } 36 | 37 | export function fetchArticleList(isRefreshing, loading, isLoadMore = false) { 38 | return { 39 | type: types.FETCH_ARTICLE_LIST, 40 | isRefreshing, 41 | loading, 42 | isLoadMore 43 | }; 44 | } 45 | 46 | export function receiveArticleList(articleList, typeId) { 47 | return { 48 | type: types.RECEIVE_ARTICLE_LIST, 49 | articleList, 50 | typeId 51 | }; 52 | } 53 | -------------------------------------------------------------------------------- /app/components/Button.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * Copyright 2016-present reading 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | import React from 'react'; 19 | import PropTypes from 'prop-types'; 20 | import { ViewPropTypes, Text, TouchableOpacity } from 'react-native'; 21 | 22 | const propTypes = { 23 | onPress: PropTypes.func, 24 | disabled: PropTypes.bool, 25 | style: Text.propTypes.style, 26 | containerStyle: ViewPropTypes.style, 27 | text: PropTypes.string, 28 | activeOpacity: PropTypes.number 29 | }; 30 | 31 | const Button = ({ 32 | onPress, 33 | disabled, 34 | style, 35 | containerStyle, 36 | text, 37 | activeOpacity 38 | }) => ( 39 | 45 | {text} 46 | 47 | ); 48 | 49 | Button.propTypes = propTypes; 50 | 51 | Button.defaultProps = { 52 | onPress() {}, 53 | disabled: false, 54 | activeOpacity: 0.8 55 | }; 56 | 57 | export default Button; 58 | -------------------------------------------------------------------------------- /app/components/GridView.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * Copyright 2016-present reading 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | import React from 'react'; 19 | import PropTypes from 'prop-types'; 20 | import { View, StyleSheet, ListView, ViewPropTypes } from 'react-native'; 21 | 22 | const propTypes = { 23 | items: PropTypes.array, 24 | renderItem: PropTypes.func, 25 | style: ViewPropTypes.style, 26 | itemsPerRow: PropTypes.number, 27 | onEndReached: PropTypes.func, 28 | scrollEnabled: PropTypes.func, 29 | pageSize: PropTypes.number 30 | }; 31 | 32 | const GridView = ({ 33 | items, 34 | renderItem, 35 | style, 36 | itemsPerRow, 37 | onEndReached, 38 | scrollEnabled, 39 | pageSize 40 | }) => { 41 | const groupItems = (renderItems, renderItemsPerRow) => { 42 | const itemsGroups = []; 43 | let group = []; 44 | renderItems.forEach((item) => { 45 | if (group.length === renderItemsPerRow) { 46 | itemsGroups.push(group); 47 | group = [item]; 48 | } else { 49 | group.push(item); 50 | } 51 | }); 52 | if (group.length > 0) { 53 | itemsGroups.push(group); 54 | } 55 | return itemsGroups; 56 | }; 57 | 58 | const renderGroup = (group) => { 59 | const itemViews = group.map((item) => { 60 | const i = renderItem(item); 61 | return i; 62 | }); 63 | return {itemViews}; 64 | }; 65 | 66 | const groups = groupItems(items, itemsPerRow); 67 | 68 | const ds = new ListView.DataSource({ 69 | rowHasChanged: (r1, r2) => r1 !== r2 70 | }); 71 | 72 | return ( 73 | 83 | ); 84 | }; 85 | 86 | const styles = StyleSheet.create({ 87 | group: { 88 | flexDirection: 'row', 89 | alignItems: 'center' 90 | } 91 | }); 92 | 93 | GridView.propTypes = propTypes; 94 | 95 | GridView.defaultProps = { 96 | items: [], 97 | renderItem: null, 98 | style: undefined, 99 | itemsPerRow: 1, 100 | onEndReached: undefined 101 | }; 102 | 103 | export default GridView; 104 | -------------------------------------------------------------------------------- /app/components/ImageButton.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * Copyright 2016-present reading 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | import React from 'react'; 19 | import PropTypes from 'prop-types'; 20 | import { ViewPropTypes, Image, TouchableOpacity } from 'react-native'; 21 | 22 | const propTypes = { 23 | onPress: PropTypes.func, 24 | disabled: PropTypes.bool, 25 | source: PropTypes.object, 26 | style: ViewPropTypes.style, 27 | containerStyle: ViewPropTypes.style 28 | }; 29 | 30 | const ImageButton = ({ 31 | onPress, disabled, source, style, containerStyle 32 | }) => ( 33 | 38 | 39 | 40 | ); 41 | 42 | ImageButton.propTypes = propTypes; 43 | 44 | ImageButton.defaultProps = { 45 | onPress() {}, 46 | disabled: false 47 | }; 48 | 49 | export default ImageButton; 50 | -------------------------------------------------------------------------------- /app/components/Loading.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * Copyright 2016-present reading 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | import React from 'react'; 19 | import PropTypes from 'prop-types'; 20 | import { 21 | StyleSheet, 22 | Dimensions, 23 | View, 24 | Text, 25 | Modal, 26 | ActivityIndicator 27 | } from 'react-native'; 28 | 29 | const SIZES = ['small', 'large']; 30 | 31 | const propTypes = { 32 | visible: PropTypes.bool, 33 | color: PropTypes.string, 34 | size: PropTypes.oneOf(SIZES), 35 | overlayColor: PropTypes.string, 36 | onRequestClose: PropTypes.func 37 | }; 38 | 39 | const Loading = ({ 40 | visible, color, size, overlayColor, onRequestClose 41 | }) => ( 42 | 43 | {visible ? ( 44 | 45 | 46 | 47 | 48 | 数据加载中... 49 | 50 | 51 | 52 | ) : ( 53 | 54 | )} 55 | 56 | ); 57 | 58 | const styles = StyleSheet.create({ 59 | container: { 60 | flex: 1, 61 | backgroundColor: 'transparent', 62 | position: 'absolute', 63 | top: 0, 64 | bottom: 0, 65 | left: 0, 66 | right: 0 67 | }, 68 | background: { 69 | position: 'absolute', 70 | top: 0, 71 | bottom: 0, 72 | left: 0, 73 | right: 0, 74 | justifyContent: 'center', 75 | alignItems: 'center' 76 | }, 77 | loading: { 78 | alignItems: 'center', 79 | justifyContent: 'center', 80 | width: Dimensions.get('window').width / 2.5, 81 | height: Dimensions.get('window').width / 2.5, 82 | borderRadius: 10, 83 | backgroundColor: 'rgba(0, 0, 0, 0.25)' 84 | }, 85 | loadingText: { 86 | marginTop: 10, 87 | textAlign: 'center', 88 | color: '#fcfcfc' 89 | } 90 | }); 91 | 92 | Loading.propTypes = propTypes; 93 | 94 | Loading.defaultProps = { 95 | visible: false, 96 | color: 'white', 97 | size: 'large', 98 | overlayColor: 'transparent', 99 | onRequestClose() {} 100 | }; 101 | 102 | export default Loading; 103 | -------------------------------------------------------------------------------- /app/components/LoadingView.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * Copyright 2015-present reading 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | import React from 'react'; 19 | import { ActivityIndicator, Text, StyleSheet, View } from 'react-native'; 20 | 21 | const LoadingView = () => ( 22 | 23 | 24 | 数据加载中... 25 | 26 | ); 27 | 28 | const styles = StyleSheet.create({ 29 | loading: { 30 | flex: 1, 31 | alignItems: 'center', 32 | justifyContent: 'center', 33 | backgroundColor: 'white' 34 | }, 35 | loadingText: { 36 | marginTop: 10, 37 | textAlign: 'center' 38 | } 39 | }); 40 | 41 | export default LoadingView; 42 | -------------------------------------------------------------------------------- /app/constants/ActionTypes.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * Copyright 2016-present reading 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | export const REQUEST_ARTICLE_LIST = 'REQUEST_ARTICLE_LIST'; 19 | export const FETCH_ARTICLE_LIST = 'FETCH_ARTICLE_LIST'; 20 | export const RECEIVE_ARTICLE_LIST = 'RECEIVE_ARTICLE_LIST'; 21 | export const REQUEST_TYPE_LIST = 'REQUEST_TYPE_LIST'; 22 | export const FETCH_TYPE_LIST = 'FETCH_TYPE_LIST'; 23 | export const RECEIVE_TYPE_LIST = 'RECEIVE_TYPE_LIST'; 24 | -------------------------------------------------------------------------------- /app/constants/Urls.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * Copyright 2016-present reading 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | export const WEXIN_ARTICLE_LIST = 'http://route.showapi.com/582-2'; 19 | export const WEXIN_ARTICLE_TYPE = 'http://route.showapi.com/582-1'; 20 | -------------------------------------------------------------------------------- /app/containers/CategoryContainer.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * Copyright 2016-present reading 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | import { connect } from 'react-redux'; 19 | import { bindActionCreators } from 'redux'; 20 | import * as categoryCreators from '../actions/category'; 21 | 22 | import Category from '../pages/Category/Category'; 23 | 24 | const mapStateToProps = (state) => { 25 | const { category } = state; 26 | return { 27 | category 28 | }; 29 | }; 30 | 31 | const mapDispatchToProps = (dispatch) => { 32 | const categoryActions = bindActionCreators(categoryCreators, dispatch); 33 | return { 34 | categoryActions 35 | }; 36 | }; 37 | 38 | export default connect(mapStateToProps, mapDispatchToProps)(Category); 39 | -------------------------------------------------------------------------------- /app/containers/MainContainer.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * Copyright 2016-present reading 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | import React from 'react'; 19 | import { connect } from 'react-redux'; 20 | import CodePush from 'react-native-code-push'; 21 | import { bindActionCreators } from 'redux'; 22 | import Main from '../pages/MainPage/Main'; 23 | import * as readCreators from '../actions/read'; 24 | import fontUri from '../utils/FontUtil'; 25 | 26 | class MainContainer extends React.Component { 27 | static navigationItem = { 28 | 29 | titleItem: { 30 | title: '首页' 31 | }, 32 | 33 | tabItem: { 34 | title: '首页', 35 | icon: { uri: fontUri('Ionicons', 'md-home', 24) }, 36 | hideTabBarWhenPush: true, 37 | }, 38 | }; 39 | 40 | static componentDidMount() { 41 | CodePush.sync({ 42 | deploymentKey: 'RGOUfyINiLicZnld67aD0nrbRvyLV1Ifekvul', 43 | updateDialog: { 44 | optionalIgnoreButtonLabel: '稍后', 45 | optionalInstallButtonLabel: '后台更新', 46 | optionalUpdateMessage: 'iReading有新版本了,是否更新?', 47 | title: '更新提示' 48 | }, 49 | installMode: CodePush.InstallMode.ON_NEXT_RESTART 50 | }); 51 | } 52 | 53 | render() { 54 | return

; 55 | } 56 | } 57 | 58 | const mapStateToProps = (state) => { 59 | const { read } = state; 60 | return { 61 | read 62 | }; 63 | }; 64 | 65 | const mapDispatchToProps = (dispatch) => { 66 | const readActions = bindActionCreators(readCreators, dispatch); 67 | return { 68 | readActions 69 | }; 70 | }; 71 | 72 | export default connect(mapStateToProps, mapDispatchToProps)(MainContainer); 73 | -------------------------------------------------------------------------------- /app/img/about_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/listenzz/reading/50f9d9e53cb11a8a3a0e872a487e1658b54f9d62/app/img/about_logo.png -------------------------------------------------------------------------------- /app/img/arrow_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/listenzz/reading/50f9d9e53cb11a8a3a0e872a487e1658b54f9d62/app/img/arrow_left.png -------------------------------------------------------------------------------- /app/img/share_icon_moments.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/listenzz/reading/50f9d9e53cb11a8a3a0e872a487e1658b54f9d62/app/img/share_icon_moments.png -------------------------------------------------------------------------------- /app/img/share_icon_wechat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/listenzz/reading/50f9d9e53cb11a8a3a0e872a487e1658b54f9d62/app/img/share_icon_wechat.png -------------------------------------------------------------------------------- /app/img/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/listenzz/reading/50f9d9e53cb11a8a3a0e872a487e1658b54f9d62/app/img/splash.png -------------------------------------------------------------------------------- /app/pages/About/About.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * Copyright 2016-present reading 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | import React from 'react'; 19 | import { StyleSheet, Image, Text, Linking, View, Platform } from 'react-native'; 20 | 21 | import DeviceInfo from 'react-native-device-info'; 22 | import Button from '../../components/Button'; 23 | import fontUri from '../../utils/FontUtil'; 24 | 25 | const SHOW_API = 'https://www.showapi.com'; 26 | const READING_REPO = 'https://github.com/attentiveness/reading'; 27 | 28 | const aboutLogo = require('../../img/about_logo.png'); 29 | 30 | class About extends React.Component { 31 | static navigationItem = { 32 | titleItem: { 33 | title: '关于' 34 | }, 35 | 36 | rightBarButtonItem: { 37 | icon: { uri: fontUri('Ionicons', 'logo-github', 24) }, 38 | action: () => { 39 | Linking.openURL(READING_REPO); 40 | }, 41 | }, 42 | 43 | tabItem: { 44 | title: '关于', 45 | icon: { uri: fontUri('Ionicons', 'md-information-circle', 24) }, 46 | hideTabBarWhenPush: true, 47 | }, 48 | 49 | }; 50 | 51 | render() { 52 | return ( 53 | 54 | 55 | 56 | 57 | {`v${DeviceInfo.getVersion()}`} 58 | iReading 59 | 让生活更精彩 60 | 61 | 62 | 63 | 64 | 免责声明:所有内容均来自: 65 | 66 |