зеркало из https://github.com/DeGsoft/maui-linux.git
Fixed SwipeItem cut off issue (#8824)
Co-authored-by: Samantha Houts <samhouts@users.noreply.github.com>
This commit is contained in:
Родитель
6eb266707d
Коммит
8ac500e25c
|
@ -0,0 +1,56 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<controls:TestContentPage
|
||||
xmlns:controls="clr-namespace:Xamarin.Forms.Controls"
|
||||
xmlns="http://xamarin.com/schemas/2014/forms"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
xmlns:d="http://xamarin.com/schemas/2014/forms/design"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d"
|
||||
x:Class="Xamarin.Forms.Controls.Issues.Issue8782">
|
||||
<StackLayout
|
||||
Margin="20">
|
||||
<SwipeView>
|
||||
<SwipeView.LeftItems>
|
||||
<SwipeItems>
|
||||
<SwipeItemView
|
||||
Invoked="OnIncorrectAnswerInvoked">
|
||||
<Grid
|
||||
WidthRequest="100">
|
||||
<Frame
|
||||
BackgroundColor="DarkGray"
|
||||
CornerRadius="30">
|
||||
<Label
|
||||
Text="1"
|
||||
HorizontalOptions="Center"
|
||||
VerticalOptions="Center" />
|
||||
</Frame>
|
||||
</Grid>
|
||||
</SwipeItemView>
|
||||
<SwipeItemView
|
||||
Invoked="OnCorrectAnswerInvoked">
|
||||
<Grid
|
||||
WidthRequest="100">
|
||||
<Frame
|
||||
BackgroundColor="DarkGray"
|
||||
CornerRadius="30">
|
||||
<Label
|
||||
Text="2"
|
||||
HorizontalOptions="Center"
|
||||
VerticalOptions="Center" />
|
||||
</Frame>
|
||||
</Grid>
|
||||
</SwipeItemView>
|
||||
</SwipeItems>
|
||||
</SwipeView.LeftItems>
|
||||
<Grid
|
||||
HeightRequest="70"
|
||||
WidthRequest="300"
|
||||
BackgroundColor="LightGray">
|
||||
<Label
|
||||
Text="What's 1+1?"
|
||||
HorizontalOptions="Center"
|
||||
VerticalOptions="Center" />
|
||||
</Grid>
|
||||
</SwipeView>
|
||||
</StackLayout>
|
||||
</controls:TestContentPage>
|
|
@ -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");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1223,6 +1223,7 @@
|
|||
<Compile Include="$(MSBuildThisFileDirectory)Issue8638.xaml.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Issue8392.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Issue8672.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Issue8782.xaml.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Issue8821.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Issue8326.xaml.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Issue8449.xaml.cs" />
|
||||
|
@ -1371,6 +1372,7 @@
|
|||
<EmbeddedResource Include="$(MSBuildThisFileDirectory)Issue8417.xaml" />
|
||||
<EmbeddedResource Include="$(MSBuildThisFileDirectory)Issue7813.xaml" />
|
||||
<EmbeddedResource Include="$(MSBuildThisFileDirectory)Issue8638.xaml" />
|
||||
<EmbeddedResource Include="$(MSBuildThisFileDirectory)Issue8782.xaml" />
|
||||
<EmbeddedResource Include="$(MSBuildThisFileDirectory)Issue8326.xaml" />
|
||||
<EmbeddedResource Include="$(MSBuildThisFileDirectory)Issue8449.xaml" />
|
||||
<EmbeddedResource Include="$(MSBuildThisFileDirectory)Issue7924.xaml" />
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -29,7 +29,7 @@ namespace Xamarin.Forms.Platform.Android
|
|||
public class SwipeViewRenderer : ViewRenderer<SwipeView, AView>, 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;
|
||||
|
|
|
@ -14,7 +14,7 @@ namespace Xamarin.Forms.Platform.iOS
|
|||
public class SwipeViewRenderer : ViewRenderer<SwipeView, UIView>
|
||||
{
|
||||
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)
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче