Skip to content

Commit

Permalink
Added a three-dot menu button and licenses page to the main screen (L…
Browse files Browse the repository at this point in the history
…ocationTracking.js) (#142)

* Update README

* Add modal menu for licenses to main screen

* Share action (#28)

* Refactoring the copy-pasted buttons styles. (#26)

* Refactoring the copy-pasted buttons styles.

* Remove dead NegButton references

This also includes some code reformatting from VS Code, but mainly it
removes dangling references to the NegViews.

Co-authored-by: Steve Penrod <[email protected]>
Co-authored-by: Steve Penrod <[email protected]>

* Fix botched merge (missing comma) (#30)

* New Icon pack. (#32)

Using Adaptive Icons Android and preparing the app for release on the Apple Store.

* UI Tweaking and changed News URL (#33)

* Massaged the look of the UI on the sub-pages and the main page
* Added description text to the Export page
* Changed the URL of the webview to:  https://privatekit.mit.edu/views

* Curate and collapse GPS location data (#35)

This changes several things about the data being stored:
* The time being stored in the structure is now UTC.  It was previous local
  time
* The data being stored is now simplified to:
   [ (utc_unix_time, GPS lat, GPS lon) ... ]
* The stored data is now limited to 28 days

* Version 0.4 (#36)

* LocationServices Refactor (#37)

Creates Statically Typed LocationServices class to handle all background instantiation once.

BackgroundGeolocation is smart in itself and will handle any form of termination events.  In addition, the onListen event `stop` was added where future release can include a local push notification to tell the user that location services were terminated.

* Version0.4 for Apple Store. (#39)

* Add file based sharing (#38)

 - Allows the file to be shared instead of raw string

NOTES: This requires accessing the filesystem when you do an Export. Potentially we'll need to warn people this is going to cause a popup.

* Google Auto Import (Prototype) (#34)

Screen requests users to download the Google Takeout file for the Location History. 
After the download, users have to go back and come back to import. 

Watch the logs to see what the app is doing. We don't have the UI to let the user know the current progress yet.

* Adding initial license file (MIT) (#41)

lgtm

* Add helper scripts and update help messages (#29)

Adds two scripts to make it easy to start the react system and (re)run
the application within the emulator.  Simply run:
  1_start_react.sh
To install packages and start the react ecosystem, then run
  2_start_android_app.sh
To launch the application within the Android emulator (launching the
emulator automatically if necessary).

* Fix merge error (missing comma)

Merge ended up with a missing comma in the package.json

* Fix multi-log bug (#42)

When the application is already running, clicking on the icon (at
least under Android) would start another object for the logger.  This
does a quick instance count check to prevent multiple loggers.

* Fix several crashes due to renamed variable (#43)

It looks like the code got refactored and not all variables were renamed
during that, leading to some exceptions during import.  Just renamed vars
as appropriate.

* Version 0.5 (#44)

Importing Google Location History
Exporting functions

* add whatsapp group for tech people (#46)

* Updating README

* Initialize .github files (#48)

* Add contribution guide
* Initialize .github files
Helping others get started

* Bugfix for v0.5 (#52)

1. Package.json format must follow 0.0.0 version names. 
2. Version ID for the AppleStore and Android Stores are now the same.

* Fix to replace code lost during merge #37 (#55)

The LocationServices refactor merge lost the changes that happened to
adding "curation" to the point data (PR #35).  This restores it.

* Add point count info, assists in debugging (#56)

Now the Export screen shows a count of points to be exported.  This is
provides minimal information for debugging and to let the user understand
that something is happening in the background.

Co-authored-by: Abhishek Singh <[email protected]>

* GPS tracking wasn't running in many cases (#58)

The HeadlessTask part of the BackgroundLocationTracker component wasn't
being used.  On Android, it spins up a special background task when the
main application has been shutdown to continue grabbing points.

* Add 'yarn' support when found (#59)

Several people have said that 'yarn' works much better than 'npm', so I'm
making it the default if found.  If not, the script will still attempt to
run 'npm.

* add stationary location logging and savelocation in backgroundtask (#61)

* Add missing notifications for Location Services (#64)

* Add missing notifications for Location Services

Several conditions cause Private Kit to stop failing when it cannot access
GPS info.  We should notify the user when this has happened.  That includes:
* The app doesn't have proper permissions
* The permissions have been revoked
* The location service has been shut down

Still to do is a notification to show the user that the background service
is not doing anything when the user turns off location services.

* Fix auto-format errors

The automatic formatting done in "Javascript" style instead of
"React Native"

* use 5 minute time interval

Co-authored-by: Abhishek Singh <[email protected]>

* Andynuzzo/fix require cycles + Clearing all Warnings and Bug Fixes for iOS (#67)

* updated README.md

Made changes for developers on macOS with Xcode 10+

* Fixed Async storage, request cycles warnings

* using patch-package to work around RNFetchBlob recursive importing

* saving patch for RNFetchBlob recursive importing

* Putting native background geo back.

* re-fix AsyncStorage

* Fixing Background services not existing on iOS

* Fixing Internationalization on Xcode

* Import Alert and add stationarylocation logging

* capitalize L

Co-authored-by: Andy Nuzzo <[email protected]>
Co-authored-by: philrouge <[email protected]>
Co-authored-by: Abhishek Singh <[email protected]>

* Downloading a PR and Reviewing it. (#82)

Added info on how to download a PR from a Forked Repo in order to review it.

* RNFS.DownloadDirectoryPath is not defined on iOS.  (#76)

* RNFS.DownloadDirectoryPath is not defined on iOS. Figure out a way to access the Downloads folder.

* Version 0.5.1

* Feature/new ui (#81)

* UI changed, added Welcome Screens, changed location tracking screen

* Moved Styles

* Slider for welcome screens

* Navigate through pagination

* Set initial route

* SafeAreaView for ios

* Added image

* Set state to true

* Dot navigation fixed

* Android backhandler

* UI Designed for Export and Import Pages

* Latest news page UI

Co-authored-by: Harsh Vitra <[email protected]>

* Adding a MacOS GitHub Action to build both apps (#90)

* Update README

* RNFS.DownloadDirectoryPath is not defined on iOS. Figure out a way to access the Downloads folder.

* Version 0.5.1

* Testing iOS Action

* adding homebrew

* Adding node and java

* Installing Android Studio, SDK and Accepting licenses

* Fixing java

* Using cast for Android SDK

* Proper way to accept licenses

* Correct Android path

* Build tools 28.0.3

* New Buildtools command

* Fixing Parallelism and License Accept.

* Fixing YAML indentation

* Trying to see what the error code when accepting the license

* Trying to get this licenses signed.

* Removing license acceptance.

* Fixing Node JS bug

* Yet another tentative to get Android Tools signed.

* Don't need to install NodeJS

* Making sure we don't change this line.

* Adding build step.

* Moving from cocoa pods action to our own install.

* Adding Android's assembleRelease step

* Separating update pods.

* Bundle is the right option

* Changing bundleRelease (needs signature) to build.

* Testing to see if react bundle is necessary

* Adding react native bundle

* Installing Android Support Library, google services and other images

* Moving SDK update up top

* New Android dependencies.

* Fixing Command Line tools

* Adding updates and platform tools

* Fixing installation by accepting licenses at the moment of the download

* Testing the need for Support libraries via cradle.

* Reverting Library support

* Adding MIT team for the release

* Removing SDK Manager update

* Adding a gradlew check before build.

* Solving merge conflict.

* Changing the name of the builder action

* Adding working dir.

* Keeping things that are working.

* Only creates the directory if the directory does not exist.

* Setting up Android's back button to go back to the main screen instead of leaving the app.

Co-authored-by: David Biga <[email protected]>

* Made Android Studio steps optional, remove dev_setup2.sh (#98)

I previous PR added a second version of dev_setup.sh that was identical
except the Android Studio setup was commented out.  This indicates a need,
so now the main dev_setup.sh allows you to skip that step.

The dev_setup2.sh has been removed.

* Version 0.5.2 (#95)

* Update README

* RNFS.DownloadDirectoryPath is not defined on iOS. Figure out a way to access the Downloads folder.

* Version 0.5.1

* Testing iOS Action

* adding homebrew

* Adding node and java

* Installing Android Studio, SDK and Accepting licenses

* Fixing java

* Using cast for Android SDK

* Proper way to accept licenses

* Correct Android path

* Build tools 28.0.3

* New Buildtools command

* Fixing Parallelism and License Accept.

* Fixing YAML indentation

* Trying to see what the error code when accepting the license

* Trying to get this licenses signed.

* Removing license acceptance.

* Fixing Node JS bug

* Yet another tentative to get Android Tools signed.

* Don't need to install NodeJS

* Making sure we don't change this line.

* Adding build step.

* Moving from cocoa pods action to our own install.

* Adding Android's assembleRelease step

* Separating update pods.

* Bundle is the right option

* Changing bundleRelease (needs signature) to build.

* Testing to see if react bundle is necessary

* Adding react native bundle

* Installing Android Support Library, google services and other images

* Moving SDK update up top

* New Android dependencies.

* Fixing Command Line tools

* Adding updates and platform tools

* Fixing installation by accepting licenses at the moment of the download

* Testing the need for Support libraries via cradle.

* Reverting Library support

* Adding MIT team for the release

* Removing SDK Manager update

* Adding a gradlew check before build.

* Solving merge conflict.

* Changing the name of the builder action

* Adding working dir.

* Keeping things that are working.

* Only creates the directory if the directory does not exist.

* Setting up Android's back button to go back to the main screen instead of leaving the app.

* Version 0.5.2

New UI (#81, #90)

Co-authored-by: David Biga <[email protected]>

* Fix Notification Issue (#115)

Co-authored-by: Harsh Vitra <[email protected]>

* Cleanup onboarding (#100)

* Made Android Studio steps optional, remove dev_setup2.sh

I previous PR added a second version of dev_setup.sh that was identical
except the Android Studio setup was commented out.  This indicates a need,
so now the main dev_setup.sh allows you to skip that step.

The dev_setup2.sh has been removed.

* Updated the CONTRIBUTING guide with better instructions

The guide was originally written from the perspective of "internal" people
with write access.  Changed instruction to the perspective of an outside
contributor.

* Improving Readme.me (#103)

* Update README

* Local push notifications (#99)

* Update LocationService + Add Local Push Noticications

* Remove key

* Update binaries

* Add Button resource from react-native

* Change optOut

* Remove Additional Stop Location Recording (#117)

* Multilingual support (#119)

* Installation & Structure ready

* Added readme in languages file and created first label

* Added labels for intro1

* Hindi support added

* Intro 2 content added

* Intro 3 content added

* Location tracking content added

* hindi content for Location tracking page

* Import added in Hindi directory

* Import screen content added

* Export and News screen added

* French, Italian, German, and Portuguese support added

Co-authored-by: Harsh Vitra <[email protected]>

* Location Issues fix FROM #109 (#127)

* remove motiontracker requirement; adjust location params; backfill stationary points

* Remove Additional Stop Location Recording

Co-authored-by: Safe Path <[email protected]>

* Updated iOS location permission description text (#128)

* Refine message in README (#126)

Add more detail about the effort to apply Private Kit to COVID

* Version 0.5.3 (#130)

* Update README

* RNFS.DownloadDirectoryPath is not defined on iOS. Figure out a way to access the Downloads folder.

* Version 0.5.1

* Testing iOS Action

* adding homebrew

* Adding node and java

* Installing Android Studio, SDK and Accepting licenses

* Fixing java

* Using cast for Android SDK

* Proper way to accept licenses

* Correct Android path

* Build tools 28.0.3

* New Buildtools command

* Fixing Parallelism and License Accept.

* Fixing YAML indentation

* Trying to see what the error code when accepting the license

* Trying to get this licenses signed.

* Removing license acceptance.

* Fixing Node JS bug

* Yet another tentative to get Android Tools signed.

* Don't need to install NodeJS

* Making sure we don't change this line.

* Adding build step.

* Moving from cocoa pods action to our own install.

* Adding Android's assembleRelease step

* Separating update pods.

* Bundle is the right option

* Changing bundleRelease (needs signature) to build.

* Testing to see if react bundle is necessary

* Adding react native bundle

* Installing Android Support Library, google services and other images

* Moving SDK update up top

* New Android dependencies.

* Fixing Command Line tools

* Adding updates and platform tools

* Fixing installation by accepting licenses at the moment of the download

* Testing the need for Support libraries via cradle.

* Reverting Library support

* Adding MIT team for the release

* Removing SDK Manager update

* Adding a gradlew check before build.

* Solving merge conflict.

* Changing the name of the builder action

* Adding working dir.

* Keeping things that are working.

* Only creates the directory if the directory does not exist.

* Setting up Android's back button to go back to the main screen instead of leaving the app.

* Version 0.5.2

New UI (#81, #90)

* Adding preview UI

* Adding logo, Apple Store URL and badge to GitHub Actions

* Adding Preview UI

* Removing old descriptions

* Version 0.5.3:
- Multilingual Support
- Local Push Notifications
- Improved Requests for App Permissions

Co-authored-by: David Biga <[email protected]>

* Added Linking in imports (#116)

Co-authored-by: Harsh Vitra <[email protected]>

* Minor Typo Fix (#132)


* fixed typo

Co-authored-by: Bikram Khastgir <[email protected]>

* Update README.md (#138)

Adding a note for developers - not sure if it is meaningful but I hit my head for hours on this!

* Create dev Code of Conduct (#139)

This is from the default community code of conduct template on Github.

* Add modal menu for licenses to main screen

Co-authored-by: David Biga <[email protected]>
Co-authored-by: David Biga <[email protected]>
Co-authored-by: Vitor Pamplona <[email protected]>
Co-authored-by: Steve Penrod <[email protected]>
Co-authored-by: Steve Penrod <[email protected]>
Co-authored-by: Abhishek Singh <[email protected]>
Co-authored-by: Andy Nuzzo <[email protected]>
Co-authored-by: philrouge <[email protected]>
Co-authored-by: Harsh Vitra <[email protected]>
Co-authored-by: Harsh Vitra <[email protected]>
Co-authored-by: Safe Path <[email protected]>
Co-authored-by: Rich Paret <[email protected]>
Co-authored-by: bikramkhastgir <[email protected]>
Co-authored-by: Bikram Khastgir <[email protected]>
Co-authored-by: Enrico Santus <[email protected]>
  • Loading branch information
16 people authored Mar 22, 2020
1 parent d44d24f commit 7b5f6eb
Show file tree
Hide file tree
Showing 11 changed files with 613 additions and 269 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
14 changes: 9 additions & 5 deletions app/Entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import Welcome from './views/Welcome';
import NewsScreen from './views/News';
import ExportScreen from './views/Export';
import ImportScreen from './views/Import';
import LicencesScreen from './views/Licenses';
import Slider from './views/welcomeScreens/Slider';
import {GetStoreData, SetStoreData} from './helpers/General';

Expand Down Expand Up @@ -50,18 +51,16 @@ class Entry extends Component {
options={{headerShown:false}}
/>
)}
<Stack.Screen
<Stack.Screen
name="Slider"
component={Slider}
options={{headerShown:false}}
/>


/>
<Stack.Screen
name="WelcomeScreen"
component={Welcome}
options={{headerShown:false}}
/>
/>
<Stack.Screen
name="LocationTrackingScreen"
component={LocationTracking}
Expand All @@ -82,6 +81,11 @@ class Entry extends Component {
component={ImportScreen}
options={{headerShown:false}}
/>
<Stack.Screen
name="LicensesScreen"
component={LicencesScreen}
options={{headerShown:false}}
/>
</Stack.Navigator>
</SafeAreaView>
</NavigationContainer>
Expand Down
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.
14 changes: 8 additions & 6 deletions app/locales/en/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import intro from './intro.json';
import locationTracking from './locationTracking.json';
import importFile from './import.json'
import exportFile from './exportscreen.json'
import importFile from './import.json';
import exportFile from './exportscreen.json';
import licensesFile from './licensesscreen.json';

export default {
...intro,
...locationTracking,
...importFile,
...exportFile
...intro,
...locationTracking,
...importFile,
...exportFile,
...licensesFile,
};
3 changes: 3 additions & 0 deletions app/locales/en/licensesscreen.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"license_placeholder": "This app is built under the MIT license."
}
160 changes: 160 additions & 0 deletions app/views/Licenses.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
import React, { Component } from 'react';
import {
SafeAreaView,
StyleSheet,
ScrollView,
View,
Text,
Image,
Dimensions,
TouchableOpacity,
BackHandler,
} from 'react-native';

import colors from '../constants/colors';
import WebView from 'react-native-webview';
import Button from '../components/Button';
import { GetStoreData } from '../helpers/General';
import { convertPointsToString } from '../helpers/convertPointsToString';
import Share from 'react-native-share';
import RNFetchBlob from 'rn-fetch-blob';
import LocationServices from '../services/LocationService';
import backArrow from './../assets/images/backArrow.png';
import languages from './../locales/languages';

const width = Dimensions.get('window').width;

const base64 = RNFetchBlob.base64;

class LicensesScreen extends Component {
constructor(props) {
super(props);
}

backToMain() {
this.props.navigation.navigate('LocationTrackingScreen', {});
}

handleBackPress = () => {
this.props.navigation.navigate('LocationTrackingScreen', {});
return true;
};

componentDidMount() {
BackHandler.addEventListener('hardwareBackPress', this.handleBackPress);
}

componentWillUnmount() {
BackHandler.removeEventListener('hardwareBackPress', this.handleBackPress);
}

render() {
return (
<SafeAreaView style={styles.container}>
<View style={styles.headerContainer}>
<TouchableOpacity
style={styles.backArrowTouchable}
onPress={() => this.backToMain()}>
<Image style={styles.backArrow} source={backArrow} />
</TouchableOpacity>
<Text style={styles.headerTitle}>Licenses</Text>
</View>

<View style={styles.main}>
<Text style={styles.sectionDescription}>
{/* This screen is a placeholder for complete license content, or a link */}
{languages.t('label.license_placeholder')}
</Text>
</View>
</SafeAreaView>
);
}
}

const styles = StyleSheet.create({
// Container covers the entire screen
container: {
flex: 1,
flexDirection: 'column',
color: colors.PRIMARY_TEXT,
backgroundColor: colors.WHITE,
},
headerTitle: {
textAlign: 'center',
fontWeight: 'bold',
fontSize: 38,
padding: 0,
},
subHeaderTitle: {
textAlign: 'center',
fontWeight: 'bold',
fontSize: 22,
padding: 5,
},
main: {
flex: 1,
flexDirection: 'column',
textAlignVertical: 'top',
// alignItems: 'center',
padding: 20,
width: '96%',
alignSelf: 'center',
},
buttonTouchable: {
borderRadius: 12,
backgroundColor: '#665eff',
height: 52,
alignSelf: 'center',
width: width * 0.7866,
marginTop: 30,
justifyContent: 'center',
},
buttonText: {
fontFamily: 'OpenSans-Bold',
fontSize: 14,
lineHeight: 19,
letterSpacing: 0,
textAlign: 'center',
color: '#ffffff',
},
mainText: {
fontSize: 18,
lineHeight: 24,
fontWeight: '400',
textAlignVertical: 'center',
padding: 20,
},
smallText: {
fontSize: 10,
lineHeight: 24,
fontWeight: '400',
textAlignVertical: 'center',
padding: 20,
},

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,
marginTop: 12,
fontFamily: 'OpenSans-Regular',
},
});

export default LicensesScreen;
Loading

0 comments on commit 7b5f6eb

Please sign in to comment.