-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
110 lines (97 loc) · 2.17 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
import React, { useState } from "react";
import {
StyleSheet,
Text,
View,
SafeAreaView,
Image,
TouchableNativeFeedback,
TouchableOpacity,
TouchableWithoutFeedback,
TouchableHighlight,
Button,
Alert,
Platform,
StatusBar,
Dimensions,
TextInput,
} from "react-native";
import {
useDimensions,
useDeviceOrientation,
} from "@react-native-community/hooks";
import WelcomeScreen from "./app/screens/WelcomeScreen";
import ViewImageScreen from "./app/screens/ViewImageScreen";
import rns from "./app/screens/rns";
import SnapchatLoginScreen from "./app/screens/SnapchatLoginScreen";
import RNSpeedometer from "react-native-speedometer";
export default function App() {
const [count, setCount] = useState(0);
const [value,setValue] = useState(0);
function onChange(value){
if(value){
setValue(parseInt(value));
}else{
setValue(0);
}
}
const { landscape } = useDeviceOrientation();
console.log(landscape);
const onPress = () => {
setCount(count + 1);
};
console.log(useDimensions());
function handlepress() {
alert("Hello from function!");
}
return (
// <WelcomeScreen />
// <ViewImageScreen />
// <SnapchatLoginScreen />
<SafeAreaView style={styles.container}>
<TextInput
placeholder="Speedometer Value"
style={styles.textInput}
onChangeText={onChange}
/>
<RNSpeedometer style={styles.speedometer} value={value} size={350} />
</SafeAreaView>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: "white",
alignItems: "center",
color:'white',
justifyContent: 'flex-end',
marginVertical:100
},
text: {
color: Platform.OS === "android" ? "red" : "green",
fontSize: 30,
fontWeight: "900",
padding: "5%",
},
image: {
// height: StatusBar.currentHeight,
margin: "5%",
height: 500,
alignItems: "center",
justifyContent: "center",
},
container2: {
flex: 1,
},
textInput: {
borderBottomWidth: 1,
borderBottomColor: "black",
height: 50,
fontSize: 25,
marginVertical: 50,
marginHorizontal: 20,
},
speedometer:{
marginVertical:150
}
});