|
@@ -1,57 +1,25 @@
|
1
|
1
|
import { StatusBar } from 'expo-status-bar';
|
2
|
2
|
import React from 'react';
|
3
|
|
-import { View, Image, StyleSheet, Text, Button } from 'react-native';
|
|
3
|
+import { View, Image, StyleSheet, Text, Button, ScrollView } from 'react-native';
|
|
4
|
+import data from './transfer.json'
|
4
|
5
|
|
5
|
6
|
|
6
|
|
-const handlePress = () => false
|
7
|
|
-
|
8
|
|
-export default class App extends React.Component {
|
9
|
|
-
|
10
|
|
- render() {
|
11
|
|
- return (
|
12
|
|
- <View>
|
13
|
|
- <View style = {styles.buttons}>
|
14
|
|
- <Button
|
15
|
|
- onPress = {handlePress}
|
16
|
|
- title = "Button1"
|
17
|
|
- color = "blue"
|
18
|
|
- />
|
19
|
|
-
|
20
|
|
- <Button
|
21
|
|
- onPress = {handlePress}
|
22
|
|
- title = "Button2"
|
23
|
|
- color = "black"
|
24
|
|
- />
|
25
|
|
- </View>
|
26
|
|
- <View style = {styles.container}>
|
27
|
|
-
|
28
|
|
-
|
29
|
|
- <Text style={styles.intro}>WELCOME!!!!</Text>
|
30
|
|
-
|
31
|
|
- <Text style={styles.sub}>オレノウタヲキケ!</Text>
|
32
|
|
-
|
33
|
|
- <Image source={require('./testimg.gif')} />
|
34
|
|
-
|
35
|
|
- </View>
|
36
|
|
- </View>
|
37
|
|
- );
|
38
|
|
- }
|
39
|
|
-}
|
40
|
|
-
|
41
|
7
|
|
|
8
|
+//change this to an external css file later
|
42
|
9
|
const styles = StyleSheet.create({
|
43
|
10
|
|
44
|
11
|
buttons: {
|
45
|
12
|
flexDirection: 'row',
|
46
|
|
- justifyContent: 'center'
|
|
13
|
+ justifyContent: 'center',
|
|
14
|
+ marginTop: 30
|
47
|
15
|
},
|
48
|
16
|
container: {
|
49
|
17
|
flexDirection: 'column',
|
50
|
18
|
justifyContent: 'center',
|
51
|
|
- backgroundColor: '#36413E',
|
|
19
|
+ backgroundColor: 'black',
|
52
|
20
|
alignItems: 'center',
|
53
|
21
|
justifyContent: 'center',
|
54
|
|
- marginTop: 100
|
|
22
|
+ marginTop: 20
|
55
|
23
|
},
|
56
|
24
|
intro: {
|
57
|
25
|
fontWeight: "bold",
|
|
@@ -63,4 +31,89 @@ const styles = StyleSheet.create({
|
63
|
31
|
color:"#D7D6D6",
|
64
|
32
|
fontSize: 20,
|
65
|
33
|
},
|
|
34
|
+ scrollView:{
|
|
35
|
+ marginHorizontal: 20
|
|
36
|
+ }
|
66
|
37
|
});
|
|
38
|
+
|
|
39
|
+//default button press
|
|
40
|
+
|
|
41
|
+const handlePress = () => false
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+//data parsing goes here
|
|
45
|
+
|
|
46
|
+function importJSON() {
|
|
47
|
+ var stuff = JSON.stringify(data)
|
|
48
|
+ return stuff
|
|
49
|
+}
|
|
50
|
+
|
|
51
|
+//states
|
|
52
|
+
|
|
53
|
+let states = {
|
|
54
|
+ welcome:
|
|
55
|
+
|
|
56
|
+ <View style = {styles.container}>
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+ <Text style={styles.intro}>WELCOME!!!!</Text>
|
|
60
|
+
|
|
61
|
+ <Text style={styles.sub}>オレノウタヲキケ!</Text>
|
|
62
|
+
|
|
63
|
+ <Image source={require('./testimg.gif')} />
|
|
64
|
+
|
|
65
|
+ </View>,
|
|
66
|
+
|
|
67
|
+ dataView:
|
|
68
|
+
|
|
69
|
+ <ScrollView style={styles.scrollView}>
|
|
70
|
+ <View style = {styles.container}>
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+ <Text style={styles.intro}>DATADATADATADATADATA</Text>
|
|
74
|
+
|
|
75
|
+ <Text style={styles.sub}>{importJSON()}</Text>
|
|
76
|
+
|
|
77
|
+ <Image source={require('./testimg.gif')} />
|
|
78
|
+
|
|
79
|
+ </View>
|
|
80
|
+ </ScrollView>
|
|
81
|
+ }
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+class App extends React.Component {
|
|
86
|
+
|
|
87
|
+//current state
|
|
88
|
+state = {current: states.welcome}
|
|
89
|
+
|
|
90
|
+//state changing functions
|
|
91
|
+setHome = () => this.setState({ current: states.welcome })
|
|
92
|
+setData = () => this.setState({ current: states.dataView })
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+ //render app
|
|
96
|
+ render() {
|
|
97
|
+ return (
|
|
98
|
+ <View>
|
|
99
|
+ <View style = {styles.buttons}>
|
|
100
|
+ <Button
|
|
101
|
+ onPress = {this.setHome}
|
|
102
|
+ title = "Button1"
|
|
103
|
+ color = "blue"
|
|
104
|
+ />
|
|
105
|
+
|
|
106
|
+ <Button
|
|
107
|
+ onPress = {this.setData}
|
|
108
|
+ title = "Button2"
|
|
109
|
+ color = "black"
|
|
110
|
+ />
|
|
111
|
+ </View>
|
|
112
|
+ {this.state.current}
|
|
113
|
+ </View>
|
|
114
|
+ );
|
|
115
|
+ }
|
|
116
|
+}
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+export default App
|