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>
+80 -109
View File
@@ -219,140 +219,111 @@ namespace FoxTube
void MainListSelected(object sender, SelectionChangedEventArgs e) void MainListSelected(object sender, SelectionChangedEventArgs e)
{ {
if (mainList.SelectedItem == null) try
return; {
if (mainList.SelectedItem == null)
return;
subscriptionsList.SelectedItem = null; subscriptionsList.SelectedItem = null;
categoriesList.SelectedItem = null; categoriesList.SelectedItem = null;
serviceList.SelectedItem = null; serviceList.SelectedItem = null;
object s = mainList.SelectedItem; object s = mainList.SelectedItem;
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)
content.Navigate(typeof(Downloads)); content.Navigate(typeof(Downloads));
else else
content.Navigate(typeof(Home)); content.Navigate(typeof(Home));
}
catch { }
} }
void ServiceListSelected(object sender, SelectionChangedEventArgs e) void ServiceListSelected(object sender, SelectionChangedEventArgs e)
{ {
if (serviceList.SelectedItem == null) try
{
if (serviceList.SelectedItem == null)
return; return;
mainList.SelectedItem = null; mainList.SelectedItem = null;
subscriptionsList.SelectedItem = null; subscriptionsList.SelectedItem = null;
categoriesList.SelectedItem = null; categoriesList.SelectedItem = null;
object s = serviceList.SelectedItem; object s = serviceList.SelectedItem;
if (s == toChannel) if (s == toChannel)
content.Navigate(typeof(Channel), SecretsVault.AccountId); content.Navigate(typeof(Channel), SecretsVault.AccountId);
else if (s == toRemoveAds) else if (s == toRemoveAds)
content.Navigate(typeof(Settings), "adblock"); content.Navigate(typeof(Settings), "adblock");
else else
content.Navigate(typeof(Settings)); content.Navigate(typeof(Settings));
}
catch { }
} }
void SubscriptionSelected(object sender, SelectionChangedEventArgs e) void SubscriptionSelected(object sender, SelectionChangedEventArgs e)
{ {
if (subscriptionsList.SelectedItem == null) try
return; {
if (subscriptionsList.SelectedItem == null)
return;
mainList.SelectedItem = null; mainList.SelectedItem = null;
categoriesList.SelectedItem = null; categoriesList.SelectedItem = null;
serviceList.SelectedItem = null; serviceList.SelectedItem = null;
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)
{ {
if (serviceList.SelectedItem == null) try
return;
mainList.SelectedItem = null;
subscriptionsList.SelectedItem = null;
serviceList.SelectedItem = null;
switch (serviceList.SelectedIndex)
{ {
case 0: if (serviceList.SelectedItem == null)
content.Navigate(typeof(Channel), "UC-9-kyTW8ZkZNDHQJ6FgpwQ"); return;
break;
case 1: mainList.SelectedItem = null;
content.Navigate(typeof(Channel), "UCEgdi0XIXXZ-qJOFPf4JSKw"); subscriptionsList.SelectedItem = null;
break; serviceList.SelectedItem = null;
case 2:
content.Navigate(typeof(Channel), "UCOpNcN46UbXVtpKMrmU4Abg"); switch (categoriesList.SelectedIndex)
break; {
case 3: case 0:
content.Navigate(typeof(Channel), "UCYfdidRxbB8Qhf0Nx7ioOYw"); GoToChannel("UC-9-kyTW8ZkZNDHQJ6FgpwQ");
break; break;
case 4: case 1:
content.Navigate(typeof(Channel), "UC4R8DWoMoI7CAwX8_LjQHig"); GoToChannel("UCEgdi0XIXXZ-qJOFPf4JSKw");
break; break;
case 5: case 2:
content.Navigate(typeof(Channel), "UC8iNz9uwDGfomRnnKKbOhOQ"); GoToChannel("UCOpNcN46UbXVtpKMrmU4Abg");
break; break;
case 6: case 3:
content.Navigate(typeof(Channel), "UCzuqhhs6NWbgTzMuM09WKDQ"); GoToChannel("UCYfdidRxbB8Qhf0Nx7ioOYw");
break; break;
case 4:
GoToChannel("UC4R8DWoMoI7CAwX8_LjQHig");
break;
case 5:
GoToChannel("UC8iNz9uwDGfomRnnKKbOhOQ");
break;
case 6:
GoToChannel("UCzuqhhs6NWbgTzMuM09WKDQ");
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)
{ {
notificationMenu.Content = ""; notificationMenu.Content = "";
+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();