Archived
1
0

Channel overview features implementation

This commit is contained in:
Michael Gordeev
2018-05-15 22:03:02 +03:00
parent 4bedece70d
commit 0ebaee13e6
4 changed files with 25 additions and 49 deletions
+11 -24
View File
@@ -20,12 +20,6 @@
<HyperlinkButton Foreground="White" Margin="0,0,10,0" Name="toPlaylists" Click="toPlaylists_Click">
<TextBlock Text="Playlists"/>
</HyperlinkButton>
<HyperlinkButton Foreground="White" Margin="0,0,10,0" Name="toCommunity" Click="toCommunity_Click">
<TextBlock Text="Community"/>
</HyperlinkButton>
<HyperlinkButton Foreground="White" Margin="0,0,10,0" Name="toChannels" Click="toChannels_Click">
<TextBlock Text="Channels"/>
</HyperlinkButton>
<HyperlinkButton Foreground="White" Margin="0,0,10,0" Name="toAbout" Click="toAbout_Click">
<TextBlock Text="About channel"/>
</HyperlinkButton>
@@ -64,8 +58,17 @@
<ToggleButton Grid.Column="3" Height="50" Width="50" FontFamily="Segoe MDL2 Assets" FontSize="18" FontWeight="SemiBold" Content="" Foreground="White" Background="Red"/>
<!--&#xE781;&#xE93E;&#xEDAC;-->
</Grid>
<StackPanel Name="videos">
<StackPanel Grid.Row="2" Name="videos" Orientation="Horizontal">
<local:VideoCard/>
<local:VideoCard/>
<local:VideoCard/>
<local:VideoCard/>
<local:VideoCard/>
<local:VideoCard/>
<local:VideoCard/>
<local:VideoCard/>
<local:VideoCard/>
<local:VideoCard/>
</StackPanel>
</Grid>
</PivotItem>
@@ -80,22 +83,6 @@
</StackPanel>
</Grid>
</PivotItem>
<PivotItem Margin="0,-48,0,0">
<StackPanel Padding="10">
<TextBlock FontSize="28" Text="Community"/>
<StackPanel Name="community">
</StackPanel>
</StackPanel>
</PivotItem>
<PivotItem Margin="0,-48,0,0">
<StackPanel Padding="10">
<TextBlock FontSize="28" Text="Featured channels"/>
<StackPanel Name="channels">
</StackPanel>
</StackPanel>
</PivotItem>
<PivotItem Margin="0,-48,0,0">
<StackPanel Visibility="Visible" Margin="10">
<TextBlock FontSize="28" Text="About this channel"/>
+6 -24
View File
@@ -36,7 +36,7 @@ namespace FoxTube
private void toAbout_Click(object sender, RoutedEventArgs e)
{
content.SelectedIndex = 4;
content.SelectedIndex = 2;
}
public async void Initialize(string id)
@@ -65,6 +65,8 @@ namespace FoxTube
description.Text = item.Snippet.Description;
views.Text = item.Statistics.ViewCount.ToString();
registration.Text = item.Snippet.PublishedAt.ToString();
searchChannel.Text = item.Snippet.Title;
}
private void toVideos_Click(object sender, RoutedEventArgs e)
@@ -100,19 +102,9 @@ namespace FoxTube
}
}
private void toCommunity_Click(object sender, RoutedEventArgs e)
{
content.SelectedIndex = 2;
}
private void toChannels_Click(object sender, RoutedEventArgs e)
{
content.SelectedIndex = 3;
}
private async void searchButton_Click(object sender, RoutedEventArgs e)
{
content.SelectedIndex = 5;
content.SelectedIndex = 3;
YouTubeService ytService = new YouTubeService(new BaseClientService.Initializer()
{
@@ -122,6 +114,7 @@ namespace FoxTube
var searchListRequest = ytService.Search.List("snippet");
searchListRequest.Q = searchField.Text;
searchListRequest.ChannelId = channelId;
searchListRequest.MaxResults = 25;
var response = await searchListRequest.ExecuteAsync();
@@ -136,10 +129,7 @@ namespace FoxTube
public void SetResults(string keyword, int count)
{
searchTerm.Text = keyword;
if (count == 1000000)
resultsCount.Text = count + "+";
else
resultsCount.Text = count.ToString();
resultsCount.Text = count.ToString();
}
public void AddItem(SearchResult result)
@@ -151,18 +141,10 @@ namespace FoxTube
resultsList.Children.Add(vCard);
break;
case "youtube#channel":
ChannelCard cCard = new ChannelCard(result.Id.ChannelId, result.Snippet.LiveBroadcastContent);
resultsList.Children.Add(cCard);
break;
case "youtube#playlist":
PlaylistCardWide pCard = new PlaylistCardWide(result.Id.PlaylistId);
resultsList.Children.Add(pCard);
break;
default:
break;
}
}
}
+3
View File
@@ -279,6 +279,9 @@
</Page>
</ItemGroup>
<ItemGroup>
<PackageReference Include="AdaptiveCards.Rendering.Uwp">
<Version>1.0.1</Version>
</PackageReference>
<PackageReference Include="Google.Apis">
<Version>1.32.2</Version>
</PackageReference>
+5 -1
View File
@@ -8,7 +8,11 @@
mc:Ignorable="d"
HorizontalAlignment="Stretch"
VerticalAlignment="Top"
SizeChanged="UserControl_SizeChanged">
SizeChanged="UserControl_SizeChanged"
d:DesignHeight="290"
d:DesignWidth="384"
MaxHeight="300"
MaxWidth="400">
<Button Padding="0" Background="Transparent" VerticalAlignment="Top">
<Grid Background="WhiteSmoke" BorderBrush="LightGray" BorderThickness="1">