Skip to content

Commit 0b04646

Browse files
committed
version 3.5.0
1 parent 5d4fe44 commit 0b04646

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+844
-172
lines changed

.flowconfig

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
# Ignore unexpected extra @providesModule
1919
.*/node_modules/commoner/test/source/widget/share.js
20+
.*/node_modules/.*/node_modules/fbjs/.*
2021

2122
# Ignore duplicate module providers
2223
# For RN Apps installed via npm, "Libraries" folder is inside node_modules/react-native but in the source repo it is in the root
@@ -48,11 +49,11 @@ suppress_type=$FlowIssue
4849
suppress_type=$FlowFixMe
4950
suppress_type=$FixMe
5051

51-
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(3[0-2]\\|[1-2][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
52-
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(3[0-2]\\|1[0-9]\\|[1-2][0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
52+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(3[0-3]\\|[1-2][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
53+
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(3[0-3]\\|1[0-9]\\|[1-2][0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
5354
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
5455

5556
unsafe.enable_getters_and_setters=true
5657

5758
[version]
58-
^0.32.0
59+
^0.33.0

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,5 @@ buck-out/
4040
\.buckd/
4141
android/app/libs
4242
android/keystores/debug.keystore
43-
source/config/index.js
43+
android/gradle.properties
44+
source/config/index.bak.js

android/app/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ android {
9090
applicationId "com.reactnativecnblogs"
9191
minSdkVersion 16
9292
targetSdkVersion 22
93-
versionCode 4
94-
versionName "3.3.0"
93+
versionCode 350
94+
versionName "3.5.0"
9595
ndk {
9696
abiFilters "armeabi-v7a", "x86"
9797
}
@@ -152,6 +152,6 @@ dependencies {
152152
// Run this once to be able to run the application with BUCK
153153
// puts all compile dependencies into folder libs for BUCK to use
154154
task copyDownloadableDepsToLibs(type: Copy) {
155-
from configurations.compile
156-
into 'libs'
155+
from configurations.compile
156+
into 'libs'
157157
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<resources>
2-
<string name="app_name">博客圆</string>
2+
<string name="app_name">博客苑</string>
33
</resources>

android/app/src/main/java/com/reactnativecnblogs/MainApplication.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import com.facebook.react.ReactNativeHost;
99
import com.facebook.react.ReactPackage;
1010
import com.facebook.react.shell.MainReactPackage;
11-
11+
import com.facebook.soloader.SoLoader;
1212
import com.oblador.vectoricons.VectorIconsPackage;
1313
import com.microsoft.codepush.react.CodePush;
1414
import com.remobile.toast.RCTToastPackage;
@@ -42,6 +42,12 @@ protected List<ReactPackage> getPackages() {
4242

4343
@Override
4444
public ReactNativeHost getReactNativeHost() {
45-
return mReactNativeHost;
45+
return mReactNativeHost;
46+
}
47+
48+
@Override
49+
public void onCreate() {
50+
super.onCreate();
51+
SoLoader.init(this, /* native exopackage */ false);
4652
}
4753
}

ios/reactNativeCnblogs/Info.plist

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,5 +52,19 @@
5252
</array>
5353
<key>UIViewControllerBasedStatusBarAppearance</key>
5454
<false/>
55+
<key>NSLocationWhenInUseUsageDescription</key>
56+
<string></string>
57+
<key>NSAppTransportSecurity</key>
58+
<!--See http://ste.vn/2015/06/10/configuring-app-transport-security-ios-9-osx-10-11/ -->
59+
<dict>
60+
<key>NSExceptionDomains</key>
61+
<dict>
62+
<key>localhost</key>
63+
<dict>
64+
<key>NSExceptionAllowsInsecureHTTPLoads</key>
65+
<true/>
66+
</dict>
67+
</dict>
68+
</dict>
5569
</dict>
5670
</plist>

package.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "reactNativeCnblogs",
3-
"version": "3.3.0",
3+
"version": "3.5.0",
44
"author": {
55
"name": "togayther",
66
"email": "[email protected]"
@@ -35,24 +35,24 @@
3535
"dependencies": {
3636
"@remobile/react-native-toast": "^1.0.5",
3737
"entities": "^1.1.1",
38-
"flux-standard-action": "^0.6.1",
39-
"lodash": "^4.13.1",
40-
"moment": "^2.13.0",
41-
"react": "^15.3.1",
42-
"react-addons-pure-render-mixin": "^15.2.0",
43-
"react-native": "^0.34.0",
44-
"react-native-action-button": "^2.0.3",
45-
"react-native-animatable": "^0.6.1",
46-
"react-native-code-push": "^1.13.5-beta",
38+
"flux-standard-action": "^1.0.0",
39+
"lodash": "^4.17.2",
40+
"moment": "^2.17.1",
41+
"react": "^15.4.1",
42+
"react-addons-pure-render-mixin": "^15.4.1",
43+
"react-native": "^0.38.1",
44+
"react-native-action-button": "^2.0.16",
45+
"react-native-animatable": "^1.1.0",
46+
"react-native-code-push": "^1.16.1-beta",
4747
"react-native-drawer": "^2.3.0",
4848
"react-native-html-converter": "^1.0.4",
4949
"react-native-parallax-scroll-view": "^0.19.0",
50-
"react-native-scrollable-tab-view": "^0.5.1",
51-
"react-native-vector-icons": "^2.0.3",
50+
"react-native-scrollable-tab-view": "^0.7.0",
51+
"react-native-vector-icons": "^3.0.0",
5252
"react-redux": "^4.4.5",
5353
"react-timer-mixin": "^0.13.3",
54-
"redux": "^3.5.2",
55-
"redux-actions": "^0.10.0",
54+
"redux": "^3.6.0",
55+
"redux-actions": "^1.1.0",
5656
"redux-thunk": "^2.1.0"
5757
}
5858
}

source/action/config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,3 @@ export const getConfig = createAction(types.GET_CONFIG, async({key})=> {
3131
rejected
3232
}
3333
});
34-

source/action/update.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { createAction } from 'redux-actions';
2+
import * as types from '../constant/actiontype';
3+
import * as updateService from '../service/updateService';
4+
5+
export const getUpdateInfo = createAction(
6+
types.FETCH_UPDATE_INFO,
7+
async(version)=> {
8+
return await updateService.getUpdateInfo(version);
9+
}
10+
)

source/component/button/home.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ class HomeButton extends Component {
5151
buttonColor = { item.color }
5252
style = { styles.button_item }
5353
titleColor = { StyleConfig.color_white }
54+
textContainerStyle = {{ borderWidth:0 }}
5455
titleBgColor = { item.color }>
5556
<Icon name={ item.icon } style={ ComponentStyles.button_icon } />
5657
</ActionButton.Item>
@@ -72,6 +73,7 @@ class HomeButton extends Component {
7273
bgColor = { StyleConfig.action_background_color }
7374
btnOutRange = { StyleConfig.action_color_danger_active }
7475
buttonColor = { StyleConfig.action_color_danger }
76+
hideShadow = { true }
7577
icon = { this.renderButtonIcon() }>
7678
{
7779
buttons && buttons.map((button, index)=>{

source/component/button/post.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ class PostButton extends Component {
5252
buttonColor = { item.color }
5353
titleBgColor = { item.color }
5454
titleColor = { StyleConfig.color_white }
55+
textContainerStyle = {{ borderWidth:0 }}
5556
onPress={() => this.onButtonPress(item) }>
5657
<Icon name={ item.icon } style={ ComponentStyles.button_icon } />
5758
</ActionButton.Item>
@@ -73,6 +74,7 @@ class PostButton extends Component {
7374
bgColor = { StyleConfig.action_background_color }
7475
btnOutRange = { StyleConfig.action_color_danger_active }
7576
buttonColor = { StyleConfig.action_color_danger }
77+
hideShadow = { true }
7678
icon = { this.renderButtonIcon() }>
7779
{
7880
buttons && buttons.map((button, index)=>{

source/component/button/search.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ class SearchButton extends Component {
4646
style = { styles.button_item }
4747
buttonColor = { item.color }
4848
titleBgColor = { item.color }
49+
textContainerStyle = {{ borderWidth:0 }}
4950
titleColor = { StyleConfig.color_white }
5051
onPress={() => this.onButtonPress(item) }>
5152
<Icon name={ item.icon } style={ ComponentStyles.button_icon } />
@@ -68,6 +69,7 @@ class SearchButton extends Component {
6869
bgColor = { StyleConfig.action_background_color }
6970
btnOutRange = { StyleConfig.action_color_danger_active }
7071
buttonColor = { StyleConfig.action_color_danger }
72+
hideShadow = { true }
7173
icon = { this.renderButtonIcon() }>
7274
{
7375
buttons && buttons.map((button, index)=>{

source/component/button/single.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ class SingleButton extends Component {
3636
position={ position }
3737
buttonColor = { color }
3838
onPress = { ()=>onPress() }
39+
hideShadow = { true }
3940
icon = { this.renderButtonIcon() }>
4041
</ActionButton>
4142
)

source/component/htmlConvertor.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,21 @@ import ImageBox from './imageBox';
1515

1616
const defaultImageMaxWidth = StyleConfig.screen_width - StyleConfig.space_3 * 2;
1717

18-
class HtmlRender extends Component {
18+
class HtmlConvertor extends Component {
1919

2020
constructor(props) {
2121
super(props);
2222
this.shouldComponentUpdate = PureRenderMixin.shouldComponentUpdate.bind(this);
2323
}
2424

2525
onLinkPress(url) {
26-
openLink(url);
26+
const { router } = this.props;
27+
if(url && router){
28+
router.push(ViewPage.web(), {
29+
title: url,
30+
url: url
31+
});
32+
}
2733
}
2834

2935
renderCodeBlock(codeText) {
@@ -74,14 +80,10 @@ class HtmlRender extends Component {
7480
const { imgDisabled } = this.props;
7581

7682
if(node.type == 'tag'){
77-
//note: 解析图片
7883
if(node.name == "img" && node.attribs && node.attribs.src){
79-
8084
const imageUri = node.attribs.src;
81-
8285
// 1,禁用图片加载
8386
// 2,每篇博文尾部会附加:<img src="http://counter.cnblogs.com//blog/post/5876249" width="1" height="1" style="border:0px;visibility:hidden"/>
84-
// 不渲染图片
8587
if(imgDisabled === true || imageUri.indexOf("counter.cnblogs.com") > 0){
8688
return undefined;
8789
}
@@ -108,7 +110,6 @@ class HtmlRender extends Component {
108110
node.name == "pre" ||
109111
(node.name == "div" && node.attribs && node.attribs.class && node.attribs.class=="cnblogs_code")){
110112

111-
//不解析code snippet
112113
if(this.props.renderCode === false){
113114
return undefined;
114115
}
@@ -140,7 +141,6 @@ class HtmlRender extends Component {
140141
}
141142
}
142143

143-
144144
render() {
145145
return (
146146
<HTMLView
@@ -154,4 +154,4 @@ class HtmlRender extends Component {
154154
}
155155
}
156156

157-
export default HtmlRender;
157+
export default HtmlConvertor;

source/component/messager.js

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import React, { Component } from 'react';
2+
import {
3+
View
4+
} from 'react-native';
5+
import { bindActionCreators } from 'redux';
6+
import { connect } from 'react-redux';
7+
import { CommonStyles, StyleConfig } from '../style';
8+
import Toast from '@remobile/react-native-toast';
9+
import PureRenderMixin from 'react-addons-pure-render-mixin';
10+
11+
class Messager extends Component {
12+
13+
constructor(props) {
14+
super(props);
15+
this.shouldComponentUpdate = PureRenderMixin.shouldComponentUpdate.bind(this);
16+
}
17+
18+
componentWillReceiveProps(nextProps, nextStates) {
19+
if (this.props.common.message.id !== nextProps.common.message.id) {
20+
const message = nextProps.common.message.text;
21+
if (message && typeof message === "string") {
22+
Toast.show(message);
23+
}
24+
}
25+
}
26+
27+
render() {
28+
return null;
29+
}
30+
}
31+
32+
export default connect(state => ({
33+
common : state.common
34+
}), dispatch => ({
35+
}), null, {
36+
withRef: true
37+
})(Messager);
38+
39+
40+
41+

source/component/navigation.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,13 @@ class Navigation extends Component {
5050
render() {
5151
return (
5252
<View style={ ComponentStyles.container }>
53-
<Plugin />
5453
<Navigator
5554
initialRoute={ defaultRoute }
5655
configureScene={ this.configureScene.bind(this) }
5756
renderScene={ this.renderScene.bind(this) }
5857
onDidFocus={ this.onDidFocus.bind(this) }/>
58+
59+
<Plugin router={ this.router }/>
5960
</View>
6061
)
6162
}

source/component/panel.js

Lines changed: 31 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -38,29 +38,39 @@ class Panel extends Component {
3838
}
3939
}
4040

41-
render() {
42-
43-
const { onPress = (()=>null) } = this.props;
41+
renderTail(){
42+
if(this.props.tailControl){
43+
return (
44+
<View style={[ CommonStyles.flexItemsMiddle, CommonStyles.flexItemsRight ]}>
45+
{ this.props.tailControl }
46+
</View>
47+
)
48+
}
49+
}
4450

51+
renderContent(){
4552
return (
46-
<TouchableHighlight
47-
onPress={()=> onPress() }
48-
underlayColor ={ StyleConfig.touchable_press_color }>
49-
<View style = {[ComponentStyles.list, CommonStyles.flexRow, CommonStyles.flexItemsMiddle, CommonStyles.flexItemsBetween]}>
50-
<View style={[ CommonStyles.flexColumn, CommonStyles.flex_4 ]}>
51-
{ this.renderTitle() }
52-
{ this.renderDescr() }
53-
</View>
54-
{
55-
this.props.tailControl?
56-
<View style={[ CommonStyles.flexItemsMiddle, CommonStyles.flex_1 ]}>
57-
{ this.props.tailControl }
58-
</View>
59-
: null
60-
}
61-
</View>
62-
</TouchableHighlight>
63-
);
53+
<View style = {[ComponentStyles.list, CommonStyles.flexRow, CommonStyles.flexItemsMiddle, CommonStyles.flexItemsBetween]}>
54+
<View style={[ CommonStyles.flexColumn, CommonStyles.flex_4 ]}>
55+
{ this.renderTitle() }
56+
{ this.renderDescr() }
57+
</View>
58+
{ this.renderTail() }
59+
</View>
60+
)
61+
}
62+
63+
render() {
64+
if(this.props.onPress){
65+
return (
66+
<TouchableHighlight
67+
onPress={()=> this.props.onPress() }
68+
underlayColor ={ StyleConfig.touchable_press_color }>
69+
{ this.renderContent() }
70+
</TouchableHighlight>
71+
)
72+
}
73+
return this.renderContent();
6474
}
6575
}
6676

0 commit comments

Comments
 (0)