├── .babelrc ├── .buckconfig ├── .flowconfig ├── .gitattributes ├── .gitignore ├── .watchmanconfig ├── README.md ├── __tests__ ├── index.android.js └── index.ios.js ├── android ├── app │ ├── BUCK │ ├── build.gradle │ ├── proguard-rules.pro │ └── src │ │ └── main │ │ ├── AndroidManifest.xml │ │ ├── assets │ │ └── fonts │ │ │ ├── Entypo.ttf │ │ │ ├── EvilIcons.ttf │ │ │ ├── Feather.ttf │ │ │ ├── FontAwesome.ttf │ │ │ ├── Foundation.ttf │ │ │ ├── Ionicons.ttf │ │ │ ├── MaterialCommunityIcons.ttf │ │ │ ├── MaterialIcons.ttf │ │ │ ├── Octicons.ttf │ │ │ ├── SimpleLineIcons.ttf │ │ │ └── Zocial.ttf │ │ ├── java │ │ └── com │ │ │ └── testt │ │ │ ├── MainActivity.java │ │ │ └── MainApplication.java │ │ └── res │ │ ├── drawable-xhdpi │ │ └── launch_screen.png │ │ ├── layout │ │ └── launch_screen.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.png │ │ └── splash_.png │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.png │ │ └── splash_.png │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.png │ │ └── launch_screen.png │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.png │ │ └── launch_screen.png │ │ └── values │ │ ├── strings.xml │ │ └── styles.xml ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── keystores │ ├── BUCK │ └── debug.keystore.properties └── settings.gradle ├── app.json ├── index.android.js ├── index.ios.js ├── ios ├── testT-tvOS │ └── Info.plist ├── testT-tvOSTests │ └── Info.plist ├── testT.xcodeproj │ ├── project.pbxproj │ └── xcshareddata │ │ └── xcschemes │ │ ├── testT-tvOS.xcscheme │ │ └── testT.xcscheme ├── testT │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Base.lproj │ │ └── LaunchScreen.xib │ ├── Images.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── Info.plist │ └── main.m └── testTTests │ ├── Info.plist │ └── testTTests.m ├── js ├── component │ ├── Avatar.js │ ├── Button.js │ ├── CustomTabBar.js │ ├── HotPanel.js │ ├── ImageButtonWithText.js │ ├── ListViewForHome.js │ ├── SearchBar.js │ ├── SimpleListView.js │ ├── SimpleNavigationBar.js │ ├── SimpleTabBar.js │ ├── TabBar.js │ ├── TextButton.js │ ├── TextDivider.js │ └── WebViewNavigationBar.js ├── config │ ├── entry.js │ └── theme.js ├── data.json ├── image │ ├── add_icon_tag_followed.png │ ├── banner1.jpg │ ├── banner2.png │ ├── carousel1.jpg │ ├── carousel2.jpg │ ├── carousel3.jpg │ ├── drawer_header.png │ ├── github_login.png │ ├── github_press.png │ ├── home │ │ ├── gongxian.png │ │ ├── goumai.png │ │ ├── hot.png │ │ ├── huodong.png │ │ ├── like.png │ │ ├── pinglun.png │ │ ├── remenhuodong.png │ │ ├── settings.png │ │ ├── shengqing.png │ │ ├── tuijian.png │ │ ├── tuijianma.png │ │ └── zuijinyuedu.png │ ├── hot.png │ ├── ic_entry_original.png │ ├── ic_fab_post.png │ ├── ic_feed_collection.png │ ├── ic_feed_comment.png │ ├── ic_feed_follow.png │ ├── ic_feed_share_entry.png │ ├── ic_feed_tag.png │ ├── ic_find_category.png │ ├── ic_find_charts.png │ ├── ic_find_hot.png │ ├── ic_find_latest.png │ ├── ic_hot_home.png │ ├── ic_hot_home_close.png │ ├── ic_login_logo.png │ ├── ic_notification_juejin.png │ ├── ic_share_android.png │ ├── ic_share_article.png │ ├── ic_share_backend.png │ ├── ic_share_description.png │ ├── ic_share_design.png │ ├── ic_share_freebie.png │ ├── ic_share_frontend.png │ ├── ic_share_ios.png │ ├── ic_share_link.png │ ├── ic_share_product.png │ ├── ic_share_selected.png │ ├── ic_share_title.png │ ├── icon_add_tag.png │ ├── icon_add_tag_white.png │ ├── icon_email.png │ ├── icon_github.png │ ├── icon_phone.png │ ├── icon_wechat.png │ ├── icon_weibo.png │ ├── logo_og.png │ ├── menuBar.jpg │ ├── notification.jpg │ ├── profile_bg.jpg │ ├── rank.png │ ├── sharing_top.png │ ├── tag_icon_default.png │ ├── trend.png │ ├── user_article_no_data.png │ ├── wechat_login.png │ ├── wechat_press.png │ ├── weibo_login.png │ └── weibo_press.png ├── native_modules │ └── SplashScreen.js ├── page │ ├── BackPageComponent.js │ ├── Compass2Fragment.js │ ├── CompassFragment.js │ ├── HomeFragment.js │ ├── HomeTabPages │ │ └── HomeTab.js │ ├── IndividualPage.js │ ├── MainPage.js │ ├── MeFragment.js │ ├── NotificationFragment.js │ ├── SettingPage.js │ ├── SignInAndSignup │ │ ├── SignInPage.js │ │ └── SignUpPage.js │ ├── TabItemSwitcherPage.js │ ├── WebViewPage.js │ ├── find │ │ ├── Cell.js │ │ ├── Cell2.js │ │ ├── Cell3.js │ │ ├── HomeFragment.js │ │ ├── MenuBar.js │ │ ├── Recommend.js │ │ ├── Special.js │ │ ├── TabView.js │ │ ├── VIP.js │ │ └── data.json │ ├── home │ │ ├── Index.js │ │ └── SimpleListView.js │ └── listview │ │ ├── Cell.js │ │ ├── Demo.js │ │ ├── ReFresh.js │ │ └── data.js └── util │ ├── computeTime.js │ └── px2dp.js ├── package-lock.json ├── package.json ├── screenshot ├── compass.png ├── home.png ├── me.png ├── notification.png ├── settings.png ├── signin.png └── webview.png └── 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 | -------------------------------------------------------------------------------- /.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 | .*/Libraries/react-native/ReactNative.js 16 | 17 | [include] 18 | 19 | [libs] 20 | node_modules/react-native/Libraries/react-native/react-native-interface.js 21 | node_modules/react-native/flow 22 | flow/ 23 | 24 | [options] 25 | emoji=true 26 | 27 | module.system=haste 28 | 29 | experimental.strict_type_args=true 30 | 31 | munge_underscores=true 32 | 33 | 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' 34 | 35 | suppress_type=$FlowIssue 36 | suppress_type=$FlowFixMe 37 | suppress_type=$FixMe 38 | 39 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(4[0-5]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\) 40 | suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(4[0-5]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+ 41 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy 42 | suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError 43 | 44 | unsafe.enable_getters_and_setters=true 45 | 46 | [version] 47 | ^0.45.0 48 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.pbxproj -text 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # Xcode 6 | # 7 | build/ 8 | *.pbxuser 9 | !default.pbxuser 10 | *.mode1v3 11 | !default.mode1v3 12 | *.mode2v3 13 | !default.mode2v3 14 | *.perspectivev3 15 | !default.perspectivev3 16 | xcuserdata 17 | *.xccheckout 18 | *.moved-aside 19 | DerivedData 20 | *.hmap 21 | *.ipa 22 | *.xcuserstate 23 | project.xcworkspace 24 | 25 | # Android/IntelliJ 26 | # 27 | build/ 28 | .idea 29 | .gradle 30 | local.properties 31 | *.iml 32 | 33 | # node.js 34 | # 35 | node_modules/ 36 | npm-debug.log 37 | yarn-error.log 38 | 39 | # BUCK 40 | buck-out/ 41 | \.buckd/ 42 | *.keystore 43 | 44 | # fastlane 45 | # 46 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 47 | # screenshots whenever they are needed. 48 | # For more information about the recommended setup visit: 49 | # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md 50 | 51 | fastlane/report.xml 52 | fastlane/Preview.html 53 | fastlane/screenshots 54 | -------------------------------------------------------------------------------- /.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # JueJinClient 2 | 3 | A react-native app simulating JueJin App, which can run on both Android and iOS platforms. 4 | 5 | ## This project has deprecated because JueJin has encrypted the dataflow so that this project can't get any data from its website. 6 | 7 | **React-Native Version: 0.36** 8 | 9 | This project currently uses these dependencies: 10 | - [react-native-tab-navigator](https://github.com/exponentjs/react-native-tab-navigator) 11 | - [react-native-swiper](https://github.com/leecade/react-native-swiper) 12 | - [react-native-vector-icons](https://github.com/oblador/react-native-vector-icons) 13 | - [react-native-scrollable-tab-view](https://github.com/skv-headless/react-native-scrollable-tab-view) 14 | 15 | ## Attention 16 | 17 | This project just implements most of UI pages, so this is a UI project. If you want to learn a complete project, please move to [this project](https://github.com/wangdicoder/react-native-Gank) 18 | 19 | ## Apk File 20 | 21 | The latest apk file is [here](https://github.com/wangdicoder/JueJinClient/blob/master/android/app/app-release.apk) 22 | 23 | ## How to run it 24 | 25 | 1. git clone https://github.com/wangdicoder/JueJinClient 26 | 2. cd JueJinClient 27 | 3. npm install 28 | 4. react-native link 29 | 5. react-native run-android / run-ios 30 | 31 | ## Screenshot 32 | 33 | ![Sign-in](https://github.com/wangdicoder/JueJinClient/raw/master/screenshot/signin.png) 34 | 35 | ![home](https://github.com/wangdicoder/JueJinClient/raw/master/screenshot/home.png) 36 | 37 | ![me](https://github.com/wangdicoder/JueJinClient/raw/master/screenshot/me.png) 38 | 39 | ![compass](https://github.com/wangdicoder/JueJinClient/raw/master/screenshot/compass.png) 40 | 41 | ![settings](https://github.com/wangdicoder/JueJinClient/raw/master/screenshot/settings.png) 42 | 43 | ![notification](https://github.com/wangdicoder/JueJinClient/raw/master/screenshot/notification.png) 44 | 45 | ![webview](https://github.com/wangdicoder/JueJinClient/raw/master/screenshot/webview.png) 46 | 47 | ## License 48 | 49 | MIT License 50 | -------------------------------------------------------------------------------- /__tests__/index.android.js: -------------------------------------------------------------------------------- 1 | import 'react-native'; 2 | import React from 'react'; 3 | import Index from '../index.android.js'; 4 | 5 | // Note: test renderer must be required after react-native. 6 | import renderer from 'react-test-renderer'; 7 | 8 | it('renders correctly', () => { 9 | const tree = renderer.create( 10 | 11 | ); 12 | }); 13 | -------------------------------------------------------------------------------- /__tests__/index.ios.js: -------------------------------------------------------------------------------- 1 | import 'react-native'; 2 | import React from 'react'; 3 | import Index from '../index.ios.js'; 4 | 5 | // Note: test renderer must be required after react-native. 6 | import renderer from 'react-test-renderer'; 7 | 8 | it('renders correctly', () => { 9 | const tree = renderer.create( 10 | 11 | ); 12 | }); 13 | -------------------------------------------------------------------------------- /android/app/BUCK: -------------------------------------------------------------------------------- 1 | # To learn about Buck see [Docs](https://buckbuild.com/). 2 | # To run your application with Buck: 3 | # - install Buck 4 | # - `npm start` - to start the packager 5 | # - `cd android` 6 | # - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"` 7 | # - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck 8 | # - `buck install -r android/app` - compile, install and run application 9 | # 10 | 11 | lib_deps = [] 12 | 13 | for jarfile in glob(['libs/*.jar']): 14 | name = 'jars__' + jarfile[jarfile.rindex('/') + 1: jarfile.rindex('.jar')] 15 | lib_deps.append(':' + name) 16 | prebuilt_jar( 17 | name = name, 18 | binary_jar = jarfile, 19 | ) 20 | 21 | for aarfile in glob(['libs/*.aar']): 22 | name = 'aars__' + aarfile[aarfile.rindex('/') + 1: aarfile.rindex('.aar')] 23 | lib_deps.append(':' + name) 24 | android_prebuilt_aar( 25 | name = name, 26 | aar = aarfile, 27 | ) 28 | 29 | android_library( 30 | name = "all-libs", 31 | exported_deps = lib_deps, 32 | ) 33 | 34 | android_library( 35 | name = "app-code", 36 | srcs = glob([ 37 | "src/main/java/**/*.java", 38 | ]), 39 | deps = [ 40 | ":all-libs", 41 | ":build_config", 42 | ":res", 43 | ], 44 | ) 45 | 46 | android_build_config( 47 | name = "build_config", 48 | package = "com.testt", 49 | ) 50 | 51 | android_resource( 52 | name = "res", 53 | package = "com.testt", 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/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | 19 | # Disabling obfuscation is useful if you collect stack traces from production crashes 20 | # (unless you are using a system that supports de-obfuscate the stack traces). 21 | -dontobfuscate 22 | 23 | # React Native 24 | 25 | # Keep our interfaces so they can be used by other ProGuard rules. 26 | # See http://sourceforge.net/p/proguard/bugs/466/ 27 | -keep,allowobfuscation @interface com.facebook.proguard.annotations.DoNotStrip 28 | -keep,allowobfuscation @interface com.facebook.proguard.annotations.KeepGettersAndSetters 29 | -keep,allowobfuscation @interface com.facebook.common.internal.DoNotStrip 30 | 31 | # Do not strip any method/class that is annotated with @DoNotStrip 32 | -keep @com.facebook.proguard.annotations.DoNotStrip class * 33 | -keep @com.facebook.common.internal.DoNotStrip class * 34 | -keepclassmembers class * { 35 | @com.facebook.proguard.annotations.DoNotStrip *; 36 | @com.facebook.common.internal.DoNotStrip *; 37 | } 38 | 39 | -keepclassmembers @com.facebook.proguard.annotations.KeepGettersAndSetters class * { 40 | void set*(***); 41 | *** get*(); 42 | } 43 | 44 | -keep class * extends com.facebook.react.bridge.JavaScriptModule { *; } 45 | -keep class * extends com.facebook.react.bridge.NativeModule { *; } 46 | -keepclassmembers,includedescriptorclasses class * { native ; } 47 | -keepclassmembers class * { @com.facebook.react.uimanager.UIProp ; } 48 | -keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactProp ; } 49 | -keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactPropGroup ; } 50 | 51 | -dontwarn com.facebook.react.** 52 | 53 | # TextLayoutBuilder uses a non-public Android constructor within StaticLayout. 54 | # See libs/proxy/src/main/java/com/facebook/fbui/textlayoutbuilder/proxy for details. 55 | -dontwarn android.text.StaticLayout 56 | 57 | # okhttp 58 | 59 | -keepattributes Signature 60 | -keepattributes *Annotation* 61 | -keep class okhttp3.** { *; } 62 | -keep interface okhttp3.** { *; } 63 | -dontwarn okhttp3.** 64 | 65 | # okio 66 | 67 | -keep class sun.misc.Unsafe { *; } 68 | -dontwarn java.nio.file.* 69 | -dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement 70 | -dontwarn okio.** 71 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 12 | 13 | 19 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/Entypo.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/android/app/src/main/assets/fonts/Entypo.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/EvilIcons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/android/app/src/main/assets/fonts/EvilIcons.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/Feather.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/android/app/src/main/assets/fonts/Feather.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/FontAwesome.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/android/app/src/main/assets/fonts/FontAwesome.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/Foundation.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/android/app/src/main/assets/fonts/Foundation.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/Ionicons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/android/app/src/main/assets/fonts/Ionicons.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/MaterialCommunityIcons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/android/app/src/main/assets/fonts/MaterialCommunityIcons.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/MaterialIcons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/android/app/src/main/assets/fonts/MaterialIcons.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/Octicons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/android/app/src/main/assets/fonts/Octicons.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/SimpleLineIcons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/android/app/src/main/assets/fonts/SimpleLineIcons.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/Zocial.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/android/app/src/main/assets/fonts/Zocial.ttf -------------------------------------------------------------------------------- /android/app/src/main/java/com/testt/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.testt; 2 | 3 | import com.facebook.react.ReactActivity; 4 | import android.os.Bundle; //add 5 | import org.devio.rn.splashscreen.SplashScreen; //add 6 | 7 | public class MainActivity extends ReactActivity { 8 | @Override 9 | protected void onCreate(Bundle savedInstanceState) { 10 | SplashScreen.show(this); // <--添加这一句 11 | super.onCreate(savedInstanceState); 12 | } 13 | 14 | /** 15 | * Returns the name of the main component registered from JavaScript. 16 | * This is used to schedule rendering of the component. 17 | */ 18 | @Override 19 | protected String getMainComponentName() { 20 | return "testT"; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /android/app/src/main/java/com/testt/MainApplication.java: -------------------------------------------------------------------------------- 1 | package com.testt; 2 | 3 | import android.app.Application; 4 | 5 | import com.facebook.react.ReactApplication; 6 | import org.devio.rn.splashscreen.SplashScreenReactPackage; 7 | import com.oblador.vectoricons.VectorIconsPackage; 8 | import com.facebook.react.ReactNativeHost; 9 | import com.facebook.react.ReactPackage; 10 | import com.facebook.react.shell.MainReactPackage; 11 | import com.facebook.soloader.SoLoader; 12 | 13 | import java.util.Arrays; 14 | import java.util.List; 15 | 16 | 17 | public class MainApplication extends Application implements ReactApplication { 18 | 19 | private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) { 20 | @Override 21 | public boolean getUseDeveloperSupport() { 22 | return BuildConfig.DEBUG; 23 | } 24 | 25 | @Override 26 | protected List getPackages() { 27 | return Arrays.asList( 28 | new MainReactPackage(), 29 | new SplashScreenReactPackage(), 30 | new VectorIconsPackage() 31 | ); 32 | } 33 | }; 34 | 35 | @Override 36 | public ReactNativeHost getReactNativeHost() { 37 | return mReactNativeHost; 38 | } 39 | 40 | @Override 41 | public void onCreate() { 42 | super.onCreate(); 43 | SoLoader.init(this, /* native exopackage */ false); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-xhdpi/launch_screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/android/app/src/main/res/drawable-xhdpi/launch_screen.png -------------------------------------------------------------------------------- /android/app/src/main/res/layout/launch_screen.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/splash_.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/android/app/src/main/res/mipmap-hdpi/splash_.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/splash_.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/android/app/src/main/res/mipmap-mdpi/splash_.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/launch_screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/android/app/src/main/res/mipmap-xhdpi/launch_screen.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/launch_screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/android/app/src/main/res/mipmap-xxhdpi/launch_screen.png -------------------------------------------------------------------------------- /android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | testT 3 | 4 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | repositories { 5 | jcenter() 6 | google() 7 | } 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:3.1.0' 10 | 11 | // NOTE: Do not place your application dependencies here; they belong 12 | // in the individual module build.gradle files 13 | } 14 | } 15 | 16 | allprojects { 17 | repositories { 18 | mavenLocal() 19 | jcenter() 20 | maven { 21 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm 22 | url "$rootDir/../node_modules/react-native/android" 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true 19 | 20 | android.useDeprecatedNdk=true 21 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Wed Dec 19 12:48:20 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.4-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/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'testT' 2 | include ':react-native-splash-screen' 3 | project(':react-native-splash-screen').projectDir = new File(rootProject.projectDir,'../node_modules/react-native-splash-screen/android') 4 | 5 | include ':react-native-vector-icons' 6 | project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android') 7 | 8 | include ':app' 9 | -------------------------------------------------------------------------------- /app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "JueJinClient", 3 | "displayName": "JueJinClient" 4 | } 5 | -------------------------------------------------------------------------------- /index.android.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import {AppRegistry} from 'react-native'; 3 | import Navigation from './js/config/entry'; 4 | 5 | export default class testT extends Component { 6 | render() { 7 | return ( 8 | 9 | ); 10 | } 11 | } 12 | 13 | AppRegistry.registerComponent('testT', () => testT); 14 | -------------------------------------------------------------------------------- /index.ios.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Sample React Native App 3 | * https://github.com/facebook/react-native 4 | * @flow 5 | */ 6 | 7 | import React, { Component } from 'react'; 8 | import { 9 | AppRegistry, 10 | StyleSheet, 11 | Text, 12 | View 13 | } from 'react-native'; 14 | 15 | export default class testT extends Component { 16 | render() { 17 | return ( 18 | 19 | 20 | Welcome to React Native! 21 | 22 | 23 | To get started, edit index.ios.js 24 | 25 | 26 | Press Cmd+R to reload,{'\n'} 27 | Cmd+D or shake for dev menu 28 | 29 | 30 | ); 31 | } 32 | } 33 | 34 | const styles = StyleSheet.create({ 35 | container: { 36 | flex: 1, 37 | justifyContent: 'center', 38 | alignItems: 'center', 39 | backgroundColor: '#F5FCFF', 40 | }, 41 | welcome: { 42 | fontSize: 20, 43 | textAlign: 'center', 44 | margin: 10, 45 | }, 46 | instructions: { 47 | textAlign: 'center', 48 | color: '#333333', 49 | marginBottom: 5, 50 | }, 51 | }); 52 | 53 | AppRegistry.registerComponent('testT', () => testT); 54 | -------------------------------------------------------------------------------- /ios/testT-tvOS/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UIViewControllerBasedStatusBarAppearance 38 | 39 | NSLocationWhenInUseUsageDescription 40 | 41 | NSAppTransportSecurity 42 | 43 | 44 | NSExceptionDomains 45 | 46 | localhost 47 | 48 | NSExceptionAllowsInsecureHTTPLoads 49 | 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /ios/testT-tvOSTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /ios/testT.xcodeproj/xcshareddata/xcschemes/testT-tvOS.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 43 | 49 | 50 | 51 | 52 | 53 | 58 | 59 | 61 | 67 | 68 | 69 | 70 | 71 | 77 | 78 | 79 | 80 | 81 | 82 | 92 | 94 | 100 | 101 | 102 | 103 | 104 | 105 | 111 | 113 | 119 | 120 | 121 | 122 | 124 | 125 | 128 | 129 | 130 | -------------------------------------------------------------------------------- /ios/testT.xcodeproj/xcshareddata/xcschemes/testT.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 43 | 49 | 50 | 51 | 52 | 53 | 58 | 59 | 61 | 67 | 68 | 69 | 70 | 71 | 77 | 78 | 79 | 80 | 81 | 82 | 92 | 94 | 100 | 101 | 102 | 103 | 104 | 105 | 111 | 113 | 119 | 120 | 121 | 122 | 124 | 125 | 128 | 129 | 130 | -------------------------------------------------------------------------------- /ios/testT/AppDelegate.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | @interface AppDelegate : UIResponder 13 | 14 | @property (nonatomic, strong) UIWindow *window; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /ios/testT/AppDelegate.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import "AppDelegate.h" 11 | 12 | #import 13 | #import 14 | 15 | @implementation AppDelegate 16 | 17 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 18 | { 19 | NSURL *jsCodeLocation; 20 | 21 | jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil]; 22 | 23 | RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation 24 | moduleName:@"testT" 25 | initialProperties:nil 26 | launchOptions:launchOptions]; 27 | rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1]; 28 | 29 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 30 | UIViewController *rootViewController = [UIViewController new]; 31 | rootViewController.view = rootView; 32 | self.window.rootViewController = rootViewController; 33 | [self.window makeKeyAndVisible]; 34 | return YES; 35 | } 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /ios/testT/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 21 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /ios/testT/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /ios/testT/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | testT 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSRequiresIPhoneOS 26 | 27 | UILaunchStoryboardName 28 | LaunchScreen 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UIViewControllerBasedStatusBarAppearance 40 | 41 | NSLocationWhenInUseUsageDescription 42 | 43 | NSAppTransportSecurity 44 | 45 | NSExceptionDomains 46 | 47 | localhost 48 | 49 | NSExceptionAllowsInsecureHTTPLoads 50 | 51 | 52 | 53 | 54 | UIAppFonts 55 | 56 | Entypo.ttf 57 | EvilIcons.ttf 58 | Feather.ttf 59 | FontAwesome.ttf 60 | Foundation.ttf 61 | Ionicons.ttf 62 | MaterialCommunityIcons.ttf 63 | MaterialIcons.ttf 64 | Octicons.ttf 65 | SimpleLineIcons.ttf 66 | Zocial.ttf 67 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /ios/testT/main.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | #import "AppDelegate.h" 13 | 14 | int main(int argc, char * argv[]) { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /ios/testTTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /ios/testTTests/testTTests.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | #import 12 | 13 | #import 14 | #import 15 | 16 | #define TIMEOUT_SECONDS 600 17 | #define TEXT_TO_LOOK_FOR @"Welcome to React Native!" 18 | 19 | @interface testTTests : XCTestCase 20 | 21 | @end 22 | 23 | @implementation testTTests 24 | 25 | - (BOOL)findSubviewInView:(UIView *)view matching:(BOOL(^)(UIView *view))test 26 | { 27 | if (test(view)) { 28 | return YES; 29 | } 30 | for (UIView *subview in [view subviews]) { 31 | if ([self findSubviewInView:subview matching:test]) { 32 | return YES; 33 | } 34 | } 35 | return NO; 36 | } 37 | 38 | - (void)testRendersWelcomeScreen 39 | { 40 | UIViewController *vc = [[[RCTSharedApplication() delegate] window] rootViewController]; 41 | NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS]; 42 | BOOL foundElement = NO; 43 | 44 | __block NSString *redboxError = nil; 45 | RCTSetLogFunction(^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) { 46 | if (level >= RCTLogLevelError) { 47 | redboxError = message; 48 | } 49 | }); 50 | 51 | while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) { 52 | [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 53 | [[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 54 | 55 | foundElement = [self findSubviewInView:vc.view matching:^BOOL(UIView *view) { 56 | if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) { 57 | return YES; 58 | } 59 | return NO; 60 | }]; 61 | } 62 | 63 | RCTSetLogFunction(RCTDefaultLogFunction); 64 | 65 | XCTAssertNil(redboxError, @"RedBox error: %@", redboxError); 66 | XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS); 67 | } 68 | 69 | 70 | @end 71 | -------------------------------------------------------------------------------- /js/component/Avatar.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by wangdi on 4/11/16. 3 | */ 4 | import React, {Component, PropTypes} from "react"; 5 | import {View, Image, Text} from "react-native"; 6 | 7 | export default class Avatar extends Component { 8 | static propTypes = { 9 | image: PropTypes.oneOfType([PropTypes.number, PropTypes.object]), 10 | size: PropTypes.number, 11 | color: PropTypes.string, 12 | backgroundColor: PropTypes.string, 13 | text: PropTypes.string, 14 | textSize: PropTypes.number, 15 | borderRadius: PropTypes.number, 16 | borderColor: PropTypes.string, 17 | borderWidth: PropTypes.number 18 | }; 19 | 20 | static defaultProps = { 21 | size: 40, 22 | color: '#ffffff', 23 | backgroundColor: 'skyblue', 24 | borderColor: 'rgba(0,0,0,.1)', 25 | borderWidth: 1 26 | }; 27 | 28 | render() { 29 | const { 30 | image, 31 | size, 32 | color, 33 | backgroundColor, 34 | text, 35 | textSize, 36 | borderColor, 37 | borderWidth 38 | } = this.props; 39 | 40 | if (image) { 41 | return( 42 | 43 | 46 | 47 | 48 | ) 49 | } 50 | 51 | if (text) { 52 | return ( 53 | 54 | 55 | {text} 56 | 57 | 58 | ); 59 | } 60 | 61 | return null; 62 | } 63 | } -------------------------------------------------------------------------------- /js/component/Button.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by wangdi on 4/11/16. 3 | */ 4 | 'use strict'; 5 | 6 | import React, {Component, PropTypes} from 'react'; 7 | import {Text, View, StyleSheet, Platform, TouchableHighlight, TouchableNativeFeedback} from 'react-native'; 8 | import px2dp from '../util/px2dp'; 9 | import theme from '../config/theme'; 10 | 11 | export default class Button extends Component{ 12 | static propTypes = { 13 | text: PropTypes.string.isRequired, 14 | onPress: PropTypes.func 15 | }; 16 | 17 | render(){ 18 | if(Platform.OS === 'android') { 19 | return ( 20 | 22 | {this._renderContent()} 23 | 24 | ); 25 | }else if(Platform.OS === 'ios'){ 26 | return( 27 | 31 | {this._renderContent()} 32 | 33 | ); 34 | } 35 | } 36 | 37 | _renderContent(){ 38 | return( 39 | 41 | {this.props.text} 42 | 43 | ); 44 | } 45 | } 46 | 47 | const styles = StyleSheet.create({ 48 | text:{ 49 | color: 'white', 50 | fontSize: px2dp(13) 51 | } 52 | }); -------------------------------------------------------------------------------- /js/component/ImageButtonWithText.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by wangdi on 4/11/16. 3 | */ 4 | 'use strict'; 5 | 6 | import React, {Component, PropTypes} from 'react'; 7 | import ReactNative, {Text, View, StyleSheet, Platform, TouchableOpacity, TouchableNativeFeedback, Image} from 'react-native'; 8 | import px2dp from '../util/px2dp'; 9 | import Icon from 'react-native-vector-icons/Ionicons'; 10 | import theme from '../config/theme'; 11 | 12 | export default class ImageButton extends Component{ 13 | 14 | static propTypes = { 15 | text: PropTypes.string, 16 | image: PropTypes.number, 17 | icon: PropTypes.string, 18 | onPress: PropTypes.func, 19 | imgSize: PropTypes.number, 20 | fontSize: PropTypes.number, 21 | color: PropTypes.string, 22 | btnStyle: View.propTypes.style 23 | }; 24 | 25 | static defaultProps = { 26 | imgSize: px2dp(40), 27 | fontSize: px2dp(13) 28 | }; 29 | 30 | render() { 31 | const {image, icon, onPress} = this.props; 32 | 33 | if (Platform.OS === 'ios') { 34 | if (image) { 35 | return ( 36 | 37 | {this._renderContentWithImage()} 38 | 39 | ); 40 | } else if (icon) { 41 | return ( 42 | 43 | {this._renderContentWithIcon()} 44 | 45 | ); 46 | } 47 | } else if (Platform.OS === 'android') { 48 | if (image) { 49 | return ( 50 | 51 | {this._renderContentWithImage()} 52 | 53 | ); 54 | } else if (icon) { 55 | return ( 56 | 57 | {this._renderContentWithIcon()} 58 | 59 | ); 60 | } 61 | } 62 | } 63 | 64 | _renderContentWithImage(){ 65 | const {text, image, color, imgSize, fontSize, btnStyle} = this.props; 66 | return( 67 | 68 | 69 | {text ? 70 | {text} 71 | : 72 | null 73 | } 74 | 75 | ); 76 | } 77 | 78 | _renderContentWithIcon(){ 79 | const {text, icon, color, imgSize, fontSize, btnStyle} = this.props; 80 | return( 81 | 82 | 83 | {text ? 84 | {text} 85 | : 86 | null 87 | } 88 | 89 | ); 90 | } 91 | } 92 | 93 | const styles = StyleSheet.create({ 94 | view:{ 95 | alignItems: 'center', 96 | justifyContent: 'center' 97 | }, 98 | text:{ 99 | color: 'rgba(255,255,255,0.7)', 100 | marginTop: px2dp(4) 101 | } 102 | }); -------------------------------------------------------------------------------- /js/component/SearchBar.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by wangdi on 7/11/16. 3 | */ 4 | import React, {Component, PropTypes} from 'react'; 5 | import {Text, View, StyleSheet, Platform, TouchableNativeFeedback, TouchableOpacity} from 'react-native'; 6 | import theme from '../config/theme'; 7 | import px2dp from '../util/px2dp'; 8 | import Icon from 'react-native-vector-icons/Ionicons'; 9 | import ImageButton from "./ImageButtonWithText"; 10 | 11 | export default class SearchBar extends Component{ 12 | static propTypes = { 13 | onPress: PropTypes.func 14 | }; 15 | 16 | render(){ 17 | if(Platform.OS === 'android'){ 18 | return( 19 | 20 | 25 | 26 | {this.renderContent()} 27 | 28 | 33 | 38 | 39 | ); 40 | }else if(Platform.OS === 'ios'){ 41 | return( 42 | 43 | 44 | {this.renderContent()} 45 | 46 | 47 | ); 48 | } 49 | } 50 | 51 | renderContent(){ 52 | return( 53 | 54 | 55 | 搜索 56 | 57 | ); 58 | } 59 | } 60 | 61 | const styles = StyleSheet.create({ 62 | container: { 63 | height: theme.actionBar.height, 64 | backgroundColor: '#f5f5f5', 65 | justifyContent: 'flex-start', 66 | flexDirection:'row', 67 | paddingTop: (Platform.OS === 'ios') ? px2dp(20) : 0 68 | }, 69 | searchBar: { 70 | flexDirection: 'row', 71 | height: px2dp(26), 72 | flex:1, 73 | marginTop:px2dp(7), 74 | paddingLeft: px2dp(13), 75 | paddingRight: px2dp(13), 76 | backgroundColor: '#fff', 77 | alignItems: 'center', 78 | marginRight: px2dp(8), 79 | marginLeft: px2dp(8), 80 | borderRadius: px2dp(22) 81 | }, 82 | text: { 83 | fontSize: px2dp(15), 84 | color: '#6f6f71', 85 | marginLeft: px2dp(13) 86 | }, 87 | imgBtn: { 88 | height:theme.actionBar.height, 89 | width:theme.actionBar.height, 90 | } 91 | }); 92 | -------------------------------------------------------------------------------- /js/component/SimpleListView.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by wangdi on 9/11/16. 3 | */ 4 | 'use strict'; 5 | 6 | import React, {Component, PropTypes} from 'react'; 7 | import ReactNative, {Text, View, StyleSheet, Platform, PixelRatio, ListView, TouchableOpacity, TouchableNativeFeedback, Image} from 'react-native'; 8 | import px2dp from '../util/px2dp'; 9 | import Icon from 'react-native-vector-icons/Ionicons'; 10 | import theme from '../config/theme'; 11 | import MainPage from '../page/MainPage'; 12 | 13 | export default class SimpleListView extends Component{ 14 | static propTypes = { 15 | isRenderHeader: PropTypes.bool 16 | } 17 | 18 | static defaultProps = { 19 | isRenderHeader: false 20 | } 21 | 22 | constructor(props){ 23 | super(props); 24 | const ds = new ListView.DataSource({ 25 | rowHasChanged: (r1, r2) => r1 !== r2 26 | }); 27 | this.state = { 28 | dataSource: ds.cloneWithRows(this.props.contents) 29 | } 30 | } 31 | 32 | _itemClickCallback(rowData){ 33 | MainPage.switchToWebViewPage(rowData); 34 | } 35 | 36 | _renderItem(rowData, sectionID, rowID, highlightRow){ 37 | if(Platform.OS === 'ios') { 38 | return ( 39 | 42 | {this._renderItemContent(rowData)} 43 | 44 | ) 45 | }else if(Platform.OS === 'android'){ 46 | return ( 47 | 48 | {rowData.images.length === 1?this._renderItemContentImageOne(rowData):this._renderItemContent(rowData)} 49 | 50 | ) 51 | } 52 | } 53 | 54 | _renderItemContentImageOne(rowData){ 55 | return( 56 | 57 | 58 | 59 | {rowData.title} 60 | {this._renderItemContext(rowData.text)} 61 | {this._renderItemOperation()} 62 | 63 | 64 | 65 | 66 | ); 67 | } 68 | _renderItemContent(rowData){ 69 | return( 70 | 71 | 72 | {rowData.title} 73 | {rowData.images.length>2?this._renderItemImage(rowData.images):this._renderItemContext(rowData.text)} 74 | {this._renderItemOperation()} 75 | 76 | ); 77 | } 78 | _renderItemContext(text){ 79 | return({text}) 80 | } 81 | _renderItemImage(images){ 82 | return( 83 | 84 | 85 | 86 | ) 87 | } 88 | _renderItemOperation(){ 89 | return( 90 | 揭远飞 91 | 92 | 12 93 | 94 | 95 | 1 96 | 97 | 98 | 12 99 | 100 | ) 101 | } 102 | _renderHeader(){ 103 | if(this.props.isRenderHeader) { 104 | return ( 105 | 106 | 热门文章 107 | 108 | ); 109 | } 110 | } 111 | 112 | render(){ 113 | return( 114 | 120 | ); 121 | } 122 | } 123 | 124 | const styles = StyleSheet.create({ 125 | listView: { 126 | // marginTop: px2dp(15) 127 | }, 128 | header: { 129 | backgroundColor: '#fff', 130 | height: px2dp(40), 131 | paddingLeft: px2dp(15), 132 | justifyContent: 'center' 133 | }, 134 | item: { 135 | flexDirection: 'column', 136 | width: theme.screenWidth, 137 | // height: px2dp(80), 138 | backgroundColor: '#fff', 139 | paddingLeft: px2dp(10), 140 | paddingRight: px2dp(10), 141 | paddingTop:px2dp(8), 142 | paddingBottom:px2dp(6), 143 | borderBottomColor: '#eee', 144 | borderBottomWidth: 0.5 145 | }, 146 | title: { 147 | color: '#333', 148 | fontSize: px2dp(15), 149 | }, 150 | content: { 151 | paddingTop:px2dp(5), 152 | paddingBottom:px2dp(5), 153 | color:'#d9d9d9' 154 | }, 155 | operation: { 156 | flexDirection: 'row', 157 | justifyContent: 'flex-start' 158 | }, 159 | 160 | images: { 161 | paddingTop:px2dp(5), 162 | paddingBottom:px2dp(5), 163 | flexDirection: 'row', 164 | justifyContent: 'flex-start' 165 | }, 166 | image: { 167 | flex:1, 168 | height: px2dp(65), 169 | borderRadius: 5, 170 | backgroundColor: '#f4f4f4', 171 | resizeMode: 'cover' 172 | }, 173 | infoBar: { 174 | flexDirection: 'row', 175 | marginTop: px2dp(3) 176 | }, 177 | infoBarText: { 178 | fontSize: px2dp(11), 179 | color: theme.grayColor 180 | } 181 | }); 182 | -------------------------------------------------------------------------------- /js/component/SimpleNavigationBar.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by wangdi on 16/11/16. 3 | */ 4 | import React, {Component, PropTypes} from 'react'; 5 | import {StyleSheet, View, Text, Platform} from 'react-native'; 6 | import ImageButton from '../component/ImageButtonWithText'; 7 | import theme from '../config/theme'; 8 | import px2dp from '../util/px2dp'; 9 | 10 | export default class SimpleNavigationBar extends Component{ 11 | static propTypes = { 12 | title: PropTypes.string.isRequired, 13 | backOnPress: PropTypes.func.isRequired 14 | }; 15 | 16 | render(){ 17 | return( 18 | 19 | {Platform.OS === 'android' ? 20 | 21 | : 22 | 23 | } 24 | {this.props.title} 25 | 26 | ); 27 | } 28 | } 29 | 30 | const styles = StyleSheet.create({ 31 | toolbar: { 32 | height: theme.actionBar.height, 33 | width: theme.screenWidth, 34 | backgroundColor: theme.actionBar.backgroundColor, 35 | flexDirection: 'row', 36 | justifyContent: 'flex-start', 37 | alignItems: 'center', 38 | paddingTop: (Platform.OS === 'ios') ? px2dp(20) : 0, 39 | }, 40 | imgBtn: { 41 | width: px2dp(49), 42 | height: px2dp(49) 43 | }, 44 | title:{ 45 | color: '#666', 46 | fontSize: theme.actionBar.fontSize, 47 | marginLeft: px2dp(5), 48 | } 49 | }); 50 | -------------------------------------------------------------------------------- /js/component/TabBar.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by wangdi on 4/11/16. 3 | */ 4 | 'use strict'; 5 | 6 | import React, {Component} from 'react'; 7 | import {Text, StyleSheet, Image} from 'react-native'; 8 | import Icon from 'react-native-vector-icons/Ionicons'; 9 | import TabNavigator from 'react-native-tab-navigator'; 10 | import FindFragment from '../page/find/HomeFragment'; 11 | import HomeFragment from '../page/home/Index'; 12 | import MeFragment from '../page/MeFragment'; 13 | import NotifyFragment from '../page/NotificationFragment'; 14 | import px2dp from '../util/px2dp'; 15 | 16 | 17 | export default class TabBar extends Component{ 18 | static defaultProps = { 19 | selectedColor: '#ff7963', 20 | normalColor: '#a9a9a9' 21 | }; 22 | 23 | constructor(props){ 24 | super(props); 25 | this.state = { 26 | selectedTab: 'home', 27 | tabName: ['首页','发现','消息','我'] 28 | } 29 | } 30 | 31 | render(){ 32 | const {selectedColor} = this.props; 33 | const {tabName} = this.state; 34 | return( 35 | 39 | } 45 | renderSelectedIcon={() => } 46 | onPress={() => this.setState({ selectedTab: 'home' })}> 47 | {} 48 | 49 | } 55 | renderSelectedIcon={() => } 56 | onPress={() => this.setState({ selectedTab: 'compass' })}> 57 | {} 58 | 59 | }> 63 | 64 | 65 | } 71 | renderSelectedIcon={() => } 72 | onPress={() => this.setState({ selectedTab: 'notification' })}> 73 | {} 74 | 75 | } 81 | renderSelectedIcon={() => } 82 | onPress={() => this.setState({ selectedTab: 'me' })}> 83 | {} 84 | 85 | 86 | ); 87 | } 88 | 89 | componentWillMount() { 90 | const {selectedColor, normalColor} = this.props; 91 | Icon.getImageSource('md-notifications', 50, normalColor).then((source) => this.setState({ notificationNormal: source })); 92 | Icon.getImageSource('md-notifications', 50, selectedColor).then((source) => this.setState({ notificationSelected: source })); 93 | Icon.getImageSource('md-home', 50, normalColor).then((source) => this.setState({ homeNormal: source })); 94 | Icon.getImageSource('md-home', 50, selectedColor).then((source) => this.setState({ homeSelected: source })); 95 | Icon.getImageSource('md-person', 50, normalColor).then((source) => this.setState({ meNormal: source })); 96 | Icon.getImageSource('md-person', 50, selectedColor).then((source) => this.setState({ meSelected: source })); 97 | Icon.getImageSource('md-compass', 50, normalColor).then((source) => this.setState({ compassNormal: source })); 98 | Icon.getImageSource('md-compass', 50, selectedColor).then((source) => this.setState({ compassSelected: source })); 99 | Icon.getImageSource('ios-add-circle', 50, selectedColor).then((source) => this.setState({ addCircle: source })); 100 | } 101 | } 102 | 103 | const styles = StyleSheet.create({ 104 | tabbar: { 105 | height: px2dp(40), 106 | alignItems:'center', 107 | justifyContent: 'center', 108 | backgroundColor: '#fff', 109 | 110 | }, 111 | tabStyle:{ 112 | paddingTop: px2dp(15) 113 | }, 114 | addTabStyle:{ 115 | paddingBottom: px2dp(0) 116 | }, 117 | tab: { 118 | width: px2dp(18), 119 | height: px2dp(18) 120 | }, 121 | tabAdd: { 122 | width: px2dp(30), 123 | height: px2dp(30) 124 | } 125 | }); 126 | -------------------------------------------------------------------------------- /js/component/TextButton.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by wangdi on 4/11/16. 3 | */ 4 | 'use strict'; 5 | 6 | import React, {Component, PropTypes} from 'react'; 7 | import {Text, View, StyleSheet, Platform, TouchableOpacity} from 'react-native'; 8 | import px2dp from '../util/px2dp'; 9 | 10 | export default class TextButton extends Component{ 11 | static propTypes = { 12 | text: PropTypes.string.isRequired, 13 | onPress: PropTypes.func, 14 | color: PropTypes.string, 15 | fontSize: PropTypes.number 16 | }; 17 | 18 | static defaultProps = { 19 | color: 'white', 20 | fontSize: px2dp(12) 21 | }; 22 | 23 | render() { 24 | return ( 25 | 27 | 28 | {this.props.text} 29 | 30 | 31 | ); 32 | } 33 | 34 | } 35 | 36 | const styles = StyleSheet.create({ 37 | 38 | }); -------------------------------------------------------------------------------- /js/component/TextDivider.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by wangdi on 4/11/16. 3 | */ 4 | 'use strict'; 5 | 6 | import React, {Component, PropTypes} from 'react'; 7 | import {Text, View, StyleSheet, Platform, PixelRatio, TouchableOpacity, Image} from 'react-native'; 8 | import px2dp from '../util/px2dp'; 9 | 10 | export default class TextDivider extends Component{ 11 | static propTypes = { 12 | text: PropTypes.string.isRequired 13 | }; 14 | 15 | render(){ 16 | return( 17 | 18 | 19 | {this.props.text} 20 | 21 | 22 | ); 23 | } 24 | } 25 | 26 | const styles = StyleSheet.create({ 27 | view:{ 28 | flexDirection: 'row', 29 | alignItems: 'center' 30 | }, 31 | divider:{ 32 | flex: 1, 33 | backgroundColor: '#3d3d3d', 34 | height: 1 / PixelRatio.get() 35 | }, 36 | text:{ 37 | color: '#3d3d3d', 38 | fontSize: px2dp(10), 39 | marginLeft: px2dp(9), 40 | marginRight: px2dp(9) 41 | } 42 | }); 43 | -------------------------------------------------------------------------------- /js/component/WebViewNavigationBar.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by wangdi on 13/11/16. 3 | */ 4 | import React, {Component, PropTypes} from 'react'; 5 | import {StyleSheet, View, Text, PixelRatio, Platform, TouchableOpacity} from 'react-native'; 6 | import theme from '../config/theme'; 7 | import px2dp from '../util/px2dp'; 8 | import Icon from 'react-native-vector-icons/Ionicons'; 9 | import ImageButton from '../component/ImageButtonWithText'; 10 | import Avatar from '../component/Avatar'; 11 | 12 | export default class WebViewNavigationBar extends Component{ 13 | static propTypes = { 14 | userInfo: PropTypes.object, 15 | onPress: PropTypes.func 16 | }; 17 | 18 | static defaultProps = { 19 | userInfo: { 20 | username: '', 21 | avatar_large: 'https://facebook.github.io/react/img/logo_og.png' 22 | } 23 | }; 24 | 25 | render(){ 26 | const {userInfo, onPress} = this.props; 27 | return( 28 | 29 | {Platform.OS === 'android' ? 30 | 31 | : 32 | 33 | } 34 | 37 | 38 | 39 | {userInfo.username} 40 | 41 | 42 | 43 | ) 44 | } 45 | 46 | _userNameClickCallback(){ 47 | 48 | } 49 | } 50 | 51 | const styles = StyleSheet.create({ 52 | toolbar: { 53 | height: theme.actionBar.height, 54 | width: theme.screenWidth, 55 | backgroundColor: theme.actionBar.backgroundColor, 56 | flexDirection: 'row', 57 | justifyContent: 'flex-start', 58 | alignItems: 'center', 59 | paddingTop: (Platform.OS === 'ios') ? px2dp(20) : 0 60 | }, 61 | imgBtn: { 62 | width: px2dp(49), 63 | height: px2dp(49) 64 | }, 65 | title:{ 66 | color: theme.actionBar.fontColor, 67 | fontSize: theme.actionBar.fontSize, 68 | marginLeft: px2dp(5) 69 | } 70 | }); 71 | -------------------------------------------------------------------------------- /js/config/entry.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by wangdi on 4/11/16. 3 | */ 4 | 'use strict'; 5 | 6 | import React, {Component} from 'react'; 7 | import {Platform} from 'react-native'; 8 | import {Navigator} from 'react-native-deprecated-custom-components'; 9 | import MainPage from '../page/MainPage'; 10 | import SignInPage from '../page/SignInAndSignup/SignInPage'; 11 | import WebViewPage from '../page/WebViewPage'; 12 | import SplashScreen from '../native_modules/SplashScreen'; 13 | 14 | export default class Navigation extends Component{ 15 | 16 | render(){ 17 | return( 18 | { 21 | return 22 | } 23 | }/> 24 | ); 25 | } 26 | 27 | componentDidMount(){ 28 | if(Platform.OS === 'android') 29 | SplashScreen.hide(); 30 | } 31 | } -------------------------------------------------------------------------------- /js/config/theme.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by wangdi on 5/11/16. 3 | */ 4 | 'use strict'; 5 | 6 | import {PixelRatio, Dimensions, Platform} from 'react-native'; 7 | import px2dp from '../util/px2dp'; 8 | 9 | const globalTextColor = '#000'; 10 | 11 | export default { 12 | screenWidth: Dimensions.get('window').width, 13 | screenHeight: Dimensions.get('window').height, 14 | themeColor: 'rgb(22,131,251)', 15 | pageBackgroundColor: '#fff', 16 | grayColor: '#c4c4c4', 17 | btnActiveOpacity: 0.7, 18 | actionBar: { 19 | height: (Platform.OS === 'android') ? px2dp(40) : px2dp(40), 20 | backgroundColor: 'white', 21 | fontSize: px2dp(13), 22 | fontColor: '#c1c2c5' 23 | }, 24 | text: { 25 | color: globalTextColor, 26 | fontSize: px2dp(15) 27 | }, 28 | scrollView: { 29 | fontSize: px2dp(13), 30 | underlineStyle: { 31 | backgroundColor: '#ff7963' 32 | } 33 | } 34 | }; 35 | -------------------------------------------------------------------------------- /js/data.json: -------------------------------------------------------------------------------- 1 | { 2 | "rows": [ 3 | { 4 | "id":1, 5 | "title":"golang 开发后端基础(1)", 6 | "text":"(半)IDE:visual studio code ,如果没用过就赶紧体验吧,下一代的开发工具。我用 visual studio code 写 rust golang c++ groovy javascript typescript powershell python, 用了就放不下。我除了 c++ 还是喜欢用 visual studio 几乎全用 visual studio code 来写", 7 | "content":"内容测试", 8 | "images":[], 9 | "user_id": 1, 10 | "type_id": 1, 11 | "article_num": 1, 12 | "ready_num": 1, 13 | "like_num": 1, 14 | "comment_num": 1, 15 | "url":"https://www.jianshu.com/p/638044afc1ec", 16 | "user":{ 17 | "id":1, 18 | "username": "揭远飞", 19 | "avatar_large":"https://cdn2.jianshu.io/assets/default_avatar/12-aeeea4bedf10f2a12c0d50d626951489.jpg?imageMogr2/auto-orient/strip|imageView2/1/w/120/h/120",// 头像 20 | "jobTitle":"测试job", 21 | "company":"xx" 22 | }, 23 | "updated_at":"2018-10-10 00:00:00" 24 | }, 25 | { 26 | "id":1, 27 | "title":"原来微信还有隐藏代码,80%的用户还不知道!(附表白代码)", 28 | "text":"我们每天都在玩微信,但其实微信除了一些常用的功能之外,它其实也是有隐藏代码的,今天就来说说微信里都有什么有趣好玩又炫酷的隐藏代码,喜欢哪一个可以自己try一下哦", 29 | "content":"内容测试", 30 | "images":["https://upload-images.jianshu.io/upload_images/11438996-a51bc19b2f866021?imageMogr2/auto-orient/strip%7CimageView2/2/w/500/format/webp"], 31 | "user_id": 1, 32 | "type_id": 1, 33 | "article_num": 1, 34 | "ready_num": 1, 35 | "like_num": 1, 36 | "comment_num": 1, 37 | "user":{ 38 | "id":1, 39 | "username": "揭远飞", 40 | "avatar_large":"https://cdn2.jianshu.io/assets/default_avatar/12-aeeea4bedf10f2a12c0d50d626951489.jpg?imageMogr2/auto-orient/strip|imageView2/1/w/120/h/120",// 头像 41 | "jobTitle":"测试job", 42 | "company":"xx" 43 | }, 44 | "updated_at":"2018-10-10 00:00:00" 45 | }, 46 | { 47 | "id":1, 48 | "title":"7款国产小众APP,个个都是精品,让你的手机1秒变成黑科技", 49 | "text":"内容测试内容测试内容测试内容测试内容测试", 50 | "content":"内容测试", 51 | "images":["https://upload-images.jianshu.io/upload_images/14387097-313f4ce5cb0f0dc8?imageMogr2/auto-orient/strip%7CimageView2/2/w/640/format/webp", 52 | "https://upload-images.jianshu.io/upload_images/14387097-db68315f0869fcb4?imageMogr2/auto-orient/strip%7CimageView2/2/w/640/format/webp", 53 | "https://upload-images.jianshu.io/upload_images/14387097-78b1d57753414b63?imageMogr2/auto-orient/strip%7CimageView2/2/w/640/format/webp"], 54 | "user_id": 1, 55 | "type_id": 1, 56 | "article_num": 1, 57 | "ready_num": 1, 58 | "like_num": 1, 59 | "comment_num": 1, 60 | "user":{ 61 | "id":1, 62 | "username": "揭远飞", 63 | "avatar_large":"https://cdn2.jianshu.io/assets/default_avatar/12-aeeea4bedf10f2a12c0d50d626951489.jpg?imageMogr2/auto-orient/strip|imageView2/1/w/120/h/120",// 头像 64 | "jobTitle":"测试job", 65 | "company":"xx" 66 | }, 67 | "updated_at":"2018-10-10 00:00:00" 68 | } 69 | ] 70 | } 71 | -------------------------------------------------------------------------------- /js/image/add_icon_tag_followed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/js/image/add_icon_tag_followed.png -------------------------------------------------------------------------------- /js/image/banner1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/js/image/banner1.jpg -------------------------------------------------------------------------------- /js/image/banner2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/js/image/banner2.png -------------------------------------------------------------------------------- /js/image/carousel1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/js/image/carousel1.jpg -------------------------------------------------------------------------------- /js/image/carousel2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/js/image/carousel2.jpg -------------------------------------------------------------------------------- /js/image/carousel3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/js/image/carousel3.jpg -------------------------------------------------------------------------------- /js/image/drawer_header.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/js/image/drawer_header.png -------------------------------------------------------------------------------- /js/image/github_login.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/js/image/github_login.png -------------------------------------------------------------------------------- /js/image/github_press.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/js/image/github_press.png -------------------------------------------------------------------------------- /js/image/home/gongxian.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/js/image/home/gongxian.png -------------------------------------------------------------------------------- /js/image/home/goumai.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/js/image/home/goumai.png -------------------------------------------------------------------------------- /js/image/home/hot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/js/image/home/hot.png -------------------------------------------------------------------------------- /js/image/home/huodong.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/js/image/home/huodong.png -------------------------------------------------------------------------------- /js/image/home/like.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/js/image/home/like.png -------------------------------------------------------------------------------- /js/image/home/pinglun.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/js/image/home/pinglun.png -------------------------------------------------------------------------------- /js/image/home/remenhuodong.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/js/image/home/remenhuodong.png -------------------------------------------------------------------------------- /js/image/home/settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/js/image/home/settings.png -------------------------------------------------------------------------------- /js/image/home/shengqing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/js/image/home/shengqing.png -------------------------------------------------------------------------------- /js/image/home/tuijian.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/js/image/home/tuijian.png -------------------------------------------------------------------------------- /js/image/home/tuijianma.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/js/image/home/tuijianma.png -------------------------------------------------------------------------------- /js/image/home/zuijinyuedu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/js/image/home/zuijinyuedu.png -------------------------------------------------------------------------------- /js/image/hot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/js/image/hot.png -------------------------------------------------------------------------------- /js/image/ic_entry_original.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/js/image/ic_entry_original.png -------------------------------------------------------------------------------- /js/image/ic_fab_post.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/js/image/ic_fab_post.png -------------------------------------------------------------------------------- /js/image/ic_feed_collection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/js/image/ic_feed_collection.png -------------------------------------------------------------------------------- /js/image/ic_feed_comment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/js/image/ic_feed_comment.png -------------------------------------------------------------------------------- /js/image/ic_feed_follow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/js/image/ic_feed_follow.png -------------------------------------------------------------------------------- /js/image/ic_feed_share_entry.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/js/image/ic_feed_share_entry.png -------------------------------------------------------------------------------- /js/image/ic_feed_tag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/js/image/ic_feed_tag.png -------------------------------------------------------------------------------- /js/image/ic_find_category.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/js/image/ic_find_category.png -------------------------------------------------------------------------------- /js/image/ic_find_charts.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/js/image/ic_find_charts.png -------------------------------------------------------------------------------- /js/image/ic_find_hot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/js/image/ic_find_hot.png -------------------------------------------------------------------------------- /js/image/ic_find_latest.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/js/image/ic_find_latest.png -------------------------------------------------------------------------------- /js/image/ic_hot_home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/js/image/ic_hot_home.png -------------------------------------------------------------------------------- /js/image/ic_hot_home_close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/js/image/ic_hot_home_close.png -------------------------------------------------------------------------------- /js/image/ic_login_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/js/image/ic_login_logo.png -------------------------------------------------------------------------------- /js/image/ic_notification_juejin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/js/image/ic_notification_juejin.png -------------------------------------------------------------------------------- /js/image/ic_share_android.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/js/image/ic_share_android.png -------------------------------------------------------------------------------- /js/image/ic_share_article.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/js/image/ic_share_article.png -------------------------------------------------------------------------------- /js/image/ic_share_backend.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/js/image/ic_share_backend.png -------------------------------------------------------------------------------- /js/image/ic_share_description.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/js/image/ic_share_description.png -------------------------------------------------------------------------------- /js/image/ic_share_design.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/js/image/ic_share_design.png -------------------------------------------------------------------------------- /js/image/ic_share_freebie.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/js/image/ic_share_freebie.png -------------------------------------------------------------------------------- /js/image/ic_share_frontend.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/js/image/ic_share_frontend.png -------------------------------------------------------------------------------- /js/image/ic_share_ios.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/js/image/ic_share_ios.png -------------------------------------------------------------------------------- /js/image/ic_share_link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/js/image/ic_share_link.png -------------------------------------------------------------------------------- /js/image/ic_share_product.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/js/image/ic_share_product.png -------------------------------------------------------------------------------- /js/image/ic_share_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/js/image/ic_share_selected.png -------------------------------------------------------------------------------- /js/image/ic_share_title.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/js/image/ic_share_title.png -------------------------------------------------------------------------------- /js/image/icon_add_tag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/js/image/icon_add_tag.png -------------------------------------------------------------------------------- /js/image/icon_add_tag_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/js/image/icon_add_tag_white.png -------------------------------------------------------------------------------- /js/image/icon_email.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/js/image/icon_email.png -------------------------------------------------------------------------------- /js/image/icon_github.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/js/image/icon_github.png -------------------------------------------------------------------------------- /js/image/icon_phone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/js/image/icon_phone.png -------------------------------------------------------------------------------- /js/image/icon_wechat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/js/image/icon_wechat.png -------------------------------------------------------------------------------- /js/image/icon_weibo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/js/image/icon_weibo.png -------------------------------------------------------------------------------- /js/image/logo_og.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/js/image/logo_og.png -------------------------------------------------------------------------------- /js/image/menuBar.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/js/image/menuBar.jpg -------------------------------------------------------------------------------- /js/image/notification.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/js/image/notification.jpg -------------------------------------------------------------------------------- /js/image/profile_bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/js/image/profile_bg.jpg -------------------------------------------------------------------------------- /js/image/rank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/js/image/rank.png -------------------------------------------------------------------------------- /js/image/sharing_top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/js/image/sharing_top.png -------------------------------------------------------------------------------- /js/image/tag_icon_default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/js/image/tag_icon_default.png -------------------------------------------------------------------------------- /js/image/trend.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/js/image/trend.png -------------------------------------------------------------------------------- /js/image/user_article_no_data.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/js/image/user_article_no_data.png -------------------------------------------------------------------------------- /js/image/wechat_login.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/js/image/wechat_login.png -------------------------------------------------------------------------------- /js/image/wechat_press.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/js/image/wechat_press.png -------------------------------------------------------------------------------- /js/image/weibo_login.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/js/image/weibo_login.png -------------------------------------------------------------------------------- /js/image/weibo_press.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jieyuanfei/jianshu-react-mobile/5e1c2fa2fec615eb7748f3869cfa5a279f1baf0d/js/image/weibo_press.png -------------------------------------------------------------------------------- /js/native_modules/SplashScreen.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by wangdi on 15/11/16. 3 | */ 4 | 'use strict'; 5 | 6 | import {NativeModules} from 'react-native'; 7 | export default NativeModules.SplashScreen; -------------------------------------------------------------------------------- /js/page/BackPageComponent.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by wangdi on 20/11/16. 3 | */ 4 | import React, {Component} from 'react'; 5 | import {BackHandler} from 'react-native'; 6 | 7 | export default class PageComponent extends Component{ 8 | constructor(props){ 9 | super(props); 10 | this.handleBack = this._handleBack.bind(this); 11 | } 12 | 13 | componentDidMount() { 14 | BackHandler.addEventListener('hardwareBackPress', this.handleBack); 15 | } 16 | 17 | componentWillUnmount() { 18 | BackHandler.removeEventListener('hardwareBackPress', this.handleBack); 19 | } 20 | 21 | _handleBack() { 22 | const navigator = this.props.navigator; 23 | if (navigator && navigator.getCurrentRoutes().length > 1) { 24 | navigator.pop() 25 | return true; 26 | } 27 | return false; 28 | } 29 | } -------------------------------------------------------------------------------- /js/page/Compass2Fragment.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by wangdi on 4/11/16. 3 | */ 4 | 'use strict'; 5 | 6 | import React, {Component} from 'react'; 7 | import {Text, View, StyleSheet, Platform, RefreshControl, ScrollView, ToastAndroid, Image, Dimensions, PixelRatio, Alert, AlertIOS} from 'react-native'; 8 | import px2dp from '../util/px2dp'; 9 | import theme from '../config/theme'; 10 | import computeTime from '../util/computeTime'; 11 | import SearchBar from '../component/SearchBar'; 12 | import Swiper from 'react-native-swiper'; 13 | import ImageButton from '../component/ImageButtonWithText'; 14 | import ListView from '../component/SimpleListView'; 15 | 16 | const bannerImages = [ 17 | require('../image/banner1.jpg'), 18 | require('../image/banner2.png') 19 | ]; 20 | 21 | const imgBtnImages = [ 22 | require('../image/trend.png'), 23 | require('../image/rank.png'), 24 | require('../image/hot.png') 25 | ]; 26 | 27 | export default class CompassFragment extends Component{ 28 | constructor(props){ 29 | super(props); 30 | this.state = { 31 | refreshing: true, 32 | loadedData: false, 33 | dataBlob: [], 34 | btnName: ['沸点','贡献榜','本周最热'] 35 | } 36 | } 37 | 38 | render(){ 39 | return( 40 | 41 | 42 | 52 | }> 53 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | {this.state.btnName.map((item, index) => { 66 | return( 67 | 75 | )}) 76 | } 77 | 78 | 79 | 80 | ); 81 | } 82 | 83 | _onRefresh() { 84 | this.setState({refreshing: true}); 85 | this._fetchData(); 86 | } 87 | 88 | _searchButtonCallback(){ 89 | 90 | } 91 | 92 | _imageButtonCallback(position){ 93 | this._alert(); 94 | } 95 | 96 | _renderListView(){ 97 | if(!this.state.refreshing || this.state.loadedData) { 98 | return ( 99 | 100 | ); 101 | } 102 | } 103 | 104 | _fetchData(){ 105 | let dataBlob = [] 106 | let itemInfo = { 107 | title: '标题', 108 | collectionCount: 111, 109 | user:{ 110 | id:1, 111 | username: "揭远飞", 112 | avatar_large:"https://cdn2.jianshu.io/assets/default_avatar/12-aeeea4bedf10f2a12c0d50d626951489.jpg?imageMogr2/auto-orient/strip|imageView2/1/w/120/h/120",// 头像 113 | jobTitle:"测试job", 114 | company:"xx" 115 | }, 116 | time: '2018-10-10', 117 | url: 'http://www.baidu.com', 118 | commentsCount: 112, 119 | viewsCount: 122, 120 | screenshot: 1 121 | } 122 | dataBlob.push(itemInfo); 123 | 124 | this.setState({ 125 | dataBlob: dataBlob, 126 | loadedData: true, 127 | refreshing: false 128 | }); 129 | 130 | } 131 | 132 | componentDidMount(){ 133 | // this._fetchData(); 134 | } 135 | 136 | _alert(){ 137 | if(Platform.OS === 'android') { 138 | Alert.alert( 139 | 'Message', 140 | "This function currently isn't available", 141 | [{text: 'OK', onPress: () => {}}] 142 | ); 143 | }else if(Platform.OS === 'ios'){ 144 | AlertIOS.alert( 145 | 'Message', 146 | "This function currently isn't available", 147 | [{text: 'OK', onPress: () => {}}] 148 | ); 149 | } 150 | } 151 | } 152 | 153 | const styles = StyleSheet.create({ 154 | container: { 155 | flex: 1, 156 | backgroundColor: theme.pageBackgroundColor 157 | }, 158 | slide: { 159 | 160 | }, 161 | image: { 162 | height: px2dp(130), 163 | width: Dimensions.get('window').width 164 | }, 165 | imageBtnLine:{ 166 | flexDirection: 'row', 167 | backgroundColor: '#fff', 168 | alignItems: 'center', 169 | borderBottomWidth: 1/PixelRatio.get(), 170 | borderBottomColor: '#c4c4c4' 171 | }, 172 | imgBtn: { 173 | height: px2dp(80), 174 | width: Dimensions.get('window').width/3, 175 | } 176 | }); 177 | -------------------------------------------------------------------------------- /js/page/CompassFragment.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by wangdi on 4/11/16. 3 | */ 4 | 'use strict'; 5 | 6 | import React, {Component} from 'react'; 7 | import {Text, View, StyleSheet, Platform, RefreshControl, ScrollView, ToastAndroid, Image, Dimensions, PixelRatio, Alert, AlertIOS} from 'react-native'; 8 | import px2dp from '../util/px2dp'; 9 | import theme from '../config/theme'; 10 | import computeTime from '../util/computeTime'; 11 | import SearchBar from '../component/SearchBar'; 12 | import Swiper from 'react-native-swiper'; 13 | import ImageButton from '../component/ImageButtonWithText'; 14 | import ListView from '../component/SimpleListView'; 15 | import data from '../data.json' 16 | 17 | const bannerImages = [ 18 | require('../image/banner1.jpg'), 19 | require('../image/banner2.png') 20 | ]; 21 | 22 | const imgBtnImages = [ 23 | require('../image/trend.png'), 24 | require('../image/rank.png'), 25 | require('../image/hot.png') 26 | ]; 27 | 28 | export default class CompassFragment extends Component{ 29 | constructor(props){ 30 | super(props); 31 | this.state = { 32 | refreshing: true, 33 | loadedData: false, 34 | dataBlob: [], 35 | btnName: ['沸点','贡献榜','本周最热'] 36 | } 37 | } 38 | 39 | render(){ 40 | return( 41 | 42 | 43 | 53 | }> 54 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | {this.state.btnName.map((item, index) => { 67 | return( 68 | 76 | )}) 77 | } 78 | 79 | { this._renderListView() } 80 | 81 | 82 | ); 83 | } 84 | 85 | _onRefresh() { 86 | this.setState({refreshing: true}); 87 | this._fetchData(); 88 | } 89 | 90 | _searchButtonCallback(){ 91 | 92 | } 93 | 94 | _imageButtonCallback(position){ 95 | this._alert(); 96 | } 97 | 98 | _renderListView(){ 99 | if(!this.state.refreshing || this.state.loadedData) { 100 | return ( 101 | 102 | ); 103 | } 104 | } 105 | 106 | _fetchData(){ 107 | let dataBlob = data.rows 108 | this.setState({ 109 | dataBlob: dataBlob, 110 | loadedData: true, 111 | refreshing: false 112 | }); 113 | } 114 | 115 | componentDidMount(){ 116 | this._fetchData(); 117 | } 118 | 119 | _alert(){ 120 | if(Platform.OS === 'android') { 121 | Alert.alert( 122 | 'Message', 123 | "This function currently isn't available", 124 | [{text: 'OK', onPress: () => {}}] 125 | ); 126 | }else if(Platform.OS === 'ios'){ 127 | AlertIOS.alert( 128 | 'Message', 129 | "This function currently isn't available", 130 | [{text: 'OK', onPress: () => {}}] 131 | ); 132 | } 133 | } 134 | } 135 | 136 | const styles = StyleSheet.create({ 137 | container: { 138 | flex: 1, 139 | backgroundColor: theme.pageBackgroundColor 140 | }, 141 | slide: { 142 | 143 | }, 144 | image: { 145 | height: px2dp(130), 146 | width: Dimensions.get('window').width 147 | }, 148 | imageBtnLine:{ 149 | flexDirection: 'row', 150 | backgroundColor: '#fff', 151 | alignItems: 'center', 152 | borderBottomWidth: 1/PixelRatio.get(), 153 | borderBottomColor: '#c4c4c4' 154 | }, 155 | imgBtn: { 156 | height: px2dp(80), 157 | width: Dimensions.get('window').width/3, 158 | } 159 | }); 160 | -------------------------------------------------------------------------------- /js/page/HomeFragment.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by wangdi on 4/11/16. 3 | */ 4 | 'use strict'; 5 | 6 | import React, {Component} from 'react'; 7 | import {Text, View, StyleSheet, Platform, ToastAndroid} from 'react-native'; 8 | import theme from '../config/theme'; 9 | import px2dp from '../util/px2dp'; 10 | import ScrollableTabView from 'react-native-scrollable-tab-view'; 11 | import CustomTabBar from '../component/CustomTabBar'; 12 | import HomeTab from './find/TabView'; 13 | import TabItemSwitcherPage from './TabItemSwitcherPage'; 14 | import RCTDeviceEventEmitter from 'RCTDeviceEventEmitter'; 15 | import Icon from 'react-native-vector-icons/Ionicons'; 16 | 17 | export default class HomeFragment extends Component { 18 | constructor(props) { 19 | super(props); 20 | this.state = { 21 | tabNames: ['推荐', 'VIP', '专题'] 22 | }; 23 | this._handleTabNames = this._handleTabNames.bind(this); 24 | } 25 | 26 | render() { 27 | return ( 28 | 29 | } 31 | tabBarBackgroundColor="#fff" 32 | tabBarActiveTextColor="#e2715c" 33 | tabBarInactiveTextColor="#c1c2c5" 34 | tabBarTextStyle={{fontSize: theme.scrollView.fontSize}} 35 | tabBarUnderlineStyle={theme.scrollView.underlineStyle}> 36 | {this.state.tabNames.map((item, i) => { 37 | return ( 38 | 39 | ); 40 | }) 41 | } 42 | 43 | 44 | ); 45 | } 46 | 47 | _pullDownCallback() { 48 | this.props.navigator.push({ 49 | component: TabItemSwitcherPage, 50 | args: {tabNames: this.state.tabNames} 51 | }); 52 | } 53 | 54 | componentDidMount() { 55 | RCTDeviceEventEmitter.addListener('valueChange', this._handleTabNames); 56 | } 57 | 58 | componentWillUnmount() { 59 | RCTDeviceEventEmitter.removeListener('value', this._handleTabNames); 60 | } 61 | 62 | _handleTabNames(tabNames) { 63 | this.setState({tabNames: tabNames}); 64 | } 65 | } 66 | 67 | const styles = StyleSheet.create({ 68 | container: { 69 | flex: 1, 70 | backgroundColor: theme.pageBackgroundColor 71 | }, 72 | text: { 73 | color: theme.text.color, 74 | fontSize: theme.text.fontSize 75 | } 76 | }); 77 | -------------------------------------------------------------------------------- /js/page/HomeTabPages/HomeTab.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by wangdi on 6/11/16. 3 | */ 4 | 'use strict'; 5 | 6 | import React, {Component} from 'react'; 7 | import {Text, StyleSheet, View, ScrollView, RefreshControl} from 'react-native'; 8 | import HotPanel from '../../component/HotPanel'; 9 | import ListViewForHomeTab from '../../component/ListViewForHome'; 10 | import ListViewForOtherTab from '../../component/SimpleListView'; 11 | import computeTime from '../../util/computeTime'; 12 | import theme from '../../config/theme'; 13 | import data from '../../data.json'; 14 | import Find from '../find/Recommend' 15 | 16 | export default class HomeTab extends Component { 17 | constructor(props) { 18 | super(props); 19 | this.state = { 20 | refreshing: true, 21 | loadedData: false, 22 | dataBlob: [] 23 | }; 24 | } 25 | 26 | componentDidMount() { 27 | this._fetchData(); 28 | } 29 | 30 | render() { 31 | return ( 32 | 33 | 34 | 35 | 36 | ); 37 | } 38 | 39 | _renderContents() { 40 | let {tabTag} = this.props; 41 | if (tabTag === '首页') 42 | tabTag = '热门推荐'; 43 | else 44 | tabTag += '热门'; 45 | 46 | if (!this.state.refreshing || this.state.loadedData) { 47 | return ( 48 | 49 | 50 | { tabTag === '热门推荐' ? 51 | 52 | : 53 | 54 | } 55 | 56 | 57 | ); 58 | } 59 | } 60 | 61 | _onRefresh() { 62 | this.setState({refreshing: true}); 63 | this._fetchData(); 64 | } 65 | 66 | _getCurrentTime() { 67 | function convertTime(time) { 68 | if (time <= 9) 69 | return '0' + time; 70 | return time; 71 | } 72 | 73 | var date = new Date(); 74 | return date.getFullYear() + '-' + convertTime(date.getMonth() + 1) + '-' + convertTime(date.getDate()) + 'T' + convertTime(date.getHours()) + ':' + convertTime(date.getMinutes()) + ':' + convertTime(date.getSeconds() + '.' + date.getMilliseconds() + 'Z'); 75 | } 76 | 77 | _fetchData() { 78 | let dataBlob = data.rows 79 | this.setState({ 80 | dataBlob: dataBlob, 81 | loadedData: true, 82 | refreshing: false 83 | }); 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /js/page/IndividualPage.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by wangdi on 14/11/16. 3 | */ 4 | import React, {PropTypes} from 'react'; 5 | import ReactNative, {Text, View, StyleSheet, Platform, TouchableOpacity, ListView, Image, PixelRatio, BackAndroid} from 'react-native'; 6 | import px2dp from '../util/px2dp'; 7 | import theme from '../config/theme'; 8 | import NavigationBar from '../component/SimpleNavigationBar'; 9 | import PageComponent from './BackPageComponent'; 10 | 11 | export default class IndividualPage extends PageComponent{ 12 | constructor(props){ 13 | super(props); 14 | } 15 | 16 | render(){ 17 | return( 18 | 19 | 20 | 21 | ); 22 | } 23 | } 24 | 25 | const styles = StyleSheet.create({ 26 | 27 | }); -------------------------------------------------------------------------------- /js/page/MainPage.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by wangdi on 4/11/16. 3 | */ 4 | 'use strict'; 5 | 6 | import React, {Component} from 'react'; 7 | import {Text, View, BackHandler, ToastAndroid, Platform} from 'react-native'; 8 | import TabBar from '../component/TabBar'; 9 | import WebViewPage from './WebViewPage'; 10 | import IndividualPage from './IndividualPage'; 11 | import SplashScreen from '../native_modules/SplashScreen'; 12 | 13 | export default class MainScene extends Component{ 14 | constructor(props){ 15 | super(props); 16 | MainScene.switchToWebViewPage = MainScene.switchToWebViewPage.bind(this); 17 | MainScene.switchToIndividualPage = MainScene.switchToIndividualPage.bind(this); 18 | } 19 | 20 | static switchToWebViewPage(rowData){ 21 | this.props.navigator.push({ 22 | component: WebViewPage, 23 | args: {rowData: rowData} 24 | }); 25 | } 26 | 27 | static switchToIndividualPage(userInfo){ 28 | this.props.navigator.push({ 29 | component: IndividualPage, 30 | args: {user: userInfo} 31 | }); 32 | } 33 | 34 | componentDidMount(){ 35 | if(Platform.OS === 'android') 36 | SplashScreen.hide(); 37 | BackHandler.addEventListener('hardwareBackPress', function () { 38 | BackHandler.exitApp(0); 39 | return true; 40 | }); 41 | } 42 | 43 | render(){ 44 | return( 45 | 46 | 47 | 48 | ); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /js/page/NotificationFragment.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by wangdi on 4/11/16. 3 | */ 4 | 5 | 'use strict'; 6 | 7 | import React, {Component} from 'react'; 8 | import {Text, View, StyleSheet, Platform, TouchableOpacity,Image,Dimensions} from 'react-native'; 9 | import theme from '../config/theme'; 10 | import px2dp from "../util/px2dp"; 11 | 12 | export default class NotificationFragment extends Component{ 13 | 14 | render(){ 15 | return( 16 | 17 | 19 | 20 | ); 21 | } 22 | 23 | 24 | } 25 | 26 | const styles = StyleSheet.create({ 27 | container: { 28 | flex: 1, 29 | backgroundColor: '#fff', 30 | }, 31 | content: { 32 | flex: 1, 33 | width:Dimensions.get('window').width-px2dp(2), 34 | alignItems: 'flex-start', 35 | justifyContent: 'center', 36 | } 37 | }); 38 | -------------------------------------------------------------------------------- /js/page/SignInAndSignup/SignInPage.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by wangdi on 4/11/16. 3 | */ 4 | import React, {Component} from 'react'; 5 | import {Text, View, StyleSheet, PixelRatio, Platform, TouchableOpacity, Image, TextInput, BackAndroid} from 'react-native'; 6 | import Icon from 'react-native-vector-icons/Ionicons'; 7 | import MainPage from '../MainPage'; 8 | import Button from '../../component/Button'; 9 | import TextButton from '../../component/TextButton'; 10 | import SignUpPage from './SignUpPage'; 11 | import ImageButton from '../../component/ImageButtonWithText'; 12 | import TextDivider from '../../component/TextDivider'; 13 | import px2dp from '../../util/px2dp'; 14 | 15 | export default class SignInPage extends Component{ 16 | constructor(props){ 17 | super(props); 18 | this.handleBack = this._handleBack.bind(this); 19 | } 20 | 21 | componentDidMount() { 22 | BackAndroid.addEventListener('hardwareBackPress', this.handleBack); 23 | } 24 | 25 | componentWillUnmount() { 26 | BackAndroid.removeEventListener('hardwareBackPress', this.handleBack); 27 | } 28 | 29 | _handleBack() { 30 | const navigator = this.props.navigator; 31 | if (navigator && navigator.getCurrentRoutes().length > 1) { 32 | navigator.pop() 33 | return true; 34 | } 35 | return false; 36 | } 37 | 38 | _signupCallback(){ 39 | this.props.navigator.push({ 40 | component: SignUpPage 41 | }); 42 | } 43 | 44 | _forgetPassword(){ 45 | 46 | } 47 | 48 | render(){ 49 | return( 50 | 51 | 52 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 70 | 71 | 72 | 73 | 78 | 79 | 80 |