Skip to content

Commit 4d10fa8

Browse files
KenChoiKenChoi
authored andcommitted
fix demo bug
1 parent 019fc80 commit 4d10fa8

File tree

4 files changed

+25
-61
lines changed

4 files changed

+25
-61
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,3 +203,4 @@ typings/
203203
package-lock.json
204204
yarn.lock
205205
*.qshell
206+
*.DS_Store

example/App.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ export default class App extends Component {
450450
underlayColor='#0866d9'
451451
activeOpacity={0.5}
452452
style={styles.bigBtn}
453-
onPress={this.cleanTags}
453+
onPress={this.cleanAllTags}
454454
>
455455
<Text style={styles.bigTextStyle}>Clean Tags</Text>
456456
</TouchableHighlight>

example/android/gradle.properties

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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

example/second.js

Lines changed: 3 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -5,83 +5,26 @@ import JPushModule from 'jpush-react-native'
55
const { View, Text, TouchableHighlight, StyleSheet } = ReactNative
66

77
export default class Second extends React.Component {
8-
onBackPress = () => {
9-
if (!this.props.navigator) {
10-
this.props.navigator.pop()
11-
} else {
12-
console.log('finishing second activity')
13-
JPushModule.finishActivity()
14-
}
15-
}
168

17-
componentDidMount () {
9+
componentDidMount() {
10+
// Receive extra
1811
JPushModule.addReceiveExtrasListener(map => {
1912
console.log('Got extra, key: hello, value: ' + map.hello)
2013
})
2114
}
2215

23-
onButtonPress = () => {
24-
console.log('will jump to setting page')
25-
if (!this.props.navigator) {
26-
this.props.navigator.push({
27-
name: 'setActivity'
28-
})
29-
} else {
30-
}
31-
}
32-
33-
render () {
16+
render() {
3417
return (
3518
<View>
36-
<TouchableHighlight
37-
style={styles.backBtn}
38-
underlayColor='#e4083f'
39-
activeOpacity={0.5}
40-
onPress={this.onBackPress}
41-
>
42-
<Text>Back</Text>
43-
</TouchableHighlight>
4419
<Text style={styles.welcome}>Welcome !</Text>
45-
<TouchableHighlight
46-
underlayColor='#e4083f'
47-
activeOpacity={0.5}
48-
style={styles.btnStyle}
49-
onPress={this.onButtonPress}
50-
>
51-
<Text style={styles.btnTextStyle}>Jump To Setting page!</Text>
52-
</TouchableHighlight>
5320
</View>
5421
)
5522
}
5623
}
5724

5825
var styles = StyleSheet.create({
59-
backBtn: {
60-
padding: 10,
61-
marginTop: 10,
62-
marginLeft: 10,
63-
borderWidth: 1,
64-
borderColor: '#3e83d7',
65-
backgroundColor: '#3e83d7',
66-
borderRadius: 8,
67-
alignSelf: 'flex-start'
68-
},
6926
welcome: {
7027
textAlign: 'center',
7128
margin: 10
7229
},
73-
btnStyle: {
74-
marginTop: 10,
75-
borderWidth: 1,
76-
borderColor: '#3e83d7',
77-
borderRadius: 8,
78-
backgroundColor: '#3e83d7',
79-
alignSelf: 'center',
80-
justifyContent: 'center'
81-
},
82-
btnTextStyle: {
83-
textAlign: 'center',
84-
fontSize: 25,
85-
color: '#ffffff'
86-
}
8730
})

0 commit comments

Comments
 (0)