This commit is contained in:
Stephane Delcroix 2020-08-01 10:10:15 +02:00 коммит произвёл GitHub
Родитель 57aefa6ade
Коммит 62b59281b3
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
10 изменённых файлов: 5 добавлений и 23 удалений

Просмотреть файл

@ -45,7 +45,7 @@ namespace Xamarin.Forms.ControlGallery.Android
#if TEST_EXPERIMENTAL_RENDERERS
#else
Forms.SetFlags("UseLegacyRenderers", "SwipeView_Experimental", "MediaElement_Experimental", "AppTheme_Experimental");
Forms.SetFlags("UseLegacyRenderers", "SwipeView_Experimental", "MediaElement_Experimental");
#endif
Forms.Init(this, bundle);

Просмотреть файл

@ -71,7 +71,7 @@ namespace Xamarin.Forms.ControlGallery.WindowsUniversal
rootFrame.NavigationFailed += OnNavigationFailed;
Forms.SetFlags("Shell_UWP_Experimental", "SwipeView_Experimental", "MediaElement_Experimental", "AppTheme_Experimental");
Forms.SetFlags("Shell_UWP_Experimental", "SwipeView_Experimental", "MediaElement_Experimental");
Forms.Init (e);
//FormsMaps.Init (Controls.App.Config["UWPMapsAuthKey"]);

Просмотреть файл

@ -151,7 +151,7 @@ namespace Xamarin.Forms.ControlGallery.iOS
App.IOSVersion = int.Parse(versionPart[0]);
Xamarin.Calabash.Start();
Forms.SetFlags("SwipeView_Experimental", "MediaElement_Experimental", "AppTheme_Experimental");
Forms.SetFlags("SwipeView_Experimental", "MediaElement_Experimental");
Forms.Init();
FormsMaps.Init();
#if __XCODE11__

Просмотреть файл

@ -42,8 +42,6 @@
button.Text = "AppTheme Enabled!";
button.TextColor = Color.Black;
button.IsEnabled = false;
Device.SetFlags(new[] { ExperimentalFlags.AppThemeExperimental });
}
}
}

Просмотреть файл

@ -10,8 +10,6 @@ namespace Xamarin.Forms.Core.UnitTests
{
base.Setup();
Application.Current = new MockApplication();
Device.SetFlags(new[] { ExperimentalFlags.AppThemeExperimental });
}
[Test]

Просмотреть файл

@ -189,9 +189,6 @@ namespace Xamarin.Forms
void TriggerThemeChangedActual(AppThemeChangedEventArgs args)
{
if (Device.Flags == null || Device.Flags.IndexOf(ExperimentalFlags.AppThemeExperimental) == -1)
return;
// On iOS the event is triggered more than once.
// To minimize that for us, we only do it when the theme actually changes and it's not currently firing
if (_themeChangedFiring || RequestedTheme == _lastAppTheme)

Просмотреть файл

@ -68,11 +68,7 @@ namespace Xamarin.Forms
return returnIfNotSet;
}
public static void SetOnAppTheme<T>(this BindableObject self, BindableProperty targetProperty, T light, T dark)
{
ExperimentalFlags.VerifyFlagEnabled(nameof(BindableObjectExtensions), ExperimentalFlags.AppThemeExperimental, nameof(BindableObjectExtensions), nameof(SetOnAppTheme));
self.SetBinding(targetProperty, new AppThemeBinding { Light = light, Dark = dark});
}
public static void SetOnAppTheme<T>(this BindableObject self, BindableProperty targetProperty, T light, T dark) => self.SetBinding(targetProperty, new AppThemeBinding { Light = light, Dark = dark});
public static void SetAppThemeColor(this BindableObject self, BindableProperty targetProperty, Color light, Color dark) => SetOnAppTheme(self, targetProperty, light, dark);
}

Просмотреть файл

@ -7,14 +7,13 @@ using System.Text;
namespace Xamarin.Forms
{
internal static class ExperimentalFlags
static class ExperimentalFlags
{
internal const string ShellUWPExperimental = "Shell_UWP_Experimental";
internal const string CarouselViewExperimental = "CarouselView_Experimental";
internal const string SwipeViewExperimental = "SwipeView_Experimental";
internal const string MediaElementExperimental = "MediaElement_Experimental";
internal const string MarkupExperimental = "Markup_Experimental";
internal const string AppThemeExperimental = "AppTheme_Experimental";
internal const string ExpanderExperimental = "Expander_Experimental";
internal const string RadioButtonExperimental = "RadioButton_Experimental";
internal const string ShapesExperimental = "Shapes_Experimental";

Просмотреть файл

@ -11,7 +11,6 @@ namespace Xamarin.Forms.Xaml.UnitTests
public override void Setup()
{
base.Setup();
Device.SetFlags(new[] { "AppTheme_Experimental" });
Application.Current = new MockApplication();
}

Просмотреть файл

@ -14,11 +14,6 @@ namespace Xamarin.Forms.Xaml
object _dark;
bool _hasdark;
public AppThemeBindingExtension()
{
ExperimentalFlags.VerifyFlagEnabled(nameof(AppThemeBindingExtension), ExperimentalFlags.AppThemeExperimental, nameof(AppThemeBindingExtension));
}
public object Default
{
get => _default; set