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
@@ -160,7 +160,6 @@ namespace FoxTube.Pages
playlistRequest = SecretsVault.Service.Search.List("id");
playlistRequest.ChannelId = channelId;
playlistRequest.Type = "playlist";
playlistRequest.Order = SearchResource.ListRequest.OrderEnum.Date;
playlistRequest.MaxResults = 48;
SearchListResponse response = await playlistRequest.ExecuteAsync();
+1
View File
@@ -127,6 +127,7 @@ namespace FoxTube.Pages
var request = SecretsVault.Service.CommentThreads.List("snippet,replies");
request.Order = order;
request.VideoId = threadId;
request.TextFormat = CommentThreadsResource.ListRequest.TextFormatEnum.PlainText;
var response = await request.ExecuteAsync();
nextPageToken = response.NextPageToken;
+11
View File
@@ -17,12 +17,15 @@ using Windows.UI.Xaml.Navigation;
namespace FoxTube
{
public enum LoadingState { Loadnig, Loaded, Error, Blocked }
/// <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 event RoutedEventHandler RefreshPage;
public LoadingState State { get; private set; } = LoadingState.Loadnig;
public LoadingPage()
{
@@ -50,6 +53,8 @@ namespace FoxTube
trouble.Visibility = Visibility.Visible;
}
State = LoadingState.Error;
}
public void Block()
@@ -60,6 +65,8 @@ namespace FoxTube
wifiTrouble.Visibility = Visibility.Collapsed;
blockIcon.Visibility = Visibility.Visible;
State = LoadingState.Blocked;
}
private async void openWifi_Click(object sender, RoutedEventArgs e)
@@ -90,11 +97,15 @@ namespace FoxTube
trouble.Visibility = Visibility.Collapsed;
wifiTrouble.Visibility = Visibility.Collapsed;
blockIcon.Visibility = Visibility.Collapsed;
State = LoadingState.Loadnig;
}
public void Close()
{
Visibility = Visibility.Collapsed;
State = LoadingState.Loaded;
}
}
}
+36 -26
View File
@@ -506,32 +506,35 @@ namespace FoxTube
} },
{ typeof(ChannelPage), () =>
{
if((content.Content as ChannelPage).channelId == SecretsVault.AccountId)
if(SecretsVault.IsAuthorized)
{
if(nav.SelectedItem != toChannel)
nav.SelectedItem = toChannel;
else
s = Sender.None;
}
else
{
bool b = false;
for(int k = 0; k < SecretsVault.Subscriptions.Count && k < 10; k++)
if(SecretsVault.Subscriptions[k].Snippet.ResourceId.ChannelId == (content.Content as ChannelPage).channelId)
{
if(nav.SelectedItem != nav.MenuItems[k + 9])
nav.SelectedItem = nav.MenuItems[k + 9];
else
s = Sender.None;
b = true;
break;
}
if(!b)
if((content.Content as ChannelPage).channelId == SecretsVault.AccountId)
{
nav.SelectedItem = null;
if(nav.SelectedItem != toChannel)
nav.SelectedItem = toChannel;
else
s = Sender.None;
}
else
{
bool found = false;
for(int k = 0; k < SecretsVault.Subscriptions.Count && k < 10; k++)
if(SecretsVault.Subscriptions[k].Snippet.ResourceId.ChannelId == (content.Content as ChannelPage).channelId)
{
if(nav.SelectedItem != nav.MenuItems[k + 9])
nav.SelectedItem = nav.MenuItems[k + 9];
else
s = Sender.None;
found = true;
break;
}
if(!found)
nav.SelectedItem = null;
}
}
else
nav.SelectedItem = null;
} },
{ typeof(PlaylistPage), () =>
{
@@ -599,10 +602,14 @@ namespace FoxTube
else
nav.IsBackEnabled = false;
if ((e.SourcePageType == typeof(Home) || e.SourcePageType == typeof(Settings)) && nav.DisplayMode == NavigationViewDisplayMode.Expanded)
nav.IsPaneOpen = true;
if (e.SourcePageType == typeof(Home) || e.SourcePageType == typeof(Settings) || e.SourcePageType == typeof(Subscriptions))
{
nav.ExpandedModeThresholdWidth = 1008;
if (nav.DisplayMode == NavigationViewDisplayMode.Expanded)
nav.IsPaneOpen = true;
}
else
nav.IsPaneOpen = false;
nav.ExpandedModeThresholdWidth = int.MaxValue;
if (videoPlaceholder.Content != null && (videoPlaceholder.Parent as DropShadowPanel).HorizontalAlignment == HorizontalAlignment.Stretch)
MinimizeAsInitializer();
@@ -618,7 +625,10 @@ namespace FoxTube
if (videoPlaceholder.Content != null)
{
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();
else
content.GoBack();
+1 -1
View File
@@ -74,7 +74,7 @@ namespace FoxTube.Pages
public VideoPlayer player;
public CommentsPage comments;
LoadingPage loading;
public LoadingPage loading;
public VideoPage()
{