Archived
1
0

bug fixes

This commit is contained in:
Michael Gordeev
2018-08-24 23:30:50 +03:00
parent 4639b9c77b
commit 94d59f1dba
9 changed files with 59 additions and 31 deletions
+1
View File
@@ -144,6 +144,7 @@ namespace FoxTube.Controls
request.ParentId = item.Id; request.ParentId = item.Id;
request.MaxResults = 10; request.MaxResults = 10;
request.PageToken = NextPageToken; request.PageToken = NextPageToken;
request.TextFormat = CommentsResource.ListRequest.TextFormatEnum.PlainText;
var response = await request.ExecuteAsync(); var response = await request.ExecuteAsync();
foreach (Comment c in response.Items) foreach (Comment c in response.Items)
+1 -1
View File
@@ -46,7 +46,7 @@ namespace FoxTube.Controls
title.Text = item.Snippet.Title; title.Text = item.Snippet.Title;
channelName.Text = item.Snippet.ChannelTitle; channelName.Text = item.Snippet.ChannelTitle;
counter.Text = item.ContentDetails.ItemCount.ToString(); counter.Text = item.ContentDetails.ItemCount.ToString();
date.Text = item.Snippet.PublishedAt.ToString(); date.Text = Methods.GetAgo(item.Snippet.PublishedAt.Value);
ChannelsResource.ListRequest r = SecretsVault.NoAuthService.Channels.List("snippet"); ChannelsResource.ListRequest r = SecretsVault.NoAuthService.Channels.List("snippet");
r.Id = item.Snippet.ChannelId; r.Id = item.Snippet.ChannelId;
+3 -2
View File
@@ -9,13 +9,12 @@
mc:Ignorable="d" mc:Ignorable="d"
d:DesignHeight="1080" d:DesignHeight="1080"
d:DesignWidth="1920" d:DesignWidth="1920"
Tapped="UserControl_Tapped"
DoubleTapped="UserControl_DoubleTapped" DoubleTapped="UserControl_DoubleTapped"
PointerMoved="UserControl_PointerMoved" PointerMoved="UserControl_PointerMoved"
PointerExited="UserControl_PointerExited" PointerExited="UserControl_PointerExited"
PointerEntered="UserControl_PointerEntered"> PointerEntered="UserControl_PointerEntered">
<Grid Background="White" Name="grid"> <Grid Background="White" Name="grid" Tapped="UserControl_Tapped">
<MediaElement IsDoubleTapEnabled="False" CurrentStateChanged="videoSource_CurrentStateChanged" AutoPlay="False" Name="videoSource" AreTransportControlsEnabled="False" PosterSource="ms-appx:///Assets/videoThumbSample.png"/> <MediaElement IsDoubleTapEnabled="False" CurrentStateChanged="videoSource_CurrentStateChanged" AutoPlay="False" Name="videoSource" AreTransportControlsEnabled="False" PosterSource="ms-appx:///Assets/videoThumbSample.png"/>
<TextBox Name="subtitleCapture" Visibility="Collapsed" Text="This is subtitle capture" Background="#99000000" VerticalAlignment="Bottom" HorizontalAlignment="Center" Foreground="White" FontSize="24" Padding="10" Margin="0,0,0,100"/> <TextBox Name="subtitleCapture" Visibility="Collapsed" Text="This is subtitle capture" Background="#99000000" VerticalAlignment="Bottom" HorizontalAlignment="Center" Foreground="White" FontSize="24" Padding="10" Margin="0,0,0,100"/>
<Grid Name="controls" Visibility="Visible"> <Grid Name="controls" Visibility="Visible">
@@ -42,6 +41,8 @@
</StackPanel> </StackPanel>
</Grid> </Grid>
<Grid Grid.Row="1" Name="playPauseArea" Tapped="playPauseArea_Tapped"/>
<Grid Name="touchCentral" Background="#7F000000" Visibility="Collapsed" Grid.Row="1"> <Grid Name="touchCentral" Background="#7F000000" Visibility="Collapsed" Grid.Row="1">
<StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center"> <StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
<Button VerticalAlignment="Center" Content="&#xED3C;" FontFamily="Segoe MDL2 Assets" Background="Transparent" FontSize="40" Foreground="WhiteSmoke" Name="touchBack10" Click="back10_Click"/> <Button VerticalAlignment="Center" Content="&#xED3C;" FontFamily="Segoe MDL2 Assets" Background="Transparent" FontSize="40" Foreground="WhiteSmoke" Name="touchBack10" Click="back10_Click"/>
+5
View File
@@ -794,5 +794,10 @@ namespace FoxTube
else if (!miniView && !fullScreen) else if (!miniView && !fullScreen)
fullscreen_Click(this, null); fullscreen_Click(this, null);
} }
private void playPauseArea_Tapped(object sender, TappedRoutedEventArgs e)
{
if (e.PointerDeviceType == Windows.Devices.Input.PointerDeviceType.Mouse) ;
}
} }
} }
-1
View File
@@ -160,7 +160,6 @@ namespace FoxTube.Pages
playlistRequest = SecretsVault.Service.Search.List("id"); playlistRequest = SecretsVault.Service.Search.List("id");
playlistRequest.ChannelId = channelId; playlistRequest.ChannelId = channelId;
playlistRequest.Type = "playlist"; playlistRequest.Type = "playlist";
playlistRequest.Order = SearchResource.ListRequest.OrderEnum.Date;
playlistRequest.MaxResults = 48; playlistRequest.MaxResults = 48;
SearchListResponse response = await playlistRequest.ExecuteAsync(); SearchListResponse response = await playlistRequest.ExecuteAsync();
+1
View File
@@ -127,6 +127,7 @@ namespace FoxTube.Pages
var request = SecretsVault.Service.CommentThreads.List("snippet,replies"); var request = SecretsVault.Service.CommentThreads.List("snippet,replies");
request.Order = order; request.Order = order;
request.VideoId = threadId; request.VideoId = threadId;
request.TextFormat = CommentThreadsResource.ListRequest.TextFormatEnum.PlainText;
var response = await request.ExecuteAsync(); var response = await request.ExecuteAsync();
nextPageToken = response.NextPageToken; nextPageToken = response.NextPageToken;
+11
View File
@@ -17,12 +17,15 @@ using Windows.UI.Xaml.Navigation;
namespace FoxTube namespace FoxTube
{ {
public enum LoadingState { Loadnig, Loaded, Error, Blocked }
/// <summary> /// <summary>
/// An empty page that can be used on its own or navigated to within a Frame. /// An empty page that can be used on its own or navigated to within a Frame.
/// </summary> /// </summary>
public sealed partial class LoadingPage : Page public sealed partial class LoadingPage : Page
{ {
public event RoutedEventHandler RefreshPage; public event RoutedEventHandler RefreshPage;
public LoadingState State { get; private set; } = LoadingState.Loadnig;
public LoadingPage() public LoadingPage()
{ {
@@ -50,6 +53,8 @@ namespace FoxTube
trouble.Visibility = Visibility.Visible; trouble.Visibility = Visibility.Visible;
} }
State = LoadingState.Error;
} }
public void Block() public void Block()
@@ -60,6 +65,8 @@ namespace FoxTube
wifiTrouble.Visibility = Visibility.Collapsed; wifiTrouble.Visibility = Visibility.Collapsed;
blockIcon.Visibility = Visibility.Visible; blockIcon.Visibility = Visibility.Visible;
State = LoadingState.Blocked;
} }
private async void openWifi_Click(object sender, RoutedEventArgs e) private async void openWifi_Click(object sender, RoutedEventArgs e)
@@ -90,11 +97,15 @@ namespace FoxTube
trouble.Visibility = Visibility.Collapsed; trouble.Visibility = Visibility.Collapsed;
wifiTrouble.Visibility = Visibility.Collapsed; wifiTrouble.Visibility = Visibility.Collapsed;
blockIcon.Visibility = Visibility.Collapsed; blockIcon.Visibility = Visibility.Collapsed;
State = LoadingState.Loadnig;
} }
public void Close() public void Close()
{ {
Visibility = Visibility.Collapsed; Visibility = Visibility.Collapsed;
State = LoadingState.Loaded;
} }
} }
} }
+17 -7
View File
@@ -505,6 +505,8 @@ namespace FoxTube
} }, } },
{ typeof(ChannelPage), () => { typeof(ChannelPage), () =>
{
if(SecretsVault.IsAuthorized)
{ {
if((content.Content as ChannelPage).channelId == SecretsVault.AccountId) if((content.Content as ChannelPage).channelId == SecretsVault.AccountId)
{ {
@@ -515,7 +517,7 @@ namespace FoxTube
} }
else else
{ {
bool b = false; bool found = false;
for(int k = 0; k < SecretsVault.Subscriptions.Count && k < 10; k++) for(int k = 0; k < SecretsVault.Subscriptions.Count && k < 10; k++)
if(SecretsVault.Subscriptions[k].Snippet.ResourceId.ChannelId == (content.Content as ChannelPage).channelId) if(SecretsVault.Subscriptions[k].Snippet.ResourceId.ChannelId == (content.Content as ChannelPage).channelId)
{ {
@@ -523,15 +525,16 @@ namespace FoxTube
nav.SelectedItem = nav.MenuItems[k + 9]; nav.SelectedItem = nav.MenuItems[k + 9];
else else
s = Sender.None; s = Sender.None;
b = true; found = true;
break; break;
} }
if(!b) if(!found)
{
nav.SelectedItem = null; nav.SelectedItem = null;
} }
} }
else
nav.SelectedItem = null;
} }, } },
{ typeof(PlaylistPage), () => { typeof(PlaylistPage), () =>
{ {
@@ -599,10 +602,14 @@ namespace FoxTube
else else
nav.IsBackEnabled = false; nav.IsBackEnabled = false;
if ((e.SourcePageType == typeof(Home) || e.SourcePageType == typeof(Settings)) && nav.DisplayMode == NavigationViewDisplayMode.Expanded) if (e.SourcePageType == typeof(Home) || e.SourcePageType == typeof(Settings) || e.SourcePageType == typeof(Subscriptions))
{
nav.ExpandedModeThresholdWidth = 1008;
if (nav.DisplayMode == NavigationViewDisplayMode.Expanded)
nav.IsPaneOpen = true; nav.IsPaneOpen = true;
}
else else
nav.IsPaneOpen = false; nav.ExpandedModeThresholdWidth = int.MaxValue;
if (videoPlaceholder.Content != null && (videoPlaceholder.Parent as DropShadowPanel).HorizontalAlignment == HorizontalAlignment.Stretch) if (videoPlaceholder.Content != null && (videoPlaceholder.Parent as DropShadowPanel).HorizontalAlignment == HorizontalAlignment.Stretch)
MinimizeAsInitializer(); MinimizeAsInitializer();
@@ -618,7 +625,10 @@ namespace FoxTube
if (videoPlaceholder.Content != null) if (videoPlaceholder.Content != null)
{ {
DropShadowPanel panel = videoPlaceholder.Parent as DropShadowPanel; DropShadowPanel panel = videoPlaceholder.Parent as DropShadowPanel;
if (panel.HorizontalAlignment == HorizontalAlignment.Stretch)
if ((videoPlaceholder.Content as VideoPage).loading.State != LoadingState.Loaded)
CloseVideo();
else if (panel.HorizontalAlignment == HorizontalAlignment.Stretch)
MinimizeAsInitializer(); MinimizeAsInitializer();
else else
content.GoBack(); content.GoBack();
+1 -1
View File
@@ -74,7 +74,7 @@ namespace FoxTube.Pages
public VideoPlayer player; public VideoPlayer player;
public CommentsPage comments; public CommentsPage comments;
LoadingPage loading; public LoadingPage loading;
public VideoPage() public VideoPage()
{ {