diff --git a/client/Nightr/App_Resources/Android/src/main/res/drawable-hdpi/logo.png b/client/Nightr/App_Resources/Android/src/main/res/drawable-hdpi/logo.png
index 5218f4c..d2d2014 100644
Binary files a/client/Nightr/App_Resources/Android/src/main/res/drawable-hdpi/logo.png and b/client/Nightr/App_Resources/Android/src/main/res/drawable-hdpi/logo.png differ
diff --git a/client/Nightr/App_Resources/Android/src/main/res/drawable-hdpi/logo_old.png b/client/Nightr/App_Resources/Android/src/main/res/drawable-hdpi/logo_old.png
new file mode 100644
index 0000000..5218f4c
Binary files /dev/null and b/client/Nightr/App_Resources/Android/src/main/res/drawable-hdpi/logo_old.png differ
diff --git a/client/Nightr/App_Resources/Android/src/main/res/drawable-ldpi/logo.png b/client/Nightr/App_Resources/Android/src/main/res/drawable-ldpi/logo.png
index b9e102a..d2d2014 100644
Binary files a/client/Nightr/App_Resources/Android/src/main/res/drawable-ldpi/logo.png and b/client/Nightr/App_Resources/Android/src/main/res/drawable-ldpi/logo.png differ
diff --git a/client/Nightr/App_Resources/Android/src/main/res/drawable-mdpi/logo.png b/client/Nightr/App_Resources/Android/src/main/res/drawable-mdpi/logo.png
index 6263387..d2d2014 100644
Binary files a/client/Nightr/App_Resources/Android/src/main/res/drawable-mdpi/logo.png and b/client/Nightr/App_Resources/Android/src/main/res/drawable-mdpi/logo.png differ
diff --git a/client/Nightr/App_Resources/Android/src/main/res/drawable-mdpi/logo_old.png b/client/Nightr/App_Resources/Android/src/main/res/drawable-mdpi/logo_old.png
new file mode 100644
index 0000000..6263387
Binary files /dev/null and b/client/Nightr/App_Resources/Android/src/main/res/drawable-mdpi/logo_old.png differ
diff --git a/client/Nightr/App_Resources/Android/src/main/res/drawable-xhdpi/logo.png b/client/Nightr/App_Resources/Android/src/main/res/drawable-xhdpi/logo.png
index ad8ee2f..d2d2014 100644
Binary files a/client/Nightr/App_Resources/Android/src/main/res/drawable-xhdpi/logo.png and b/client/Nightr/App_Resources/Android/src/main/res/drawable-xhdpi/logo.png differ
diff --git a/client/Nightr/App_Resources/Android/src/main/res/drawable-xhdpi/logo_old.png b/client/Nightr/App_Resources/Android/src/main/res/drawable-xhdpi/logo_old.png
new file mode 100644
index 0000000..ad8ee2f
Binary files /dev/null and b/client/Nightr/App_Resources/Android/src/main/res/drawable-xhdpi/logo_old.png differ
diff --git a/client/Nightr/App_Resources/Android/src/main/res/drawable-xxhdpi/logo.png b/client/Nightr/App_Resources/Android/src/main/res/drawable-xxhdpi/logo.png
index 6683278..d2d2014 100644
Binary files a/client/Nightr/App_Resources/Android/src/main/res/drawable-xxhdpi/logo.png and b/client/Nightr/App_Resources/Android/src/main/res/drawable-xxhdpi/logo.png differ
diff --git a/client/Nightr/App_Resources/Android/src/main/res/drawable-xxhdpi/logo_old.png b/client/Nightr/App_Resources/Android/src/main/res/drawable-xxhdpi/logo_old.png
new file mode 100644
index 0000000..6683278
Binary files /dev/null and b/client/Nightr/App_Resources/Android/src/main/res/drawable-xxhdpi/logo_old.png differ
diff --git a/client/Nightr/App_Resources/Android/src/main/res/drawable-xxxhdpi/logo.png b/client/Nightr/App_Resources/Android/src/main/res/drawable-xxxhdpi/logo.png
index fa6331c..d2d2014 100644
Binary files a/client/Nightr/App_Resources/Android/src/main/res/drawable-xxxhdpi/logo.png and b/client/Nightr/App_Resources/Android/src/main/res/drawable-xxxhdpi/logo.png differ
diff --git a/client/Nightr/App_Resources/Android/src/main/res/drawable-xxxhdpi/logo_old.png b/client/Nightr/App_Resources/Android/src/main/res/drawable-xxxhdpi/logo_old.png
new file mode 100644
index 0000000..fa6331c
Binary files /dev/null and b/client/Nightr/App_Resources/Android/src/main/res/drawable-xxxhdpi/logo_old.png differ
diff --git a/client/Nightr/src/app/home-page/home-page.component.css b/client/Nightr/src/app/home-page/home-page.component.css
index 990379e..6b0ca11 100644
--- a/client/Nightr/src/app/home-page/home-page.component.css
+++ b/client/Nightr/src/app/home-page/home-page.component.css
@@ -4,3 +4,13 @@
left: 90%;
top: 160%;
}
+
+ .font-awesome {
+ font-family: "fontawesome-webfont";
+ font-size: 24;
+}
+
+.radioBefore {
+ font-family: "fontawesome-webfont";
+ font-size: 24;
+}
diff --git a/client/Nightr/src/app/home-page/home-page.component.html b/client/Nightr/src/app/home-page/home-page.component.html
index 34a9045..8257d79 100644
--- a/client/Nightr/src/app/home-page/home-page.component.html
+++ b/client/Nightr/src/app/home-page/home-page.component.html
@@ -1,14 +1,9 @@
-
+
-
-
-
-
-
diff --git a/client/Nightr/src/app/home-page/home-page.component.ts b/client/Nightr/src/app/home-page/home-page.component.ts
index 3b29d40..900dca8 100644
--- a/client/Nightr/src/app/home-page/home-page.component.ts
+++ b/client/Nightr/src/app/home-page/home-page.component.ts
@@ -1,10 +1,9 @@
import { Component, OnInit } from "@angular/core";
import * as dialogs from "tns-core-modules/ui/dialogs";
import { RouterExtensions } from "nativescript-angular/router";
-import { TouchGestureEventData, GestureEventData } from 'tns-core-modules/ui/gestures'
+import { TouchGestureEventData, GestureEventData } from 'tns-core-modules/ui/gestures';
import { isEnabled, enableLocationRequest, getCurrentLocation, watchLocation, distance, clearWatch, Location } from "nativescript-geolocation";
-
-import { MyHttpPostService } from '../services/my-http-post-service'
+import { MyHttpPostService } from '../services/my-http-post-service';
@Component({
@@ -22,6 +21,7 @@ export class HomePageComponent implements OnInit {
image: any;
flat_earth: boolean;
in_australia: boolean;
+ changeYes: boolean;
constructor(private routerExtensions: RouterExtensions,
) { }
@@ -29,6 +29,13 @@ export class HomePageComponent implements OnInit {
ngOnInit(): void {
}
+ public changeGenderMale(){
+ if(this.changeYes == true)
+ this.changeYes = false;
+ else
+ this.changeYes = true;
+ }
+
public onTap(args: GestureEventData): void {
this.routerExtensions.navigateByUrl("/result-page");
}
diff --git a/client/Nightr/src/app/result-page/result-page.component.css b/client/Nightr/src/app/result-page/result-page.component.css
index 7b3ead4..dddc019 100644
--- a/client/Nightr/src/app/result-page/result-page.component.css
+++ b/client/Nightr/src/app/result-page/result-page.component.css
@@ -1,11 +1,26 @@
-.title-container
+.h2
{
font-family: sans-serif;
- font-size: 30px;
- padding: 5px;
+ font-size: 35px;
color: white;
text-align: center;
}
+ .h1
+ {
+ font-family: sans-serif;
+ font-size: 100px;
+ color: white;
+ text-align: center;
+ }
+ .h3
+ {
+ font-family: sans-serif;
+ font-style: italic;
+ font-size: 20px;
+ color: white;
+ text-align: center;
+ }
+
.page {
background-color: lightskyblue;
}
diff --git a/client/Nightr/src/app/result-page/result-page.component.html b/client/Nightr/src/app/result-page/result-page.component.html
index 7f4c484..56dba69 100644
--- a/client/Nightr/src/app/result-page/result-page.component.html
+++ b/client/Nightr/src/app/result-page/result-page.component.html
@@ -1,11 +1,12 @@
-
-
+
-
-
-
+
+
+
+
+
-
+
@@ -16,3 +17,4 @@
+
diff --git a/client/Nightr/src/app/result-page/result-page.component.ts b/client/Nightr/src/app/result-page/result-page.component.ts
index 2b849ac..89a97e4 100644
--- a/client/Nightr/src/app/result-page/result-page.component.ts
+++ b/client/Nightr/src/app/result-page/result-page.component.ts
@@ -1,9 +1,9 @@
import { Component, OnInit } from '@angular/core';
-import { MyHttpPostService } from '../services/my-http-post-service'
+import { MyHttpPostService } from '../services/my-http-post-service';
import { MyGeoLocationService} from '../services/my-geo-location.service';
import { MyBatteryInfoService } from '../services/my-battery-info.service';
-import { MyCameraService } from '../services/my-camera-service'
+import { MyCameraService } from '../services/my-camera-service';
import { RouterExtensions } from 'nativescript-angular/router';
import { Location } from 'nativescript-geolocation';
@@ -21,6 +21,7 @@ class Reason {
})
export class ResultPageComponent implements OnInit {
returnMessage: string = "";
+ isBusy: boolean;
myReturnJSON: Object;
locationData: Location;
myPicture: String;
@@ -28,9 +29,12 @@ export class ResultPageComponent implements OnInit {
flat_earth: boolean;
in_australia: boolean;
night: string = "";
- percentage: string = "";
+ percentage: string = "Calculating...";
+ hereswhy: string = "";
+ itis: string = "";
+ reasons: Array;
JSONObject;
- public reasons: Array;
+
constructor(private myHttpPostSerivce: MyHttpPostService,
private routerExtensions: RouterExtensions,
@@ -39,6 +43,8 @@ export class ResultPageComponent implements OnInit {
private cameraService: MyCameraService,){ }
ngOnInit(): Promise {
+ this.isBusy = true;
+ this.reasons = new Array();
return this.cameraService.takePicture().
then(picture => {
this.image = JSON.stringify(picture);
@@ -60,15 +66,38 @@ public submit(): void {
}
private makePostRequest(): void {
+ this.isBusy = true;
this.myHttpPostSerivce
.postData({ position: this.locationData, image: this.image, flat_earth: true, in_australia: true, })
.subscribe(res => {
- //console.log('This is res', res);
+ console.log('This is res', res);
this.JSONObject = res;
+ this.isBusy = false;
+ this.addToArray();
//console.log('THis is myreturnJSON', this.myReturnJSON);
});
}
+public addToArray(): void {
+
+ if (this.JSONObject.night) {
+ this.night = "NIGHT";
+ } else {
+ this.night = "DAY";
+ }
+
+ this.percentage = "At least we are "+Math.floor(this.JSONObject.weighted_probabilities_mean*100)+"% sure"
+ for (let i = 0; i < this.JSONObject.predictions.length; i++) {
+ var causestring = ""
+ for (let j = 0; j < this.JSONObject.predictions[i].reasons.length; j++) {
+ causestring = causestring + " - " + this.JSONObject.predictions[i].reasons[j] + "\n";
+ }
+ this.itis = "It is"
+ this.hereswhy = "Here's why:"
+ this.reasons.push(new Reason(""+Math.round(this.JSONObject.predictions[i].contribution*100)+"% - " + this.JSONObject.predictions[i].name, causestring));
+ }
+ }
+
goBack(): void {
this.routerExtensions.back();
}