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>
<ScrollViewer>
<StackPanel>
<ListBox Name="mainList" SelectionChanged="HamburgerSelectionChanged">
<ListBox Name="mainList" SelectionChanged="MainListSelected">
<ListBoxItem Name="toHome" IsSelected="True">
<StackPanel Orientation="Horizontal">
<TextBlock Style="{StaticResource ItemIcon}" Text="&#xE80F;"/>
@@ -177,7 +177,7 @@
</ListBoxItem>
</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">
<StackPanel Orientation="Horizontal">
<TextBlock Name="subsTitle" Text="Subscriptions" FontSize="12" Padding="5,0,5,0" Visibility="Visible"/>
@@ -186,7 +186,7 @@
</ListBoxItem>
</ListBox>
<ListBox Name="categoriesList" SelectionChanged="HamburgerSelectionChanged">
<ListBox Name="categoriesList" SelectionChanged="FeaturedSelected">
<ListBoxItem IsEnabled="False" Height="17" Padding="0,0,5,0">
<StackPanel Orientation="Horizontal">
<TextBlock Name="catTitle" Text="Featured" FontSize="12" Padding="5,0,5,0"/>
@@ -239,7 +239,7 @@
</ListBox>
</StackPanel>
</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">
<Line X2="250" Stroke="Gray"/>
</ListBoxItem>
+81 -110
View File
@@ -219,140 +219,111 @@ namespace FoxTube
void MainListSelected(object sender, SelectionChangedEventArgs e)
{
if (mainList.SelectedItem == null)
return;
try
{
if (mainList.SelectedItem == null)
return;
subscriptionsList.SelectedItem = null;
categoriesList.SelectedItem = null;
serviceList.SelectedItem = null;
subscriptionsList.SelectedItem = null;
categoriesList.SelectedItem = null;
serviceList.SelectedItem = null;
object s = mainList.SelectedItem;
if (s == toHistory)
content.Navigate(typeof(Settings));
else if (s == toLiked)
content.Navigate(typeof(PlaylistPage));
else if (s == toLater)
content.Navigate(typeof(Settings));
else if (s == toSubscriptions)
content.Navigate(typeof(Settings));
else if (s == toDownloads)
content.Navigate(typeof(Downloads));
else
content.Navigate(typeof(Home));
object s = mainList.SelectedItem;
if (s == toHistory)
content.Navigate(typeof(Settings));
else if (s == toLiked)
content.Navigate(typeof(PlaylistPage), SecretsVault.UserChannel.ContentDetails.RelatedPlaylists.Likes);
else if (s == toLater)
content.Navigate(typeof(PlaylistPage), SecretsVault.UserChannel.ContentDetails.RelatedPlaylists.WatchLater);
else if (s == toSubscriptions)
content.Navigate(typeof(Settings));
else if (s == toDownloads)
content.Navigate(typeof(Downloads));
else
content.Navigate(typeof(Home));
}
catch { }
}
void ServiceListSelected(object sender, SelectionChangedEventArgs e)
{
if (serviceList.SelectedItem == null)
try
{
if (serviceList.SelectedItem == null)
return;
mainList.SelectedItem = null;
subscriptionsList.SelectedItem = null;
categoriesList.SelectedItem = null;
mainList.SelectedItem = null;
subscriptionsList.SelectedItem = null;
categoriesList.SelectedItem = null;
object s = serviceList.SelectedItem;
object s = serviceList.SelectedItem;
if (s == toChannel)
content.Navigate(typeof(Channel), SecretsVault.AccountId);
else if (s == toRemoveAds)
content.Navigate(typeof(Settings), "adblock");
else
content.Navigate(typeof(Settings));
if (s == toChannel)
content.Navigate(typeof(Channel), SecretsVault.AccountId);
else if (s == toRemoveAds)
content.Navigate(typeof(Settings), "adblock");
else
content.Navigate(typeof(Settings));
}
catch { }
}
void SubscriptionSelected(object sender, SelectionChangedEventArgs e)
{
if (subscriptionsList.SelectedItem == null)
return;
try
{
if (subscriptionsList.SelectedItem == null)
return;
mainList.SelectedItem = null;
categoriesList.SelectedItem = null;
serviceList.SelectedItem = null;
mainList.SelectedItem = null;
categoriesList.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)
{
if (serviceList.SelectedItem == null)
return;
mainList.SelectedItem = null;
subscriptionsList.SelectedItem = null;
serviceList.SelectedItem = null;
switch (serviceList.SelectedIndex)
try
{
case 0:
content.Navigate(typeof(Channel), "UC-9-kyTW8ZkZNDHQJ6FgpwQ");
break;
case 1:
content.Navigate(typeof(Channel), "UCEgdi0XIXXZ-qJOFPf4JSKw");
break;
case 2:
content.Navigate(typeof(Channel), "UCOpNcN46UbXVtpKMrmU4Abg");
break;
case 3:
content.Navigate(typeof(Channel), "UCYfdidRxbB8Qhf0Nx7ioOYw");
break;
case 4:
content.Navigate(typeof(Channel), "UC4R8DWoMoI7CAwX8_LjQHig");
break;
case 5:
content.Navigate(typeof(Channel), "UC8iNz9uwDGfomRnnKKbOhOQ");
break;
case 6:
content.Navigate(typeof(Channel), "UCzuqhhs6NWbgTzMuM09WKDQ");
break;
if (serviceList.SelectedItem == null)
return;
mainList.SelectedItem = null;
subscriptionsList.SelectedItem = null;
serviceList.SelectedItem = null;
switch (categoriesList.SelectedIndex)
{
case 0:
GoToChannel("UC-9-kyTW8ZkZNDHQJ6FgpwQ");
break;
case 1:
GoToChannel("UCEgdi0XIXXZ-qJOFPf4JSKw");
break;
case 2:
GoToChannel("UCOpNcN46UbXVtpKMrmU4Abg");
break;
case 3:
GoToChannel("UCYfdidRxbB8Qhf0Nx7ioOYw");
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)
{
notificationMenu.Content = "";
+3 -3
View File
@@ -73,15 +73,15 @@ namespace FoxTube.Pages
try
{
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;
Google.Apis.YouTube.v3.Data.Channel channel = (await channelRequest.ExecuteAsync()).Items[0];
avatar.ProfilePicture = new BitmapImage(new Uri(channel.Snippet.Thumbnails.Medium.Url));
}
catch { }
PlaylistItemsResource.ListRequest listRequest = SecretsVault.NoAuthService.PlaylistItems.List("contentDetails");
listRequest.PlaylistId = item.Id;
PlaylistItemsResource.ListRequest listRequest = SecretsVault.Service.PlaylistItems.List("contentDetails");
listRequest.PlaylistId = id;
listRequest.MaxResults = 50;
PlaylistItemListResponse response = await listRequest.ExecuteAsync();