Archived
1
0
#191: Done
This commit is contained in:
Michael Gordeev
2018-09-27 20:32:06 +03:00
parent 861631d0bd
commit 02327ad55d
4 changed files with 69 additions and 24 deletions
+9 -4
View File
@@ -23,14 +23,19 @@
<PersonPicture Tapped="avatar_Tapped" Name="avatar" Height="50" Margin="5" VerticalAlignment="Top"/>
<Grid Grid.Column="1" Margin="5">
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
<RowDefinition/>
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
<TextBlock Name="meta" TextWrapping="WrapWholeWords" Foreground="Gray" FontSize="13" Text="[Author's name] | [Published time span] [?](edited)"/>
<TextBlock Name="text" IsTextSelectionEnabled="True" TextWrapping="WrapWholeWords" Grid.Row="1" Text="[Content]"/>
<TextBlock Name="author" TextWrapping="WrapWholeWords" Foreground="Gray" FontSize="13" Text="[Author's name]"/>
<Border Name="authorBorder" HorizontalAlignment="Left" Background="Red" CornerRadius="5" Visibility="Collapsed">
<TextBlock Name="specialAuthor" TextWrapping="WrapWholeWords" Foreground="White" FontSize="13" Text="[Author's name]" Padding="2,0,2,2"/>
</Border>
<TextBlock Name="meta" Grid.Row="1" TextWrapping="WrapWholeWords" Foreground="Gray" FontSize="13" Text="[Published time span] [?](edited)"/>
<TextBlock Name="text" IsTextSelectionEnabled="True" TextWrapping="WrapWholeWords" Grid.Row="2" Text="[Content]"/>
<StackPanel Grid.Row="1" Name="editor" Visibility="Collapsed">
<StackPanel Grid.Row="2" Name="editor" Visibility="Collapsed">
<TextBox Name="editorText" Text="[Content]" AcceptsReturn="True" Height="Auto" TextChanged="editorText_TextChanged"/>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,5,0,5">
<Button Name="editorClose" Content="Cancel" Click="editorClose_Click"/>
@@ -39,7 +44,7 @@
<ProgressBar Name="editorSending" Foreground="Red" IsIndeterminate="True" Visibility="Collapsed"/>
</StackPanel>
<StackPanel Grid.Row="2" Orientation="Horizontal">
<StackPanel Grid.Row="3" Orientation="Horizontal">
<TextBlock Name="upvote" Foreground="Gray" Padding="0"
VerticalAlignment="Center" Margin="0,0,5,0"
FontFamily="Segoe MDL2 Assets" Text="&#xE19F;" FontSize="20"/>
+31 -2
View File
@@ -57,9 +57,22 @@ namespace FoxTube.Controls
rating.Text = comment.Snippet.TopLevelComment.Snippet.LikeCount.HasValue ? comment.Snippet.TopLevelComment.Snippet.LikeCount.ToString() : "";
if (item.Snippet.AuthorChannelId.ToString().Split('"')[3] == SecretsVault.AccountId)
{
specialAuthor.Text = comment.Snippet.TopLevelComment.Snippet.AuthorDisplayName;
authorBorder.Visibility = Visibility.Visible;
author.Visibility = Visibility.Collapsed;
editBtn.Visibility = Visibility.Visible;
}
else if (item.Snippet.AuthorChannelId.ToString().Split('"')[3] == Methods.MainPage.GetCurrentItem().Snippet.ChannelId)
{
specialAuthor.Text = comment.Snippet.TopLevelComment.Snippet.AuthorDisplayName;
authorBorder.Visibility = Visibility.Visible;
author.Visibility = Visibility.Collapsed;
}
else
author.Text = comment.Snippet.TopLevelComment.Snippet.AuthorDisplayName;
meta.Text = string.Format("{0} | {1} {2}", comment.Snippet.TopLevelComment.Snippet.AuthorDisplayName, Methods.GetAgo(comment.Snippet.TopLevelComment.Snippet.PublishedAt.Value), comment.Snippet.TopLevelComment.Snippet.UpdatedAt != comment.Snippet.TopLevelComment.Snippet.PublishedAt ? "(edited)" : "");
meta.Text = string.Format("{0} {1}", Methods.GetAgo(comment.Snippet.TopLevelComment.Snippet.PublishedAt.Value), comment.Snippet.TopLevelComment.Snippet.UpdatedAt != comment.Snippet.TopLevelComment.Snippet.PublishedAt ? "(edited)" : "");
Methods.FormatText(ref text, comment.Snippet.TopLevelComment.Snippet.TextDisplay);
try { avatar.ProfilePicture = new BitmapImage(new Uri(comment.Snippet.TopLevelComment.Snippet.AuthorProfileImageUrl)); }
@@ -89,7 +102,23 @@ namespace FoxTube.Controls
else
rating.Text = comment.Snippet.LikeCount.HasValue ? comment.Snippet.LikeCount.ToString() : "";
meta.Text = string.Format("{0} | {1} {2}", comment.Snippet.AuthorDisplayName, Methods.GetAgo(comment.Snippet.PublishedAt.Value), comment.Snippet.UpdatedAt.Value != comment.Snippet.PublishedAt.Value ? "(edited)" : "");
if (item.Snippet.AuthorChannelId.ToString().Split('"')[3] == SecretsVault.AccountId)
{
specialAuthor.Text = comment.Snippet.AuthorDisplayName;
authorBorder.Visibility = Visibility.Visible;
author.Visibility = Visibility.Collapsed;
editBtn.Visibility = Visibility.Visible;
}
else if (item.Snippet.AuthorChannelId.ToString().Split('"')[3] == Methods.MainPage.GetCurrentItem().Snippet.ChannelId)
{
specialAuthor.Text = comment.Snippet.AuthorDisplayName;
authorBorder.Visibility = Visibility.Visible;
author.Visibility = Visibility.Collapsed;
}
else
author.Text = comment.Snippet.AuthorDisplayName;
meta.Text = string.Format("{0} {1}", comment.Snippet.AuthorDisplayName, Methods.GetAgo(comment.Snippet.PublishedAt.Value), comment.Snippet.UpdatedAt.Value != comment.Snippet.PublishedAt.Value ? "(edited)" : "");
Methods.FormatText(ref text, comment.Snippet.TextDisplay);
try { avatar.ProfilePicture = new BitmapImage(new Uri(comment.Snippet.AuthorProfileImageUrl)); }
+11
View File
@@ -144,6 +144,12 @@ namespace FoxTube
SetTitleBar();
}
public Video GetCurrentItem()
{
try { return (videoPlaceholder.Content as VideoPage).item; }
catch { return null; }
}
public void SetTitleBar()
{
var titleBar = ApplicationView.GetForCurrentView().TitleBar;
@@ -307,6 +313,7 @@ namespace FoxTube
public void GoToSearch(SearchParameters args)
{
nav.IsPaneOpen = false;
MinimizeAsInitializer();
content.Navigate(typeof(Search), args);
}
@@ -318,6 +325,8 @@ namespace FoxTube
}
public async void GoToVideo(string id, string playlistId = null)
{
try
{
var connection = NetworkInformation.GetInternetConnectionProfile().GetConnectionCost();
if ((bool)settings.Values["moblieWarning"] && (connection.NetworkCostType == NetworkCostType.Fixed || connection.NetworkCostType == NetworkCostType.Variable))
@@ -340,6 +349,8 @@ namespace FoxTube
if (cancel)
return;
}
}
catch { }
nav.IsPaneOpen = false;
+1 -1
View File
@@ -63,7 +63,7 @@ namespace FoxTube.Pages
public string videoId;
string playlistId = null;
Video item;
public Video item;
List<string> downloads = new List<string>();