diff --git a/src/TravelMonkey.Android/Resources/Resource.designer.cs b/src/TravelMonkey.Android/Resources/Resource.designer.cs index 5e6cbf4..1d07de8 100644 --- a/src/TravelMonkey.Android/Resources/Resource.designer.cs +++ b/src/TravelMonkey.Android/Resources/Resource.designer.cs @@ -2,6 +2,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -11198,7 +11199,10 @@ public partial class Drawable public const int tooltip_frame_light = 2131165309; // aapt resource value: 0x7F07007E - public const int TravelMonkey = 2131165310; + public const int tr = 2131165310; + + // aapt resource value: 0x7F07007F + public const int TravelMonkey = 2131165311; static Drawable() { diff --git a/src/TravelMonkey.Android/Resources/drawable/tr.png b/src/TravelMonkey.Android/Resources/drawable/tr.png new file mode 100644 index 0000000..b5f1fbc Binary files /dev/null and b/src/TravelMonkey.Android/Resources/drawable/tr.png differ diff --git a/src/TravelMonkey.Android/TravelMonkey.Android.csproj b/src/TravelMonkey.Android/TravelMonkey.Android.csproj index 4b9a5ab..155acb7 100644 --- a/src/TravelMonkey.Android/TravelMonkey.Android.csproj +++ b/src/TravelMonkey.Android/TravelMonkey.Android.csproj @@ -1,4 +1,4 @@ - + Debug @@ -53,6 +53,9 @@ + + 4.0.0 + @@ -93,57 +96,80 @@ - - + + + + - - + + + + - - + + + + - - + + + + - - + + + + - - + + + + - - + + + + - - + + + + - - + + + + - - + + + + - - + + + + - - + + + + - - + @@ -151,5 +177,5 @@ TravelMonkey - - + + \ No newline at end of file diff --git a/src/TravelMonkey.iOS/Resources/tr.png b/src/TravelMonkey.iOS/Resources/tr.png new file mode 100644 index 0000000..b5f1fbc Binary files /dev/null and b/src/TravelMonkey.iOS/Resources/tr.png differ diff --git a/src/TravelMonkey.iOS/TravelMonkey.iOS.csproj b/src/TravelMonkey.iOS/TravelMonkey.iOS.csproj index 479887f..6cf7c44 100644 --- a/src/TravelMonkey.iOS/TravelMonkey.iOS.csproj +++ b/src/TravelMonkey.iOS/TravelMonkey.iOS.csproj @@ -75,24 +75,60 @@ false - - - - - - - - - - - - - - - - - - + + false + + + false + + + false + + + false + + + false + + + false + + + false + + + false + + + false + + + false + + + false + + + false + + + false + + + false + + + false + + + false + + + false + + + false + @@ -103,6 +139,9 @@ + + 4.0.0 + @@ -130,6 +169,6 @@ - + \ No newline at end of file diff --git a/src/TravelMonkey.sln b/src/TravelMonkey.sln index 222f516..8f51a42 100644 --- a/src/TravelMonkey.sln +++ b/src/TravelMonkey.sln @@ -1,57 +1,65 @@ - Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29911.84 +MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TravelMonkey.Android", "TravelMonkey.Android\TravelMonkey.Android.csproj", "{A06A377B-F901-4238-88BD-A92726C715C2}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TravelMonkey.iOS", "TravelMonkey.iOS\TravelMonkey.iOS.csproj", "{8C00CCB8-214B-4B88-8042-4C8D31284CD3}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TravelMonkey", "TravelMonkey\TravelMonkey.csproj", "{04991790-FBB2-415A-9531-268B4193DB3E}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TravelMonkey", "TravelMonkey\TravelMonkey.csproj", "{04991790-FBB2-415A-9531-268B4193DB3E}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - Debug|iPhoneSimulator = Debug|iPhoneSimulator - Release|iPhoneSimulator = Release|iPhoneSimulator Debug|iPhone = Debug|iPhone + Debug|iPhoneSimulator = Debug|iPhoneSimulator + Release|Any CPU = Release|Any CPU Release|iPhone = Release|iPhone + Release|iPhoneSimulator = Release|iPhoneSimulator EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {A06A377B-F901-4238-88BD-A92726C715C2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {A06A377B-F901-4238-88BD-A92726C715C2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A06A377B-F901-4238-88BD-A92726C715C2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A06A377B-F901-4238-88BD-A92726C715C2}.Release|Any CPU.Build.0 = Release|Any CPU - {A06A377B-F901-4238-88BD-A92726C715C2}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {A06A377B-F901-4238-88BD-A92726C715C2}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU - {A06A377B-F901-4238-88BD-A92726C715C2}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU - {A06A377B-F901-4238-88BD-A92726C715C2}.Release|iPhoneSimulator.Build.0 = Release|Any CPU + {A06A377B-F901-4238-88BD-A92726C715C2}.Debug|Any CPU.Deploy.0 = Debug|Any CPU {A06A377B-F901-4238-88BD-A92726C715C2}.Debug|iPhone.ActiveCfg = Debug|Any CPU {A06A377B-F901-4238-88BD-A92726C715C2}.Debug|iPhone.Build.0 = Debug|Any CPU + {A06A377B-F901-4238-88BD-A92726C715C2}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {A06A377B-F901-4238-88BD-A92726C715C2}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {A06A377B-F901-4238-88BD-A92726C715C2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A06A377B-F901-4238-88BD-A92726C715C2}.Release|Any CPU.Build.0 = Release|Any CPU {A06A377B-F901-4238-88BD-A92726C715C2}.Release|iPhone.ActiveCfg = Release|Any CPU {A06A377B-F901-4238-88BD-A92726C715C2}.Release|iPhone.Build.0 = Release|Any CPU + {A06A377B-F901-4238-88BD-A92726C715C2}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU + {A06A377B-F901-4238-88BD-A92726C715C2}.Release|iPhoneSimulator.Build.0 = Release|Any CPU {8C00CCB8-214B-4B88-8042-4C8D31284CD3}.Debug|Any CPU.ActiveCfg = Debug|iPhoneSimulator {8C00CCB8-214B-4B88-8042-4C8D31284CD3}.Debug|Any CPU.Build.0 = Debug|iPhoneSimulator - {8C00CCB8-214B-4B88-8042-4C8D31284CD3}.Release|Any CPU.ActiveCfg = Release|iPhoneSimulator - {8C00CCB8-214B-4B88-8042-4C8D31284CD3}.Release|Any CPU.Build.0 = Release|iPhoneSimulator - {8C00CCB8-214B-4B88-8042-4C8D31284CD3}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator - {8C00CCB8-214B-4B88-8042-4C8D31284CD3}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator - {8C00CCB8-214B-4B88-8042-4C8D31284CD3}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator - {8C00CCB8-214B-4B88-8042-4C8D31284CD3}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator {8C00CCB8-214B-4B88-8042-4C8D31284CD3}.Debug|iPhone.ActiveCfg = Debug|iPhone {8C00CCB8-214B-4B88-8042-4C8D31284CD3}.Debug|iPhone.Build.0 = Debug|iPhone + {8C00CCB8-214B-4B88-8042-4C8D31284CD3}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator + {8C00CCB8-214B-4B88-8042-4C8D31284CD3}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator + {8C00CCB8-214B-4B88-8042-4C8D31284CD3}.Release|Any CPU.ActiveCfg = Release|iPhoneSimulator + {8C00CCB8-214B-4B88-8042-4C8D31284CD3}.Release|Any CPU.Build.0 = Release|iPhoneSimulator {8C00CCB8-214B-4B88-8042-4C8D31284CD3}.Release|iPhone.ActiveCfg = Release|iPhone {8C00CCB8-214B-4B88-8042-4C8D31284CD3}.Release|iPhone.Build.0 = Release|iPhone + {8C00CCB8-214B-4B88-8042-4C8D31284CD3}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator + {8C00CCB8-214B-4B88-8042-4C8D31284CD3}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator {04991790-FBB2-415A-9531-268B4193DB3E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {04991790-FBB2-415A-9531-268B4193DB3E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {04991790-FBB2-415A-9531-268B4193DB3E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {04991790-FBB2-415A-9531-268B4193DB3E}.Release|Any CPU.Build.0 = Release|Any CPU - {04991790-FBB2-415A-9531-268B4193DB3E}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {04991790-FBB2-415A-9531-268B4193DB3E}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU - {04991790-FBB2-415A-9531-268B4193DB3E}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU - {04991790-FBB2-415A-9531-268B4193DB3E}.Release|iPhoneSimulator.Build.0 = Release|Any CPU {04991790-FBB2-415A-9531-268B4193DB3E}.Debug|iPhone.ActiveCfg = Debug|Any CPU {04991790-FBB2-415A-9531-268B4193DB3E}.Debug|iPhone.Build.0 = Debug|Any CPU + {04991790-FBB2-415A-9531-268B4193DB3E}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {04991790-FBB2-415A-9531-268B4193DB3E}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {04991790-FBB2-415A-9531-268B4193DB3E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {04991790-FBB2-415A-9531-268B4193DB3E}.Release|Any CPU.Build.0 = Release|Any CPU {04991790-FBB2-415A-9531-268B4193DB3E}.Release|iPhone.ActiveCfg = Release|Any CPU {04991790-FBB2-415A-9531-268B4193DB3E}.Release|iPhone.Build.0 = Release|Any CPU + {04991790-FBB2-415A-9531-268B4193DB3E}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU + {04991790-FBB2-415A-9531-268B4193DB3E}.Release|iPhoneSimulator.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {09B5064B-74F7-4DA7-BCE3-0CFA917E847F} EndGlobalSection EndGlobal diff --git a/src/TravelMonkey/ApiKeys.cs b/src/TravelMonkey/ApiKeys.cs index 82c4dd3..9e18dd0 100644 --- a/src/TravelMonkey/ApiKeys.cs +++ b/src/TravelMonkey/ApiKeys.cs @@ -3,12 +3,16 @@ public static class ApiKeys { #warning You need to set up your API keys. - public static string ComputerVisionApiKey = ""; - public static string TranslationsApiKey = ""; - public static string BingImageSearch = ""; + public static string ComputerVisionApiKey = "YOUR_API_KEY"; + public static string TranslationsApiKey = "YOUR_API_KEY"; + public static string BingImageSearch = "YOUR_API_KEY"; + public static string TextAnalysisApiKey = "YOUR_API_KEY"; + public static string FaceDetectionApiKey = "YOUR_API_KEY"; // Change this to the Azure Region you are using - public static string ComputerVisionEndpoint = "https://westeurope.api.cognitive.microsoft.com/"; - public static string TranslationsEndpoint = "https://api.cognitive.microsofttranslator.com/"; + public static string ComputerVisionEndpoint = "YOUR_END_POINT"; + public static string TranslationsEndpoint = "YOUR_END_POINT"; + public static string TextAnalysisEndPoint = "YOUR_END_POINT"; + public static string FaceDetectionEndPoint = "YOUR_END_POINT"; } } \ No newline at end of file diff --git a/src/TravelMonkey/Models/FaceModel.cs b/src/TravelMonkey/Models/FaceModel.cs new file mode 100644 index 0000000..9d8b41e --- /dev/null +++ b/src/TravelMonkey/Models/FaceModel.cs @@ -0,0 +1,108 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace TravelMonkey.Models +{ + public class FaceModel + { + public string faceId { get; set; } + public FaceRectangle faceRectangle { get; set; } + public FaceAttributes faceAttributes { get; set; } + } + public class FaceRectangle + { + public int top { get; set; } + public int left { get; set; } + public int width { get; set; } + public int height { get; set; } + } + + public class HeadPose + { + public double pitch { get; set; } + public double roll { get; set; } + public double yaw { get; set; } + } + + public class FacialHair + { + public double moustache { get; set; } + public double beard { get; set; } + public double sideburns { get; set; } + } + + public class Emotion + { + public double anger { get; set; } + public double contempt { get; set; } + public double disgust { get; set; } + public double fear { get; set; } + public double happiness { get; set; } + public double neutral { get; set; } + public double sadness { get; set; } + public double surprise { get; set; } + } + + public class Blur + { + public string blurLevel { get; set; } + public double value { get; set; } + } + + public class Exposure + { + public string exposureLevel { get; set; } + public double value { get; set; } + } + + public class Noise + { + public string noiseLevel { get; set; } + public double value { get; set; } + } + + public class Makeup + { + public bool eyeMakeup { get; set; } + public bool lipMakeup { get; set; } + } + + public class Occlusion + { + public bool foreheadOccluded { get; set; } + public bool eyeOccluded { get; set; } + public bool mouthOccluded { get; set; } + } + + public class HairColor + { + public string color { get; set; } + public double confidence { get; set; } + } + + public class Hair + { + public double bald { get; set; } + public bool invisible { get; set; } + public List hairColor { get; set; } + } + + public class FaceAttributes + { + public double smile { get; set; } + public HeadPose headPose { get; set; } + public string gender { get; set; } + public double age { get; set; } + public FacialHair facialHair { get; set; } + public string glasses { get; set; } + public Emotion emotion { get; set; } + public Blur blur { get; set; } + public Exposure exposure { get; set; } + public Noise noise { get; set; } + public Makeup makeup { get; set; } + public List accessories { get; set; } + public Occlusion occlusion { get; set; } + public Hair hair { get; set; } + } +} diff --git a/src/TravelMonkey/Services/TranslationService.cs b/src/TravelMonkey/Services/TranslationService.cs index cac08af..9421eca 100644 --- a/src/TravelMonkey/Services/TranslationService.cs +++ b/src/TravelMonkey/Services/TranslationService.cs @@ -22,7 +22,7 @@ public async Task TranslateText(string inputText) { // Build the request. request.Method = HttpMethod.Post; - request.RequestUri = new Uri(ApiKeys.TranslationsEndpoint + "/translate?api-version=3.0&to=en&to=nl&to=es&to=fr"); + request.RequestUri = new Uri(ApiKeys.TranslationsEndpoint + "/translate?api-version=3.0&to=tr&to=en&to=nl&to=es&to=fr"); request.Content = new StringContent(requestBody, Encoding.UTF8, "application/json"); request.Headers.Add("Ocp-Apim-Subscription-Key", ApiKeys.TranslationsApiKey); diff --git a/src/TravelMonkey/TravelMonkey.csproj b/src/TravelMonkey/TravelMonkey.csproj index de0691b..ced6953 100644 --- a/src/TravelMonkey/TravelMonkey.csproj +++ b/src/TravelMonkey/TravelMonkey.csproj @@ -11,6 +11,7 @@ + @@ -23,9 +24,7 @@ - - @@ -51,4 +50,12 @@ Code + + + MSBuild:UpdateDesignTimeXaml + + + MSBuild:UpdateDesignTimeXaml + + \ No newline at end of file diff --git a/src/TravelMonkey/ViewModels/AddPicturePageViewModel.cs b/src/TravelMonkey/ViewModels/AddPicturePageViewModel.cs index c7acb84..cb3226a 100644 --- a/src/TravelMonkey/ViewModels/AddPicturePageViewModel.cs +++ b/src/TravelMonkey/ViewModels/AddPicturePageViewModel.cs @@ -1,23 +1,43 @@ -using System.Threading.Tasks; +using System.Collections.Generic; +using System.ComponentModel; +using System.IO; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Threading.Tasks; using Acr.UserDialogs; +using Newtonsoft.Json; using Plugin.Media; using Plugin.Media.Abstractions; using TravelMonkey.Data; using TravelMonkey.Models; using TravelMonkey.Services; +using TravelMonkey.Views; using Xamarin.Forms; namespace TravelMonkey.ViewModels { - public class AddPicturePageViewModel : BaseViewModel + public class AddPicturePageViewModel : BaseViewModel,INotifyPropertyChanged { - private readonly ComputerVisionService _computerVisionService = new ComputerVisionService(); + private readonly ComputerVisionService _computerVisionService = new ComputerVisionService(); + public INavigation Navigation { get; set; } public bool ShowImagePlaceholder => !ShowPhoto; public bool ShowPhoto => _photoSource != null; + private string url; + public string Url + { + get { return url; } + set { url = value; } + } MediaFile _photo; StreamImageSource _photoSource; + List faceModels = new List(); + public List FaceModels + { + get => faceModels; + set => Set(ref faceModels, value); + } public StreamImageSource PhotoSource { get => _photoSource; @@ -55,8 +75,9 @@ public string PictureDescription public Command TakePhotoCommand { get; } public Command AddPictureCommand { get; } - public AddPicturePageViewModel() + public AddPicturePageViewModel(INavigation navigation) { + this.Navigation = navigation; TakePhotoCommand = new Command(async () => await TakePhoto()); AddPictureCommand = new Command(() => { @@ -73,14 +94,16 @@ private async Task TakePhoto() if (result.Equals("Take photo")) { _photo = await CrossMedia.Current.TakePhotoAsync(new StoreCameraMediaOptions { PhotoSize = PhotoSize.Small }); + PhotoSource = (StreamImageSource)ImageSource.FromStream(() => _photo.GetStream()); + Url = _photo.Path; - PhotoSource = (StreamImageSource)ImageSource.FromStream(() => _photo.GetStream()); } else if (result.Equals("Choose photo")) { _photo = await CrossMedia.Current.PickPhotoAsync(new PickMediaOptions { PhotoSize = PhotoSize.Small }); - PhotoSource = (StreamImageSource)ImageSource.FromStream(() => _photo.GetStream()); + PhotoSource = (StreamImageSource)ImageSource.FromStream(() => _photo.GetStream()); + MakeAnalysisRequest(_photo.Path); } else { @@ -123,6 +146,48 @@ private async Task Post() { IsPosting = false; } + } + + public async void MakeAnalysisRequest(string imageFilePath) + { + + HttpClient client = new HttpClient(); + + client.DefaultRequestHeaders.Add("Ocp-Apim-Subscription-Key", ApiKeys.FaceDetectionApiKey); + + string requestParameters = "returnFaceId=true&returnFaceLandmarks=false" + + "&returnFaceAttributes=age,gender,headPose,smile,facialHair,glasses," + + "emotion,hair,makeup,occlusion,accessories,blur,exposure,noise"; + + string uri = ApiKeys.FaceDetectionEndPoint + "?" + requestParameters; + HttpResponseMessage response; + byte[] byteData = GetImageAsByteArray(imageFilePath); + + using (ByteArrayContent content = new ByteArrayContent(byteData)) + { + content.Headers.ContentType = new MediaTypeHeaderValue("application/octet-stream"); + response = await client.PostAsync(uri, content); + string contentString = await response.Content.ReadAsStringAsync(); + + //Display Result + faceModels = JsonConvert.DeserializeObject>(contentString); + if (faceModels.Count != 0) + { + var res =await Application.Current.MainPage.DisplayAlert("Hmm I see a Face", "Do you want me to Analyze Face?", "OK", "CANCEL"); + if (res) + await Navigation.PushModalAsync(new FaceAnalysisPage(faceModels)); + //var a = faceModels[0].faceAttributes.gender; + } + } + } + public byte[] GetImageAsByteArray(string imageFilePath) + { + using (FileStream fileStream = + new FileStream(imageFilePath, FileMode.Open, FileAccess.Read)) + { + BinaryReader binaryReader = new BinaryReader(fileStream); + return binaryReader.ReadBytes((int)fileStream.Length); + } } } } \ No newline at end of file diff --git a/src/TravelMonkey/ViewModels/BaseViewModel.cs b/src/TravelMonkey/ViewModels/BaseViewModel.cs index 1240a74..fd74e33 100644 --- a/src/TravelMonkey/ViewModels/BaseViewModel.cs +++ b/src/TravelMonkey/ViewModels/BaseViewModel.cs @@ -1,10 +1,18 @@ using System.ComponentModel; using System.Runtime.CompilerServices; +using Xamarin.Forms; namespace TravelMonkey.ViewModels { public abstract class BaseViewModel : INotifyPropertyChanged { + private INavigation navigation; + + public INavigation Navigation + { + get { return navigation; } + set { navigation = value; } + } protected bool Set(ref T field, T value, [CallerMemberName] string propertyName = null) { if (Equals(field, value)) diff --git a/src/TravelMonkey/ViewModels/TranslateResultPageViewModel.cs b/src/TravelMonkey/ViewModels/TranslateResultPageViewModel.cs index 137b899..89c3fe6 100644 --- a/src/TravelMonkey/ViewModels/TranslateResultPageViewModel.cs +++ b/src/TravelMonkey/ViewModels/TranslateResultPageViewModel.cs @@ -7,8 +7,11 @@ namespace TravelMonkey.ViewModels public class TranslateResultPageViewModel : BaseViewModel { private readonly TranslationService _translationService = - new TranslationService(); - + new TranslationService(); + + private Command _selectCountryCommand; + + private string _inputText; private Dictionary _translations; @@ -40,6 +43,18 @@ public Dictionary Translations InputText = inputText; }); + public Command SelectCountryCommand + { + get + { + return _selectCountryCommand ?? (_selectCountryCommand = new Command((code) => + { + Application.Current.MainPage.DisplayAlert("Selected Country", "Country code : " + code, "Ok"); + //Navigation.PushAsync(new PrivacyPolicyPage()); + })); + } + } + private async void TranslateText() { var result = await _translationService.TranslateText(_inputText); diff --git a/src/TravelMonkey/Views/AddPicturePage.xaml b/src/TravelMonkey/Views/AddPicturePage.xaml index 8a6f98a..98db819 100644 --- a/src/TravelMonkey/Views/AddPicturePage.xaml +++ b/src/TravelMonkey/Views/AddPicturePage.xaml @@ -15,7 +15,7 @@ - + diff --git a/src/TravelMonkey/Views/AddPicturePage.xaml.cs b/src/TravelMonkey/Views/AddPicturePage.xaml.cs index 3ea8d36..1985f96 100644 --- a/src/TravelMonkey/Views/AddPicturePage.xaml.cs +++ b/src/TravelMonkey/Views/AddPicturePage.xaml.cs @@ -1,4 +1,10 @@ -using System; +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.IO; +using System.Net.Http; +using System.Net.Http.Headers; +using TravelMonkey.Models; using TravelMonkey.ViewModels; using Xamarin.Forms; @@ -10,12 +16,13 @@ public AddPicturePage() { InitializeComponent(); - BindingContext = new AddPicturePageViewModel(); + BindingContext = new AddPicturePageViewModel(Navigation); - MessagingCenter.Subscribe(this, Constants.PictureAddedMessage, async (vm) => await Navigation.PopModalAsync(true)); + MessagingCenter.Subscribe(this, Constants.PictureAddedMessage, async (vm) => await Navigation.PopModalAsync(true)); MessagingCenter.Subscribe(this, Constants.PictureFailedMessage, async (vm) => await DisplayAlert("Uh-oh!", "Can you hand me my glasses? Something went wrong while analyzing this image", "OK")); - } + + } private void Button_Clicked(object sender, EventArgs e) { diff --git a/src/TravelMonkey/Views/FaceAnalysisPage.xaml b/src/TravelMonkey/Views/FaceAnalysisPage.xaml new file mode 100644 index 0000000..149ce5b --- /dev/null +++ b/src/TravelMonkey/Views/FaceAnalysisPage.xaml @@ -0,0 +1,95 @@ + + + + + + + + + + + +