Skip to content

Commit

Permalink
Merge pull request #76 from shankari/release_v_12
Browse files Browse the repository at this point in the history
Slew of minor improvements for release 0.0.12
  • Loading branch information
shankari authored Jul 18, 2016
2 parents 3dcb5ad + 065ba94 commit ebeaa32
Show file tree
Hide file tree
Showing 9 changed files with 50 additions and 19 deletions.
2 changes: 1 addition & 1 deletion bin/sign_and_align_keys.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore ~/Safety_Infras
~/Library/Android/sdk/build-tools/22.0.1/zipalign -v 4 platforms/android/build/outputs/apk/android-L+-release-signed-unaligned.apk emission-L+-build-$1.apk

# Re-add the plugin
ionic plugin add cordova-plugin-crosswalk-webview --variable XWALK_MODE="lite"
ionic plugin add cordova-plugin-crosswalk-webview
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"ui-leaflet": "^1.0.0",
"Leaflet.awesome-markers": "^2.0.2",
"ionic-datepicker": "^0.9.0",
"ionic-platform-web-client": "^0.7.1",
"ionic-platform-web-client": "^0.7.1"
},
"resolutions": {
"angular": "1.5.3",
Expand Down
10 changes: 5 additions & 5 deletions config.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<widget id="edu.berkeley.eecs.emission"
version="0.0.11"
android-versionCode="11"
ios-CFBundleVersion="11"
version="0.0.12"
android-versionCode="12"
ios-CFBundleVersion="12"
xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>emission</name>
<description>
Expand All @@ -21,9 +21,9 @@
<preference name="BackupWebStorage" value="none"/>
<preference name="SplashScreen" value="screen"/>
<preference name="SplashScreenDelay" value="3000"/>
<preference name="xwalkVersion" value="xwalk_core_library_canary:17+" />
<preference name="xwalkVersion" value="19+" />
<preference name="xwalkCommandLine" value="--disable-pull-to-refresh-effect" />
<preference name="xwalkMode" value="lite" />
<preference name="xwalkMode" value="embedded" />
<preference name="xwalkMultipleApk" value="true" />
<feature name="StatusBar">
<param name="ios-package" onload="true" value="CDVStatusBar"/>
Expand Down
10 changes: 2 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,18 +73,12 @@
"locator": "https://github.com/e-mission/cordova-server-sync.git",
"id": "edu.berkeley.eecs.emission.cordova.serversync"
},
{
"variables": {
"XWALK_MODE": "lite"
},
"locator": "cordova-plugin-crosswalk-webview",
"id": "cordova-plugin-crosswalk-webview"
},
{
"locator": "https://github.com/apla/me.apla.cordova.app-preferences",
"id": "cordova-plugin-app-preferences"
},
"ionic-plugin-deploy"
"ionic-plugin-deploy",
"cordova-plugin-crosswalk-webview"
],
"cordovaPlatforms": [
{
Expand Down
3 changes: 3 additions & 0 deletions www/js/common/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ angular.module('emission.main.common.map',['ionic-datepicker',
$scope.refreshMap = function() {
CommonGraph.updateCurrent();
};
$scope.refreshTiles = function() {
$scope.$broadcast('invalidateSize');
};
$scope.getFormattedDuration = DiaryHelper.getFormattedDuration;
$scope.$on(CommonGraph.UPDATE_DONE, function(event, args) {
$scope.$apply(function() {
Expand Down
31 changes: 29 additions & 2 deletions www/js/metrics.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

angular.module('emission.main.metrics',['nvd3', 'emission.services'])

.controller('MetricsCtrl', function($scope, $ionicActionSheet, CommHelper) {
.controller('MetricsCtrl', function($scope, $ionicActionSheet, $ionicLoading,
CommHelper) {
$scope.options = {
chart: {
type: 'multiBarChart',
Expand Down Expand Up @@ -50,13 +51,17 @@ angular.module('emission.main.metrics',['nvd3', 'emission.services'])

$scope.getMetrics = function() {
var data = {
freq: 'DAILY',
freq: $scope.selectCtrl.freq,
start_time: $scope.selectCtrl.fromDate,
end_time: $scope.selectCtrl.toDate,
metric: $scope.selectCtrl.metric
};
console.log("Sending data "+JSON.stringify(data));
$ionicLoading.show({
template: 'Loading...'
});
CommHelper.getMetrics("local_date", data, function(response) {
$ionicLoading.hide();
if (angular.isDefined(response.user_metrics)) {
console.log("Got aggregate result "+response.user_metrics.length);
$scope.$apply(function() {
Expand All @@ -66,6 +71,7 @@ angular.module('emission.main.metrics',['nvd3', 'emission.services'])
console.log("did not find aggregate result in response data "+JSON.stringify(response));
}
}, function(error) {
$ionicLoading.hide();
console.log("Got error %s while trying to read metric data" +
JSON.stringify(error));
});
Expand Down Expand Up @@ -109,6 +115,12 @@ angular.module('emission.main.metrics',['nvd3', 'emission.services'])
{text: "MEDIAN_SPEED", value: 'median_speed'}
];

$scope.freqOptions = [
{text: "DAILY", value:'DAILY'},
{text: "MONTHLY", value: 'MONTHLY'},
{text: "YEARLY", value: 'YEARLY'}
];

$scope.changeFromWeekday = function() {
return $scope.changeWeekday(function(newVal) {
$scope.selectCtrl.fromDateWeekdayString = newVal;
Expand Down Expand Up @@ -159,11 +171,26 @@ angular.module('emission.main.metrics',['nvd3', 'emission.services'])
});
};

$scope.changeFreq = function() {
$ionicActionSheet.show({
buttons: $scope.freqOptions,
titleText: "Select summary freq",
cancelText: "Cancel",
buttonClicked: function(index, button) {
$scope.selectCtrl.freqString = button.text;
$scope.selectCtrl.freq = button.value;
return true;
}
});
};

var initSelect = function() {
var now = moment();
var monthago = moment().subtract(7, 'd');
$scope.selectCtrl.metric = 'count';
$scope.selectCtrl.metricString = "COUNT";
$scope.selectCtrl.freq = 'DAILY';
$scope.selectCtrl.freqString = "DAILY";
$scope.selectCtrl.fromDate = moment2Localdate(monthago)
$scope.selectCtrl.toDate = moment2Localdate(now);
$scope.selectCtrl.fromDateWeekdayString = "All"
Expand Down
4 changes: 3 additions & 1 deletion www/templates/common/map.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
<div style="" class="button-bar">
<button class="button button-stable button-block icon ion-refresh"
ng-click="refreshMap()">Refresh</button>
<button class="button button-stable button-block icon ion-android-map"
ng-click="refreshTiles()">Reload Tiles</button>
</div>

<leaflet geojson="mapCtrl.geojson"
Expand All @@ -17,4 +19,4 @@
height="100%" width="100%">
</leaflet>
</ion-content>
</ion-view>
</ion-view>
4 changes: 4 additions & 0 deletions www/templates/main-metrics.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@
</div>
</div>
</div>
<div class="col-30">
<button class="button button-stable button-block row"
ng-click="changeFreq()">{{selectCtrl.freqString}}</button>
</div>
<!--
<div class="col">
</div>
Expand Down
3 changes: 2 additions & 1 deletion www/templates/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@
<ion-nav-view name="main-diary"></ion-nav-view>
</ion-tab>

<!-- Game Tab -->
<!-- Game Tab
<ion-tab title="Goals" icon="ion-android-checkbox" href="#/root/main/goals">
<ion-nav-view name="main-goals"></ion-nav-view>
</ion-tab>
-->

<!-- Common Patterns Tab -->
<ion-tab title="Common" icon="ion-star" href="#/root/main/common/map">
Expand Down

0 comments on commit ebeaa32

Please sign in to comment.