Skip to content

Commit

Permalink
Merge pull request #810 from shankari/finish_status_screen
Browse files Browse the repository at this point in the history
Finish pending changes for the status screen
  • Loading branch information
shankari authored Feb 8, 2022
2 parents 544a679 + 3646511 commit 6abb703
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 12 deletions.
5 changes: 5 additions & 0 deletions www/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@

"intro": {
"appstatus": {
"overall-loc-name": "Location",
"locsettings": {
"name": "Location Settings",
"description": {
Expand All @@ -333,13 +334,16 @@
"ios": "Placeholder"
}
},
"overall-fitness-name-android": "Physical activity",
"overall-fitness-name-ios": "Motion & Fitness",
"fitnessperms": {
"name": "Fitness Permission",
"description": {
"android": "Please allow.",
"ios": "Please allow."
}
},
"overall-notification-name": "Notifications",
"notificationperms": {
"app-enabled-name": "App Notifications",
"not-paused-name": "Not Paused",
Expand All @@ -349,6 +353,7 @@
"ios": "Please allow."
}
},
"overall-background-restrictions-name": "Background restrictions",
"unusedapprestrict": {
"name": "Unused apps disabled",
"description": {
Expand Down
3 changes: 3 additions & 0 deletions www/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ angular.module('emission', ['ionic',
.run(function($ionicPlatform, $rootScope, $http, Logger,
CustomURLScheme, ReferralHandler, UpdateCheck) {
console.log("Starting run");
// ensure that plugin events are delivered after the ionicPlatform is ready
// https://github.com/katzer/cordova-plugin-local-notifications#launch-details
window.skipLocalNotificationReady = true;
// alert("Starting run");
// BEGIN: Global listeners, no need to wait for the platform
// TODO: Although the onLaunch call doesn't need to wait for the platform the
Expand Down
1 change: 1 addition & 0 deletions www/js/appstatus/permissioncheck.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ controller("PermissionCheckControl", function($scope, $element, $attrs,
fix: fixPerms,
refresh: checkPerms
}
$scope.overallFitnessName = $translate.instant("intro.appstatus.overall-fitness-name-android");
$scope.fitnessChecks = [fitnessPermissionsCheck];
let fitnessCheckPromises = $scope.fitnessChecks.map((fc) => fc.refresh());
console.log(fitnessCheckPromises);
Expand Down
2 changes: 2 additions & 0 deletions www/js/splash/localnotify.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ angular.module('emission.splash.localnotify', ['emission.plugin.logger',

$ionicPlatform.ready().then(function() {
localNotify.registerRedirectHandler();
Logger.log("finished registering handlers, about to fire queued events");
$window.cordova.plugins.notification.local.fireQueuedEvents();
});

return localNotify;
Expand Down
21 changes: 11 additions & 10 deletions www/templates/appstatus/permissioncheck.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<details>
<summary><h4 ng-class="overallLocStatusClass"> Location {{overallLocStatusIcon}} </h4></summary>
Make sure that all the settings below are green so that the app can work properly!

We need this this sensor to read your location data and automatically generate
a trip log that is displayed to you for annotation. We need the background
location permission to track your location in the background, even when the app
is closed. This makes the app easier to use and saves battery since you don't
have to remember to start and stop trip recording.
<details>
<summary><h4 ng-class="overallLocStatusClass"> {{ 'intro.appstatus.overall-loc-name' | translate }} {{overallLocStatusIcon}} </h4></summary>
We use location permissions to automatically generate a trip diary for annotation.
We use the background location permission to track your location in the
background, even when the app is closed. Reading background locations obviates
the need to turn tracking on and off, making the app easier to use and
preventing battery drain.
<ion-list>
<ion-item ng-repeat="locCheck in locChecks">
<div class="row">
Expand All @@ -23,7 +24,7 @@

<div ng-if="fitnessPermNeeded">
<details>
<summary><h4 ng-class="overallFitnessStatusClass"> Motion and Fitness {{overallFitnessStatusIcon}} </h4></summary>
<summary><h4 ng-class="overallFitnessStatusClass"> {{ overallFitnessName }} {{overallFitnessStatusIcon}} </h4></summary>
The fitness sensors distinguish between walking, bicycling and motorized modes.
We use this data in order to separate the parts of multi-modal travel such as
transit.
Expand All @@ -44,7 +45,7 @@
</div>

<details>
<summary><h4 ng-class="overallNotificationStatusClass"> Notifications {{overallNotificationStatusIcon}}</h4></summary>
<summary><h4 ng-class="overallNotificationStatusClass"> {{ 'intro.appstatus.overall-notification-name' | translate }} {{overallNotificationStatusIcon}}</h4></summary>
We need to use notifications to inform you if the settings are incorrect. We also use notifications to remind you to label your trips.
<ion-list>
<ion-item ng-repeat="notificationCheck in notificationChecks">
Expand All @@ -63,7 +64,7 @@

<div ng-if="backgroundUnrestrictionsNeeded">
<details>
<summary><h4 ng-class="overallBackgroundRestrictionStatusClass"> Background restrictions {{overallBackgroundRestrictionStatusIcon}} </h3> </summary>
<summary><h4 ng-class="overallBackgroundRestrictionStatusClass"> {{ 'intro.appstatus.overall-background-restrictions-name' | translate }} {{overallBackgroundRestrictionStatusIcon}} </h3> </summary>

The app runs in the background most of the time to make your life easier. You
only need to open it periodically to label trips. Android sometimes restricts
Expand Down
1 change: 0 additions & 1 deletion www/templates/control/app-status-modal.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ <h1 class="title">Permissions</h1>
</ion-header-bar>
<ion-content>
<div class="consent-text">
Please fix any incorrect permissions!
<permissioncheck overallstatus="overallAppStatus"></permissioncheck>
<div class="col" style="margin-left: 5px; margin-right: 5px">
<button class="button button-block button-positive button-outline" ng-disabled="!overallAppStatus" ng-click="appStatusChecked()"><span translate>{{'.button-accept'}}</span></button>
Expand Down
1 change: 0 additions & 1 deletion www/templates/intro/sensor_explanation.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<center><h2>Permissions </h2></center>
</div>
<div class="consent-text">
We will now ask you for permissions to access the following sensors.

<permissioncheck overallstatus="overallStatus"></permissioncheck>

Expand Down

0 comments on commit 6abb703

Please sign in to comment.