Put SwipeView behind experimental flag (#8786)
authorShane Neuville <shneuvil@microsoft.com>
Fri, 6 Dec 2019 19:00:35 +0000 (12:00 -0700)
committerSamantha Houts <samhouts@users.noreply.github.com>
Fri, 6 Dec 2019 19:00:35 +0000 (11:00 -0800)
* Put SwipeView behind experimental flag

* Update Xamarin.Forms.ControlGallery.Android/FormsAppCompatActivity.cs

Xamarin.Forms.ControlGallery.Android/FormsAppCompatActivity.cs
Xamarin.Forms.ControlGallery.WindowsUniversal/App.xaml.cs
Xamarin.Forms.ControlGallery.iOS/AppDelegate.cs
Xamarin.Forms.Core/ExperimentalFlags.cs
Xamarin.Forms.Core/SwipeView.cs
Xamarin.Forms.Platform.Android/Renderers/SwipeViewRenderer.cs
Xamarin.Forms.Platform.UAP/SwipeViewRenderer.cs
Xamarin.Forms.Platform.iOS/Renderers/SwipeViewRenderer.cs

index 2ee5a7c..8bbd52a 100644 (file)
@@ -44,7 +44,7 @@ namespace Xamarin.Forms.ControlGallery.Android
                        // Fake_Flag is here so we can test for flag initialization issues
                        Forms.SetFlags("Fake_Flag"/*, "CollectionView_Experimental", "Shell_Experimental"*/); 
 #else
-                       Forms.SetFlags("UseLegacyRenderers"/*, "CollectionView_Experimental", "Shell_Experimental" */);
+                       Forms.SetFlags("UseLegacyRenderers", "SwipeView_Experimental");
 #endif
                        Forms.Init(this, bundle);
 
index 615c37b..4e5b8cd 100644 (file)
@@ -70,7 +70,7 @@ namespace Xamarin.Forms.ControlGallery.WindowsUniversal
 
                 rootFrame.NavigationFailed += OnNavigationFailed;
 
-                               Forms.SetFlags("Shell_UWP_Experimental");
+                               Forms.SetFlags("Shell_UWP_Experimental", "SwipeView_Experimental");
                                Forms.Init (e);
                                //FormsMaps.Init (Controls.App.Config["UWPMapsAuthKey"]);
 
index 2785c00..b780200 100644 (file)
@@ -150,7 +150,7 @@ namespace Xamarin.Forms.ControlGallery.iOS
                        App.IOSVersion = int.Parse(versionPart[0]);
 
                        Xamarin.Calabash.Start();
-                       // Forms.SetFlags("CollectionView_Experimental", "Shell_Experimental");
+                       Forms.SetFlags("SwipeView_Experimental");
                        Forms.Init();
                        FormsMaps.Init();
                        FormsMaterial.Init();
index 7d6725d..11bc2ba 100644 (file)
@@ -12,6 +12,7 @@ namespace Xamarin.Forms
                internal const string IndicatorViewExperimental = "IndicatorView_Experimental";
                internal const string ShellUWPExperimental = "Shell_UWP_Experimental";
                internal const string CarouselViewExperimental = "CarouselView_Experimental";
+               internal const string SwipeViewExperimental = "SwipeView_Experimental";
 
                [EditorBrowsable(EditorBrowsableState.Never)]
                public static void VerifyFlagEnabled(
index 561371a..d6e7b4b 100644 (file)
@@ -1,5 +1,6 @@
 using System;
 using System.ComponentModel;
+using System.Runtime.CompilerServices;
 using Xamarin.Forms.Platform;
 
 namespace Xamarin.Forms
@@ -15,6 +16,15 @@ namespace Xamarin.Forms
                        _platformConfigurationRegistry = new Lazy<PlatformConfigurationRegistry<SwipeView>>(() => new PlatformConfigurationRegistry<SwipeView>(this));
                }
 
+
+               [EditorBrowsable(EditorBrowsableState.Never)]
+               public static void VerifySwipeViewFlagEnabled(
+                       string constructorHint = null,
+                       [CallerMemberName] string memberName = "")
+               {
+                       ExperimentalFlags.VerifyFlagEnabled(nameof(SwipeView), ExperimentalFlags.SwipeViewExperimental, memberName: memberName);
+               }
+
                public static readonly BindableProperty LeftItemsProperty = BindableProperty.Create(nameof(LeftItems), typeof(SwipeItems), typeof(SwipeView), null, BindingMode.OneWay, null, defaultValueCreator: SwipeItemsDefaultValueCreator);
                public static readonly BindableProperty RightItemsProperty = BindableProperty.Create(nameof(RightItems), typeof(SwipeItems), typeof(SwipeView), null, BindingMode.OneWay, null, defaultValueCreator: SwipeItemsDefaultValueCreator);
                public static readonly BindableProperty TopItemsProperty = BindableProperty.Create(nameof(TopItems), typeof(SwipeItems), typeof(SwipeView), null, BindingMode.OneWay, null, defaultValueCreator: SwipeItemsDefaultValueCreator);
index 72187a2..8c0179d 100644 (file)
@@ -45,6 +45,7 @@ namespace Xamarin.Forms.Platform.Android
 
                public SwipeViewRenderer(Context context) : base(context)
                {
+                       Xamarin.Forms.SwipeView.VerifySwipeViewFlagEnabled(nameof(SwipeViewRenderer));
                        _context = context;
 
                        AutoPackage = false;
index 81a2247..512b80c 100755 (executable)
@@ -21,6 +21,7 @@ namespace Xamarin.Forms.Platform.UWP
 
                public SwipeViewRenderer()
                {
+                       Xamarin.Forms.SwipeView.VerifySwipeViewFlagEnabled(nameof(SwipeViewRenderer));
                        AutoPackage = false;
                }
 
index 27eb95a..94177fe 100644 (file)
@@ -35,6 +35,8 @@ namespace Xamarin.Forms.Platform.iOS
 
                public SwipeViewRenderer()
                {
+                       Xamarin.Forms.SwipeView.VerifySwipeViewFlagEnabled(nameof(SwipeViewRenderer));
+
                        _tapGestureRecognizer = new UITapGestureRecognizer(OnTap)
                        {
                                CancelsTouchesInView = true