#200: Fixed, Orientation support cut
This commit is contained in:
@@ -82,7 +82,7 @@
|
||||
</StackPanel>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
<ProgressBar Grid.Row="2" VerticalAlignment="Bottom" IsIndeterminate="True" Visibility="Collapsed" Name="commentsLoading"/>
|
||||
<ProgressBar Grid.Row="3" VerticalAlignment="Bottom" IsIndeterminate="True" Visibility="Collapsed" Name="commentsLoading"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
|
||||
@@ -218,7 +218,7 @@ namespace FoxTube.Controls
|
||||
|
||||
private void editorClose_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
((grid.Children[0] as Grid).Children[1] as Grid).RowDefinitions[2].Height = GridLength.Auto;
|
||||
((grid.Children[0] as Grid).Children[1] as Grid).RowDefinitions[3].Height = GridLength.Auto;
|
||||
text.Visibility = Visibility.Visible;
|
||||
editor.Visibility = Visibility.Collapsed;
|
||||
}
|
||||
@@ -236,11 +236,15 @@ namespace FoxTube.Controls
|
||||
item.Snippet.UpdatedAt = DateTime.Now;
|
||||
|
||||
if (type == CommentType.Reply)
|
||||
{
|
||||
await SecretsVault.Service.Comments.Update(item, "snippet").ExecuteAsync();
|
||||
Initialize(item);
|
||||
}
|
||||
else
|
||||
{
|
||||
thread.Snippet.TopLevelComment = item;
|
||||
await SecretsVault.Service.CommentThreads.Update(thread, "snippet").ExecuteAsync();
|
||||
Initialize(thread);
|
||||
}
|
||||
|
||||
editorClose_Click(this, null);
|
||||
@@ -265,7 +269,7 @@ namespace FoxTube.Controls
|
||||
|
||||
private void editBtn_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
((grid.Children[0] as Grid).Children[1] as Grid).RowDefinitions[2].Height = new GridLength(0);
|
||||
((grid.Children[0] as Grid).Children[1] as Grid).RowDefinitions[3].Height = new GridLength(0);
|
||||
text.Visibility = Visibility.Collapsed;
|
||||
editorText.Text = text.Text;
|
||||
editor.Visibility = Visibility.Visible;
|
||||
|
||||
@@ -44,12 +44,9 @@ using Windows.System.Profile;
|
||||
|
||||
namespace FoxTube
|
||||
{
|
||||
public enum DeviceType { Other, Desktop, Mobile }
|
||||
|
||||
public sealed partial class VideoPlayer : UserControl
|
||||
{
|
||||
public string videoId;
|
||||
private DeviceType deviceType = DeviceType.Other;
|
||||
|
||||
private bool miniview = false;
|
||||
public bool MiniView
|
||||
@@ -107,21 +104,6 @@ namespace FoxTube
|
||||
if (!ApplicationView.GetForCurrentView().IsViewModeSupported(ApplicationViewMode.CompactOverlay))
|
||||
miniViewBtn.Visibility = Visibility.Collapsed;
|
||||
|
||||
switch(AnalyticsInfo.VersionInfo.DeviceFamily)
|
||||
{
|
||||
case "Windows.Mobile":
|
||||
deviceType = DeviceType.Mobile;
|
||||
break;
|
||||
|
||||
case "Windows.Desktop":
|
||||
deviceType = DeviceType.Desktop;
|
||||
break;
|
||||
|
||||
default:
|
||||
deviceType = DeviceType.Other;
|
||||
break;
|
||||
}
|
||||
|
||||
captions = grid.Children[2] as LiveCaptions;
|
||||
|
||||
volume.Value = Convert.ToDouble(settings.Values["volume"]);
|
||||
@@ -136,18 +118,6 @@ namespace FoxTube
|
||||
audioSource.CurrentStateChanged += AudioSource_CurrentStateChanged;
|
||||
t.Elapsed += T_Elapsed;
|
||||
seekTimer.Elapsed += SeekTimer_Elapsed;
|
||||
|
||||
if(SimpleOrientationSensor.GetDefault() != null && deviceType == DeviceType.Mobile)
|
||||
{
|
||||
if (SimpleOrientationSensor.GetDefault().GetCurrentOrientation() == SimpleOrientation.Rotated270DegreesCounterclockwise || SimpleOrientationSensor.GetDefault().GetCurrentOrientation() == SimpleOrientation.Rotated90DegreesCounterclockwise)
|
||||
fullscreen_Click(this, null);
|
||||
SimpleOrientationSensor.GetDefault().OrientationChanged += (s, arg) =>
|
||||
{
|
||||
if (((SimpleOrientationSensor.GetDefault().GetCurrentOrientation() == SimpleOrientation.NotRotated || SimpleOrientationSensor.GetDefault().GetCurrentOrientation() == SimpleOrientation.Rotated180DegreesCounterclockwise) && fullScreen) ||
|
||||
((SimpleOrientationSensor.GetDefault().GetCurrentOrientation() == SimpleOrientation.Rotated270DegreesCounterclockwise || SimpleOrientationSensor.GetDefault().GetCurrentOrientation() == SimpleOrientation.Rotated90DegreesCounterclockwise) && !fullScreen))
|
||||
fullscreen_Click(this, null);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public async void Initialize(Video meta, string channelAvatar)
|
||||
@@ -497,18 +467,12 @@ namespace FoxTube
|
||||
ApplicationView.GetForCurrentView().TryEnterFullScreenMode();
|
||||
fullscreen.Content = "\xE1D8";
|
||||
Height = Methods.MainPage.Height;
|
||||
|
||||
if (deviceType == DeviceType.Mobile)
|
||||
DisplayInformation.AutoRotationPreferences = DisplayOrientations.Landscape;
|
||||
}
|
||||
else
|
||||
{
|
||||
ApplicationView.GetForCurrentView().ExitFullScreenMode();
|
||||
fullscreen.Content = "\xE1D9";
|
||||
Height = double.NaN;
|
||||
|
||||
if (deviceType == DeviceType.Mobile)
|
||||
DisplayInformation.AutoRotationPreferences = DisplayOrientations.Portrait;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user