diff --git a/FoxTube.Core/Helpers/Inbox.cs b/FoxTube.Core/Helpers/Inbox.cs index c7d84a6..edbbdf7 100644 --- a/FoxTube.Core/Helpers/Inbox.cs +++ b/FoxTube.Core/Helpers/Inbox.cs @@ -60,7 +60,7 @@ namespace FoxTube.Core.Helpers try { // TODO: Add backend - HttpResponseMessage response = await client.GetAsync("https://xfox111.net/FoxTube/Changelogs?lang=" + Settings.Language); + HttpResponseMessage response = await client.GetAsync($"https://xfox111.net/FoxTube/Changelogs?lang={Settings.Language}¤tVersion={Metrics.CurrentVersion}"); if (response.StatusCode == System.Net.HttpStatusCode.NoContent) return list; diff --git a/FoxTube.Core/Models/Inbox/InboxItem.cs b/FoxTube.Core/Models/Inbox/InboxItem.cs index 0837b65..85da766 100644 --- a/FoxTube.Core/Models/Inbox/InboxItem.cs +++ b/FoxTube.Core/Models/Inbox/InboxItem.cs @@ -13,5 +13,6 @@ namespace FoxTube.Core.Models public DateTime TimeStamp { get; set; } public abstract string Type { get; } + public string ShortTimeStamp => $"{TimeStamp.ToShortDateString()} {TimeStamp.ToShortTimeString()}"; } } diff --git a/FoxTube/App.xaml b/FoxTube/App.xaml index 4a4243f..dd044f5 100644 --- a/FoxTube/App.xaml +++ b/FoxTube/App.xaml @@ -10,6 +10,18 @@ Red + + Gray + Gray + DarkRed + DarkRed + + Red + Gray + DarkRed + + Gray + - + @@ -24,11 +24,11 @@ - + diff --git a/FoxTube/Views/Settings.xaml.cs b/FoxTube/Views/Settings.xaml.cs index 6631a7a..35bcae4 100644 --- a/FoxTube/Views/Settings.xaml.cs +++ b/FoxTube/Views/Settings.xaml.cs @@ -1,35 +1,45 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Runtime.InteropServices.WindowsRuntime; -using Windows.Foundation; -using Windows.Foundation.Collections; -using Windows.UI.Xaml; -using Windows.UI.Xaml.Controls; -using Windows.UI.Xaml.Controls.Primitives; -using Windows.UI.Xaml.Data; -using Windows.UI.Xaml.Input; -using Windows.UI.Xaml.Media; +using Windows.UI.Xaml.Controls; using Windows.UI.Xaml.Navigation; -// The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238 - namespace FoxTube.Views { /// - /// An empty page that can be used on its own or navigated to within a Frame. + /// Settings page /// public sealed partial class Settings : Page { - public Settings() - { - this.InitializeComponent(); - } + public Settings() => + InitializeComponent(); - void Pivot_SelectionChanged(object sender, SelectionChangedEventArgs e) + protected override void OnNavigatedTo(NavigationEventArgs e) { + base.OnNavigatedTo(e); + if (string.IsNullOrWhiteSpace(e.Parameter as string)) + return; + + string[] param = (e.Parameter as string).Split('/'); + + object focus; + switch(param[0]) + { + case "about": + case "info": + focus = aboutTab; + break; + case "inbox": + case "message": + case "changelog": + focus = inboxTab; + break; + default: + focus = generalTab; + break; + } + pivot.SelectedItem = focus; + + if (focus == inboxTab && param.Length > 1) + inbox.Open(param[1]); } } } diff --git a/FoxTube/Views/SettingsSections/About.xaml b/FoxTube/Views/SettingsSections/About.xaml index cbb0c97..0df5c6b 100644 --- a/FoxTube/Views/SettingsSections/About.xaml +++ b/FoxTube/Views/SettingsSections/About.xaml @@ -27,7 +27,7 @@ @Tyrrrz for his awesome library @msreviewnet for warm welcome and first feedback - You for using my app :) + You for using my app :) @@ -38,7 +38,7 @@ Vkontakte: @XFox.Mike E-mail: michael.xfox@outlook.com - My website: https://xfox111.net + My website: https://xfox111.net diff --git a/FoxTube/Views/SettingsSections/General.xaml b/FoxTube/Views/SettingsSections/General.xaml index d0a4d64..7a8342e 100644 --- a/FoxTube/Views/SettingsSections/General.xaml +++ b/FoxTube/Views/SettingsSections/General.xaml @@ -4,10 +4,9 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - xmlns:controls="using:Microsoft.UI.Xaml.Controls" mc:Ignorable="d"> - + diff --git a/FoxTube/Views/SettingsSections/Inbox.xaml b/FoxTube/Views/SettingsSections/Inbox.xaml index f5aa380..24eab1b 100644 --- a/FoxTube/Views/SettingsSections/Inbox.xaml +++ b/FoxTube/Views/SettingsSections/Inbox.xaml @@ -11,12 +11,12 @@ - + @@ -29,43 +29,53 @@ - - + + - + + + + - - + + + + + + - + - - + + - - - + + + + - + - + - + diff --git a/FoxTube/Views/SettingsSections/Inbox.xaml.cs b/FoxTube/Views/SettingsSections/Inbox.xaml.cs index cbccc99..deec8e4 100644 --- a/FoxTube/Views/SettingsSections/Inbox.xaml.cs +++ b/FoxTube/Views/SettingsSections/Inbox.xaml.cs @@ -12,6 +12,7 @@ namespace FoxTube.Views.SettingsSections public sealed partial class Inbox : Page { List items; + string idToOpen; public Inbox() => InitializeComponent(); @@ -24,19 +25,28 @@ namespace FoxTube.Views.SettingsSections progressBar.Visibility = Visibility.Collapsed; filter.IsEnabled = true; + + if (idToOpen != null) + Open(idToOpen); } - void FilterChanged(object sender, SelectionChangedEventArgs e) - { - List filtered = new List(); - filtered.AddRange(filter.SelectedIndex switch + void FilterChanged(object sender, SelectionChangedEventArgs e) => + masterDetailsView.ItemsSource = filter.SelectedIndex switch { 1 => items.FindAll(i => i is Changelog), 2 => items.FindAll(i => i is DeveloperMessage), _ => items - }); + }; - masterDetailsView.ItemsSource = filtered; + public void Open(string id) + { + idToOpen = id; + if (!IsLoaded) + return; + + masterDetailsView.SelectedItem = (masterDetailsView.ItemsSource as List).Find(i => i.Id == id); + + idToOpen = null; } } } diff --git a/FoxTube/Views/SettingsSections/Translate.xaml b/FoxTube/Views/SettingsSections/Translate.xaml index 7c0d020..0ebbbdc 100644 --- a/FoxTube/Views/SettingsSections/Translate.xaml +++ b/FoxTube/Views/SettingsSections/Translate.xaml @@ -5,9 +5,64 @@ xmlns:local="using:FoxTube.Views.SettingsSections" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:globalization="using:System.Globalization" mc:Ignorable="d"> - + + + + + - + + + + + + + + + + +