- flags
This commit is contained in:
Родитель
ddf3fbc06d
Коммит
668516548d
|
@ -27,7 +27,6 @@ namespace XamarinTV.Droid
|
|||
base.OnCreate(savedInstanceState);
|
||||
|
||||
Xamarin.Essentials.Platform.Init(this, savedInstanceState);
|
||||
Forms.SetFlags("IndicatorView_Experimental", "CarouselView_Experimental", "MediaElement_Experimental");
|
||||
Forms.Init(this, savedInstanceState);
|
||||
CachedImageRenderer.Init(true);
|
||||
SharpnadoInitializer.Initialize();
|
||||
|
|
|
@ -39,7 +39,6 @@ namespace XamarinTV.UWP
|
|||
rootFrame = new Frame();
|
||||
|
||||
rootFrame.NavigationFailed += OnNavigationFailed;
|
||||
Xamarin.Forms.Forms.SetFlags("IndicatorView_Experimental", "CarouselView_Experimental", "MediaElement_Experimental");
|
||||
Xamarin.Forms.Forms.Init(e); // requires the `e` parameter
|
||||
|
||||
if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
using Xamarin.Forms.PlatformConfiguration;
|
||||
using Xamarin.Forms.PlatformConfiguration.WindowsSpecific;
|
||||
using FormsApplication = Xamarin.Forms.Application;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace XamarinTV
|
||||
{
|
||||
|
@ -20,8 +21,10 @@ namespace XamarinTV
|
|||
}
|
||||
|
||||
_mainPage = new MainPage();
|
||||
MainPage = _mainPage;
|
||||
|
||||
MainPage = _mainPage;
|
||||
|
||||
Xamarin.Forms.Device.SetFlags(new List<string>() { "StateTriggers_Experimental", "IndicatorView_Experimental", "CarouselView_Experimental", "MediaElement_Experimental" });
|
||||
|
||||
On<Windows>().SetImageDirectory("Assets");
|
||||
}
|
||||
|
||||
|
|
|
@ -44,11 +44,25 @@ namespace XamarinTV.Views
|
|||
}
|
||||
}
|
||||
|
||||
bool IsLandscape
|
||||
{
|
||||
get
|
||||
{
|
||||
if (DualScreenInfo.Current.SpanMode == TwoPaneViewMode.SinglePane &&
|
||||
DualScreenInfo.Current.HingeBounds == Rectangle.Zero)
|
||||
return Device.info.CurrentOrientation == Xamarin.Forms.Internals.DeviceOrientation.Landscape ||
|
||||
Device.info.CurrentOrientation == Xamarin.Forms.Internals.DeviceOrientation.LandscapeRight ||
|
||||
Device.info.CurrentOrientation == Xamarin.Forms.Internals.DeviceOrientation.LandscapeLeft;
|
||||
|
||||
return DualScreenInfo.Current.IsLandscape;
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAspectRatio()
|
||||
{
|
||||
Device.BeginInvokeOnMainThread(() =>
|
||||
{
|
||||
if (DualScreenInfo.Current.IsLandscape)
|
||||
if (IsLandscape)
|
||||
{
|
||||
VideoPlayer.Aspect = Aspect.AspectFill;
|
||||
VideoPlayer.HeightRequest = -1;
|
||||
|
|
Загрузка…
Ссылка в новой задаче