Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
8561232
fix
bhavanesh2001 Feb 19, 2025
44a8f0f
adding snapshots
bhavanesh2001 Feb 20, 2025
2bd7db6
Revert "[ci] Run provisionator devdiv (#28056)" (#28079)
rmarinho Feb 27, 2025
7b29dda
[create-pull-request] automated change (#28068)
github-actions[bot] Feb 27, 2025
594e1d5
Impl (#28040)
MartyIX Feb 27, 2025
1ef5c16
[Testing] Implement the option to change system theme on Appium (#28025)
jsuarezruiz Feb 27, 2025
7cfead1
[MacCatalyst] Picker focus events (#27973)
kubaflo Feb 27, 2025
9574d1a
[Testing] Resolved Shell TabBar DeviceTests CI failures on macOS (#28…
Feb 27, 2025
42ce89b
[Android] Fixed the ScrollbarVisibility issues (#27613)
Ahamed-Ali Feb 28, 2025
0119d31
Fixed FontImageSource icon color does not change in the TabbedPage wh…
NirmalKumarYuvaraj Feb 28, 2025
56cab2f
Update SkiaSharp (#26373)
mattleibow Mar 3, 2025
c2a9031
[iOS] Fixed ImageButton not honoring Padding value. (#26785)
NirmalKumarYuvaraj Mar 3, 2025
4aabe67
Optimize (#28073)
MartyIX Mar 3, 2025
bd8bdf4
IsNullOrEmpty for Paint not returning true if Color(s) are not set (#…
mos379 Mar 3, 2025
718f306
Fix broken/unreliable UI tests (#28125)
albyrock87 Mar 3, 2025
a8eba91
Add test run message to device tests logs (#27993)
albyrock87 Mar 4, 2025
487f868
Bump Microsoft.Web.WebView2 from 1.0.2739.15 to 1.0.2903.40 (#24329)
MartyIX Mar 4, 2025
c42508e
[Android] [Shell] Ensure `AnimationFinished` is called when app backg…
albyrock87 Mar 4, 2025
9988566
[Testing] Enabling UITest Stepper actions for Maccatalyst (#28055)
LogishaSelvarajSF4525 Mar 4, 2025
9e5d0d9
[ci] Publish VS workload zips (#28145)
pjcollins Mar 4, 2025
5cb9a87
[Testing] Fix for flaky UITests in CI that occasionally fail - 4 (#28…
HarishKumarSF4517 Mar 5, 2025
89b3e70
2025-3-3-docs-UiTesting.md-improvements (#28143)
BrayanKhosravian Mar 5, 2025
b871c3c
Improve the performance of provisioning and running of device tests (…
mattleibow Mar 5, 2025
7ca7553
Start shipping WorkloadDependencies.json (#28149)
Redth Mar 5, 2025
da1eba0
Change iOS SetNeedsLayout propagation mechanism (#26629)
albyrock87 Mar 5, 2025
07386b9
Fixed the CollectionView scroll the content inside Editor when tappin…
NanthiniMahalingam Mar 5, 2025
1c11de3
[android] add AOT profile for `dotnet new maui -sc` (#28172)
jonathanpeppers Mar 5, 2025
b10b92e
[Bindings SG] Filter out false positive Binding.Create matches (#28138)
jkurdek Mar 5, 2025
42bdc83
Fix CSS Hot Reload on iOS device (#27812)
spadapet Mar 6, 2025
28e278d
[test] Run Android device tests on linux (#28192)
rmarinho Mar 6, 2025
2847ecc
[Testing] Enabling more UI Tests by removing platform specific condit…
TamilarasanSF4853 Mar 6, 2025
7b57726
[Testing] Enabling more UI Tests by removing platform specific condit…
HarishKumarSF4517 Mar 6, 2025
c5afea1
[Testing] Migration of Compatibility.Core platform-specific unit test…
TamilarasanSF4853 Mar 6, 2025
9956f41
Fix Crashing issue with keyboard scrolling iOS (#28148)
tj-devel709 Mar 6, 2025
5878152
Revert "Fix FlyoutPage ShouldShowToolbarButton when overridden to ret…
NirmalKumarYuvaraj Mar 6, 2025
874be34
Fixed-ToolBar-Visibility-FlyoutPage (#28209)
prakashKannanSf3972 Mar 6, 2025
8f744e3
Use only major JDK version to install via homebrew (#28224)
Redth Mar 7, 2025
b157e5a
Update the version of SkiaSharp used by SVG (#28233)
mattleibow Mar 7, 2025
a53e4f7
[CollectionView] Crash occurs when switching CollectionView.IsVisible…
kubaflo Mar 7, 2025
52f119d
improve iOS Tapgesture
bhavanesh2001 Mar 7, 2025
440af19
Merge branch 'dotnet:main' into fix_21328_android
bhavanesh2001 Mar 7, 2025
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.
18 changes: 18 additions & 0 deletions src/Controls/tests/TestCases.HostApp/Issues/Issues21328.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?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="Controls.TestCases.HostApp.Issues.Issues21328"
Title="Issues21328">
<VerticalStackLayout VerticalOptions="Center"
HorizontalOptions="Fill"
Spacing="20">
<Label x:Name="label" HorizontalOptions="Center"
AutomationId="HtmlLinkLabel"
TextType="Html" >
</Label>
<Label x:Name="label2" HorizontalOptions="Center"
TextType="Html" />

<Button Text="Change 2nd lable text" Clicked="Button_Clicked" />
</VerticalStackLayout>
</ContentPage>
16 changes: 16 additions & 0 deletions src/Controls/tests/TestCases.HostApp/Issues/Issues21328.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
namespace Controls.TestCases.HostApp.Issues;

[Issue(IssueTracker.Github, 21328, "Link in Label with TextType HTML is not clickable", PlatformAffected.iOS | PlatformAffected.Android)]
public partial class Issues21328 : ContentPage
{
public Issues21328()
{
InitializeComponent();
label.Text = @"<a href=""https://www.example.com"">Example HTML link</a>";
label2.Text = @"Normal Text and <a href=""https://www.example.com"">Example HTML link</a> here";
}
private void Button_Clicked(object sender, EventArgs e)
{
label2.Text = @"Visit dotnet from <a href=""https://dotnet.microsoft.com/en-us/""> here </a>";
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using System;
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;

namespace Microsoft.Maui.TestCases.Tests.Tests.Issues;

public class Issue21328 : _IssuesUITest
{
public Issue21328(TestDevice device) : base(device)
{
}

public override string Issue => "Link in Label with TextType HTML is not clickable";

#if !WINDOWS

[Test]
[Category(UITestCategories.Label)]
public void HtmlTextLinkShouldBeClickable()
{
App.WaitForElement("HtmlLinkLabel");
App.Tap("HtmlLinkLabel");
Thread.Sleep(3000);
VerifyScreenshot();
}
#endif
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions src/Core/src/Platform/Android/TextViewExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Net;
using Android.Graphics;
using Android.Text;
using Android.Text.Method;
using Android.Widget;
using static Android.Widget.TextView;
using ALayoutDirection = Android.Views.LayoutDirection;
Expand All @@ -18,6 +19,9 @@ public static void UpdateTextPlainText(this TextView textView, IText label)

public static void UpdateTextHtml(this TextView textView, ILabel label)
{
if(textView.MovementMethod is null)
textView.MovementMethod = LinkMovementMethod.Instance ?? new LinkMovementMethod();

var text = label.Text ?? string.Empty;
var htmlText = WebUtility.HtmlDecode(text);

Expand Down
62 changes: 62 additions & 0 deletions src/Core/src/Platform/iOS/LabelExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System;
using Foundation;
using Microsoft.Maui.Graphics;
using ObjCRuntime;
Expand Down Expand Up @@ -91,11 +92,72 @@ internal static void UpdateTextHtml(this UILabel platformLabel, ILabel label)
#pragma warning disable CS8601
platformLabel.AttributedText = new NSAttributedString(text, attr, ref nsError);
#pragma warning restore CS8601
platformLabel.UserInteractionEnabled = true;
platformLabel.DetectAndOpenLink();
}
internal static void RemoveCurrentGesture(this UILabel platformLabel)
{
if(platformLabel.GestureRecognizers is null)
return;
foreach(var gesture in platformLabel.GestureRecognizers)
{
if(gesture is HtmlTextGestureRecognizer htmlTextGesture)
{
platformLabel.RemoveGestureRecognizer(htmlTextGesture);
break;
}
}
}

internal static void DetectAndOpenLink(this UILabel platformLabel)
{
platformLabel.RemoveCurrentGesture();
var tapGesture = new HtmlTextGestureRecognizer((UITapGestureRecognizer recognizer) =>
{
if (recognizer.State != UIGestureRecognizerState.Recognized) return;
if (platformLabel.AttributedText is null) return;

var layoutManager = new NSLayoutManager();
var textStorage = new NSTextStorage();
var textContainer = new NSTextContainer();

textStorage.SetString(platformLabel.AttributedText);
layoutManager.AddTextContainer(textContainer);
textStorage.AddLayoutManager(layoutManager);

textContainer.LineFragmentPadding = 0;
textContainer.LineBreakMode = platformLabel.LineBreakMode;
textContainer.Size = platformLabel.Bounds.Size;

var location = recognizer.LocationInView(platformLabel);
var index = (nint)layoutManager.GetCharacterIndex(location, textContainer);

if (index < platformLabel.AttributedText.Length)
{
var url = platformLabel.AttributedText.GetAttribute(UIStringAttributeKey.Link, index, out _);
if (url is NSUrl nsUrl)
{
UIApplication.SharedApplication.OpenUrl(nsUrl,new UIApplicationOpenUrlOptions(),null);
}
}
});
platformLabel.AddGestureRecognizer(tapGesture);
}

internal static void UpdateTextPlainText(this UILabel platformLabel, IText label)
{
platformLabel.Text = label.Text;
}
}

internal class HtmlTextGestureRecognizer: UITapGestureRecognizer
{
public HtmlTextGestureRecognizer(Action<UITapGestureRecognizer> action):base(action)
{
CancelsTouchesInView = false;
ShouldRecognizeSimultaneously = GetRecognizeSimultaneously;
}

private bool GetRecognizeSimultaneously(UIGestureRecognizer gestureRecognizer, UIGestureRecognizer otherGestureRecognizer) => true;
}
}