-
Notifications
You must be signed in to change notification settings - Fork 0
/
androidhacker.js
196 lines (185 loc) · 5.62 KB
/
androidhacker.js
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
'use strict';
var React = require('react-native');
var {
StyleSheet,
View,
Text,
Component,
ListView,
ScrollView
} = React;
var headerSeparate = function(s) {
return s.split('*');
}
var more4 = React.createClass({
getInitialState: function() {
var ds = new ListView.DataSource({
rowHasChanged: (r1, r2) => r1 !== r2,
sectionHeaderHasChanged: (s1, s2) => s1 !== s2
}),
dataBlob = {
'Saturday, November 7*9:00-12:00 AM':[{'time':'10:00-10:00','name':'Check-In Begins', 'place':'FCIEMAS Floor 1 Schiciano Entrance'}, {'time':'11:00-12:00','name':'Lunch and Mingle', 'place':'FCIEMAS Floor 1 Schiciano Entrance'}],
'12:00-3:00 PM':[ {'time':'12:30-1:30','name':'Opening Ceremony', 'place':'Bryan Center, Reynolds Auditorium'},
{'time':'1:30-1:30','name':'Hacking Begins!', 'place':'FCIEMAS'},
{'time':'1:30-2:30','name':'Education Talks', 'place':'Floor 1 Schiciano Auditorium A'},
{'time':'1:30-2:30','name':'Inequality Talks', 'place':'Floor 1 Schiciano Auditorium B'},
{'time':'1:30-2:30','name':'Energy and Environment Talks', 'place':'Hudson Building 125'},
{'time':'1:30-2:30','name':'Health and Wellness Talks', 'place':'Teer Building 203'}],
'3:00-6:00 PM':[{'time':'4:00-4:00','name':'DiVE Tours Begin', 'place':'FCIEMAS Floor 1'}],
'6:00-9:00 PM':[{'time':'6:00-7:30','name':'Dinner and Talks', 'place':'FCIEMAS Floor 1 Schiciano Entrance'}, {'time':'6:30-6:30','name':'DiVE Tours End', 'place':'FCIEMAS Floor 1'}, {'time':'8:00-9:00','name':'Ladies Dessert Meetup', 'place':'FCIEMAS Floor 1 Schiciano Entrance'}],
'9:00-12:00 PM':[{'time':'10:00-11:00','name':'Cat Cookie Decoration', 'place':'Engineering Quad'}, {'time':'11:00-12:00','name':'Nerf Gun War', 'place':'FCIEMAS Basement'}],
'Sunday, November 8*12:00-12:00 AM':[{'time':'12:00-1:00','name':'Midnight Snack', 'place':'FCIEMAS Floor 1 Schiciano Entrance'}, {'time':'9:00-10:00','name':'Breakfast', 'place':'FCIEMAS Floor 1 Schiciano Entrance'}],
' 12:00-3:00 PM':[{'time':'12:00-12:00','name':'Hacking Ends!', 'place':'FCIEMAS'},{'time':'12:00-3:00','name':'Lunch', 'place':'FCIEMAS Floor 1 Schiciano Entrance'}, {'time':'12:30-1:30','name':'Hack Expo Part 1', 'place':'FCIEMAS'}, {'time':'2:00-3:00','name':'Hack Expo Part 2', 'place':'FCIEMAS'}],
' 3:00-6:00 PM':[{'time':'4:30-5:30','name':'Closing Ceremony', 'place':'Bryan Center, Reynolds Auditorium'}, {'time':'5:30-5:30','name':'Departure', 'place':'FCIEMAS'}],
};
return {
dataSource: ds.cloneWithRowsAndSections(
dataBlob)
};
},
render: function() {
return (
<ListView
dataSource={this.state.dataSource}
contentInset={{bottom: 50}}
automaticallyAdjustContentInsets={false}
renderRow={this.renderPostCell}
zoomScale={5}
renderSectionHeader={this.renderSectionHeader}
renderSeparator={this.renderSeparator}
style={styles.postsListView} />
)
},
renderSectionHeader: function(sectionData, sectionID) {
var s = headerSeparate(sectionID);
if (s.length == 1) {
return (
<View style={styles.section}>
<Text style={styles.sectionText}>{s[0]}</Text>
</View>
)
}
else {
return (
<View style={styles.section}>
<Text style={styles.dateText}>{s[0]}</Text>
<Text style={styles.dateSectionText}>{s[1]}</Text>
</View>
)
}
},
renderPostCell: function(rowData) {
return (
<View style={styles.horizontalContainer}>
<View style={styles.container}>
<Text style={styles.postTitle}>
{rowData.name}
</Text>
<Text style={styles.postDetailsLine}>
{rowData.place}
</Text>
</View>
<Text style={styles.timeFormat}>
{rowData.time}
</Text>
</View>
)
},
renderSeparator: function(sectionID: number, rowID: number){
return(
<View style={styles.separator}>
</View>
);
},
});
var styles = StyleSheet.create({
horizontalContainer:{
backgroundColor: '#FFFFFD',
flexDirection: 'row'
},
container: {
marginLeft: 7,
backgroundColor: '#FFFFFD',
flex: 1
},
postsListView:{
backgroundColor: '#FFFFFD',
},
section: {
alignItems: 'center',
backgroundColor: '#F0F0F0'
},
sectionText: {
fontSize: 20,
color: '#54728C',
fontWeight: 'bold'
},
votesContainer: {
alignItems: 'center',
backgroundColor: '#FFFFFD',
marginRight: 15
},
image: {
height: 48,
width: 48,
borderRadius: 25,
marginTop: 10,
alignSelf: 'center',
marginRight: 15,
marginLeft: 15
},
icon: {
alignSelf: 'center'
},
votes: {
textAlign: 'center',
fontSize: 15
},
postCount: {
fontSize: 20,
textAlign: 'right',
margin: 10,
color: 'gray',
marginLeft: 15,
},
postDetailsContainer:{
marginLeft: 20,
flex: 1,
},
postTitle: {
fontSize: 15,
textAlign: 'left',
marginTop: 10,
marginBottom: 4,
marginRight: 10,
color: '#54728C'
},
postDetailsLine: {
fontSize: 12,
marginBottom: 4,
color: 'gray',
},
timeFormat:{
fontSize:12,
marginTop: 20,
marginRight: 15,
color: 'gray',
},
separator: {
height: 0.5,
backgroundColor: '#CCCCCC',
},
dateText: {
fontSize: 20,
color: '#54728C',
marginTop: 5,
fontWeight: 'bold',
},
dateSectionText: {
fontSize: 20,
color: '#54728C',
fontWeight: 'bold',
paddingBottom: 5,
}
});
module.exports = more4;