From 7cbbc59e162e4a956367d4d223238499ac4652ab Mon Sep 17 00:00:00 2001 From: Michael Gordeev Date: Wed, 10 Apr 2019 14:02:42 +0300 Subject: [PATCH] Updated target version to 17134 Fixed headers Added ads to VideoGrid Related Work Items: #162, #188 --- FoxTube/App.xaml | 16 ++- FoxTube/Assets/Data/Patchnotes.xml | 8 ++ FoxTube/Classes/Methods.cs | 19 ++-- FoxTube/Classes/SecretsVault.cs | 5 +- FoxTube/Controls/Adverts/CardAdvert.xaml | 22 +++- FoxTube/Controls/Adverts/CardAdvert.xaml.cs | 46 ++++++--- FoxTube/Controls/ChannelCard.xaml | 28 +++-- FoxTube/Controls/ChannelCard.xaml.cs | 4 +- FoxTube/Controls/Player/VideoPlayer.xaml | 2 - FoxTube/Controls/PlaylistCard.xaml | 28 +++-- FoxTube/Controls/PlaylistCard.xaml.cs | 4 +- FoxTube/Controls/VideoCard.xaml | 28 +++-- FoxTube/Controls/VideoCard.xaml.cs | 8 +- FoxTube/FoxTube.csproj | 18 ++-- FoxTube/Pages/ChannelPage.xaml | 27 +++-- FoxTube/Pages/ChannelPage.xaml.cs | 14 ++- FoxTube/Pages/MainPage.xaml | 108 ++++++++++---------- FoxTube/Pages/MainPage.xaml.cs | 32 ++++-- FoxTube/Pages/SettingsPages/Inbox.xaml | 2 +- FoxTube/Pages/VideoGrid.xaml.cs | 14 ++- FoxTube/Pages/VideoPage.xaml | 2 +- FoxTube/Themes/Resources.xaml | 46 +++++++++ 22 files changed, 311 insertions(+), 170 deletions(-) create mode 100644 FoxTube/Themes/Resources.xaml diff --git a/FoxTube/App.xaml b/FoxTube/App.xaml index 93d2f98..9629a35 100644 --- a/FoxTube/App.xaml +++ b/FoxTube/App.xaml @@ -3,15 +3,13 @@ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="using:FoxTube"> + - Red - - + + + + + + diff --git a/FoxTube/Assets/Data/Patchnotes.xml b/FoxTube/Assets/Data/Patchnotes.xml index 69cf03f..d57de83 100644 --- a/FoxTube/Assets/Data/Patchnotes.xml +++ b/FoxTube/Assets/Data/Patchnotes.xml @@ -7,12 +7,20 @@ - Added ability to add videos to playlists on video page - Added ability to add videos to playlists through card's context menu - Added ability to download video through card's context menu +- Deleted videos are now also displayed +- Added support of April 2018 Update (Windows 10 build 17134) +- Added adverts +- Fixed header titles ### Что нового: - Добавлено уведомление со списком изменений при первом запуске после обновления - Добавлена возможность добавлять видео в плейлисты на странице просмотра - Добавлена возможность добавлять видео в плейлисты через контекстное меню карточки - Добавлена возможность скачивать видео через контекстное меню карточки +- Удаленные видео теперь также отображаются +- Добавлена поддержка Апрельского Обновления 2018 (Windows 10 сборка 17134) +- Добавлена реклама +- Исправлено изменение заголовков diff --git a/FoxTube/Classes/Methods.cs b/FoxTube/Classes/Methods.cs index 18890fe..4be9f0a 100644 --- a/FoxTube/Classes/Methods.cs +++ b/FoxTube/Classes/Methods.cs @@ -1,27 +1,21 @@ using FoxTube.Pages; -using Google.Apis.YouTube.v3; using Newtonsoft.Json; using System; using System.Collections.Generic; -using System.Diagnostics; using System.IO; using System.Linq; using System.Text.RegularExpressions; using System.Threading.Tasks; -using System.Web; using System.Xml; using Windows.ApplicationModel.Core; using Windows.ApplicationModel.DataTransfer; using Windows.ApplicationModel.Resources; -using Windows.ApplicationModel.Resources.Core; using Windows.Storage; using Windows.Storage.Streams; using Windows.System; -using Windows.UI; using Windows.UI.Xaml; using Windows.UI.Xaml.Controls; using Windows.UI.Xaml.Documents; -using Windows.UI.Xaml.Media; using YoutubeExplode; using YoutubeExplode.Models.MediaStreams; @@ -51,6 +45,19 @@ namespace FoxTube return new Uri(url); } + public static string GuardFromNull(this string str) + { + if (string.IsNullOrWhiteSpace(str)) + return string.Empty; + else + return str; + } + + public static bool IsNullOrWhiteSpace(this string str) + { + return string.IsNullOrWhiteSpace(str); + } + public static string GetChars(this string str, int count) { try diff --git a/FoxTube/Classes/SecretsVault.cs b/FoxTube/Classes/SecretsVault.cs index 990e5a9..197b339 100644 --- a/FoxTube/Classes/SecretsVault.cs +++ b/FoxTube/Classes/SecretsVault.cs @@ -42,8 +42,9 @@ namespace FoxTube }; public static YouTubeService Service => IsAuthorized ? new YouTubeService(Initializer) : NoAuthService; public static HttpClient HttpClient { get; } = new HttpClient(); - public static string AppId => true ? "d25517cb-12d4-4699-8bdc-52040c712cab" : "9ncqqxjtdlfh"; - public static string AdUnitId => true ? "test" : "1100037769"; + private static bool TestAds => true; //Change this bool + public static string AppId => TestAds ? "d25517cb-12d4-4699-8bdc-52040c712cab" : "9ncqqxjtdlfh"; + public static string AdUnitId => TestAds ? "test" : "1100037769"; public static bool AdsDisabled { get; private set; } = true; //User info diff --git a/FoxTube/Controls/Adverts/CardAdvert.xaml b/FoxTube/Controls/Adverts/CardAdvert.xaml index 4f5a4f6..9711087 100644 --- a/FoxTube/Controls/Adverts/CardAdvert.xaml +++ b/FoxTube/Controls/Adverts/CardAdvert.xaml @@ -9,7 +9,23 @@ VerticalAlignment="Top" d:DesignHeight="290" d:DesignWidth="384" - Visibility="Collapsed"> + Opacity="0" + Name="card"> + + + + + + + + + + + + + + +