@@ -75,6 +75,7 @@ import Success from './src/views/Success' | |||||
// import WallletAdd from './src/views/WalletAdd' | // import WallletAdd from './src/views/WalletAdd' | ||||
import WalletAdd from "./src/views/WalletAdd"; | import WalletAdd from "./src/views/WalletAdd"; | ||||
import AddressEnter from "./src/views/AddressEnter"; | import AddressEnter from "./src/views/AddressEnter"; | ||||
import AddressMap from "./src/views/AddressMap"; | |||||
const Stack = createStackNavigator(); | const Stack = createStackNavigator(); | ||||
const Tab = createBottomTabNavigator(); | const Tab = createBottomTabNavigator(); | ||||
@@ -248,6 +249,9 @@ function App() { | |||||
<Stack.Screen name="WalletAdd" component={WalletAdd} /> | <Stack.Screen name="WalletAdd" component={WalletAdd} /> | ||||
<Stack.Screen name="AddressEnter" | <Stack.Screen name="AddressEnter" | ||||
component={AddressEnter} | component={AddressEnter} | ||||
/> | |||||
<Stack.Screen name="AddressMap" | |||||
component={AddressMap} | |||||
/> | /> | ||||
<Stack.Screen | <Stack.Screen | ||||
name="DoctorSubCategories" | name="DoctorSubCategories" | ||||
@@ -38,6 +38,7 @@ import { | |||||
get_blood_list, | get_blood_list, | ||||
api_url1, | api_url1, | ||||
} from "../config/Constants"; | } from "../config/Constants"; | ||||
import { StatusBar, Loader } from "../components/GeneralComponents"; | import { StatusBar, Loader } from "../components/GeneralComponents"; | ||||
import * as colors from "../assets/css/Colors"; | import * as colors from "../assets/css/Colors"; | ||||
import axios from "axios"; | import axios from "axios"; | ||||
@@ -285,7 +286,7 @@ class AddressEnter extends Component<Props> { | |||||
/> | /> | ||||
</TouchableOpacity> | </TouchableOpacity> | ||||
<View style={styles.reg_style4} /> | <View style={styles.reg_style4} /> | ||||
<Text style={styles.reg_style5}>Enter Your location</Text> | |||||
<Text style={styles.reg_style5}>Enter Your Address</Text> | |||||
</View> | </View> | ||||
</View> | </View> | ||||
<ScrollView keyboardShouldPersistTaps="always"> | <ScrollView keyboardShouldPersistTaps="always"> | ||||
@@ -145,7 +145,7 @@ class AddressList extends Component<Props> { | |||||
fastInterval: 5000, | fastInterval: 5000, | ||||
}) | }) | ||||
.then((data) => { | .then((data) => { | ||||
this.props.navigation.navigate("AddressEnter", { id: 0 }); | |||||
this.props.navigation.navigate("AddressMap"); | |||||
}) | }) | ||||
.catch((err) => { | .catch((err) => { | ||||
alert("Please enable your location"); | alert("Please enable your location"); | ||||
@@ -3,8 +3,20 @@ import { Text, View, StyleSheet } from "react-native"; | |||||
// import Geocoder from "react-native-geocoder"; | // import Geocoder from "react-native-geocoder"; | ||||
import MapView from "react-native-maps"; | import MapView from "react-native-maps"; | ||||
import Geolocation from "@react-native-community/geolocation"; | import Geolocation from "@react-native-community/geolocation"; | ||||
import opencage from "opencage-api-client"; | |||||
// import opencage from "opencage-api-client"; | |||||
import { Marker } from "react-native-maps"; | import { Marker } from "react-native-maps"; | ||||
import { | |||||
api_url1, | |||||
address_list, | |||||
address_delete, | |||||
img_url, | |||||
last_active_address, | |||||
font_title, | |||||
font_description, | |||||
no_address_lottie, | |||||
} from "../config/Constants"; | |||||
import * as colors from "../assets/css/Colors"; | |||||
import { Button } from "react-native-elements"; | |||||
// import { address } from "../config/Constants"; | // import { address } from "../config/Constants"; | ||||
export default class AddressMap extends Component { | export default class AddressMap extends Component { | ||||
@@ -21,7 +33,7 @@ export default class AddressMap extends Component { | |||||
this.handleUserNavigation(); | this.handleUserNavigation(); | ||||
this.getData(); | |||||
// this.getData(); | |||||
// this.onRegionChange(); | // this.onRegionChange(); | ||||
// this.getAddress(this.state.latitude,this.state.longitude); | // this.getAddress(this.state.latitude,this.state.longitude); | ||||
} | } | ||||
@@ -35,36 +47,36 @@ export default class AddressMap extends Component { | |||||
getAddress = async(ny) => { | getAddress = async(ny) => { | ||||
await Geocoder.fallbackToGoogle('AIzaSyB_mBINSZ5m6dVyK6ANTLoEhkZq1nH9dG8'); | |||||
try { | |||||
let res = await Geocoder.geocodePosition(ny); | |||||
let addr = res[0].formattedAddress; | |||||
alert(addr); | |||||
this.setState({ | |||||
address: addr, | |||||
}); | |||||
} catch (err) { | |||||
alert(err); | |||||
} | |||||
// await Geocoder.fallbackToGoogle('AIzaSyB_mBINSZ5m6dVyK6ANTLoEhkZq1nH9dG8'); | |||||
// try { | |||||
// let res = await Geocoder.geocodePosition(ny); | |||||
// let addr = res[0].formattedAddress; | |||||
// alert(addr); | |||||
// this.setState({ | |||||
// address: addr, | |||||
// }); | |||||
// } catch (err) { | |||||
// alert(err); | |||||
// } | |||||
}; | }; | ||||
newOne=()=>{ | |||||
const ny={lat:this.state.latitude,lng:this.state.latitude} | |||||
this.getAddress(ny); | |||||
} | |||||
// newOne=()=>{ | |||||
// const ny={lat:this.state.latitude,lng:this.state.latitude} | |||||
// this.getAddress(ny); | |||||
// } | |||||
getData=()=>{ | |||||
Geocoder.setApiKey('AIzaSyB_mBINSZ5m6dVyK6ANTLoEhkZq1nH9dG8'); | |||||
Geocoder.getFromLatLng(41.89,12.49).then( | |||||
// getData=()=>{ | |||||
// Geocoder.setApiKey('AIzaSyB_mBINSZ5m6dVyK6ANTLoEhkZq1nH9dG8'); | |||||
// Geocoder.getFromLatLng(41.89,12.49).then( | |||||
json=>{ | |||||
var address_component=json.results[0].address_component[0] | |||||
alert(address_component.long_name) | |||||
} | |||||
) | |||||
// json=>{ | |||||
// var address_component=json.results[0].address_component[0] | |||||
// alert(address_component.long_name) | |||||
// } | |||||
// ) | |||||
} | |||||
// } | |||||
// reverseGeocode = () => { | // reverseGeocode = () => { | ||||
// const key = "320646a99ec348baa3beb82943516ae6"; | // const key = "320646a99ec348baa3beb82943516ae6"; | ||||
@@ -126,8 +138,8 @@ getData=()=>{ | |||||
initialRegion={{ | initialRegion={{ | ||||
latitude: this.state.latitude, | latitude: this.state.latitude, | ||||
longitude: this.state.longitude, | longitude: this.state.longitude, | ||||
latitudeDelta: 0.0922, | |||||
longitudeDelta: 0.0421, | |||||
latitudeDelta: .001, | |||||
longitudeDelta: .05, | |||||
}} | }} | ||||
> | > | ||||
<Marker | <Marker | ||||
@@ -139,6 +151,33 @@ getData=()=>{ | |||||
description={(this.state.address) } | description={(this.state.address) } | ||||
/> | /> | ||||
</MapView> | </MapView> | ||||
<View | |||||
style={{ | |||||
height:'20%',paddingHorizontal:22 | |||||
}} | |||||
> | |||||
<Text | |||||
style={{fontSize:23}} | |||||
> | |||||
Your location : {this.state.latitude} , {this.state.longitude} | |||||
</Text> | |||||
<Text | |||||
style={styles.reg_style13} | |||||
> | |||||
Accuracy:({this.state.coords.accuracy}) | |||||
</Text> | |||||
<Button | |||||
title="Next" | |||||
onPress={()=>this.props.navigation.navigate('AddressEnter')} | |||||
buttonStyle={{ | |||||
backgroundColor: colors.theme_bg, | |||||
fontFamily: font_title,}} | |||||
titleStyle={{ color: colors.theme_bg_three, | |||||
fontFamily: font_description,}} | |||||
/> | |||||
</View> | |||||
</View> | </View> | ||||
); | ); | ||||
} | } | ||||
@@ -152,6 +191,8 @@ const styles = StyleSheet.create({ | |||||
bottom: 0, | bottom: 0, | ||||
alignItems: "center", | alignItems: "center", | ||||
justifyContent: "flex-end", | justifyContent: "flex-end", | ||||
height:'100%' | |||||
}, | }, | ||||
mapStyle: { | mapStyle: { | ||||
position: "absolute", | position: "absolute", | ||||
@@ -159,5 +200,6 @@ const styles = StyleSheet.create({ | |||||
left: 0, | left: 0, | ||||
right: 0, | right: 0, | ||||
bottom: 0, | bottom: 0, | ||||
height:'80%' | |||||
}, | }, | ||||
}); | }); |
@@ -157,8 +157,13 @@ export default class Home extends Component<Props> { | |||||
return ( | return ( | ||||
<Container> | <Container> | ||||
<StatusBar | <StatusBar | ||||
backgroundColor = "#a4a9b7" | |||||
barStyle = "dark-content" | |||||
backgroundColor = "#0c0a8d" | |||||
barStyle = "light-content" | |||||
hidden = {false} | |||||
translucent = {false} | |||||
networkActivityIndicatorVisible = {true} | |||||
/> | /> | ||||
<Content padder> | <Content padder> | ||||
<View style={styles.home_style1}> | <View style={styles.home_style1}> | ||||
@@ -71,11 +71,12 @@ export default class More extends Component<Props> { | |||||
data={menus} | data={menus} | ||||
renderItem={({ item, index }) => ( | renderItem={({ item, index }) => ( | ||||
<ListItem icon onPress={() => this.navigate(item.route)}> | <ListItem icon onPress={() => this.navigate(item.route)}> | ||||
<Left> | |||||
{/* <Left> | |||||
<Button style={styles.more_style5}> | <Button style={styles.more_style5}> | ||||
<Icon active name={item.icon} /> | |||||
</Button> | |||||
</Left> | |||||
// {/* <Icon active name={item.icon} /> */} | |||||
{/* // </Button> */} | |||||
{/* // </Left> */} | |||||
{/* // */} | |||||
<Body> | <Body> | ||||
<Text style={styles.more_style6}>{item.menu_name}</Text> | <Text style={styles.more_style6}>{item.menu_name}</Text> | ||||
</Body> | </Body> | ||||
@@ -93,9 +94,9 @@ export default class More extends Component<Props> { | |||||
const styles = StyleSheet.create({ | const styles = StyleSheet.create({ | ||||
more_style1: { backgroundColor: colors.theme_bg_two }, | more_style1: { backgroundColor: colors.theme_bg_two }, | ||||
more_style2: { backgroundColor: colors.theme_bg_three, padding: 10 }, | |||||
more_style2: { backgroundColor: colors.theme_bg_three, padding: 13 }, | |||||
more_style3: { | more_style3: { | ||||
fontSize: 16, | |||||
fontSize: 20, | |||||
color: colors.theme_fg_two, | color: colors.theme_fg_two, | ||||
fontFamily: font_title, | fontFamily: font_title, | ||||
}, | }, | ||||
@@ -105,5 +106,6 @@ const styles = StyleSheet.create({ | |||||
fontSize: 16, | fontSize: 16, | ||||
color: colors.theme_fg_two, | color: colors.theme_fg_two, | ||||
fontFamily: font_description, | fontFamily: font_description, | ||||
paddingLeft:12 | |||||
}, | }, | ||||
}); | }); |