Archived
1
0

Broke everything; #220: Fixed

This commit is contained in:
Michael Gordeev
2018-12-09 13:41:00 +03:00
parent 1a6447a4aa
commit f16be876c6
19 changed files with 201 additions and 145 deletions
+2 -1
View File
@@ -19,7 +19,8 @@
<ScrollViewer Name="scroll">
<local:VideoGrid/>
</ScrollViewer>
<CommandBar Grid.Row="1">
<CommandBar Grid.Row="1" DefaultLabelPosition="Right">
<AppBarButton LabelPosition="Default" Icon="Help" Label="Missing some stuff?" Name="help" Click="help_Click"/>
<AppBarButton Label="Open in browser" Icon="Globe" Name="toBrowser" Click="toBrowser_Click"/>
</CommandBar>
<foxtube:LoadingPage Visibility="Collapsed" Grid.RowSpan="2"/>
+6 -1
View File
@@ -36,7 +36,7 @@ namespace FoxTube.Pages
loading.Refresh();
list.Clear();
SecretsVault.UserHistory.ForEach(i => list.Add(new VideoCard(i)));
SecretsVault.UserHistory.ForEach(i => list.Add(new VideoCard(i.Id)));
loading.Close();
}
@@ -45,5 +45,10 @@ namespace FoxTube.Pages
{
await Launcher.LaunchUriAsync(new Uri("youtube.com/feed/history"));
}
private void help_Click(object sender, RoutedEventArgs e)
{
Methods.MainPage.GoToDeveloper("local-history");
}
}
}
+26 -25
View File
@@ -33,47 +33,48 @@
</NavigationView.MenuItems>
<NavigationView.PaneFooter>
<StackPanel>
<Button Visibility="Visible" Name="feedback" Click="feedback_Click" Height="40" HorizontalAlignment="Stretch" Background="Transparent" HorizontalContentAlignment="Left">
<NavigationViewList>
<NavigationViewItem x:Uid="/Main/feedback" Name="feedback" Content="Give a feedback" Tapped="feedback_Click">
<NavigationViewItem.Icon>
<FontIcon Glyph="&#xED15;"/>
</NavigationViewItem.Icon>
</NavigationViewItem>
<NavigationViewItem x:Uid="/Main/adsFree" Content="Remove ads" Visibility="Collapsed" Name="removeAds">
<NavigationViewItem.Icon>
<FontIcon Glyph="&#xE14D;"/>
</NavigationViewItem.Icon>
</NavigationViewItem>
<NavigationViewItem Name="account" Tapped="openContext">
<StackPanel Orientation="Horizontal">
<FontIcon Glyph="&#xED15;" FontSize="16" Margin="6,0,16,0"/>
<TextBlock x:Uid="/Main/feedback" Text="Give a feedback"/>
</StackPanel>
</Button>
<Button Visibility="Collapsed" Name="removeAds" Height="40" HorizontalAlignment="Stretch" Background="Transparent" HorizontalContentAlignment="Left">
<StackPanel Orientation="Horizontal">
<FontIcon Glyph="&#xE14D;" FontSize="16" Margin="6,0,16,0"/>
<TextBlock x:Uid="/Main/adsFree" Text="Remove ads"/>
</StackPanel>
</Button>
<Button Visibility="Visible" Name="account" Height="40" HorizontalAlignment="Stretch" Background="Transparent" HorizontalContentAlignment="Left">
<StackPanel Orientation="Horizontal">
<FontIcon Glyph="&#xE8FA;" FontSize="16" Margin="6,0,16,0"/>
<FontIcon Glyph="&#xE8FA;" FontSize="16" Margin="0,0,16,0"/>
<TextBlock x:Uid="/Main/signIn" Text="Add account"/>
</StackPanel>
<Button.Flyout>
<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"/>
</MenuFlyout>
</Button.Flyout>
</Button>
<Button Visibility="Collapsed" Name="avatar" Height="40" HorizontalAlignment="Stretch" Background="Transparent" HorizontalContentAlignment="Left">
<StackPanel Orientation="Horizontal">
<PersonPicture Height="23" Margin="3,0,12,0"/>
</NavigationViewItem.ContextFlyout>
</NavigationViewItem>
<NavigationViewItem Visibility="Collapsed" Name="avatar" Tapped="openContext" Padding="-5">
<StackPanel Orientation="Horizontal" Padding="5">
<PersonPicture Height="20" Margin="-5,0,15,0"/>
<TextBlock Name="myName" Text="My account"/>
</StackPanel>
<Button.Flyout>
<NavigationViewItem.ContextFlyout>
<MenuFlyout>
<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"/>
</MenuFlyout>
</Button.Flyout>
</Button>
</StackPanel>
</NavigationViewItem.ContextFlyout>
</NavigationViewItem>
</NavigationViewList>
</NavigationView.PaneFooter>
<NavigationView.AutoSuggestBox>
+55 -31
View File
@@ -81,7 +81,7 @@ namespace FoxTube
try
{
XmlDocument changelog = new XmlDocument();
changelog.Load("http://foxgame.hol.es/foxtube-changelog.xml");
changelog.Load("http://foxgame-studio.000webhostapp.com/foxtube-changelog.xml");
XmlElement e = changelog["items"].ChildNodes[0] as XmlElement;
ToastNotificationManager.CreateToastNotifier().Show(FoxTube.Background.Notification.GetChangelogToast(e.GetAttribute("version")));
@@ -100,6 +100,11 @@ namespace FoxTube
Initialize();
}
async void GetVideosFromToday()
{
}
public async void Initialize()
{
if (await ApplicationData.Current.RoamingFolder.GetFileAsync("notifications.json") != null)
@@ -130,7 +135,7 @@ namespace FoxTube
titleBar.ButtonBackgroundColor = Colors.Red;
titleBar.ButtonHoverBackgroundColor = Colors.IndianRed;
titleBar.ButtonPressedBackgroundColor = Colors.DarkRed;
titleBar.ButtonInactiveBackgroundColor = Colors.DarkRed;
titleBar.ButtonInactiveBackgroundColor = Colors.Black;
titleBar.ForegroundColor = Colors.White;
CoreApplication.GetCurrentView().TitleBar.ExtendViewIntoTitleBar = false;
@@ -141,18 +146,23 @@ namespace FoxTube
if ((string)args[0] == "add" && nav.MenuItems.Count < 19)
{
Subscription s = args[1] as Subscription;
StackPanel panel = new StackPanel() { Orientation = Orientation.Horizontal };
StackPanel panel = new StackPanel()
{
Orientation = Orientation.Horizontal,
Padding = new Thickness(5)
};
panel.Children.Add(new PersonPicture()
{
Height = 20,
Margin = new Thickness(0, 0, 13, 0),
Margin = new Thickness(-5, 0, 15, 0),
ProfilePicture = new BitmapImage(new Uri(s.Snippet.Thumbnails.Medium.Url))
});
panel.Children.Add(new TextBlock() { Text = s.Snippet.Title });
nav.MenuItems.Add(new NavigationViewItem()
{
Content = panel,
Name = (nav.MenuItems.Count - 9).ToString()
Name = (nav.MenuItems.Count - 9).ToString(),
Padding = new Thickness(-5)
});
}
else if ((string)args[0] == "remove" && (int)args[1] < 10)
@@ -190,18 +200,23 @@ namespace FoxTube
try
{
Subscription s = SecretsVault.Subscriptions[k];
StackPanel panel = new StackPanel() { Orientation = Orientation.Horizontal };
StackPanel panel = new StackPanel()
{
Orientation = Orientation.Horizontal,
Padding = new Thickness(5)
};
panel.Children.Add(new PersonPicture()
{
Height = 20,
Margin = new Thickness(0, 0, 13, 0),
Margin = new Thickness(-5, 0, 15, 0),
ProfilePicture = new BitmapImage(new Uri(s.Snippet.Thumbnails.Medium.Url))
});
panel.Children.Add(new TextBlock() { Text = s.Snippet.Title });
nav.MenuItems.Add(new NavigationViewItem()
{
Content = panel,
Name = k.ToString()
Name = k.ToString(),
Padding = new Thickness(-5)
});
}
catch { continue; }
@@ -234,7 +249,7 @@ namespace FoxTube
GoToVideo((videoPlaceholder.Content as VideoPage).videoId);
}
private async void feedback_Click(object sender, RoutedEventArgs e)
private async void feedback_Click(object sender, TappedRoutedEventArgs e)
{
await Launcher.LaunchUriAsync(new Uri("feedback-hub:"));
}
@@ -466,33 +481,37 @@ namespace FoxTube
private void nav_SelectionChanged(NavigationView sender, NavigationViewSelectionChangedEventArgs args)
{
if (s == Sender.None)
try
{
s = Sender.Menu;
if (args.IsSettingsSelected)
content.Navigate(typeof(Settings));
else
if (s == Sender.None)
{
if (args.SelectedItem == toHome)
content.Navigate(typeof(Home));
else if (args.SelectedItem == toHistory)
content.Navigate(typeof(History));
else if (args.SelectedItem == toLiked)
content.Navigate(typeof(PlaylistPage), SecretsVault.UserChannel.ContentDetails.RelatedPlaylists.Likes);
else if (args.SelectedItem == toLater)
content.Navigate(typeof(PlaylistPage), SecretsVault.UserChannel.ContentDetails.RelatedPlaylists.WatchLater);
else if (args.SelectedItem == toSubscriptions)
content.Navigate(typeof(Subscriptions));
else if (args.SelectedItem == toDownloads)
content.Navigate(typeof(Downloads));
else if (args.SelectedItem == toChannel)
content.Navigate(typeof(ChannelPage), SecretsVault.UserChannel.Id);
s = Sender.Menu;
if (args.IsSettingsSelected)
content.Navigate(typeof(Settings));
else
content.Navigate(typeof(ChannelPage), SecretsVault.Subscriptions[Convert.ToInt32((args.SelectedItem as NavigationViewItem).Name)].Snippet.ResourceId.ChannelId);
{
if (args.SelectedItem == toHome)
content.Navigate(typeof(Home));
else if (args.SelectedItem == toHistory)
content.Navigate(typeof(History));
else if (args.SelectedItem == toLiked)
content.Navigate(typeof(PlaylistPage), SecretsVault.UserChannel.ContentDetails.RelatedPlaylists.Likes);
else if (args.SelectedItem == toLater)
content.Navigate(typeof(PlaylistPage), SecretsVault.UserChannel.ContentDetails.RelatedPlaylists.WatchLater);
else if (args.SelectedItem == toSubscriptions)
content.Navigate(typeof(Subscriptions));
else if (args.SelectedItem == toDownloads)
content.Navigate(typeof(Downloads));
else if (args.SelectedItem == toChannel)
content.Navigate(typeof(ChannelPage), SecretsVault.UserChannel.Id);
else
content.Navigate(typeof(ChannelPage), SecretsVault.Subscriptions[Convert.ToInt32((args.SelectedItem as NavigationViewItem).Name)].Snippet.ResourceId.ChannelId);
}
}
else
s = Sender.None;
}
else
s = Sender.None;
catch { }
}
public void content_Navigated(object sender, NavigationEventArgs e)
@@ -681,5 +700,10 @@ namespace FoxTube
(videoPlaceholder.Content as VideoPage).player.KeyUpPressed(sender, e);
}
}
private void openContext(object sender, TappedRoutedEventArgs e)
{
((NavigationViewItem)sender).ContextFlyout.ShowAt((NavigationViewItem)sender);
}
}
}
+2 -2
View File
@@ -40,14 +40,14 @@ namespace FoxTube.Pages.SettingsPages
{
XmlDocument doc = new XmlDocument();
doc.Load("http://foxgame.hol.es/foxtube-changelog.xml");
doc.Load("http://foxgame-studio.000webhostapp.com/foxtube-changelog.xml");
foreach (XmlElement e in doc["items"].ChildNodes)
items.Add(new InboxItem(
e.GetAttribute("version"),
e["content"].InnerText,
e.GetAttribute("time")));
doc.Load("http://foxgame.hol.es/foxtube-messages.xml");
doc.Load("http://foxgame-studio.000webhostapp.com/foxtube-messages.xml");
foreach (XmlElement e in doc["posts"].ChildNodes)
items.Add(new InboxItem(
e["header"].InnerText,
-2
View File
@@ -208,8 +208,6 @@ namespace FoxTube.Pages
}
}
subscribe.Visibility = Visibility.Visible;
SecretsVault.HistoryAdd(videoId);
}
else
{