Suyash Srivastava 3 lat temu
rodzic
commit
8ee848b625
12 zmienionych plików z 92 dodań i 38 usunięć
  1. +4
    -0
      App.js
  2. BIN
      android/.gradle/6.5/executionHistory/executionHistory.bin
  3. BIN
      android/.gradle/6.5/executionHistory/executionHistory.lock
  4. BIN
      android/.gradle/6.5/fileHashes/fileHashes.bin
  5. BIN
      android/.gradle/6.5/fileHashes/fileHashes.lock
  6. BIN
      android/.gradle/buildOutputCleanup/buildOutputCleanup.lock
  7. BIN
      android/.gradle/checksums/checksums.lock
  8. +2
    -1
      src/views/AddressEnter.js
  9. +1
    -1
      src/views/AddressList.js
  10. +70
    -28
      src/views/AddressMap.js
  11. +7
    -2
      src/views/Home.js
  12. +8
    -6
      src/views/More.js

+ 4
- 0
App.js Wyświetl plik

@@ -75,6 +75,7 @@ import Success from './src/views/Success'
// import WallletAdd from './src/views/WalletAdd'
import WalletAdd from "./src/views/WalletAdd";
import AddressEnter from "./src/views/AddressEnter";
import AddressMap from "./src/views/AddressMap";
const Stack = createStackNavigator();
const Tab = createBottomTabNavigator();

@@ -248,6 +249,9 @@ function App() {
<Stack.Screen name="WalletAdd" component={WalletAdd} />
<Stack.Screen name="AddressEnter"
component={AddressEnter}
/>
<Stack.Screen name="AddressMap"
component={AddressMap}
/>
<Stack.Screen
name="DoctorSubCategories"


BIN
android/.gradle/6.5/executionHistory/executionHistory.bin Wyświetl plik


BIN
android/.gradle/6.5/executionHistory/executionHistory.lock Wyświetl plik


BIN
android/.gradle/6.5/fileHashes/fileHashes.bin Wyświetl plik


BIN
android/.gradle/6.5/fileHashes/fileHashes.lock Wyświetl plik


BIN
android/.gradle/buildOutputCleanup/buildOutputCleanup.lock Wyświetl plik


BIN
android/.gradle/checksums/checksums.lock Wyświetl plik


+ 2
- 1
src/views/AddressEnter.js Wyświetl plik

@@ -38,6 +38,7 @@ import {
get_blood_list,
api_url1,
} from "../config/Constants";

import { StatusBar, Loader } from "../components/GeneralComponents";
import * as colors from "../assets/css/Colors";
import axios from "axios";
@@ -285,7 +286,7 @@ class AddressEnter extends Component<Props> {
/>
</TouchableOpacity>
<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>
<ScrollView keyboardShouldPersistTaps="always">


+ 1
- 1
src/views/AddressList.js Wyświetl plik

@@ -145,7 +145,7 @@ class AddressList extends Component<Props> {
fastInterval: 5000,
})
.then((data) => {
this.props.navigation.navigate("AddressEnter", { id: 0 });
this.props.navigation.navigate("AddressMap");
})
.catch((err) => {
alert("Please enable your location");


+ 70
- 28
src/views/AddressMap.js Wyświetl plik

@@ -3,8 +3,20 @@ import { Text, View, StyleSheet } from "react-native";
// import Geocoder from "react-native-geocoder";
import MapView from "react-native-maps";
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 {
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";

export default class AddressMap extends Component {
@@ -21,7 +33,7 @@ export default class AddressMap extends Component {
this.handleUserNavigation();

this.getData();
// this.getData();
// this.onRegionChange();
// this.getAddress(this.state.latitude,this.state.longitude);
}
@@ -35,36 +47,36 @@ export default class AddressMap extends Component {

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 = () => {
// const key = "320646a99ec348baa3beb82943516ae6";
@@ -126,8 +138,8 @@ getData=()=>{
initialRegion={{
latitude: this.state.latitude,
longitude: this.state.longitude,
latitudeDelta: 0.0922,
longitudeDelta: 0.0421,
latitudeDelta: .001,
longitudeDelta: .05,
}}
>
<Marker
@@ -139,6 +151,33 @@ getData=()=>{
description={(this.state.address) }
/>
</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>
);
}
@@ -152,6 +191,8 @@ const styles = StyleSheet.create({
bottom: 0,
alignItems: "center",
justifyContent: "flex-end",
height:'100%'

},
mapStyle: {
position: "absolute",
@@ -159,5 +200,6 @@ const styles = StyleSheet.create({
left: 0,
right: 0,
bottom: 0,
height:'80%'
},
});

+ 7
- 2
src/views/Home.js Wyświetl plik

@@ -157,8 +157,13 @@ export default class Home extends Component<Props> {
return (
<Container>
<StatusBar
backgroundColor = "#a4a9b7"
barStyle = "dark-content"
backgroundColor = "#0c0a8d"
barStyle = "light-content"
hidden = {false}
translucent = {false}
networkActivityIndicatorVisible = {true}
/>
<Content padder>
<View style={styles.home_style1}>


+ 8
- 6
src/views/More.js Wyświetl plik

@@ -71,11 +71,12 @@ export default class More extends Component<Props> {
data={menus}
renderItem={({ item, index }) => (
<ListItem icon onPress={() => this.navigate(item.route)}>
<Left>
{/* <Left>
<Button style={styles.more_style5}>
<Icon active name={item.icon} />
</Button>
</Left>
// {/* <Icon active name={item.icon} /> */}
{/* // </Button> */}
{/* // </Left> */}
{/* // */}
<Body>
<Text style={styles.more_style6}>{item.menu_name}</Text>
</Body>
@@ -93,9 +94,9 @@ export default class More extends Component<Props> {

const styles = StyleSheet.create({
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: {
fontSize: 16,
fontSize: 20,
color: colors.theme_fg_two,
fontFamily: font_title,
},
@@ -105,5 +106,6 @@ const styles = StyleSheet.create({
fontSize: 16,
color: colors.theme_fg_two,
fontFamily: font_description,
paddingLeft:12
},
});

Ładowanie…
Anuluj
Zapisz