From 4d13ea1226a4548bc54dd3d21d53d23484eb23d2 Mon Sep 17 00:00:00 2001 From: Michael Gordeev Date: Sun, 4 Nov 2018 15:32:51 +0300 Subject: [PATCH] Ads added; Fullscreen & minivew modes fixed; Titlebar returned --- FoxTube/App.xaml.cs | 6 ++---- FoxTube/Controls/Advert.xaml.cs | 5 ++--- FoxTube/Controls/VideoPlayer.xaml.cs | 7 ++----- FoxTube/Pages/MainPage.xaml.cs | 10 ++-------- FoxTube/Pages/SettingsPages/General.xaml.cs | 1 - 5 files changed, 8 insertions(+), 21 deletions(-) diff --git a/FoxTube/App.xaml.cs b/FoxTube/App.xaml.cs index 085c1e2..99b88bd 100644 --- a/FoxTube/App.xaml.cs +++ b/FoxTube/App.xaml.cs @@ -99,8 +99,7 @@ namespace FoxTube // Ensure the current window is active Window.Current.Activate(); } - - CoreApplication.GetCurrentView().TitleBar.ExtendViewIntoTitleBar = true; + ActivateToastBackgoundTask(); ActivateBackgoundTask(); } @@ -238,8 +237,7 @@ namespace FoxTube break; } } - - CoreApplication.GetCurrentView().TitleBar.ExtendViewIntoTitleBar = true; + Window.Current.Activate(); } diff --git a/FoxTube/Controls/Advert.xaml.cs b/FoxTube/Controls/Advert.xaml.cs index 3c12a1d..dfdf5e7 100644 --- a/FoxTube/Controls/Advert.xaml.cs +++ b/FoxTube/Controls/Advert.xaml.cs @@ -1,5 +1,4 @@ -using System.Diagnostics; -using Windows.UI.Xaml; +using Windows.UI.Xaml; using Windows.UI.Xaml.Controls; namespace FoxTube.Controls @@ -32,7 +31,7 @@ namespace FoxTube.Controls public Advert() { - this.InitializeComponent(); + InitializeComponent(); if (!SecretsVault.AdsDisabled) Visibility = Visibility.Visible; else diff --git a/FoxTube/Controls/VideoPlayer.xaml.cs b/FoxTube/Controls/VideoPlayer.xaml.cs index e8eeefa..19bb268 100644 --- a/FoxTube/Controls/VideoPlayer.xaml.cs +++ b/FoxTube/Controls/VideoPlayer.xaml.cs @@ -633,9 +633,8 @@ namespace FoxTube titleBar.ButtonBackgroundColor = Colors.Transparent; titleBar.ButtonInactiveBackgroundColor = Colors.Transparent; - - CoreApplicationViewTitleBar coreTitleBar = CoreApplication.GetCurrentView().TitleBar; - coreTitleBar.ExtendViewIntoTitleBar = true; + + CoreApplication.GetCurrentView().TitleBar.ExtendViewIntoTitleBar = true; mainControls.Visibility = Visibility.Collapsed; header.Visibility = Visibility.Collapsed; @@ -651,8 +650,6 @@ namespace FoxTube { await ApplicationView.GetForCurrentView().TryEnterViewModeAsync(ApplicationViewMode.Default); - //Methods.MainPage.SetTitleBar(); - mainControls.Visibility = Visibility.Visible; header.Visibility = Visibility.Visible; diff --git a/FoxTube/Pages/MainPage.xaml.cs b/FoxTube/Pages/MainPage.xaml.cs index e0d1319..cd1eae4 100644 --- a/FoxTube/Pages/MainPage.xaml.cs +++ b/FoxTube/Pages/MainPage.xaml.cs @@ -112,7 +112,6 @@ namespace FoxTube protected override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); - SetTitleBar(); } public Video GetCurrentItem() @@ -378,7 +377,6 @@ namespace FoxTube nav.IsBackEnabled = true; else nav.IsBackEnabled = false; - CoreApplication.GetCurrentView().TitleBar.ExtendViewIntoTitleBar = true; } public void MaximizeVideo() @@ -390,7 +388,6 @@ namespace FoxTube videoPlaceholder.Margin = new Thickness(0); nav.IsBackEnabled = true; - CoreApplication.GetCurrentView().TitleBar.ExtendViewIntoTitleBar = false; } public void Fullscreen(bool on) @@ -404,7 +401,7 @@ namespace FoxTube if ((videoPlaceholder.Content as VideoPage).player.MiniView) nav.Margin = new Thickness(0, -48, 0, 0); else - nav.Margin = new Thickness(0, -60, 0, 0); + nav.Margin = new Thickness(0, -50, 0, 0); } else { @@ -414,9 +411,8 @@ namespace FoxTube nav.Margin = new Thickness(0); nav.OpenPaneLength = 300; nav.CompactPaneLength = 48; + SetTitleBar(); } - - CoreApplication.GetCurrentView().TitleBar.ExtendViewIntoTitleBar = on; } public void CloseVideo() @@ -435,8 +431,6 @@ namespace FoxTube nav.IsBackEnabled = true; else nav.IsBackEnabled = false; - - CoreApplication.GetCurrentView().TitleBar.ExtendViewIntoTitleBar = false; } private void search_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args) diff --git a/FoxTube/Pages/SettingsPages/General.xaml.cs b/FoxTube/Pages/SettingsPages/General.xaml.cs index be096a5..d62547b 100644 --- a/FoxTube/Pages/SettingsPages/General.xaml.cs +++ b/FoxTube/Pages/SettingsPages/General.xaml.cs @@ -131,7 +131,6 @@ namespace FoxTube.Pages.SettingsPages else Methods.MainPage.RequestedTheme = ElementTheme.Light; } - Methods.MainPage.SetTitleBar(); }