Updated target version to 17134
Fixed headers Added ads to VideoGrid Related Work Items: #162, #188
This commit is contained in:
+7
-9
@@ -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">
|
||||
|
||||
<Application.Resources>
|
||||
<Color x:Key="SystemAccentColor">Red</Color>
|
||||
<Style TargetType="Button" BasedOn="{StaticResource ButtonRevealStyle}"/>
|
||||
<Style TargetType="ListViewItem" BasedOn="{StaticResource ListViewItemRevealStyle}"/>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="SelectionHighlightColor" Value="Red"/>
|
||||
</Style>
|
||||
<Style TargetType="TextBox">
|
||||
<Setter Property="SelectionHighlightColor" Value="Red"/>
|
||||
</Style>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="Themes/Resources.xml"/>
|
||||
<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls"/>
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
</Application.Resources>
|
||||
</Application>
|
||||
|
||||
@@ -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
|
||||
</en-US>
|
||||
<ru-RU>### Что нового:
|
||||
- Добавлено уведомление со списком изменений при первом запуске после обновления
|
||||
- Добавлена возможность добавлять видео в плейлисты на странице просмотра
|
||||
- Добавлена возможность добавлять видео в плейлисты через контекстное меню карточки
|
||||
- Добавлена возможность скачивать видео через контекстное меню карточки
|
||||
- Удаленные видео теперь также отображаются
|
||||
- Добавлена поддержка Апрельского Обновления 2018 (Windows 10 сборка 17134)
|
||||
- Добавлена реклама
|
||||
- Исправлено изменение заголовков
|
||||
</ru-RU>
|
||||
</content>
|
||||
</item>
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -9,7 +9,23 @@
|
||||
VerticalAlignment="Top"
|
||||
d:DesignHeight="290"
|
||||
d:DesignWidth="384"
|
||||
Visibility="Collapsed">
|
||||
Opacity="0"
|
||||
Name="card">
|
||||
|
||||
<UserControl.Resources>
|
||||
<Storyboard x:Name="show">
|
||||
<DoubleAnimation Storyboard.TargetName="card" Storyboard.TargetProperty="Opacity" From="0" To="1" Duration="{StaticResource CardOpacityDuration}"/>
|
||||
</Storyboard>
|
||||
<Storyboard x:Name="hide">
|
||||
<DoubleAnimation Storyboard.TargetName="card" Storyboard.TargetProperty="Opacity" From="1" To="0" Duration="{StaticResource CardOpacityDuration}"/>
|
||||
</Storyboard>
|
||||
<Storyboard x:Name="showThumb">
|
||||
<DoubleAnimation Storyboard.TargetName="image" Storyboard.TargetProperty="Opacity" From="0" To="1" Duration="{StaticResource CardOpacityDuration}"/>
|
||||
</Storyboard>
|
||||
<Storyboard x:Name="hideThumb">
|
||||
<DoubleAnimation Storyboard.TargetName="image" Storyboard.TargetProperty="Opacity" From="1" To="0" Duration="{StaticResource CardOpacityDuration}"/>
|
||||
</Storyboard>
|
||||
</UserControl.Resources>
|
||||
|
||||
<Button Padding="0" Background="{ThemeResource SystemControlBackgroundChromeMediumBrush}">
|
||||
<Grid>
|
||||
@@ -20,10 +36,10 @@
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Image Source="/Assets/videoPlaceholder.png" Opacity=".0001" Stretch="Fill"/>
|
||||
<Image Name="image" Source="/Assets/videoThumbSample.png" Stretch="Fill"/>
|
||||
<Image Name="image" Stretch="Fill" ImageOpened="Image_ImageOpened"/>
|
||||
|
||||
<StackPanel Margin="0,0,5,5" Background="Orange" VerticalAlignment="Bottom" BorderBrush="OrangeRed" BorderThickness="1" HorizontalAlignment="Right" Padding="5,2,5,3">
|
||||
<TextBlock Name="info" Text="SPONSORED CONTENT" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="Gray" FontSize="12"/>
|
||||
<TextBlock Name="info" Text="CALL TO ACTION TEXT" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="Gray" FontSize="12"/>
|
||||
</StackPanel>
|
||||
|
||||
<Grid Grid.Row="1" Name="contentGrid">
|
||||
|
||||
@@ -13,13 +13,26 @@ namespace FoxTube.Controls.Adverts
|
||||
{
|
||||
NativeAdsManagerV2 manager = new NativeAdsManagerV2(SecretsVault.AppId, SecretsVault.AdUnitId);
|
||||
public NativeAdV2 advert;
|
||||
public CardAdvert()
|
||||
public CardAdvert(bool isOnVideoPage = false)
|
||||
{
|
||||
InitializeComponent();
|
||||
if(!isOnVideoPage)
|
||||
MainPage.VideoPageSizeChanged += Methods_VideoPageSizeChanged;
|
||||
manager.AdReady += AdReady;
|
||||
manager.ErrorOccurred += ErrorOccurred;
|
||||
manager.RequestAd();
|
||||
}
|
||||
|
||||
private void Methods_VideoPageSizeChanged(object sender = null, params object[] args)
|
||||
{
|
||||
Visibility = (bool)args[0] ? Visibility.Collapsed : Visibility.Visible;
|
||||
}
|
||||
|
||||
private void ErrorOccurred(object sender, NativeAdErrorEventArgs e)
|
||||
{
|
||||
System.Diagnostics.Debug.WriteLine("Error has occured while loading ad");
|
||||
}
|
||||
|
||||
private void AdReady(object sender, NativeAdReadyEventArgs e)
|
||||
{
|
||||
advert = e.NativeAd;
|
||||
@@ -32,24 +45,29 @@ namespace FoxTube.Controls.Adverts
|
||||
title.Text = advert.Title;
|
||||
image.Source = new BitmapImage(advert.MainImages.First().Url.ToUri());
|
||||
|
||||
icon.ProfilePicture = advert.AdIcon.Source;
|
||||
icon.ProfilePicture = advert.AdIcon == null ? null : advert.AdIcon.Source;
|
||||
|
||||
if (string.IsNullOrWhiteSpace(advert.SponsoredBy))
|
||||
sponsor.Visibility = Visibility.Collapsed;
|
||||
sponsor.Text = advert.SponsoredBy.GuardFromNull();
|
||||
|
||||
if (advert.CallToActionText.IsNullOrWhiteSpace())
|
||||
(info.Parent as FrameworkElement).Visibility = Visibility.Collapsed;
|
||||
else
|
||||
sponsor.Text = advert.SponsoredBy;
|
||||
info.Text = advert.CallToActionText;
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(advert.Rating))
|
||||
info.Text += $" {advert.Rating}";
|
||||
desc.Text = string.Empty;
|
||||
|
||||
if (string.IsNullOrWhiteSpace(advert.CallToActionText) && string.IsNullOrWhiteSpace(advert.Price))
|
||||
desc.Visibility = Visibility.Collapsed;
|
||||
else if (!string.IsNullOrWhiteSpace(advert.CallToActionText))
|
||||
desc.Text = advert.CallToActionText;
|
||||
else
|
||||
desc.Text = advert.Price;
|
||||
if (!advert.Price.IsNullOrWhiteSpace())
|
||||
desc.Text += advert.Price;
|
||||
|
||||
Visibility = Visibility.Visible;
|
||||
if (!advert.Rating.IsNullOrWhiteSpace())
|
||||
desc.Text += " " + advert.Rating;
|
||||
|
||||
show.Begin();
|
||||
}
|
||||
|
||||
private void Image_ImageOpened(object sender, RoutedEventArgs e)
|
||||
{
|
||||
showThumb.Begin();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,11 +10,23 @@
|
||||
VerticalAlignment="Top"
|
||||
d:DesignHeight="290"
|
||||
d:DesignWidth="384"
|
||||
Opacity="0">
|
||||
Opacity="0"
|
||||
Name="card">
|
||||
|
||||
<Windows10version1809:UserControl.OpacityTransition>
|
||||
<ScalarTransition Duration="0:0:0.5"/>
|
||||
</Windows10version1809:UserControl.OpacityTransition>
|
||||
<UserControl.Resources>
|
||||
<Storyboard x:Name="show">
|
||||
<DoubleAnimation Storyboard.TargetName="card" Storyboard.TargetProperty="Opacity" From="0" To="1" Duration="{StaticResource CardOpacityDuration}"/>
|
||||
</Storyboard>
|
||||
<Storyboard x:Name="hide">
|
||||
<DoubleAnimation Storyboard.TargetName="card" Storyboard.TargetProperty="Opacity" From="1" To="0" Duration="{StaticResource CardOpacityDuration}"/>
|
||||
</Storyboard>
|
||||
<Storyboard x:Name="showThumb">
|
||||
<DoubleAnimation Storyboard.TargetName="thumbnail" Storyboard.TargetProperty="Opacity" From="0" To="1" Duration="{StaticResource CardOpacityDuration}"/>
|
||||
</Storyboard>
|
||||
<Storyboard x:Name="hideThumb">
|
||||
<DoubleAnimation Storyboard.TargetName="thumbnail" Storyboard.TargetProperty="Opacity" From="1" To="0" Duration="{StaticResource CardOpacityDuration}"/>
|
||||
</Storyboard>
|
||||
</UserControl.Resources>
|
||||
|
||||
<Button Padding="0" Margin="1" Background="{ThemeResource SystemControlBackgroundChromeMediumBrush}" Click="Button_Click">
|
||||
<Grid Name="grid">
|
||||
@@ -26,11 +38,7 @@
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Image Source="/Assets/ChannelCoverTemplate.png" Stretch="UniformToFill" Opacity=".0001"/>
|
||||
<Image Name="cover" Source="/Assets/ChannelCoverTemplate.png" Stretch="UniformToFill" ImageOpened="Cover_ImageOpened" Opacity="0">
|
||||
<Windows10version1809:Image.OpacityTransition>
|
||||
<ScalarTransition Duration="0:0:0.5"/>
|
||||
</Windows10version1809:Image.OpacityTransition>
|
||||
</Image>
|
||||
<Image Name="cover" Source="/Assets/ChannelCoverTemplate.png" Stretch="UniformToFill" ImageOpened="Cover_ImageOpened" Opacity="0"/>
|
||||
|
||||
<StackPanel Name="liveTag" Margin="5" Background="Red" BorderBrush="White" BorderThickness="1" VerticalAlignment="Bottom" HorizontalAlignment="Right" Padding="5,2,5,3" Orientation="Horizontal" Visibility="Collapsed">
|
||||
<TextBlock Text=" " VerticalAlignment="Center" Foreground="White" FontSize="12" FontFamily="Segoe MDL2 Assets" FontWeight="Black"/>
|
||||
|
||||
@@ -82,7 +82,7 @@ namespace FoxTube.Controls
|
||||
});
|
||||
}
|
||||
|
||||
Opacity = 1;
|
||||
show.Begin();
|
||||
}
|
||||
|
||||
public void Button_Click(object sender, RoutedEventArgs e)
|
||||
@@ -125,7 +125,7 @@ namespace FoxTube.Controls
|
||||
|
||||
private void Cover_ImageOpened(object sender, RoutedEventArgs e)
|
||||
{
|
||||
cover.Opacity = 1;
|
||||
showThumb.Begin();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,8 +4,6 @@
|
||||
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:controls1="using:FoxTube.Controls"
|
||||
xmlns:Windows10version1809="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractPresent(Windows.Foundation.UniversalApiContract, 7)"
|
||||
xmlns:foxtube="using:FoxTube"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="1080"
|
||||
|
||||
@@ -10,11 +10,23 @@
|
||||
VerticalAlignment="Top"
|
||||
d:DesignHeight="290"
|
||||
d:DesignWidth="384"
|
||||
Opacity="0">
|
||||
Opacity="0"
|
||||
Name="card">
|
||||
|
||||
<Windows10version1809:Page.OpacityTransition>
|
||||
<ScalarTransition Duration="0:0:0.5"/>
|
||||
</Windows10version1809:Page.OpacityTransition>
|
||||
<UserControl.Resources>
|
||||
<Storyboard x:Name="show">
|
||||
<DoubleAnimation Storyboard.TargetName="card" Storyboard.TargetProperty="Opacity" From="0" To="1" Duration="{StaticResource CardOpacityDuration}"/>
|
||||
</Storyboard>
|
||||
<Storyboard x:Name="hide">
|
||||
<DoubleAnimation Storyboard.TargetName="card" Storyboard.TargetProperty="Opacity" From="1" To="0" Duration="{StaticResource CardOpacityDuration}"/>
|
||||
</Storyboard>
|
||||
<Storyboard x:Name="showThumb">
|
||||
<DoubleAnimation Storyboard.TargetName="thumbnail" Storyboard.TargetProperty="Opacity" From="0" To="1" Duration="{StaticResource CardOpacityDuration}"/>
|
||||
</Storyboard>
|
||||
<Storyboard x:Name="hideThumb">
|
||||
<DoubleAnimation Storyboard.TargetName="thumbnail" Storyboard.TargetProperty="Opacity" From="1" To="0" Duration="{StaticResource CardOpacityDuration}"/>
|
||||
</Storyboard>
|
||||
</UserControl.Resources>
|
||||
|
||||
<Button Padding="0" Margin="1" Background="{ThemeResource SystemControlBackgroundChromeMediumBrush}" Click="Button_Click">
|
||||
<Grid>
|
||||
@@ -25,11 +37,7 @@
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Image Source="/Assets/videoPlaceholder.png" Opacity=".0001" Stretch="Fill"/>
|
||||
<Image Name="thumbnail" Source="/Assets/videoThumbSample.png" Stretch="Fill" Opacity="0" ImageOpened="Thumbnail_ImageOpened">
|
||||
<Windows10version1809:Image.OpacityTransition>
|
||||
<ScalarTransition Duration="0:0:0.5"/>
|
||||
</Windows10version1809:Image.OpacityTransition>
|
||||
</Image>
|
||||
<Image Name="thumbnail" Source="/Assets/videoThumbSample.png" Stretch="Fill" Opacity="0" ImageOpened="Thumbnail_ImageOpened"/>
|
||||
|
||||
<Grid HorizontalAlignment="Right" Width="100">
|
||||
<Grid.Background>
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace FoxTube.Controls
|
||||
try { avatar.ProfilePicture = new BitmapImage(new Uri((await r.ExecuteAsync()).Items[0].Snippet.Thumbnails.Medium.Url)) { DecodePixelWidth = 46, DecodePixelHeight = 46 }; }
|
||||
catch { }
|
||||
|
||||
Opacity = 1;
|
||||
show.Begin();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -87,7 +87,7 @@ namespace FoxTube.Controls
|
||||
|
||||
private void Thumbnail_ImageOpened(object sender, RoutedEventArgs e)
|
||||
{
|
||||
thumbnail.Opacity = 1;
|
||||
showThumb.Begin();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,11 +10,23 @@
|
||||
VerticalAlignment="Top"
|
||||
d:DesignHeight="290"
|
||||
d:DesignWidth="384"
|
||||
Opacity="0">
|
||||
Opacity="0"
|
||||
Name="card">
|
||||
|
||||
<Windows10version1809:UserControl.OpacityTransition>
|
||||
<ScalarTransition Duration="0:0:0.5"/>
|
||||
</Windows10version1809:UserControl.OpacityTransition>
|
||||
<UserControl.Resources>
|
||||
<Storyboard x:Name="show">
|
||||
<DoubleAnimation Storyboard.TargetName="card" Storyboard.TargetProperty="Opacity" From="0" To="1" Duration="{StaticResource CardOpacityDuration}"/>
|
||||
</Storyboard>
|
||||
<Storyboard x:Name="hide">
|
||||
<DoubleAnimation Storyboard.TargetName="card" Storyboard.TargetProperty="Opacity" From="1" To="0" Duration="{StaticResource CardOpacityDuration}"/>
|
||||
</Storyboard>
|
||||
<Storyboard x:Name="showThumb">
|
||||
<DoubleAnimation Storyboard.TargetName="thumbnail" Storyboard.TargetProperty="Opacity" From="0" To="1" Duration="{StaticResource CardOpacityDuration}"/>
|
||||
</Storyboard>
|
||||
<Storyboard x:Name="hideThumb">
|
||||
<DoubleAnimation Storyboard.TargetName="thumbnail" Storyboard.TargetProperty="Opacity" From="1" To="0" Duration="{StaticResource CardOpacityDuration}"/>
|
||||
</Storyboard>
|
||||
</UserControl.Resources>
|
||||
|
||||
<Button Padding="0" Margin="1" Background="{ThemeResource SystemControlBackgroundChromeMediumBrush}" Click="Button_Click">
|
||||
<Grid>
|
||||
@@ -25,11 +37,7 @@
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Image Source="/Assets/videoPlaceholder.png" Opacity=".0001" Stretch="Fill"/>
|
||||
<Image Name="thumbnail" Source="/Assets/videoThumbSample.png" Stretch="Fill" ImageOpened="Thumbnail_ImageOpened" Opacity="0">
|
||||
<Windows10version1809:Image.OpacityTransition>
|
||||
<ScalarTransition Duration="0:0:0.5"/>
|
||||
</Windows10version1809:Image.OpacityTransition>
|
||||
</Image>
|
||||
<Image Name="thumbnail" Source="/Assets/videoThumbSample.png" Stretch="Fill" ImageOpened="Thumbnail_ImageOpened" Opacity="0"/>
|
||||
|
||||
<Grid Background="#7F000000" Name="watched" Visibility="Collapsed">
|
||||
<StackPanel Margin="5" Background="{ThemeResource SystemControlBackgroundChromeMediumBrush}" VerticalAlignment="Top" HorizontalAlignment="Left" Padding="5,2,5,2" BorderBrush="Gray" BorderThickness="1">
|
||||
|
||||
@@ -57,7 +57,7 @@ namespace FoxTube.Controls
|
||||
if (item.Snippet.Title == "Deleted video")
|
||||
{
|
||||
ContextFlyout = null;
|
||||
Opacity = 1;
|
||||
show.Begin();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -101,7 +101,7 @@ namespace FoxTube.Controls
|
||||
if(SecretsVault.History.Contains(videoId))
|
||||
watched.Visibility = Visibility.Visible;
|
||||
|
||||
Opacity = 1;
|
||||
show.Begin();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -193,7 +193,7 @@ namespace FoxTube.Controls
|
||||
if (SecretsVault.History.Contains(videoId))
|
||||
watched.Visibility = Visibility.Visible;
|
||||
|
||||
Opacity = 1;
|
||||
show.Begin();
|
||||
}
|
||||
|
||||
public async void Button_Click(object sender, RoutedEventArgs e)
|
||||
@@ -252,7 +252,7 @@ namespace FoxTube.Controls
|
||||
|
||||
private void Thumbnail_ImageOpened(object sender, RoutedEventArgs e)
|
||||
{
|
||||
thumbnail.Opacity = 1;
|
||||
showThumb.Begin();
|
||||
}
|
||||
|
||||
private async void NewPlaylist_Click(object sender, RoutedEventArgs e)
|
||||
|
||||
+8
-10
@@ -11,7 +11,7 @@
|
||||
<AssemblyName>FoxTube</AssemblyName>
|
||||
<DefaultLanguage>en-US</DefaultLanguage>
|
||||
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
|
||||
<TargetPlatformVersion Condition=" '$(TargetPlatformVersion)' == '' ">10.0.17763.0</TargetPlatformVersion>
|
||||
<TargetPlatformVersion Condition=" '$(TargetPlatformVersion)' == '' ">10.0.17134.0</TargetPlatformVersion>
|
||||
<TargetPlatformMinVersion>10.0.17134.0</TargetPlatformMinVersion>
|
||||
<MinimumVisualStudioVersion>14</MinimumVisualStudioVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
@@ -390,11 +390,12 @@
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="Themes\Resources.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="AdaptiveCards.Rendering.Uwp">
|
||||
<Version>1.1.2</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Google.Apis">
|
||||
<Version>1.30.0-beta02</Version>
|
||||
</PackageReference>
|
||||
@@ -414,7 +415,7 @@
|
||||
<Version>10.1811.22001</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.AppCenter.Analytics">
|
||||
<Version>1.13.2</Version>
|
||||
<Version>1.14.0</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform">
|
||||
<Version>6.2.8</Version>
|
||||
@@ -429,16 +430,13 @@
|
||||
<Version>5.1.1</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.UI.Xaml">
|
||||
<Version>2.0.181018004</Version>
|
||||
<Version>2.0.181011001</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="runtime.win10-arm64.runtime.native.System.IO.Compression">
|
||||
<Version>4.3.2</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="YoutubeExplode">
|
||||
<Version>4.6.7</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="YoutubeExtractor">
|
||||
<Version>0.10.11</Version>
|
||||
<Version>4.6.8</Version>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
||||
@@ -8,9 +8,23 @@
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:pages="using:FoxTube.Pages"
|
||||
xmlns:controls="using:FoxTube.Controls"
|
||||
xmlns:Windows10version1809="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractPresent(Windows.Foundation.UniversalApiContract, 7)"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<Page.Resources>
|
||||
<Storyboard x:Name="showHeader">
|
||||
<DoubleAnimation Storyboard.TargetName="ColapsedHeader" Storyboard.TargetProperty="Opacity" From="0" To="1" Duration="{StaticResource CardOpacityDuration}"/>
|
||||
</Storyboard>
|
||||
<Storyboard x:Name="hideHeader">
|
||||
<DoubleAnimation Storyboard.TargetName="ColapsedHeader" Storyboard.TargetProperty="Opacity" From="1" To="0" Duration="{StaticResource CardOpacityDuration}"/>
|
||||
</Storyboard>
|
||||
<Storyboard x:Name="showThumb">
|
||||
<DoubleAnimation Storyboard.TargetName="channelCover" Storyboard.TargetProperty="Opacity" From="0" To="1" Duration="{StaticResource CardOpacityDuration}"/>
|
||||
</Storyboard>
|
||||
<Storyboard x:Name="hideThumb">
|
||||
<DoubleAnimation Storyboard.TargetName="channelCover" Storyboard.TargetProperty="Opacity" From="1" To="0" Duration="{StaticResource CardOpacityDuration}"/>
|
||||
</Storyboard>
|
||||
</Page.Resources>
|
||||
|
||||
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" SizeChanged="Grid_SizeChanged">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition/>
|
||||
@@ -22,11 +36,7 @@
|
||||
<Grid>
|
||||
<ParallaxView Source="{x:Bind videoScroll}" VerticalShift="100">
|
||||
<Grid>
|
||||
<Image Source="/Assets/ChannelCoverTemplate.png" Name="channelCover" Stretch="Uniform" HorizontalAlignment="Left" VerticalAlignment="Top" Opacity="0" ImageOpened="ChannelCover_ImageOpened">
|
||||
<Windows10version1809:Image.OpacityTransition>
|
||||
<ScalarTransition Duration="0:0:0.5"/>
|
||||
</Windows10version1809:Image.OpacityTransition>
|
||||
</Image>
|
||||
<Image Source="/Assets/ChannelCoverTemplate.png" Name="channelCover" Stretch="Uniform" HorizontalAlignment="Left" VerticalAlignment="Top" Opacity="0" ImageOpened="ChannelCover_ImageOpened"/>
|
||||
</Grid>
|
||||
</ParallaxView>
|
||||
<ScrollViewer ViewChanged="ScrollViewer_ViewChanged" Name="videoScroll">
|
||||
@@ -78,14 +88,11 @@
|
||||
<Pivot.RightHeader>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<StackPanel Orientation="Horizontal" Name="ColapsedHeader" Opacity="0">
|
||||
<Windows10version1809:StackPanel.OpacityTransition>
|
||||
<ScalarTransition/>
|
||||
</Windows10version1809:StackPanel.OpacityTransition>
|
||||
<PersonPicture Height="32" Name="collapsedAvatar"/>
|
||||
<TextBlock Text="Channel name" VerticalAlignment="Center" Margin="10,0" Name="collapsedTitle"/>
|
||||
<Button x:Uid="/Cards/subscribe" Background="Red" Foreground="White" FontWeight="SemiBold" Content="Subscribe" Width="150" Name="collapsedBtn" Click="Subscribe_Click" Padding="2"/>
|
||||
</StackPanel>
|
||||
<AutoSuggestBox x:Uid="/Channel/search" VerticalAlignment="Center" Width="250" Margin="8" PlaceholderText="Search on channel" QueryIcon="Find" Name="search" QuerySubmitted="AutoSuggestBox_QuerySubmitted"/>
|
||||
<AutoSuggestBox FontSize="14" x:Uid="/Channel/search" VerticalAlignment="Center" Width="250" Margin="8" PlaceholderText="Search on channel" QueryIcon="Find" Name="search" QuerySubmitted="AutoSuggestBox_QuerySubmitted"/>
|
||||
</StackPanel>
|
||||
</Pivot.RightHeader>
|
||||
</Pivot>
|
||||
|
||||
@@ -175,7 +175,7 @@ namespace FoxTube.Pages
|
||||
if (content.SelectedIndex == 0)
|
||||
ScrollViewer_ViewChanged(this, null);
|
||||
else
|
||||
ColapsedHeader.Opacity = 1;
|
||||
showHeader.Begin();
|
||||
}
|
||||
|
||||
private async void ShowMorePlaylists_Click()
|
||||
@@ -259,9 +259,15 @@ namespace FoxTube.Pages
|
||||
Rect view = new Rect(0.0, 0.0, videoScroll.ActualWidth, videoScroll.ActualHeight);
|
||||
|
||||
if (view.Contains(new Point(panel.Left, panel.Bottom)))
|
||||
ColapsedHeader.Opacity = 0;
|
||||
{
|
||||
if (ColapsedHeader.Opacity == 1)
|
||||
hideHeader.Begin();
|
||||
}
|
||||
else
|
||||
ColapsedHeader.Opacity = 1;
|
||||
{
|
||||
if (ColapsedHeader.Opacity == 0)
|
||||
showHeader.Begin();
|
||||
}
|
||||
}
|
||||
|
||||
private void Refresh_Click(object sender, RoutedEventArgs e)
|
||||
@@ -281,7 +287,7 @@ namespace FoxTube.Pages
|
||||
|
||||
private void ChannelCover_ImageOpened(object sender, RoutedEventArgs e)
|
||||
{
|
||||
channelCover.Opacity = 1;
|
||||
showThumb.Begin();
|
||||
infoStack.Margin = new Thickness(0, channelCover.ActualHeight, 0, 0);
|
||||
}
|
||||
|
||||
|
||||
+52
-56
@@ -4,14 +4,10 @@
|
||||
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:Windows10version1809="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractPresent(Windows.Foundation.UniversalApiContract, 7)"
|
||||
xmlns:Windows10version1803="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractPresent(Windows.Foundation.UniversalApiContract, 6)"
|
||||
mc:Ignorable="d">
|
||||
mc:Ignorable="d"
|
||||
xmlns:ui="using:Microsoft.UI.Xaml.Controls">
|
||||
|
||||
<Grid Name="grid" Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
||||
<Windows10version1809:Grid.BackgroundTransition>
|
||||
<BrushTransition/>
|
||||
</Windows10version1809:Grid.BackgroundTransition>
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
<VisualStateGroup>
|
||||
<VisualState>
|
||||
@@ -25,26 +21,26 @@
|
||||
</VisualStateGroup>
|
||||
</VisualStateManager.VisualStateGroups>
|
||||
|
||||
<Border x:Name="AppTitleBar"
|
||||
<Border x:Name="AppTitleBar"
|
||||
IsHitTestVisible="True"
|
||||
VerticalAlignment="Top"
|
||||
Background="Transparent"
|
||||
Canvas.ZIndex="1">
|
||||
|
||||
<TextBlock x:Name="AppTitle"
|
||||
<TextBlock x:Name="AppTitle"
|
||||
Text="FoxTube"
|
||||
VerticalAlignment="Center"
|
||||
Margin="12, 8, 0, 0"
|
||||
Style="{StaticResource CaptionTextBlockStyle}" />
|
||||
</Border>
|
||||
|
||||
<NavigationView SelectedItem="toHome" Windows10version1803:BackRequested="Nav_BackRequested" Windows10version1803:PaneClosing="Nav_PaneClosing" Windows10version1803:PaneOpened="Nav_PaneOpened" OpenPaneLength="300" Name="nav" SelectionChanged="Nav_SelectionChanged">
|
||||
<ui:NavigationView FontSize="14" SelectedItem="toHome" BackRequested="Nav_BackRequested" PaneClosing="Nav_PaneClosing" PaneOpened="Nav_PaneOpened" OpenPaneLength="300" Name="nav" SelectionChanged="Nav_SelectionChanged">
|
||||
|
||||
<NavigationView.Header>
|
||||
<TextBlock Name="Title" Margin="0,30,0,10" Style="{StaticResource TitleTextBlockStyle}"/>
|
||||
</NavigationView.Header>
|
||||
<ui:NavigationView.Header>
|
||||
<TextBlock Name="Title" Style="{StaticResource TitleTextBlockStyle}"/>
|
||||
</ui:NavigationView.Header>
|
||||
|
||||
<NavigationView.MenuItemTemplate>
|
||||
<ui:NavigationView.MenuItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Horizontal" Padding="5" Margin="-5,0,0,0" Tag="{Binding Snippet.ResourceId.ChannelId}">
|
||||
<PersonPicture Height="20" Margin="-5,0,15,0">
|
||||
@@ -52,61 +48,61 @@
|
||||
<BitmapImage UriSource="{Binding Snippet.Thumbnails.Medium.Url}" DecodePixelHeight="20" DecodePixelWidth="20"/>
|
||||
</PersonPicture.ProfilePicture>
|
||||
</PersonPicture>
|
||||
<TextBlock Text="{Binding Snippet.Title}"/>
|
||||
<TextBlock FontSize="14" Text="{Binding Snippet.Title}"/>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</NavigationView.MenuItemTemplate>
|
||||
</ui:NavigationView.MenuItemTemplate>
|
||||
|
||||
<NavigationView.MenuItems>
|
||||
<NavigationViewItem x:Uid="/Main/home" Icon="Home" Content="Home" Name="toHome"/>
|
||||
<NavigationViewItem x:Uid="/Main/myChannel" Icon="Contact" Content="My channel" Name="toChannel" Visibility="Collapsed"/>
|
||||
<NavigationViewItem x:Uid="/Main/subscriptions" Icon="People" Content="Subscriptions" Name="toSubscriptions" Visibility="Collapsed"/>
|
||||
<NavigationViewItemHeader x:Uid="/Main/myLibrary" Content="My library" Name="libHeader" Visibility="Collapsed"/>
|
||||
<NavigationViewItem x:Uid="/Main/history" Content="History" Name="toHistory" Visibility="Collapsed">
|
||||
<NavigationViewItem.Icon>
|
||||
<ui:NavigationView.MenuItems>
|
||||
<ui:NavigationViewItem x:Uid="/Main/home" Icon="Home" Content="Home" Name="toHome"/>
|
||||
<ui:NavigationViewItem x:Uid="/Main/myChannel" Icon="Contact" Content="My channel" Name="toChannel" Visibility="Collapsed"/>
|
||||
<ui:NavigationViewItem x:Uid="/Main/subscriptions" Icon="People" Content="Subscriptions" Name="toSubscriptions" Visibility="Collapsed"/>
|
||||
<ui:NavigationViewItemHeader x:Uid="/Main/myLibrary" FontSize="14" Content="My library" Name="libHeader" Visibility="Collapsed"/>
|
||||
<ui:NavigationViewItem x:Uid="/Main/history" Content="History" Name="toHistory" Visibility="Collapsed">
|
||||
<ui:NavigationViewItem.Icon>
|
||||
<FontIcon Glyph=""/>
|
||||
</NavigationViewItem.Icon>
|
||||
</NavigationViewItem>
|
||||
<NavigationViewItem x:Uid="/Main/liked" Icon="Like" Content="Liked videos" Name="toLiked" Visibility="Collapsed"/>
|
||||
<NavigationViewItem x:Uid="/Main/later" Icon="Clock" Content="Watch later" Name="toLater" Visibility="Collapsed"/>
|
||||
<NavigationViewItem x:Uid="/Main/downloads" Icon="Download" Content="Downloads" Name="toDownloads"/>
|
||||
<NavigationViewItemHeader x:Uid="/Main/subscriptions" Content="Subscriptions" Name="subsHeader" Visibility="Collapsed"/>
|
||||
</NavigationView.MenuItems>
|
||||
</ui:NavigationViewItem.Icon>
|
||||
</ui:NavigationViewItem>
|
||||
<ui:NavigationViewItem x:Uid="/Main/liked" Icon="Like" Content="Liked videos" Name="toLiked" Visibility="Collapsed"/>
|
||||
<ui:NavigationViewItem x:Uid="/Main/later" Icon="Clock" Content="Watch later" Name="toLater" Visibility="Collapsed"/>
|
||||
<ui:NavigationViewItem x:Uid="/Main/downloads" Icon="Download" Content="Downloads" Name="toDownloads"/>
|
||||
<ui:NavigationViewItemHeader x:Uid="/Main/subscriptions" FontSize="14" Content="Subscriptions" Name="subsHeader" Visibility="Collapsed"/>
|
||||
</ui:NavigationView.MenuItems>
|
||||
|
||||
<NavigationView.PaneFooter>
|
||||
<NavigationViewList>
|
||||
<NavigationViewList.ItemContainerTransitions>
|
||||
<ui:NavigationView.PaneFooter>
|
||||
<ui:NavigationViewList>
|
||||
<ui:NavigationViewList.ItemContainerTransitions>
|
||||
<TransitionCollection>
|
||||
<EntranceThemeTransition IsStaggeringEnabled="True"/>
|
||||
<ReorderThemeTransition/>
|
||||
</TransitionCollection>
|
||||
</NavigationViewList.ItemContainerTransitions>
|
||||
<NavigationViewItem Name="openWeb" Tapped="Web_Tapped" Icon="Globe" Content="Browser" Visibility="Collapsed"/>
|
||||
<NavigationViewItem x:Uid="/Main/feedback" Name="feedback" Content="Give a feedback" Tapped="Feedback_Click" Visibility="Collapsed">
|
||||
<NavigationViewItem.Icon>
|
||||
</ui:NavigationViewList.ItemContainerTransitions>
|
||||
<ui:NavigationViewItem Name="openWeb" Tapped="Web_Tapped" Icon="Globe" Content="Browser" Visibility="Collapsed"/>
|
||||
<ui:NavigationViewItem x:Uid="/Main/feedback" Name="feedback" Content="Give a feedback" Tapped="Feedback_Click" Visibility="Collapsed">
|
||||
<ui:NavigationViewItem.Icon>
|
||||
<FontIcon Glyph=""/>
|
||||
</NavigationViewItem.Icon>
|
||||
</NavigationViewItem>
|
||||
</ui:NavigationViewItem.Icon>
|
||||
</ui:NavigationViewItem>
|
||||
|
||||
<NavigationViewItem x:Uid="/Main/adsFree" Content="Remove ads" Visibility="Collapsed" Tapped="RemoveAds_Tapped" Name="removeAds">
|
||||
<NavigationViewItem.Icon>
|
||||
<ui:NavigationViewItem x:Uid="/Main/adsFree" Content="Remove ads" Visibility="Collapsed" Tapped="RemoveAds_Tapped" Name="removeAds">
|
||||
<ui:NavigationViewItem.Icon>
|
||||
<FontIcon Glyph=""/>
|
||||
</NavigationViewItem.Icon>
|
||||
</NavigationViewItem>
|
||||
</ui:NavigationViewItem.Icon>
|
||||
</ui:NavigationViewItem>
|
||||
|
||||
<NavigationViewItem Name="account" x:Uid="/Main/signIn" Content="Add account" Tapped="SignIn_Click" Visibility="Collapsed">
|
||||
<NavigationViewItem.Icon>
|
||||
<ui:NavigationViewItem Name="account" x:Uid="/Main/signIn" Content="Add account" Tapped="SignIn_Click" Visibility="Collapsed">
|
||||
<ui:NavigationViewItem.Icon>
|
||||
<FontIcon Glyph=""/>
|
||||
</NavigationViewItem.Icon>
|
||||
</NavigationViewItem>
|
||||
</ui:NavigationViewItem.Icon>
|
||||
</ui:NavigationViewItem>
|
||||
|
||||
<NavigationViewItem Visibility="Collapsed" Name="avatar" Tapped="OpenContext" Padding="-5">
|
||||
<ui:NavigationViewItem Visibility="Collapsed" Name="avatar" Tapped="OpenContext" Padding="-5">
|
||||
<StackPanel Orientation="Horizontal" Padding="5">
|
||||
<PersonPicture Height="20" Margin="-5,0,15,0"/>
|
||||
<TextBlock Name="myName" Text="My account"/>
|
||||
</StackPanel>
|
||||
|
||||
<NavigationViewItem.ContextFlyout>
|
||||
<ui:NavigationViewItem.ContextFlyout>
|
||||
<Flyout>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
@@ -121,20 +117,20 @@
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Flyout>
|
||||
</NavigationViewItem.ContextFlyout>
|
||||
</NavigationViewItem>
|
||||
</NavigationViewList>
|
||||
</NavigationView.PaneFooter>
|
||||
</ui:NavigationViewItem.ContextFlyout>
|
||||
</ui:NavigationViewItem>
|
||||
</ui:NavigationViewList>
|
||||
</ui:NavigationView.PaneFooter>
|
||||
|
||||
<NavigationView.AutoSuggestBox>
|
||||
<AutoSuggestBox x:Name="search" QueryIcon="Find" QuerySubmitted="Search_QuerySubmitted" TextChanged="Search_TextChanged" x:Uid="/Main/searchPlaceholder" PlaceholderText="Search"/>
|
||||
</NavigationView.AutoSuggestBox>
|
||||
<ui:NavigationView.AutoSuggestBox>
|
||||
<AutoSuggestBox FontSize="14" x:Name="search" QueryIcon="Find" QuerySubmitted="Search_QuerySubmitted" TextChanged="Search_TextChanged" x:Uid="/Main/searchPlaceholder" PlaceholderText="Search"/>
|
||||
</ui:NavigationView.AutoSuggestBox>
|
||||
|
||||
<Grid>
|
||||
<Frame Name="content" Navigated="Content_Navigated"/>
|
||||
<Frame Name="videoPlaceholder"/>
|
||||
</Grid>
|
||||
|
||||
</NavigationView>
|
||||
</ui:NavigationView>
|
||||
</Grid>
|
||||
</Page>
|
||||
|
||||
@@ -12,14 +12,11 @@ using System.Xml;
|
||||
using Google.Apis.YouTube.v3.Data;
|
||||
using Windows.ApplicationModel.Core;
|
||||
using Windows.System;
|
||||
using Google.Apis.Oauth2.v2;
|
||||
using Google.Apis.Oauth2.v2.Data;
|
||||
using FoxTube.Pages;
|
||||
using Windows.UI.Popups;
|
||||
using Windows.Networking.Connectivity;
|
||||
using Windows.ApplicationModel.Resources;
|
||||
using Microsoft.Services.Store.Engagement;
|
||||
using System.Linq;
|
||||
|
||||
namespace FoxTube
|
||||
{
|
||||
@@ -29,6 +26,7 @@ namespace FoxTube
|
||||
public sealed partial class MainPage : Page
|
||||
{
|
||||
bool wasInvoked = false;
|
||||
public static event ObjectEventHandler VideoPageSizeChanged;
|
||||
readonly ResourceLoader resources = ResourceLoader.GetForCurrentView("Main");
|
||||
Dictionary<Type, Action> headers;
|
||||
public MainPage()
|
||||
@@ -157,7 +155,7 @@ namespace FoxTube
|
||||
break;
|
||||
|
||||
case "remove":
|
||||
NavigationViewItem item = nav.MenuItems.Find(i => ((i as NavigationViewItem).Content as StackPanel).Tag.ToString() == (args[1] as Subscription).Snippet.ResourceId.ChannelId) as NavigationViewItem;
|
||||
Microsoft.UI.Xaml.Controls.NavigationViewItem item = nav.MenuItems.Find(i => ((i as Microsoft.UI.Xaml.Controls.NavigationViewItem).Content as StackPanel).Tag.ToString() == (args[1] as Subscription).Snippet.ResourceId.ChannelId) as Microsoft.UI.Xaml.Controls.NavigationViewItem;
|
||||
if (item == null)
|
||||
break;
|
||||
else
|
||||
@@ -338,7 +336,10 @@ namespace FoxTube
|
||||
nav.ExpandedModeThresholdWidth = short.MaxValue;
|
||||
nav.IsPaneOpen = false;
|
||||
|
||||
VideoPageSizeChanged?.Invoke(this, true);
|
||||
videoPlaceholder.Navigate(typeof(VideoPage), new string[2] { id, playlistId });
|
||||
|
||||
Title.Text = resources.GetString("/Main/video");
|
||||
}
|
||||
|
||||
public void GoToDeveloper(string id)
|
||||
@@ -383,6 +384,8 @@ namespace FoxTube
|
||||
else
|
||||
nav.IsBackEnabled = false;
|
||||
|
||||
VideoPageSizeChanged?.Invoke(this, false);
|
||||
|
||||
SetNavigationMenu();
|
||||
|
||||
try { headers[content.SourcePageType](); }
|
||||
@@ -394,7 +397,7 @@ namespace FoxTube
|
||||
if (content.SourcePageType == typeof(Home) || content.SourcePageType == typeof(Settings) || content.SourcePageType == typeof(Subscriptions))
|
||||
{
|
||||
nav.ExpandedModeThresholdWidth = 1008;
|
||||
nav.IsPaneOpen = nav.DisplayMode == NavigationViewDisplayMode.Expanded ? true : false;
|
||||
nav.IsPaneOpen = nav.DisplayMode == Microsoft.UI.Xaml.Controls.NavigationViewDisplayMode.Expanded ? true : false;
|
||||
}
|
||||
else
|
||||
nav.ExpandedModeThresholdWidth = short.MaxValue;
|
||||
@@ -415,6 +418,8 @@ namespace FoxTube
|
||||
Title.Text = resources.GetString("/Main/video");
|
||||
nav.ExpandedModeThresholdWidth = short.MaxValue;
|
||||
nav.IsPaneOpen = false;
|
||||
|
||||
VideoPageSizeChanged?.Invoke(this, true);
|
||||
}
|
||||
|
||||
public void CloseVideo()
|
||||
@@ -431,7 +436,12 @@ namespace FoxTube
|
||||
else
|
||||
nav.IsBackEnabled = false;
|
||||
|
||||
VideoPageSizeChanged?.Invoke(this, false);
|
||||
|
||||
SetNavigationMenu();
|
||||
|
||||
try { headers[content.SourcePageType](); }
|
||||
catch { }
|
||||
}
|
||||
|
||||
private void Search_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
|
||||
@@ -538,7 +548,7 @@ namespace FoxTube
|
||||
|
||||
private void OpenContext(object sender, TappedRoutedEventArgs e)
|
||||
{
|
||||
((NavigationViewItem)sender).ContextFlyout.ShowAt((NavigationViewItem)sender);
|
||||
((Microsoft.UI.Xaml.Controls.NavigationViewItem)sender).ContextFlyout.ShowAt((Microsoft.UI.Xaml.Controls.NavigationViewItem)sender);
|
||||
}
|
||||
|
||||
private void RemoveAds_Tapped(object sender, TappedRoutedEventArgs e)
|
||||
@@ -551,7 +561,7 @@ namespace FoxTube
|
||||
content.Navigate(typeof(Home1));
|
||||
}
|
||||
|
||||
private void Nav_SelectionChanged(NavigationView sender, NavigationViewSelectionChangedEventArgs args)
|
||||
private void Nav_SelectionChanged(Microsoft.UI.Xaml.Controls.NavigationView sender, Microsoft.UI.Xaml.Controls.NavigationViewSelectionChangedEventArgs args)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -586,7 +596,7 @@ namespace FoxTube
|
||||
catch { }
|
||||
}
|
||||
|
||||
private void Nav_BackRequested(NavigationView sender, NavigationViewBackRequestedEventArgs args)
|
||||
private void Nav_BackRequested(Microsoft.UI.Xaml.Controls.NavigationView sender, Microsoft.UI.Xaml.Controls.NavigationViewBackRequestedEventArgs args)
|
||||
{
|
||||
if (videoPlaceholder.Content != null)
|
||||
{
|
||||
@@ -599,16 +609,16 @@ namespace FoxTube
|
||||
content.GoBack();
|
||||
}
|
||||
|
||||
private void Nav_PaneClosing(NavigationView sender, NavigationViewPaneClosingEventArgs args)
|
||||
private void Nav_PaneClosing(Microsoft.UI.Xaml.Controls.NavigationView sender, Microsoft.UI.Xaml.Controls.NavigationViewPaneClosingEventArgs args)
|
||||
{
|
||||
AppTitle.Visibility = Visibility.Collapsed;
|
||||
}
|
||||
|
||||
private void Nav_PaneOpened(NavigationView sender, object args)
|
||||
private void Nav_PaneOpened(Microsoft.UI.Xaml.Controls.NavigationView sender, object args)
|
||||
{
|
||||
AppTitle.Visibility = Visibility.Visible;
|
||||
|
||||
if (sender.DisplayMode == NavigationViewDisplayMode.Expanded && sender.IsPaneOpen)
|
||||
if (sender.DisplayMode == Microsoft.UI.Xaml.Controls.NavigationViewDisplayMode.Expanded && sender.IsPaneOpen)
|
||||
AppTitleBar.Margin = new Thickness(40, 0, 0, 0);
|
||||
else
|
||||
AppTitleBar.Margin = new Thickness();
|
||||
|
||||
@@ -79,7 +79,7 @@
|
||||
</Grid>
|
||||
<StackPanel Grid.Column="1">
|
||||
<TextBlock FontWeight="Bold" Text="{Binding Path=Title}" MaxLines="1" TextWrapping="Wrap"/>
|
||||
<TextBlock Opacity=".5" Text="{Binding Path=Subtitle}"/>
|
||||
<TextBlock FontSize="14" Opacity=".5" Text="{Binding Path=Subtitle}"/>
|
||||
<TextBlock Opacity=".5" FontSize="13" Text="{Binding Path=TimeStampString}" TextWrapping="WrapWholeWords"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using FoxTube.Controls.Adverts;
|
||||
using System.Collections.Generic;
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
|
||||
@@ -20,6 +21,7 @@ namespace FoxTube.Pages
|
||||
}
|
||||
private int cols = 1;
|
||||
public int Count => Children.Count;
|
||||
public bool IsRelatedVideos { get; set; } = false;
|
||||
public List<UIElement> Children { get; } = new List<UIElement>();
|
||||
|
||||
public VideoGrid()
|
||||
@@ -31,8 +33,14 @@ namespace FoxTube.Pages
|
||||
{
|
||||
(grid.Children[Count % cols + 1] as StackPanel).Children.Add(card);
|
||||
Children.Add(card);
|
||||
/*if (list.Items.Count % 10 == 0)
|
||||
list.Items.Add(new CardAdvert());*/
|
||||
|
||||
if ((Children.Count - 5) % 20 == 0)
|
||||
{
|
||||
CardAdvert advert = new CardAdvert(IsRelatedVideos);
|
||||
(grid.Children[Count % cols + 1] as StackPanel).Children.Add(advert);
|
||||
Children.Add(advert);
|
||||
}
|
||||
|
||||
empty.Visibility = Visibility.Collapsed;
|
||||
}
|
||||
|
||||
|
||||
@@ -128,7 +128,7 @@
|
||||
<Pivot Grid.Row="1" Name="pivot" SelectedIndex="0" IsHeaderItemsCarouselEnabled="False">
|
||||
<PivotItem x:Uid="/VideoPage/related" Header="Suggestions">
|
||||
<ScrollViewer>
|
||||
<pages:VideoGrid x:Name="relatedVideos"/>
|
||||
<pages:VideoGrid x:Name="relatedVideos" IsRelatedVideos="True"/>
|
||||
</ScrollViewer>
|
||||
</PivotItem>
|
||||
<PivotItem x:Uid="/VideoPage/comments" Header="Comments" Name="commentsPlaceholder">
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
<ResourceDictionary
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:ui="using:Microsoft.UI.Xaml.Controls">
|
||||
|
||||
<Color x:Key="SystemAccentColor">Red</Color>
|
||||
<Style TargetType="Button" BasedOn="{StaticResource ButtonRevealStyle}">
|
||||
<Setter Property="FontSize" Value="14"/>
|
||||
</Style>
|
||||
<Style TargetType="ListViewItem" BasedOn="{StaticResource ListViewItemRevealStyle}"/>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="SelectionHighlightColor" Value="Red"/>
|
||||
<Setter Property="FontSize" Value="14"/>
|
||||
</Style>
|
||||
<Style TargetType="TextBox">
|
||||
<Setter Property="SelectionHighlightColor" Value="Red"/>
|
||||
<Setter Property="FontSize" Value="14"/>
|
||||
</Style>
|
||||
<Style TargetType="ComboBox">
|
||||
<Setter Property="Margin" Value="0,5,0,0"/>
|
||||
<Setter Property="FontSize" Value="14"/>
|
||||
</Style>
|
||||
<Style TargetType="ToggleSwitch">
|
||||
<Setter Property="FontSize" Value="14"/>
|
||||
</Style>
|
||||
<Style TargetType="RadioButton">
|
||||
<Setter Property="FontSize" Value="14"/>
|
||||
</Style>
|
||||
<Style TargetType="Run">
|
||||
<Setter Property="FontSize" Value="{StaticResource Size}"/>
|
||||
</Style>
|
||||
<Style TargetType="HyperlinkButton">
|
||||
<Setter Property="FontSize" Value="14"/>
|
||||
</Style>
|
||||
<Style TargetType="AutoSuggestBox">
|
||||
<Setter Property="FontSize" Value="14"/>
|
||||
</Style>
|
||||
<Style TargetType="ui:NavigationViewItem">
|
||||
<Setter Property="FontSize" Value="14"/>
|
||||
</Style>
|
||||
<Style TargetType="ui:NavigationViewItemHeader">
|
||||
<Setter Property="FontSize" Value="14"/>
|
||||
</Style>
|
||||
<Duration x:Key="CardOpacityDuration">0:0:0.5</Duration>
|
||||
|
||||
</ResourceDictionary>
|
||||
Reference in New Issue
Block a user