From acb8e0cce4f8120f97d3bcc7bdc0955f2febedb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Su=C3=A1rez=20Ruiz?= Date: Tue, 24 May 2022 16:07:12 +0200 Subject: [PATCH 01/10] Implement Entry IsSpellCheckEnabled property --- .../Core/src/Windows/EntryRenderer.cs | 1 + .../Core/src/iOS/Renderers/EntryRenderer.cs | 1 + src/Core/src/Core/ITextInput.cs | 5 ++++ .../Handlers/Entry/EntryHandler.Android.cs | 3 ++ .../Handlers/Entry/EntryHandler.Standard.cs | 1 + .../Handlers/Entry/EntryHandler.Windows.cs | 3 ++ src/Core/src/Handlers/Entry/EntryHandler.cs | 1 + .../src/Handlers/Entry/EntryHandler.iOS.cs | 3 ++ .../Platform/Android/EditTextExtensions.cs | 11 +++++++- .../src/Platform/Windows/TextBoxExtensions.cs | 5 ++++ .../src/Platform/iOS/TextFieldExtensions.cs | 28 +++++++++++++------ .../Entry/EntryHandlerTests.Android.cs | 6 ++-- .../Handlers/Entry/EntryHandlerTests.cs | 18 ++++++++---- .../Handlers/Entry/EntryHandlerTests.iOS.cs | 3 ++ .../tests/DeviceTests/Stubs/EditorStub.cs | 2 ++ src/Core/tests/DeviceTests/Stubs/EntryStub.cs | 2 ++ .../tests/DeviceTests/Stubs/SearchBarStub.cs | 2 ++ 17 files changed, 77 insertions(+), 18 deletions(-) diff --git a/src/Compatibility/Core/src/Windows/EntryRenderer.cs b/src/Compatibility/Core/src/Windows/EntryRenderer.cs index 0b50be67c295..bc6fe0c67dc5 100644 --- a/src/Compatibility/Core/src/Windows/EntryRenderer.cs +++ b/src/Compatibility/Core/src/Windows/EntryRenderer.cs @@ -260,6 +260,7 @@ void UpdateClearButtonVisibility() Control.ClearButtonVisible = Element.ClearButtonVisibility == ClearButtonVisibility.WhileEditing; } + [PortHandler] void UpdateInputScope() { Entry entry = Element; diff --git a/src/Compatibility/Core/src/iOS/Renderers/EntryRenderer.cs b/src/Compatibility/Core/src/iOS/Renderers/EntryRenderer.cs index 3933d5cbac2a..201d82b8fdd5 100644 --- a/src/Compatibility/Core/src/iOS/Renderers/EntryRenderer.cs +++ b/src/Compatibility/Core/src/iOS/Renderers/EntryRenderer.cs @@ -306,6 +306,7 @@ protected virtual void UpdateFont() Control.Font = Element.ToUIFont(); } + [PortHandler] void UpdateKeyboard() { var keyboard = Element.Keyboard; diff --git a/src/Core/src/Core/ITextInput.cs b/src/Core/src/Core/ITextInput.cs index 53c6a76ce1c8..d930ad34fd3d 100644 --- a/src/Core/src/Core/ITextInput.cs +++ b/src/Core/src/Core/ITextInput.cs @@ -15,6 +15,11 @@ public interface ITextInput : IText, IPlaceholder /// bool IsTextPredictionEnabled { get; } + /// + /// Gets a value that controls whether spell checking is enabled. + /// + bool IsSpellCheckEnabled { get; } + /// /// Gets a value indicating whether or not the view is read-only. /// diff --git a/src/Core/src/Handlers/Entry/EntryHandler.Android.cs b/src/Core/src/Handlers/Entry/EntryHandler.Android.cs index f3c2701a592a..922020ea8df3 100644 --- a/src/Core/src/Handlers/Entry/EntryHandler.Android.cs +++ b/src/Core/src/Handlers/Entry/EntryHandler.Android.cs @@ -64,6 +64,9 @@ public static void MapVerticalTextAlignment(IEntryHandler handler, IEntry entry) public static void MapIsTextPredictionEnabled(IEntryHandler handler, IEntry entry) => handler.PlatformView?.UpdateIsTextPredictionEnabled(entry); + public static void MapIsSpellCheckEnabled(IEntryHandler handler, IEntry entry) => + handler.PlatformView?.UpdateIsSpellCheckEnabled(entry); + public static void MapMaxLength(IEntryHandler handler, IEntry entry) => handler.PlatformView?.UpdateMaxLength(entry); diff --git a/src/Core/src/Handlers/Entry/EntryHandler.Standard.cs b/src/Core/src/Handlers/Entry/EntryHandler.Standard.cs index a3c379f96b60..3553baa5da98 100644 --- a/src/Core/src/Handlers/Entry/EntryHandler.Standard.cs +++ b/src/Core/src/Handlers/Entry/EntryHandler.Standard.cs @@ -12,6 +12,7 @@ public static void MapIsPassword(IEntryHandler handler, IEntry entry) { } public static void MapHorizontalTextAlignment(IEntryHandler handler, IEntry entry) { } public static void MapVerticalTextAlignment(IEntryHandler handler, IEntry entry) { } public static void MapIsTextPredictionEnabled(IEntryHandler handler, IEntry entry) { } + public static void MapIsSpellCheckEnabled(IEntryHandler handler, IEntry entry) { } public static void MapMaxLength(IEntryHandler handler, IEntry entry) { } public static void MapPlaceholder(IEntryHandler handler, IEntry entry) { } public static void MapPlaceholderColor(IEntryHandler handler, IEntry entry) { } diff --git a/src/Core/src/Handlers/Entry/EntryHandler.Windows.cs b/src/Core/src/Handlers/Entry/EntryHandler.Windows.cs index 5c4688455a72..f8f254a962da 100644 --- a/src/Core/src/Handlers/Entry/EntryHandler.Windows.cs +++ b/src/Core/src/Handlers/Entry/EntryHandler.Windows.cs @@ -56,6 +56,9 @@ public static void MapVerticalTextAlignment(IEntryHandler handler, IEntry entry) public static void MapIsTextPredictionEnabled(IEntryHandler handler, IEntry entry) => handler.PlatformView?.UpdateIsTextPredictionEnabled(entry); + public static void MapIsSpellCheckEnabled(IEntryHandler handler, IEntry entry) => + handler.PlatformView?.UpdateIsSpellCheckEnabled(entry); + public static void MapMaxLength(IEntryHandler handler, IEntry entry) => handler.PlatformView?.UpdateMaxLength(entry); diff --git a/src/Core/src/Handlers/Entry/EntryHandler.cs b/src/Core/src/Handlers/Entry/EntryHandler.cs index 146d2af3aa9e..f9e4547e4992 100644 --- a/src/Core/src/Handlers/Entry/EntryHandler.cs +++ b/src/Core/src/Handlers/Entry/EntryHandler.cs @@ -28,6 +28,7 @@ public partial class EntryHandler : IEntryHandler [nameof(IEntry.VerticalTextAlignment)] = MapVerticalTextAlignment, [nameof(IEntry.IsReadOnly)] = MapIsReadOnly, [nameof(IEntry.IsTextPredictionEnabled)] = MapIsTextPredictionEnabled, + [nameof(IEntry.IsSpellCheckEnabled)] = MapIsSpellCheckEnabled, [nameof(IEntry.Keyboard)] = MapKeyboard, [nameof(IEntry.MaxLength)] = MapMaxLength, [nameof(IEntry.Placeholder)] = MapPlaceholder, diff --git a/src/Core/src/Handlers/Entry/EntryHandler.iOS.cs b/src/Core/src/Handlers/Entry/EntryHandler.iOS.cs index 8b6d1101bd10..ab72268fcfc8 100644 --- a/src/Core/src/Handlers/Entry/EntryHandler.iOS.cs +++ b/src/Core/src/Handlers/Entry/EntryHandler.iOS.cs @@ -59,6 +59,9 @@ public static void MapVerticalTextAlignment(IEntryHandler handler, IEntry entry) public static void MapIsTextPredictionEnabled(IEntryHandler handler, IEntry entry) => handler.PlatformView?.UpdateIsTextPredictionEnabled(entry); + public static void MapIsSpellCheckEnabled(IEntryHandler handler, IEntry entry) => + handler.PlatformView?.UpdateIsSpellCheckEnabled(entry); + public static void MapMaxLength(IEntryHandler handler, IEntry entry) => handler.PlatformView?.UpdateMaxLength(entry); diff --git a/src/Core/src/Platform/Android/EditTextExtensions.cs b/src/Core/src/Platform/Android/EditTextExtensions.cs index 80b089d7c406..c99385a56c7b 100644 --- a/src/Core/src/Platform/Android/EditTextExtensions.cs +++ b/src/Core/src/Platform/Android/EditTextExtensions.cs @@ -67,6 +67,11 @@ public static void UpdateIsTextPredictionEnabled(this EditText editText, IEntry editText.SetInputType(entry); } + public static void UpdateIsSpellCheckEnabled(this EditText editText, IEntry entry) + { + editText.SetInputType(entry); + } + public static void UpdateIsTextPredictionEnabled(this EditText editText, IEditor editor) { if (editor.IsTextPredictionEnabled) @@ -292,7 +297,11 @@ internal static void SetInputType(this EditText editText, ITextInput textInput) if (keyboard is not CustomKeyboard) { - // TODO: IsSpellCheckEnabled handling must be here. + if ((nativeInputTypeToUpdate & InputTypes.TextFlagNoSuggestions) != InputTypes.TextFlagNoSuggestions) + { + if (!textInput.IsSpellCheckEnabled) + nativeInputTypeToUpdate |= InputTypes.TextFlagNoSuggestions; + } if ((nativeInputTypeToUpdate & InputTypes.TextFlagNoSuggestions) != InputTypes.TextFlagNoSuggestions) { diff --git a/src/Core/src/Platform/Windows/TextBoxExtensions.cs b/src/Core/src/Platform/Windows/TextBoxExtensions.cs index b58415f5a404..7f9d54d3f2f3 100644 --- a/src/Core/src/Platform/Windows/TextBoxExtensions.cs +++ b/src/Core/src/Platform/Windows/TextBoxExtensions.cs @@ -149,6 +149,11 @@ public static void UpdateIsTextPredictionEnabled(this TextBox textBox, ITextInpu textBox.UpdateInputScope(textInput); } + public static void UpdateIsSpellCheckEnabled(this TextBox textBox, ITextInput textInput) + { + textBox.UpdateInputScope(textInput); + } + public static void UpdateKeyboard(this TextBox textBox, ITextInput textInput) { textBox.UpdateInputScope(textInput); diff --git a/src/Core/src/Platform/iOS/TextFieldExtensions.cs b/src/Core/src/Platform/iOS/TextFieldExtensions.cs index 34baecb90246..34f745dce80e 100644 --- a/src/Core/src/Platform/iOS/TextFieldExtensions.cs +++ b/src/Core/src/Platform/iOS/TextFieldExtensions.cs @@ -51,10 +51,12 @@ public static void UpdateVerticalTextAlignment(this UITextField textField, IText public static void UpdateIsTextPredictionEnabled(this UITextField textField, IEntry entry) { - if (entry.IsTextPredictionEnabled) - textField.AutocorrectionType = UITextAutocorrectionType.Yes; - else - textField.AutocorrectionType = UITextAutocorrectionType.No; + textField.UpdateKeyboard(entry); + } + + public static void UpdateIsSpellCheckEnabled(this UITextField textField, IEntry entry) + { + textField.UpdateKeyboard(entry); } public static void UpdateMaxLength(this UITextField textField, IEntry entry) @@ -117,8 +119,16 @@ public static void UpdateKeyboard(this UITextField textField, IEntry entry) textField.ApplyKeyboard(keyboard); if (keyboard is not CustomKeyboard) + { textField.UpdateIsTextPredictionEnabled(entry); + if (!entry.IsSpellCheckEnabled) + textField.SpellCheckingType = UITextSpellCheckingType.No; + + if (!entry.IsTextPredictionEnabled) + textField.AutocorrectionType = UITextAutocorrectionType.No; + } + textField.ReloadInputViews(); } @@ -140,6 +150,11 @@ public static void UpdateSelectionLength(this UITextField textField, IEntry entr UpdateCursorSelection(textField, entry); } + public static void UpdateClearButtonVisibility(this UITextField textField, IEntry entry) + { + textField.ClearButtonMode = entry.ClearButtonVisibility == ClearButtonVisibility.WhileEditing ? UITextFieldViewMode.WhileEditing : UITextFieldViewMode.Never; + } + /* Updates both the IEntry.CursorPosition and IEntry.SelectionLength properties. */ static void UpdateCursorSelection(this UITextField textField, IEntry entry) { @@ -181,10 +196,5 @@ static UITextPosition GetSelectionEnd(UITextField textField, IEntry entry, UITex return end; } - - public static void UpdateClearButtonVisibility(this UITextField textField, IEntry entry) - { - textField.ClearButtonMode = entry.ClearButtonVisibility == ClearButtonVisibility.WhileEditing ? UITextFieldViewMode.WhileEditing : UITextFieldViewMode.Never; - } } } diff --git a/src/Core/tests/DeviceTests/Handlers/Entry/EntryHandlerTests.Android.cs b/src/Core/tests/DeviceTests/Handlers/Entry/EntryHandlerTests.Android.cs index 8849cb1eadba..2248daa8cc31 100644 --- a/src/Core/tests/DeviceTests/Handlers/Entry/EntryHandlerTests.Android.cs +++ b/src/Core/tests/DeviceTests/Handlers/Entry/EntryHandlerTests.Android.cs @@ -4,10 +4,7 @@ using Android.Text.Method; using Android.Views.InputMethods; using AndroidX.AppCompat.Widget; -using Microsoft.Extensions.DependencyInjection; using Microsoft.Maui.DeviceTests.Stubs; -using Microsoft.Maui.Graphics; -using Microsoft.Maui.Handlers; using Xunit; using AColor = Android.Graphics.Color; @@ -291,5 +288,8 @@ int GetPlatformSelectionLength(EntryHandler entryHandler) return -1; } + + bool GetNativeIsSpellCheckEnabled(EntryHandler entryHandler) => + !GetNativeEntry(entryHandler).InputType.HasFlag(InputTypes.TextFlagNoSuggestions); } } diff --git a/src/Core/tests/DeviceTests/Handlers/Entry/EntryHandlerTests.cs b/src/Core/tests/DeviceTests/Handlers/Entry/EntryHandlerTests.cs index e694d8322557..b46e045e9bf1 100644 --- a/src/Core/tests/DeviceTests/Handlers/Entry/EntryHandlerTests.cs +++ b/src/Core/tests/DeviceTests/Handlers/Entry/EntryHandlerTests.cs @@ -1,8 +1,5 @@ -using System; -using System.Threading.Tasks; +using System.Threading.Tasks; using Microsoft.Maui.DeviceTests.Stubs; -using Microsoft.Maui.Graphics; -using Microsoft.Maui.Handlers; using Xunit; namespace Microsoft.Maui.DeviceTests @@ -578,6 +575,18 @@ public async Task SelectionLengthIsCapped(int selectionLength) Assert.Equal(text.Length, actualLength); } + [Theory(DisplayName = "Is Spell Check Enabled")] + [InlineData(true)] + [InlineData(false)] + public async Task IsSpellCheckEnabledCorrectly(bool isSpellCheckEnabled) + { + var entry = new EntryStub() + { + IsSpellCheckEnabled = isSpellCheckEnabled + }; + + await ValidatePropertyInitValue(entry, () => entry.IsSpellCheckEnabled, GetNativeIsSpellCheckEnabled, isSpellCheckEnabled); + } [Category(TestCategory.Entry)] public class EntryTextInputTests : TextInputHandlerTests @@ -596,6 +605,5 @@ protected override void UpdateCursorStartPosition(EntryHandler entryHandler, int EntryHandlerTests.UpdateCursorStartPosition(entryHandler, position); } } - } } diff --git a/src/Core/tests/DeviceTests/Handlers/Entry/EntryHandlerTests.iOS.cs b/src/Core/tests/DeviceTests/Handlers/Entry/EntryHandlerTests.iOS.cs index 349e2d06f0f9..5848f86df3b7 100644 --- a/src/Core/tests/DeviceTests/Handlers/Entry/EntryHandlerTests.iOS.cs +++ b/src/Core/tests/DeviceTests/Handlers/Entry/EntryHandlerTests.iOS.cs @@ -218,5 +218,8 @@ int GetPlatformSelectionLength(EntryHandler entryHandler) return -1; } + + bool GetNativeIsSpellCheckEnabled(EntryHandler entryHandler) => + GetNativeEntry(entryHandler).SpellCheckingType == UITextSpellCheckingType.Yes; } } \ No newline at end of file diff --git a/src/Core/tests/DeviceTests/Stubs/EditorStub.cs b/src/Core/tests/DeviceTests/Stubs/EditorStub.cs index d8a090fda5f7..a6f7b8b8eb91 100644 --- a/src/Core/tests/DeviceTests/Stubs/EditorStub.cs +++ b/src/Core/tests/DeviceTests/Stubs/EditorStub.cs @@ -29,6 +29,8 @@ public string Text public bool IsTextPredictionEnabled { get; set; } = true; + public bool IsSpellCheckEnabled { get; set; } = true; + public Keyboard Keyboard { get; set; } public TextAlignment HorizontalTextAlignment { get; set; } diff --git a/src/Core/tests/DeviceTests/Stubs/EntryStub.cs b/src/Core/tests/DeviceTests/Stubs/EntryStub.cs index 2589c8bc9e82..4960c6836780 100644 --- a/src/Core/tests/DeviceTests/Stubs/EntryStub.cs +++ b/src/Core/tests/DeviceTests/Stubs/EntryStub.cs @@ -21,6 +21,8 @@ public string Text public bool IsTextPredictionEnabled { get; set; } = true; + public bool IsSpellCheckEnabled { get; set; } = true; + public string Placeholder { get; set; } public Color PlaceholderColor { get; set; } diff --git a/src/Core/tests/DeviceTests/Stubs/SearchBarStub.cs b/src/Core/tests/DeviceTests/Stubs/SearchBarStub.cs index d486897f1137..3ef8f8b4b8c7 100644 --- a/src/Core/tests/DeviceTests/Stubs/SearchBarStub.cs +++ b/src/Core/tests/DeviceTests/Stubs/SearchBarStub.cs @@ -41,6 +41,8 @@ void OnTextChanged(string oldValue, string newValue) => public bool IsTextPredictionEnabled { get; set; } = true; + public bool IsSpellCheckEnabled { get; set; } = true; + public bool IsReadOnly { get; set; } public int MaxLength { get; set; } = int.MaxValue; From 3d06a8be56c701d81909c592ebb156110523bb80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Su=C3=A1rez=20Ruiz?= Date: Tue, 24 May 2022 20:21:45 +0200 Subject: [PATCH 02/10] Fix build errors --- src/Core/src/Handlers/Entry/EntryHandler.Tizen.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Core/src/Handlers/Entry/EntryHandler.Tizen.cs b/src/Core/src/Handlers/Entry/EntryHandler.Tizen.cs index 7de35a8909ce..b2ff9de3ac46 100644 --- a/src/Core/src/Handlers/Entry/EntryHandler.Tizen.cs +++ b/src/Core/src/Handlers/Entry/EntryHandler.Tizen.cs @@ -109,6 +109,8 @@ public static void MapIsTextPredictionEnabled(IEntryHandler handler, IEntry entr handler.PlatformView?.UpdateIsTextPredictionEnabled(entry); } + public static void MapIsSpellCheckEnabled(IEntryHandler handler, IEntry entry) { } + public static void MapKeyboard(IEntryHandler handler, IEntry entry) { handler.PlatformView?.UpdateKeyboard(entry); From 51c67faa8ae6b6d6f6a8d97b9d05828a3b3ee0e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Su=C3=A1rez=20Ruiz?= Date: Tue, 27 Sep 2022 17:48:36 +0200 Subject: [PATCH 03/10] Updated public APIs --- src/Core/src/PublicAPI/net-android/PublicAPI.Unshipped.txt | 3 +++ src/Core/src/PublicAPI/net-ios/PublicAPI.Unshipped.txt | 3 +++ src/Core/src/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt | 3 +++ src/Core/src/PublicAPI/net-windows/PublicAPI.Unshipped.txt | 3 +++ src/Core/src/PublicAPI/net/PublicAPI.Unshipped.txt | 2 ++ src/Core/src/PublicAPI/netstandard/PublicAPI.Unshipped.txt | 2 ++ src/Core/src/PublicAPI/netstandard2.0/PublicAPI.Unshipped.txt | 2 ++ 7 files changed, 18 insertions(+) diff --git a/src/Core/src/PublicAPI/net-android/PublicAPI.Unshipped.txt b/src/Core/src/PublicAPI/net-android/PublicAPI.Unshipped.txt index f61776e22e5c..23bb19614aac 100644 --- a/src/Core/src/PublicAPI/net-android/PublicAPI.Unshipped.txt +++ b/src/Core/src/PublicAPI/net-android/PublicAPI.Unshipped.txt @@ -30,6 +30,7 @@ Microsoft.Maui.IFlyout Microsoft.Maui.IMenuFlyout Microsoft.Maui.IContextFlyoutElement Microsoft.Maui.IMenuFlyoutSeparator +Microsoft.Maui.ITextInput.IsSpellCheckEnabled.get -> bool Microsoft.Maui.IToolTipElement Microsoft.Maui.IToolTipElement.ToolTip.get -> Microsoft.Maui.ToolTip? Microsoft.Maui.IWindow.FrameChanged(Microsoft.Maui.Graphics.Rect frame) -> void @@ -66,6 +67,7 @@ override Microsoft.Maui.Platform.AccessibilityDelegateCompatWrapper.OnInitialize override Microsoft.Maui.Platform.AccessibilityDelegateCompatWrapper.PerformAccessibilityAction(Android.Views.View! host, int action, Android.OS.Bundle? args) -> bool override Microsoft.Maui.Platform.MauiAccessibilityDelegateCompat.OnInitializeAccessibilityNodeInfo(Android.Views.View! host, AndroidX.Core.View.Accessibility.AccessibilityNodeInfoCompat! info) -> void override Microsoft.Maui.Platform.NavigationViewFragment.OnCreateView(Android.Views.LayoutInflater! inflater, Android.Views.ViewGroup? container, Android.OS.Bundle? savedInstanceState) -> Android.Views.View! +static Microsoft.Maui.Handlers.EntryHandler.MapIsSpellCheckEnabled(Microsoft.Maui.Handlers.IEntryHandler! handler, Microsoft.Maui.IEntry! entry) -> void static Microsoft.Maui.Handlers.MenuFlyoutHandler.CommandMapper -> Microsoft.Maui.CommandMapper! static Microsoft.Maui.Handlers.MenuFlyoutHandler.MapAdd(Microsoft.Maui.Handlers.IMenuFlyoutHandler! handler, Microsoft.Maui.IMenuFlyout! menuElement, object? arg) -> void static Microsoft.Maui.Handlers.MenuFlyoutHandler.MapClear(Microsoft.Maui.Handlers.IMenuFlyoutHandler! handler, Microsoft.Maui.IMenuFlyout! menuElement, object? arg) -> void @@ -80,6 +82,7 @@ static Microsoft.Maui.Handlers.WindowHandler.MapHeight(Microsoft.Maui.Handlers.I static Microsoft.Maui.Handlers.WindowHandler.MapWidth(Microsoft.Maui.Handlers.IWindowHandler! handler, Microsoft.Maui.IWindow! view) -> void static Microsoft.Maui.Handlers.WindowHandler.MapX(Microsoft.Maui.Handlers.IWindowHandler! handler, Microsoft.Maui.IWindow! view) -> void static Microsoft.Maui.Handlers.WindowHandler.MapY(Microsoft.Maui.Handlers.IWindowHandler! handler, Microsoft.Maui.IWindow! view) -> void +static Microsoft.Maui.Platform.EditTextExtensions.UpdateIsSpellCheckEnabled(this Android.Widget.EditText! editText, Microsoft.Maui.IEntry! entry) -> void static Microsoft.Maui.Platform.SwitchExtensions.GetDefaultSwitchThumbDrawable(this AndroidX.AppCompat.Widget.SwitchCompat! aSwitch) -> Android.Graphics.Drawables.Drawable? static Microsoft.Maui.Platform.SwitchExtensions.GetDefaultSwitchTrackDrawable(this AndroidX.AppCompat.Widget.SwitchCompat! aSwitch) -> Android.Graphics.Drawables.Drawable? static Microsoft.Maui.Platform.ViewExtensions.UpdateToolTip(this Android.Views.View! view, Microsoft.Maui.ToolTip? tooltip) -> void diff --git a/src/Core/src/PublicAPI/net-ios/PublicAPI.Unshipped.txt b/src/Core/src/PublicAPI/net-ios/PublicAPI.Unshipped.txt index 0111176429ee..255938388ae2 100644 --- a/src/Core/src/PublicAPI/net-ios/PublicAPI.Unshipped.txt +++ b/src/Core/src/PublicAPI/net-ios/PublicAPI.Unshipped.txt @@ -30,6 +30,7 @@ Microsoft.Maui.IFlyout Microsoft.Maui.IMenuFlyout Microsoft.Maui.IContextFlyoutElement Microsoft.Maui.IMenuFlyoutSeparator +Microsoft.Maui.ITextInput.IsSpellCheckEnabled.get -> bool Microsoft.Maui.IToolTipElement Microsoft.Maui.IToolTipElement.ToolTip.get -> Microsoft.Maui.ToolTip? Microsoft.Maui.IWindow.FrameChanged(Microsoft.Maui.Graphics.Rect frame) -> void @@ -80,6 +81,7 @@ override Microsoft.Maui.Platform.MauiWebViewUIDelegate.RunJavaScriptAlertPanel(W override Microsoft.Maui.Platform.MauiWebViewUIDelegate.RunJavaScriptConfirmPanel(WebKit.WKWebView! webView, string! message, WebKit.WKFrameInfo! frame, System.Action! completionHandler) -> void override Microsoft.Maui.Platform.MauiWebViewUIDelegate.RunJavaScriptTextInputPanel(WebKit.WKWebView! webView, string! prompt, string? defaultText, WebKit.WKFrameInfo! frame, System.Action! completionHandler) -> void override Microsoft.Maui.Platform.MauiWebViewUIDelegate.SetContextMenuConfiguration(WebKit.WKWebView! webView, WebKit.WKContextMenuElementInfo! elementInfo, System.Action! completionHandler) -> void +static Microsoft.Maui.Handlers.EntryHandler.MapIsSpellCheckEnabled(Microsoft.Maui.Handlers.IEntryHandler! handler, Microsoft.Maui.IEntry! entry) -> void static Microsoft.Maui.Handlers.MenuFlyoutHandler.CommandMapper -> Microsoft.Maui.CommandMapper! static Microsoft.Maui.Handlers.MenuFlyoutHandler.MapAdd(Microsoft.Maui.Handlers.IMenuFlyoutHandler! handler, Microsoft.Maui.IMenuFlyout! menuElement, object? arg) -> void static Microsoft.Maui.Handlers.MenuFlyoutHandler.MapClear(Microsoft.Maui.Handlers.IMenuFlyoutHandler! handler, Microsoft.Maui.IMenuFlyout! menuElement, object? arg) -> void @@ -111,6 +113,7 @@ static Microsoft.Maui.LifecycleEvents.iOSLifecycleBuilderExtensions.SceneWillEnt static Microsoft.Maui.LifecycleEvents.iOSLifecycleBuilderExtensions.WindowSceneDidUpdateCoordinateSpace(this Microsoft.Maui.LifecycleEvents.IiOSLifecycleBuilder! lifecycle, Microsoft.Maui.LifecycleEvents.iOSLifecycle.WindowSceneDidUpdateCoordinateSpace! del) -> Microsoft.Maui.LifecycleEvents.IiOSLifecycleBuilder! static Microsoft.Maui.Platform.MauiWKWebView.CreateConfiguration() -> WebKit.WKWebViewConfiguration! static Microsoft.Maui.Handlers.ViewHandler.MapToolTip(Microsoft.Maui.IViewHandler! handler, Microsoft.Maui.IView! view) -> void +static Microsoft.Maui.Platform.TextFieldExtensions.UpdateIsSpellCheckEnabled(this UIKit.UITextField! textField, Microsoft.Maui.IEntry! entry) -> void static Microsoft.Maui.Platform.ViewExtensions.UpdateBackground(this UIKit.UIView! platformView, Microsoft.Maui.Graphics.Paint? paint, Microsoft.Maui.IButtonStroke? stroke = null) -> void static Microsoft.Maui.Platform.ViewExtensions.UpdateToolTip(this UIKit.UIView! platformView, Microsoft.Maui.ToolTip? tooltip) -> void static Microsoft.Maui.Platform.WindowExtensions.UpdateMaximumHeight(this UIKit.UIWindow! platformWindow, Microsoft.Maui.IWindow! window) -> void diff --git a/src/Core/src/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt b/src/Core/src/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt index 1a2ac38ca844..7f92c8f6a951 100644 --- a/src/Core/src/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt +++ b/src/Core/src/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt @@ -30,6 +30,7 @@ Microsoft.Maui.IFlyout Microsoft.Maui.IMenuFlyout Microsoft.Maui.IContextFlyoutElement Microsoft.Maui.IMenuFlyoutSeparator +Microsoft.Maui.ITextInput.IsSpellCheckEnabled.get -> bool Microsoft.Maui.IToolTipElement Microsoft.Maui.IToolTipElement.ToolTip.get -> Microsoft.Maui.ToolTip? Microsoft.Maui.IWindow.FrameChanged(Microsoft.Maui.Graphics.Rect frame) -> void @@ -80,6 +81,7 @@ override Microsoft.Maui.Platform.MauiWebViewUIDelegate.RunJavaScriptAlertPanel(W override Microsoft.Maui.Platform.MauiWebViewUIDelegate.RunJavaScriptConfirmPanel(WebKit.WKWebView! webView, string! message, WebKit.WKFrameInfo! frame, System.Action! completionHandler) -> void override Microsoft.Maui.Platform.MauiWebViewUIDelegate.RunJavaScriptTextInputPanel(WebKit.WKWebView! webView, string! prompt, string? defaultText, WebKit.WKFrameInfo! frame, System.Action! completionHandler) -> void override Microsoft.Maui.Platform.MauiWebViewUIDelegate.SetContextMenuConfiguration(WebKit.WKWebView! webView, WebKit.WKContextMenuElementInfo! elementInfo, System.Action! completionHandler) -> void +static Microsoft.Maui.Handlers.EntryHandler.MapIsSpellCheckEnabled(Microsoft.Maui.Handlers.IEntryHandler! handler, Microsoft.Maui.IEntry! entry) -> void static Microsoft.Maui.Handlers.MenuFlyoutHandler.CommandMapper -> Microsoft.Maui.CommandMapper! static Microsoft.Maui.Handlers.MenuFlyoutHandler.MapAdd(Microsoft.Maui.Handlers.IMenuFlyoutHandler! handler, Microsoft.Maui.IMenuFlyout! menuElement, object? arg) -> void static Microsoft.Maui.Handlers.MenuFlyoutHandler.MapClear(Microsoft.Maui.Handlers.IMenuFlyoutHandler! handler, Microsoft.Maui.IMenuFlyout! menuElement, object? arg) -> void @@ -111,6 +113,7 @@ static Microsoft.Maui.LifecycleEvents.iOSLifecycleBuilderExtensions.SceneWillCon static Microsoft.Maui.LifecycleEvents.iOSLifecycleBuilderExtensions.SceneWillEnterForeground(this Microsoft.Maui.LifecycleEvents.IiOSLifecycleBuilder! lifecycle, Microsoft.Maui.LifecycleEvents.iOSLifecycle.SceneWillEnterForeground! del) -> Microsoft.Maui.LifecycleEvents.IiOSLifecycleBuilder! static Microsoft.Maui.LifecycleEvents.iOSLifecycleBuilderExtensions.WindowSceneDidUpdateCoordinateSpace(this Microsoft.Maui.LifecycleEvents.IiOSLifecycleBuilder! lifecycle, Microsoft.Maui.LifecycleEvents.iOSLifecycle.WindowSceneDidUpdateCoordinateSpace! del) -> Microsoft.Maui.LifecycleEvents.IiOSLifecycleBuilder! static Microsoft.Maui.Platform.MauiWKWebView.CreateConfiguration() -> WebKit.WKWebViewConfiguration! +static Microsoft.Maui.Platform.TextFieldExtensions.UpdateIsSpellCheckEnabled(this UIKit.UITextField! textField, Microsoft.Maui.IEntry! entry) -> void static Microsoft.Maui.Platform.ViewExtensions.UpdateBackground(this UIKit.UIView! platformView, Microsoft.Maui.Graphics.Paint? paint, Microsoft.Maui.IButtonStroke? stroke = null) -> void static Microsoft.Maui.Platform.ViewExtensions.UpdateToolTip(this UIKit.UIView! platformView, Microsoft.Maui.ToolTip? tooltip) -> void static Microsoft.Maui.Platform.WindowExtensions.UpdateMaximumHeight(this UIKit.UIWindow! platformWindow, Microsoft.Maui.IWindow! window) -> void diff --git a/src/Core/src/PublicAPI/net-windows/PublicAPI.Unshipped.txt b/src/Core/src/PublicAPI/net-windows/PublicAPI.Unshipped.txt index ad0c202c26c3..045ea9d5cc45 100644 --- a/src/Core/src/PublicAPI/net-windows/PublicAPI.Unshipped.txt +++ b/src/Core/src/PublicAPI/net-windows/PublicAPI.Unshipped.txt @@ -31,6 +31,7 @@ Microsoft.Maui.IFlyout Microsoft.Maui.IMenuFlyout Microsoft.Maui.IContextFlyoutElement Microsoft.Maui.IMenuFlyoutSeparator +Microsoft.Maui.ITextInput.IsSpellCheckEnabled.get -> bool Microsoft.Maui.IToolTipElement Microsoft.Maui.IToolTipElement.ToolTip.get -> Microsoft.Maui.ToolTip? Microsoft.Maui.IWindow.FrameChanged(Microsoft.Maui.Graphics.Rect frame) -> void @@ -49,6 +50,7 @@ Microsoft.Maui.IWindow.Y.get -> double override Microsoft.Maui.Handlers.MenuFlyoutHandler.CreatePlatformElement() -> Microsoft.UI.Xaml.Controls.MenuFlyout! override Microsoft.Maui.Handlers.MenuFlyoutHandler.SetVirtualView(Microsoft.Maui.IElement! view) -> void override Microsoft.Maui.Handlers.MenuFlyoutSeparatorHandler.CreatePlatformElement() -> Microsoft.UI.Xaml.Controls.MenuFlyoutSeparator! +static Microsoft.Maui.Handlers.EntryHandler.MapIsSpellCheckEnabled(Microsoft.Maui.Handlers.IEntryHandler! handler, Microsoft.Maui.IEntry! entry) -> void static Microsoft.Maui.Handlers.MenuFlyoutHandler.CommandMapper -> Microsoft.Maui.CommandMapper! static Microsoft.Maui.Handlers.MenuFlyoutHandler.MapAdd(Microsoft.Maui.Handlers.IMenuFlyoutHandler! handler, Microsoft.Maui.IMenuFlyout! menuElement, object? arg) -> void static Microsoft.Maui.Handlers.MenuFlyoutHandler.MapClear(Microsoft.Maui.Handlers.IMenuFlyoutHandler! handler, Microsoft.Maui.IMenuFlyout! menuElement, object? arg) -> void @@ -74,6 +76,7 @@ static Microsoft.Maui.Handlers.WindowHandler.MapMinimumWidth(Microsoft.Maui.Hand static Microsoft.Maui.Handlers.WindowHandler.MapWidth(Microsoft.Maui.Handlers.IWindowHandler! handler, Microsoft.Maui.IWindow! view) -> void static Microsoft.Maui.Handlers.WindowHandler.MapX(Microsoft.Maui.Handlers.IWindowHandler! handler, Microsoft.Maui.IWindow! view) -> void static Microsoft.Maui.Handlers.WindowHandler.MapY(Microsoft.Maui.Handlers.IWindowHandler! handler, Microsoft.Maui.IWindow! view) -> void +static Microsoft.Maui.Platform.TextBoxExtensions.UpdateIsSpellCheckEnabled(this Microsoft.UI.Xaml.Controls.TextBox! textBox, Microsoft.Maui.ITextInput! textInput) -> void static Microsoft.Maui.Platform.ViewExtensions.UpdateToolTip(this Microsoft.UI.Xaml.FrameworkElement! platformView, Microsoft.Maui.ToolTip? tooltip) -> void static Microsoft.Maui.Platform.WindowExtensions.UpdateHeight(this Microsoft.UI.Xaml.Window! platformWindow, Microsoft.Maui.IWindow! window) -> void static Microsoft.Maui.Platform.WindowExtensions.UpdateMaximumHeight(this Microsoft.UI.Xaml.Window! platformWindow, Microsoft.Maui.IWindow! window) -> void diff --git a/src/Core/src/PublicAPI/net/PublicAPI.Unshipped.txt b/src/Core/src/PublicAPI/net/PublicAPI.Unshipped.txt index 3d6386fc4f06..1f12d884d615 100644 --- a/src/Core/src/PublicAPI/net/PublicAPI.Unshipped.txt +++ b/src/Core/src/PublicAPI/net/PublicAPI.Unshipped.txt @@ -30,6 +30,7 @@ Microsoft.Maui.IFlyout Microsoft.Maui.IMenuFlyout Microsoft.Maui.IContextFlyoutElement Microsoft.Maui.IMenuFlyoutSeparator +Microsoft.Maui.ITextInput.IsSpellCheckEnabled.get -> bool Microsoft.Maui.IToolTipElement Microsoft.Maui.IToolTipElement.ToolTip.get -> Microsoft.Maui.ToolTip? Microsoft.Maui.IWindow.FrameChanged(Microsoft.Maui.Graphics.Rect frame) -> void @@ -47,6 +48,7 @@ Microsoft.Maui.IWindow.X.get -> double Microsoft.Maui.IWindow.Y.get -> double override Microsoft.Maui.Handlers.MenuFlyoutHandler.CreatePlatformElement() -> object! override Microsoft.Maui.Handlers.MenuFlyoutSeparatorHandler.CreatePlatformElement() -> object! +static Microsoft.Maui.Handlers.EntryHandler.MapIsSpellCheckEnabled(Microsoft.Maui.Handlers.IEntryHandler! handler, Microsoft.Maui.IEntry! entry) -> void static Microsoft.Maui.Handlers.MenuFlyoutHandler.CommandMapper -> Microsoft.Maui.CommandMapper! static Microsoft.Maui.Handlers.MenuFlyoutHandler.MapAdd(Microsoft.Maui.Handlers.IMenuFlyoutHandler! handler, Microsoft.Maui.IMenuFlyout! menuElement, object? arg) -> void static Microsoft.Maui.Handlers.MenuFlyoutHandler.MapClear(Microsoft.Maui.Handlers.IMenuFlyoutHandler! handler, Microsoft.Maui.IMenuFlyout! menuElement, object? arg) -> void diff --git a/src/Core/src/PublicAPI/netstandard/PublicAPI.Unshipped.txt b/src/Core/src/PublicAPI/netstandard/PublicAPI.Unshipped.txt index 8d460b918f51..048840f9d410 100644 --- a/src/Core/src/PublicAPI/netstandard/PublicAPI.Unshipped.txt +++ b/src/Core/src/PublicAPI/netstandard/PublicAPI.Unshipped.txt @@ -30,6 +30,7 @@ Microsoft.Maui.IMenuFlyout Microsoft.Maui.IFlyout Microsoft.Maui.IContextFlyoutElement Microsoft.Maui.IMenuFlyoutSeparator +Microsoft.Maui.ITextInput.IsSpellCheckEnabled.get -> bool Microsoft.Maui.IToolTipElement Microsoft.Maui.IToolTipElement.ToolTip.get -> Microsoft.Maui.ToolTip? Microsoft.Maui.IWindow.FrameChanged(Microsoft.Maui.Graphics.Rect frame) -> void @@ -47,6 +48,7 @@ Microsoft.Maui.IWindow.X.get -> double Microsoft.Maui.IWindow.Y.get -> double override Microsoft.Maui.Handlers.MenuFlyoutHandler.CreatePlatformElement() -> object! override Microsoft.Maui.Handlers.MenuFlyoutSeparatorHandler.CreatePlatformElement() -> object! +static Microsoft.Maui.Handlers.EntryHandler.MapIsSpellCheckEnabled(Microsoft.Maui.Handlers.IEntryHandler! handler, Microsoft.Maui.IEntry! entry) -> void static Microsoft.Maui.Handlers.MenuFlyoutHandler.CommandMapper -> Microsoft.Maui.CommandMapper! static Microsoft.Maui.Handlers.MenuFlyoutHandler.MapAdd(Microsoft.Maui.Handlers.IMenuFlyoutHandler! handler, Microsoft.Maui.IMenuFlyout! menuElement, object? arg) -> void static Microsoft.Maui.Handlers.MenuFlyoutHandler.MapClear(Microsoft.Maui.Handlers.IMenuFlyoutHandler! handler, Microsoft.Maui.IMenuFlyout! menuElement, object? arg) -> void diff --git a/src/Core/src/PublicAPI/netstandard2.0/PublicAPI.Unshipped.txt b/src/Core/src/PublicAPI/netstandard2.0/PublicAPI.Unshipped.txt index 8d460b918f51..048840f9d410 100644 --- a/src/Core/src/PublicAPI/netstandard2.0/PublicAPI.Unshipped.txt +++ b/src/Core/src/PublicAPI/netstandard2.0/PublicAPI.Unshipped.txt @@ -30,6 +30,7 @@ Microsoft.Maui.IMenuFlyout Microsoft.Maui.IFlyout Microsoft.Maui.IContextFlyoutElement Microsoft.Maui.IMenuFlyoutSeparator +Microsoft.Maui.ITextInput.IsSpellCheckEnabled.get -> bool Microsoft.Maui.IToolTipElement Microsoft.Maui.IToolTipElement.ToolTip.get -> Microsoft.Maui.ToolTip? Microsoft.Maui.IWindow.FrameChanged(Microsoft.Maui.Graphics.Rect frame) -> void @@ -47,6 +48,7 @@ Microsoft.Maui.IWindow.X.get -> double Microsoft.Maui.IWindow.Y.get -> double override Microsoft.Maui.Handlers.MenuFlyoutHandler.CreatePlatformElement() -> object! override Microsoft.Maui.Handlers.MenuFlyoutSeparatorHandler.CreatePlatformElement() -> object! +static Microsoft.Maui.Handlers.EntryHandler.MapIsSpellCheckEnabled(Microsoft.Maui.Handlers.IEntryHandler! handler, Microsoft.Maui.IEntry! entry) -> void static Microsoft.Maui.Handlers.MenuFlyoutHandler.CommandMapper -> Microsoft.Maui.CommandMapper! static Microsoft.Maui.Handlers.MenuFlyoutHandler.MapAdd(Microsoft.Maui.Handlers.IMenuFlyoutHandler! handler, Microsoft.Maui.IMenuFlyout! menuElement, object? arg) -> void static Microsoft.Maui.Handlers.MenuFlyoutHandler.MapClear(Microsoft.Maui.Handlers.IMenuFlyoutHandler! handler, Microsoft.Maui.IMenuFlyout! menuElement, object? arg) -> void From c03b78b10b368632e4d5bd4f248dea50d0f4aab3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Su=C3=A1rez=20Ruiz?= Date: Fri, 30 Sep 2022 13:43:07 +0200 Subject: [PATCH 04/10] Updated Tizen public apis --- src/Core/src/PublicAPI/net-tizen/PublicAPI.Unshipped.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Core/src/PublicAPI/net-tizen/PublicAPI.Unshipped.txt b/src/Core/src/PublicAPI/net-tizen/PublicAPI.Unshipped.txt index 8b9ba2f13459..c251dc728902 100644 --- a/src/Core/src/PublicAPI/net-tizen/PublicAPI.Unshipped.txt +++ b/src/Core/src/PublicAPI/net-tizen/PublicAPI.Unshipped.txt @@ -949,6 +949,7 @@ Microsoft.Maui.IMenuFlyout Microsoft.Maui.IMenuFlyoutItem Microsoft.Maui.IMenuFlyoutSeparator Microsoft.Maui.IMenuFlyoutSubItem +Microsoft.Maui.ITextInput.IsSpellCheckEnabled.get -> bool Microsoft.Maui.IPadding Microsoft.Maui.IPadding.Padding.get -> Microsoft.Maui.Thickness Microsoft.Maui.IPersistedState @@ -2207,6 +2208,7 @@ static Microsoft.Maui.Handlers.EntryHandler.MapSelectionLength(Microsoft.Maui.Ha static Microsoft.Maui.Handlers.EntryHandler.MapText(Microsoft.Maui.Handlers.IEntryHandler! handler, Microsoft.Maui.IEntry! entry) -> void static Microsoft.Maui.Handlers.EntryHandler.MapTextColor(Microsoft.Maui.Handlers.IEntryHandler! handler, Microsoft.Maui.IEntry! entry) -> void static Microsoft.Maui.Handlers.EntryHandler.MapVerticalTextAlignment(Microsoft.Maui.Handlers.IEntryHandler! handler, Microsoft.Maui.IEntry! entry) -> void +static Microsoft.Maui.Handlers.EntryHandler.MapIsSpellCheckEnabled(Microsoft.Maui.Handlers.IEntryHandler! handler, Microsoft.Maui.IEntry! entry) -> void static Microsoft.Maui.Handlers.FlyoutViewHandler.CommandMapper -> Microsoft.Maui.CommandMapper! static Microsoft.Maui.Handlers.FlyoutViewHandler.MapDetail(Microsoft.Maui.Handlers.IFlyoutViewHandler! handler, Microsoft.Maui.IFlyoutView! flyoutView) -> void static Microsoft.Maui.Handlers.FlyoutViewHandler.MapFlyout(Microsoft.Maui.Handlers.IFlyoutViewHandler! handler, Microsoft.Maui.IFlyoutView! flyoutView) -> void From 738e5b0d60acab982d08b985fd091244ba06312b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Su=C3=A1rez=20Ruiz?= Date: Fri, 30 Sep 2022 19:04:43 +0200 Subject: [PATCH 05/10] Fix build errors --- .../Entry/EntryHandlerTests.Windows.cs | 5 +- .../Handlers/Entry/EntryHandlerTests.cs | 122 +----------------- 2 files changed, 7 insertions(+), 120 deletions(-) diff --git a/src/Core/tests/DeviceTests/Handlers/Entry/EntryHandlerTests.Windows.cs b/src/Core/tests/DeviceTests/Handlers/Entry/EntryHandlerTests.Windows.cs index b0bf77d597ea..e874d1421a4b 100644 --- a/src/Core/tests/DeviceTests/Handlers/Entry/EntryHandlerTests.Windows.cs +++ b/src/Core/tests/DeviceTests/Handlers/Entry/EntryHandlerTests.Windows.cs @@ -108,6 +108,9 @@ int GetNativeCursorPosition(EntryHandler entryHandler) => GetNativeEntry(entryHandler).GetCursorPosition(); int GetNativeSelectionLength(EntryHandler entryHandler) => - GetNativeEntry(entryHandler).SelectionLength; + GetNativeEntry(entryHandler).SelectionLength; + + bool GetNativeIsSpellCheckEnabled(EntryHandler entryHandler) => + GetNativeEntry(entryHandler).IsTextPredictionEnabled; } } \ No newline at end of file diff --git a/src/Core/tests/DeviceTests/Handlers/Entry/EntryHandlerTests.cs b/src/Core/tests/DeviceTests/Handlers/Entry/EntryHandlerTests.cs index ddbad9bf8d78..3a18ec17993d 100644 --- a/src/Core/tests/DeviceTests/Handlers/Entry/EntryHandlerTests.cs +++ b/src/Core/tests/DeviceTests/Handlers/Entry/EntryHandlerTests.cs @@ -2,6 +2,8 @@ using System.Threading.Tasks; using Microsoft.Maui.Controls; using Microsoft.Maui.DeviceTests.Stubs; +using Microsoft.Maui.Graphics; +using Microsoft.Maui.Handlers; using Xunit; namespace Microsoft.Maui.DeviceTests @@ -492,106 +494,6 @@ await ValidateUnrelatedPropertyUnaffected( () => entry.CharacterSpacing = newSize); } - [Theory(DisplayName = "CursorPosition Initializes Correctly")] - [InlineData(0)] - public async Task CursorPositionInitializesCorrectly(int initialPosition) - { - var entry = new EntryStub - { - Text = "This is TEXT!", - CursorPosition = initialPosition - }; - - await ValidatePropertyInitValue(entry, () => entry.CursorPosition, GetNativeCursorPosition, initialPosition); - } - - [Theory(DisplayName = "CursorPosition Updates Correctly")] - [InlineData(2, 5)] - public async Task CursorPositionUpdatesCorrectly(int setValue, int unsetValue) - { - string text = "This is TEXT!"; - - var entry = new EntryStub - { - Text = text, - }; - - await ValidatePropertyUpdatesValue( - entry, - nameof(IEntry.CursorPosition), - GetNativeCursorPosition, - setValue, - unsetValue - ); - } - - [Theory(DisplayName = "CursorPosition is Capped to Text's Length")] - [InlineData(30)] - public async Task CursorPositionIsCapped(int initialPosition) - { - string text = "This is TEXT!"; - - var entry = new EntryStub - { - Text = text, - CursorPosition = initialPosition - }; - - int actualPosition = await GetValueAsync(entry, GetNativeCursorPosition); - - Assert.Equal(text.Length, actualPosition); - } - - [Theory(DisplayName = "SelectionLength Initializes Correctly")] - [InlineData(0)] - public async Task SelectionLengthInitializesCorrectly(int initialLength) - { - var entry = new EntryStub - { - Text = "This is TEXT!", - SelectionLength = initialLength - }; - - await ValidatePropertyInitValue(entry, () => entry.SelectionLength, GetPlatformSelectionLength, initialLength); - } - - [Theory(DisplayName = "SelectionLength Updates Correctly")] - [InlineData(2, 5)] - public async Task SelectionLengthUpdatesCorrectly(int setValue, int unsetValue) - { - string text = "This is TEXT!"; - - var entry = new EntryStub - { - Text = text, - }; - - await ValidatePropertyUpdatesValue( - entry, - nameof(IEntry.SelectionLength), - GetPlatformSelectionLength, - setValue, - unsetValue - ); - } - - [Theory(DisplayName = "SelectionLength is Capped to Text Length")] - [InlineData(30)] - public async Task SelectionLengthIsCapped(int selectionLength) - { - string text = "This is TEXT!"; - - var entry = new EntryStub - { - Text = text, - SelectionLength = selectionLength - }; - - var actualLength = await GetValueAsync(entry, GetPlatformSelectionLength); - - Assert.Equal(text.Length, actualLength); - } - [Theory(DisplayName = "Is Spell Check Enabled")] [InlineData(true)] [InlineData(false)] @@ -604,23 +506,5 @@ public async Task IsSpellCheckEnabledCorrectly(bool isSpellCheckEnabled) await ValidatePropertyInitValue(entry, () => entry.IsSpellCheckEnabled, GetNativeIsSpellCheckEnabled, isSpellCheckEnabled); } - - [Category(TestCategory.Entry)] - public class EntryTextInputTests : TextInputHandlerTests - { - protected override void SetNativeText(EntryHandler entryHandler, string text) - { - EntryHandlerTests.SetNativeText(entryHandler, text); - } - protected override int GetCursorStartPosition(EntryHandler entryHandler) - { - return EntryHandlerTests.GetCursorStartPosition(entryHandler); - } - - protected override void UpdateCursorStartPosition(EntryHandler entryHandler, int position) - { - EntryHandlerTests.UpdateCursorStartPosition(entryHandler, position); - } - } } -} +} \ No newline at end of file From 54476404c52317461606a7ac632bebf7130f82b1 Mon Sep 17 00:00:00 2001 From: Matthew Leibowitz Date: Mon, 20 Mar 2023 20:44:19 +0200 Subject: [PATCH 06/10] move this back --- src/Core/src/Platform/iOS/TextFieldExtensions.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Core/src/Platform/iOS/TextFieldExtensions.cs b/src/Core/src/Platform/iOS/TextFieldExtensions.cs index 5e016103d3b3..6f88383b8b63 100644 --- a/src/Core/src/Platform/iOS/TextFieldExtensions.cs +++ b/src/Core/src/Platform/iOS/TextFieldExtensions.cs @@ -144,11 +144,6 @@ public static void UpdateSelectionLength(this UITextField textField, IEntry entr UpdateCursorSelection(textField, entry); } - public static void UpdateClearButtonVisibility(this UITextField textField, IEntry entry) - { - textField.ClearButtonMode = entry.ClearButtonVisibility == ClearButtonVisibility.WhileEditing ? UITextFieldViewMode.WhileEditing : UITextFieldViewMode.Never; - } - /* Updates both the IEntry.CursorPosition and IEntry.SelectionLength properties. */ static void UpdateCursorSelection(this UITextField textField, IEntry entry) { @@ -188,5 +183,10 @@ static UITextPosition GetSelectionEnd(UITextField textField, IEntry entry, UITex return end; } + + public static void UpdateClearButtonVisibility(this UITextField textField, IEntry entry) + { + textField.ClearButtonMode = entry.ClearButtonVisibility == ClearButtonVisibility.WhileEditing ? UITextFieldViewMode.WhileEditing : UITextFieldViewMode.Never; + } } } From 50d3a893b51b191fa7086843627ae58d50bb6eaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Su=C3=A1rez?= Date: Tue, 21 Mar 2023 12:33:57 +0100 Subject: [PATCH 07/10] Updated publicAPIs --- src/Core/src/PublicAPI/net-android/PublicAPI.Unshipped.txt | 3 +++ src/Core/src/PublicAPI/net-ios/PublicAPI.Unshipped.txt | 3 +++ src/Core/src/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt | 3 +++ src/Core/src/PublicAPI/net-windows/PublicAPI.Unshipped.txt | 3 +++ src/Core/src/PublicAPI/net/PublicAPI.Unshipped.txt | 2 ++ src/Core/src/PublicAPI/netstandard/PublicAPI.Unshipped.txt | 2 ++ src/Core/src/PublicAPI/netstandard2.0/PublicAPI.Unshipped.txt | 2 ++ 7 files changed, 18 insertions(+) diff --git a/src/Core/src/PublicAPI/net-android/PublicAPI.Unshipped.txt b/src/Core/src/PublicAPI/net-android/PublicAPI.Unshipped.txt index a440b184d5f6..29c09b8faa92 100644 --- a/src/Core/src/PublicAPI/net-android/PublicAPI.Unshipped.txt +++ b/src/Core/src/PublicAPI/net-android/PublicAPI.Unshipped.txt @@ -2,6 +2,7 @@ Microsoft.Maui.FontSize.Equals(Microsoft.Maui.FontSize other) -> bool Microsoft.Maui.IApplication.UserAppTheme.get -> Microsoft.Maui.ApplicationModel.AppTheme Microsoft.Maui.Hosting.MauiApp.DisposeAsync() -> System.Threading.Tasks.ValueTask +Microsoft.Maui.ITextInput.IsSpellCheckEnabled.get -> bool Microsoft.Maui.Layouts.FlexBasis.Equals(Microsoft.Maui.Layouts.FlexBasis other) -> bool Microsoft.Maui.SizeRequest.Equals(Microsoft.Maui.SizeRequest other) -> bool override Microsoft.Maui.FontSize.Equals(object? obj) -> bool @@ -18,11 +19,13 @@ static Microsoft.Maui.FontSize.operator !=(Microsoft.Maui.FontSize left, Microso static Microsoft.Maui.FontSize.operator ==(Microsoft.Maui.FontSize left, Microsoft.Maui.FontSize right) -> bool static Microsoft.Maui.GridLength.operator !=(Microsoft.Maui.GridLength left, Microsoft.Maui.GridLength right) -> bool static Microsoft.Maui.GridLength.operator ==(Microsoft.Maui.GridLength left, Microsoft.Maui.GridLength right) -> bool +static Microsoft.Maui.Handlers.EntryHandler.MapIsSpellCheckEnabled(Microsoft.Maui.Handlers.IEntryHandler! handler, Microsoft.Maui.IEntry! entry) -> void static Microsoft.Maui.Handlers.StepperHandler.MapIsEnabled(Microsoft.Maui.Handlers.IStepperHandler! handler, Microsoft.Maui.IStepper! stepper) -> void static Microsoft.Maui.Layouts.FlexBasis.operator !=(Microsoft.Maui.Layouts.FlexBasis left, Microsoft.Maui.Layouts.FlexBasis right) -> bool static Microsoft.Maui.Layouts.FlexBasis.operator ==(Microsoft.Maui.Layouts.FlexBasis left, Microsoft.Maui.Layouts.FlexBasis right) -> bool static Microsoft.Maui.Layouts.LayoutExtensions.ArrangeContentUnbounded(this Microsoft.Maui.IContentView! contentView, Microsoft.Maui.Graphics.Rect bounds) -> Microsoft.Maui.Graphics.Size static Microsoft.Maui.Handlers.SearchBarHandler.MapKeyboard(Microsoft.Maui.Handlers.ISearchBarHandler! handler, Microsoft.Maui.ISearchBar! searchBar) -> void +static Microsoft.Maui.Platform.EditTextExtensions.UpdateIsSpellCheckEnabled(this Android.Widget.EditText! editText, Microsoft.Maui.IEntry! entry) -> void static Microsoft.Maui.Platform.SearchViewExtensions.UpdateKeyboard(this AndroidX.AppCompat.Widget.SearchView! searchView, Microsoft.Maui.ISearchBar! searchBar) -> void Microsoft.Maui.IWebView.UserAgent.get -> string? Microsoft.Maui.IWebView.UserAgent.set -> void diff --git a/src/Core/src/PublicAPI/net-ios/PublicAPI.Unshipped.txt b/src/Core/src/PublicAPI/net-ios/PublicAPI.Unshipped.txt index ba7714750fe1..ed7053f455ac 100644 --- a/src/Core/src/PublicAPI/net-ios/PublicAPI.Unshipped.txt +++ b/src/Core/src/PublicAPI/net-ios/PublicAPI.Unshipped.txt @@ -4,6 +4,7 @@ Microsoft.Maui.Handlers.SwipeItemButton.FrameChanged -> System.EventHandler? Microsoft.Maui.Handlers.SwipeItemButton.SwipeItemButton() -> void Microsoft.Maui.IApplication.UserAppTheme.get -> Microsoft.Maui.ApplicationModel.AppTheme Microsoft.Maui.Hosting.MauiApp.DisposeAsync() -> System.Threading.Tasks.ValueTask +Microsoft.Maui.ITextInput.IsSpellCheckEnabled.get -> bool Microsoft.Maui.Layouts.FlexBasis.Equals(Microsoft.Maui.Layouts.FlexBasis other) -> bool Microsoft.Maui.LifecycleEvents.iOSLifecycle.PerformFetch Microsoft.Maui.SizeRequest.Equals(Microsoft.Maui.SizeRequest other) -> bool @@ -24,6 +25,7 @@ override Microsoft.Maui.SizeRequest.Equals(object? obj) -> bool override Microsoft.Maui.SizeRequest.GetHashCode() -> int static Microsoft.Maui.GridLength.operator !=(Microsoft.Maui.GridLength left, Microsoft.Maui.GridLength right) -> bool static Microsoft.Maui.GridLength.operator ==(Microsoft.Maui.GridLength left, Microsoft.Maui.GridLength right) -> bool +static Microsoft.Maui.Handlers.EntryHandler.MapIsSpellCheckEnabled(Microsoft.Maui.Handlers.IEntryHandler! handler, Microsoft.Maui.IEntry! entry) -> void static Microsoft.Maui.Layouts.FlexBasis.operator !=(Microsoft.Maui.Layouts.FlexBasis left, Microsoft.Maui.Layouts.FlexBasis right) -> bool static Microsoft.Maui.Layouts.FlexBasis.operator ==(Microsoft.Maui.Layouts.FlexBasis left, Microsoft.Maui.Layouts.FlexBasis right) -> bool static Microsoft.Maui.Layouts.LayoutExtensions.ArrangeContentUnbounded(this Microsoft.Maui.IContentView! contentView, Microsoft.Maui.Graphics.Rect bounds) -> Microsoft.Maui.Graphics.Size @@ -38,6 +40,7 @@ Microsoft.Maui.IWebView.UserAgent.get -> string? Microsoft.Maui.IWebView.UserAgent.set -> void static Microsoft.Maui.Handlers.WebViewHandler.MapUserAgent(Microsoft.Maui.Handlers.IWebViewHandler! handler, Microsoft.Maui.IWebView! webView) -> void static Microsoft.Maui.Platform.ApplicationExtensions.UpdateUserInterfaceStyle(this Microsoft.Maui.IApplication! application) -> void +static Microsoft.Maui.Platform.TextFieldExtensions.UpdateIsSpellCheckEnabled(this UIKit.UITextField! textField, Microsoft.Maui.IEntry! entry) -> void static Microsoft.Maui.Platform.WebViewExtensions.UpdateUserAgent(this WebKit.WKWebView! platformWebView, Microsoft.Maui.IWebView! webView) -> void *REMOVED*Microsoft.Maui.WeakEventManager.HandleEvent(object! sender, object! args, string! eventName) -> void Microsoft.Maui.WeakEventManager.HandleEvent(object? sender, object? args, string! eventName) -> void diff --git a/src/Core/src/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt b/src/Core/src/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt index 87539f3a96d5..254a5bb0ef4f 100644 --- a/src/Core/src/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt +++ b/src/Core/src/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt @@ -4,6 +4,7 @@ Microsoft.Maui.Handlers.SwipeItemButton.FrameChanged -> System.EventHandler? Microsoft.Maui.Handlers.SwipeItemButton.SwipeItemButton() -> void Microsoft.Maui.IApplication.UserAppTheme.get -> Microsoft.Maui.ApplicationModel.AppTheme Microsoft.Maui.Hosting.MauiApp.DisposeAsync() -> System.Threading.Tasks.ValueTask +Microsoft.Maui.ITextInput.IsSpellCheckEnabled.get -> bool Microsoft.Maui.Layouts.FlexBasis.Equals(Microsoft.Maui.Layouts.FlexBasis other) -> bool Microsoft.Maui.SizeRequest.Equals(Microsoft.Maui.SizeRequest other) -> bool Microsoft.Maui.Platform.MauiScrollView @@ -23,6 +24,7 @@ override Microsoft.Maui.SizeRequest.Equals(object? obj) -> bool override Microsoft.Maui.SizeRequest.GetHashCode() -> int static Microsoft.Maui.GridLength.operator !=(Microsoft.Maui.GridLength left, Microsoft.Maui.GridLength right) -> bool static Microsoft.Maui.GridLength.operator ==(Microsoft.Maui.GridLength left, Microsoft.Maui.GridLength right) -> bool +static Microsoft.Maui.Handlers.EntryHandler.MapIsSpellCheckEnabled(Microsoft.Maui.Handlers.IEntryHandler! handler, Microsoft.Maui.IEntry! entry) -> void static Microsoft.Maui.Layouts.FlexBasis.operator !=(Microsoft.Maui.Layouts.FlexBasis left, Microsoft.Maui.Layouts.FlexBasis right) -> bool static Microsoft.Maui.Layouts.FlexBasis.operator ==(Microsoft.Maui.Layouts.FlexBasis left, Microsoft.Maui.Layouts.FlexBasis right) -> bool static Microsoft.Maui.Layouts.LayoutExtensions.ArrangeContentUnbounded(this Microsoft.Maui.IContentView! contentView, Microsoft.Maui.Graphics.Rect bounds) -> Microsoft.Maui.Graphics.Size @@ -37,6 +39,7 @@ Microsoft.Maui.IWebView.UserAgent.get -> string? Microsoft.Maui.IWebView.UserAgent.set -> void static Microsoft.Maui.Handlers.WebViewHandler.MapUserAgent(Microsoft.Maui.Handlers.IWebViewHandler! handler, Microsoft.Maui.IWebView! webView) -> void static Microsoft.Maui.Platform.ApplicationExtensions.UpdateUserInterfaceStyle(this Microsoft.Maui.IApplication! application) -> void +static Microsoft.Maui.Platform.TextFieldExtensions.UpdateIsSpellCheckEnabled(this UIKit.UITextField! textField, Microsoft.Maui.IEntry! entry) -> void static Microsoft.Maui.Platform.WebViewExtensions.UpdateUserAgent(this WebKit.WKWebView! platformWebView, Microsoft.Maui.IWebView! webView) -> void *REMOVED*Microsoft.Maui.WeakEventManager.HandleEvent(object! sender, object! args, string! eventName) -> void Microsoft.Maui.WeakEventManager.HandleEvent(object? sender, object? args, string! eventName) -> void diff --git a/src/Core/src/PublicAPI/net-windows/PublicAPI.Unshipped.txt b/src/Core/src/PublicAPI/net-windows/PublicAPI.Unshipped.txt index f7e7b81f6a37..6b0be5aa8c16 100644 --- a/src/Core/src/PublicAPI/net-windows/PublicAPI.Unshipped.txt +++ b/src/Core/src/PublicAPI/net-windows/PublicAPI.Unshipped.txt @@ -1,6 +1,7 @@ #nullable enable Microsoft.Maui.IApplication.UserAppTheme.get -> Microsoft.Maui.ApplicationModel.AppTheme Microsoft.Maui.Hosting.MauiApp.DisposeAsync() -> System.Threading.Tasks.ValueTask +Microsoft.Maui.ITextInput.IsSpellCheckEnabled.get -> bool Microsoft.Maui.Layouts.FlexBasis.Equals(Microsoft.Maui.Layouts.FlexBasis other) -> bool Microsoft.Maui.Platform.MauiWebView.MauiWebView(Microsoft.Maui.Handlers.WebViewHandler! handler) -> void Microsoft.Maui.SizeRequest.Equals(Microsoft.Maui.SizeRequest other) -> bool @@ -11,6 +12,7 @@ override Microsoft.Maui.SizeRequest.Equals(object? obj) -> bool override Microsoft.Maui.SizeRequest.GetHashCode() -> int static Microsoft.Maui.GridLength.operator !=(Microsoft.Maui.GridLength left, Microsoft.Maui.GridLength right) -> bool static Microsoft.Maui.GridLength.operator ==(Microsoft.Maui.GridLength left, Microsoft.Maui.GridLength right) -> bool +static Microsoft.Maui.Handlers.EntryHandler.MapIsSpellCheckEnabled(Microsoft.Maui.Handlers.IEntryHandler! handler, Microsoft.Maui.IEntry! entry) -> void static Microsoft.Maui.Layouts.FlexBasis.operator !=(Microsoft.Maui.Layouts.FlexBasis left, Microsoft.Maui.Layouts.FlexBasis right) -> bool static Microsoft.Maui.Layouts.FlexBasis.operator ==(Microsoft.Maui.Layouts.FlexBasis left, Microsoft.Maui.Layouts.FlexBasis right) -> bool static Microsoft.Maui.Layouts.LayoutExtensions.ArrangeContentUnbounded(this Microsoft.Maui.IContentView! contentView, Microsoft.Maui.Graphics.Rect bounds) -> Microsoft.Maui.Graphics.Size @@ -19,6 +21,7 @@ static Microsoft.Maui.Platform.SearchBarExtensions.UpdateKeyboard(this Microsoft Microsoft.Maui.IWebView.UserAgent.get -> string? Microsoft.Maui.IWebView.UserAgent.set -> void static Microsoft.Maui.Handlers.WebViewHandler.MapUserAgent(Microsoft.Maui.Handlers.IWebViewHandler! handler, Microsoft.Maui.IWebView! webView) -> void +static Microsoft.Maui.Platform.TextBoxExtensions.UpdateIsSpellCheckEnabled(this Microsoft.UI.Xaml.Controls.TextBox! textBox, Microsoft.Maui.ITextInput! textInput) -> void static Microsoft.Maui.Platform.WebViewExtensions.UpdateUserAgent(this Microsoft.UI.Xaml.Controls.WebView2! platformWebView, Microsoft.Maui.IWebView! webView) -> void *REMOVED*Microsoft.Maui.WeakEventManager.HandleEvent(object! sender, object! args, string! eventName) -> void Microsoft.Maui.WeakEventManager.HandleEvent(object? sender, object? args, string! eventName) -> void diff --git a/src/Core/src/PublicAPI/net/PublicAPI.Unshipped.txt b/src/Core/src/PublicAPI/net/PublicAPI.Unshipped.txt index 97edf1e46179..9e70dd8462df 100644 --- a/src/Core/src/PublicAPI/net/PublicAPI.Unshipped.txt +++ b/src/Core/src/PublicAPI/net/PublicAPI.Unshipped.txt @@ -1,6 +1,7 @@ #nullable enable Microsoft.Maui.IApplication.UserAppTheme.get -> Microsoft.Maui.ApplicationModel.AppTheme Microsoft.Maui.Hosting.MauiApp.DisposeAsync() -> System.Threading.Tasks.ValueTask +Microsoft.Maui.ITextInput.IsSpellCheckEnabled.get -> bool Microsoft.Maui.Layouts.FlexBasis.Equals(Microsoft.Maui.Layouts.FlexBasis other) -> bool Microsoft.Maui.SizeRequest.Equals(Microsoft.Maui.SizeRequest other) -> bool override Microsoft.Maui.Layouts.FlexBasis.Equals(object? obj) -> bool @@ -9,6 +10,7 @@ override Microsoft.Maui.SizeRequest.Equals(object? obj) -> bool override Microsoft.Maui.SizeRequest.GetHashCode() -> int static Microsoft.Maui.GridLength.operator !=(Microsoft.Maui.GridLength left, Microsoft.Maui.GridLength right) -> bool static Microsoft.Maui.GridLength.operator ==(Microsoft.Maui.GridLength left, Microsoft.Maui.GridLength right) -> bool +static Microsoft.Maui.Handlers.EntryHandler.MapIsSpellCheckEnabled(Microsoft.Maui.Handlers.IEntryHandler! handler, Microsoft.Maui.IEntry! entry) -> void static Microsoft.Maui.Layouts.FlexBasis.operator !=(Microsoft.Maui.Layouts.FlexBasis left, Microsoft.Maui.Layouts.FlexBasis right) -> bool static Microsoft.Maui.Layouts.FlexBasis.operator ==(Microsoft.Maui.Layouts.FlexBasis left, Microsoft.Maui.Layouts.FlexBasis right) -> bool static Microsoft.Maui.Layouts.LayoutExtensions.ArrangeContentUnbounded(this Microsoft.Maui.IContentView! contentView, Microsoft.Maui.Graphics.Rect bounds) -> Microsoft.Maui.Graphics.Size diff --git a/src/Core/src/PublicAPI/netstandard/PublicAPI.Unshipped.txt b/src/Core/src/PublicAPI/netstandard/PublicAPI.Unshipped.txt index b53159a7dd99..4eb9c427c89d 100644 --- a/src/Core/src/PublicAPI/netstandard/PublicAPI.Unshipped.txt +++ b/src/Core/src/PublicAPI/netstandard/PublicAPI.Unshipped.txt @@ -1,6 +1,7 @@ #nullable enable Microsoft.Maui.IApplication.UserAppTheme.get -> Microsoft.Maui.ApplicationModel.AppTheme Microsoft.Maui.Hosting.MauiApp.DisposeAsync() -> System.Threading.Tasks.ValueTask +Microsoft.Maui.ITextInput.IsSpellCheckEnabled.get -> bool Microsoft.Maui.Layouts.FlexBasis.Equals(Microsoft.Maui.Layouts.FlexBasis other) -> bool Microsoft.Maui.SizeRequest.Equals(Microsoft.Maui.SizeRequest other) -> bool override Microsoft.Maui.Layouts.FlexBasis.Equals(object? obj) -> bool @@ -9,6 +10,7 @@ override Microsoft.Maui.SizeRequest.Equals(object? obj) -> bool override Microsoft.Maui.SizeRequest.GetHashCode() -> int static Microsoft.Maui.GridLength.operator !=(Microsoft.Maui.GridLength left, Microsoft.Maui.GridLength right) -> bool static Microsoft.Maui.GridLength.operator ==(Microsoft.Maui.GridLength left, Microsoft.Maui.GridLength right) -> bool +static Microsoft.Maui.Handlers.EntryHandler.MapIsSpellCheckEnabled(Microsoft.Maui.Handlers.IEntryHandler! handler, Microsoft.Maui.IEntry! entry) -> void static Microsoft.Maui.Layouts.FlexBasis.operator !=(Microsoft.Maui.Layouts.FlexBasis left, Microsoft.Maui.Layouts.FlexBasis right) -> bool static Microsoft.Maui.Layouts.FlexBasis.operator ==(Microsoft.Maui.Layouts.FlexBasis left, Microsoft.Maui.Layouts.FlexBasis right) -> bool static Microsoft.Maui.Layouts.LayoutExtensions.ArrangeContentUnbounded(this Microsoft.Maui.IContentView! contentView, Microsoft.Maui.Graphics.Rect bounds) -> Microsoft.Maui.Graphics.Size diff --git a/src/Core/src/PublicAPI/netstandard2.0/PublicAPI.Unshipped.txt b/src/Core/src/PublicAPI/netstandard2.0/PublicAPI.Unshipped.txt index 97edf1e46179..9e70dd8462df 100644 --- a/src/Core/src/PublicAPI/netstandard2.0/PublicAPI.Unshipped.txt +++ b/src/Core/src/PublicAPI/netstandard2.0/PublicAPI.Unshipped.txt @@ -1,6 +1,7 @@ #nullable enable Microsoft.Maui.IApplication.UserAppTheme.get -> Microsoft.Maui.ApplicationModel.AppTheme Microsoft.Maui.Hosting.MauiApp.DisposeAsync() -> System.Threading.Tasks.ValueTask +Microsoft.Maui.ITextInput.IsSpellCheckEnabled.get -> bool Microsoft.Maui.Layouts.FlexBasis.Equals(Microsoft.Maui.Layouts.FlexBasis other) -> bool Microsoft.Maui.SizeRequest.Equals(Microsoft.Maui.SizeRequest other) -> bool override Microsoft.Maui.Layouts.FlexBasis.Equals(object? obj) -> bool @@ -9,6 +10,7 @@ override Microsoft.Maui.SizeRequest.Equals(object? obj) -> bool override Microsoft.Maui.SizeRequest.GetHashCode() -> int static Microsoft.Maui.GridLength.operator !=(Microsoft.Maui.GridLength left, Microsoft.Maui.GridLength right) -> bool static Microsoft.Maui.GridLength.operator ==(Microsoft.Maui.GridLength left, Microsoft.Maui.GridLength right) -> bool +static Microsoft.Maui.Handlers.EntryHandler.MapIsSpellCheckEnabled(Microsoft.Maui.Handlers.IEntryHandler! handler, Microsoft.Maui.IEntry! entry) -> void static Microsoft.Maui.Layouts.FlexBasis.operator !=(Microsoft.Maui.Layouts.FlexBasis left, Microsoft.Maui.Layouts.FlexBasis right) -> bool static Microsoft.Maui.Layouts.FlexBasis.operator ==(Microsoft.Maui.Layouts.FlexBasis left, Microsoft.Maui.Layouts.FlexBasis right) -> bool static Microsoft.Maui.Layouts.LayoutExtensions.ArrangeContentUnbounded(this Microsoft.Maui.IContentView! contentView, Microsoft.Maui.Graphics.Rect bounds) -> Microsoft.Maui.Graphics.Size From 4cd84d3bcaabf14eb248ca86c835900acb8896ef Mon Sep 17 00:00:00 2001 From: GitHub Actions Autoformatter Date: Tue, 21 Mar 2023 11:35:49 +0000 Subject: [PATCH 08/10] Auto-format source code --- src/Core/src/Handlers/Entry/EntryHandler.iOS.cs | 2 +- .../DeviceTests/Handlers/Entry/EntryHandlerTests.Android.cs | 2 +- .../tests/DeviceTests/Handlers/Entry/EntryHandlerTests.iOS.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Core/src/Handlers/Entry/EntryHandler.iOS.cs b/src/Core/src/Handlers/Entry/EntryHandler.iOS.cs index 6d0ef310cdc1..94a523ee30ea 100644 --- a/src/Core/src/Handlers/Entry/EntryHandler.iOS.cs +++ b/src/Core/src/Handlers/Entry/EntryHandler.iOS.cs @@ -76,7 +76,7 @@ public static void MapVerticalTextAlignment(IEntryHandler handler, IEntry entry) public static void MapIsTextPredictionEnabled(IEntryHandler handler, IEntry entry) => handler.PlatformView?.UpdateIsTextPredictionEnabled(entry); - public static void MapIsSpellCheckEnabled(IEntryHandler handler, IEntry entry) => + public static void MapIsSpellCheckEnabled(IEntryHandler handler, IEntry entry) => handler.PlatformView?.UpdateIsSpellCheckEnabled(entry); public static void MapMaxLength(IEntryHandler handler, IEntry entry) => diff --git a/src/Core/tests/DeviceTests/Handlers/Entry/EntryHandlerTests.Android.cs b/src/Core/tests/DeviceTests/Handlers/Entry/EntryHandlerTests.Android.cs index bacb6cbc084d..324b612ca561 100644 --- a/src/Core/tests/DeviceTests/Handlers/Entry/EntryHandlerTests.Android.cs +++ b/src/Core/tests/DeviceTests/Handlers/Entry/EntryHandlerTests.Android.cs @@ -324,7 +324,7 @@ int GetNativeSelectionLength(EntryHandler entryHandler) return -1; } - bool GetNativeIsSpellCheckEnabled(EntryHandler entryHandler) => + bool GetNativeIsSpellCheckEnabled(EntryHandler entryHandler) => !GetNativeEntry(entryHandler).InputType.HasFlag(InputTypes.TextFlagNoSuggestions); } } diff --git a/src/Core/tests/DeviceTests/Handlers/Entry/EntryHandlerTests.iOS.cs b/src/Core/tests/DeviceTests/Handlers/Entry/EntryHandlerTests.iOS.cs index d27b1c5285f7..1c059e688bde 100644 --- a/src/Core/tests/DeviceTests/Handlers/Entry/EntryHandlerTests.iOS.cs +++ b/src/Core/tests/DeviceTests/Handlers/Entry/EntryHandlerTests.iOS.cs @@ -737,7 +737,7 @@ int GetNativeSelectionLength(EntryHandler entryHandler) return -1; } - bool GetNativeIsSpellCheckEnabled(EntryHandler entryHandler) => + bool GetNativeIsSpellCheckEnabled(EntryHandler entryHandler) => GetNativeEntry(entryHandler).SpellCheckingType == UITextSpellCheckingType.Yes; } } \ No newline at end of file From ce50a17d49adb1d302715b877db3b52221e22bde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Su=C3=A1rez?= Date: Tue, 21 Mar 2023 13:34:06 +0100 Subject: [PATCH 09/10] Fix build errors --- src/Core/src/PublicAPI/net-tizen/PublicAPI.Unshipped.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Core/src/PublicAPI/net-tizen/PublicAPI.Unshipped.txt b/src/Core/src/PublicAPI/net-tizen/PublicAPI.Unshipped.txt index 96ac11228270..e7ae941e5590 100644 --- a/src/Core/src/PublicAPI/net-tizen/PublicAPI.Unshipped.txt +++ b/src/Core/src/PublicAPI/net-tizen/PublicAPI.Unshipped.txt @@ -19,4 +19,6 @@ static Microsoft.Maui.Layouts.LayoutExtensions.ArrangeContentUnbounded(this Micr *REMOVED*Microsoft.Maui.WeakEventManager.HandleEvent(object! sender, object! args, string! eventName) -> void Microsoft.Maui.WeakEventManager.HandleEvent(object? sender, object? args, string! eventName) -> void static Microsoft.Maui.SizeRequest.operator !=(Microsoft.Maui.SizeRequest left, Microsoft.Maui.SizeRequest right) -> bool -static Microsoft.Maui.SizeRequest.operator ==(Microsoft.Maui.SizeRequest left, Microsoft.Maui.SizeRequest right) -> bool \ No newline at end of file +static Microsoft.Maui.SizeRequest.operator ==(Microsoft.Maui.SizeRequest left, Microsoft.Maui.SizeRequest right) -> bool +Microsoft.Maui.ITextInput.IsSpellCheckEnabled.get -> bool +static Microsoft.Maui.Handlers.EntryHandler.MapIsSpellCheckEnabled(Microsoft.Maui.Handlers.IEntryHandler! handler, Microsoft.Maui.IEntry! entry) -> void \ No newline at end of file From 00b2fa5a795d32ee9c166f98a5a8dea3670de5c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Su=C3=A1rez?= Date: Wed, 22 Mar 2023 17:04:53 +0100 Subject: [PATCH 10/10] Use HasFlag method --- src/Core/src/Platform/Android/EditTextExtensions.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Core/src/Platform/Android/EditTextExtensions.cs b/src/Core/src/Platform/Android/EditTextExtensions.cs index 041548b75db5..dfa9f94a9b3f 100644 --- a/src/Core/src/Platform/Android/EditTextExtensions.cs +++ b/src/Core/src/Platform/Android/EditTextExtensions.cs @@ -293,13 +293,12 @@ internal static void SetInputType(this EditText editText, ITextInput textInput) if ((nativeInputTypeToUpdate & InputTypes.TextFlagNoSuggestions) != InputTypes.TextFlagNoSuggestions) { - if ((nativeInputTypeToUpdate & InputTypes.TextFlagNoSuggestions) != InputTypes.TextFlagNoSuggestions) + if (!nativeInputTypeToUpdate.HasFlag(InputTypes.TextFlagNoSuggestions)) { if (!textInput.IsSpellCheckEnabled) nativeInputTypeToUpdate |= InputTypes.TextFlagNoSuggestions; } - - if ((nativeInputTypeToUpdate & InputTypes.TextFlagNoSuggestions) != InputTypes.TextFlagNoSuggestions) + if (!nativeInputTypeToUpdate.HasFlag(InputTypes.TextFlagNoSuggestions)) { if (!textInput.IsTextPredictionEnabled) nativeInputTypeToUpdate |= InputTypes.TextFlagNoSuggestions;