|
|
|
|
@ -9,14 +9,15 @@ import {
|
|
|
|
|
ScrollView,
|
|
|
|
|
TextInput,
|
|
|
|
|
TouchableHighlight,
|
|
|
|
|
View
|
|
|
|
|
View,
|
|
|
|
|
Modal
|
|
|
|
|
} from 'react-native';
|
|
|
|
|
|
|
|
|
|
import RunInfo from './components/run-info';
|
|
|
|
|
import RunInfoNumeric from './components/run-info-num';
|
|
|
|
|
|
|
|
|
|
import MapView from 'react-native-maps';
|
|
|
|
|
import NewButton from "./components/new-button";
|
|
|
|
|
import WalkButton from "./components/new-button";
|
|
|
|
|
import JoinButton from "./components/join-button";
|
|
|
|
|
import CapturedArea from "./components/captured-area";
|
|
|
|
|
import RoomInput from "./components/room-input";
|
|
|
|
|
@ -49,7 +50,10 @@ export default class App extends Component<Props> {
|
|
|
|
|
]
|
|
|
|
|
});
|
|
|
|
|
}, null, {enableHighAccuracy: true, timeout: 20000, distanceFilter: 10});
|
|
|
|
|
|
|
|
|
|
this.state = {
|
|
|
|
|
username: "",
|
|
|
|
|
gameNumber: "",
|
|
|
|
|
walkMarkers: [],
|
|
|
|
|
captures: [
|
|
|
|
|
new CapturedArea("fanded", [
|
|
|
|
|
@ -69,6 +73,9 @@ export default class App extends Component<Props> {
|
|
|
|
|
watchID
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
setGameNumber(user, number){
|
|
|
|
|
this.setState({username: user, gameNumber: number})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
componentWillUnmount() {
|
|
|
|
|
navigator.geolocation.stopWatch(this.state.watchID);
|
|
|
|
|
@ -106,21 +113,23 @@ export default class App extends Component<Props> {
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
</MapView>
|
|
|
|
|
<RoomInput/>
|
|
|
|
|
<Text style={styles.gameNumber}>
|
|
|
|
|
{"name: " + this.state.username + "\ngame: " + this.state.gameNumber}
|
|
|
|
|
|
|
|
|
|
</Text>
|
|
|
|
|
|
|
|
|
|
<RoomInput
|
|
|
|
|
ref={instance => this.roomInputModal = instance}
|
|
|
|
|
join={(user, number) => this.setGameNumber(user, number)}/>
|
|
|
|
|
<View style={styles.menu}>
|
|
|
|
|
|
|
|
|
|
<View style={styles.new}>
|
|
|
|
|
<NewButton erase={() => {this.setState({walkMarkers: []})}}/>
|
|
|
|
|
<View style={styles.walk}>
|
|
|
|
|
<WalkButton erase={() => {this.setState({walkMarkers: []})}}/>
|
|
|
|
|
</View>
|
|
|
|
|
|
|
|
|
|
<View style={styles.infoWrapper}>
|
|
|
|
|
|
|
|
|
|
<JoinButton join={() => {}}/>
|
|
|
|
|
<JoinButton join={() => {}}/>
|
|
|
|
|
<JoinButton join={() => {}}/>
|
|
|
|
|
<JoinButton join={() => {}}/>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<JoinButton
|
|
|
|
|
modal={() => this.roomInputModal.setModalVisible(true)}/>
|
|
|
|
|
</View>
|
|
|
|
|
</View>
|
|
|
|
|
</View>
|
|
|
|
|
@ -130,10 +139,6 @@ export default class App extends Component<Props> {
|
|
|
|
|
|
|
|
|
|
const styles = StyleSheet.create({
|
|
|
|
|
infoWrapper: {
|
|
|
|
|
// position: 'absolute',
|
|
|
|
|
// left: 0,
|
|
|
|
|
// bottom: 0,
|
|
|
|
|
// right: 0,
|
|
|
|
|
paddingVertical: 0,
|
|
|
|
|
flexDirection: 'row',
|
|
|
|
|
flex: 1
|
|
|
|
|
@ -147,7 +152,7 @@ const styles = StyleSheet.create({
|
|
|
|
|
flexDirection: 'column',
|
|
|
|
|
flex: 1
|
|
|
|
|
},
|
|
|
|
|
new: {
|
|
|
|
|
walk: {
|
|
|
|
|
// position: 'absolute',
|
|
|
|
|
// left: 0,
|
|
|
|
|
// bottom: 60,
|
|
|
|
|
@ -156,9 +161,18 @@ const styles = StyleSheet.create({
|
|
|
|
|
flexDirection: 'row',
|
|
|
|
|
flex: 1
|
|
|
|
|
},
|
|
|
|
|
modal:{
|
|
|
|
|
backgroundColor: 'white',
|
|
|
|
|
margin: 0, // This is the important style you need to set
|
|
|
|
|
alignItems: undefined,
|
|
|
|
|
justifyContent: undefined,
|
|
|
|
|
},
|
|
|
|
|
map: {
|
|
|
|
|
...StyleSheet.absoluteFillObject
|
|
|
|
|
},
|
|
|
|
|
gameNumber:{
|
|
|
|
|
fontSize: 30,
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
container: {
|
|
|
|
|
flex: 1,
|
|
|
|
|
|