Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

latest from march 29 #7

Merged
merged 12 commits into from
Mar 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,6 @@ buck-out/

# CocoaPods
/ios/Pods/
yarn.lock
.vscode/launch.json
ios/Podfile.lock
1 change: 1 addition & 0 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ android {
}

dependencies {
implementation project(':react-native-svg')
implementation project(':react-native-webview')
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.facebook.react:react-native:+" // From node_modules
Expand Down
3 changes: 3 additions & 0 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>

<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

<application
android:name=".MainApplication"
android:label="@string/app_name"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import android.content.Context;
import com.facebook.react.PackageList;
import com.facebook.react.ReactApplication;
import com.horcrux.svg.SvgPackage;
import com.reactnativecommunity.webview.RNCWebViewPackage;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
Expand Down
2 changes: 2 additions & 0 deletions android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
rootProject.name = 'PrivateKit'
include ':react-native-svg'
project(':react-native-svg').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-svg/android')
include ':react-native-fs'
project(':react-native-fs').projectDir = new File(settingsDir, '../node_modules/react-native-fs/android')
include ':react-native-zip-archive'
Expand Down
6 changes: 6 additions & 0 deletions app/Entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import ExportScreen from './views/Export';
import ImportScreen from './views/Import';
import OverlapScreen from './views/Overlap';
import LicencesScreen from './views/Licenses';
import NotificationScreen from './views/Notification';
import Slider from './views/welcomeScreens/Slider';
import { GetStoreData } from './helpers/General';

Expand Down Expand Up @@ -87,6 +88,11 @@ class Entry extends Component {
component={LicencesScreen}
options={{ headerShown: false }}
/>
<Stack.Screen
name='NotificationScreen'
component={NotificationScreen}
options={{ headerShown: false }}
/>
<Stack.Screen
name='OverlapScreen'
component={OverlapScreen}
Expand Down
Binary file added app/assets/images/user-green.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions app/constants/colors.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ const colors = {
PRIMARY_TEXT: '#000',
GREEN: '#32A852',
VIOLET: '#6C3794',
RED: '#e74c3c',
ORANGE: '#e67e22',

REG_BUTTON: '#428AF8',
POS_BUTTON: '#32A852',
Expand Down
94 changes: 45 additions & 49 deletions app/helpers/convertPointsToString.js
Original file line number Diff line number Diff line change
@@ -1,51 +1,47 @@
export function convertPointsToString(count) {
// For testing Manually override count
// count = 3000

// Get minutes
let tot_mins = count * 5;

// Calculate days
let days = tot_mins / 60 / 24;
let rdays = Math.floor(days);

// Calculate Hours
let hours = (days - rdays) * 24;
let rhours = Math.floor(hours);

// Calculate Minutes
let minutes = (hours - rhours) * 60;
let rminutes = Math.round(minutes);

if (rdays > 0) {
if (rdays > 1) {
if (rhours > 1) {
return (
rdays + ' days, ' + rhours + ' hours and ' + rminutes + ' minutes.'
);
} else {
return (
rdays + ' days, ' + rhours + ' hour and ' + rminutes + ' minutes.'
);
}
} else {
if (rhours > 1) {
return (
rdays + ' day, ' + rhours + ' hours and ' + rminutes + ' minutes.'
);
} else {
return (
rdays + ' day, ' + rhours + ' hour and ' + rminutes + ' minutes.'
);
}
}
} else if (rhours > 0) {
if (rhours > 1) {
return rhours + ' hours and ' + rminutes + ' minutes.';
} else {
return rhours + ' hour and ' + rminutes + ' minutes.';
}
} else {
return rminutes + ' minutes.';
import pluralize from 'pluralize';
import languages from './../locales/languages';

export function timeSincePoint(point) {
if (!point) {
return languages.t('label.no_data');
}

const pointDays = point ? daysDifferenceFromNow(point.time) : null;
const pointHours = point ? hoursDifferenceFromNow(point.time) : null;
const pointMinutes = point ? minutesDifferenceFromNow(point.time) : null;
const pointTime = [
pointDays > 0 ? pluralize('day', pointDays, true) : null,
pointHours > 0 ? pluralize('hour', pointHours, true) : null,
pointMinutes > 0
? pluralize('minute', pointMinutes, true)
: languages.t('label.less_than_one_minute'),
]
.filter(item => item)
.join(' ');

return pointTime;
}

function daysDifferenceFromNow(timestamp) {
var difference = now() - timestamp;
var daysDifference = Math.floor(difference / 1000 / 60 / 60 / 24);
return daysDifference;
}

function hoursDifferenceFromNow(timestamp) {
var difference = now() - timestamp;
var hoursDifference = Math.floor(difference / 1000 / 60 / 60);
return hoursDifference % 24;
}

function minutesDifferenceFromNow(timestamp) {
var difference = now() - timestamp;
var minutesDifference = Math.floor(difference / 1000 / 60);

return minutesDifference % 60;
}

function now() {
let nowUTC = new Date().toISOString();
return Date.parse(nowUTC);
}
9 changes: 7 additions & 2 deletions app/locales/de/exportscreen.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,10 @@
"export_para_1":"You can share your location trail with anyone using the Share button below. Once you press the button it will ask you with whom and how you want to share it.",
"export_para_2":"Location is shared as a simple list of times and coordinates, no other identifying information.",
"share":"SHARE",
"data_hint":"Log has data of"
}
"data_hint":"Log has data of",
"data_covers":"Total time the log covers:",
"data_count":"Number of points logged:",
"data_last_updated":"Time since last updated:",
"no_data": "No data",
"less_than_one_minute": "less than 1 minute"
}
7 changes: 6 additions & 1 deletion app/locales/en/exportscreen.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,10 @@
"export_para_1":"You can share your location trail with anyone using the Share button below. Once you press the button it will ask you with whom and how you want to share it.",
"export_para_2":"Location is shared as a simple list of times and coordinates, no other identifying information.",
"share":"SHARE",
"data_hint":"Log has data of"
"data_hint":"Log has data of",
"data_covers":"Total time the log covers:",
"data_count":"Number of points logged:",
"data_last_updated":"Time since last updated:",
"no_data": "No data",
"less_than_one_minute": "less than 1 minute"
}
14 changes: 8 additions & 6 deletions app/locales/en/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ import importFile from './import.json';
import exportFile from './exportscreen.json';
import licensesFile from './licensesscreen.json';
import overlapFile from './overlap.json';
import notificationFile from './notification.json';

export default {
...intro,
...locationTracking,
...importFile,
...exportFile,
...overlapFile,
...licensesFile,
...intro,
...locationTracking,
...importFile,
...exportFile,
...overlapFile,
...licensesFile,
...notificationFile,
};
8 changes: 8 additions & 0 deletions app/locales/en/notification.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"notification_main_text": "Check your Intersection day wise",
"notification_title": "Analyze your intersection",
"notification_data_not_available": "\n\nYou do not have any trails downloaded!\n\n",
"notification_warning_text": "You can press the following button to generate random intersections.\nWARNING: These are simulated intersections not real",
"notification_random_data_button": "Press this button to generate random data",
"notifications":"Notifications"
}
4 changes: 2 additions & 2 deletions app/locales/en/overlap.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"overlap_title": "Check Overlap",
"overlap_para_1": "Green circles are clusters of your locations, click to zoom. Red markers are your recorded locations.\n\nPress the button to download public information of confirmed cases, shown as faint purple circles.",
"show_overlap": "Check Public Data",
"overlap_para_1": "The green trail represents your location history\n\nThe light purple circles represent the public dataset",
"show_overlap": "Click to view the public dataset",
"loading_public_data": "loading data...",
"overlap_no_results_button_label": "Public Data Loaded",
"overlap_found_button_label": "Public Data Loaded",
Expand Down
6 changes: 6 additions & 0 deletions app/locales/es/exportscreen.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"export_para_1":"Puedes compartir tu historial de ubicaciones usando el botón Compartir. Una vez hayas pulsado, tú decides con quién y cómo quieres compartir esta información",
"export_para_2":"Tu historial de ubicaciones se compartirá como una lista de coordenadas en el tiempo, sin revelar ningún dato personal",
"share":"COMPARTIR",
"data_hint":"Tienes información acumulada de"
}
5 changes: 5 additions & 0 deletions app/locales/es/import.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"import_title":"Importar ubicaciones",
"import_step_1":"1. Inicia sesión en tu cuenta de Google y descarga tu historial de ubicaciones",
"import_step_2":"2. Después de la descarga, vuelve a abrir esta ventana. Tus datos se importarán de forma automática"
}
15 changes: 15 additions & 0 deletions app/locales/es/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import intro from './intro.json';
import locationTracking from './locationTracking.json';
import importFile from './import.json';
import exportFile from './exportscreen.json';
import licensesFile from './licensesscreen.json';
import overlapFile from './overlap.json';

