-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.tsx
73 lines (69 loc) · 1.6 KB
/
App.tsx
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
import React, { useState, useEffect } from "react";
import { StatusBar } from "expo-status-bar";
import {
StyleSheet,
Text,
View,
Dimensions,
TouchableOpacity,
} from "react-native";
import { Video, ResizeMode } from "expo-av";
export default function App() {
const [height, setHeight] = useState<number>(0);
const [width, setWidth] = useState<number>(0);
useEffect(() => {
//handler to get device Height
setHeight(Dimensions.get("window").height);
//handler to get device Width
setWidth(Dimensions.get("window").width);
}, []);
return (
<View>
<StatusBar style="auto" />
<Video
source={require("./assets/video/stock-scrolling.mp4")}
style={{
height: height,
width: width,
}}
isMuted={true}
isLooping={true}
resizeMode={ResizeMode.COVER}
rate={1.0}
shouldPlay={true}
/>
<View style={styles.buttonContainer}>
<TouchableOpacity style={styles.button}>
<Text style={styles.buttonText}>Start using the app</Text>
</TouchableOpacity>
</View>
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: "#fff",
alignItems: "center",
justifyContent: "center",
},
buttonContainer: {
position: 'absolute',
bottom: 30,
left: 20,
right: 20,
},
button: {
width: '100%',
padding: 15,
backgroundColor: "#176B87",
alignItems: "center",
justifyContent: "center",
borderRadius: 25,
},
buttonText: {
color: "#fff",
fontSize: 18,
fontWeight: 'bold',
},
});