forked from irlmobile/irlmobile
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.android.js
More file actions
157 lines (138 loc) · 3.7 KB
/
Copy pathindex.android.js
File metadata and controls
157 lines (138 loc) · 3.7 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
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
var React = require('react-native');
var Icon = require('react-native-vector-icons/FontAwesome');
var {vw, vh, vmin, vmax} = require('react-native-viewport-units');
var ScrollableTabView = require('react-native-scrollable-tab-view');
var LoginComponent = require('./components/LoginComponent.js');
var TabBarComponent = require('./components/TabBarComponent.js');
var MapComponent = require('./components/MapComponent.js');
var MenuBarComponent = require('./components/MenuBarComponent.js');
var ProfileComponent = require('./components/ProfileComponent.js');
var SearchComponent = require('./components/SearchComponent.js');
var FeedComponent = require('./components/FeedComponent.js');
var CreateEventComponent = require('./components/CreateEventComponent.js');
var RouteComponent = require('./components/RouteComponent.js');
var {
AppRegistry,
StyleSheet,
Text,
View,
Navigator,
TouchableOpacity,
Component
} = React;
var irlMobile = React.createClass({
configureScene: function (route, routeStack) {
return Navigator.SceneConfigs.FloatFromBottom;
},
render: function() {
return (
<View style={{ flex: 1}}>
<Navigator
configureScene={this.configureScene}
initialRoute={{component: 'RouteComponent'}}
renderScene={this.renderScene}
/>
</View>
);
},
renderScene: function(route, navigator) {
if(route.component === 'RouteComponent') {
return (
<RouteComponent navigator={navigator}/>
)
}
if(route.component === 'MapComponent') {
return (
<MapComponent navigator={navigator} />
)
}
if(route.component === 'CreateEventComponent') {
return (
<CreateEventComponent navigator={navigator} initLocation={route.passProps.initLocation}/>
)
}
}
});
var NavigationBarRouteMapper = {
LeftButton: function (route, navigator, index, navState) {
return (
<TouchableOpacity
style={{flex: 1, justifyContent: 'center'}}
>
<Text style={{color: 'white', margin: 10}}>
<Icon name="bars" size={20} color="white"/>
</Text>
</TouchableOpacity>
);
},
RightButton: function (route, navigator, index, navState) {
return (
<TouchableOpacity style={{flex: 1, justifyContent: 'center'}}
onPress={function () {navigator.push({
component: 'MapComponent',
passProps: {
name: 'name'
}
})}}>
<Text style={{color: 'white', margin: 10}}>
<Icon name="home" size={20} color="white"/>
</Text>
</TouchableOpacity>
);
},
Title: function (route, navigator, index, navState) {
return (
<TouchableOpacity style={{flex: 1, justifyContent: 'center'}}>
<Text style={{color: 'white', margin: 10, fontSize: 18}}>
asdfasdf
</Text>
</TouchableOpacity>
);
}
};
var styles = StyleSheet.create({
toolbar:{
backgroundColor:'#81c04d',
paddingTop:20,
paddingBottom:10,
flexDirection:'row',
height: 10 * vh,
},
toolbarButton:{
width: 50,
color:'#fff',
textAlign:'center'
},
toolbarTitle:{
color:'#fff',
textAlign:'center',
fontWeight:'bold',
flex:1
},
map: {
position: 'absolute',
top: 10 * vh,
left: 0,
right: 0,
bottom: 0,
height: 90 * vh,
},
menubar: {
width: 25 * vw,
height: 100 * vh,
backgroundColor: '#000000',
opacity: 0.5,
},
menubarText: {
textAlign:'center',
fontWeight:'bold',
marginTop: 10,
padding: 5,
color: '#fff',
opacity: 1,
},
containerWebView: {
flex: 1,
},
});
AppRegistry.registerComponent('irlMobile', () => irlMobile);