export default {
...intro,
...locationTracking,
...importFile,
...exportFile,
...overlapFile,
...licensesFile,
};
14 changes: 14 additions & 0 deletions app/locales/es/intro.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"private_kit":"Private Kit",
"intro1_para1":"Diseñada para dar máxima prioridad a la seguridad y privacidad de tus datos, el Private Kit del MIT utiliza tecnología punta para elaborar tu historial de ubicaciones de forma segura.",
"next":"SIGUIENTE",
"back":"ATRÁS",
"start":"INICIA",
"intro2_title1":"Menos de 100KB",
"intro2_para1":"Private Kit recopila datos sobre tu historial de ubicaciones y lo convierte en un archivo con menos de 100KB de memoria – ocupa menos memoria que una foto.",
"intro2_title2":"Compartir información depende de ti",
"intro2_para2": "Tu información nunca saldrá de tu dispositivo sin tu consentimiento",
"intro3_title1":"El futuro",
"intro3_para1": "Pensada para resolver los problemas de hoy y mañana permitiendo a los usuarios registrar su recorrido, ofrece nuevas oportunidades para investigadores que estudien la evolución de las epidemias, los movimientos de refugiados, y el análisis de tráfico de nuestras comunidades.",
"intro3_para2":"Descubre más en http://privatekit.mit.edu/"
}
3 changes: 3 additions & 0 deletions app/locales/es/licensesscreen.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"license_placeholder": "App desarrollada bajo la licencia del MIT."
}
13 changes: 13 additions & 0 deletions app/locales/es/locationTracking.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"start_logging":"INICIAR REGISTRO",
"stop_logging":"PARAR REGISTRO",
"logging_message":"La app está ahora mismo haciendo un seguimiento de tu ubicación de forma privada cada 5 minutos. Tu registro de ubicaciones NO sale de tu teléfono",
"not_logging_message":"AVISO: Después de hacer click en este botón, es posible que se te pida que permitas acceso a Private Kit a tu localización.",
"import":"Importar",
"export":"Exportar",
"news":"Notícias",
"latest_news":"Últimas notícias",
"url_info":"Para más información visita la página de inicio de la web de Private Kit",
"private_kit_url":"privatekit.mit.edu",
"overlap": "Comprobar posibles puntos de encuentro"
}
10 changes: 10 additions & 0 deletions app/locales/es/overlap.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"overlap_title": "Comprobar posibles puntos de encuentro",
"overlap_para_1": "Los círculos verdes indican las ubicaciones en las que te has registrado más veces. Amplia el mapa para ver los marcadores rojos, que indican tus ubicaciones exactas guardadas en cada momento. \n\nHaz click en el botón para descargar la información pública sobre casos confirmados, que se muestra con los círculos de color púrpura claro.",
"show_overlap": "Incorporar información pública",
"loading_public_data": "cargando datos...",
"overlap_no_results_button_label": "Información pública incorporada",
"overlap_found_button_label": "Información pública incorporada",
"nCoV2019_url_info": "Para obtener más información sobre los datos detrás de este mapa",
"nCoV2019_url": "github.com/beoutbreakprepared/nCoV2019"
}
9 changes: 7 additions & 2 deletions app/locales/fr/exportscreen.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,10 @@
"export_para_1":"You can share your location trail with anyone using the Share button below. Once you press the button it will ask you with whom and how you want to share it.",
"export_para_2":"Location is shared as a simple list of times and coordinates, no other identifying information.",
"share":"SHARE",
"data_hint":"Log has data of"
}
"data_hint":"Log has data of",
"data_covers":"Total time the log covers:",
"data_count":"Number of points logged:",
"data_last_updated":"Time since last updated:",
"no_data": "No data",
"less_than_one_minute": "less than 1 minute"
}
9 changes: 7 additions & 2 deletions app/locales/hi/exportscreen.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,10 @@
"export_para_1":"आप नीचे दिए गए शेयर बटन का उपयोग करके किसी के साथ भी अपना लोकेशन ट्रेल शेयर कर सकते हैं। बटन दबाते ही यह आपसे पूछेगा कि आप इसे किससे और कैसे शेयर करना चाहते हैं।",
"export_para_2":"स्थान को समय और निर्देशांक की एक सरल सूची के रूप में शेयर किया जाता है, कोई अन्य पहचान करने वाली जानकारी नहीं।",
"share":"शेयर",
"data_hint":"लॉग का डेटा:"
}
"data_hint":"लॉग का डेटा:",
"data_covers":"Total time the log covers:",
"data_count":"Number of points logged:",
"data_last_updated":"Time since last updated:",
"no_data": "No data",
"less_than_one_minute": "less than 1 minute"
}
6 changes: 6 additions & 0 deletions app/locales/ht/exportscreen.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"export_para_1":"Ou ka pataje pozisyon kote ou ye a ak nenpòt moun lèw itilize bouton pataje anba a. Lèw fin peze bouton an li pral mande w ak ki moun e kijan ou vle pataje li.",
"export_para_2":"Lokalizasyon yo prale nan fòm yon senp lis lè ak kowòdone zòn yo. San okenn enfòmasyon pèsonèl moun",
"share":"PATAJE",
"data_hint":"Men Done ki sou koneksyon an"
}
5 changes: 5 additions & 0 deletions app/locales/ht/import.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"import_title":"Resevwa Pozisyon",
"import_step_1":"1. Konekte sou kont Google ou e telechaje list tout kote ou te ye",
"import_step_2":"2. Lè w fin telechaje l, louvri ekran ankò. Tout done ou yo ap monte otomatikman"
}
15 changes: 15 additions & 0 deletions app/locales/ht/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import intro from './intro.json';
import locationTracking from './locationTracking.json';
import importFile from './import.json';
import exportFile from './exportscreen.json';
import licensesFile from './licensesscreen.json';
import overlapFile from './overlap.json';

