Skip to content

Commit

Permalink
Merge pull request #4 from tripleblindmarket/develop
Browse files Browse the repository at this point in the history
Merge
  • Loading branch information
harshvitra authored Mar 24, 2020
2 parents 8844ba8 + 8d74174 commit 222c29f
Show file tree
Hide file tree
Showing 73 changed files with 9,771 additions and 6,322 deletions.
2 changes: 1 addition & 1 deletion .prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
bracketSpacing: false,
bracketSpacing: true,
jsxBracketSameLine: true,
singleQuote: true,
trailingComma: 'all',
Expand Down
12 changes: 5 additions & 7 deletions App.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,15 @@
*/

import React from 'react';
import {
StatusBar
} from 'react-native';

import { StatusBar } from 'react-native';
import { MenuProvider } from 'react-native-popup-menu';
import Entry from './app/Entry';

const App: () => React$Node = () => {
return (
<>
<Entry></Entry>
</>
<MenuProvider>
<Entry />
</MenuProvider>
);
};

Expand Down
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md → CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ prepare and submit a pull request.

* You need a Github account. You can [create one](https://github.com/signup/free)
for free.
* Submit an [Issue](https://github.com/tripleblind/mobileapp/issues) against
* Submit an [Issue](https://github.com/tripleblindmarket/private-kit/issues) against
the repo to describe the idea or problem if there is not one yet.
* Describe a bug by including steps to reproduce and earliest version you
know is affected.
Expand Down
19 changes: 8 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,14 @@ Private Kit’s trail generator logs your device’s location once every five mi

**Downloads:** [Google Play](https://play.google.com/store/apps/details?id=edu.mit.privatekit) | [Apple Store](https://apps.apple.com/us/app/private-kit-prototype/id1501903733)

# Development
# Development Overview

This is a React Native app version 61.5

## Architecture

Please refer to `docs/Private Kit Diagram.png` for a basic overview on the sequencing of generalized events and services that are utilized by Private Kit.

## Developer Setup

Refer to and run the dev_setup.sh for needed tools.
Expand All @@ -50,20 +54,13 @@ or
npx react-native run-ios --simulator="iPhone 8 Plus"
```

----------------------------------------------------------------------------------
NOTE: In some cases, the abovementioned procedure leads to the error 'Failed to load bundle - Could not connect to development server'. In these cases, kill all other react-native processes and try it again.
----------------------------------------------------------------------------------

## Contributing

Read the [contribution guidelines](./.github/CONTRIBUTING.md).

Join the WhatsApp group - https://chat.whatsapp.com/HXonYGVeAwQIKxO0HYlxYL
Read the [contribution guidelines](CONTRIBUTING.md).

## Tested On
WhatsApp: https://chat.whatsapp.com/HXonYGVeAwQIKxO0HYlxYL
Slack: https://safepathsprivatekit.slack.com/

| Device | Version |
| ------------- | ------------- |
| Android Pixel | API 28 |
| Android Pixel | API 29 |

35 changes: 33 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,9 @@ android {
applicationId "edu.mit.privatekit"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 8
versionName "0.5.3"
multiDexEnabled true
versionCode 11
versionName "0.5.4"
}
splits {
abi {
Expand Down Expand Up @@ -205,8 +206,38 @@ dependencies {
} else {
implementation jscFlavor
}

implementation(project(':react-native-maps')){
exclude group: 'com.google.android.gms', module: 'play-services-base'
exclude group: 'com.google.android.gms', module: 'play-services-maps'
}
implementation 'com.google.android.gms:play-services-base:10.0.1'
implementation 'com.google.android.gms:play-services-maps:10.0.1'
}

// Just to fix the app start crash error
allprojects {
repositories {
//start here
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def requested = details.requested
if (requested.group == 'com.google.android.gms') {
details.useVersion '12.0.1'
}
if (requested.group == 'com.google.firebase') {
details.useVersion '12.0.1'
}
}
}
//end
jcenter()
maven {
url "https://maven.google.com"
}
}
}

// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
Expand Down
4 changes: 4 additions & 0 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
android:roundIcon="@mipmap/ic_launcher"
android:allowBackup="false"
android:theme="@style/AppTheme">
<uses-library android:name="org.apache.http.legacy" android:required="false"/>
<activity
android:name=".MainActivity"
android:label="@string/app_name"
Expand All @@ -31,6 +32,9 @@
<!-- Change the resource name to your App's accent color - or any other color you want -->
<meta-data android:name="com.dieam.reactnativepushnotification.notification_color"
android:resource="@android:color/white"/>
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="AIzaSyDNplqevzMxOGNuTr_lv6NXsjzIa1PboVc"/>

<service
android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationListenerService"
Expand Down
1 change: 1 addition & 0 deletions android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@

android.useAndroidX=true
android.enableJetifier=true
# googlePlayServicesVersion=12.0.1
105 changes: 58 additions & 47 deletions app/Entry.js
Original file line number Diff line number Diff line change
@@ -1,92 +1,103 @@
import React, {Component } from 'react';
import React, { Component } from 'react';

import {NavigationContainer} from '@react-navigation/native';
import {createStackNavigator} from '@react-navigation/stack';
import {SafeAreaView} from 'react-native';
import { NavigationContainer } from '@react-navigation/native';
import { createStackNavigator } from '@react-navigation/stack';
import { SafeAreaView } from 'react-native';
import LocationTracking from './views/LocationTracking';
import Welcome from './views/Welcome';
import NewsScreen from './views/News';
import ExportScreen from './views/Export';
import ImportScreen from './views/Import';
import OverlapScreen from './views/Overlap';
import LicencesScreen from './views/Licenses';
import Slider from './views/welcomeScreens/Slider';
import {GetStoreData, SetStoreData} from './helpers/General';
import { GetStoreData, SetStoreData } from './helpers/General';

const Stack = createStackNavigator();

class Entry extends Component {
constructor(props) {
super(props);
this.state={
initialRouteName:''
}
}

componentDidMount(){
GetStoreData('PARTICIPATE')
constructor(props) {
super(props);
this.state = {
initialRouteName: '',
};
}

componentDidMount() {
GetStoreData('PARTICIPATE')
.then(isParticipating => {
console.log(isParticipating);
this.setState({
initialRouteName:isParticipating
})
console.log(isParticipating);
this.setState({
initialRouteName: isParticipating,
});
})
.catch(error => console.log(error))
}
.catch(error => console.log(error));
}

render() {
return (
<NavigationContainer>
<SafeAreaView style={{flex:1}}>
<Stack.Navigator initialRouteName='InitialScreen'>
render() {
return (
<NavigationContainer>
<SafeAreaView style={{ flex: 1 }}>
<Stack.Navigator initialRouteName="InitialScreen">
{this.state.initialRouteName === 'true' ? (
<Stack.Screen
name="InitialScreen"
component={LocationTracking}
options={{headerShown:false}}
/>
):(
name="InitialScreen"
component={LocationTracking}
options={{ headerShown: false }}
/>
) : (
<Stack.Screen
name="InitialScreen"
component={Slider}
options={{headerShown:false}}
/>
name="InitialScreen"
component={Slider}
options={{ headerShown: false }}
/>
)}
<Stack.Screen
<Stack.Screen
name="Slider"
component={Slider}
options={{headerShown:false}}
/>


options={{ headerShown: false }}
/>
<Stack.Screen
name="WelcomeScreen"
component={Welcome}
options={{headerShown:false}}
/>
options={{ headerShown: false }}
/>
<Stack.Screen
name="LocationTrackingScreen"
component={LocationTracking}
options={{headerShown:false}}
options={{ headerShown: false }}
/>
<Stack.Screen
name="NewsScreen"
component={NewsScreen}
options={{headerShown:false}}
options={{ headerShown: false }}
/>
<Stack.Screen
name="ExportScreen"
component={ExportScreen}
options={{headerShown:false}}
options={{ headerShown: false }}
/>
<Stack.Screen
name="ImportScreen"
component={ImportScreen}
options={{ headerShown: false }}
/>
<Stack.Screen
name="LicensesScreen"
component={LicencesScreen}
options={{ headerShown: false }}
/>
<Stack.Screen
name="OverlapScreen"
component={OverlapScreen}
options={{headerShown:false}}
/>
</Stack.Navigator>
</SafeAreaView>
</NavigationContainer>
)
}
</SafeAreaView>
</NavigationContainer>
);
}
}

export default Entry;
Binary file added app/assets/images/kebabIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 16 additions & 11 deletions app/components/Button.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from "react";
import { StyleSheet, Text, TouchableOpacity } from "react-native";
import colors from "../constants/colors";
import * as React from 'react';
import { StyleSheet, Text, TouchableOpacity } from 'react-native';
import colors from '../constants/colors';

interface Props {
label: string;
Expand All @@ -12,7 +12,12 @@ class Button extends React.Component<Props> {
render() {
const { title, onPress, bgColor } = this.props;
return (
<TouchableOpacity style={[styles.container, {backgroundColor: bgColor || colors.DODGER_BLUE}]} onPress={onPress} >
<TouchableOpacity
style={[
styles.container,
{ backgroundColor: bgColor || colors.DODGER_BLUE },
]}
onPress={onPress}>
<Text style={styles.text}>{title}</Text>
</TouchableOpacity>
);
Expand All @@ -21,21 +26,21 @@ class Button extends React.Component<Props> {

const styles = StyleSheet.create({
container: {
width: "100%",
alignItems: "center",
justifyContent: "center",
width: '100%',
alignItems: 'center',
justifyContent: 'center',
paddingVertical: 12,
borderRadius: 4,
borderWidth: StyleSheet.hairlineWidth,
borderColor: "rgba(255,255,255,0.7)"
borderColor: 'rgba(255,255,255,0.7)',
},
text: {
color: colors.WHITE,
textAlign: "center",
textAlign: 'center',
height: 28,
fontSize: 20,
fontWeight: '600',
}
},
});

export default Button;
export default Button;
26 changes: 13 additions & 13 deletions app/constants/colors.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
const colors = {
BLACK: "#000",
WHITE: "#FFF",
DODGER_BLUE: "#428AF8",
SILVER: "#BEBEBE",
TORCH_RED: "#F8262F",
MISCHKA: "#E5E4E6",
BLACK: '#000',
WHITE: '#FFF',
DODGER_BLUE: '#428AF8',
SILVER: '#BEBEBE',
TORCH_RED: '#F8262F',
MISCHKA: '#E5E4E6',
APP_BACKGROUND: '#FFF8ED',
PRIMARY_TEXT: "#000",
GREEN: "#32A852",
VIOLET: "#6C3794",
PRIMARY_TEXT: '#000',
GREEN: '#32A852',
VIOLET: '#6C3794',

REG_BUTTON: "#428AF8",
POS_BUTTON: "#32A852",
NEG_BUTTON: "#F8262F",
SENS_BUTTON: "#6C3794"
REG_BUTTON: '#428AF8',
POS_BUTTON: '#32A852',
NEG_BUTTON: '#F8262F',
SENS_BUTTON: '#6C3794',
};

export default colors;
Loading

0 comments on commit 222c29f

Please sign in to comment.