Skip to content

Commit 19dab0b

Browse files
authored
Replace Android ToSpannableString overload (#27597)
1 parent 094222a commit 19dab0b

2 files changed

Lines changed: 3 additions & 22 deletions

File tree

src/Controls/src/Core/Platform/Android/Extensions/FormattedStringExtensions.cs

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ namespace Microsoft.Maui.Controls.Platform
1414
public static class FormattedStringExtensions
1515
{
1616
public static SpannableString ToSpannableString(this Label label)
17-
=> ToSpannableStringNewWay(
17+
=> ToSpannableString(
1818
label.FormattedText,
1919
label.RequireFontManager(),
2020
label.Handler?.MauiContext?.Context,
@@ -25,28 +25,7 @@ public static SpannableString ToSpannableString(this Label label)
2525
label.TextTransform,
2626
label.TextDecorations);
2727

28-
// TODO: NET8 this overload must be removed in net8.0 and replaced with the one below
2928
public static SpannableString ToSpannableString(
30-
this FormattedString formattedString,
31-
IFontManager fontManager,
32-
TextPaint? textPaint = null,
33-
Context? context = null,
34-
double defaultLineHeight = 0,
35-
TextAlignment defaultHorizontalAlignment = TextAlignment.Start,
36-
Font? defaultFont = null,
37-
Graphics.Color? defaultColor = null,
38-
TextTransform defaultTextTransform = TextTransform.Default)
39-
=> formattedString.ToSpannableStringNewWay(
40-
fontManager,
41-
context,
42-
0d,
43-
defaultHorizontalAlignment,
44-
defaultFont,
45-
defaultColor,
46-
defaultTextTransform,
47-
TextDecorations.None);
48-
49-
internal static SpannableString ToSpannableStringNewWay(
5029
this FormattedString formattedString,
5130
IFontManager fontManager,
5231
Context? context = null,

src/Controls/src/Core/PublicAPI/net-android/PublicAPI.Unshipped.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
Microsoft.Maui.Controls.HybridWebView.InvokeJavaScriptAsync(string! methodName, object?[]? paramValues = null, System.Text.Json.Serialization.Metadata.JsonTypeInfo?[]? paramJsonTypeInfos = null) -> System.Threading.Tasks.Task!
1313
Microsoft.Maui.Controls.HybridWebView.SetInvokeJavaScriptTarget<T>(T! target) -> void
1414
Microsoft.Maui.Controls.StyleableElement.Style.get -> Microsoft.Maui.Controls.Style?
15+
*REMOVED*static Microsoft.Maui.Controls.Platform.FormattedStringExtensions.ToSpannableString(this Microsoft.Maui.Controls.FormattedString! formattedString, Microsoft.Maui.IFontManager! fontManager, Android.Text.TextPaint? textPaint = null, Android.Content.Context? context = null, double defaultLineHeight = 0, Microsoft.Maui.TextAlignment defaultHorizontalAlignment = Microsoft.Maui.TextAlignment.Start, Microsoft.Maui.Font? defaultFont = null, Microsoft.Maui.Graphics.Color? defaultColor = null, Microsoft.Maui.TextTransform defaultTextTransform = Microsoft.Maui.TextTransform.Default) -> Android.Text.SpannableString!
16+
static Microsoft.Maui.Controls.Platform.FormattedStringExtensions.ToSpannableString(this Microsoft.Maui.Controls.FormattedString! formattedString, Microsoft.Maui.IFontManager! fontManager, Android.Content.Context? context = null, double defaultCharacterSpacing = 0, Microsoft.Maui.TextAlignment defaultHorizontalAlignment = Microsoft.Maui.TextAlignment.Start, Microsoft.Maui.Font? defaultFont = null, Microsoft.Maui.Graphics.Color? defaultColor = null, Microsoft.Maui.TextTransform defaultTextTransform = Microsoft.Maui.TextTransform.Default, Microsoft.Maui.TextDecorations defaultTextDecorations = Microsoft.Maui.TextDecorations.None) -> Android.Text.SpannableString!
1517
~Microsoft.Maui.Controls.ResourceDictionary.SetAndCreateSource<T>(System.Uri value) -> void
1618
~Microsoft.Maui.Controls.Internals.TypedBindingBase.UpdateSourceEventName.set -> void
1719
~Microsoft.Maui.Controls.WebViewProcessTerminatedEventArgs.PlatformArgs.get -> Microsoft.Maui.Controls.PlatformWebViewProcessTerminatedEventArgs

0 commit comments

Comments
 (0)