-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathExerciseScreen.js
194 lines (118 loc) · 4.8 KB
/
ExerciseScreen.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
import {
SafeAreaView,
Platform,
StyleSheet,
ScrollView,
View,
Text,
StatusBar,
Alert,
TouchableOpacity,
TextInput,
Image,
ImageBackground,
Linking,
FlatList,
Dimensions,
AsyncStorage,
} from 'react-native';
import Loader from './Loader.js';
import React, {Component} from 'react';
import Button from 'react-native-button';
const GLOBAL = require('./Global');
import { WebView } from 'react-native-webview';
import { SafeAreaProvider } from 'react-native-safe-area-context';
import { PulseIndicator } from 'react-native-indicators';
import VideoPlayer from 'react-native-video-controls';
class ExerciseScreen extends React.Component {
constructor(props) {
super(props);
this.state={
loading:'',
}
}
componentDidMount () {
// alert(JSON.stringify(GLOBAL.worklevel))
}
render() {
if(this.state.loading){
return(
<Loader>
</Loader>
)
}
var str = GLOBAL.worklevel
var res = str.split(",");
const renderedButtons = res.map((b, index) => {
return <View style={{width:92,height:28,borderRadius:3,backgroundColor:'#161718',justifyContent:'center',marginLeft:12}}>
<Text style={{fontSize: 12, color: 'white',fontFamily:'Gilroy-Bold',alignSelf:'center'}}>{b}</Text>
</View>
})
var str2 = GLOBAL.workgrp
var news = str2.split(",");
const renderedButton1 = news.map((a, index) => {
return <View style={{width:92,height:28,borderRadius:3,backgroundColor:'#161718',justifyContent:'center',marginLeft:12}}>
<Text style={{fontSize: 12, color: 'white',fontFamily:'Gilroy-Bold',alignSelf:'center'}}>{a}</Text>
</View>
})
var str3 = GLOBAL.workequip
var weigh = str3.split(",");
const renderedButton2 = weigh.map((c, index) => {
return <View style={{width:128,height:28,borderRadius:3,backgroundColor:'#161718',justifyContent:'center',marginLeft:12}}>
<Text style={{fontSize: 12, color: 'white',fontFamily:'Gilroy-Bold',alignSelf:'center'}}>{c}</Text>
</View>
})
return(
<SafeAreaProvider>
<StatusBar backgroundColor="black" barStyle="light-content" />
<ScrollView style={{flex:1,backgroundColor:'white'}}>
<View style={{width:'100%',height:Dimensions.get('window').height/2-20,resizeMode:'contain'}}>
<VideoPlayer
source={{ uri: GLOBAL.workvideo }}
navigator={ this.props.navigator }
repeat
onBack={()=>this.props.navigation.goBack()}
/>
</View>
<Text style={{fontSize:22,fontFamily:'Gilroy-Bold',color:'#000000',marginTop:12,marginLeft:'5%',width:'90%'}}>{GLOBAL.workname2}</Text>
<Text style={{fontSize:14,fontFamily:'Gilroy-Bold',color:'#00000066',marginTop:5,marginLeft:'5%',width:'90%'}}>{GLOBAL.worktime}</Text>
<Text style={{fontSize:20,fontFamily:'Exo2-Medium',color:'#0000004D',marginTop:15,marginLeft:'5%'}}>Level</Text>
<View style={{flexDirection:'row',alignItems:'center',width:'80%',marginTop:12,marginLeft:7}}>
{renderedButtons}
</View>
<Text style={{fontSize:20,fontFamily:'Exo2-Medium',color:'#0000004D',marginTop:15,marginLeft:'5%'}}>Muscle groups</Text>
<View style={{flexDirection:'row',alignItems:'center',width:'90%',marginTop:12,marginLeft:7}}>
{renderedButton1}
</View>
<Text style={{fontSize:20,fontFamily:'Exo2-Medium',color:'#0000004D',marginTop:15,marginLeft:'5%'}}>Equipment Required</Text>
<View style={{flexDirection:'row',alignItems:'center',width:'90%',marginTop:12,marginLeft:7}}>
{renderedButton2}
</View>
</ScrollView>
</SafeAreaProvider>
);
}
}
export default ExerciseScreen;
const styles = StyleSheet.create({
container: {
flex:1,
backgroundColor :'white',
},
containers: {
backgroundColor :'white'
},
AndroidSafeArea: {
flex: 0,
backgroundColor:'black',
paddingTop: Platform.OS === "android" ? 0 : 0
},
loading: {
position: 'absolute',
left: window.width/2 - 30,
top: window.height/2,
opacity: 0.5,
justifyContent: 'center',
alignItems: 'center'
},
})