diff --git a/src/TravelMonkey.Android/Resources/Resource.designer.cs b/src/TravelMonkey.Android/Resources/Resource.designer.cs index 5e6cbf4..15832c1 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. diff --git a/src/TravelMonkey.Android/TravelMonkey.Android.csproj b/src/TravelMonkey.Android/TravelMonkey.Android.csproj index 4b9a5ab..1e75998 100644 --- a/src/TravelMonkey.Android/TravelMonkey.Android.csproj +++ b/src/TravelMonkey.Android/TravelMonkey.Android.csproj @@ -54,7 +54,7 @@ - + 1.3.7 diff --git a/src/TravelMonkey.iOS/TravelMonkey.iOS.csproj b/src/TravelMonkey.iOS/TravelMonkey.iOS.csproj index 479887f..3adbe09 100644 --- a/src/TravelMonkey.iOS/TravelMonkey.iOS.csproj +++ b/src/TravelMonkey.iOS/TravelMonkey.iOS.csproj @@ -104,7 +104,7 @@ - + 1.3.7 diff --git a/src/TravelMonkey/ApiKeys.cs b/src/TravelMonkey/ApiKeys.cs index 82c4dd3..4574d4c 100644 --- a/src/TravelMonkey/ApiKeys.cs +++ b/src/TravelMonkey/ApiKeys.cs @@ -2,13 +2,13 @@ { 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 = ""; + //#warning You need to set up your API keys. + public static string ComputerVisionApiKey = "16631d45b4eb49859c78a4f1226554dd"; + public static string TranslationsApiKey = "af35527fe3d54e71819bb95eb9a88283"; + public static string BingImageSearch = "40ab99291f01481ebc3b58b460e2681a"; // Change this to the Azure Region you are using - public static string ComputerVisionEndpoint = "https://westeurope.api.cognitive.microsoft.com/"; + public static string ComputerVisionEndpoint = "https://westus2.api.cognitive.microsoft.com/"; public static string TranslationsEndpoint = "https://api.cognitive.microsofttranslator.com/"; } } \ No newline at end of file diff --git a/src/TravelMonkey/Services/BingSearchService.cs b/src/TravelMonkey/Services/BingSearchService.cs index 3c18d40..5dad819 100644 --- a/src/TravelMonkey/Services/BingSearchService.cs +++ b/src/TravelMonkey/Services/BingSearchService.cs @@ -12,8 +12,8 @@ public class BingSearchService public async Task> GetDestinations() { - var searchDestinations = new[] { "Seattle", "Maui", "Amsterdam", "Antarctica" }; - + var searchDestinations = new[] { "Seattle", "Maui", "Amsterdam", "Antarctica", "Argentina" }; + //Write city and call bingsearch try { var client = new ImageSearchClient(new ApiKeyServiceClientCredentials(ApiKeys.BingImageSearch)); diff --git a/src/TravelMonkey/TravelMonkey.csproj b/src/TravelMonkey/TravelMonkey.csproj index de0691b..84c5208 100644 --- a/src/TravelMonkey/TravelMonkey.csproj +++ b/src/TravelMonkey/TravelMonkey.csproj @@ -12,7 +12,7 @@ - + diff --git a/src/TravelMonkey/ViewModels/MainPageViewModel.cs b/src/TravelMonkey/ViewModels/MainPageViewModel.cs index 187ec60..e08883b 100644 --- a/src/TravelMonkey/ViewModels/MainPageViewModel.cs +++ b/src/TravelMonkey/ViewModels/MainPageViewModel.cs @@ -22,6 +22,10 @@ public Destination CurrentDestination set => Set(ref _currentDestination, value); } + + + + public Command OpenUrlCommand { get; } = new Command(async (url) => { if (!string.IsNullOrWhiteSpace(url)) @@ -33,6 +37,9 @@ public Destination CurrentDestination }); }); + public string Description { get; } + + public MainPageViewModel() { if (Destinations.Count > 0) @@ -48,13 +55,21 @@ public MainPageViewModel() else CurrentDestination = Destinations[currentIdx + 1]; }; + } + } + public Command SpeachTextCommand { get; } = new Command(async (text) => + { + if (!string.IsNullOrWhiteSpace(text)) + await TextToSpeech.SpeakAsync(text); + + }); public void StartSlideShow() { _slideShowTimer.Start(); - + } public void StopSlideShow() { diff --git a/src/TravelMonkey/ViewModels/TranslateResultPageViewModel.cs b/src/TravelMonkey/ViewModels/TranslateResultPageViewModel.cs index 137b899..fbdbc95 100644 --- a/src/TravelMonkey/ViewModels/TranslateResultPageViewModel.cs +++ b/src/TravelMonkey/ViewModels/TranslateResultPageViewModel.cs @@ -1,5 +1,6 @@ using System.Collections.Generic; using TravelMonkey.Services; +using Xamarin.Essentials; using Xamarin.Forms; namespace TravelMonkey.ViewModels @@ -49,5 +50,12 @@ private async void TranslateText() Translations = result.Translations; } + + public Command SpeachTranslationsCommand { get; } = new Command(async (text) => + { + if (!string.IsNullOrWhiteSpace(text)) + await TextToSpeech.SpeakAsync(text); + + }); } } \ No newline at end of file diff --git a/src/TravelMonkey/Views/MainPage.xaml b/src/TravelMonkey/Views/MainPage.xaml index ee8eb69..c63eeee 100644 --- a/src/TravelMonkey/Views/MainPage.xaml +++ b/src/TravelMonkey/Views/MainPage.xaml @@ -1,5 +1,11 @@  - + @@ -75,7 +81,7 @@ - + @@ -89,9 +95,15 @@ - + diff --git a/src/TravelMonkey/Views/MainPage.xaml.cs b/src/TravelMonkey/Views/MainPage.xaml.cs index 8b2b41f..d91b29c 100644 --- a/src/TravelMonkey/Views/MainPage.xaml.cs +++ b/src/TravelMonkey/Views/MainPage.xaml.cs @@ -1,6 +1,7 @@ using System; using System.ComponentModel; using TravelMonkey.ViewModels; +using Xamarin.Essentials; using Xamarin.Forms; namespace TravelMonkey.Views @@ -15,6 +16,7 @@ public MainPage() InitializeComponent(); BindingContext = _mainPageViewModel; + } protected override void OnAppearing() @@ -36,6 +38,8 @@ private async void AddNewPicture_Tapped(object sender, EventArgs e) await Navigation.PushModalAsync(new AddPicturePage()); } + + private async void Entry_Completed(object sender, EventArgs e) { if (string.IsNullOrWhiteSpace(TranslateTextEntry.Text)) diff --git a/src/TravelMonkey/Views/TranslationResultPage.xaml b/src/TravelMonkey/Views/TranslationResultPage.xaml index 0fcf116..4faf71f 100644 --- a/src/TravelMonkey/Views/TranslationResultPage.xaml +++ b/src/TravelMonkey/Views/TranslationResultPage.xaml @@ -14,7 +14,7 @@ - + @@ -38,6 +38,11 @@