Archived
1
0

Submission candidate #1 (ver. 0.3)

This commit is contained in:
Michael Gordeev
2019-02-02 16:59:11 +03:00
53 changed files with 287 additions and 262 deletions
+12 -2
View File
@@ -1,6 +1,7 @@
using Google.Apis.Services;
using Google.Apis.YouTube.v3;
using Google.Apis.YouTube.v3.Data;
using Microsoft.AppCenter.Analytics;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
@@ -16,7 +17,7 @@ namespace FoxTube.Background
public sealed class BackgroundProcessor : IBackgroundTask
{
private DateTime lastCheck = DateTime.Now;
private ApplicationDataContainer settings = ApplicationData.Current.LocalSettings;
private readonly ApplicationDataContainer settings = ApplicationData.Current.LocalSettings;
private YouTubeService Service => new YouTubeService(new BaseClientService.Initializer()
{
ApiKey = "AIzaSyBgHrCnrlzlVmk0cJKL8RqP9Y8x6XSuk_0",
@@ -29,6 +30,7 @@ namespace FoxTube.Background
try
{
def = taskInstance.GetDeferral();
taskInstance.Canceled += new BackgroundTaskCanceledEventHandler(OnCanceled);
if (settings.Values["lastCheck"] == null)
{
@@ -45,7 +47,6 @@ namespace FoxTube.Background
if (notificationsSettings[1])
await CheckAccount();
}
catch { }
finally
{
settings.Values["lastCheck"] = DateTime.Now.ToString();
@@ -53,6 +54,15 @@ namespace FoxTube.Background
}
}
private void OnCanceled(IBackgroundTaskInstance sender, BackgroundTaskCancellationReason reason)
{
Analytics.TrackEvent("Background task caneled", new Dictionary<string, string>()
{
{ "Reason", reason.ToString() }
});
settings.Values["lastCheck"] = DateTime.Now.ToString();
}
async Task CheckAccount()
{
try
@@ -127,6 +127,9 @@
<PackageReference Include="Google.Apis.YouTube.v3">
<Version>1.29.2.1006</Version>
</PackageReference>
<PackageReference Include="Microsoft.AppCenter.Analytics">
<Version>1.13.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform">
<Version>6.1.5</Version>
</PackageReference>
-1
View File
@@ -1,6 +1,5 @@
using Newtonsoft.Json;
using System.Collections.Generic;
using Windows.ApplicationModel.Resources;
using Windows.Data.Xml.Dom;
using Windows.Storage;
using Windows.UI.Notifications;
+17 -6
View File
@@ -1,5 +1,8 @@
using Google.Apis.YouTube.v3.Data;
using Microsoft.AppCenter;
using Microsoft.AppCenter.Analytics;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using Windows.ApplicationModel;
@@ -42,6 +45,9 @@ namespace FoxTube
ApplicationLanguages.PrimaryLanguageOverride = SettingsStorage.Language;
InitializeComponent();
Suspending += OnSuspending;
UnhandledException += UnhandledError;
AppCenter.Start("45774462-9ea7-438a-96fc-03982666f39e", typeof(Analytics));
AppCenter.SetCountryCode(SettingsStorage.Region);
}
/// <summary>
@@ -51,11 +57,9 @@ namespace FoxTube
/// <param name="e">Details about the launch request and process.</param>
protected override void OnLaunched(LaunchActivatedEventArgs e)
{
Frame rootFrame = Window.Current.Content as Frame;
// Do not repeat app initialization when the Window already has content,
// just ensure that the window is active
if (rootFrame == null)
if (!(Window.Current.Content is Frame rootFrame))
{
// Create a Frame to act as the navigation context and navigate to the first page
rootFrame = new Frame();
@@ -180,9 +184,7 @@ namespace FoxTube
{
base.OnActivated(e);
Frame rootFrame = Window.Current.Content as Frame;
if (rootFrame == null)
if (!(Window.Current.Content is Frame rootFrame))
{
rootFrame = new Frame();
rootFrame.NavigationFailed += OnNavigationFailed;
@@ -248,5 +250,14 @@ namespace FoxTube
DownloadAgent.QuitPrompt();
deferral.Complete();
}
private void UnhandledError(object sender, Windows.UI.Xaml.UnhandledExceptionEventArgs e)
{
Analytics.TrackEvent("The app crashed", new Dictionary<string, string>()
{
{ "Exception", e.Exception.GetType().ToString() },
{ "Class", e.ToString() },
{ "Details", e.Message }
});
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 562 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 667 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 672 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 804 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

+16
View File
@@ -1,5 +1,21 @@
<?xml version="1.0" encoding="utf-8" ?>
<items>
<item time="2019-02-02" version="0.3">
<content>
<en-US>### What's new:
- Small fixes
- First public pre-release version
- Some content was cut out due to its incompleteness
</en-US>
<ru-RU>### Что нового:
- Мелкие исправления багов
- Эта версия является первой пред-релизной публичной версией
- Некотроые функции были вырезаны из-за их незавершенности
</ru-RU>
</content>
</item>
<item time="2019-01-05" version="0.2.19012">
<content>
<en-US>### What's new:
-1
View File
@@ -5,7 +5,6 @@ using FoxTube.Classes;
using Newtonsoft.Json;
using YoutubeExplode.Models.MediaStreams;
using Google.Apis.YouTube.v3.Data;
using System.Diagnostics;
using FoxTube.Controls;
namespace FoxTube
-1
View File
@@ -1,5 +1,4 @@
using System;
using Windows.Storage;
namespace FoxTube.Classes
{
-1
View File
@@ -1,5 +1,4 @@
using System;
using System.Xml;
using Windows.ApplicationModel.Resources;
namespace FoxTube.Classes
+1 -38
View File
@@ -1,7 +1,5 @@
using FoxTube.Controls.Adverts;
using FoxTube.Pages;
using FoxTube.Pages;
using Google.Apis.YouTube.v3;
using Microsoft.Advertising.WinRT.UI;
using System;
using System.Collections.Generic;
using System.Diagnostics;
@@ -223,41 +221,6 @@ namespace FoxTube
}
}
/*public static string QualityToString(YouTubeQuality quality)
{
switch(quality)
{
case YouTubeQuality.NotAvailable:
return "N/A";
case YouTubeQuality.Quality1080P:
return "1080p";
case YouTubeQuality.Quality144P:
return "144p";
case YouTubeQuality.Quality2160P:
return "2160p";
case YouTubeQuality.Quality240P:
return "240p";
case YouTubeQuality.Quality270P:
return "270p";
case YouTubeQuality.Quality360P:
return "360p";
case YouTubeQuality.Quality480P:
return "480p";
case YouTubeQuality.Quality520P:
return "520p";
case YouTubeQuality.Quality720P:
return "720p";
case YouTubeQuality.QualityHigh:
return "[Audio only] High quality";
case YouTubeQuality.QualityLow:
return "[Audio only] Low quality";
case YouTubeQuality.QualityMedium:
return "[Audio only] Medium quality";
default:
return "Unknown";
}
}*/
public async static void ProcessLink(string url)
{
try
+1 -1
View File
@@ -43,7 +43,7 @@ namespace FoxTube
//User info
public static bool IsAuthorized => Credential != null;
private static UserCredential Credential { get; set; }
public static UserCredential Credential { get; set; }
public static string AccountId => UserChannel?.Id;
public static Channel UserChannel { get; private set; }
+24 -27
View File
@@ -17,12 +17,11 @@
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WindowsXamlEnableOverview>true</WindowsXamlEnableOverview>
<PackageCertificateKeyFile>
</PackageCertificateKeyFile>
<PackageCertificateThumbprint>E888C12EC9A02B902D03CDA4515BDBE9F5E71F1F</PackageCertificateThumbprint>
<PackageCertificateKeyFile>FoxTube_StoreKey.pfx</PackageCertificateKeyFile>
<PackageCertificateThumbprint>50B93E6A246058D555BA65CD203D7A02064A7409</PackageCertificateThumbprint>
<GenerateAppInstallerFile>False</GenerateAppInstallerFile>
<AppxAutoIncrementPackageRevision>False</AppxAutoIncrementPackageRevision>
<AppxPackageDir>C:\Users\Michael Gordeev\Downloads\FoxTube dists\0.2.1901-1\</AppxPackageDir>
<AppxAutoIncrementPackageRevision>True</AppxAutoIncrementPackageRevision>
<AppxPackageDir>D:\XFox\Documents\FoxTube builds\0.3\</AppxPackageDir>
<AppxBundle>Always</AppxBundle>
<AppxBundlePlatforms>x86|x64|arm</AppxBundlePlatforms>
<AppInstallerUpdateFrequency>1</AppInstallerUpdateFrequency>
@@ -137,6 +136,9 @@
<Compile Include="Controls\ShowMore.xaml.cs">
<DependentUpon>ShowMore.xaml</DependentUpon>
</Compile>
<Compile Include="Pages\Browser.xaml.cs">
<DependentUpon>Browser.xaml</DependentUpon>
</Compile>
<Compile Include="Pages\ChannelPage.xaml.cs">
<DependentUpon>ChannelPage.xaml</DependentUpon>
</Compile>
@@ -201,6 +203,11 @@
</ItemGroup>
<ItemGroup>
<Content Include="Assets\AnnouncementThumb.png" />
<Content Include="Assets\BadgeLogo.scale-100.png" />
<Content Include="Assets\BadgeLogo.scale-125.png" />
<Content Include="Assets\BadgeLogo.scale-150.png" />
<Content Include="Assets\BadgeLogo.scale-200.png" />
<Content Include="Assets\BadgeLogo.scale-400.png" />
<Content Include="Assets\ChannelCoverTemplate.png" />
<Content Include="Assets\Data\Patchnotes.xml" />
<Content Include="Assets\FoxGame.png" />
@@ -250,25 +257,8 @@
<Content Include="Assets\Wide310x150Logo.scale-125.png" />
<Content Include="Assets\Wide310x150Logo.scale-150.png" />
<Content Include="Assets\Wide310x150Logo.scale-400.png" />
<Content Include="Notifications\Comment.xml">
<SubType>Designer</SubType>
</Content>
<Content Include="Notifications\Download.xml">
<SubType>Designer</SubType>
</Content>
<Content Include="Notifications\DownloadComplete.xml" />
<Content Include="Notifications\downloadHistorySample.xml" />
<Content Include="Notifications\Internal.xml">
<SubType>Designer</SubType>
</Content>
<Content Include="Notifications\NotificationsHistorySample.xml" />
<Content Include="Notifications\Post.xml">
<SubType>Designer</SubType>
</Content>
<Content Include="Notifications\ServerLogSamlpe.xml" />
<Content Include="Notifications\Video.xml">
<SubType>Designer</SubType>
</Content>
<None Include="FoxTube_StoreKey.pfx" />
<None Include="Package.StoreAssociation.xml" />
<Content Include="Properties\Default.rd.xml" />
<Content Include="Assets\LockScreenLogo.scale-200.png" />
<Content Include="Assets\SplashScreen.scale-200.png" />
@@ -318,6 +308,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Pages\Browser.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Pages\ChannelPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@@ -411,7 +405,10 @@
<Version>1.29.2.1006</Version>
</PackageReference>
<PackageReference Include="Microsoft.Advertising.XAML">
<Version>10.1805.7001</Version>
<Version>10.1811.22001</Version>
</PackageReference>
<PackageReference Include="Microsoft.AppCenter.Analytics">
<Version>1.13.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform">
<Version>6.1.9</Version>
@@ -420,13 +417,13 @@
<Version>5.0.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.Toolkit.Uwp.UI.Controls">
<Version>4.0.0</Version>
<Version>5.0.0</Version>
</PackageReference>
<PackageReference Include="runtime.win10-arm64.runtime.native.System.IO.Compression">
<Version>4.3.2</Version>
</PackageReference>
<PackageReference Include="YoutubeExplode">
<Version>4.6.1</Version>
<Version>4.6.4</Version>
</PackageReference>
<PackageReference Include="YoutubeExtractor">
<Version>0.10.11</Version>
+5 -4
View File
@@ -1,10 +1,10 @@
<?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" xmlns:uap3="http://schemas.microsoft.com/appx/manifest/uap/windows10/3" IgnorableNamespaces="uap mp uap3">
<Identity Name="foxtube-5d1cba1f-d7d5-472b-acb7-beb360bab268" Publisher="CN=Michael Gordeev" Version="0.2.19012.0" />
<mp:PhoneIdentity PhoneProductId="5d1cba1f-d7d5-472b-acb7-beb360bab268" PhonePublisherId="00000000-0000-0000-0000-000000000000" />
<Identity Name="53949MichaelXFoxGordeev.FoxTube" Publisher="CN=FD7A34DD-FE4D-4D7D-9D33-2DA9EBBE7725" Version="0.3.4.0" />
<mp:PhoneIdentity PhoneProductId="04fd81c1-6473-4174-afd7-4ac71dd85721" PhonePublisherId="00000000-0000-0000-0000-000000000000" />
<Properties>
<DisplayName>FoxTube</DisplayName>
<PublisherDisplayName>Michael Gordeev</PublisherDisplayName>
<PublisherDisplayName>Michael "XFox" Gordeev</PublisherDisplayName>
<Logo>Assets\StoreLogo.png</Logo>
</Properties>
<Dependencies>
@@ -15,7 +15,7 @@
</Resources>
<Applications>
<Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="FoxTube.App" ResourceGroup="foxtube">
<uap:VisualElements DisplayName="FoxTube" Square150x150Logo="Assets\Square150x150Logo.png" Square44x44Logo="Assets\Square44x44Logo.png" Description="YouTube Client" BackgroundColor="skyBlue">
<uap:VisualElements DisplayName="FoxTube" Square150x150Logo="Assets\Square150x150Logo.png" Square44x44Logo="Assets\Square44x44Logo.png" Description="YouTube Client for Windows 10" BackgroundColor="skyBlue">
<uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png" ShortName="FoxTube" Square310x310Logo="Assets\LargeTile.png" Square71x71Logo="Assets\SmallTile.png">
<uap:ShowNameOnTiles>
<uap:ShowOn Tile="square150x150Logo" />
@@ -24,6 +24,7 @@
</uap:ShowNameOnTiles>
</uap:DefaultTile>
<uap:SplashScreen Image="Assets\SplashScreen.png" BackgroundColor="#282828" />
<uap:LockScreen Notification="badgeAndTileText" BadgeLogo="Assets\BadgeLogo.png"/>
</uap:VisualElements>
<Extensions>
<Extension Category="windows.backgroundTasks" EntryPoint="FoxTube.Background.BackgroundProcessor">
+27
View File
@@ -0,0 +1,27 @@
<Page
x:Class="FoxTube.Pages.Browser"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:FoxTube.Pages"
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)"
mc:Ignorable="d"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<AutoSuggestBox Grid.ColumnSpan="2" Text="https://youtube.com/" QueryIcon="Forward" QuerySubmitted="Adress_QuerySubmitted" Name="adress"/>
<ScrollViewer Grid.Row="1">
<TextBlock TextWrapping="Wrap" Name="code" IsTextSelectionEnabled="True"/>
</ScrollViewer>
<WebView Name="view" Grid.Row="1" Grid.Column="1"/>
</Grid>
</Page>
+60
View File
@@ -0,0 +1,60 @@
using Google.Apis.Http;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
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.Pages
{
/// <summary>
/// An empty page that can be used on its own or navigated to within a Frame.
/// </summary>
public sealed partial class Browser : Page
{
public Browser()
{
InitializeComponent();
Initialize();
}
public async void Initialize()
{
/*Debug.WriteLine(SecretsVault.Credential.Token.AccessToken);
WebClient client = new WebClient();
client.Headers.Add(HttpRequestHeader.Cookie, "SID=9wYUCqAm2D7AmC_Vi8uNGjYZAf6Js2hasI1gCEhznMjJbYqnt0J6m1sthArcXG_pMMadnQ.; HSID=AhyajPo6nPBx7VB-0; SSID=AaaOvEW6jZVcc4Asp; APISID=tXeMRBKErzlt6KOo/Aapw7Rv4U_HG1A0CQ; SAPISID=FGp4Ff7MMF8Yq0X4/AOdNjGueWyCkkK7C5; LOGIN_INFO=AFmmF2swRAIgZln6SD5aFUlABb9pBEq9uAwLBISe7sYR1NWVXyaDTY4CIBLo_KAFcoo4wtlW0ZPmJnHaa-xVhsA7MzdGm7-vvgX-:QUQ3MjNmekJTZ3M2dXJNaFh3M3NfTFVDS0RIaUM3WlJNWlRJbk5sZUE1eHR3bHkwckhQeEppazkyekhDb0ljcXpacDdwQXlIanhSbnpSWkUyZVFpdWtiT243Rzhad0N4aGZwUXJDZ1Mxd0tFTS0wVDdudk9xaFJDdTNYUWtnQlE3VXhQdVl5MjB2MGdEdl9keElDaS1yX0tmQWowS041ZWF1VU9tV0c3bTRVbWNGSHFjWHRDVTIw;");*/
HttpClient client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", "BQcUCusfz2zKN_ejHc3Xu15ahz8eEEaKouKJydqBAVKxWxcqfhht1zVux-G9bRf0KSTFBw");
/*SecretsVault.Credential.ToString();
string url = $"https://www.youtube.com/list_ajax?style=json&action_get_list=1&list=HL&hl=en";
string response = client.DownloadString(url.ToUri());
HttpClient c = new HttpClient();*/
string response = await SecretsVault.Service.HttpClient.GetStringAsync("https://www.youtube.com/list_ajax?style=xml&action_get_list=1&list=HL");
//HttpResponseMessage res = await c.GetAsync("");
Debug.WriteLine(response);
/*new Google.Apis.Oauth2.v2.Oauth2Service.Initializer();
code.Text = response;*/
}
private void Adress_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
{
Initialize();
}
}
}
+7 -7
View File
@@ -16,7 +16,7 @@
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
<Pivot SelectedIndex="0" Name="content" IsHeaderItemsCarouselEnabled="False" SelectionChanged="content_SelectionChanged">
<Pivot SelectedIndex="0" Name="content" IsHeaderItemsCarouselEnabled="False" SelectionChanged="Content_SelectionChanged">
<PivotItem x:Uid="/Channel/videos" Header="Videos">
<ScrollViewer>
<StackPanel Name="videos">
@@ -39,11 +39,11 @@
</TextBlock>
<Grid Visibility="Collapsed" Grid.Column="2" VerticalAlignment="Bottom" Margin="10" Name="subscriptionPane" Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Button x:Uid="/Cards/subscribe" Click="subscribe_Click" Name="subscribe" Width="250" Height="50" Background="Red" Foreground="White" FontSize="18" FontWeight="SemiBold" Content="Subscirbe"/>
<Button x:Uid="/Cards/subscribe" Click="Subscribe_Click" Name="subscribe" Width="250" Height="50" Background="Red" Foreground="White" FontSize="18" FontWeight="SemiBold" Content="Subscirbe"/>
</Grid>
</Grid>
<pages:VideoGrid/>
<controls:ShowMore Clicked="videoMore_Clicked"/>
<controls:ShowMore Clicked="VideoMore_Clicked"/>
</StackPanel>
</ScrollViewer>
</PivotItem>
@@ -53,7 +53,7 @@
<StackPanel Margin="10" Visibility="Visible">
<TextBlock x:Uid="/Channel/playlistTitle" FontSize="28" Text="Playlists"/>
<pages:VideoGrid/>
<controls:ShowMore Clicked="showMorePlaylists_Click"/>
<controls:ShowMore Clicked="ShowMorePlaylists_Click"/>
</StackPanel>
<local:LoadingPage Visibility="Collapsed"/>
</Grid>
@@ -104,9 +104,9 @@
</Pivot>
<CommandBar Grid.Row="1" VerticalAlignment="Bottom" Name="commandBar">
<AppBarButton x:Uid="/Channel/openWeb" Icon="Globe" Label="Open in browser" Name="inBrowser" Click="inBrowser_Click"/>
<AppBarButton x:Uid="/Channel/refresh" Icon="Refresh" Label="Refresh" Name="refresh" Click="refresh_Click"/>
<AppBarButton x:Uid="/Channel/share" Icon="Share" Label="Share" Name="share" Click="share_Click"/>
<AppBarButton x:Uid="/Channel/openWeb" Icon="Globe" Label="Open in browser" Name="inBrowser" Click="InBrowser_Click"/>
<AppBarButton x:Uid="/Channel/refresh" Icon="Refresh" Label="Refresh" Name="refresh" Click="Refresh_Click"/>
<AppBarButton x:Uid="/Channel/share" Icon="Share" Label="Share" Name="share" Click="Share_Click"/>
</CommandBar>
<local:LoadingPage Grid.RowSpan="2" Visibility="Collapsed"/>
+22 -13
View File
@@ -13,6 +13,8 @@ using Windows.ApplicationModel.DataTransfer;
using Windows.System;
using Windows.UI;
using Windows.ApplicationModel.Resources;
using Microsoft.AppCenter.Analytics;
using System.Collections.Generic;
namespace FoxTube.Pages
{
@@ -21,14 +23,14 @@ namespace FoxTube.Pages
/// </summary>
public sealed partial class ChannelPage : Page
{
ResourceLoader resources = ResourceLoader.GetForCurrentView("Cards");
readonly ResourceLoader resources = ResourceLoader.GetForCurrentView("Cards");
public string channelId;
public Channel item;
LoadingPage loading, playlistLoading;
VideoGrid videoList, playlistList;
ShowMore videoMore, playlistMore;
readonly LoadingPage loading, playlistLoading;
readonly VideoGrid videoList, playlistList;
readonly ShowMore videoMore, playlistMore;
SearchResource.ListRequest videoRequest, playlistRequest;
@@ -48,7 +50,7 @@ namespace FoxTube.Pages
videoMore = videos.Children[3] as ShowMore;
playlistMore = (playlists.Children[0] as StackPanel).Children[2] as ShowMore;
loading.RefreshPage += refresh_Click;
loading.RefreshPage += Refresh_Click;
DataTransferManager.GetForCurrentView().DataRequested += new TypedEventHandler<DataTransferManager, DataRequestedEventArgs>(Share);
}
@@ -71,7 +73,7 @@ namespace FoxTube.Pages
{
channelId = id;
if (Methods.NeedToResponse)
Methods.MainPage.content_Navigated(this, null);
Methods.MainPage.Content_Navigated(this, null);
ChannelsResource.ListRequest request = SecretsVault.Service.Channels.List("snippet,statistics,brandingSettings");
request.Id = id;
@@ -138,6 +140,12 @@ namespace FoxTube.Pages
catch (Exception e)
{
loading.Error(e.GetType().ToString(), e.Message);
Analytics.TrackEvent("Channel loading error", new Dictionary<string, string>()
{
{ "Exception", e.GetType().ToString() },
{ "Message", e.Message },
{ "Channel ID", channelId }
});
}
}
@@ -167,6 +175,7 @@ namespace FoxTube.Pages
else
playlistMore.Visibility = Visibility.Collapsed;
playlistLoaded = true;
playlistLoading.Close();
}
catch (System.Net.Http.HttpRequestException)
@@ -179,13 +188,13 @@ namespace FoxTube.Pages
}
}
private void content_SelectionChanged(object sender, SelectionChangedEventArgs e)
private void Content_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (content.SelectedIndex == 1 && !playlistLoaded)
LoadPlaylist();
}
private async void showMorePlaylists_Click()
private async void ShowMorePlaylists_Click()
{
playlistRequest.PageToken = playlistToken;
SearchListResponse response = await playlistRequest.ExecuteAsync();
@@ -205,7 +214,7 @@ namespace FoxTube.Pages
playlistMore.Complete(true);
}
private async void videoMore_Clicked()
private async void VideoMore_Clicked()
{
videoRequest.PageToken = videoToken;
SearchListResponse response = await videoRequest.ExecuteAsync();
@@ -225,7 +234,7 @@ namespace FoxTube.Pages
videoMore.Complete(true);
}
private async void subscribe_Click(object sender, RoutedEventArgs e)
private async void Subscribe_Click(object sender, RoutedEventArgs e)
{
if(await SecretsVault.ChangeSubscriptionState(channelId))
{
@@ -265,12 +274,12 @@ namespace FoxTube.Pages
}
}
private void refresh_Click(object sender, RoutedEventArgs e)
private void Refresh_Click(object sender, RoutedEventArgs e)
{
Methods.MainPage.GoToChannel(channelId);
}
private async void inBrowser_Click(object sender, RoutedEventArgs e)
private async void InBrowser_Click(object sender, RoutedEventArgs e)
{
if (!string.IsNullOrWhiteSpace(item.Snippet.CustomUrl))
await Launcher.LaunchUriAsync(new Uri($"https://www.youtube.com/user/{item.Snippet.CustomUrl}"));
@@ -278,7 +287,7 @@ namespace FoxTube.Pages
await Launcher.LaunchUriAsync(new Uri($"https://www.youtube.com/channel/{item.Id}"));
}
private void share_Click(object sender, RoutedEventArgs e)
private void Share_Click(object sender, RoutedEventArgs e)
{
DataTransferManager.ShowShareUI();
}
-2
View File
@@ -2,10 +2,8 @@
x:Class="FoxTube.Pages.Downloads"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:FoxTube.Pages"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:controls="using:FoxTube.Controls"
mc:Ignorable="d"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
+2 -13
View File
@@ -1,24 +1,13 @@
using FoxTube.Controls;
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.Storage;
using Windows.Storage.Pickers;
using System;
using Windows.System;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Navigation;
// The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238
namespace FoxTube.Pages
{
/// <summary>
/// An empty page that can be used on its own or navigated to within a Frame.
/// Downloads page
/// </summary>
public sealed partial class Downloads : Page
{
-1
View File
@@ -6,7 +6,6 @@
xmlns:local="using:FoxTube.Pages"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:controls="using:FoxTube.Controls"
xmlns:foxtube="using:FoxTube"
mc:Ignorable="d"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
+2 -5
View File
@@ -1,16 +1,13 @@
using FoxTube.Controls;
using System;
using System;
using Windows.System;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Navigation;
// The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238
namespace FoxTube.Pages
{
/// <summary>
/// An empty page that can be used on its own or navigated to within a Frame.
/// YouTube history page
/// </summary>
public sealed partial class History : Page
{
+3 -5
View File
@@ -1,14 +1,11 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Google.Apis.YouTube.v3;
using Google.Apis.YouTube.v3.Data;
using Windows.Storage;
using FoxTube.Controls;
using FoxTube.Pages;
using System.Globalization;
namespace FoxTube
{
@@ -17,6 +14,7 @@ namespace FoxTube
/// </summary>
public sealed partial class Home : Page
{
// TODO: Refactor home page
private bool trendLoaded = false;
VideoGrid trendGrid;
@@ -75,9 +73,9 @@ namespace FoxTube
public void Initialize()
{
if(SecretsVault.IsAuthorized)
/*if(SecretsVault.IsAuthorized)
LoadRecommendations();
else
else*/
{
pivot.Items.Remove(recommended);
pivot.Items.Remove(subscriptions);
+11 -10
View File
@@ -10,7 +10,7 @@
PreviewKeyUp="Page_PreviewKeyUp">
<Grid Name="grid" Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<NavigationView Header="Home" SelectedItem="toHome" Windows10version1803:BackRequested="nav_BackRequested" Windows10version1803:PaneTitle="FoxTube" OpenPaneLength="300" Name="nav" SelectionChanged="nav_SelectionChanged">
<NavigationView Header="Home" SelectedItem="toHome" Windows10version1803:BackRequested="Nav_BackRequested" Windows10version1803:PaneTitle="FoxTube" OpenPaneLength="300" Name="nav" SelectionChanged="Nav_SelectionChanged">
<NavigationView.MenuItems>
<NavigationViewItem x:Uid="/Main/home" Icon="Home" Content="Home" Name="toHome"/>
@@ -30,7 +30,8 @@
<NavigationView.PaneFooter>
<NavigationViewList>
<NavigationViewItem x:Uid="/Main/feedback" Name="feedback" Content="Give a feedback" Tapped="feedback_Click">
<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">
<NavigationViewItem.Icon>
<FontIcon Glyph="&#xED15;"/>
</NavigationViewItem.Icon>
@@ -42,7 +43,7 @@
</NavigationViewItem.Icon>
</NavigationViewItem>
<NavigationViewItem Name="account" Tapped="openContext">
<NavigationViewItem Name="account" Tapped="OpenContext">
<StackPanel Orientation="Horizontal">
<FontIcon Glyph="&#xE8FA;" FontSize="16" Margin="0,0,16,0"/>
<TextBlock x:Uid="/Main/signIn" Text="Add account"/>
@@ -50,13 +51,13 @@
<NavigationViewItem.ContextFlyout>
<MenuFlyout>
<MenuFlyoutItem x:Uid="/Main/signEx" Text="Sign in with existing account" Name="signIn" Click="signIn_Click"/>
<MenuFlyoutItem x:Uid="/Main/signNew" Text="Create new Google account" Name="createAccount" Click="createAccount_Click"/>
<MenuFlyoutItem x:Uid="/Main/signEx" Text="Sign in with existing account" Name="signIn" Click="SignIn_Click"/>
<MenuFlyoutItem x:Uid="/Main/signNew" Text="Create new Google account" Name="createAccount" Click="CreateAccount_Click"/>
</MenuFlyout>
</NavigationViewItem.ContextFlyout>
</NavigationViewItem>
<NavigationViewItem Visibility="Collapsed" Name="avatar" Tapped="openContext" Padding="-5">
<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"/>
@@ -64,9 +65,9 @@
<NavigationViewItem.ContextFlyout>
<MenuFlyout>
<MenuFlyoutItem x:Uid="/Main/myChannelContext" Text="My channel" Name="myChannel" Click="myChannel_Click"/>
<MenuFlyoutItem x:Uid="/Main/myChannelContext" Text="My channel" Name="myChannel" Click="MyChannel_Click"/>
<MenuFlyoutSeparator/>
<MenuFlyoutItem x:Uid="/Main/signOut" Text="Log out" Name="logout" Click="logout_Click"/>
<MenuFlyoutItem x:Uid="/Main/signOut" Text="Log out" Name="logout" Click="Logout_Click"/>
</MenuFlyout>
</NavigationViewItem.ContextFlyout>
</NavigationViewItem>
@@ -74,11 +75,11 @@
</NavigationView.PaneFooter>
<NavigationView.AutoSuggestBox>
<AutoSuggestBox x:Name="search" QueryIcon="Find" QuerySubmitted="search_QuerySubmitted" TextChanged="search_TextChanged" x:Uid="/Main/searchPlaceholder" PlaceholderText="Search"/>
<AutoSuggestBox x:Name="search" QueryIcon="Find" QuerySubmitted="Search_QuerySubmitted" TextChanged="Search_TextChanged" x:Uid="/Main/searchPlaceholder" PlaceholderText="Search"/>
</NavigationView.AutoSuggestBox>
<Grid>
<Frame Name="content" Navigated="content_Navigated"/>
<Frame Name="content" Navigated="Content_Navigated"/>
<Frame Name="videoPlaceholder"/>
</Grid>
+22 -16
View File
@@ -34,8 +34,9 @@ namespace FoxTube
/// </summary>
public sealed partial class MainPage : Page
{
// TODO: Refactor main page
Sender s = Sender.None;
ResourceLoader resources = ResourceLoader.GetForCurrentView("Main");
readonly ResourceLoader resources = ResourceLoader.GetForCurrentView("Main");
public MainPage()
{
InitializeComponent();
@@ -185,9 +186,9 @@ namespace FoxTube
toChannel.Visibility = Visibility.Visible;
toSubscriptions.Visibility = Visibility.Visible;
libHeader.Visibility = Visibility.Visible;
toHistory.Visibility = Visibility.Visible;
//toHistory.Visibility = Visibility.Visible;
toLiked.Visibility = Visibility.Visible;
toLater.Visibility = Visibility.Visible;
//toLater.Visibility = Visibility.Visible;
if (SecretsVault.Subscriptions.Count > 0)
{
@@ -229,9 +230,9 @@ namespace FoxTube
toChannel.Visibility = Visibility.Collapsed;
toSubscriptions.Visibility = Visibility.Collapsed;
libHeader.Visibility = Visibility.Collapsed;
toHistory.Visibility = Visibility.Collapsed;
//toHistory.Visibility = Visibility.Collapsed;
toLiked.Visibility = Visibility.Collapsed;
toLater.Visibility = Visibility.Collapsed;
//toLater.Visibility = Visibility.Collapsed;
subsHeader.Visibility = Visibility.Collapsed;
subsHeader.Visibility = Visibility.Collapsed;
@@ -264,27 +265,27 @@ namespace FoxTube
GoToVideo((videoPlaceholder.Content as VideoPage).videoId);
}
private async void feedback_Click(object sender, TappedRoutedEventArgs e)
private async void Feedback_Click(object sender, TappedRoutedEventArgs e)
{
await Launcher.LaunchUriAsync(new Uri("feedback-hub:"));
}
private async void createAccount_Click(object sender, RoutedEventArgs e)
private async void CreateAccount_Click(object sender, RoutedEventArgs e)
{
await Launcher.LaunchUriAsync(new Uri("https://accounts.google.com/signup/v2/webcreateaccount?ManageAccount&flowName=GlifWebSignIn&flowEntry=SignUp"));
}
private void signIn_Click(object sender, RoutedEventArgs e)
private void SignIn_Click(object sender, RoutedEventArgs e)
{
SecretsVault.Authorize();
}
private void myChannel_Click(object sender, RoutedEventArgs e)
private void MyChannel_Click(object sender, RoutedEventArgs e)
{
GoToChannel(SecretsVault.AccountId);
}
private void logout_Click(object sender, RoutedEventArgs e)
private void Logout_Click(object sender, RoutedEventArgs e)
{
SecretsVault.Deauthenticate();
}
@@ -512,13 +513,13 @@ namespace FoxTube
nav.IsBackEnabled = false;
}
private void search_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
private void Search_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
{
if(!string.IsNullOrWhiteSpace(search.Text))
GoToSearch(new SearchParameters(search.Text));
}
private void search_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args)
private void Search_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args)
{
if (search.Text.Length > 2 && args.Reason == AutoSuggestionBoxTextChangeReason.UserInput)
{
@@ -541,7 +542,7 @@ namespace FoxTube
}
}
private void nav_SelectionChanged(NavigationView sender, NavigationViewSelectionChangedEventArgs args)
private void Nav_SelectionChanged(NavigationView sender, NavigationViewSelectionChangedEventArgs args)
{
Debug.WriteLine("Menu selection changed");
try
@@ -577,7 +578,7 @@ namespace FoxTube
catch { }
}
public void content_Navigated(object sender, NavigationEventArgs e)
public void Content_Navigated(object sender, NavigationEventArgs e)
{
Dictionary<Type, Action> switchCase = new Dictionary<Type, Action>()
{
@@ -735,7 +736,7 @@ namespace FoxTube
MinimizeAsInitializer();
}
private void nav_BackRequested(NavigationView sender, NavigationViewBackRequestedEventArgs args)
private void Nav_BackRequested(NavigationView sender, NavigationViewBackRequestedEventArgs args)
{
if (videoPlaceholder.Content != null)
{
@@ -757,7 +758,7 @@ namespace FoxTube
}
}
private void openContext(object sender, TappedRoutedEventArgs e)
private void OpenContext(object sender, TappedRoutedEventArgs e)
{
((NavigationViewItem)sender).ContextFlyout.ShowAt((NavigationViewItem)sender);
}
@@ -766,5 +767,10 @@ namespace FoxTube
{
SecretsVault.GetAdblock();
}
private void Web_Tapped(object sender, TappedRoutedEventArgs e)
{
content.Navigate(typeof(Browser));
}
}
}
+1 -2
View File
@@ -7,7 +7,6 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:foxtube="using:FoxTube"
xmlns:ui="using:Microsoft.Advertising.WinRT.UI"
mc:Ignorable="d"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
@@ -64,7 +63,7 @@
<CommandBar Grid.Row="2" Grid.ColumnSpan="2">
<AppBarButton x:Uid="/Playlist/openWeb" Icon="Globe" Label="Open in browser" Name="inBrowser" Click="inBrowser_Click"/>
<AppBarButton x:Uid="/Playlist/addTo" Icon="Add" Label="Add to" IsEnabled="False">
<AppBarButton x:Uid="/Playlist/addTo" Icon="Add" Label="Add to" IsEnabled="False" Visibility="Collapsed">
<AppBarButton.Flyout>
<MenuFlyout>
+11 -3
View File
@@ -1,7 +1,9 @@
using FoxTube.Controls;
using Google.Apis.YouTube.v3;
using Google.Apis.YouTube.v3.Data;
using Microsoft.AppCenter.Analytics;
using System;
using System.Collections.Generic;
using Windows.ApplicationModel.DataTransfer;
using Windows.ApplicationModel.Resources;
using Windows.Foundation;
@@ -50,7 +52,7 @@ namespace FoxTube.Pages
{
playlistId = id;
if (Methods.NeedToResponse)
Methods.MainPage.content_Navigated(this, null);
Methods.MainPage.Content_Navigated(this, null);
PlaylistsResource.ListRequest request = SecretsVault.Service.Playlists.List("snippet,contentDetails");
request.Id = id;
@@ -98,9 +100,15 @@ namespace FoxTube.Pages
{
loading.Error("System.Net.Http.HttpRequestException", "Unable to connect to Google servers.", true);
}
catch
catch (Exception e)
{
loading.Error();
loading.Error(e.GetType().ToString(), e.Message);
Analytics.TrackEvent("Playlist loading error", new Dictionary<string, string>()
{
{ "Exception", e.GetType().ToString() },
{ "Message", e.Message },
{ "Playlist ID", playlistId }
});
}
}
+5 -5
View File
@@ -19,7 +19,7 @@
<TextBlock Name="searchTerm" Text="Search results for: [searchTerm]" FontSize="28"/>
<TextBlock Name="resultsCount" Text="Found: [resultCount] item(s)" FontSize="14" Foreground="Gray"/>
<HyperlinkButton x:Uid="/Search/filters" Name="toggleFilters" Click="toggleFilters_Click" Content="Show filters &#xE71C;" FontFamily="Default, Segoe MDL2 Assets" Visibility="Visible"/>
<HyperlinkButton x:Uid="/Search/filters" Name="toggleFilters" Click="ToggleFilters_Click" Content="Show filters &#xE71C;" FontFamily="Default, Segoe MDL2 Assets" Visibility="Visible"/>
<StackPanel Name="filters" Visibility="Collapsed">
<GridView Padding="5" SelectionMode="None">
<ComboBox x:Uid="/Search/order" Name="order" Header="Sort by" Width="150" SelectedIndex="0">
@@ -29,7 +29,7 @@
<ComboBoxItem x:Uid="/Search/rating" Content="Rating"/>
<ComboBoxItem x:Uid="/Search/title" Content="Title"/>
</ComboBox>
<ComboBox x:Uid="/Search/type" Name="type" Header="Type" Width="150" SelectedIndex="0" SelectionChanged="type_SelectionChanged">
<ComboBox x:Uid="/Search/type" Name="type" Header="Type" Width="150" SelectedIndex="0" SelectionChanged="Type_SelectionChanged">
<ComboBoxItem x:Uid="/Search/all" Content="All"/>
<ComboBoxItem x:Uid="/Search/video" Content="Video"/>
<ComboBoxItem x:Uid="/Search/channel" Content="Channel"/>
@@ -64,16 +64,16 @@
</Flyout>
</Button.Flyout>
</Button>
<Button x:Uid="/Search/apply" Content="Apply" Margin="10,0,0,10" Name="apply" Click="apply_Click"/>
<Button x:Uid="/Search/apply" Content="Apply" Margin="10,0,0,10" Name="apply" Click="Apply_Click"/>
</StackPanel>
</StackPanel>
<pages:VideoGrid/>
<controls:ShowMore Clicked="more_Clicked"/>
<controls:ShowMore Clicked="More_Clicked"/>
</StackPanel>
</ScrollViewer>
<CommandBar Grid.Row="1" DefaultLabelPosition="Right">
<AppBarButton Label="Open in browser" Icon="Globe" Name="inBrowser" Click="inBrowser_Click"/>
<AppBarButton Label="Open in browser" Icon="Globe" Name="inBrowser" Click="InBrowser_Click"/>
<AppBarButton Label="Refresh" Icon="Refresh" Click="AppBarButton_Click"/>
</CommandBar>
+9 -11
View File
@@ -3,7 +3,6 @@ using FoxTube.Pages;
using Google.Apis.YouTube.v3;
using Google.Apis.YouTube.v3.Data;
using System;
using Windows.Storage;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Navigation;
@@ -17,16 +16,15 @@ namespace FoxTube
/// </summary>
public sealed partial class Search : Page
{
ResourceLoader resources = ResourceLoader.GetForCurrentView("Search");
readonly ResourceLoader resources = ResourceLoader.GetForCurrentView("Search");
public SearchParameters Parameters;
SearchResource.ListRequest request;
string nextToken;
ApplicationDataContainer settings = ApplicationData.Current.LocalSettings;
VideoGrid list;
LoadingPage loading;
ShowMore more;
readonly VideoGrid list;
readonly LoadingPage loading;
readonly ShowMore more;
public Search()
{
@@ -155,7 +153,7 @@ namespace FoxTube
}
}
private void toggleFilters_Click(object sender, RoutedEventArgs e)
private void ToggleFilters_Click(object sender, RoutedEventArgs e)
{
if(filters.Visibility == Visibility.Collapsed)
{
@@ -174,7 +172,7 @@ namespace FoxTube
Methods.MainPage.GoToSearch(Parameters);
}
private async void more_Clicked()
private async void More_Clicked()
{
request.PageToken = nextToken;
SearchListResponse response = await request.ExecuteAsync();
@@ -190,7 +188,7 @@ namespace FoxTube
more.Complete(true);
}
private void type_SelectionChanged(object sender, SelectionChangedEventArgs e)
private void Type_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
try
{
@@ -210,12 +208,12 @@ namespace FoxTube
catch (NullReferenceException) { }
}
private async void inBrowser_Click(object sender, RoutedEventArgs e)
private async void InBrowser_Click(object sender, RoutedEventArgs e)
{
await Launcher.LaunchUriAsync(new Uri($"https://www.youtube.com/results?search_query={searchTerm}"));
}
private void apply_Click(object sender, RoutedEventArgs e)
private void Apply_Click(object sender, RoutedEventArgs e)
{
Parameters.Filter.HD = features.SelectedItems.Contains(features.Items[0]);
Parameters.Filter.Is3D = features.SelectedItems.Contains(features.Items[1]);
+1 -8
View File
@@ -2,15 +2,13 @@
x:Class="FoxTube.Settings"
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"
xmlns:pages="using:FoxTube.Pages"
xmlns:settingspages="using:FoxTube.Pages.SettingsPages"
mc:Ignorable="d">
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Pivot SelectedIndex="0" Name="pivot" IsHeaderItemsCarouselEnabled="False" SelectionChanged="pivot_SelectionChanged">
<Pivot SelectedIndex="0" Name="pivot" IsHeaderItemsCarouselEnabled="False" SelectionChanged="Pivot_SelectionChanged">
<PivotItem Header="General" x:Uid="/Settings/general">
<ScrollViewer>
<settingspages:General/>
@@ -21,11 +19,6 @@
<settingspages:About/>
</ScrollViewer>
</PivotItem>
<!--<PivotItem Header="Help us translate this app" x:Uid="/Settings/helpTranslate">
<ScrollViewer>
<settingspages:Translate/>
</ScrollViewer>
</PivotItem>-->
<PivotItem Header="Inbox" x:Uid="/Settings/inbox">
<ScrollViewer>
<settingspages:Inbox/>
+5 -31
View File
@@ -1,29 +1,11 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.ApplicationModel;
using System.Globalization;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.Storage;
using Windows.UI.Text;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Navigation;
using FoxTube.Pages.SettingsPages;
// 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.
/// Settings tabs placeholder
/// </summary>
public sealed partial class Settings : Page
{
@@ -31,7 +13,7 @@ namespace FoxTube
string inboxId = null;
public Settings()
{
this.InitializeComponent();
InitializeComponent();
}
protected override void OnNavigatedTo(NavigationEventArgs e)
@@ -45,20 +27,12 @@ namespace FoxTube
inboxId = e.Parameter as string;
pivot.SelectedIndex = 2;
}
else
switch(e.Parameter as string)
{
case "about":
else if ((e.Parameter as string) == "about")
pivot.SelectedIndex = 1;
break;
/*case "translate":
pivot.SelectedIndex = 3;
break;*/
}
}
}
private void pivot_SelectionChanged(object sender, SelectionChangedEventArgs e)
private void Pivot_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (pivot.SelectedIndex == 2 && !inboxLoaded)
{
+1 -2
View File
@@ -2,7 +2,6 @@
x:Class="FoxTube.Pages.SettingsPages.About"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:FoxTube.Pages.SettingsPages"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
@@ -39,7 +38,7 @@
<TextBlock x:Uid="/About/contacts" Text="Contacts" FontSize="22" FontWeight="SemiBold"/>
<TextBlock><Run x:Uid="/About/twitter">Twitter:</Run> <Hyperlink NavigateUri="https://twitter.com/XFox_Mike">@XFox_Mike</Hyperlink></TextBlock>
<TextBlock><Run x:Uid="/About/vk">Vkontakte:</Run> <Hyperlink NavigateUri="https://vk.com/XFox.Mike">@XFox.Mike</Hyperlink></TextBlock>
<TextBlock>YouTube: <Hyperlink NavigateUri="https://youtube.com/c/FoxGameStudioChannel">@FoxGameStudioChannel</Hyperlink></TextBlock>
<TextBlock Visibility="Collapsed">YouTube: <Hyperlink NavigateUri="https://youtube.com/c/FoxGameStudioChannel">@FoxGameStudioChannel</Hyperlink></TextBlock>
<TextBlock>E-mail: <Hyperlink NavigateUri="mailto:michael.xfox@outlook.com">michael.xfox@outlook.com</Hyperlink></TextBlock>
<TextBlock Visibility="Collapsed" Margin="0,0,0,10"> <Run x:Uid="/About/myBlog">My blog (Russian language only):</Run> <Hyperlink NavigateUri="https://michael-xfox.com">https://michael-xfox.com</Hyperlink></TextBlock>
+1 -14
View File
@@ -1,25 +1,12 @@
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.Pages.SettingsPages
{
/// <summary>
/// An empty page that can be used on its own or navigated to within a Frame.
/// Page with general information about the app
/// </summary>
public sealed partial class About : Page
{
-1
View File
@@ -2,7 +2,6 @@
x:Class="FoxTube.Pages.SettingsPages.General"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:FoxTube.Pages.SettingsPages"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
+1 -2
View File
@@ -2,7 +2,6 @@
x:Class="FoxTube.Pages.SettingsPages.Inbox"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:FoxTube.Pages"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls"
@@ -101,7 +100,7 @@
<Grid Grid.Column="1" Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" Name="block">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
<TextBlock FontFamily="Segoe MDL2 Assets" Text="&#xE7EA;" FontSize="70" Foreground="Gray" Margin="10"/>
<TextBlock x:Uid="/Inbox/select" Text="Select item from list" FontSize="30" VerticalAlignment="Center" Foreground="Gray"/>
<TextBlock x:Uid="/Inbox/select" Text="Select item from list" FontSize="30" VerticalAlignment="Center" TextWrapping="WrapWholeWords" Foreground="Gray"/>
</StackPanel>
</Grid>
</Grid>
-1
View File
@@ -2,7 +2,6 @@
x:Class="FoxTube.Pages.Subscriptions"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:FoxTube.Pages"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:foxtube="using:FoxTube"
+3 -16
View File
@@ -1,32 +1,19 @@
using Google.Apis.YouTube.v3.Data;
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.Pages
{
/// <summary>
/// An empty page that can be used on its own or navigated to within a Frame.
/// User's subscriptions page
/// </summary>
public sealed partial class Subscriptions : Page
{
List<Subscription> list = SecretsVault.Subscriptions;
readonly List<Subscription> list = SecretsVault.Subscriptions;
public Subscriptions()
{
this.InitializeComponent();
InitializeComponent();
}
private void Button_Click(object sender, RoutedEventArgs e)
-1
View File
@@ -2,7 +2,6 @@
x:Class="FoxTube.Pages.VideoGrid"
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"
xmlns:ui="using:Microsoft.Toolkit.Uwp.UI.Controls"
+1 -3
View File
@@ -1,7 +1,5 @@
using FoxTube.Controls.Adverts;
using Windows.UI.Xaml;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Navigation;
namespace FoxTube.Pages
{
+1 -1
View File
@@ -86,7 +86,7 @@
<MenuFlyout x:Name="downloadSelector"/>
</AppBarButton.Flyout>
</AppBarButton>
<AppBarButton x:Uid="/VideoPage/addTo" Name="addTo" Label="Add to" Icon="Add">
<AppBarButton x:Uid="/VideoPage/addTo" Name="addTo" Label="Add to" Icon="Add" Visibility="Collapsed">
<AppBarButton.Flyout>
<Flyout>
<ScrollViewer Margin="-12" MaxHeight="300">
+7 -2
View File
@@ -1,7 +1,7 @@
using FoxTube.Controls;
using FoxTube.Controls.Adverts;
using Google.Apis.YouTube.v3;
using Google.Apis.YouTube.v3.Data;
using Microsoft.AppCenter.Analytics;
using System;
using System.Collections.Generic;
using System.Diagnostics;
@@ -10,7 +10,6 @@ using System.Linq;
using Windows.ApplicationModel.DataTransfer;
using Windows.ApplicationModel.Resources;
using Windows.Foundation;
using Windows.Storage;
using Windows.System;
using Windows.UI;
using Windows.UI.Xaml;
@@ -139,6 +138,12 @@ namespace FoxTube.Pages
catch (Exception e)
{
loading.Error(e.GetType().ToString(), e.Message);
Analytics.TrackEvent("Video loading error", new Dictionary<string, string>()
{
{ "Exception", e.GetType().ToString() },
{ "Message", e.Message },
{ "Video ID", videoId }
});
}
}