Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

Commit

Permalink
Drop AppTheme flag
Browse files Browse the repository at this point in the history
  • Loading branch information
StephaneDelcroix committed Jul 31, 2020
1 parent 5754d1a commit dee96d8
Show file tree
Hide file tree
Showing 10 changed files with 5 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ protected override void OnCreate(Bundle bundle)

#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);

Expand Down
2 changes: 1 addition & 1 deletion Xamarin.Forms.ControlGallery.WindowsUniversal/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ protected override void OnLaunched(LaunchActivatedEventArgs e)

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"]);

Expand Down
2 changes: 1 addition & 1 deletion Xamarin.Forms.ControlGallery.iOS/AppDelegate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public override bool FinishedLaunching(UIApplication uiApplication, NSDictionary
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__
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ void ButtonClicked(object sender, System.EventArgs e)
button.Text = "AppTheme Enabled!";
button.TextColor = Color.Black;
button.IsEnabled = false;

Device.SetFlags(new[] { ExperimentalFlags.AppThemeExperimental });
}
}
}
2 changes: 0 additions & 2 deletions Xamarin.Forms.Core.UnitTests/AppThemeTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ public override void Setup()
{
base.Setup();
Application.Current = new MockApplication();

Device.SetFlags(new[] { ExperimentalFlags.AppThemeExperimental });
}

[Test]
Expand Down
3 changes: 0 additions & 3 deletions Xamarin.Forms.Core/Application.cs
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,6 @@ public void TriggerThemeChanged(AppThemeChangedEventArgs args)

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)
Expand Down
6 changes: 1 addition & 5 deletions Xamarin.Forms.Core/BindableObjectExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,7 @@ public static T GetPropertyIfSet<T>(this BindableObject bindableObject, Bindable
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);
}
Expand Down
3 changes: 1 addition & 2 deletions Xamarin.Forms.Core/ExperimentalFlags.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,13 @@

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";
Expand Down
1 change: 0 additions & 1 deletion Xamarin.Forms.Xaml.UnitTests/OnAppThemeTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ public class OnAppThemeTests : BaseTestFixture
public override void Setup()
{
base.Setup();
Device.SetFlags(new[] { "AppTheme_Experimental" });
Application.Current = new MockApplication();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@ public class AppThemeBindingExtension : IMarkupExtension<BindingBase>
object _dark;
bool _hasdark;

public AppThemeBindingExtension()
{
ExperimentalFlags.VerifyFlagEnabled(nameof(AppThemeBindingExtension), ExperimentalFlags.AppThemeExperimental, nameof(AppThemeBindingExtension));
}

public object Default
{
get => _default; set
Expand Down

0 comments on commit dee96d8

Please sign in to comment.