diff --git a/android/app/build.gradle b/android/app/build.gradle index c974c54a54..4261fe5493 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -199,7 +199,7 @@ dependencies { implementation "com.facebook.react:react-native:+" // From node_modules implementation "androidx.annotation:annotation:1.1.0" - compile project(':react-native-fs') + implementation project(':react-native-fs') if (enableHermes) { def hermesPath = "../../node_modules/hermes-engine/android/"; diff --git a/android/build.gradle b/android/build.gradle index 8ff49b39df..61e848c686 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -15,7 +15,7 @@ buildscript { jcenter() } dependencies { - classpath("com.android.tools.build:gradle:3.4.2") + classpath('com.android.tools.build:gradle:3.5.0') // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/app/Entry.js b/app/Entry.js index 791842da26..038b87a824 100644 --- a/app/Entry.js +++ b/app/Entry.js @@ -1,11 +1,9 @@ import React, { Component } from 'react'; - import { NavigationContainer } from '@react-navigation/native'; import { createStackNavigator, CardStyleInterpolators, } from '@react-navigation/stack'; -import { SafeAreaView } from 'react-native'; import LocationTracking from './views/LocationTracking'; import NewsScreen from './views/News'; import ExportScreen from './views/Export'; @@ -20,8 +18,7 @@ import Onboarding2 from './views/onboarding/Onboarding2'; import Onboarding5 from './views/onboarding/Onboarding5'; import AboutScreen from './views/About'; import ChooseProviderScreen from './views/ChooseProvider'; - -import { GetStoreData, SetStoreData } from './helpers/General'; +import { GetStoreData } from './helpers/General'; import { PARTICIPATE } from './constants/storage'; const Stack = createStackNavigator(); diff --git a/app/components/NativePicker.js b/app/components/NativePicker.js index 293526bdd6..d05b8b6d8e 100644 --- a/app/components/NativePicker.js +++ b/app/components/NativePicker.js @@ -23,7 +23,6 @@ export default class NativePicker extends Component { render() { // iOS and Android Pickers behave differently, handled below if (Platform.OS === 'android') { - const selectedItem = this.props.items.find( i => i.value === this.props.value, ); @@ -35,7 +34,6 @@ export default class NativePicker extends Component { onPress={() => this.setState({ modalVisible: true })}> { @@ -129,32 +127,6 @@ export default class NativePicker extends Component { } const styles = StyleSheet.create({ - mainContainer: { - flex: 1, - backgroundColor: '#ffffff', - }, - imageContainer: { - alignItems: 'center', - justifyContent: 'center', - margin: '3%', - }, - descriptionContainer: { - flex: 1, - flexDirection: 'row', - }, - descriptionIconContainer: { - alignSelf: 'center', - }, - descriptionIcon: { - width: 10, - height: 10, - resizeMode: 'contain', - }, - descriptionTextContainer: { - flex: 1, - justifyContent: 'center', - marginLeft: '5%', - }, touchableTrigger: { backgroundColor: '#ffffff', opacity: 0.4, @@ -168,5 +140,4 @@ const styles = StyleSheet.create({ textAlign: 'center', textTransform: 'uppercase', }, - }); diff --git a/app/services/__tests__/LocationService.spec.js b/app/services/__tests__/LocationService.spec.js index fe62989d0b..eab7ae7a91 100644 --- a/app/services/__tests__/LocationService.spec.js +++ b/app/services/__tests__/LocationService.spec.js @@ -1,4 +1,4 @@ -import LocationService, { LocationData } from '../LocationService'; +import { LocationData } from '../LocationService'; import * as General from '../../helpers/General'; function mockGetStoreData(data) { diff --git a/app/views/About.js b/app/views/About.js index 538de9ff64..5c6b7e8b98 100644 --- a/app/views/About.js +++ b/app/views/About.js @@ -1,8 +1,6 @@ import React, { Component } from 'react'; import { StyleSheet, View, Text, ScrollView, BackHandler } from 'react-native'; - import languages from './../locales/languages'; -import { isPlatformiOS } from './../Util'; import Colors from '../constants/colors'; import fontFamily from './../constants/fonts'; import team from './../assets/svgs/team'; @@ -74,12 +72,6 @@ const styles = StyleSheet.create({ paddingHorizontal: 26, flex: 1, }, - section: { - flexDirection: 'column', - width: '87.5%', - alignSelf: 'center', - backgroundColor: Colors.WHITE, - }, aboutSectionIconTeam: { width: 40.38, height: 19, diff --git a/app/views/ChooseProvider.js b/app/views/ChooseProvider.js index de6c7d238f..7ff8aba5bd 100644 --- a/app/views/ChooseProvider.js +++ b/app/views/ChooseProvider.js @@ -1,6 +1,5 @@ import React, { Component } from 'react'; import { - SafeAreaView, StyleSheet, View, Text, @@ -27,7 +26,6 @@ import { GetStoreData, SetStoreData } from '../helpers/General'; import colors from '../constants/colors'; import Colors from '../constants/colors'; import fontFamily from '../constants/fonts'; -import backArrow from './../assets/images/backArrow.png'; import closeIcon from './../assets/images/closeIcon.png'; import saveIcon from './../assets/images/saveIcon.png'; import languages from '../locales/languages'; @@ -358,14 +356,6 @@ class ChooseProviderScreen extends Component { } const styles = StyleSheet.create({ - // Container covers the entire screen - container: { - flex: 1, - flexDirection: 'column', - justifyContent: 'space-between', - color: colors.PRIMARY_TEXT, - backgroundColor: colors.WHITE, - }, main: { flex: 2, flexDirection: 'column', @@ -385,12 +375,6 @@ const styles = StyleSheet.create({ alignSelf: 'center', backgroundColor: colors.WHITE, }, - row: { - flex: 1, - flexDirection: 'row', - color: colors.PRIMARY_TEXT, - backgroundColor: colors.WHITE, - }, value: { fontSize: 20, fontWeight: '200', @@ -411,33 +395,11 @@ const styles = StyleSheet.create({ textAlign: 'center', color: '#ffffff', }, - - buttonTouchable: { - borderRadius: 12, - backgroundColor: '#665eff', - height: 52, - alignSelf: 'center', - width: width * 0.7866, - marginTop: 30, - justifyContent: 'center', - }, - buttonText: { - fontFamily: fontFamily.primaryBold, - fontSize: 14, - lineHeight: 19, - letterSpacing: 0, - textAlign: 'center', - color: '#ffffff', - }, headerTitle: { fontSize: 24, fontFamily: fontFamily.primaryBold, color: Colors.VIOLET_TEXT, }, - backArrow: { - height: 18, - width: 18.48, - }, sectionDescription: { fontSize: 18, lineHeight: 24, diff --git a/app/views/Export.js b/app/views/Export.js index 2ec78f0d16..48f24b2a27 100644 --- a/app/views/Export.js +++ b/app/views/Export.js @@ -4,30 +4,25 @@ import { StyleSheet, View, Text, - Image, TouchableOpacity, BackHandler, StatusBar, ScrollView, - Platform, } from 'react-native'; import PropTypes from 'prop-types'; import { useFocusEffect, useNavigation } from '@react-navigation/native'; import RNFetchBlob from 'rn-fetch-blob'; import RNFS from 'react-native-fs'; import Share from 'react-native-share'; -// import colors from '../constants/colors'; import fontFamily from '../constants/fonts'; import { GetStoreData } from '../helpers/General'; import { timeSincePoint } from '../helpers/convertPointsToString'; import LocationServices, { LocationData } from '../services/LocationService'; -import backArrow from './../assets/images/backArrow.png'; import { isPlatformiOS } from './../Util'; import LinearGradient from 'react-native-linear-gradient'; import Colors from '../constants/colors'; import languages from './../locales/languages'; -import licenses from './../assets/LICENSE.json'; import { SvgXml } from 'react-native-svg'; import close from './../assets/svgs/close'; import exportIcon from './../assets/svgs/export'; @@ -176,7 +171,6 @@ function ExportScreen(props) { } const styles = StyleSheet.create({ - // Container covers the entire screen topSafeAreaContainer: { flex: 0, backgroundColor: Colors.VIOLET_BUTTON, @@ -206,12 +200,6 @@ const styles = StyleSheet.create({ flex: 1, paddingHorizontal: 26, }, - row: { - flexDirection: 'row', - color: Colors.PRIMARY_TEXT, - alignItems: 'flex-start', - }, - exportSectionTitles: { color: Colors.WHITE, fontSize: 26, @@ -225,7 +213,6 @@ const styles = StyleSheet.create({ marginTop: 22, fontFamily: fontFamily.primaryRegular, }, - exportButton: { backgroundColor: Colors.WHITE, flexDirection: 'row', diff --git a/app/views/Import.js b/app/views/Import.js index c9eb5794d7..1d746cda6b 100644 --- a/app/views/Import.js +++ b/app/views/Import.js @@ -7,8 +7,6 @@ import { Dimensions, ActivityIndicator, } from 'react-native'; - -import colors from '../constants/colors'; import fontFamily from '../constants/fonts'; import WebView from 'react-native-webview'; import { SearchAndImport } from '../helpers/GoogleTakeOutAutoImport'; @@ -108,13 +106,6 @@ class ImportScreen extends Component { } const styles = StyleSheet.create({ - // Container covers the entire screen - container: { - flex: 1, - flexDirection: 'column', - color: colors.PRIMARY_TEXT, - backgroundColor: colors.WHITE, - }, subHeaderTitle: { textAlign: 'center', fontWeight: 'bold', diff --git a/app/views/Licenses.js b/app/views/Licenses.js index 155a9f4f3c..2d723641e9 100644 --- a/app/views/Licenses.js +++ b/app/views/Licenses.js @@ -13,7 +13,6 @@ import { } from 'react-native'; import { WebView } from 'react-native-webview'; import packageJson from '../../package.json'; - import Colors from '../constants/colors'; import fontFamily from '../constants/fonts'; import languages from './../locales/languages'; diff --git a/app/views/LocationTracking.js b/app/views/LocationTracking.js index 5f9639ea9e..f21ee459d1 100644 --- a/app/views/LocationTracking.js +++ b/app/views/LocationTracking.js @@ -1,7 +1,6 @@ import React, { Component } from 'react'; import { AppState, - SafeAreaView, StyleSheet, Linking, View, @@ -9,17 +8,10 @@ import { TouchableOpacity, Dimensions, Image, - ScrollView, BackHandler, ImageBackground, StatusBar, } from 'react-native'; -import { - Menu, - MenuOptions, - MenuOption, - MenuTrigger, -} from 'react-native-popup-menu'; import BackgroundImage from './../assets/images/launchScreenBackground.png'; import BackgroundImageAtRisk from './../assets/images/backgroundAtRisk.png'; import Colors from '../constants/colors'; @@ -39,8 +31,6 @@ import { RESULTS, openSettings, } from 'react-native-permissions'; -import foreArrow from './../assets/images/foreArrow.png'; - import { GetStoreData, SetStoreData } from '../helpers/General'; import languages from '../locales/languages'; @@ -50,7 +40,7 @@ import StateNoContact from './../assets/svgs/stateNoContact'; import StateUnknown from './../assets/svgs/stateUnknown'; import SettingsGear from './../assets/svgs/settingsGear'; import fontFamily from '../constants/fonts'; -import { PARTICIPATE, CROSSED_PATHS } from '../constants/storage'; +import { PARTICIPATE } from '../constants/storage'; const StateEnum = { UNKNOWN: 0, @@ -501,32 +491,6 @@ const styles = StyleSheet.create({ fontFamily: fontFamily.primaryLight, marginBottom: '8%', }, - mayoInfoRow: { - flexDirection: 'row', - justifyContent: 'space-between', - }, - mayoInfoContainer: { - flexDirection: 'column', - justifyContent: 'space-between', - alignContent: 'flex-end', - padding: 20, - }, - mainMayoHeader: { - textAlign: 'left', - color: Colors.MISCHKA, - fontSize: 18, - fontFamily: fontFamily.primaryBold, - }, - mainMayoSubtext: { - textAlign: 'left', - color: Colors.MISCHKA, - fontSize: 18, - fontFamily: fontFamily.primaryRegular, - }, - arrowContainer: { - alignSelf: 'center', - paddingRight: 20, - }, }); export default LocationTracking; diff --git a/app/views/MapLocation.js b/app/views/MapLocation.js index f6aef6f7e4..1dde354ba6 100644 --- a/app/views/MapLocation.js +++ b/app/views/MapLocation.js @@ -1,35 +1,9 @@ import React, { Component } from 'react'; - -import { - View, - Text, - StyleSheet, - ImageBackground, - StatusBar, -} from 'react-native'; -import { - check, - request, - PERMISSIONS, - RESULTS, - checkNotifications, - requestNotifications, -} from 'react-native-permissions'; -import languages from '../locales/languages'; -import ButtonWrapper from '../components/ButtonWrapper'; +import { View, Text, StyleSheet, StatusBar } from 'react-native'; import Colors from '../constants/colors'; -import { SetStoreData } from '../helpers/General'; -import MapView, { - Marker, - PROVIDER_GOOGLE, - Polyline, - Circle, -} from 'react-native-maps'; +import MapView, { PROVIDER_GOOGLE, Polyline, Circle } from 'react-native-maps'; import Geolocation from '@react-native-community/geolocation'; -import { isPlatformiOS } from './../Util'; import BottomSheet from 'reanimated-bottom-sheet'; -import { SvgXml } from 'react-native-svg'; -import fontFamily from '../constants/fonts'; import LocationServices, { LocationData } from '../services/LocationService'; const InitialRegion = { diff --git a/app/views/News.js b/app/views/News.js index 19d2050346..3c30e78efd 100644 --- a/app/views/News.js +++ b/app/views/News.js @@ -4,18 +4,12 @@ import { BackHandler, Dimensions, ActivityIndicator, - ScrollView, - SafeAreaView, View, - TouchableOpacity, - Image, Text, } from 'react-native'; import Carousel from 'react-native-snap-carousel'; import LinearGradient from 'react-native-linear-gradient'; - import { GetStoreData } from '../helpers/General'; -import colors from '../constants/colors'; import { WebView } from 'react-native-webview'; import languages from './../locales/languages'; // import { Colors } from 'react-native/Libraries/NewAppScreen'; @@ -166,22 +160,6 @@ class NewsScreen extends Component { } const styles = StyleSheet.create({ - // Container covers the entire screen - container: { - flex: 1, - flexDirection: 'column', - color: colors.PRIMARY_TEXT, - backgroundColor: colors.WHITE, - }, - web: { - width: '100%', - margin: 0, - padding: 0, - }, - slide: { - height: 100, - backgroundColor: 'rgba(20,20,200,0.3)', - }, singleNews: { flexGrow: 1, backgroundColor: 'rgba(255,255,255,0.6)', diff --git a/app/views/Notification.js b/app/views/Notification.js index 56aeb32765..e1f9d85f96 100644 --- a/app/views/Notification.js +++ b/app/views/Notification.js @@ -1,30 +1,18 @@ import React, { Component } from 'react'; import { - SafeAreaView, StyleSheet, View, Text, - Image, Dimensions, TouchableOpacity, BackHandler, ScrollView, } from 'react-native'; -import { WebView } from 'react-native-webview'; -import packageJson from '../../package.json'; - import colors from '../constants/colors'; import fontFamily from '../constants/fonts'; -import backArrow from './../assets/images/backArrow.png'; import languages from './../locales/languages'; -import AsyncStorage from '@react-native-community/async-storage'; -import { GetStoreData, SetStoreData } from '../helpers/General'; -import { - VictoryBar, - VictoryAxis, - VictoryChart, - VictoryTooltip, -} from 'victory-native'; +import { GetStoreData } from '../helpers/General'; +import { VictoryBar, VictoryAxis, VictoryChart } from 'victory-native'; import Colors from '../constants/colors'; import NavigationBarWrapper from '../components/NavigationBarWrapper'; import { CROSSED_PATHS } from '../constants/storage'; @@ -255,24 +243,11 @@ class NotificationScreen extends Component { } const styles = StyleSheet.create({ - // Container covers the entire screen - container: { - flex: 1, - flexDirection: 'column', - color: colors.PRIMARY_TEXT, - backgroundColor: colors.WHITE, - }, main: { flex: 1, paddingVertical: 20, width: '100%', }, - row: { - flex: 1, - flexDirection: 'row', - color: colors.PRIMARY_TEXT, - backgroundColor: colors.WHITE, - }, buttonTouchable: { borderRadius: 12, backgroundColor: '#665eff', @@ -308,22 +283,6 @@ const styles = StyleSheet.create({ fontFamily: fontFamily.primaryRegular, marginLeft: 20, }, - backArrow: { - height: 18, - width: 18.48, - }, - notificationsHeader: { - backgroundColor: '#665eff', - width: '100%', - paddingHorizontal: 20, - paddingVertical: 14, - }, - notificationsHeaderText: { - color: colors.WHITE, - fontSize: 18, - lineHeight: 22, - fontFamily: fontFamily.primaryBold, - }, notificationView: { width: '100%', paddingVertical: 5, diff --git a/app/views/Overlap.js b/app/views/Overlap.js index ee0529e0e3..fe2c3dcc44 100644 --- a/app/views/Overlap.js +++ b/app/views/Overlap.js @@ -8,8 +8,8 @@ import { TouchableOpacity, BackHandler, Modal, - Image, TouchableHighlight, + Alert, } from 'react-native'; import { useFocusEffect, useNavigation } from '@react-navigation/native'; import MapView, { Marker, PROVIDER_GOOGLE } from 'react-native-maps'; @@ -20,7 +20,6 @@ import greenMarker from '../assets/images/user-green.png'; import languages from '../locales/languages'; import CustomCircle from '../helpers/customCircle'; import fontFamily from '../constants/fonts'; - import { PUBLIC_DATA_URL } from '../constants/authorities'; import { LOCATION_DATA } from '../constants/storage'; @@ -71,7 +70,7 @@ function distance(lat1, lon1, lat2, lon2) { } function OverlapScreen(props) { - const [region, setRegion] = useState({}); + //const [region, setRegion] = useState({}); const [markers, setMarkers] = useState([]); const [circles, setCircles] = useState([]); const [showButton, setShowButton] = useState({ @@ -80,7 +79,7 @@ function OverlapScreen(props) { }); const [modalVisible, setModalVisible] = useState(false); const [initialRegion, setInitialRegion] = useState(INITIAL_REGION); - const { navigate } = useNavigation(); + //const { navigate } = useNavigation(); const mapView = useRef(); try { @@ -210,8 +209,8 @@ function OverlapScreen(props) { async function parseCSV(records) { try { - const latestLat = initialRegion.latitude; - const latestLong = initialRegion.longitude; + /* const latestLat = initialRegion.latitude; + const latestLong = initialRegion.longitude; */ const rows = records.split('\n'); const parsedRows = {}; @@ -274,7 +273,7 @@ function OverlapScreen(props) { function backToMain() { props.navigation.goBack(); } - function setVisible(){ + function setVisible() { setModalVisible(true); } @@ -306,61 +305,72 @@ function OverlapScreen(props) { + onInfoTapped={setVisible.bind()}> - - { - modalVisible && + {modalVisible && ( { - console.log("Modal has been closed"); - }} - > - + Alert.alert('Modal has been closed.'); + }}> + - { setModalVisible(!modalVisible); - }} - > - + }}> - + {languages.t('label.overlap_para_1')} - - Linking.openURL('https://github.com/beoutbreakprepared/nCoV2019') + Linking.openURL( + 'https://github.com/beoutbreakprepared/nCoV2019', + ) }> {languages.t('label.nCoV2019_url_info')}{' '} - - {"OK"} + + {'OK'} - - - } - + + )} - } @@ -407,19 +416,12 @@ function OverlapScreen(props) { } const styles = StyleSheet.create({ - // Container covers the entire screen - container: { - flex: 1, - }, - headerTitle: { - fontSize: 24, - fontFamily: fontFamily.primaryRegular, - }, main: { flex: 1, }, map: { flex: 1, + ...StyleSheet.absoluteFillObject, }, description: { flex: 0.5, @@ -441,23 +443,6 @@ const styles = StyleSheet.create({ textAlign: 'center', color: '#ffffff', }, - headerContainer: { - flexDirection: 'row', - height: 60, - borderBottomWidth: 1, - borderBottomColor: 'rgba(189, 195, 199,0.6)', - alignItems: 'center', - }, - backArrowTouchable: { - width: 60, - height: 60, - paddingTop: 21, - paddingLeft: 20, - }, - backArrow: { - height: 18, - width: 18.48, - }, sectionDescription: { fontSize: 16, lineHeight: 24, @@ -477,36 +462,38 @@ const styles = StyleSheet.create({ padding: 4, paddingBottom: 5, }, - mapFooter:{ - position:'absolute', - justifyContent:"flex-end", - bottom:30, - alignSelf:"center", + mapFooter: { + flex: 1, + position: 'relative', + justifyContent: 'flex-end', + alignSelf: 'center', + marginBottom: 35, }, centeredView: { - justifyContent: "center", - alignItems: "center", - marginTop: 10 + flex: 1, + justifyContent: 'center', + alignItems: 'center', + marginTop: 10, }, modalView: { margin: 20, - backgroundColor: "#fff", + backgroundColor: '#fff', borderRadius: 10, - alignItems: "center", - shadowColor: "#000", + alignItems: 'center', + shadowColor: '#000', shadowOffset: { width: 0, - height: 2 + height: 2, }, shadowOpacity: 0.25, shadowRadius: 3.84, - elevation: 5 + elevation: 5, }, openButton: { - backgroundColor: "#333333", + backgroundColor: '#333333', borderRadius: 10, padding: 10, - elevation: 2 + elevation: 2, }, overlay: { position: 'absolute', @@ -514,12 +501,12 @@ const styles = StyleSheet.create({ right: 0, bottom: 0, left: 0, - backgroundColor: "#06273F80", + backgroundColor: '#06273F80', + }, + okButton: { + paddingTop: 5, + color: 'white', }, - okButton:{ - paddingTop:5, - color:"white" - } }); const customMapStyles = [