initial commit taken from gitlab.lrz.de

This commit is contained in:
privatereese
2018-08-24 18:09:42 +02:00
parent ae54ed4c48
commit fc05486403
28494 changed files with 2159823 additions and 0 deletions

View File

@@ -0,0 +1,39 @@
import React, { Component } from 'react';
import { Text } from 'react-native';
import styles from './../style';
import { YellowBox } from 'react-native';
YellowBox.ignoreWarnings(['Warning: Each child in an array or iterator should have a unique "key" prop.']); //Silence Warning
export default class NodeInformation extends Component {
constructor(props) {
super(props);
};
render() {
var dataATT = this.props.dataATT;
var ready = false;
// console.log('Child-Component Lat' , dataATT[0]);
var hn = 'praxis-dr-tschoep';
for (var k in dataATT) {
if (dataATT.hasOwnProperty(k)) {
if (dataATT[k].nodeinfo.hostname === hn) {
ready = true;
}
}
};
textAnzeigen = () => {
if(ready === false) {
return 'Loading..';
}
else {
return 'Ready';
}
}
return ([
<Text style={{ paddingBottom: 10 }}>{textAnzeigen()}</Text>
]);
}
}

View File

@@ -0,0 +1,71 @@
import React, { Component } from 'react'
import { View, Text, Switch, StyleSheet } from 'react-native'
import { PermissionsAndroid } from 'react-native';
class SwichExample extends Component {
constructor(props) {
super(props);
this.state = {
latitude: null,
longitude: null,
error: null,
};
}
async requestLocationPermission() {
const chckLocationPermission = PermissionsAndroid.check(PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION);
if (chckLocationPermission === PermissionsAndroid.RESULTS.GRANTED) {
alert("You've access for the location");
} else {
try {
const granted = await PermissionsAndroid.request(PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION,
{
'title': 'Cool Location App required Location permission',
'message': 'We required Location permission in order to get device location ' +
'Please grant us.'
}
)
if (granted === PermissionsAndroid.RESULTS.GRANTED) {
alert("You've access for the location");
} else {
alert("You don't have access for the location");
}
} catch (err) {
alert(err)
}
}
};
componentDidMount() {
navigator.geolocation.getCurrentPosition(
(position) => {
this.setState({
latitude: position.coords.latitude,
longitude: position.coords.longitude,
error: null,
});
},
(error) => this.setState({ error: error.message }),
{ enableHighAccuracy: false, timeout: 20000, maximumAge: 1000 },
);
}
render() {
return (
<View style={{ flexGrow: 1, alignItems: 'center', justifyContent: 'center' }}>
<Text
onPress={() => this.requestLocationPermission()}>
Request Location Permission
</Text>
<Text>Latitude: {this.state.latitude}</Text>
<Text style={{paddingBottom: 10}}>Longitude: {this.state.longitude}</Text>
{this.state.error ? <Text>Error: {this.state.error}</Text> : null}
</View>
)
}
}
export default SwichExample;

17
components/fetchData.js Normal file
View File

@@ -0,0 +1,17 @@
import React, { Component } from 'react';
import { Text} from 'react-native';
export default class FetchData extends Component {
constructor(props) {
super(props);
}
render() {
var data = this.props.data;
console.log('Child-Data from JSON: ');
return(
<Text></Text>
);
}
}