-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
99 lines (76 loc) · 1.89 KB
/
App.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
import React, { Component } from 'react';
import { Row, Grid } from "react-native-easy-grid";
import ProgressBar from 'react-native-progress-bar';
import Content from './Content';
import MainMenu from './MainMenu';
import KeepAwake from 'react-native-keep-awake';
import {observer} from 'mobx-react';
import {Store} from './store.js';
import {
BackHandler,
Text,ScrollView
} from 'react-native';
import {controller} from './controller.js';
import Settings from './Settings';
@observer
export default class App extends Component {
constructor(props) {
super(props);
this.handleBackButtonClick = this.handleBackButtonClick.bind(this);
KeepAwake.activate();
}
componentWillMount() {
BackHandler.addEventListener('hardwareBackPress', this.handleBackButtonClick);
}
componentWillUnmount() {
BackHandler.removeEventListener('hardwareBackPress', this.handleBackButtonClick);
}
handleBackButtonClick() {
if(Store.change!=0)
{ Store.change=0;
return true;}
return false;
}
render() {
let navi, bottom,progress,test;
if(!Store.hide)
{progress=(<Row size={4}>
<ProgressBar
fillStyle={{backgroundColor: '#5d9133'}}
backgroundStyle={{backgroundColor: '#5d9133', borderRadius: 2}}
style={{margin: 10, flex: 1}}
progress={Store.progress}
/>
</Row> );
}
if(Store.change==0)
{
navi=<MainMenu/>;
}
else if(Store.change==1 || Store.change==2 || Store.change==3|| Store.change==4 )
{
navi=<Content/>;
}
else if(Store.change==5)
{
navi=<Settings/>;
}
//test için
if(Store.test!="" && Store.test!=null)
{
test= <Row size={20} style={{backgroundColor: '#FFFFFF'}} >
<ScrollView><Text>{Store.test}</Text></ScrollView>
</Row>;
}
return (
<Grid style={{backgroundColor: '#393938'}} >
<KeepAwake />
{test}
{progress}
<Row size={96}>
{navi}
</Row>
</Grid>
);
}
}