seek indicator for miniview & s char after secured links fixed
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using MyToolkit.Multimedia;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
using Windows.UI;
|
||||
@@ -56,20 +57,24 @@ namespace FoxTube
|
||||
Regex regx = new Regex(@"(http(s)?://[\S]+|www.[\S]+|[\S]+@[\S]+)", RegexOptions.IgnoreCase);
|
||||
Regex isWWW = new Regex(@"(http[s]?://[\S]+|www.[\S]+)");
|
||||
Regex isEmail = new Regex(@"[\S]+@[\S]+");
|
||||
foreach (var item in regx.Split(text))
|
||||
foreach (string item in regx.Split(text))
|
||||
{
|
||||
if (isWWW.IsMatch(item))
|
||||
{
|
||||
Hyperlink link = new Hyperlink { NavigateUri = new Uri(item.ToLower().StartsWith("http") ? item : $"http://{item}"), Foreground = new SolidColorBrush(Colors.Red) };
|
||||
Debug.WriteLine(item);
|
||||
Hyperlink link = new Hyperlink { NavigateUri = new Uri(item), Foreground = new SolidColorBrush(Colors.Red) };
|
||||
link.Inlines.Add(new Run { Text = item });
|
||||
block.Inlines.Add(link);
|
||||
}
|
||||
else if (isEmail.IsMatch(item))
|
||||
{
|
||||
Debug.WriteLine(item);
|
||||
Hyperlink link = new Hyperlink { NavigateUri = new Uri($"mailto:{item}"), Foreground = new SolidColorBrush(Colors.Red) };
|
||||
link.Inlines.Add(new Run { Text = item });
|
||||
block.Inlines.Add(link);
|
||||
}
|
||||
else if (item == "s")
|
||||
continue;
|
||||
else block.Inlines.Add(new Run { Text = item });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,6 +57,7 @@
|
||||
Content=""
|
||||
Width="45" Height="45"
|
||||
ToolTipService.ToolTip="Maximize"/>
|
||||
<ProgressBar VerticalAlignment="Bottom" Foreground="Red" Name="seekIndicator" Visibility="Collapsed"/>
|
||||
</Grid>
|
||||
|
||||
<Button Name="skipAd" Visibility="Collapsed" Margin="0,0,0,25" Grid.Row="1" HorizontalAlignment="Right" Foreground="White" VerticalAlignment="Bottom" Padding="10" BorderBrush="Black" BorderThickness="2" Background="#7E000000">
|
||||
|
||||
@@ -234,6 +234,7 @@ namespace FoxTube
|
||||
|
||||
total = XmlConvert.ToTimeSpan(item.ContentDetails.Duration);
|
||||
seek.Maximum = total.TotalSeconds;
|
||||
seekIndicator.Maximum = total.TotalSeconds;
|
||||
|
||||
elapsed = TimeSpan.FromSeconds(seek.Value);
|
||||
remaining = total.Subtract(elapsed);
|
||||
@@ -321,6 +322,7 @@ namespace FoxTube
|
||||
void SeekElapsed()
|
||||
{
|
||||
seek.Value = videoSource.Position.TotalSeconds;
|
||||
seekIndicator.Value = seek.Value;
|
||||
}
|
||||
|
||||
void Elapsed()
|
||||
@@ -332,6 +334,7 @@ namespace FoxTube
|
||||
touchCentral.Visibility = Visibility.Collapsed;
|
||||
if (pointerCaptured)
|
||||
Window.Current.CoreWindow.PointerCursor = null;
|
||||
seekIndicator.Visibility = Visibility.Collapsed;
|
||||
t.Stop();
|
||||
}
|
||||
}
|
||||
@@ -410,11 +413,10 @@ namespace FoxTube
|
||||
}
|
||||
|
||||
void ShowControls()
|
||||
{
|
||||
if(controls.Visibility == Visibility.Collapsed)
|
||||
{
|
||||
controls.Visibility = Visibility.Visible;
|
||||
}
|
||||
if (miniView)
|
||||
seekIndicator.Visibility = Visibility.Visible;
|
||||
if (pointerCaptured)
|
||||
Window.Current.CoreWindow.PointerCursor = cursorBackup;
|
||||
t.Stop();
|
||||
@@ -603,6 +605,7 @@ namespace FoxTube
|
||||
}
|
||||
|
||||
await ApplicationView.GetForCurrentView().TryEnterViewModeAsync(ApplicationViewMode.CompactOverlay);
|
||||
pointerCaptured = false;
|
||||
|
||||
titleBar.ButtonBackgroundColor = Colors.Transparent;
|
||||
titleBar.ButtonInactiveBackgroundColor = Colors.Transparent;
|
||||
@@ -717,6 +720,7 @@ namespace FoxTube
|
||||
Width = 432;
|
||||
Height = 243;
|
||||
|
||||
miniView = true;
|
||||
Methods.MainPage.MinimizeVideo();
|
||||
|
||||
mainControls.Visibility = Visibility.Collapsed;
|
||||
@@ -738,11 +742,12 @@ namespace FoxTube
|
||||
|
||||
private void maximize_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
SetFullSize.Invoke(this, null);
|
||||
SetFullSize.Invoke(this, false);
|
||||
|
||||
Width = double.NaN;
|
||||
Height = double.NaN;
|
||||
|
||||
miniView = false;
|
||||
Methods.MainPage.MaximizeVideo();
|
||||
|
||||
mainControls.Visibility = Visibility.Visible;
|
||||
|
||||
Reference in New Issue
Block a user