김승훈

update

......@@ -2,12 +2,15 @@ import { Component } from 'react';
import { StyleSheet, Text, View, AppRegistry } from 'react-native';
import { createAppContainer } from 'react-navigation';
import {createStackNavigator } from 'react-navigation-stack'
import MainScreen from './components/Mainscreen';
import MainScreen from './components/Navigation/Navigation';
import React from 'react'
const AppStackNavigator = createStackNavigator({
Main:{
screen: MainScreen
screen: MainScreen,
navigationOptions: {
headerShown:false
}
}
});
......
import { Component } from 'react';
import { StyleSheet, Text, View } from 'react-native';
import { StyleSheet, Text, View, Image, TouchableOpacity, Alert } from 'react-native';
import { Icon } from 'native-base'; // 추가된 코드
import React from 'react'
import {Marker} from 'react-native-maps'
import Constants from 'expo-constants';
import * as Location from 'expo-location';
import MapView from "./ClusteredMapView";
import MapView from "../ClusteredMapView";
export default class MainScreen extends Component {
......@@ -43,32 +43,17 @@ export default class MainScreen extends Component {
}
render() {
return (
this.state.location?
<MapView
style={{ flex: 1 }}
initialRegion={ { latitude: this.state.location.coords.latitude, longitude: this.state.location.coords.longitude
,latitudeDelta: 0.0922, longitudeDelta: 0.0421}}
zoomEnabled={true}
pitchEnabled={true}
showsUserLocation={true}
followsUserLocation={true}
showsCompass={true}
showsBuildings={true}
showsTraffic={true}
showsIndoors={true}
extent={512}>
<Marker coordinate={{ latitude: this.state.location.coords.latitude+0.1, longitude: this.state.location.coords.longitude }} />
<Marker coordinate={{ latitude: this.state.location.coords.latitude+0.5, longitude: this.state.location.coords.longitude }} />
<Marker coordinate={{ latitude: this.state.location.coords.latitude+0.0001, longitude: this.state.location.coords.longitude }} />
<Marker coordinate={{ latitude: this.state.location.coords.latitude+0.0003, longitude: this.state.location.coords.longitude }} />
<Marker coordinate={{ latitude: this.state.location.coords.latitude+0.03, longitude: this.state.location.coords.longitude }} />
<Marker coordinate={{ latitude: this.state.location.coords.latitude+0.05, longitude: this.state.location.coords.longitude }} />
<Marker coordinate={{ latitude: this.state.location.coords.latitude+0.01, longitude: this.state.location.coords.longitude }} />
<Marker coordinate={{ latitude: this.state.location.coords.latitude+0.2, longitude: this.state.location.coords.longitude }} />
<Marker coordinate={{ latitude: this.state.location.coords.latitude+0.3, longitude: this.state.location.coords.longitude }} />
<Marker coordinate={{ latitude: this.state.location.coords.latitude+0.7, longitude: this.state.location.coords.longitude }} />
</MapView>:<Text>Loading..</Text>
//this.state.location?
<View style={{width:"100%",height:"100%"}}>
<TouchableOpacity onPress={() => Alert.alert('OK',"주변에 의심자가 있습니까?",[{text:"OK",onPress:() =>alert("확인")},{text:'cancel'}])} style={{position:"absolute",bottom:10,right:10, width:50,height:50,backgroundColor:"red",borderRadius:100}}>
<View style={{flex:1,justifyContent: 'center',alignItems: 'center'}}>
<Image style={{width:22,height:22}} source={require('../assets/security.png')}/>
</View>
</TouchableOpacity>
</View>
//:<Text>Loading..</Text>
);
}
}
......
import React, { Component } from 'react';
import { StyleSheet, Text, View, Image,
TouchableOpacity, ScrollView, Dimensions,
SafeAreaView, } from 'react-native';
import { createAppContainer} from 'react-navigation';
import {createStackNavigator } from 'react-navigation-stack';
import ReportTab from '../TabNavigator/reportTab'
import MainTab from '../TabNavigator/MainTab'
import { Icon } from 'native-base'; // 추가된 코드
const Stack = createStackNavigator(
{
MainTab: {
screen: props => <MainTab {...props}/>,
navigationOptions: {
headerLeft: <Icon name='ios-camera' style={{ paddingLeft:10 }}/>,
title: 'PME Service',
headerRight: <Icon name='ios-send' style={{ paddingRight:10 }}/>,
headerTitleStyle: {flex: 1, textAlign: 'center'},
headerStyle: {
shadowOpacity: 0,
shadowOffset: {
y: 0,
x:0,
height:0
},
shadowRadius: 0, elevation:0
}
},
}
,reportTab: {
screen: props=> <ReportTab {...props}/>,
navigationOptions: {
headerShown:false
}
},
},{
}
);
export default createAppContainer(Stack);
/*
<Text
onPress={() => {
props.navigation.navigate('BlueScreen');
props.navigation.closeDrawer();
}}
>
BlueScreen
</Text>
<Text
onPress={() => {
props.navigation.navigate('DefaultScreen');
props.navigation.closeDrawer();
}}
>
DefaultScreen
</Text>
*/
\ No newline at end of file
import { Component } from 'react';
import { StyleSheet, Text, View, Image, TouchableOpacity, Alert, Platform } from 'react-native';
import { Icon } from 'native-base'; // 추가된 코드
import React from 'react'
import {Marker} from 'react-native-maps'
import Constants from 'expo-constants';
import * as Location from 'expo-location';
import MapView from "../ClusteredMapView";
import Share from 'react-native-share';
const url = 'https://awesome.contents.com/';
const title = 'Awesome Contents';
const message = 'Please check this out.';
const icon = 'data:<data_type>/<file_extension>;base64,<base64_data>';
const options = Platform.select({
ios: {
activityItemSources: [
{ // For sharing url with custom title.
placeholderItem: { type: 'url', content: url },
item: {
default: { type: 'url', content: url },
},
subject: {
default: title,
},
linkMetadata: { originalUrl: url, url, title },
},
{ // For sharing text.
placeholderItem: { type: 'text', content: message },
item: {
default: { type: 'text', content: message },
message: null, // Specify no text to share via Messages app.
},
linkMetadata: { // For showing app icon on share preview.
title: message
},
},
{ // For using custom icon instead of default text icon at share preview when sharing with message.
placeholderItem: {
type: 'url',
content: icon
},
item: {
default: {
type: 'text',
content: `${message} ${url}`
},
},
linkMetadata: {
title: message,
icon: icon
}
},
],
},
default: {
title,
subject: title,
message: `${message} ${url}`,
},
});
export default class MainScreen extends Component {
// navigationOptions 코드 추가
static navigationOptions = {
headerLeft: <Icon name='ios-camera' style={{ paddingLeft:10 }}/>,
title: 'PME Service',
headerRight: <Icon name='ios-send' style={{ paddingRight:10 }}/>,
}
constructor(props) {
super(props)
this.state= {
location:null,
errorMsg:null
}
}
componentDidMount() {
(async () => {
let { status } = await Location.requestPermissionsAsync();
if (status !== 'granted') {
this.setState({
errorMsg:'Permission to access location was denied'
})
}
let location = await Location.getCurrentPositionAsync({});
console.log(location)
this.setState({
location
},() => {
console.log(this.state.location.coords.latitude)
})
})();
}
render() {
return (
this.state.location?
<View style={{width:"100%",height:"100%"}}>
<MapView
style={{ flex: 1 }}
initialRegion={ { latitude: this.state.location.coords.latitude, longitude: this.state.location.coords.longitude
,latitudeDelta: 0.0922, longitudeDelta: 0.0421}}
zoomEnabled={true}
pitchEnabled={true}
showsUserLocation={true}
followsUserLocation={true}
showsCompass={true}
showsBuildings={true}
showsTraffic={true}
showsIndoors={true}
extent={512}>
<Marker coordinate={{ latitude: this.state.location.coords.latitude+0.1, longitude: this.state.location.coords.longitude }} >
<Image style={{width:54,height:54}} source={require('../../assets/marker.png')}/>
</Marker>
<Marker coordinate={{ latitude: this.state.location.coords.latitude+0.5, longitude: this.state.location.coords.longitude }}>
<Image style={{width:54,height:54}} source={require('../../assets/marker.png')}/>
</Marker>
<Marker icon="../../assets/marker.png" coordinate={{ latitude: this.state.location.coords.latitude+0.0001, longitude: this.state.location.coords.longitude }}>
<Image style={{width:54,height:54}} source={require('../../assets/marker.png')}/>
</Marker>
<Marker icon="../../assets/marker.png" coordinate={{ latitude: this.state.location.coords.latitude+0.0003, longitude: this.state.location.coords.longitude }}>
<Image style={{width:54,height:54}} source={require('../../assets/marker.png')}/>
</Marker>
<Marker icon="../../assets/marker.png" coordinate={{ latitude: this.state.location.coords.latitude+0.03, longitude: this.state.location.coords.longitude }}>
<Image style={{width:54,height:54}} source={require('../../assets/marker.png')}/>
</Marker>
<Marker icon="../../assets/marker.png" coordinate={{ latitude: this.state.location.coords.latitude+0.05, longitude: this.state.location.coords.longitude }}>
<Image style={{width:54,height:54}} source={require('../../assets/marker.png')}/>
</Marker>
<Marker icon="../../assets/marker.png" coordinate={{ latitude: this.state.location.coords.latitude+0.01, longitude: this.state.location.coords.longitude }}>
<Image style={{width:54,height:54}} source={require('../../assets/marker.png')}/>
</Marker>
<Marker icon="../../assets/marker.png" coordinate={{ latitude: this.state.location.coords.latitude+0.2, longitude: this.state.location.coords.longitude }}>
<Image style={{width:54,height:54}} source={require('../../assets/marker.png')}/>
</Marker>
<Marker icon="../../assets/marker.png" coordinate={{ latitude: this.state.location.coords.latitude+0.3, longitude: this.state.location.coords.longitude }}>
<Image style={{width:54,height:54}} source={require('../../assets/marker.png')}/>
</Marker>
<Marker icon="../../assets/marker.png" coordinate={{ latitude: this.state.location.coords.latitude+0.7, longitude: this.state.location.coords.longitude }}>
<Image style={{width:54,height:54}} source={require('../../assets/marker.png')}/>
</Marker>
</MapView>
<TouchableOpacity onPress={() => Alert.alert('OK',"주변에 의심자가 있습니까?",[{text:"OK",onPress:() =>Share.open(options)},{text:'cancel'}])} style={{position:"absolute",bottom:10,right:10, width:50,height:50,backgroundColor:"red",borderRadius:100}}>
<View style={{flex:1,justifyContent: 'center',alignItems: 'center'}}>
<Image style={{width:22,height:22}} source={require('../../assets/security.png')}/>
</View>
</TouchableOpacity>
</View>
:<Text>Loading..</Text>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
},
});
\ No newline at end of file
import React, { Component } from 'react';
import { View, Text, StyleSheet, Button } from 'react-native';
import * as DocumentPicker from 'expo-document-picker';
import Icon from 'native-base'
export default class AddTab extends Component {
static navigationOptions = {
headerLeft: <Icon name='ios-camera' style={{ paddingLeft:10 }}/>,
title: 'PME Service',
headerRight: <Icon name='ios-send' style={{ paddingRight:10 }}/>,
}
state = {
image: null,
};
_pickDocument = async () => {
let result = await DocumentPicker.getDocumentAsync({});
alert(result.uri);
console.log(result);
}
_pickImage = async () => {
let result = await ImagePicker.launchImageLibraryAsync({
allowsEditing: true,
aspect: [4, 3],
});
alert(result.uri);
console.log(result)
if (!result.cancelled) {
this.setState({ image: result.uri });
}
};
render() {
let { image } = this.state;
return (
<View style={style.container}>
<Button
title="녹음파일을 등록해주세요."
onPress={this._pickDocument}
/>
<Button
title="접수하기"
onPress={() => {alert("접수되었습니다.")}}
/>
</View>
);
}
}
const style = StyleSheet.create({
container: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
}
});
\ No newline at end of file
......@@ -117,17 +117,17 @@ export const returnMarkerStyle = points => {
if (points >= 4) {
return {
width: 54,
height: 54,
size: 40,
width: 84,
height: 84,
size: 64,
fontSize: 16
};
}
return {
width: 48,
height: 48,
size: 36,
width: 84,
height: 84,
size: 64,
fontSize: 15
};
};
......
......@@ -1252,9 +1252,9 @@
"integrity": "sha512-rk4sWFsmtOw8oyx8SD3KSvawwaK7gRBSEIy2TAwURyGt+3TizssXP1r8nx3zY+R7v2vYYHXZ+k2/GULAT/bcaQ=="
},
"@react-navigation/core": {
"version": "3.7.5",
"resolved": "https://registry.npmjs.org/@react-navigation/core/-/core-3.7.5.tgz",
"integrity": "sha512-B8vKZhHvX+C+lD0UfU5ljCOWIDgDKrlzMuuqIftCB5lnMFvRQZJ5cGpK6u6+BEoX1myfO5j4KUEsRv4H+2f5lg==",
"version": "3.7.6",
"resolved": "https://registry.npmjs.org/@react-navigation/core/-/core-3.7.6.tgz",
"integrity": "sha512-loYFIn0Boy7C+vYxwcqsBVRFRO1EizZJErdutE6/3Jw6dbzz3Bnzupbw5hckZNB16GckacMwGoepZNIK51IIcg==",
"requires": {
"hoist-non-react-statics": "^3.3.2",
"path-to-regexp": "^1.8.0",
......@@ -1263,9 +1263,9 @@
}
},
"@react-navigation/native": {
"version": "3.7.12",
"resolved": "https://registry.npmjs.org/@react-navigation/native/-/native-3.7.12.tgz",
"integrity": "sha512-StECfhxtEJvFehh16Wc9jnepy5gYKovzynVW+jr/+jKa7xlKskSCvASDnIwLHoFcWom084afKbqpVoVLEsE3lg==",
"version": "3.7.13",
"resolved": "https://registry.npmjs.org/@react-navigation/native/-/native-3.7.13.tgz",
"integrity": "sha512-M6v1bLz0WbQmlPKF3WKBEZDGQ3CaqmzQULGs7XWtQe+f03VEbeX+kCkr/J6hw+rsgAy9Nwr4mGCPPQhF2pa7Yw==",
"requires": {
"hoist-non-react-statics": "^3.3.2",
"react-native-safe-area-view": "^0.14.9"
......@@ -2629,6 +2629,14 @@
"resolved": "https://registry.npmjs.org/expo-constants/-/expo-constants-9.0.0.tgz",
"integrity": "sha512-1kqZMM8Ez5JT3sTEx8I69fP6NYFLOJjeM6Z63dD/m2NiwvzSADiO5+BhghnWNGN1L3bxbgOjXS6EHtS7CdSfxA=="
},
"expo-document-picker": {
"version": "8.1.0",
"resolved": "https://registry.npmjs.org/expo-document-picker/-/expo-document-picker-8.1.0.tgz",
"integrity": "sha512-GSPCNSwgAbRZ021bOf/ogHlbb8ZrL5iHwDx66QZCbzZTtHVTR1UVYRGhuNIjpjCaGLtd3pa0vqYp4dcx6upEVA==",
"requires": {
"uuid": "^3.3.2"
}
},
"expo-error-recovery": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/expo-error-recovery/-/expo-error-recovery-1.1.0.tgz",
......@@ -5858,6 +5866,11 @@
"resolved": "https://registry.npmjs.org/react-native-screens/-/react-native-screens-2.7.0.tgz",
"integrity": "sha512-n/23IBOkrTKCfuUd6tFeRkn3lB2QZ3cmvoubRscR0JU/Zl4/ZyKmwnFmUv1/Fr+2GH/H8UTX59kEKDYYg3dMgA=="
},
"react-native-share": {
"version": "3.3.2",
"resolved": "https://registry.npmjs.org/react-native-share/-/react-native-share-3.3.2.tgz",
"integrity": "sha512-Pvkr62TiCX511RMPL+wvy9Fofre4HQnvUT5zzgPPN3vszP/C8lUb7cmFu/8x5U14t3JQg+xW/svNK5eKNebJKw=="
},
"react-native-vector-icons": {
"version": "6.6.0",
"resolved": "https://registry.npmjs.org/react-native-vector-icons/-/react-native-vector-icons-6.6.0.tgz",
......@@ -5984,18 +5997,18 @@
}
},
"react-navigation": {
"version": "4.3.8",
"resolved": "https://registry.npmjs.org/react-navigation/-/react-navigation-4.3.8.tgz",
"integrity": "sha512-Hxb6VkGu38x4r8nysAJutFkZ1yax29H6BrcdsqxlfGO2pCd821JkRL9h1Zqxn7qLm5JM6+7h0Yx3AS+YKDU5nw==",
"version": "4.3.9",
"resolved": "https://registry.npmjs.org/react-navigation/-/react-navigation-4.3.9.tgz",
"integrity": "sha512-nqAHS7jL1hgFPZeYt1vU8zVuF2Ay3bVVdCYvJSFJ9UvQZOtqPr/Wen/Ya9fRc+AvTtf3+AJn97K8xIiz2HHusQ==",
"requires": {
"@react-navigation/core": "^3.7.5",
"@react-navigation/native": "^3.7.12"
"@react-navigation/core": "^3.7.6",
"@react-navigation/native": "^3.7.13"
}
},
"react-navigation-stack": {
"version": "2.3.13",
"resolved": "https://registry.npmjs.org/react-navigation-stack/-/react-navigation-stack-2.3.13.tgz",
"integrity": "sha512-WOfrkDnTaGeVU+8+Fm5WHvovN/9o1jHADcOBBGgNN6T8XsYwtGHPr5eQbe77LKYXQ/gX3pcGiOVG3WSBDHzH+w==",
"version": "2.5.0",
"resolved": "https://registry.npmjs.org/react-navigation-stack/-/react-navigation-stack-2.5.0.tgz",
"integrity": "sha512-B+j7J8M17WbF5JhMxOnKayMO7BDajzzp/xFkOUH9TFu7solkDPGUt0XDM2joYdvsnTLye7oEDqF4X2YGnbPYJw==",
"requires": {
"color": "^3.1.2",
"react-native-iphone-x-helper": "^1.2.1"
......
......@@ -12,6 +12,7 @@
"@react-native-community/masked-view": "^0.1.10",
"expo": "~37.0.3",
"expo-constants": "^9.0.0",
"expo-document-picker": "^8.1.0",
"expo-location": "^8.1.0",
"native-base": "^2.13.12",
"react": "~16.9.0",
......@@ -22,9 +23,10 @@
"react-native-maps": "^0.27.1",
"react-native-safe-area-context": "^0.7.3",
"react-native-screens": "^2.7.0",
"react-native-share": "^3.3.2",
"react-native-web": "~0.11.7",
"react-navigation": "^4.3.8",
"react-navigation-stack": "^2.3.13"
"react-navigation": "^4.3.9",
"react-navigation-stack": "^2.5.0"
},
"devDependencies": {
"@babel/core": "^7.8.6",
......