-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.android.js
More file actions
93 lines (86 loc) · 2.43 KB
/
index.android.js
File metadata and controls
93 lines (86 loc) · 2.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
/**
* Sample React Native App
* https://github.com/facebook/react-native
*/
import React, {
AppRegistry,
Component,
StyleSheet,
Text,
View,
ListView,
Image,
} from 'react-native';
var CQ5_URL = "https://www.horizon.tv/content/unified/NL/eng/android/settings.js";
var ReactProject = React.createClass({
componentDidMount() {
console.log("Start load CQ5");
this.loadCQ5();
},
loadCQ5() {
fetch(CQ5_URL)
.then((response) => {
console.log(response)
})
//.catch((error) => console.log(error))
.done();
},
getInitialState() {
var ds = new ListView.DataSource({ rowHasChanged: (r1, r2) => r1 !== r2 });
var data = [{ key: 'row 1', image: "http://icons.iconarchive.com/icons/designbolts/free-multimedia/1024/iMac-icon.png" }, { key: 'row 2', image: "http://icons.iconarchive.com/icons/paomedia/small-n-flat/1024/sign-check-icon.png" }];
return {
dataSource: ds.cloneWithRows(data),
};
},
render() {
return (
<View style={styles.container}>
<Text style={styles.welcome}>
Welcome to React Native!
</Text>
<Text style={styles.instructions}>
To get started, edit index.android.js
</Text>
<Text style={styles.instructions}>
Shake or press menu button for dev menu
</Text>
<ListView
dataSource={this.state["dataSource"]}
renderRow={this.renderRow}
/>
</View>
);
},
renderRow(rowData, sectionID, rowID, highlightRow) {
return (
<View>
<Image
style={styles.image}
source={{ uri: rowData.image }}/>
<Text>{rowData.key}</Text>
</View>
);
},
});
const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: 'center',
backgroundColor: '#F5FCFF',
},
welcome: {
fontSize: 20,
textAlign: 'center',
margin: 10,
},
instructions: {
textAlign: 'center',
color: '#333333',
marginBottom: 5,
},
image: {
width: 64,
height: 64,
}
});
AppRegistry.registerComponent('ReactProject', () => ReactProject);