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

Commit

Permalink
Put SwipeView behind experimental flag (#8786)
Browse files Browse the repository at this point in the history
* Put SwipeView behind experimental flag

* Update Xamarin.Forms.ControlGallery.Android/FormsAppCompatActivity.cs
  • Loading branch information
PureWeen authored and samhouts committed Dec 6, 2019
1 parent 75f101f commit 5677829
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 3 deletions.
Expand Up @@ -44,7 +44,7 @@ protected override void OnCreate(Bundle bundle)
// 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);

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

rootFrame.NavigationFailed += OnNavigationFailed;

Forms.SetFlags("Shell_UWP_Experimental");
Forms.SetFlags("Shell_UWP_Experimental", "SwipeView_Experimental");
Forms.Init (e);
//FormsMaps.Init (Controls.App.Config["UWPMapsAuthKey"]);

Expand Down
2 changes: 1 addition & 1 deletion Xamarin.Forms.ControlGallery.iOS/AppDelegate.cs
Expand Up @@ -150,7 +150,7 @@ public override bool FinishedLaunching(UIApplication uiApplication, NSDictionary
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();
Expand Down
1 change: 1 addition & 0 deletions Xamarin.Forms.Core/ExperimentalFlags.cs
Expand Up @@ -12,6 +12,7 @@ internal static class ExperimentalFlags
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(
Expand Down
10 changes: 10 additions & 0 deletions Xamarin.Forms.Core/SwipeView.cs
@@ -1,5 +1,6 @@
using System;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using Xamarin.Forms.Platform;

namespace Xamarin.Forms
Expand All @@ -15,6 +16,15 @@ public SwipeView()
_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);
Expand Down
Expand Up @@ -45,6 +45,7 @@ public class SwipeViewRenderer : ViewRenderer<SwipeView, AView>, GestureDetector

public SwipeViewRenderer(Context context) : base(context)
{
Xamarin.Forms.SwipeView.VerifySwipeViewFlagEnabled(nameof(SwipeViewRenderer));
_context = context;

AutoPackage = false;
Expand Down
1 change: 1 addition & 0 deletions Xamarin.Forms.Platform.UAP/SwipeViewRenderer.cs
Expand Up @@ -21,6 +21,7 @@ public class SwipeViewRenderer : ViewRenderer<SwipeView, WSwipeControl>

public SwipeViewRenderer()
{
Xamarin.Forms.SwipeView.VerifySwipeViewFlagEnabled(nameof(SwipeViewRenderer));
AutoPackage = false;
}

Expand Down
2 changes: 2 additions & 0 deletions Xamarin.Forms.Platform.iOS/Renderers/SwipeViewRenderer.cs
Expand Up @@ -35,6 +35,8 @@ public class SwipeViewRenderer : ViewRenderer<SwipeView, UIView>

public SwipeViewRenderer()
{
Xamarin.Forms.SwipeView.VerifySwipeViewFlagEnabled(nameof(SwipeViewRenderer));

_tapGestureRecognizer = new UITapGestureRecognizer(OnTap)
{
CancelsTouchesInView = true
Expand Down

0 comments on commit 5677829

Please sign in to comment.