Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
64 changes: 64 additions & 0 deletions src/Controls/tests/TestCases.HostApp/Issues/Issue18806.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Maui.Controls.Sample.Issues.Issue18806"
xmlns:ns="clr-namespace:Maui.Controls.Sample.Issues">
<Grid RowDefinitions="*,Auto">
<VerticalStackLayout>
<SwipeView x:Name="swipeView1"
Threshold="100">
<SwipeView.RightItems>
<SwipeItems>
<SwipeItemView BackgroundColor="Black">
<Image
HorizontalOptions="Center"
WidthRequest="10"
VerticalOptions="Center">
<Image.Source>
<FontImageSource Color="White"
Glyph="A"/>
</Image.Source>
</Image>
</SwipeItemView>
</SwipeItems>
</SwipeView.RightItems>

<SwipeItemView>
<Label HeightRequest="200"
VerticalTextAlignment="Center"
Text="Swipe view 1"/>
</SwipeItemView>
</SwipeView>

<SwipeView x:Name="swipeView2"
Threshold="100">
<SwipeView.LeftItems>
<SwipeItems>
<SwipeItemView BackgroundColor="Black">
<Image
HorizontalOptions="Center"
WidthRequest="10"
VerticalOptions="Center">
<Image.Source>
<FontImageSource Color="White"
Glyph="A"/>
</Image.Source>
</Image>
</SwipeItemView>
</SwipeItems>
</SwipeView.LeftItems>

<SwipeItemView>
<Label HeightRequest="200"
VerticalTextAlignment="Center"
Text="Swipe view 2"/>
</SwipeItemView>
</SwipeView>
</VerticalStackLayout>

<Button Grid.Row="1"
AutomationId="button"
Text="Open SwipeViews"
Clicked="Button_Clicked"/>
</Grid>
</ContentPage>
19 changes: 19 additions & 0 deletions src/Controls/tests/TestCases.HostApp/Issues/Issue18806.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using System.ComponentModel;

namespace Maui.Controls.Sample.Issues
{
[Issue(IssueTracker.Github, 18806, "SwipeItemView won't render FontImageSource on first opening", PlatformAffected.Android)]
public partial class Issue18806 : ContentPage
{
public Issue18806()
{
InitializeComponent();
}

private void Button_Clicked(object sender, EventArgs e)
{
swipeView1.Open(OpenSwipeItem.RightItems, false);
swipeView2.Open(OpenSwipeItem.LeftItems, false);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;

namespace Microsoft.Maui.TestCases.Tests.Issues;

public class Issue18806 : _IssuesUITest
{
public Issue18806(TestDevice testDevice) : base(testDevice)
{
}

public override string Issue => "SwipeItemView won't render FontImageSource on first opening";

[Test]
[Category(UITestCategories.SwipeView)]
public void ItemImageSourceShouldBeVisible()
{
App.WaitForElement("button");
App.Tap("button");

VerifyScreenshot();
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions src/Core/src/Platform/Android/MauiSwipeView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,16 @@ protected override void OnAttachedToWindow()
_viewPagerParent = Control.Parent.GetParentOfType<SwipeViewPager>();
}

protected override void OnLayout(bool changed, int left, int top, int right, int bottom)
{
base.OnLayout(changed, left, top, right, bottom);

if (_contentView is null || _actionView is null || GetNativeSwipeItems() is not {Count: > 0} swipeItems)
return;

LayoutSwipeItems(swipeItems);
}

public override bool OnTouchEvent(MotionEvent? e)
{
base.OnTouchEvent(e);
Expand Down
1 change: 1 addition & 0 deletions src/Core/src/PublicAPI/net-android/PublicAPI.Unshipped.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ override Microsoft.Maui.Handlers.HybridWebViewHandler.DisconnectHandler(Android.
override Microsoft.Maui.Platform.MauiAppCompatEditText.OnSelectionChanged(int selStart, int selEnd) -> void
override Microsoft.Maui.Platform.MauiHybridWebViewClient.Dispose(bool disposing) -> void
override Microsoft.Maui.Platform.MauiHybridWebViewClient.ShouldInterceptRequest(Android.Webkit.WebView? view, Android.Webkit.IWebResourceRequest? request) -> Android.Webkit.WebResourceResponse?
override Microsoft.Maui.Platform.MauiSwipeView.OnLayout(bool changed, int left, int top, int right, int bottom) -> void
override Microsoft.Maui.Platform.MauiWebViewClient.OnRenderProcessGone(Android.Webkit.WebView? view, Android.Webkit.RenderProcessGoneDetail? detail) -> bool
static Microsoft.Maui.ElementHandlerExtensions.GetRequiredService<T>(this Microsoft.Maui.IElementHandler! handler, System.Type! type) -> T
static Microsoft.Maui.ElementHandlerExtensions.GetRequiredService<T>(this Microsoft.Maui.IElementHandler! handler) -> T
Expand Down
Loading