export default {
...intro,
...locationTracking,
...importFile,
...exportFile,
...overlapFile,
...licensesFile,
};
14 changes: 14 additions & 0 deletions app/locales/ht/intro.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"private_kit":"Private Kit: Chase Kowona",
"intro1_para1":"Antan ke yon enstriman ki fèt ak yon sistèm sekirite done ak pwoteksyon vi prive ki entegre ladanl, MIT Private Kit: Chase Kowona reprezante pwochen generasyon ki sekirize tout kote w pase.",
"next":"Kontinye",
"back":"Retounen",
"start":"Kòmanse",
"intro2_title1":"Pi piti pase 100KB",
"intro2_para1":"Private Kit: Chase Kowona sa trete done lokalizasyon aparèy ou nan mwens pase 100KB espas - kidonk mwens espas pase yon sèl grenn foto pran sou aparèy ou.",
"intro2_title2":"Ou gen kontròl tout bagay",
"intro2_para2": "Okenn done pap transfere, ni soti sou aparèy ou an san otorizasyon ou",
"intro3_title1":"Lavni",
"intro3_para1": "Pwochen etap nan rezoud problèm ki gen jodia ak sa ki kapab prezante demen yo, se pèmèt chak moun louvri yon sesyon kap konekte ak lokalizasyon yo. Sa pral ofri opòtinite a syantifik yo pou yo etidye evolisyon pandemi, deplasman imigran yo e analize trafic rout nan kestion deplasman kominote a.",
"intro3_para2":"Konnen plis ankò http://privatekit.mit.edu/"
}
3 changes: 3 additions & 0 deletions app/locales/ht/licensesscreen.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"license_placeholder": "Aplikasyon sa kreye an akò ak lisans MIT."
}
13 changes: 13 additions & 0 deletions app/locales/ht/locationTracking.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"start_logging":"KOMANSE KONEKSYON",
"stop_logging":"KANPE KONEKSYON",
"logging_message":"Li anrejistre pozisyon ou an prive chak senk (5) minit. Men okenn enfòmasyon sou pozisyon ou pap kite aparèy ou an.",
"not_logging_message":"Remak: Lèw fin klike sou bouton sa, sa ka rive yo mandew pouw ba Private Kit: Chase Kowona la otorizasyon poul gen aksè a pozisyon ou ye a.",
"import":"Pran done",
"export":"Voye done",
"news":"Nouvèl",
"latest_news":"Dènye Nouvèl",
"url_info":"Pou plis enfòmasyon vizite paj entènèt Private Kit: Chase Kowona",
"private_kit_url":"privatekit.mit.edu",
"overlap": "Konpare done"
}
Loading