Remove requirement for CollectionView Experimental flag (#7907)
* CollectionView_Experimental is dead; long live CarouselView_Experimental! * Change CollectionView enabling button labels to CarouselView for CarouselView tests * Fix UI tests for Carousel * Honor the CollectionView_Experimental flag for CarouselView * Update Issue6963.cs * Update Issue7817.xaml.cs * Remove collection view flag settings
This commit is contained in:
Родитель
2d6a218803
Коммит
98d9245eb4
|
@ -26,8 +26,6 @@ namespace Xamarin.Forms.Controls.Issues
|
|||
public CollectionViewBindingErrors()
|
||||
{
|
||||
#if APP
|
||||
Device.SetFlags(new List<string> { CollectionView.CollectionViewExperimental });
|
||||
|
||||
InitializeComponent();
|
||||
|
||||
var listener = new CountBindingErrors(BindingErrorCount);
|
||||
|
|
|
@ -25,7 +25,6 @@ namespace Xamarin.Forms.Controls.Issues
|
|||
protected override void Init()
|
||||
{
|
||||
#if APP
|
||||
FlagTestHelpers.SetCollectionViewTestFlag();
|
||||
PushAsync(TestPage());
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -22,8 +22,6 @@ namespace Xamarin.Forms.Controls.Issues
|
|||
protected override void Init()
|
||||
{
|
||||
#if APP
|
||||
FlagTestHelpers.SetCollectionViewTestFlag();
|
||||
|
||||
PushAsync(new GalleryPages.CollectionViewGalleries.HeaderFooterGalleries.HeaderFooterString());
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -22,8 +22,6 @@ namespace Xamarin.Forms.Controls.Issues
|
|||
protected override void Init()
|
||||
{
|
||||
#if APP
|
||||
FlagTestHelpers.SetCollectionViewTestFlag();
|
||||
|
||||
PushAsync(new GalleryPages.CollectionViewGalleries.HeaderFooterGalleries.HeaderFooterTemplate());
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -22,8 +22,6 @@ namespace Xamarin.Forms.Controls.Issues
|
|||
protected override void Init()
|
||||
{
|
||||
#if APP
|
||||
FlagTestHelpers.SetCollectionViewTestFlag();
|
||||
|
||||
PushAsync(new GalleryPages.CollectionViewGalleries.HeaderFooterGalleries.HeaderFooterView());
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -23,9 +23,6 @@ namespace Xamarin.Forms.Controls.Issues
|
|||
{
|
||||
protected override void Init()
|
||||
{
|
||||
#if APP
|
||||
FlagTestHelpers.SetCollectionViewTestFlag();
|
||||
#endif
|
||||
Content = new StackLayout()
|
||||
{
|
||||
Children =
|
||||
|
|
|
@ -9,7 +9,7 @@ namespace Xamarin.Forms.Controls.Issues
|
|||
Device.SetFlags(new List<string>(Device.Flags ?? new List<string>()) { flag });
|
||||
}
|
||||
|
||||
public static void SetCollectionViewTestFlag()
|
||||
public static void SetCarouselViewTestFlag()
|
||||
{
|
||||
SetTestFlag("CollectionView_Experimental");
|
||||
}
|
||||
|
|
|
@ -36,8 +36,6 @@ namespace Xamarin.Forms.Controls.Issues
|
|||
|
||||
public Github5623()
|
||||
{
|
||||
Device.SetFlags(new List<string> { CollectionView.CollectionViewExperimental });
|
||||
|
||||
InitializeComponent();
|
||||
|
||||
BindingContext = new ViewModel5623();
|
||||
|
|
|
@ -30,8 +30,6 @@ namespace Xamarin.Forms.Controls.Issues
|
|||
#if APP
|
||||
public Issue5354()
|
||||
{
|
||||
Device.SetFlags(new List<string> { CollectionView.CollectionViewExperimental });
|
||||
|
||||
InitializeComponent();
|
||||
|
||||
BindingContext = new ViewModel5354();
|
||||
|
|
|
@ -23,8 +23,6 @@ namespace Xamarin.Forms.Controls.Issues
|
|||
protected override void Init()
|
||||
{
|
||||
#if APP
|
||||
FlagTestHelpers.SetCollectionViewTestFlag();
|
||||
|
||||
PushAsync(new GalleryPages.CollectionViewGalleries.EmptyViewGalleries.EmptyViewSwapGallery());
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -23,8 +23,6 @@ namespace Xamarin.Forms.Controls.Issues
|
|||
|
||||
protected override void Init()
|
||||
{
|
||||
FlagTestHelpers.SetCollectionViewTestFlag();
|
||||
|
||||
PushAsync(CreateRoot());
|
||||
}
|
||||
|
||||
|
|
|
@ -26,7 +26,6 @@ namespace Xamarin.Forms.Controls.Issues
|
|||
{
|
||||
protected override void Init()
|
||||
{
|
||||
FlagTestHelpers.SetCollectionViewTestFlag();
|
||||
Appearing += Issue5949Appearing;
|
||||
}
|
||||
|
||||
|
|
|
@ -23,8 +23,6 @@ namespace Xamarin.Forms.Controls.Issues
|
|||
protected override void Init()
|
||||
{
|
||||
#if APP
|
||||
FlagTestHelpers.SetCollectionViewTestFlag();
|
||||
|
||||
PushAsync(new GalleryPages.CollectionViewGalleries.SelectionGalleries.SelectionChangedCommandParameter());
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -14,7 +14,6 @@ namespace Xamarin.Forms.Controls.Issues
|
|||
#if APP
|
||||
public Issue6644()
|
||||
{
|
||||
Device.SetFlags(new List<string> { CollectionView.CollectionViewExperimental });
|
||||
InitializeComponent();
|
||||
cv.ItemsSource = new ObservableCollection<int>(Enumerable.Range(0, 10).ToList());
|
||||
}
|
||||
|
|
|
@ -23,8 +23,6 @@ namespace Xamarin.Forms.Controls.Issues
|
|||
protected override void Init()
|
||||
{
|
||||
#if APP
|
||||
FlagTestHelpers.SetCollectionViewTestFlag();
|
||||
|
||||
PushAsync(new GalleryPages.CollectionViewGalleries.SelectionGalleries.SelectionSynchronization());
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -23,8 +23,6 @@ namespace Xamarin.Forms.Controls.Issues
|
|||
protected override void Init()
|
||||
{
|
||||
#if APP
|
||||
FlagTestHelpers.SetCollectionViewTestFlag();
|
||||
|
||||
PushAsync(new GalleryPages.CollectionViewGalleries.ObservableCodeCollectionViewGallery(grid: false));
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -23,7 +23,6 @@ namespace Xamarin.Forms.Controls.Issues
|
|||
{
|
||||
protected override void Init()
|
||||
{
|
||||
FlagTestHelpers.SetCollectionViewTestFlag();
|
||||
PushAsync(CreateRoot());
|
||||
}
|
||||
|
||||
|
|
|
@ -24,7 +24,6 @@ namespace Xamarin.Forms.Controls.Issues
|
|||
|
||||
protected override void Init()
|
||||
{
|
||||
FlagTestHelpers.SetCollectionViewTestFlag();
|
||||
PushAsync(CreateRoot());
|
||||
}
|
||||
|
||||
|
|
|
@ -34,8 +34,6 @@ namespace Xamarin.Forms.Controls.Issues
|
|||
|
||||
public Issue7357()
|
||||
{
|
||||
Device.SetFlags(new List<string> { CollectionView.CollectionViewExperimental });
|
||||
|
||||
InitializeComponent();
|
||||
|
||||
(CollectionView7357.ItemsLayout as LinearItemsLayout).ItemSpacing = 5;
|
||||
|
|
|
@ -30,8 +30,6 @@ namespace Xamarin.Forms.Controls.Issues
|
|||
#if APP
|
||||
public Issue7512()
|
||||
{
|
||||
Device.SetFlags(new List<string> { CollectionView.CollectionViewExperimental });
|
||||
|
||||
InitializeComponent();
|
||||
|
||||
BindingContext = new ViewModel7512();
|
||||
|
|
|
@ -23,7 +23,6 @@ namespace Xamarin.Forms.Controls.Issues
|
|||
protected override void Init()
|
||||
{
|
||||
#if APP
|
||||
FlagTestHelpers.SetCollectionViewTestFlag();
|
||||
PushAsync(new Issue7519Xaml());
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -32,8 +32,6 @@ namespace Xamarin.Forms.Controls.Issues
|
|||
#if APP
|
||||
public Issue7593()
|
||||
{
|
||||
Device.SetFlags(new List<string> { CollectionView.CollectionViewExperimental });
|
||||
|
||||
InitializeComponent();
|
||||
|
||||
BindingContext = new ViewModel7593();
|
||||
|
|
|
@ -32,8 +32,6 @@ namespace Xamarin.Forms.Controls.Issues
|
|||
#if APP
|
||||
public Issue7621()
|
||||
{
|
||||
Device.SetFlags(new List<string> { CollectionView.CollectionViewExperimental });
|
||||
|
||||
InitializeComponent();
|
||||
|
||||
BindingContext = new ViewModel7621();
|
||||
|
|
|
@ -11,8 +11,6 @@ namespace Xamarin.Forms.Controls.Issues
|
|||
public Issue7758()
|
||||
{
|
||||
#if APP
|
||||
Device.SetFlags(new List<string> { CollectionView.CollectionViewExperimental });
|
||||
|
||||
InitializeComponent();
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -25,7 +25,6 @@ namespace Xamarin.Forms.Controls.Issues
|
|||
public Issue7789()
|
||||
{
|
||||
#if APP
|
||||
Device.SetFlags(new List<string> { CollectionView.CollectionViewExperimental });
|
||||
InitializeComponent();
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -18,7 +18,6 @@ namespace Xamarin.Forms.Controls.Issues
|
|||
public Issue7792()
|
||||
{
|
||||
#if APP
|
||||
Device.SetFlags(new List<string> { CollectionView.CollectionViewExperimental });
|
||||
InitializeComponent();
|
||||
#endif
|
||||
BindingContext = new Issue7792ViewModel();
|
||||
|
|
|
@ -29,7 +29,7 @@ namespace Xamarin.Forms.Controls.Issues
|
|||
public Issue7817()
|
||||
{
|
||||
#if APP
|
||||
Device.SetFlags(new List<string> { CollectionView.CollectionViewExperimental });
|
||||
Device.SetFlags(new List<string> { ExperimentalFlags.CarouselViewExperimental });
|
||||
Title = "Issue 7817";
|
||||
InitializeComponent();
|
||||
#endif
|
||||
|
|
|
@ -26,7 +26,6 @@ namespace Xamarin.Forms.Controls.Issues
|
|||
public Issue7865()
|
||||
{
|
||||
#if APP
|
||||
Device.SetFlags(new List<string> { CollectionView.CollectionViewExperimental });
|
||||
Title = "Issue 7865";
|
||||
InitializeComponent();
|
||||
#endif
|
||||
|
|
|
@ -26,7 +26,6 @@ namespace Xamarin.Forms.Controls.Issues
|
|||
public Issue7943()
|
||||
{
|
||||
#if APP
|
||||
Device.SetFlags(new List<string> { CollectionView.CollectionViewExperimental });
|
||||
Title = "Issue 7943";
|
||||
InitializeComponent();
|
||||
|
||||
|
|
|
@ -24,7 +24,6 @@ namespace Xamarin.Forms.Controls.Issues
|
|||
protected override void Init()
|
||||
{
|
||||
#if APP
|
||||
FlagTestHelpers.SetCollectionViewTestFlag();
|
||||
PushAsync(new GalleryPages.CollectionViewGalleries.NestedGalleries.NestedCollectionViewGallery());
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -23,7 +23,6 @@ namespace Xamarin.Forms.Controls.Issues
|
|||
protected override void Init()
|
||||
{
|
||||
#if APP
|
||||
FlagTestHelpers.SetCollectionViewTestFlag();
|
||||
PushAsync(new GalleryPages.CollectionViewGalleries.ScrollToGalleries.ScrollToGroup());
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -14,8 +14,8 @@ namespace Xamarin.Forms.Controls.GalleryPages.CollectionViewGalleries.CarouselVi
|
|||
|
||||
var button = new Button
|
||||
{
|
||||
Text = "Enable CollectionView",
|
||||
AutomationId = "EnableCollectionView"
|
||||
Text = "Enable CarouselView",
|
||||
AutomationId = "EnableCarouselView"
|
||||
};
|
||||
button.Clicked += ButtonClicked;
|
||||
|
||||
|
@ -50,11 +50,11 @@ namespace Xamarin.Forms.Controls.GalleryPages.CollectionViewGalleries.CarouselVi
|
|||
{
|
||||
var button = sender as Button;
|
||||
|
||||
button.Text = "CollectionView Enabled!";
|
||||
button.Text = "CarouselView Enabled!";
|
||||
button.TextColor = Color.Black;
|
||||
button.IsEnabled = false;
|
||||
|
||||
Device.SetFlags(new[] { ExperimentalFlags.CollectionViewExperimental });
|
||||
Device.SetFlags(new[] { ExperimentalFlags.CarouselViewExperimental });
|
||||
}
|
||||
}
|
||||
}
|
|
@ -14,20 +14,12 @@ namespace Xamarin.Forms.Controls.GalleryPages.CollectionViewGalleries
|
|||
{
|
||||
public CollectionViewGallery()
|
||||
{
|
||||
var button = new Button
|
||||
{
|
||||
Text = "Enable CollectionView",
|
||||
AutomationId = "EnableCollectionView"
|
||||
};
|
||||
button.Clicked += ButtonClicked;
|
||||
|
||||
Content = new ScrollView
|
||||
{
|
||||
Content = new StackLayout
|
||||
{
|
||||
Children =
|
||||
{
|
||||
button,
|
||||
GalleryBuilder.NavButton("Default Text Galleries", () => new DefaultTextGallery(), Navigation),
|
||||
GalleryBuilder.NavButton("DataTemplate Galleries", () => new DataTemplateGallery(), Navigation),
|
||||
GalleryBuilder.NavButton("Observable Collection Galleries", () => new ObservableCollectionGallery(), Navigation),
|
||||
|
@ -47,16 +39,5 @@ namespace Xamarin.Forms.Controls.GalleryPages.CollectionViewGalleries
|
|||
}
|
||||
};
|
||||
}
|
||||
|
||||
void ButtonClicked(object sender, System.EventArgs e)
|
||||
{
|
||||
var button = sender as Button;
|
||||
|
||||
button.Text = "CollectionView Enabled!";
|
||||
button.TextColor = Color.Black;
|
||||
button.IsEnabled = false;
|
||||
|
||||
Device.SetFlags(new[] { ExperimentalFlags.CollectionViewExperimental });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,7 +15,6 @@ namespace Xamarin.Forms.Controls.GalleryPages.RefreshViewGalleries
|
|||
{
|
||||
Children =
|
||||
{
|
||||
new Button { Text ="Enable CollectionView", AutomationId = "EnableCollectionView", Command = new Command(() => Device.SetFlags(new[] { ExperimentalFlags.CollectionViewExperimental })) },
|
||||
GalleryBuilder.NavButton("Refresh Layout Gallery", () => new RefreshLayoutGallery(), Navigation),
|
||||
GalleryBuilder.NavButton("Refresh ScrollView Gallery", () => new RefreshScrollViewGallery(), Navigation),
|
||||
GalleryBuilder.NavButton("Refresh ListView Gallery", () => new RefreshListViewGallery(), Navigation),
|
||||
|
|
|
@ -7,16 +7,17 @@ namespace Xamarin.Forms.Core.UITests
|
|||
[Category(UITestCategories.CarouselView)]
|
||||
internal class CarouselViewUITests : BaseTestFixture
|
||||
{
|
||||
string _enableCollectionView = "Enable CollectionView";
|
||||
string _enableControl = "Enable CarouselView";
|
||||
string _carouselViewGalleries = "CarouselView Galleries";
|
||||
|
||||
protected override void NavigateToGallery()
|
||||
{
|
||||
App.NavigateToGallery(GalleryQueries.CollectionViewGallery);
|
||||
|
||||
App.WaitForElement(_enableCollectionView);
|
||||
App.Tap(_enableCollectionView);
|
||||
App.WaitForElement(_carouselViewGalleries);
|
||||
App.Tap(_carouselViewGalleries);
|
||||
App.WaitForElement(_enableControl);
|
||||
App.Tap(_enableControl);
|
||||
}
|
||||
|
||||
[TestCase("CarouselView (Code, Horizontal)")]
|
||||
|
|
|
@ -6,7 +6,6 @@ namespace Xamarin.Forms.Core.UITests
|
|||
internal class CollectionViewUITests : BaseTestFixture
|
||||
{
|
||||
string _collectionViewId = "collectionview";
|
||||
string _enableCollectionView = "Enable CollectionView";
|
||||
string _btnUpdate = "Update";
|
||||
string _entryUpdate = "entryUpdate";
|
||||
string _entryInsert = "entryInsert";
|
||||
|
@ -170,8 +169,6 @@ namespace Xamarin.Forms.Core.UITests
|
|||
void VisitInitialGallery(string collectionTestName)
|
||||
{
|
||||
var galeryName = $"{collectionTestName} Galleries";
|
||||
App.WaitForElement(t => t.Marked(_enableCollectionView));
|
||||
App.Tap(t => t.Marked(_enableCollectionView));
|
||||
|
||||
App.WaitForElement(t => t.Marked(galeryName));
|
||||
App.Tap(t => t.Marked(galeryName));
|
||||
|
|
|
@ -12,7 +12,7 @@ namespace Xamarin.Forms.Core.UnitTests
|
|||
[SetUp]
|
||||
public override void Setup()
|
||||
{
|
||||
Device.SetFlags(new List<string> { CollectionView.CollectionViewExperimental });
|
||||
Device.SetFlags(new List<string> { ExperimentalFlags.CarouselViewExperimental });
|
||||
base.Setup();
|
||||
var mockDeviceInfo = new TestDeviceInfo();
|
||||
Device.Info = mockDeviceInfo;
|
||||
|
|
|
@ -10,7 +10,7 @@ namespace Xamarin.Forms.Core.UnitTests
|
|||
[SetUp]
|
||||
public override void Setup()
|
||||
{
|
||||
Device.SetFlags(new List<string> {CollectionView.CollectionViewExperimental});
|
||||
Device.SetFlags(new List<string> { ExperimentalFlags.CarouselViewExperimental });
|
||||
base.Setup();
|
||||
var mockDeviceInfo = new TestDeviceInfo();
|
||||
Device.Info = mockDeviceInfo;
|
||||
|
|
|
@ -9,8 +9,9 @@ namespace Xamarin.Forms
|
|||
{
|
||||
internal static class ExperimentalFlags
|
||||
{
|
||||
internal const string CollectionViewExperimental = "CollectionView_Experimental";
|
||||
internal const string ShellUWPExperimental = "Shell_UWP_Experimental";
|
||||
internal const string CarouselViewExperimental = "CarouselView_Experimental";
|
||||
internal const string CollectionViewExperimental = "CollectionView_Experimental";
|
||||
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public static void VerifyFlagEnabled(
|
||||
|
|
|
@ -5,6 +5,7 @@ using System.ComponentModel;
|
|||
using System.Windows.Input;
|
||||
using Xamarin.Forms.Platform;
|
||||
using System.Linq;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace Xamarin.Forms
|
||||
{
|
||||
|
@ -173,7 +174,7 @@ namespace Xamarin.Forms
|
|||
|
||||
public CarouselView()
|
||||
{
|
||||
CollectionView.VerifyCollectionViewFlagEnabled(constructorHint: nameof(CarouselView));
|
||||
VerifyCarouselViewFlagEnabled(constructorHint: nameof(CarouselView));
|
||||
ItemsLayout = new LinearItemsLayout(ItemsLayoutOrientation.Horizontal)
|
||||
{
|
||||
SnapPointsType = SnapPointsType.MandatorySingle,
|
||||
|
@ -182,6 +183,24 @@ namespace Xamarin.Forms
|
|||
ItemSizingStrategy = ItemSizingStrategy.None;
|
||||
}
|
||||
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public static void VerifyCarouselViewFlagEnabled(
|
||||
string constructorHint = null,
|
||||
[CallerMemberName] string memberName = "")
|
||||
{
|
||||
try
|
||||
{
|
||||
ExperimentalFlags.VerifyFlagEnabled(nameof(CollectionView), ExperimentalFlags.CarouselViewExperimental,
|
||||
constructorHint, memberName);
|
||||
}
|
||||
catch (InvalidOperationException)
|
||||
{
|
||||
// We'll still honor the CollectionView_Experimental flag for CarouselView stuff
|
||||
ExperimentalFlags.VerifyFlagEnabled(nameof(CollectionView), ExperimentalFlags.CollectionViewExperimental,
|
||||
constructorHint, memberName);
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual void OnPositionChanged(PositionChangedEventArgs args)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -12,19 +12,5 @@ namespace Xamarin.Forms
|
|||
[RenderWith(typeof(_CollectionViewRenderer))]
|
||||
public class CollectionView : GroupableItemsView
|
||||
{
|
||||
internal const string CollectionViewExperimental = "CollectionView_Experimental";
|
||||
|
||||
public CollectionView()
|
||||
{
|
||||
VerifyCollectionViewFlagEnabled(constructorHint: nameof(CollectionView));
|
||||
}
|
||||
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public static void VerifyCollectionViewFlagEnabled(
|
||||
string constructorHint = null,
|
||||
[CallerMemberName] string memberName = "")
|
||||
{
|
||||
ExperimentalFlags.VerifyFlagEnabled(nameof(CollectionView), ExperimentalFlags.CollectionViewExperimental);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
|
||||
protected ItemsLayout([Parameter("Orientation")] ItemsLayoutOrientation orientation)
|
||||
{
|
||||
CollectionView.VerifyCollectionViewFlagEnabled(constructorHint: nameof(ItemsLayout));
|
||||
Orientation = orientation;
|
||||
}
|
||||
|
||||
|
|
|
@ -11,11 +11,6 @@ namespace Xamarin.Forms
|
|||
{
|
||||
List<Element> _logicalChildren = new List<Element>();
|
||||
|
||||
protected internal ItemsView()
|
||||
{
|
||||
CollectionView.VerifyCollectionViewFlagEnabled(constructorHint: nameof(ItemsView));
|
||||
}
|
||||
|
||||
public static readonly BindableProperty EmptyViewProperty =
|
||||
BindableProperty.Create(nameof(EmptyView), typeof(object), typeof(ItemsView), null);
|
||||
|
||||
|
|
|
@ -18,8 +18,6 @@ namespace Xamarin.Forms
|
|||
public ScrollToRequestEventArgs(int index, int groupIndex,
|
||||
ScrollToPosition scrollToPosition, bool isAnimated)
|
||||
{
|
||||
CollectionView.VerifyCollectionViewFlagEnabled(nameof(ScrollToRequestEventArgs));
|
||||
|
||||
Mode = ScrollToMode.Position;
|
||||
|
||||
Index = index;
|
||||
|
@ -31,8 +29,6 @@ namespace Xamarin.Forms
|
|||
public ScrollToRequestEventArgs(object item, object group,
|
||||
ScrollToPosition scrollToPosition, bool isAnimated)
|
||||
{
|
||||
CollectionView.VerifyCollectionViewFlagEnabled(nameof(ScrollToRequestEventArgs));
|
||||
|
||||
Mode = ScrollToMode.Element;
|
||||
|
||||
Item = item;
|
||||
|
|
|
@ -2,7 +2,7 @@ using System;
|
|||
using System.ComponentModel;
|
||||
using Android.Content;
|
||||
using Android.Views;
|
||||
using FormsCollectionView = Xamarin.Forms.CollectionView;
|
||||
using FormsCarouselView = Xamarin.Forms.CarouselView;
|
||||
|
||||
namespace Xamarin.Forms.Platform.Android
|
||||
{
|
||||
|
@ -16,7 +16,7 @@ namespace Xamarin.Forms.Platform.Android
|
|||
|
||||
public CarouselViewRenderer(Context context) : base(context)
|
||||
{
|
||||
FormsCollectionView.VerifyCollectionViewFlagEnabled(nameof(CarouselViewRenderer));
|
||||
FormsCarouselView.VerifyCarouselViewFlagEnabled(nameof(CarouselViewRenderer));
|
||||
}
|
||||
|
||||
protected override void Dispose(bool disposing)
|
||||
|
|
|
@ -43,7 +43,6 @@ namespace Xamarin.Forms.Platform.Android
|
|||
|
||||
public EmptyViewAdapter(ItemsView itemsView)
|
||||
{
|
||||
Xamarin.Forms.CollectionView.VerifyCollectionViewFlagEnabled(nameof(EmptyViewAdapter));
|
||||
ItemsView = itemsView;
|
||||
}
|
||||
|
||||
|
|
|
@ -22,8 +22,6 @@ namespace Xamarin.Forms.Platform.Android
|
|||
|
||||
internal ItemsViewAdapter(TItemsView itemsView, Func<View, Context, ItemContentView> createItemContentView = null)
|
||||
{
|
||||
Xamarin.Forms.CollectionView.VerifyCollectionViewFlagEnabled(nameof(ItemsViewAdapter<TItemsView, TItemsViewSource>));
|
||||
|
||||
ItemsView = itemsView ?? throw new ArgumentNullException(nameof(itemsView));
|
||||
|
||||
UpdateUsingItemTemplate();
|
||||
|
|
|
@ -42,8 +42,6 @@ namespace Xamarin.Forms.Platform.Android
|
|||
|
||||
public ItemsViewRenderer(Context context) : base(new ContextThemeWrapper(context, Resource.Style.collectionViewStyle))
|
||||
{
|
||||
Xamarin.Forms.CollectionView.VerifyCollectionViewFlagEnabled(nameof(ItemsViewRenderer<TItemsView, TAdapter, TItemsViewSource>));
|
||||
|
||||
_automationPropertiesProvider = new AutomationPropertiesProvider(this);
|
||||
_effectControlProvider = new EffectControlProvider(this);
|
||||
|
||||
|
|
|
@ -9,7 +9,6 @@ namespace Xamarin.Forms.Platform.Android
|
|||
|
||||
public PositionalSmoothScroller(Context context, ScrollToPosition scrollToPosition) : base(context)
|
||||
{
|
||||
Xamarin.Forms.CollectionView.VerifyCollectionViewFlagEnabled(nameof(PositionalSmoothScroller));
|
||||
_scrollToPosition = scrollToPosition;
|
||||
}
|
||||
|
||||
|
|
|
@ -11,7 +11,6 @@ namespace Xamarin.Forms.Platform.Android
|
|||
|
||||
public SnapManager(IItemsLayout itemsLayout, RecyclerView recyclerView)
|
||||
{
|
||||
Xamarin.Forms.CollectionView.VerifyCollectionViewFlagEnabled(nameof(SnapManager));
|
||||
_itemsLayout = itemsLayout;
|
||||
_recyclerView = recyclerView;
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ namespace Xamarin.Forms.Platform.UWP
|
|||
ScrollViewer _scrollViewer;
|
||||
public CarouselViewRenderer()
|
||||
{
|
||||
CollectionView.VerifyCollectionViewFlagEnabled(nameof(CarouselView));
|
||||
CarouselView.VerifyCarouselViewFlagEnabled(nameof(CarouselView));
|
||||
}
|
||||
|
||||
CarouselView CarouselView => Element;
|
||||
|
|
|
@ -13,7 +13,6 @@ namespace Xamarin.Forms.Platform.UWP
|
|||
|
||||
public ItemContentControl()
|
||||
{
|
||||
CollectionView.VerifyCollectionViewFlagEnabled(nameof(ItemContentControl));
|
||||
DefaultStyleKey = typeof(ItemContentControl);
|
||||
}
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ namespace Xamarin.Forms.Platform.iOS
|
|||
|
||||
public CarouselViewRenderer()
|
||||
{
|
||||
CollectionView.VerifyCollectionViewFlagEnabled(nameof(CarouselViewRenderer));
|
||||
CarouselView.VerifyCarouselViewFlagEnabled(nameof(CarouselViewRenderer));
|
||||
}
|
||||
|
||||
protected override CarouselViewController CreateController(CarouselView newElement, ItemsViewLayout layout)
|
||||
|
|
|
@ -14,8 +14,6 @@ namespace Xamarin.Forms.Platform.iOS
|
|||
[Export("initWithFrame:")]
|
||||
protected DefaultCell(CGRect frame) : base(frame)
|
||||
{
|
||||
CollectionView.VerifyCollectionViewFlagEnabled(nameof(DefaultCell));
|
||||
|
||||
Label = new UILabel(frame)
|
||||
{
|
||||
TextColor = UIColor.Black,
|
||||
|
|
|
@ -10,7 +10,6 @@ namespace Xamarin.Forms.Platform.iOS
|
|||
[Export("initWithFrame:")]
|
||||
protected ItemsViewCell(CGRect frame) : base(frame)
|
||||
{
|
||||
CollectionView.VerifyCollectionViewFlagEnabled(nameof(ItemsViewCell));
|
||||
ContentView.BackgroundColor = UIColor.Clear;
|
||||
|
||||
var selectedBackgroundView = new UIView
|
||||
|
|
|
@ -20,8 +20,6 @@ namespace Xamarin.Forms.Platform.iOS
|
|||
|
||||
protected ItemsViewLayout(ItemsLayout itemsLayout, ItemSizingStrategy itemSizingStrategy)
|
||||
{
|
||||
Xamarin.Forms.CollectionView.VerifyCollectionViewFlagEnabled(nameof(ItemsViewLayout));
|
||||
|
||||
ItemSizingStrategy = itemSizingStrategy;
|
||||
|
||||
_itemsLayout = itemsLayout;
|
||||
|
|
|
@ -15,10 +15,7 @@ namespace Xamarin.Forms.Platform.iOS
|
|||
|
||||
protected TItemsView ItemsView => Element;
|
||||
|
||||
public ItemsViewRenderer()
|
||||
{
|
||||
CollectionView.VerifyCollectionViewFlagEnabled(nameof(ItemsViewRenderer<TItemsView, TViewController>));
|
||||
}
|
||||
|
||||
|
||||
public override UIViewController ViewController => Controller;
|
||||
|
||||
|
|
|
@ -7,8 +7,6 @@ namespace Xamarin.Forms.Platform.iOS
|
|||
public static UICollectionViewScrollPosition ToCollectionViewScrollPosition(this ScrollToPosition scrollToPosition,
|
||||
UICollectionViewScrollDirection scrollDirection = UICollectionViewScrollDirection.Vertical, bool isLtr = false)
|
||||
{
|
||||
CollectionView.VerifyCollectionViewFlagEnabled();
|
||||
|
||||
if (scrollDirection == UICollectionViewScrollDirection.Horizontal)
|
||||
{
|
||||
return scrollToPosition.ToHorizontalCollectionViewScrollPosition(isLtr);
|
||||
|
@ -19,8 +17,6 @@ namespace Xamarin.Forms.Platform.iOS
|
|||
|
||||
public static UICollectionViewScrollPosition ToHorizontalCollectionViewScrollPosition(this ScrollToPosition scrollToPosition, bool isLtr)
|
||||
{
|
||||
CollectionView.VerifyCollectionViewFlagEnabled();
|
||||
|
||||
switch (scrollToPosition)
|
||||
{
|
||||
case ScrollToPosition.MakeVisible:
|
||||
|
@ -37,8 +33,6 @@ namespace Xamarin.Forms.Platform.iOS
|
|||
|
||||
public static UICollectionViewScrollPosition ToVerticalCollectionViewScrollPosition(this ScrollToPosition scrollToPosition)
|
||||
{
|
||||
CollectionView.VerifyCollectionViewFlagEnabled();
|
||||
|
||||
switch (scrollToPosition)
|
||||
{
|
||||
case ScrollToPosition.MakeVisible:
|
||||
|
|
Загрузка…
Ссылка в новой задаче