diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue8782.xaml b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue8782.xaml new file mode 100644 index 000000000..59985971c --- /dev/null +++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue8782.xaml @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue8782.xaml.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue8782.xaml.cs new file mode 100644 index 000000000..3dd2ba194 --- /dev/null +++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue8782.xaml.cs @@ -0,0 +1,48 @@ +using System; +using Xamarin.Forms.CustomAttributes; +using Xamarin.Forms.Internals; +using Xamarin.Forms.Xaml; + +#if UITEST +using Xamarin.UITest; +using Xamarin.UITest.Queries; +using NUnit.Framework; +using Xamarin.Forms.Core.UITests; +#endif + +namespace Xamarin.Forms.Controls.Issues +{ +#if UITEST + [Category(UITestCategories.SwipeView)] +#endif +#if APP + [XamlCompilation(XamlCompilationOptions.Compile)] +#endif + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Github, 8782, "[Bug] SwipeViewItems cut off on one or more sides", PlatformAffected.All)] + public partial class Issue8782 : TestContentPage + { + public Issue8782() + { +#if APP + Title = "Issue 8782"; + InitializeComponent(); +#endif + } + + protected override void Init() + { + + } + + async void OnIncorrectAnswerInvoked(object sender, EventArgs e) + { + await DisplayAlert("Incorrect!", "Try again.", "OK"); + } + + async void OnCorrectAnswerInvoked(object sender, EventArgs e) + { + await DisplayAlert("Correct!", "The answer is 2.", "OK"); + } + } +} \ No newline at end of file diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems index e8c8d8f36..f7e161516 100644 --- a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems +++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems @@ -1223,6 +1223,7 @@ + @@ -1371,6 +1372,7 @@ + diff --git a/Xamarin.Forms.Core.UITests.Shared/UITestCategories.cs b/Xamarin.Forms.Core.UITests.Shared/UITestCategories.cs index 8957b066d..5d8857dff 100644 --- a/Xamarin.Forms.Core.UITests.Shared/UITestCategories.cs +++ b/Xamarin.Forms.Core.UITests.Shared/UITestCategories.cs @@ -35,6 +35,7 @@ public const string Slider = "Slider"; public const string Stepper = "Stepper"; public const string Switch = "Switch"; + public const string SwipeView = "SwipeView"; public const string TableView = "TableView"; public const string TimePicker = "TimePicker"; public const string ToolbarItem = "ToolbarItem"; diff --git a/Xamarin.Forms.Platform.Android/Renderers/SwipeViewRenderer.cs b/Xamarin.Forms.Platform.Android/Renderers/SwipeViewRenderer.cs index d2badcb01..00d98502a 100644 --- a/Xamarin.Forms.Platform.Android/Renderers/SwipeViewRenderer.cs +++ b/Xamarin.Forms.Platform.Android/Renderers/SwipeViewRenderer.cs @@ -29,7 +29,7 @@ namespace Xamarin.Forms.Platform.Android public class SwipeViewRenderer : ViewRenderer, GestureDetector.IOnGestureListener { const int SwipeThreshold = 250; - const int SwipeThresholdMargin = 6; + const int SwipeThresholdMargin = 0; const int SwipeItemWidth = 100; const long SwipeAnimationDuration = 200; @@ -52,7 +52,7 @@ namespace Xamarin.Forms.Platform.Android public SwipeViewRenderer(Context context) : base(context) { - Xamarin.Forms.SwipeView.VerifySwipeViewFlagEnabled(nameof(SwipeViewRenderer)); + SwipeView.VerifySwipeViewFlagEnabled(nameof(SwipeViewRenderer)); _context = context; AutoPackage = false; diff --git a/Xamarin.Forms.Platform.iOS/Renderers/SwipeViewRenderer.cs b/Xamarin.Forms.Platform.iOS/Renderers/SwipeViewRenderer.cs index 94177fe93..dc203fc1f 100644 --- a/Xamarin.Forms.Platform.iOS/Renderers/SwipeViewRenderer.cs +++ b/Xamarin.Forms.Platform.iOS/Renderers/SwipeViewRenderer.cs @@ -14,7 +14,7 @@ namespace Xamarin.Forms.Platform.iOS public class SwipeViewRenderer : ViewRenderer { const double SwipeThreshold = 250; - const int SwipeThresholdMargin = 6; + const int SwipeThresholdMargin = 0; const double SwipeItemWidth = 100; const double SwipeAnimationDuration = 0.2; @@ -35,7 +35,7 @@ namespace Xamarin.Forms.Platform.iOS public SwipeViewRenderer() { - Xamarin.Forms.SwipeView.VerifySwipeViewFlagEnabled(nameof(SwipeViewRenderer)); + SwipeView.VerifySwipeViewFlagEnabled(nameof(SwipeViewRenderer)); _tapGestureRecognizer = new UITapGestureRecognizer(OnTap) {