Archived
1
0

Hamburger menu fix

This commit is contained in:
Michael Gordeev
2018-08-01 21:33:59 +03:00
parent ba02a37760
commit 2614a7d88d
3 changed files with 88 additions and 117 deletions
+4 -4
View File
@@ -138,7 +138,7 @@
</Grid.RowDefinitions> </Grid.RowDefinitions>
<ScrollViewer> <ScrollViewer>
<StackPanel> <StackPanel>
<ListBox Name="mainList" SelectionChanged="HamburgerSelectionChanged"> <ListBox Name="mainList" SelectionChanged="MainListSelected">
<ListBoxItem Name="toHome" IsSelected="True"> <ListBoxItem Name="toHome" IsSelected="True">
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<TextBlock Style="{StaticResource ItemIcon}" Text="&#xE80F;"/> <TextBlock Style="{StaticResource ItemIcon}" Text="&#xE80F;"/>
@@ -177,7 +177,7 @@
</ListBoxItem> </ListBoxItem>
</ListBox> </ListBox>
<ListBox Name="subscriptionsList" Visibility="Collapsed" SelectionChanged="HamburgerSelectionChanged"> <ListBox Name="subscriptionsList" Visibility="Collapsed" SelectionChanged="SubscriptionSelected">
<ListBoxItem IsEnabled="False" Height="17" Padding="0,0,5,0"> <ListBoxItem IsEnabled="False" Height="17" Padding="0,0,5,0">
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<TextBlock Name="subsTitle" Text="Subscriptions" FontSize="12" Padding="5,0,5,0" Visibility="Visible"/> <TextBlock Name="subsTitle" Text="Subscriptions" FontSize="12" Padding="5,0,5,0" Visibility="Visible"/>
@@ -186,7 +186,7 @@
</ListBoxItem> </ListBoxItem>
</ListBox> </ListBox>
<ListBox Name="categoriesList" SelectionChanged="HamburgerSelectionChanged"> <ListBox Name="categoriesList" SelectionChanged="FeaturedSelected">
<ListBoxItem IsEnabled="False" Height="17" Padding="0,0,5,0"> <ListBoxItem IsEnabled="False" Height="17" Padding="0,0,5,0">
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<TextBlock Name="catTitle" Text="Featured" FontSize="12" Padding="5,0,5,0"/> <TextBlock Name="catTitle" Text="Featured" FontSize="12" Padding="5,0,5,0"/>
@@ -239,7 +239,7 @@
</ListBox> </ListBox>
</StackPanel> </StackPanel>
</ScrollViewer> </ScrollViewer>
<ListBox Grid.Row="1" VerticalAlignment="Bottom" Name="serviceList" SelectionChanged="HamburgerSelectionChanged"> <ListBox Grid.Row="1" VerticalAlignment="Bottom" Name="serviceList" SelectionChanged="ServiceListSelected">
<ListBoxItem Padding="0" IsEnabled="False"> <ListBoxItem Padding="0" IsEnabled="False">
<Line X2="250" Stroke="Gray"/> <Line X2="250" Stroke="Gray"/>
</ListBoxItem> </ListBoxItem>
+25 -54
View File
@@ -218,6 +218,8 @@ namespace FoxTube
} }
void MainListSelected(object sender, SelectionChangedEventArgs e) void MainListSelected(object sender, SelectionChangedEventArgs e)
{
try
{ {
if (mainList.SelectedItem == null) if (mainList.SelectedItem == null)
return; return;
@@ -231,9 +233,9 @@ namespace FoxTube
if (s == toHistory) if (s == toHistory)
content.Navigate(typeof(Settings)); content.Navigate(typeof(Settings));
else if (s == toLiked) else if (s == toLiked)
content.Navigate(typeof(PlaylistPage)); content.Navigate(typeof(PlaylistPage), SecretsVault.UserChannel.ContentDetails.RelatedPlaylists.Likes);
else if (s == toLater) else if (s == toLater)
content.Navigate(typeof(Settings)); content.Navigate(typeof(PlaylistPage), SecretsVault.UserChannel.ContentDetails.RelatedPlaylists.WatchLater);
else if (s == toSubscriptions) else if (s == toSubscriptions)
content.Navigate(typeof(Settings)); content.Navigate(typeof(Settings));
else if (s == toDownloads) else if (s == toDownloads)
@@ -241,8 +243,12 @@ namespace FoxTube
else else
content.Navigate(typeof(Home)); content.Navigate(typeof(Home));
} }
catch { }
}
void ServiceListSelected(object sender, SelectionChangedEventArgs e) void ServiceListSelected(object sender, SelectionChangedEventArgs e)
{
try
{ {
if (serviceList.SelectedItem == null) if (serviceList.SelectedItem == null)
return; return;
@@ -260,8 +266,12 @@ namespace FoxTube
else else
content.Navigate(typeof(Settings)); content.Navigate(typeof(Settings));
} }
catch { }
}
void SubscriptionSelected(object sender, SelectionChangedEventArgs e) void SubscriptionSelected(object sender, SelectionChangedEventArgs e)
{
try
{ {
if (subscriptionsList.SelectedItem == null) if (subscriptionsList.SelectedItem == null)
return; return;
@@ -272,8 +282,12 @@ namespace FoxTube
content.Navigate(typeof(Channel), SecretsVault.Subscriptions[subscriptionsList.SelectedIndex - 1].Snippet.ChannelId); content.Navigate(typeof(Channel), SecretsVault.Subscriptions[subscriptionsList.SelectedIndex - 1].Snippet.ChannelId);
} }
catch { }
}
void FeaturedSelected(object sender, SelectionChangedEventArgs e) void FeaturedSelected(object sender, SelectionChangedEventArgs e)
{
try
{ {
if (serviceList.SelectedItem == null) if (serviceList.SelectedItem == null)
return; return;
@@ -282,76 +296,33 @@ namespace FoxTube
subscriptionsList.SelectedItem = null; subscriptionsList.SelectedItem = null;
serviceList.SelectedItem = null; serviceList.SelectedItem = null;
switch (serviceList.SelectedIndex) switch (categoriesList.SelectedIndex)
{ {
case 0: case 0:
content.Navigate(typeof(Channel), "UC-9-kyTW8ZkZNDHQJ6FgpwQ"); GoToChannel("UC-9-kyTW8ZkZNDHQJ6FgpwQ");
break; break;
case 1: case 1:
content.Navigate(typeof(Channel), "UCEgdi0XIXXZ-qJOFPf4JSKw"); GoToChannel("UCEgdi0XIXXZ-qJOFPf4JSKw");
break; break;
case 2: case 2:
content.Navigate(typeof(Channel), "UCOpNcN46UbXVtpKMrmU4Abg"); GoToChannel("UCOpNcN46UbXVtpKMrmU4Abg");
break; break;
case 3: case 3:
content.Navigate(typeof(Channel), "UCYfdidRxbB8Qhf0Nx7ioOYw"); GoToChannel("UCYfdidRxbB8Qhf0Nx7ioOYw");
break; break;
case 4: case 4:
content.Navigate(typeof(Channel), "UC4R8DWoMoI7CAwX8_LjQHig"); GoToChannel("UC4R8DWoMoI7CAwX8_LjQHig");
break; break;
case 5: case 5:
content.Navigate(typeof(Channel), "UC8iNz9uwDGfomRnnKKbOhOQ"); GoToChannel("UC8iNz9uwDGfomRnnKKbOhOQ");
break; break;
case 6: case 6:
content.Navigate(typeof(Channel), "UCzuqhhs6NWbgTzMuM09WKDQ"); GoToChannel("UCzuqhhs6NWbgTzMuM09WKDQ");
break; break;
} }
} }
catch { }
/*private void MenuSelectionChanged()
{
if(topHamburger.SelectedIndex == 0)
{
content.Navigate(typeof(Home));
headerText.Text = "Home";
menu.DisplayMode = SplitViewDisplayMode.CompactInline;
isForcedCollapsed = false;
menu.IsPaneOpen = true;
} }
else if (topHamburger.SelectedIndex == 1)
{
//content.Navigate(typeof(Video));
//headerText.Text = "Video";
//menu.DisplayMode = SplitViewDisplayMode.CompactOverlay;
//menu.IsPaneOpen = false;
//isForcedCollapsed = true;
}
else if (bottomHaburger.SelectedIndex == 4)
{
content.Navigate(typeof(Settings));
headerText.Text = "Settings";
menu.DisplayMode = SplitViewDisplayMode.CompactOverlay;
menu.IsPaneOpen = false;
isForcedCollapsed = true;
}
else if (bottomHaburger.SelectedIndex == 1)
{
content.Navigate(typeof(Channel));
headerText.Text = "Channel overview";
menu.DisplayMode = SplitViewDisplayMode.CompactOverlay;
menu.IsPaneOpen = false;
isForcedCollapsed = true;
}
else if (bottomHaburger.SelectedIndex == 3)
{
if(content.SourcePageType == typeof(Settings))
bottomHaburger.SelectedIndex = 3;
else if (content.SourcePageType == typeof(Home))
topHamburger.SelectedIndex = 0;
else if (content.SourcePageType == typeof(Channel))
bottomHaburger.SelectedIndex = 1;
}
}*/
public void notificationMenu_Click(object sender, RoutedEventArgs e) public void notificationMenu_Click(object sender, RoutedEventArgs e)
{ {
+3 -3
View File
@@ -73,15 +73,15 @@ namespace FoxTube.Pages
try try
{ {
thumbnail.Source = new BitmapImage(new Uri(item.Snippet.Thumbnails.Medium.Url)); thumbnail.Source = new BitmapImage(new Uri(item.Snippet.Thumbnails.Medium.Url));
ChannelsResource.ListRequest channelRequest = SecretsVault.NoAuthService.Channels.List("snippet"); ChannelsResource.ListRequest channelRequest = SecretsVault.Service.Channels.List("snippet");
channelRequest.Id = item.Snippet.ChannelId; channelRequest.Id = item.Snippet.ChannelId;
Google.Apis.YouTube.v3.Data.Channel channel = (await channelRequest.ExecuteAsync()).Items[0]; Google.Apis.YouTube.v3.Data.Channel channel = (await channelRequest.ExecuteAsync()).Items[0];
avatar.ProfilePicture = new BitmapImage(new Uri(channel.Snippet.Thumbnails.Medium.Url)); avatar.ProfilePicture = new BitmapImage(new Uri(channel.Snippet.Thumbnails.Medium.Url));
} }
catch { } catch { }
PlaylistItemsResource.ListRequest listRequest = SecretsVault.NoAuthService.PlaylistItems.List("contentDetails"); PlaylistItemsResource.ListRequest listRequest = SecretsVault.Service.PlaylistItems.List("contentDetails");
listRequest.PlaylistId = item.Id; listRequest.PlaylistId = id;
listRequest.MaxResults = 50; listRequest.MaxResults = 50;
PlaylistItemListResponse response = await listRequest.ExecuteAsync(); PlaylistItemListResponse response = await listRequest.ExecuteAsync();