diff options
| author | Maksymilian Jopek <maks@jopek.eu> | 2022-03-03 22:57:17 +0100 |
|---|---|---|
| committer | Maksymilian Jopek <maks@jopek.eu> | 2022-03-03 22:57:17 +0100 |
| commit | 5cf454c6800d6bfe26e08c6b4393b82bff442b4d (patch) | |
| tree | 55ad9e2bfdfa35e2665451ed9f3b370e7d6d6a70 /components/Home.js | |
| download | aparatus-5cf454c6800d6bfe26e08c6b4393b82bff442b4d.tar.gz aparatus-5cf454c6800d6bfe26e08c6b4393b82bff442b4d.tar.zst aparatus-5cf454c6800d6bfe26e08c6b4393b82bff442b4d.zip | |
Initial commit - v1.0.0
Diffstat (limited to 'components/Home.js')
| -rw-r--r-- | components/Home.js | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/components/Home.js b/components/Home.js new file mode 100644 index 0000000..fb857c5 --- /dev/null +++ b/components/Home.js @@ -0,0 +1,60 @@ +import * as React from 'react'; +import { View, Text, StyleSheet, TouchableOpacity } from 'react-native'; +import * as MediaLibrary from "expo-media-library"; +import * as ECamera from "expo-camera"; + +export default class Home extends React.Component { + constructor(props) { + super(props) + this.state = {} + } + + async componentDidMount() { + const { status } = await MediaLibrary.requestPermissionsAsync(); + if (status !== 'granted') { + alert('brak uprawnień do czytania image-ów z galerii') + } + const status2 = (await ECamera.requestCameraPermissionsAsync()).status; + console.log(status2) + if (status2 !== 'granted') { + alert('brak uprawnień do wykonywania zdjec') + } + } + + render() { + return ( + <View style={styles.cont}> + <TouchableOpacity style={styles.btn} onPress={() => this.props.navigation.navigate("gallery")}><Text style={styles.h1}>CAMERA{"\n"}SETTINGS App</Text></TouchableOpacity> + <Text style={styles.span}>Change camera white balance</Text> + <Text style={styles.span}>Change camera flash mode</Text> + <Text style={styles.span}>Change camera picture size</Text> + <Text style={styles.span}>Change camera camera ratio</Text> + </View> + ) + } +} + +const styles = StyleSheet.create({ + cont: { + flexDirection: "column", + marginTop: 10, + paddingTop: 10, + backgroundColor: "#EB1F63", + justifyContent: "center", + alignItems: "center", + height: "100%", + }, + btn: { + margin: 10, + }, + h1: { + color: "white", + fontSize: 55, + fontWeight: "bold", + textAlign: "center", + }, + span: { + color: "white", + fontSize: 22, + } +}) |
