A ton of improvements
This commit is contained in:
@@ -1,62 +0,0 @@
|
|||||||
<Page
|
|
||||||
x:Class="FoxTube.About"
|
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
||||||
xmlns:local="using:FoxTube"
|
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
||||||
mc:Ignorable="d">
|
|
||||||
|
|
||||||
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
|
||||||
<StackPanel Orientation="Vertical" Margin="10">
|
|
||||||
<TextBlock Text="About us and this app" FontSize="28"/>
|
|
||||||
<Grid>
|
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition Width="*"/>
|
|
||||||
<ColumnDefinition Width="128"/>
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
<StackPanel Grid.Column="0">
|
|
||||||
<TextBlock Text="FoxTube" FontSize="24"/>
|
|
||||||
<TextBlock Name="version" Text="[currentVersion]" FontSize="14" Foreground="Gray" Margin="0,-5,0,10"/>
|
|
||||||
<TextBlock Text="Developed by Michael Gordeev (also known as XFox)" Margin="0,0,0,10"/>
|
|
||||||
<TextBlock Visibility="Collapsed" Text="Special thanks to contributors for motivating me, testers and translators for making this app better everyday and you for using this app;)" Margin="0,0,0,10"/>
|
|
||||||
<TextBlock Text="Contacts" FontSize="22" FontWeight="SemiBold"/>
|
|
||||||
<StackPanel Orientation="Horizontal">
|
|
||||||
<TextBlock Text="Twitter:" Margin="0,0,5,0"/>
|
|
||||||
<HyperlinkButton Foreground="Red" Content="@XFox_Mike" Padding="0" NavigateUri="https://twitter.com/XFox_Mike"/>
|
|
||||||
</StackPanel>
|
|
||||||
<StackPanel Orientation="Horizontal" Visibility="Collapsed">
|
|
||||||
<TextBlock Text="Facebook:" Margin="0,0,5,0"/>
|
|
||||||
<HyperlinkButton Foreground="Red" Content="@XFox.Mike" Padding="0"/>
|
|
||||||
</StackPanel>
|
|
||||||
<StackPanel Orientation="Horizontal">
|
|
||||||
<TextBlock Text="VKontakte:" Margin="0,0,5,0"/>
|
|
||||||
<HyperlinkButton Foreground="Red" Content="@XFox.Mike" Padding="0" NavigateUri="https://vk.com/XFox.Mike"/>
|
|
||||||
</StackPanel>
|
|
||||||
<StackPanel Orientation="Horizontal">
|
|
||||||
<TextBlock Text="YouTube:" Margin="0,0,5,0"/>
|
|
||||||
<HyperlinkButton Foreground="Red" Content="@FoxGameStudioChannel" Padding="0" NavigateUri="https://youtube.com/c/FoxGameStudioChannel"/>
|
|
||||||
</StackPanel>
|
|
||||||
<StackPanel Orientation="Horizontal">
|
|
||||||
<TextBlock Text="E-mail:" Margin="0,0,5,0"/>
|
|
||||||
<HyperlinkButton Foreground="Red" Content="foxgameofficial@gmail.com" Padding="0" NavigateUri="mailto:foxgameofficial+foxtube@gmail.com"/>
|
|
||||||
</StackPanel>
|
|
||||||
<StackPanel Orientation="Horizontal">
|
|
||||||
<TextBlock Text="Official website (Russian language only):" Margin="0,0,5,0"/>
|
|
||||||
<HyperlinkButton Foreground="Red" Content="http://foxgame.hol.es/" Padding="0" NavigateUri="http://foxgame.hol.es/"/>
|
|
||||||
</StackPanel>
|
|
||||||
<TextBlock/>
|
|
||||||
<TextBlock Text="Legal stuff" FontSize="22" FontWeight="SemiBold"/>
|
|
||||||
<HyperlinkButton Foreground="Red" Content="Our Privacy Policy" NavigateUri="http://foxgame.hol.es/foxtubepp.txt" Padding="0,5,0,0"/>
|
|
||||||
<HyperlinkButton Foreground="Red" Content="Privacy Policy" NavigateUri="https://youtube.com/t/privacy" Padding="0"/>
|
|
||||||
<HyperlinkButton Foreground="Red" Content="Terms of use" NavigateUri="https://youtube.com/t/terms" Padding="0"/>
|
|
||||||
<HyperlinkButton Foreground="Red" Content="Community Guidelines" NavigateUri="https://youtube.com/t/community_guidelines" Padding="0,0,0,10"/>
|
|
||||||
<TextBlock Text="© 2018 Michael Gordeev"/>
|
|
||||||
<TextBlock Text="© 2018 YouTube, LLC"/>
|
|
||||||
<Image Source="Assets/FoxGame.png" Width="300" HorizontalAlignment="Left" Visibility="Collapsed"/>
|
|
||||||
</StackPanel>
|
|
||||||
<Image Grid.Column="1" Source="Assets/LogoAvatar.png" VerticalAlignment="Top"/>
|
|
||||||
</Grid>
|
|
||||||
</StackPanel>
|
|
||||||
</Grid>
|
|
||||||
</Page>
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.IO;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Runtime.InteropServices.WindowsRuntime;
|
|
||||||
using Windows.ApplicationModel;
|
|
||||||
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.Navigation;
|
|
||||||
|
|
||||||
// The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238
|
|
||||||
|
|
||||||
namespace FoxTube
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// An empty page that can be used on its own or navigated to within a Frame.
|
|
||||||
/// </summary>
|
|
||||||
public sealed partial class About : Page
|
|
||||||
{
|
|
||||||
PackageVersion ver = Package.Current.Id.Version;
|
|
||||||
public About()
|
|
||||||
{
|
|
||||||
this.InitializeComponent();
|
|
||||||
version.Text = string.Format("{0}.{1}.{2}" , ver.Major, ver.Minor, ver.Build);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+7
-14
@@ -31,17 +31,12 @@
|
|||||||
FontFamily="Segoe MDL2 Assets" Content="" FontSize="20" FocusVisualSecondaryBrush="#66FFFFFF" FocusVisualPrimaryBrush="White" Foreground="White"/>
|
FontFamily="Segoe MDL2 Assets" Content="" FontSize="20" FocusVisualSecondaryBrush="#66FFFFFF" FocusVisualPrimaryBrush="White" Foreground="White"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Grid>
|
</Grid>
|
||||||
<ScrollViewer Grid.Row="1">
|
<ScrollViewer Grid.Row="1" Margin="0,0,0,50">
|
||||||
<Pivot SelectedIndex="0" Name="content">
|
<Pivot SelectedIndex="0" Name="content" IsHeaderItemsCarouselEnabled="False" SelectionChanged="content_SelectionChanged">
|
||||||
<PivotItem Margin="0,-48,0,0">
|
<PivotItem Margin="0,-48,0,0">
|
||||||
|
<StackPanel Name="videos">
|
||||||
|
<Image Name="channelCover" Stretch="Uniform" Source="Assets/ChannelCoverTemplate.png"/>
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.RowDefinitions>
|
|
||||||
<RowDefinition MinHeight="50" MaxHeight="310"/>
|
|
||||||
<RowDefinition Height="75"/>
|
|
||||||
<RowDefinition Height="*"/>
|
|
||||||
</Grid.RowDefinitions>
|
|
||||||
<Image Grid.Row="0" Name="channelCover" Width="1920" Source="Assets/ChannelCoverTemplate.png"/>
|
|
||||||
<Grid Grid.Row="1">
|
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="120"/>
|
<ColumnDefinition Width="120"/>
|
||||||
<ColumnDefinition Width="*"/>
|
<ColumnDefinition Width="*"/>
|
||||||
@@ -58,10 +53,7 @@
|
|||||||
<ToggleButton Grid.Column="3" Height="50" Width="50" FontFamily="Segoe MDL2 Assets" FontSize="18" FontWeight="SemiBold" Content="" Foreground="White" Background="Red"/>
|
<ToggleButton Grid.Column="3" Height="50" Width="50" FontFamily="Segoe MDL2 Assets" FontSize="18" FontWeight="SemiBold" Content="" Foreground="White" Background="Red"/>
|
||||||
<!---->
|
<!---->
|
||||||
</Grid>
|
</Grid>
|
||||||
<StackPanel Grid.Row="2" Name="videos" Orientation="Horizontal">
|
|
||||||
|
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Grid>
|
|
||||||
</PivotItem>
|
</PivotItem>
|
||||||
<PivotItem Margin="0,-48,0,0">
|
<PivotItem Margin="0,-48,0,0">
|
||||||
<Grid Padding="10">
|
<Grid Padding="10">
|
||||||
@@ -141,8 +133,9 @@
|
|||||||
</Pivot>
|
</Pivot>
|
||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
<CommandBar Grid.Row="1" VerticalAlignment="Bottom" Name="commandBar">
|
<CommandBar Grid.Row="1" VerticalAlignment="Bottom" Name="commandBar">
|
||||||
<AppBarToggleButton Icon="Favorite" Label="Add to bookmarks"/>
|
<AppBarButton Icon="Favorite" Label="Add to bookmarks"/>
|
||||||
<AppBarToggleButton Icon="Refresh" Label="Refresh"/>
|
<AppBarButton Icon="Refresh" Label="Refresh"/>
|
||||||
|
<AppBarButton Icon="Share" Label="Share"/>
|
||||||
<AppBarButton Icon="Flag" Label="Report this channel"/>
|
<AppBarButton Icon="Flag" Label="Report this channel"/>
|
||||||
</CommandBar>
|
</CommandBar>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|||||||
+55
-34
@@ -17,6 +17,7 @@ using Google.Apis.Services;
|
|||||||
using Google.Apis.YouTube.v3;
|
using Google.Apis.YouTube.v3;
|
||||||
using Google.Apis.YouTube.v3.Data;
|
using Google.Apis.YouTube.v3.Data;
|
||||||
using Windows.UI.Xaml.Media.Imaging;
|
using Windows.UI.Xaml.Media.Imaging;
|
||||||
|
using Windows.UI.Text;
|
||||||
|
|
||||||
// The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238
|
// The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238
|
||||||
|
|
||||||
@@ -29,6 +30,7 @@ namespace FoxTube
|
|||||||
{
|
{
|
||||||
public string channelId;
|
public string channelId;
|
||||||
public Google.Apis.YouTube.v3.Data.Channel item;
|
public Google.Apis.YouTube.v3.Data.Channel item;
|
||||||
|
VideoGrid videoGrid = new VideoGrid();
|
||||||
public Channel()
|
public Channel()
|
||||||
{
|
{
|
||||||
this.InitializeComponent();
|
this.InitializeComponent();
|
||||||
@@ -43,11 +45,7 @@ namespace FoxTube
|
|||||||
{
|
{
|
||||||
channelId = id;
|
channelId = id;
|
||||||
|
|
||||||
YouTubeService ytService = new YouTubeService(new BaseClientService.Initializer()
|
YouTubeService ytService = SecretsVault.YoutubeService;
|
||||||
{
|
|
||||||
ApiKey = "AIzaSyBgHrCnrlzlVmk0cJKL8RqP9Y8x6XSuk_0",
|
|
||||||
ApplicationName = this.GetType().ToString()
|
|
||||||
});
|
|
||||||
|
|
||||||
ChannelsResource.ListRequest request = ytService.Channels.List("snippet,contentDetails,statistics,brandingSettings");
|
ChannelsResource.ListRequest request = ytService.Channels.List("snippet,contentDetails,statistics,brandingSettings");
|
||||||
request.Id = id;
|
request.Id = id;
|
||||||
@@ -67,6 +65,22 @@ namespace FoxTube
|
|||||||
registration.Text = item.Snippet.PublishedAt.ToString();
|
registration.Text = item.Snippet.PublishedAt.ToString();
|
||||||
|
|
||||||
searchChannel.Text = item.Snippet.Title;
|
searchChannel.Text = item.Snippet.Title;
|
||||||
|
|
||||||
|
SearchResource.ListRequest request2 = ytService.Search.List("snippet");
|
||||||
|
request2.ChannelId = id;
|
||||||
|
request2.Type = "video";
|
||||||
|
request2.Order = SearchResource.ListRequest.OrderEnum.Date;
|
||||||
|
request2.MaxResults = 48;
|
||||||
|
|
||||||
|
SearchListResponse response2 = await request2.ExecuteAsync();
|
||||||
|
|
||||||
|
videos.Children.Add(videoGrid);
|
||||||
|
|
||||||
|
foreach(Google.Apis.YouTube.v3.Data.SearchResult vid in response2.Items)
|
||||||
|
{
|
||||||
|
VideoCard vCard = new VideoCard(vid.Id.VideoId);
|
||||||
|
videoGrid.AddCards(vCard);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void toVideos_Click(object sender, RoutedEventArgs e)
|
private void toVideos_Click(object sender, RoutedEventArgs e)
|
||||||
@@ -74,43 +88,16 @@ namespace FoxTube
|
|||||||
content.SelectedIndex = 0;
|
content.SelectedIndex = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
private async void toPlaylists_Click(object sender, RoutedEventArgs e)
|
private void toPlaylists_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
content.SelectedIndex = 1;
|
content.SelectedIndex = 1;
|
||||||
|
|
||||||
if(playlists.Children.Count == 0)
|
|
||||||
{
|
|
||||||
YouTubeService ytService = new YouTubeService(new BaseClientService.Initializer()
|
|
||||||
{
|
|
||||||
ApiKey = "AIzaSyBgHrCnrlzlVmk0cJKL8RqP9Y8x6XSuk_0",
|
|
||||||
ApplicationName = this.GetType().ToString()
|
|
||||||
});
|
|
||||||
|
|
||||||
PlaylistsResource.ListRequest request = ytService.Playlists.List("snippet,contentDetails");
|
|
||||||
request.MaxResults = 25;
|
|
||||||
request.ChannelId = channelId;
|
|
||||||
PlaylistListResponse response = await request.ExecuteAsync();
|
|
||||||
|
|
||||||
foreach (Playlist playlist in response.Items)
|
|
||||||
{
|
|
||||||
PlaylistCardWide playlistCard = new PlaylistCardWide(playlist.Id, true);
|
|
||||||
playlists.Children.Add(playlistCard);
|
|
||||||
}
|
|
||||||
|
|
||||||
playlistRing.IsActive = false;
|
|
||||||
playlistPane.Visibility = Visibility.Visible;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private async void searchButton_Click(object sender, RoutedEventArgs e)
|
private async void searchButton_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
content.SelectedIndex = 3;
|
content.SelectedIndex = 3;
|
||||||
|
|
||||||
YouTubeService ytService = new YouTubeService(new BaseClientService.Initializer()
|
YouTubeService ytService = SecretsVault.YoutubeService;
|
||||||
{
|
|
||||||
ApiKey = "AIzaSyBgHrCnrlzlVmk0cJKL8RqP9Y8x6XSuk_0",
|
|
||||||
ApplicationName = this.GetType().ToString()
|
|
||||||
});
|
|
||||||
|
|
||||||
var searchListRequest = ytService.Search.List("snippet");
|
var searchListRequest = ytService.Search.List("snippet");
|
||||||
searchListRequest.Q = searchField.Text;
|
searchListRequest.Q = searchField.Text;
|
||||||
@@ -147,5 +134,39 @@ namespace FoxTube
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private async void content_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||||
|
{
|
||||||
|
toVideos.FontWeight = FontWeights.Normal;
|
||||||
|
toPlaylists.FontWeight = FontWeights.Normal;
|
||||||
|
toAbout.FontWeight = FontWeights.Normal;
|
||||||
|
if (content.SelectedIndex == 0)
|
||||||
|
toVideos.FontWeight = FontWeights.Bold;
|
||||||
|
else if (content.SelectedIndex == 1)
|
||||||
|
{
|
||||||
|
toPlaylists.FontWeight = FontWeights.Bold;
|
||||||
|
|
||||||
|
if (playlists.Children.Count == 0)
|
||||||
|
{
|
||||||
|
YouTubeService ytService = SecretsVault.YoutubeService;
|
||||||
|
|
||||||
|
PlaylistsResource.ListRequest request = ytService.Playlists.List("snippet,contentDetails");
|
||||||
|
request.MaxResults = 25;
|
||||||
|
request.ChannelId = channelId;
|
||||||
|
PlaylistListResponse response = await request.ExecuteAsync();
|
||||||
|
|
||||||
|
foreach (Playlist playlist in response.Items)
|
||||||
|
{
|
||||||
|
PlaylistCardWide playlistCard = new PlaylistCardWide(playlist.Id, true);
|
||||||
|
playlists.Children.Add(playlistCard);
|
||||||
|
}
|
||||||
|
|
||||||
|
playlistRing.IsActive = false;
|
||||||
|
playlistPane.Visibility = Visibility.Visible;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (content.SelectedIndex == 2)
|
||||||
|
toAbout.FontWeight = FontWeights.Bold;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+11
-2
@@ -28,11 +28,20 @@
|
|||||||
<TextBlock Name="subjectMissed" Grid.Column="1" FontFamily="Segoe MDL2 Assets" Text="" Foreground="Red" FontSize="30" Visibility="Collapsed" VerticalAlignment="Bottom" Margin="1"/>
|
<TextBlock Name="subjectMissed" Grid.Column="1" FontFamily="Segoe MDL2 Assets" Text="" Foreground="Red" FontSize="30" Visibility="Collapsed" VerticalAlignment="Bottom" Margin="1"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
<TextBox Name="details" HorizontalAlignment="Stretch" Height="200" AcceptsReturn="True" ScrollViewer.VerticalScrollBarVisibility="Auto" MaxLength="1000" Margin="0,5,30,0" Header="Give us more detail (optional) (max 1000 characters)"/>
|
<TextBox Name="details" HorizontalAlignment="Stretch" Height="200" AcceptsReturn="True" ScrollViewer.VerticalScrollBarVisibility="Auto" MaxLength="1000" Margin="0,5,30,0" Header="Give us more detail (optional) (max 1000 characters)"/>
|
||||||
|
<CheckBox Content="I'd like to get response from developers" Name="emailToggle" Click="emailToggle_Click"/>
|
||||||
|
<TextBox Header="E-mail adress for response:" PlaceholderText="someone@example.com" IsEnabled="False" Name="email" Margin="0,5,30,0"/>
|
||||||
|
<StackPanel Orientation="Horizontal" BorderBrush="Green" BorderThickness="5" Margin="0,10,30,0" Name="debugAttached" Visibility="Collapsed">
|
||||||
|
<TextBlock FontFamily="Segoe MDL2 Assets" Text="" FontSize="40" Foreground="Green" Margin="5"/>
|
||||||
|
<StackPanel>
|
||||||
|
<TextBlock Text="Logs attached!" Foreground="Green" FontWeight="Bold" FontSize="20"/>
|
||||||
|
<TextBlock Text="You don't have to attach error code or exception details to you feedback. We did it ourselves." Foreground="Green"/>
|
||||||
|
</StackPanel>
|
||||||
|
</StackPanel>
|
||||||
<StackPanel Orientation="Horizontal" BorderBrush="Green" BorderThickness="5" Margin="0,10,30,0" Visibility="Collapsed" Name="greenResult">
|
<StackPanel Orientation="Horizontal" BorderBrush="Green" BorderThickness="5" Margin="0,10,30,0" Visibility="Collapsed" Name="greenResult">
|
||||||
<TextBlock FontFamily="Segoe MDL2 Assets" Text="" FontSize="40" Foreground="Green" Margin="5"/>
|
<TextBlock FontFamily="Segoe MDL2 Assets" Text="" FontSize="40" Foreground="Green" Margin="5"/>
|
||||||
<StackPanel>
|
<StackPanel>
|
||||||
<TextBlock Text="Your feedback has been sent!" Foreground="Green" FontWeight="Bold" FontSize="20"/>
|
<TextBlock Text="Your feedback has been sent!" Foreground="Green" FontWeight="Bold" FontSize="20"/>
|
||||||
<TextBlock Text="Thank you! It's very imortant for us. Thank your for helping us making the app better" Foreground="Green"/>
|
<TextBlock Text="Thank you! It's very imortant for us. Thank you for helping us making the app better" Foreground="Green"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<StackPanel Orientation="Horizontal" BorderBrush="OrangeRed" BorderThickness="5" Margin="0,10,30,0" Visibility="Collapsed" Name="cooldown">
|
<StackPanel Orientation="Horizontal" BorderBrush="OrangeRed" BorderThickness="5" Margin="0,10,30,0" Visibility="Collapsed" Name="cooldown">
|
||||||
@@ -43,7 +52,7 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
<Button Content="Submit feedback" Name="submit" Margin="0,10,10,10" Click="submit_Click"/>
|
<Button Content="Submit feedback" Name="submit" Margin="0,10,10,10" Click="submit_Click" Background="Red" Foreground="White"/>
|
||||||
<ProgressRing VerticalAlignment="Center" Name="ring" Foreground="Red"/>
|
<ProgressRing VerticalAlignment="Center" Name="ring" Foreground="Red"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ namespace FoxTube
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public sealed partial class Feedback : Page
|
public sealed partial class Feedback : Page
|
||||||
{
|
{
|
||||||
|
string debugData = "";
|
||||||
ApplicationDataContainer settings = ApplicationData.Current.LocalSettings;
|
ApplicationDataContainer settings = ApplicationData.Current.LocalSettings;
|
||||||
public Feedback()
|
public Feedback()
|
||||||
{
|
{
|
||||||
@@ -83,7 +84,7 @@ namespace FoxTube
|
|||||||
msg.To.Add("foxgameofficial+foxtube@gmail.com");
|
msg.To.Add("foxgameofficial+foxtube@gmail.com");
|
||||||
msg.From = new MailAddress("foxgameofficial+foxtube@gmail.com");
|
msg.From = new MailAddress("foxgameofficial+foxtube@gmail.com");
|
||||||
msg.Subject = "FoxTube feedback";
|
msg.Subject = "FoxTube feedback";
|
||||||
msg.Body = string.Format("Type: {0}\nTime: {1}\n\nTitle:\n{2}\n\nDetails:\n{3}", Type(), DateTime.Now, subject.Text, details.Text);
|
msg.Body = string.Format("Type: {0}\nTime: {1}\n\nTitle:\n{2}\n\nDetails:\n{3}\n\nResponse e-mail: {4}\n\nException details:\n{5}", Type(), DateTime.Now, subject.Text, details.Text, email.Text, debugData);
|
||||||
|
|
||||||
subject.IsEnabled = false;
|
subject.IsEnabled = false;
|
||||||
details.IsEnabled = false;
|
details.IsEnabled = false;
|
||||||
@@ -127,6 +128,27 @@ namespace FoxTube
|
|||||||
subject.Background = new SolidColorBrush();
|
subject.Background = new SolidColorBrush();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void emailToggle_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
email.IsEnabled = (bool)emailToggle.IsChecked;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void PreDefine(bool isProblem, string meta)
|
||||||
|
{
|
||||||
|
if (isProblem)
|
||||||
|
{
|
||||||
|
promblemRadio.IsChecked = true;
|
||||||
|
suggestionRadio.IsChecked = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
promblemRadio.IsChecked = false;
|
||||||
|
suggestionRadio.IsChecked = true;
|
||||||
|
}
|
||||||
|
debugData = meta;
|
||||||
|
debugAttached.Visibility = Visibility.Visible;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
private void feedbackSubmit_Click(object sender, EventArgs e)
|
private void feedbackSubmit_Click(object sender, EventArgs e)
|
||||||
|
|||||||
+13
-8
@@ -11,13 +11,14 @@
|
|||||||
<AssemblyName>FoxTube</AssemblyName>
|
<AssemblyName>FoxTube</AssemblyName>
|
||||||
<DefaultLanguage>en-US</DefaultLanguage>
|
<DefaultLanguage>en-US</DefaultLanguage>
|
||||||
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
|
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
|
||||||
<TargetPlatformVersion Condition=" '$(TargetPlatformVersion)' == '' ">10.0.16299.0</TargetPlatformVersion>
|
<TargetPlatformVersion Condition=" '$(TargetPlatformVersion)' == '' ">10.0.17134.0</TargetPlatformVersion>
|
||||||
<TargetPlatformMinVersion>10.0.16299.0</TargetPlatformMinVersion>
|
<TargetPlatformMinVersion>10.0.16299.0</TargetPlatformMinVersion>
|
||||||
<MinimumVisualStudioVersion>14</MinimumVisualStudioVersion>
|
<MinimumVisualStudioVersion>14</MinimumVisualStudioVersion>
|
||||||
<FileAlignment>512</FileAlignment>
|
<FileAlignment>512</FileAlignment>
|
||||||
<ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
<ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||||
<WindowsXamlEnableOverview>true</WindowsXamlEnableOverview>
|
<WindowsXamlEnableOverview>true</WindowsXamlEnableOverview>
|
||||||
<PackageCertificateKeyFile>FoxTube_TemporaryKey.pfx</PackageCertificateKeyFile>
|
<PackageCertificateKeyFile>FoxTube_TemporaryKey.pfx</PackageCertificateKeyFile>
|
||||||
|
<PackageCertificateThumbprint>965BA230AF9DB31698CAE7A94DE7CA256841AEE0</PackageCertificateThumbprint>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
|
||||||
<DebugSymbols>true</DebugSymbols>
|
<DebugSymbols>true</DebugSymbols>
|
||||||
@@ -92,9 +93,6 @@
|
|||||||
<RestoreProjectStyle>PackageReference</RestoreProjectStyle>
|
<RestoreProjectStyle>PackageReference</RestoreProjectStyle>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="About.xaml.cs">
|
|
||||||
<DependentUpon>About.xaml</DependentUpon>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="App.xaml.cs">
|
<Compile Include="App.xaml.cs">
|
||||||
<DependentUpon>App.xaml</DependentUpon>
|
<DependentUpon>App.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
@@ -113,6 +111,9 @@
|
|||||||
<Compile Include="Home.xaml.cs">
|
<Compile Include="Home.xaml.cs">
|
||||||
<DependentUpon>Home.xaml</DependentUpon>
|
<DependentUpon>Home.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="LoadingPage.xaml.cs">
|
||||||
|
<DependentUpon>LoadingPage.xaml</DependentUpon>
|
||||||
|
</Compile>
|
||||||
<Compile Include="MainPage.xaml.cs">
|
<Compile Include="MainPage.xaml.cs">
|
||||||
<DependentUpon>MainPage.xaml</DependentUpon>
|
<DependentUpon>MainPage.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
@@ -124,6 +125,7 @@
|
|||||||
<Compile Include="Search.xaml.cs">
|
<Compile Include="Search.xaml.cs">
|
||||||
<DependentUpon>Search.xaml</DependentUpon>
|
<DependentUpon>Search.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="SecretsVault.cs" />
|
||||||
<Compile Include="Settings.xaml.cs">
|
<Compile Include="Settings.xaml.cs">
|
||||||
<DependentUpon>Settings.xaml</DependentUpon>
|
<DependentUpon>Settings.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
@@ -213,10 +215,6 @@
|
|||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</ApplicationDefinition>
|
</ApplicationDefinition>
|
||||||
<Page Include="About.xaml">
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
<Generator>MSBuild:Compile</Generator>
|
|
||||||
</Page>
|
|
||||||
<Page Include="Channel.xaml">
|
<Page Include="Channel.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
@@ -237,6 +235,10 @@
|
|||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
|
<Page Include="LoadingPage.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
<Page Include="MainPage.xaml">
|
<Page Include="MainPage.xaml">
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
@@ -300,6 +302,9 @@
|
|||||||
<PackageReference Include="Microsoft.Toolkit.Uwp.Notifications">
|
<PackageReference Include="Microsoft.Toolkit.Uwp.Notifications">
|
||||||
<Version>2.2.0</Version>
|
<Version>2.2.0</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
|
<PackageReference Include="runtime.win10-arm64.runtime.native.System.IO.Compression">
|
||||||
|
<Version>4.3.1</Version>
|
||||||
|
</PackageReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup />
|
<ItemGroup />
|
||||||
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' < '14.0' ">
|
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' < '14.0' ">
|
||||||
|
|||||||
+13
-2
@@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="47"/>
|
<RowDefinition Height="0"/>
|
||||||
<RowDefinition Height="*"/>
|
<RowDefinition Height="*"/>
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<Grid Grid.Row="0" Background="Red">
|
<Grid Grid.Row="0" Background="Red">
|
||||||
@@ -19,6 +19,17 @@
|
|||||||
<HyperlinkButton Content="Subscriptions" Foreground="White" Margin="10,8,10,10"/>
|
<HyperlinkButton Content="Subscriptions" Foreground="White" Margin="10,8,10,10"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Frame Grid.Row="1" Name="content"/>
|
<Frame Grid.Row="1" Name="content" Visibility="Collapsed"/>
|
||||||
|
<Pivot Grid.Row="1" Padding="0">
|
||||||
|
<PivotItem Header="Recommended">
|
||||||
|
<local:VideoGrid/>
|
||||||
|
</PivotItem>
|
||||||
|
<PivotItem Header="Trending">
|
||||||
|
<local:Channel/>
|
||||||
|
</PivotItem>
|
||||||
|
<PivotItem Header="Subscriptions">
|
||||||
|
|
||||||
|
</PivotItem>
|
||||||
|
</Pivot>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Page>
|
</Page>
|
||||||
|
|||||||
@@ -0,0 +1,38 @@
|
|||||||
|
<Page
|
||||||
|
x:Class="FoxTube.LoadingPage"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:local="using:FoxTube"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
||||||
|
|
||||||
|
<Grid HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||||
|
<ProgressRing Name="ring" IsActive="True" Foreground="Red" Width="100" Height="100"/>
|
||||||
|
<StackPanel Name="wifiTrouble" Visibility="Collapsed">
|
||||||
|
<FontIcon FontFamily="Segoe MDL2 Assets" Glyph="" FontSize="100" HorizontalAlignment="Center"/>
|
||||||
|
<TextBlock Text="Check your internet connection" FontSize="48" HorizontalAlignment="Center"/>
|
||||||
|
<TextBlock Text="Please, make sure you are connected to the internet and try again." HorizontalAlignment="Center"/>
|
||||||
|
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
|
||||||
|
<Button Content="Open Wi-Fi settings" Margin="5" Name="openWifi" Click="openWifi_Click"/>
|
||||||
|
<Button Content="Open troubleshooter" Background="Red" Foreground="White" Margin="5" Name="openTroubleshoot" Click="openTroubleshoot_Click"/>
|
||||||
|
</StackPanel>
|
||||||
|
<TextBlock Text="OR" FontSize="20" HorizontalAlignment="Center"/>
|
||||||
|
<Button Content="Refresh page" HorizontalAlignment="Center" Background="Red" Foreground="White" Margin="5"/>
|
||||||
|
<TextBlock Name="wifiException" Foreground="Gray" Text="Exception:" HorizontalAlignment="Center"/>
|
||||||
|
<TextBlock Name="wifiMessage" Foreground="Gray" Text="Message:" HorizontalAlignment="Center"/>
|
||||||
|
</StackPanel>
|
||||||
|
<StackPanel Name="trouble" Visibility="Collapsed">
|
||||||
|
<FontIcon FontFamily="Segoe MDL2 Assets" Glyph="" FontSize="100" HorizontalAlignment="Center"/>
|
||||||
|
<TextBlock Text="We are unable to display the page" FontSize="48" HorizontalAlignment="Center"/>
|
||||||
|
<TextBlock Text="It could be caused by YouTube internal server error or by application's bug. Please, try again later" HorizontalAlignment="Center"/>
|
||||||
|
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
|
||||||
|
<Button Content="Refresh page" Margin="5"/>
|
||||||
|
<Button Content="Leave feedback" Background="Red" Foreground="White" Margin="5" Name="feedback" Click="feedback_Click"/>
|
||||||
|
</StackPanel>
|
||||||
|
<TextBlock Name="exception" Foreground="Gray" Text="Exception:" HorizontalAlignment="Center"/>
|
||||||
|
<TextBlock Name="message" Foreground="Gray" Text="Message:" HorizontalAlignment="Center"/>
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
</Page>
|
||||||
@@ -0,0 +1,69 @@
|
|||||||
|
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.Navigation;
|
||||||
|
|
||||||
|
// The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238
|
||||||
|
|
||||||
|
namespace FoxTube
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// An empty page that can be used on its own or navigated to within a Frame.
|
||||||
|
/// </summary>
|
||||||
|
public sealed partial class LoadingPage : Page
|
||||||
|
{
|
||||||
|
public LoadingPage()
|
||||||
|
{
|
||||||
|
this.InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Error(string exceptionId, string details, bool isWifiTrouble = false)
|
||||||
|
{
|
||||||
|
ring.IsActive = false;
|
||||||
|
trouble.Visibility = Visibility.Collapsed;
|
||||||
|
wifiTrouble.Visibility = Visibility.Collapsed;
|
||||||
|
|
||||||
|
if(isWifiTrouble)
|
||||||
|
{
|
||||||
|
wifiException.Text = exceptionId;
|
||||||
|
wifiMessage.Text = details;
|
||||||
|
|
||||||
|
wifiTrouble.Visibility = Visibility.Visible;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
exception.Text = exceptionId;
|
||||||
|
message.Text = details;
|
||||||
|
|
||||||
|
trouble.Visibility = Visibility.Visible;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private async void openWifi_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
await Windows.System.Launcher.LaunchUriAsync(new Uri("ms-settings:network"));
|
||||||
|
}
|
||||||
|
|
||||||
|
private async void openTroubleshoot_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
await Windows.System.Launcher.LaunchUriAsync(new Uri("ms-settings:troubleshoot"));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void feedback_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
Frame root = Window.Current.Content as Frame;
|
||||||
|
MainPage main = root.Content as MainPage;
|
||||||
|
main.PreDefineFeedback(true, string.Format("Exception:\n{0}\n\nMessage:\n{1}", exception, message));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+11
-7
@@ -23,6 +23,7 @@
|
|||||||
<ColumnDefinition Width="50"/>
|
<ColumnDefinition Width="50"/>
|
||||||
<ColumnDefinition Width="50"/>
|
<ColumnDefinition Width="50"/>
|
||||||
<ColumnDefinition Width="50"/>
|
<ColumnDefinition Width="50"/>
|
||||||
|
<ColumnDefinition Width="50"/>
|
||||||
<ColumnDefinition Width="350"/>
|
<ColumnDefinition Width="350"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<Button Name="menuButton"
|
<Button Name="menuButton"
|
||||||
@@ -42,7 +43,10 @@
|
|||||||
<Button Name="notificationMenu" Grid.Column="5" ToolTipService.ToolTip="Notifications" Click="notification_Click"
|
<Button Name="notificationMenu" Grid.Column="5" ToolTipService.ToolTip="Notifications" Click="notification_Click"
|
||||||
FontFamily="Segoe MDL2 Assets" Content="" Foreground="White"
|
FontFamily="Segoe MDL2 Assets" Content="" Foreground="White"
|
||||||
Width="50" Height="50" Background="#00000000" RelativePanel.LeftOf="searchField"/>
|
Width="50" Height="50" Background="#00000000" RelativePanel.LeftOf="searchField"/>
|
||||||
<Popup Grid.Column="5" Margin="0,50,0,0" Name="notificationPane" IsOpen="False" IsLightDismissEnabled="True">
|
<Button Name="openBrowser" Grid.Column="6" ToolTipService.ToolTip="Open page in browser" Click="notification_Click"
|
||||||
|
FontFamily="Segoe MDL2 Assets" Content="" Foreground="White"
|
||||||
|
Width="50" Height="50" Background="#00000000" RelativePanel.LeftOf="searchField"/>
|
||||||
|
<Popup Grid.Column="6" Margin="0,50,0,0" Name="notificationPane" IsOpen="False" IsLightDismissEnabled="True">
|
||||||
<StackPanel Width="350" Background="WhiteSmoke" Padding="0,10,0,0">
|
<StackPanel Width="350" Background="WhiteSmoke" Padding="0,10,0,0">
|
||||||
<TextBlock Text="Notifications" HorizontalAlignment="Center" FontWeight="Bold"/>
|
<TextBlock Text="Notifications" HorizontalAlignment="Center" FontWeight="Bold"/>
|
||||||
<StackPanel Margin="0,10,0,0">
|
<StackPanel Margin="0,10,0,0">
|
||||||
@@ -56,10 +60,10 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Popup>
|
</Popup>
|
||||||
<Button Name="feddback" Grid.Column="6" ToolTipService.ToolTip="Send feedback" Click="feddback_Click"
|
<Button Name="feddback" Grid.Column="7" ToolTipService.ToolTip="Send feedback" Click="feddback_Click"
|
||||||
FontFamily="Segoe MDL2 Assets" Content="" Foreground="White"
|
FontFamily="Segoe MDL2 Assets" Content="" Foreground="White"
|
||||||
Width="50" Height="50" Background="#00000000" RelativePanel.LeftOf="searchField"/>
|
Width="50" Height="50" Background="#00000000" RelativePanel.LeftOf="searchField"/>
|
||||||
<Button Name="account" Grid.Column="7" ToolTipService.ToolTip="Sign in"
|
<Button Name="account" Grid.Column="8" ToolTipService.ToolTip="Sign in"
|
||||||
FontFamily="Segoe MDL2 Assets" Content="" Foreground="White"
|
FontFamily="Segoe MDL2 Assets" Content="" Foreground="White"
|
||||||
Width="50" Height="50" Background="#00000000" RelativePanel.LeftOf="searchField">
|
Width="50" Height="50" Background="#00000000" RelativePanel.LeftOf="searchField">
|
||||||
<Button.Flyout>
|
<Button.Flyout>
|
||||||
@@ -69,10 +73,10 @@
|
|||||||
</MenuFlyout>
|
</MenuFlyout>
|
||||||
</Button.Flyout>
|
</Button.Flyout>
|
||||||
</Button>
|
</Button>
|
||||||
<Button Grid.Column="7" Padding="0" Width="50" Height="50" Visibility="Collapsed" Name="LoggedAvatar" Click="LoggedAvatar_Click">
|
<Button Grid.Column="8" Padding="0" Width="50" Height="50" Visibility="Collapsed" Name="LoggedAvatar" Click="LoggedAvatar_Click">
|
||||||
<PersonPicture Width="30"/>
|
<PersonPicture Width="30"/>
|
||||||
</Button>
|
</Button>
|
||||||
<Popup Grid.Column="7" Margin="0,50,0,0" IsOpen="False" IsLightDismissEnabled="True" Name="AccountManagement">
|
<Popup Grid.Column="8" Margin="0,50,0,0" IsOpen="False" IsLightDismissEnabled="True" Name="AccountManagement">
|
||||||
<StackPanel Width="300" Background="WhiteSmoke">
|
<StackPanel Width="300" Background="WhiteSmoke">
|
||||||
<ListBox>
|
<ListBox>
|
||||||
<ListBoxItem Height="75">
|
<ListBoxItem Height="75">
|
||||||
@@ -102,8 +106,8 @@
|
|||||||
</ListBox>
|
</ListBox>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Popup>
|
</Popup>
|
||||||
<TextBox KeyUp="searchField_KeyUp" Name="searchField" Grid.Column="8" ToolTipService.ToolTip="Search" Margin="4" Width="350" Height="50" Padding="14,10,5,0" PlaceholderText="Search" BorderThickness="0" Background="#7FFFFFFF" Text="" TextChanged="searchField_TextChanged" LostFocus="searchField_LostFocus"/>
|
<TextBox KeyUp="searchField_KeyUp" Name="searchField" Grid.Column="9" ToolTipService.ToolTip="Search" Margin="4" Width="350" Height="50" Padding="14,10,5,0" PlaceholderText="Search" BorderThickness="0" Background="#7FFFFFFF" Text="" TextChanged="searchField_TextChanged" LostFocus="searchField_LostFocus"/>
|
||||||
<Button Name="searchButton" Grid.Column="8" HorizontalAlignment="Right" Click="searchButton_Click"
|
<Button Name="searchButton" Grid.Column="9" HorizontalAlignment="Right" Click="searchButton_Click"
|
||||||
Width="42" Height="42" Margin="4"
|
Width="42" Height="42" Margin="4"
|
||||||
RelativePanel.AlignRightWithPanel="True"
|
RelativePanel.AlignRightWithPanel="True"
|
||||||
Background="Transparent"
|
Background="Transparent"
|
||||||
|
|||||||
+11
-19
@@ -301,7 +301,15 @@ namespace FoxTube
|
|||||||
{
|
{
|
||||||
bottomHaburger.SelectedIndex = 4;
|
bottomHaburger.SelectedIndex = 4;
|
||||||
Settings s = content.Content as Settings;
|
Settings s = content.Content as Settings;
|
||||||
s.content.Navigate(typeof(Feedback));
|
s.pivot.SelectedIndex = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void PreDefineFeedback(bool isProblem, string meta)
|
||||||
|
{
|
||||||
|
bottomHaburger.SelectedIndex = 4;
|
||||||
|
Settings s = content.Content as Settings;
|
||||||
|
s.pivot.SelectedIndex = 3;
|
||||||
|
s.fb.PreDefine(isProblem, meta);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void menu_PaneClosed(SplitView sender, object args)
|
private void menu_PaneClosed(SplitView sender, object args)
|
||||||
@@ -345,28 +353,12 @@ namespace FoxTube
|
|||||||
|
|
||||||
private async Task LogIn()
|
private async Task LogIn()
|
||||||
{
|
{
|
||||||
StorageFile file = await StorageFile.GetFileFromApplicationUriAsync(new Uri(@"ms-appx:///client_secrets.json"));
|
|
||||||
|
|
||||||
Debug.WriteLine("Exception accured after opening a stream");
|
|
||||||
|
|
||||||
credential = await GoogleWebAuthorizationBroker.AuthorizeAsync(
|
credential = await GoogleWebAuthorizationBroker.AuthorizeAsync(
|
||||||
GoogleClientSecrets.Load(await file.OpenStreamForReadAsync()).Secrets,
|
SecretsVault.Secrets,
|
||||||
new[] { YouTubeService.Scope.Youtube },
|
new[] { YouTubeService.Scope.Youtube },
|
||||||
"user",
|
"user",
|
||||||
CancellationToken.None,
|
CancellationToken.None
|
||||||
new FileDataStore(this.GetType().ToString())
|
|
||||||
);
|
);
|
||||||
Debug.WriteLine("200 OK");
|
|
||||||
using (var stream = new FileStream("client_secrets.json", FileMode.Open, FileAccess.Read))
|
|
||||||
{
|
|
||||||
credential = await GoogleWebAuthorizationBroker.AuthorizeAsync(
|
|
||||||
GoogleClientSecrets.Load(stream).Secrets,
|
|
||||||
new[] { YouTubeService.Scope.Youtube },
|
|
||||||
"user",
|
|
||||||
CancellationToken.None,
|
|
||||||
new FileDataStore(this.GetType().ToString())
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void searchField_TextChanged(object sender, TextChangedEventArgs e)
|
private void searchField_TextChanged(object sender, TextChangedEventArgs e)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" IgnorableNamespaces="uap mp">
|
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" IgnorableNamespaces="uap mp">
|
||||||
<Identity Name="5d1cba1f-d7d5-472b-acb7-beb360bab268" Publisher="CN=Michael Gordeev" Version="1.0.0.0" />
|
<Identity Name="5d1cba1f-d7d5-472b-acb7-beb360bab268" Publisher="CN=XFox" Version="1.0.0.0" />
|
||||||
<mp:PhoneIdentity PhoneProductId="5d1cba1f-d7d5-472b-acb7-beb360bab268" PhonePublisherId="00000000-0000-0000-0000-000000000000" />
|
<mp:PhoneIdentity PhoneProductId="5d1cba1f-d7d5-472b-acb7-beb360bab268" PhonePublisherId="00000000-0000-0000-0000-000000000000" />
|
||||||
<Properties>
|
<Properties>
|
||||||
<DisplayName>FoxTube</DisplayName>
|
<DisplayName>FoxTube</DisplayName>
|
||||||
|
|||||||
@@ -0,0 +1,60 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Google.Apis.Auth.OAuth2;
|
||||||
|
using Google.Apis.Services;
|
||||||
|
using Google.Apis.YouTube.v3;
|
||||||
|
|
||||||
|
namespace FoxTube
|
||||||
|
{
|
||||||
|
class SecretsVault
|
||||||
|
{
|
||||||
|
public static string Email
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return "youwillneverknowthisadress@gmail.com";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public static string Password
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return "thisisthepassword12345";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public static string YoutubeApi
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return "AIzaSyBgHrCnrlzlVmk0cJKL8RqP9Y8x6XSuk_0";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static YouTubeService YoutubeService
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return new YouTubeService(new BaseClientService.Initializer()
|
||||||
|
{
|
||||||
|
ApiKey = SecretsVault.YoutubeApi,
|
||||||
|
ApplicationName = "FoxTube"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ClientSecrets Secrets
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return new ClientSecrets()
|
||||||
|
{
|
||||||
|
ClientId = "349735264870-2ekqlm0a4mkg3mmrfcv90s3qp3o15dq0.apps.googleusercontent.com",
|
||||||
|
ClientSecret = "BkVZOAaCU2Zclf0Zlicg6y2_"
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+122
-27
@@ -9,43 +9,138 @@
|
|||||||
|
|
||||||
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="auto"/>
|
<RowDefinition Height="47"/>
|
||||||
<RowDefinition Height="0*"/>
|
<RowDefinition Height="*"/>
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<Pivot>
|
<ScrollViewer Grid.Row="1">
|
||||||
<PivotItem Header="General">
|
<Pivot SelectedIndex="0" Name="content" Grid.Row="1" IsHeaderItemsCarouselEnabled="False" SelectionChanged="content_SelectionChanged">
|
||||||
<local:General/>
|
<PivotItem Margin="0,-48,0,0">
|
||||||
|
<StackPanel Orientation="Vertical" Margin="10">
|
||||||
|
<TextBlock Text="Preferences" FontSize="28"/>
|
||||||
|
<ComboBox Header="Language" MinWidth="250" Name="language" SelectionChanged="language_SelectionChanged">
|
||||||
|
<ComboBoxItem Content="English"/>
|
||||||
|
<ComboBoxItem Content="Russian"/>
|
||||||
|
</ComboBox>
|
||||||
|
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left" BorderBrush="OrangeRed" BorderThickness="3" Margin="0,10,0,0" Padding="2" Visibility="Collapsed" Name="restartNote">
|
||||||
|
<TextBlock FontFamily="Segoe MDL2 Assets" FontWeight="Bold" Text="" FontSize="30" Foreground="OrangeRed"/>
|
||||||
|
<TextBlock FontFamily="Default" FontWeight="Bold" Text="Reopen the app to apply settings" Foreground="OrangeRed" VerticalAlignment="Center"/>
|
||||||
|
</StackPanel>
|
||||||
|
<TextBlock Text="Playback" FontSize="22"/>
|
||||||
|
<ComboBox Margin="0,0,0,10" Width="250" Header="Default video playback quality" Name="quality" SelectionChanged="quality_SelectionChanged">
|
||||||
|
<ComboBoxItem Content="Auto"/>
|
||||||
|
<ComboBoxItem Content="1080p60"/>
|
||||||
|
<ComboBoxItem Content="1080p30"/>
|
||||||
|
<ComboBoxItem Content="720p60"/>
|
||||||
|
<ComboBoxItem Content="720p30"/>
|
||||||
|
<ComboBoxItem Content="480p"/>
|
||||||
|
<ComboBoxItem Content="360p"/>
|
||||||
|
<ComboBoxItem Content="240p"/>
|
||||||
|
<ComboBoxItem Content="144p"/>
|
||||||
|
</ComboBox>
|
||||||
|
<ToggleSwitch OnContent="Notify when playing on metered connection" OffContent="Notify when playing on metered connection" Name="mobileWarning" Toggled="notification_IsEnabledChanged"/>
|
||||||
|
<ToggleSwitch OnContent="Play videos automatically" OffContent="Play videos automatically" Name="autoplay" Margin="0,0,0,10" Toggled="notification_IsEnabledChanged"/>
|
||||||
|
|
||||||
|
<TextBlock Text="Notifications" FontSize="22"/>
|
||||||
|
<CheckBox Content="New video" Name="newVideo" Click="notification_IsEnabledChanged"/>
|
||||||
|
<CheckBox Content="New post" Name="newPost" Click="notification_IsEnabledChanged"/>
|
||||||
|
<CheckBox Content="New commentary" Name="newComment" Click="notification_IsEnabledChanged"/>
|
||||||
|
<CheckBox Content="What's new posts" Visibility="Collapsed" Click="notification_IsEnabledChanged"/>
|
||||||
|
<CheckBox Content="Developer's messages" Name="messages" Margin="0,0,0,10" Click="notification_IsEnabledChanged"/>
|
||||||
|
|
||||||
|
<!--<TextBlock Text="Color scheme" FontSize="22"/>
|
||||||
|
<RadioButton Content="Light" GroupName="color" Name="darkTheme"/>
|
||||||
|
<RadioButton Content="Dark" GroupName="color" Name="lightTheme"/>
|
||||||
|
<RadioButton Content="Use system setting" GroupName="color" Name="systemTheme"/>
|
||||||
|
<TextBlock Text="Accent color" FontSize="22"/>
|
||||||
|
<RadioButton Content="Classic" GroupName="accentColor" Name="classicAccent"/>
|
||||||
|
<RadioButton Content="Custom" GroupName="accentColor" Name="customAccent"/>
|
||||||
|
<StackPanel Name="customColorPicker">
|
||||||
|
<ColorPicker HorizontalAlignment="Left" Margin="0,10,0,0" Name="colorPicker"/>
|
||||||
|
<Button Content="Apply" Margin="0,10,0,0" Name="applyColor"/>
|
||||||
|
</StackPanel>-->
|
||||||
|
</StackPanel>
|
||||||
</PivotItem>
|
</PivotItem>
|
||||||
<PivotItem Header="Personalization">
|
<PivotItem Margin="0,-48,0,0">
|
||||||
|
|
||||||
</PivotItem>
|
</PivotItem>
|
||||||
<PivotItem Header="Account">
|
<PivotItem Name="feedbackHub" Margin="0,-48,0,0">
|
||||||
|
|
||||||
</PivotItem>
|
|
||||||
<PivotItem Header="Leave feedback">
|
|
||||||
<local:Feedback/>
|
<local:Feedback/>
|
||||||
</PivotItem>
|
</PivotItem>
|
||||||
<PivotItem Header="About us">
|
<PivotItem Margin="0,-48,0,0">
|
||||||
<local:About/>
|
<StackPanel Orientation="Vertical" Margin="10">
|
||||||
|
<TextBlock Text="About us and this app" FontSize="28"/>
|
||||||
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="*"/>
|
||||||
|
<ColumnDefinition Width="128"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<StackPanel Grid.Column="0">
|
||||||
|
<TextBlock Text="FoxTube" FontSize="24"/>
|
||||||
|
<TextBlock Name="version" Text="[currentVersion]" FontSize="14" Foreground="Gray" Margin="0,-5,0,10"/>
|
||||||
|
<TextBlock Text="Developed by Michael Gordeev (also known as XFox)" Margin="0,0,0,10"/>
|
||||||
|
<TextBlock Visibility="Collapsed" Text="Special thanks to contributors for motivating me, testers and translators for making this app better everyday and you for using this app;)" Margin="0,0,0,10"/>
|
||||||
|
<TextBlock Text="Contacts" FontSize="22" FontWeight="SemiBold"/>
|
||||||
|
<StackPanel Orientation="Horizontal">
|
||||||
|
<TextBlock Text="Twitter:" Margin="0,0,5,0"/>
|
||||||
|
<HyperlinkButton Foreground="Red" Content="@XFox_Mike" Padding="0" NavigateUri="https://twitter.com/XFox_Mike"/>
|
||||||
|
</StackPanel>
|
||||||
|
<StackPanel Orientation="Horizontal" Visibility="Collapsed">
|
||||||
|
<TextBlock Text="Facebook:" Margin="0,0,5,0"/>
|
||||||
|
<HyperlinkButton Foreground="Red" Content="@XFox.Mike" Padding="0"/>
|
||||||
|
</StackPanel>
|
||||||
|
<StackPanel Orientation="Horizontal">
|
||||||
|
<TextBlock Text="VKontakte:" Margin="0,0,5,0"/>
|
||||||
|
<HyperlinkButton Foreground="Red" Content="@XFox.Mike" Padding="0" NavigateUri="https://vk.com/XFox.Mike"/>
|
||||||
|
</StackPanel>
|
||||||
|
<StackPanel Orientation="Horizontal">
|
||||||
|
<TextBlock Text="YouTube:" Margin="0,0,5,0"/>
|
||||||
|
<HyperlinkButton Foreground="Red" Content="@FoxGameStudioChannel" Padding="0" NavigateUri="https://youtube.com/c/FoxGameStudioChannel"/>
|
||||||
|
</StackPanel>
|
||||||
|
<StackPanel Orientation="Horizontal">
|
||||||
|
<TextBlock Text="E-mail:" Margin="0,0,5,0"/>
|
||||||
|
<HyperlinkButton Foreground="Red" Content="foxgameofficial@gmail.com" Padding="0" NavigateUri="mailto:foxgameofficial+foxtube@gmail.com"/>
|
||||||
|
</StackPanel>
|
||||||
|
<StackPanel Orientation="Horizontal">
|
||||||
|
<TextBlock Text="Official website (Russian language only):" Margin="0,0,5,0"/>
|
||||||
|
<HyperlinkButton Foreground="Red" Content="http://foxgame.hol.es/" Padding="0" NavigateUri="http://foxgame.hol.es/"/>
|
||||||
|
</StackPanel>
|
||||||
|
<TextBlock/>
|
||||||
|
<TextBlock Text="Legal stuff" FontSize="22" FontWeight="SemiBold"/>
|
||||||
|
<HyperlinkButton Foreground="Red" Content="Our Privacy Policy" NavigateUri="http://foxgame.hol.es/foxtubepp.txt" Padding="0,5,0,0"/>
|
||||||
|
<HyperlinkButton Foreground="Red" Content="Privacy Policy" NavigateUri="https://youtube.com/t/privacy" Padding="0"/>
|
||||||
|
<HyperlinkButton Foreground="Red" Content="Terms of use" NavigateUri="https://youtube.com/t/terms" Padding="0"/>
|
||||||
|
<HyperlinkButton Foreground="Red" Content="Community Guidelines" NavigateUri="https://youtube.com/t/community_guidelines" Padding="0,0,0,10"/>
|
||||||
|
<TextBlock Text="© 2018 Michael Gordeev"/>
|
||||||
|
<TextBlock Text="© 2018 YouTube, LLC"/>
|
||||||
|
<Image Source="Assets/FoxGame.png" Width="300" HorizontalAlignment="Left" Visibility="Collapsed"/>
|
||||||
|
</StackPanel>
|
||||||
|
<Image Grid.Column="1" Source="Assets/LogoAvatar.png" VerticalAlignment="Top"/>
|
||||||
|
</Grid>
|
||||||
|
</StackPanel>
|
||||||
</PivotItem>
|
</PivotItem>
|
||||||
<PivotItem Header="Join beta program">
|
<PivotItem Margin="0,-48,0,0">
|
||||||
|
|
||||||
</PivotItem>
|
|
||||||
<PivotItem Header="Help us translate this app">
|
|
||||||
<local:Translate/>
|
<local:Translate/>
|
||||||
</PivotItem>
|
</PivotItem>
|
||||||
</Pivot>
|
</Pivot>
|
||||||
<!--<Grid Grid.Row="0" Background="Red" Visibility="Collapsed">
|
</ScrollViewer>
|
||||||
<StackPanel Orientation="Horizontal">
|
<Grid Grid.Row="0" Background="Red">
|
||||||
<HyperlinkButton Content="General" Foreground="White" Margin="10,8,10,10" Name="GeneralMenu" Click="General_Click"/>
|
<StackPanel Orientation="Horizontal" Margin="10,0,10,0" Grid.Row="0" Background="Red">
|
||||||
<HyperlinkButton Content="Personalization" Foreground="White" Margin="10,8,10,10" Name="PersonalizationMenu" Click="Personalization_Click" Visibility="Collapsed"/>
|
<HyperlinkButton Name="toGeneral" Click="toGeneral_Click" Foreground="White" Margin="0,0,10,0">
|
||||||
<HyperlinkButton Content="Account" Foreground="White" Margin="10,8,10,10" Name="AccountMenu" Click="Account_Click" Visibility="Collapsed"/>
|
<TextBlock Text="General"/>
|
||||||
<HyperlinkButton Content="Leave feedback" Foreground="White" Margin="10,8,10,10" Name="FeedbackMenu" Click="Feedback_Click"/>
|
</HyperlinkButton>
|
||||||
<HyperlinkButton Content="About us" Foreground="White" FontStyle="Normal" Margin="10,8,10,10" Name="AboutMenu" Click="About_Click"/>
|
<HyperlinkButton Foreground="White" Margin="0,0,10,0" Name="toAccount" Click="toAccount_Click">
|
||||||
<HyperlinkButton Content="Join beta program" Foreground="White" Margin="10,8,10,10" Name="BetaMenu" Click="Beta_Click" Visibility="Collapsed"/>
|
<TextBlock Text="Account"/>
|
||||||
<HyperlinkButton Content="Help us translate this app" Foreground="White" Margin="10,8,10,10" Name="TranslateMenu" Click="Translate_Click" Visibility="Collapsed"/>
|
</HyperlinkButton>
|
||||||
|
<HyperlinkButton Foreground="White" Margin="0,0,10,0" Name="toFeedback" Click="toFeedback_Click">
|
||||||
|
<TextBlock Text="Leave feedback"/>
|
||||||
|
</HyperlinkButton>
|
||||||
|
<HyperlinkButton Foreground="White" Margin="0,0,10,0" Name="toAbout" Click="toAbout_Click">
|
||||||
|
<TextBlock Text="About us"/>
|
||||||
|
</HyperlinkButton>
|
||||||
|
<HyperlinkButton Foreground="White" Margin="0,0,10,0" Name="toTranslate" Click="toTranslate_Click">
|
||||||
|
<TextBlock Text="Help us translate this app"/>
|
||||||
|
</HyperlinkButton>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Grid>-->
|
</Grid>
|
||||||
<Frame Grid.Row="1" Name="settingsContent" Visibility="Collapsed"/>
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</Page>
|
</Page>
|
||||||
|
|||||||
+80
-16
@@ -3,8 +3,11 @@ using System.Collections.Generic;
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Runtime.InteropServices.WindowsRuntime;
|
using System.Runtime.InteropServices.WindowsRuntime;
|
||||||
|
using Windows.ApplicationModel;
|
||||||
using Windows.Foundation;
|
using Windows.Foundation;
|
||||||
using Windows.Foundation.Collections;
|
using Windows.Foundation.Collections;
|
||||||
|
using Windows.Storage;
|
||||||
|
using Windows.UI.Text;
|
||||||
using Windows.UI.Xaml;
|
using Windows.UI.Xaml;
|
||||||
using Windows.UI.Xaml.Controls;
|
using Windows.UI.Xaml.Controls;
|
||||||
using Windows.UI.Xaml.Controls.Primitives;
|
using Windows.UI.Xaml.Controls.Primitives;
|
||||||
@@ -22,47 +25,108 @@ namespace FoxTube
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public sealed partial class Settings : Page
|
public sealed partial class Settings : Page
|
||||||
{
|
{
|
||||||
public Frame content;
|
ApplicationDataContainer settings = ApplicationData.Current.LocalSettings;
|
||||||
|
PackageVersion ver = Package.Current.Id.Version;
|
||||||
|
public Pivot pivot;
|
||||||
|
public Feedback fb;
|
||||||
public Settings()
|
public Settings()
|
||||||
{
|
{
|
||||||
this.InitializeComponent();
|
this.InitializeComponent();
|
||||||
settingsContent.Navigate(typeof(General));
|
version.Text = string.Format("{0}.{1}.{2}", ver.Major, ver.Minor, ver.Build);
|
||||||
content = settingsContent;
|
pivot = content;
|
||||||
|
fb = feedbackHub.Content as Feedback;
|
||||||
|
|
||||||
|
language.SelectedIndex = (int)settings.Values["language"];
|
||||||
|
quality.SelectedIndex = (int)settings.Values["quality"];
|
||||||
|
|
||||||
|
newVideo.IsChecked = (bool)settings.Values["newVideoNotification"];
|
||||||
|
newComment.IsChecked = (bool)settings.Values["newCommentNotification"];
|
||||||
|
newPost.IsChecked = (bool)settings.Values["newPostNotification"];
|
||||||
|
messages.IsChecked = (bool)settings.Values["newmessagesNotification"];
|
||||||
|
|
||||||
|
mobileWarning.IsOn = (bool)settings.Values["moblieWarning"];
|
||||||
|
autoplay.IsOn = (bool)settings.Values["videoAutoplay"];
|
||||||
}
|
}
|
||||||
|
|
||||||
private void General_Click(object sender, RoutedEventArgs e)
|
private void language_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||||
{
|
{
|
||||||
settingsContent.Navigate(typeof(General));
|
if ((int)settings.Values["language"] != language.SelectedIndex)
|
||||||
|
{
|
||||||
|
settings.Values["language"] = language.SelectedIndex;
|
||||||
|
restartNote.Visibility = Visibility.Visible;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Personalization_Click(object sender, RoutedEventArgs e)
|
private void quality_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||||
{
|
{
|
||||||
|
if ((int)settings.Values["quality"] != quality.SelectedIndex)
|
||||||
|
settings.Values["quality"] = quality.SelectedIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Account_Click(object sender, RoutedEventArgs e)
|
private void notification_IsEnabledChanged(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
|
if ((bool)settings.Values["newVideoNotification"] != newVideo.IsChecked)
|
||||||
|
settings.Values["newVideoNotification"] = newVideo.IsChecked;
|
||||||
|
|
||||||
|
if ((bool)settings.Values["newPostNotification"] != newPost.IsChecked)
|
||||||
|
settings.Values["newPostNotification"] = newPost.IsChecked;
|
||||||
|
|
||||||
|
if ((bool)settings.Values["newCommentNotification"] != newComment.IsChecked)
|
||||||
|
settings.Values["newCommentNotification"] = newComment.IsChecked;
|
||||||
|
|
||||||
|
if ((bool)settings.Values["newmessagesNotification"] != messages.IsChecked)
|
||||||
|
settings.Values["newmessagesNotification"] = messages.IsChecked;
|
||||||
|
|
||||||
|
if ((bool)settings.Values["moblieWarning"] != mobileWarning.IsOn)
|
||||||
|
settings.Values["moblieWarning"] = mobileWarning.IsOn;
|
||||||
|
|
||||||
|
if ((bool)settings.Values["videoAutoplay"] != autoplay.IsOn)
|
||||||
|
settings.Values["videoAutoplay"] = autoplay.IsOn;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void About_Click(object sender, RoutedEventArgs e)
|
private void toGeneral_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
settingsContent.Navigate(typeof(About));
|
content.SelectedIndex = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Beta_Click(object sender, RoutedEventArgs e)
|
private void toFeedback_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
|
content.SelectedIndex = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Translate_Click(object sender, RoutedEventArgs e)
|
private void toTranslate_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
settingsContent.Navigate(typeof(Translate));
|
content.SelectedIndex = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Feedback_Click(object sender, RoutedEventArgs e)
|
private void content_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||||
{
|
{
|
||||||
settingsContent.Navigate(typeof(Feedback));
|
toGeneral.FontWeight = FontWeights.Normal;
|
||||||
|
toAccount.FontWeight = FontWeights.Normal;
|
||||||
|
toFeedback.FontWeight = FontWeights.Normal;
|
||||||
|
toAbout.FontWeight = FontWeights.Normal;
|
||||||
|
toTranslate.FontWeight = FontWeights.Normal;
|
||||||
|
|
||||||
|
if (content.SelectedIndex == 0)
|
||||||
|
toGeneral.FontWeight = FontWeights.Bold;
|
||||||
|
else if (content.SelectedIndex == 1)
|
||||||
|
toAccount.FontWeight = FontWeights.Bold;
|
||||||
|
else if (content.SelectedIndex == 2)
|
||||||
|
toFeedback.FontWeight = FontWeights.Bold;
|
||||||
|
else if (content.SelectedIndex == 3)
|
||||||
|
toAbout.FontWeight = FontWeights.Bold;
|
||||||
|
else if (content.SelectedIndex == 4)
|
||||||
|
toTranslate.FontWeight = FontWeights.Bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void toAccount_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
content.SelectedIndex = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void toAbout_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
content.SelectedIndex = 3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+38
-13
@@ -10,20 +10,45 @@
|
|||||||
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
||||||
<StackPanel Orientation="Vertical" Margin="10">
|
<StackPanel Orientation="Vertical" Margin="10">
|
||||||
<TextBlock Text="Help us translate this app" FontSize="28"/>
|
<TextBlock Text="Help us translate this app" FontSize="28"/>
|
||||||
<TextBlock Text="You can help us make this app even better by contributing to its development by translating this app. You can choose a brand new languageto translate or edit mistakes in existing translations." Margin="0,0,0,10"/>
|
<TextBlock TextWrapping="WrapWholeWords" Text="You can help us make this app even better by contributing to its development by translating this app. You can choose a brand new language to translate or edit mistakes in existing translations." Margin="0,0,0,10"/>
|
||||||
<TextBlock Text="It's quite simple:" Margin="0,0,0,10"/>
|
<StackPanel BorderThickness="2" BorderBrush="OrangeRed" MaxWidth="500" HorizontalAlignment="Left" Margin="0,0,0,10" Padding="0,0,0,3">
|
||||||
<TextBlock Text="1. Choose language you want to translate"/>
|
<TextBlock Foreground="OrangeRed" FontWeight="SemiBold" TextWrapping="WrapWholeWords" Text="Attention! This tool is used to help us to provide our app to more people from other countries. If you want to corect some mistakes in already existing language pack, please, report them via our Feedback Hub. Thanks in advance ;)" Margin="5"/>
|
||||||
<ComboBox Name="LangList" Margin="0,0,0,10"/>
|
</StackPanel>
|
||||||
<TextBlock Text="2. Import language pack file to your PC (.xml)"/>
|
<TextBlock Text="It's quite simple:" Margin="0,0,0,10"/>
|
||||||
<Button Content="Export"/>
|
|
||||||
<TextBlock Text="3. Open file with any text editor you want" Margin="0,0,0,10"/>
|
<ComboBox Header="1. Choose language you want to translate" PlaceholderText="Choose language..." Name="LangList" Margin="0,0,0,10" MinWidth="350" SelectionChanged="LangList_SelectionChanged"/>
|
||||||
<TextBlock Text="4. Edit file by translating nececcary words and sentences"/>
|
|
||||||
<StackPanel BorderThickness="2" BorderBrush="OrangeRed" Width="350" HorizontalAlignment="Left" Margin="0,0,0,10">
|
<TextBlock Text="2. Import language pack file to your PC" Margin="0,0,0,10"/>
|
||||||
<TextBlock FontFamily="Default, Segoe MDL2 Assets" Foreground="OrangeRed" FontWeight="SemiBold" Text=" Attention! Try not to break package structure!" Margin="5"/>
|
|
||||||
|
<Button Content="Export to PC (.xml)" Margin="0,0,0,10" Name="export" Click="export_Click" IsEnabled="False"/>
|
||||||
|
|
||||||
|
<TextBlock TextWrapping="WrapWholeWords" Text="3. Open file with any text editor you want (Notepad, Wordpad, Notepad++, VS Code, etc.)" Margin="0,0,0,10"/>
|
||||||
|
<TextBlock TextWrapping="WrapWholeWords" Text="4. Edit file by translating nececcary words and sentences" Margin="0,0,0,10"/>
|
||||||
|
<TextBlock Text="5. Upload final package to our servers" Margin="0,0,0,10"/>
|
||||||
|
|
||||||
|
<StackPanel Name="submitNotification" Visibility="Collapsed" BorderThickness="2" BorderBrush="OrangeRed" Width="350" HorizontalAlignment="Left" Margin="0,0,0,10" Padding="0,0,0,3">
|
||||||
|
<TextBlock Foreground="OrangeRed" FontWeight="SemiBold" Text="Attention! Once you submitted this language pack you won't be able to contribute to the language anymore. Think twice before continuing" TextWrapping="WrapWholeWords" Margin="5"/>
|
||||||
|
</StackPanel>
|
||||||
|
<Button Content="Choose file to upload" Margin="-1,0,0,10" HorizontalAlignment="Left" VerticalAlignment="Top" Name="upload" IsEnabled="False" Click="upload_Click"/>
|
||||||
|
<ProgressBar Width="250" HorizontalAlignment="Left" IsIndeterminate="True" Name="uploadingProgress" Visibility="Collapsed"/>
|
||||||
|
<TextBlock TextWrapping="WrapWholeWords" Text="It takes about 2-3 weeks to process new language pack and include it to the next update" Margin="0,0,0,10"/>
|
||||||
|
<TextBlock Text="Thank you for your help 😚"/>
|
||||||
|
<TextBlock Text="Best wishes,"/>
|
||||||
|
<TextBlock Text=" XFox"/>
|
||||||
|
<StackPanel Orientation="Horizontal" BorderBrush="Green" BorderThickness="5" Margin="0,10,30,0" Visibility="Collapsed" Name="greenResult">
|
||||||
|
<TextBlock FontFamily="Segoe MDL2 Assets" Text="" FontSize="40" Foreground="Green" Margin="5"/>
|
||||||
|
<StackPanel>
|
||||||
|
<TextBlock Text="Your language pack has been sent!" Foreground="Green" FontWeight="Bold" FontSize="20"/>
|
||||||
|
<TextBlock Text="Thank you! It's very imortant for us. Thank you for helping us making the app better" Foreground="Green"/>
|
||||||
|
</StackPanel>
|
||||||
|
</StackPanel>
|
||||||
|
<StackPanel Orientation="Horizontal" BorderBrush="OrangeRed" BorderThickness="5" Margin="0,10,30,0" Visibility="Collapsed" Name="denied">
|
||||||
|
<TextBlock FontFamily="Segoe MDL2 Assets" Text="" FontSize="40" Foreground="OrangeRed" Margin="5"/>
|
||||||
|
<StackPanel>
|
||||||
|
<TextBlock Text="You have already contributed to this language" Foreground="OrangeRed" FontWeight="Bold" FontSize="20"/>
|
||||||
|
<TextBlock Text="To prevent spaming our mailbox we allow our users to contribute to each language only 1 time" Foreground="OrangeRed"/>
|
||||||
|
</StackPanel>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<TextBlock Text="5. Upload final package to our servers"/>
|
|
||||||
<Button Content="Choose file" Margin="0,0,0,10"/>
|
|
||||||
<TextBlock Text="It took about 2-3 weeks to process your pack and include it to the next update"/>
|
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Page>
|
</Page>
|
||||||
|
|||||||
@@ -13,6 +13,11 @@ using Windows.UI.Xaml.Data;
|
|||||||
using Windows.UI.Xaml.Input;
|
using Windows.UI.Xaml.Input;
|
||||||
using Windows.UI.Xaml.Media;
|
using Windows.UI.Xaml.Media;
|
||||||
using Windows.UI.Xaml.Navigation;
|
using Windows.UI.Xaml.Navigation;
|
||||||
|
using Windows.Storage.Pickers;
|
||||||
|
using Windows.Storage;
|
||||||
|
using System.Net.Mail;
|
||||||
|
using System.Net;
|
||||||
|
using Windows.UI.Popups;
|
||||||
|
|
||||||
// The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238
|
// The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238
|
||||||
|
|
||||||
@@ -23,13 +28,98 @@ namespace FoxTube
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public sealed partial class Translate : Page
|
public sealed partial class Translate : Page
|
||||||
{
|
{
|
||||||
|
ApplicationDataContainer settings = ApplicationData.Current.LocalSettings;
|
||||||
|
int selectedLanguage;
|
||||||
public Translate()
|
public Translate()
|
||||||
{
|
{
|
||||||
this.InitializeComponent();
|
this.InitializeComponent();
|
||||||
foreach (CultureInfo culture in CultureInfo.GetCultures(CultureTypes.AllCultures))
|
foreach (CultureInfo culture in CultureInfo.GetCultures(CultureTypes.AllCultures))
|
||||||
LangList.Items.Add(culture);
|
LangList.Items.Add(culture.DisplayName);
|
||||||
LangList.SelectedIndex = 0;
|
}
|
||||||
|
|
||||||
|
private async void export_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
FileSavePicker picker = new FileSavePicker();
|
||||||
|
picker.CommitButtonText = "Export";
|
||||||
|
picker.DefaultFileExtension = ".xml";
|
||||||
|
picker.SuggestedFileName = "foxtube_langpack_" + CultureInfo.GetCultures(CultureTypes.AllCultures)[selectedLanguage];
|
||||||
|
picker.SuggestedStartLocation = PickerLocationId.Desktop;
|
||||||
|
picker.FileTypeChoices.Add("Language pack scheme", new List<string>() { ".xml" });
|
||||||
|
|
||||||
|
StorageFile file = await picker.PickSaveFileAsync();
|
||||||
|
if(file != null)
|
||||||
|
await FileIO.WriteTextAsync(file, GetPackage(selectedLanguage));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void LangList_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||||
|
{
|
||||||
|
selectedLanguage = LangList.SelectedIndex;
|
||||||
|
|
||||||
|
greenResult.Visibility = Visibility.Collapsed;
|
||||||
|
denied.Visibility = Visibility.Collapsed;
|
||||||
|
|
||||||
|
if (settings.Values[CultureInfo.GetCultures(CultureTypes.AllCultures)[selectedLanguage] + "_sent"] == null)
|
||||||
|
{
|
||||||
|
export.IsEnabled = true;
|
||||||
|
upload.IsEnabled = true;
|
||||||
|
submitNotification.Visibility = Visibility.Visible;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
export.IsEnabled = false;
|
||||||
|
upload.IsEnabled = false;
|
||||||
|
denied.Visibility = Visibility.Visible;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private async void upload_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
FileOpenPicker picker = new FileOpenPicker()
|
||||||
|
{
|
||||||
|
CommitButtonText = "Upload",
|
||||||
|
SuggestedStartLocation = PickerLocationId.Desktop
|
||||||
|
};
|
||||||
|
picker.FileTypeFilter.Clear();
|
||||||
|
picker.FileTypeFilter.Add(".xml");
|
||||||
|
|
||||||
|
StorageFile file = await picker.PickSingleFileAsync();
|
||||||
|
if (file != null)
|
||||||
|
{
|
||||||
|
MailMessage msg = new MailMessage();
|
||||||
|
msg.To.Add("foxgameofficial+foxtube@gmail.com");
|
||||||
|
msg.From = new MailAddress("foxgameofficial+foxtube@gmail.com");
|
||||||
|
msg.Subject = "FoxTube language pack contribution";
|
||||||
|
msg.Body = string.Format("Language: {0}\nLanguage code: {1}", CultureInfo.GetCultures(CultureTypes.AllCultures)[selectedLanguage].EnglishName, CultureInfo.GetCultures(CultureTypes.AllCultures)[selectedLanguage]);
|
||||||
|
msg.Attachments.Add(new Attachment(file.Path));
|
||||||
|
|
||||||
|
SmtpClient client = new SmtpClient("smtp.gmail.com", 587);
|
||||||
|
client.EnableSsl = true;
|
||||||
|
client.Credentials = new NetworkCredential(SecretsVault.Email, SecretsVault.Password);
|
||||||
|
|
||||||
|
upload.IsEnabled = false;
|
||||||
|
export.IsEnabled = false;
|
||||||
|
uploadingProgress.Visibility = Visibility.Visible;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
client.Send(msg);
|
||||||
|
greenResult.Visibility = Visibility.Visible;
|
||||||
|
submitNotification.Visibility = Visibility.Collapsed;
|
||||||
|
settings.Values.Add(CultureInfo.GetCultures(CultureTypes.AllCultures)[selectedLanguage] + "_sent", true);
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
MessageDialog message = new MessageDialog("We was unable to send your feedback due to connection problems or internal server error. Please, try again later.", "Failed to send your feedback");
|
||||||
|
await message.ShowAsync();
|
||||||
|
export.IsEnabled = true;
|
||||||
|
upload.IsEnabled = true;
|
||||||
|
}
|
||||||
|
uploadingProgress.Visibility = Visibility.Collapsed;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public string GetPackage(int cultureIndex)
|
||||||
|
{
|
||||||
|
return "langpack";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,11 +19,11 @@
|
|||||||
<RowDefinition Height="75"/>
|
<RowDefinition Height="75"/>
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<Grid Grid.Row="0" Background="Black">
|
<Grid Grid.Row="0" Background="Black">
|
||||||
<Image Source="Assets/videoThumbSample.png" Stretch="Fill"/>
|
<Image Name="thumbnail" Source="Assets/videoThumbSample.png" Stretch="Fill"/>
|
||||||
<StackPanel Margin="0,0,5,5" Background="WhiteSmoke" VerticalAlignment="Bottom" HorizontalAlignment="Right" Padding="5,2,5,0" Height="20">
|
<StackPanel Margin="0,0,5,5" Background="WhiteSmoke" VerticalAlignment="Bottom" HorizontalAlignment="Right" Padding="5,2,5,0" Height="20">
|
||||||
<TextBlock Text="1:00:00 | 59 minute ago" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="Gray" FontSize="12"/>
|
<TextBlock Name="info" Text="1:00:00 | 59 minute ago" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="Gray" FontSize="12"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<StackPanel Margin="0,0,5,30" Background="Red" BorderBrush="White" BorderThickness="1" VerticalAlignment="Bottom" HorizontalAlignment="Right" Padding="5,0,5,0" Height="20" Orientation="Horizontal" Visibility="Collapsed">
|
<StackPanel Name="liveTag" Margin="0,0,5,30" Background="Red" BorderBrush="White" BorderThickness="1" VerticalAlignment="Bottom" HorizontalAlignment="Right" Padding="5,0,5,0" Height="20" Orientation="Horizontal" Visibility="Collapsed">
|
||||||
<TextBlock Text=" " VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="White" FontSize="12" FontFamily="Segoe MDL2 Assets" Margin="0,1,0,0" FontWeight="Black"/>
|
<TextBlock Text=" " VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="White" FontSize="12" FontFamily="Segoe MDL2 Assets" Margin="0,1,0,0" FontWeight="Black"/>
|
||||||
<TextBlock Text="LIVE" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="White" FontSize="12" FontWeight="Bold"/>
|
<TextBlock Text="LIVE" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="White" FontSize="12" FontWeight="Bold"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
@@ -46,13 +46,13 @@
|
|||||||
<ColumnDefinition Width="*"/>
|
<ColumnDefinition Width="*"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<Ellipse Grid.Column="0" Height="50" Width="50" Margin="5,-30,5,10" Fill="WhiteSmoke"/>
|
<Ellipse Grid.Column="0" Height="50" Width="50" Margin="5,-30,5,10" Fill="WhiteSmoke"/>
|
||||||
<PersonPicture Grid.Column="0" Height="46" Margin="5,-30,5,0" BorderBrush="White" BorderThickness="10" ProfilePicture="https://yt3.ggpht.com/-UOhOJaAitUc/AAAAAAAAAAI/AAAAAAAAAAA/z3WPfWpVuZw/s88-c-k-no-mo-rj-c0xffffff/photo.jpg"/>
|
<PersonPicture Name="avatar" Grid.Column="0" Height="46" Margin="5,-30,5,0" BorderBrush="White" BorderThickness="10" ProfilePicture="https://yt3.ggpht.com/-UOhOJaAitUc/AAAAAAAAAAI/AAAAAAAAAAA/z3WPfWpVuZw/s88-c-k-no-mo-rj-c0xffffff/photo.jpg"/>
|
||||||
|
|
||||||
<TextBlock Grid.Column="1" Text="IGP" Foreground="Gray" Margin="0,2,0,0" FontSize="12"/>
|
<TextBlock Name="channelName" Grid.Column="1" Text="IGP" Foreground="Gray" Margin="0,2,0,0" FontSize="12"/>
|
||||||
<TextBlock Grid.Column="2" Text="1M views" HorizontalAlignment="Right" Foreground="Gray" Margin="0,2,2,0" FontSize="12"/>
|
<TextBlock Grid.Column="2" Name="views" Text="1M views" HorizontalAlignment="Right" Foreground="Gray" Margin="0,2,2,0" FontSize="12"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
<StackPanel Grid.Row="1">
|
<StackPanel Grid.Row="1">
|
||||||
<TextBlock Text="Subnautica - SAY GOODBYE TO SUBNAUTICA! We're Back Home! - Subnautica Ending (Full Release Gameplay)" TextWrapping="WrapWholeWords" Margin="5" FontSize="14" MaxLines="2"/>
|
<TextBlock Name="title" Text="Subnautica - SAY GOODBYE TO SUBNAUTICA! We're Back Home! - Subnautica Ending (Full Release Gameplay)" TextWrapping="WrapWholeWords" Margin="5" FontSize="14" MaxLines="2"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|||||||
@@ -14,20 +14,60 @@ using Windows.UI.Xaml.Input;
|
|||||||
using Windows.UI.Xaml.Media;
|
using Windows.UI.Xaml.Media;
|
||||||
using Windows.UI.Xaml.Navigation;
|
using Windows.UI.Xaml.Navigation;
|
||||||
|
|
||||||
|
using Google.Apis.Services;
|
||||||
|
using Google.Apis.YouTube.v3;
|
||||||
|
using Google.Apis.YouTube.v3.Data;
|
||||||
|
using Windows.UI.Xaml.Media.Imaging;
|
||||||
|
using System.Xml;
|
||||||
|
|
||||||
// The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236
|
// The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236
|
||||||
|
|
||||||
namespace FoxTube
|
namespace FoxTube
|
||||||
{
|
{
|
||||||
public sealed partial class VideoCard : UserControl
|
public sealed partial class VideoCard : UserControl
|
||||||
{
|
{
|
||||||
public VideoCard()
|
public string channeId;
|
||||||
|
public VideoCard(string id)
|
||||||
{
|
{
|
||||||
this.InitializeComponent();
|
this.InitializeComponent();
|
||||||
|
Initialize(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UserControl_SizeChanged(object sender, SizeChangedEventArgs e)
|
private void UserControl_SizeChanged(object sender, SizeChangedEventArgs e)
|
||||||
{
|
{
|
||||||
Height = e.NewSize.Width * 0.75;
|
Height = e.NewSize.Width * 0.75;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async void Initialize(string id)
|
||||||
|
{
|
||||||
|
YouTubeService ytService = SecretsVault.YoutubeService;
|
||||||
|
|
||||||
|
VideosResource.ListRequest request = ytService.Videos.List("snippet,contentDetails,statistics");
|
||||||
|
request.Id = id;
|
||||||
|
VideoListResponse response = await request.ExecuteAsync();
|
||||||
|
|
||||||
|
var item = response.Items[0];
|
||||||
|
|
||||||
|
channeId = id;
|
||||||
|
|
||||||
|
title.Text = item.Snippet.Title;
|
||||||
|
views.Text = string.Format("{0} views", item.Statistics.ViewCount);
|
||||||
|
|
||||||
|
TimeSpan duration = XmlConvert.ToTimeSpan(item.ContentDetails.Duration);
|
||||||
|
|
||||||
|
info.Text = string.Format("{0}:{1}:{2} | {3}", duration.Hours, duration.Minutes, duration.Seconds, item.Snippet.PublishedAt);
|
||||||
|
thumbnail.Source = new BitmapImage(new Uri(item.Snippet.Thumbnails.Medium.Url));
|
||||||
|
if (item.Snippet.LiveBroadcastContent == "live")
|
||||||
|
liveTag.Visibility = Visibility.Visible;
|
||||||
|
|
||||||
|
var request1 = ytService.Channels.List("snippet,contentDetails,statistics");
|
||||||
|
request1.Id = item.Snippet.ChannelId;
|
||||||
|
ChannelListResponse response1 = await request1.ExecuteAsync();
|
||||||
|
|
||||||
|
var item1 = response1.Items[0];
|
||||||
|
|
||||||
|
avatar.ProfilePicture = new BitmapImage(new Uri(item1.Snippet.Thumbnails.Medium.Url));
|
||||||
|
channelName.Text = item1.Snippet.Title;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ using Google.Apis.YouTube.v3.Data;
|
|||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using Google.Apis.Util.Store;
|
using Google.Apis.Util.Store;
|
||||||
|
using System.Xml;
|
||||||
|
|
||||||
// The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236
|
// The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236
|
||||||
|
|
||||||
@@ -36,11 +37,7 @@ namespace FoxTube
|
|||||||
|
|
||||||
public async void Initialize(string id)
|
public async void Initialize(string id)
|
||||||
{
|
{
|
||||||
YouTubeService ytService = new YouTubeService(new BaseClientService.Initializer()
|
YouTubeService ytService = SecretsVault.YoutubeService;
|
||||||
{
|
|
||||||
ApiKey = "AIzaSyBgHrCnrlzlVmk0cJKL8RqP9Y8x6XSuk_0",
|
|
||||||
ApplicationName = this.GetType().ToString()
|
|
||||||
});
|
|
||||||
|
|
||||||
VideosResource.ListRequest request = ytService.Videos.List("snippet,contentDetails,statistics");
|
VideosResource.ListRequest request = ytService.Videos.List("snippet,contentDetails,statistics");
|
||||||
request.Id = id;
|
request.Id = id;
|
||||||
@@ -51,7 +48,10 @@ namespace FoxTube
|
|||||||
channeId = id;
|
channeId = id;
|
||||||
|
|
||||||
title.Text = item.Snippet.Title;
|
title.Text = item.Snippet.Title;
|
||||||
info.Text = string.Format("{0} | {1} | {2} views", item.ContentDetails.Duration, item.Snippet.PublishedAt, item.Statistics.ViewCount);
|
|
||||||
|
TimeSpan duration = XmlConvert.ToTimeSpan(item.ContentDetails.Duration);
|
||||||
|
|
||||||
|
info.Text = string.Format("{0}:{1}:{2} | {3} | {4} views", duration.Hours, duration.Minutes, duration.Seconds, item.ContentDetails.Duration, item.Snippet.PublishedAt, item.Statistics.ViewCount);
|
||||||
thumbnail.Source = new BitmapImage(new Uri(item.Snippet.Thumbnails.Medium.Url));
|
thumbnail.Source = new BitmapImage(new Uri(item.Snippet.Thumbnails.Medium.Url));
|
||||||
if (item.Snippet.LiveBroadcastContent == "live")
|
if (item.Snippet.LiveBroadcastContent == "live")
|
||||||
liveTag.Visibility = Visibility.Visible;
|
liveTag.Visibility = Visibility.Visible;
|
||||||
@@ -65,7 +65,6 @@ namespace FoxTube
|
|||||||
avatar.ProfilePicture = new BitmapImage(new Uri(item1.Snippet.Thumbnails.Medium.Url));
|
avatar.ProfilePicture = new BitmapImage(new Uri(item1.Snippet.Thumbnails.Medium.Url));
|
||||||
channelName.Text = item1.Snippet.Title;
|
channelName.Text = item1.Snippet.Title;
|
||||||
channelSubs.Text = string.Format("{0} subscribers", item1.Statistics.SubscriberCount);
|
channelSubs.Text = string.Format("{0} subscribers", item1.Statistics.SubscriberCount);
|
||||||
channelLink.NavigateUri = new Uri("https://www.youtube.com/channel/" + item.Snippet.ChannelId);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void channelLink_Click(object sender, RoutedEventArgs e)
|
private void channelLink_Click(object sender, RoutedEventArgs e)
|
||||||
|
|||||||
@@ -14,42 +14,14 @@
|
|||||||
<ColumnDefinition Width="*"/>
|
<ColumnDefinition Width="*"/>
|
||||||
<ColumnDefinition Width="*"/>
|
<ColumnDefinition Width="*"/>
|
||||||
<ColumnDefinition Width="*"/>
|
<ColumnDefinition Width="*"/>
|
||||||
<ColumnDefinition Width="*"/>
|
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<StackPanel Orientation="Vertical" Grid.Column="0" Name="col0">
|
<StackPanel Orientation="Vertical" Grid.Column="0" Name="col0">
|
||||||
<local:VideoCard/>
|
|
||||||
<local:VideoCard/>
|
|
||||||
<local:VideoCard/>
|
|
||||||
<local:VideoCard/>
|
|
||||||
<local:VideoCard/>
|
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<StackPanel Orientation="Vertical" Grid.Column="1" Name="col1">
|
<StackPanel Orientation="Vertical" Grid.Column="1" Name="col1">
|
||||||
<local:VideoCard/>
|
|
||||||
<local:VideoCard/>
|
|
||||||
<local:VideoCard/>
|
|
||||||
<local:VideoCard/>
|
|
||||||
<local:VideoCard/>
|
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<StackPanel Orientation="Vertical" Grid.Column="2" Name="col2">
|
<StackPanel Orientation="Vertical" Grid.Column="2" Name="col2">
|
||||||
<local:VideoCard/>
|
|
||||||
<local:VideoCard/>
|
|
||||||
<local:VideoCard/>
|
|
||||||
<local:VideoCard/>
|
|
||||||
<local:VideoCard/>
|
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<StackPanel Orientation="Vertical" Grid.Column="3" Name="col3">
|
<StackPanel Orientation="Vertical" Grid.Column="3" Name="col3">
|
||||||
<local:VideoCard/>
|
|
||||||
<local:VideoCard/>
|
|
||||||
<local:VideoCard/>
|
|
||||||
<local:VideoCard/>
|
|
||||||
<local:VideoCard/>
|
|
||||||
</StackPanel>
|
|
||||||
<StackPanel Orientation="Vertical" Grid.Column="4" Name="col4">
|
|
||||||
<local:VideoCard/>
|
|
||||||
<local:VideoCard/>
|
|
||||||
<local:VideoCard/>
|
|
||||||
<local:VideoCard/>
|
|
||||||
<local:VideoCard/>
|
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Page>
|
</Page>
|
||||||
|
|||||||
@@ -31,8 +31,11 @@ namespace FoxTube
|
|||||||
public VideoGrid()
|
public VideoGrid()
|
||||||
{
|
{
|
||||||
this.InitializeComponent();
|
this.InitializeComponent();
|
||||||
for (int k = 0; k < 25; k++)
|
}
|
||||||
cards.Add(new VideoCard());
|
|
||||||
|
public void AddCards(VideoCard vCard)
|
||||||
|
{
|
||||||
|
cards.Add(vCard);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetColumns(int num)
|
void SetColumns(int num)
|
||||||
@@ -47,7 +50,6 @@ namespace FoxTube
|
|||||||
col1.Children.Clear();
|
col1.Children.Clear();
|
||||||
col2.Children.Clear();
|
col2.Children.Clear();
|
||||||
col3.Children.Clear();
|
col3.Children.Clear();
|
||||||
col4.Children.Clear();
|
|
||||||
|
|
||||||
for (int k = 0; k < cards.Count; k += num)
|
for (int k = 0; k < cards.Count; k += num)
|
||||||
col0.Children.Add(cards[k]);
|
col0.Children.Add(cards[k]);
|
||||||
@@ -63,69 +65,14 @@ namespace FoxTube
|
|||||||
{
|
{
|
||||||
for (int k = 3; k < cards.Count; k += num)
|
for (int k = 3; k < cards.Count; k += num)
|
||||||
col3.Children.Add(cards[k]);
|
col3.Children.Add(cards[k]);
|
||||||
if(num == 5)
|
|
||||||
{
|
|
||||||
for (int k = 4; k < cards.Count; k += num)
|
|
||||||
col4.Children.Add(cards[k]);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*switch(num)
|
|
||||||
{
|
|
||||||
case 1:
|
|
||||||
foreach (VideoCard card in cards)
|
|
||||||
col0.Children.Add(card);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 2:
|
|
||||||
for (int k = 0; k < cards.Count; k += 2)
|
|
||||||
col0.Children.Add(cards[k]);
|
|
||||||
for (int k = 1; k < cards.Count; k += 2)
|
|
||||||
col1.Children.Add(cards[k]);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 3:
|
|
||||||
for (int k = 0; k < cards.Count; k += 3)
|
|
||||||
col0.Children.Add(cards[k]);
|
|
||||||
for (int k = 1; k < cards.Count; k += 3)
|
|
||||||
col1.Children.Add(cards[k]);
|
|
||||||
for (int k = 2; k < cards.Count; k += 3)
|
|
||||||
col2.Children.Add(cards[k]);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 4:
|
|
||||||
for (int k = 0; k < cards.Count; k += 4)
|
|
||||||
col0.Children.Add(cards[k]);
|
|
||||||
for (int k = 1; k < cards.Count; k += 4)
|
|
||||||
col1.Children.Add(cards[k]);
|
|
||||||
for (int k = 2; k < cards.Count; k += 4)
|
|
||||||
col2.Children.Add(cards[k]);
|
|
||||||
for (int k = 3; k < cards.Count; k += 4)
|
|
||||||
col3.Children.Add(cards[k]);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 5:
|
|
||||||
for (int k = 0; k < cards.Count; k += 5)
|
|
||||||
col0.Children.Add(cards[k]);
|
|
||||||
for (int k = 1; k < cards.Count; k += 5)
|
|
||||||
col1.Children.Add(cards[k]);
|
|
||||||
for (int k = 2; k < cards.Count; k += 5)
|
|
||||||
col2.Children.Add(cards[k]);
|
|
||||||
for (int k = 3; k < cards.Count; k += 5)
|
|
||||||
col3.Children.Add(cards[k]);
|
|
||||||
for (int k = 4; k < cards.Count; k += 5)
|
|
||||||
col4.Children.Add(cards[k]);
|
|
||||||
break;
|
|
||||||
}*/
|
|
||||||
}
|
|
||||||
|
|
||||||
private void grid_SizeChanged(object sender, SizeChangedEventArgs e)
|
private void grid_SizeChanged(object sender, SizeChangedEventArgs e)
|
||||||
{
|
{
|
||||||
if (e.NewSize.Width >= 1500 && cols != 5)
|
if (e.NewSize.Width >= 1000 && cols != 4)
|
||||||
SetColumns(5);
|
|
||||||
else if (e.NewSize.Width >= 1000 && e.NewSize.Width < 1500 && cols != 4)
|
|
||||||
SetColumns(4);
|
SetColumns(4);
|
||||||
else if (e.NewSize.Width >= 800 && e.NewSize.Width < 1000 && cols != 3)
|
else if (e.NewSize.Width >= 800 && e.NewSize.Width < 1000 && cols != 3)
|
||||||
SetColumns(3);
|
SetColumns(3);
|
||||||
|
|||||||
@@ -120,7 +120,17 @@
|
|||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid Background="#FF333333" Padding="25">
|
<Grid Background="Gray" Name="meteredNotification">
|
||||||
|
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||||
|
<FontIcon FontFamily="Segoe MDL2 Assets" FontSize="72" Foreground="White" Glyph=""/>
|
||||||
|
<TextBlock Text="You are on a metered connection now. Additional charges may apply." FontSize="22" Foreground="White"/>
|
||||||
|
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
|
||||||
|
<Button Content="Add to 'Watch later' playlist and go back" Margin="10" Background="Red" Foreground="White"/>
|
||||||
|
<Button Content="Continue" Margin="10"/>
|
||||||
|
</StackPanel>
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
<Grid Name="matureBlock" Visibility="Collapsed" Background="#FF333333" Padding="25">
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="auto"/>
|
<RowDefinition Height="auto"/>
|
||||||
<RowDefinition/>
|
<RowDefinition/>
|
||||||
|
|||||||
Reference in New Issue
Block a user