From 1169d11edc49293c6401a88f969c78b214122aa3 Mon Sep 17 00:00:00 2001 From: Rui Marinho Date: Mon, 31 Jul 2023 16:23:38 +0100 Subject: [PATCH 1/2] [api] Make UpdateBackground public --- .../src/Handlers/ImageButton/ImageButtonHandler.Android.cs | 3 +-- src/Core/src/Handlers/SearchBar/SearchBarHandler.iOS.cs | 3 +-- src/Core/src/Platform/Android/ViewExtensions.cs | 3 +-- src/Core/src/Platform/iOS/SearchBarExtensions.cs | 3 +-- src/Core/src/PublicAPI/net-android/PublicAPI.Unshipped.txt | 2 ++ src/Core/src/PublicAPI/net-ios/PublicAPI.Unshipped.txt | 2 ++ src/Core/src/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt | 2 ++ 7 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/Core/src/Handlers/ImageButton/ImageButtonHandler.Android.cs b/src/Core/src/Handlers/ImageButton/ImageButtonHandler.Android.cs index a3bb1ccb4599..0ea5dd153d38 100644 --- a/src/Core/src/Handlers/ImageButton/ImageButtonHandler.Android.cs +++ b/src/Core/src/Handlers/ImageButton/ImageButtonHandler.Android.cs @@ -43,8 +43,7 @@ protected override void ConnectHandler(ShapeableImageView platformView) base.ConnectHandler(platformView); } - // TODO: NET8 make this public - internal static void MapBackground(IImageButtonHandler handler, IImageButton imageButton) + public static void MapBackground(IImageButtonHandler handler, IImageButton imageButton) { (handler.PlatformView as ShapeableImageView)?.UpdateBackground(imageButton); } diff --git a/src/Core/src/Handlers/SearchBar/SearchBarHandler.iOS.cs b/src/Core/src/Handlers/SearchBar/SearchBarHandler.iOS.cs index 0d48dd38b988..6b22b2ed7b20 100644 --- a/src/Core/src/Handlers/SearchBar/SearchBarHandler.iOS.cs +++ b/src/Core/src/Handlers/SearchBar/SearchBarHandler.iOS.cs @@ -67,8 +67,7 @@ public override Size GetDesiredSize(double widthConstraint, double heightConstra return base.GetDesiredSize(widthConstraint, heightConstraint); } - // TODO: NET8 make this public - internal static void MapBackground(ISearchBarHandler handler, ISearchBar searchBar) + public static void MapBackground(ISearchBarHandler handler, ISearchBar searchBar) { handler.PlatformView?.UpdateBackground(searchBar); } diff --git a/src/Core/src/Platform/Android/ViewExtensions.cs b/src/Core/src/Platform/Android/ViewExtensions.cs index 52e559dddfd0..6758232e4cfb 100644 --- a/src/Core/src/Platform/Android/ViewExtensions.cs +++ b/src/Core/src/Platform/Android/ViewExtensions.cs @@ -182,8 +182,7 @@ internal static void UpdateBackground(this AView platformView, IView view, bool internal static void UpdateBackground(this TextView platformView, IView view) => UpdateBackground(platformView, view, true); - // TODO: NET8 make this public for NET8.0 - internal static void UpdateBackground(this EditText platformView, IView view) + public static void UpdateBackground(this EditText platformView, IView view) { if (platformView is null || platformView.Context is null) { diff --git a/src/Core/src/Platform/iOS/SearchBarExtensions.cs b/src/Core/src/Platform/iOS/SearchBarExtensions.cs index 01f183e76f36..d3c0779236b5 100644 --- a/src/Core/src/Platform/iOS/SearchBarExtensions.cs +++ b/src/Core/src/Platform/iOS/SearchBarExtensions.cs @@ -15,8 +15,7 @@ public static class SearchBarExtensions return searchBar.GetSearchTextField(); } - // TODO: NET8 maybe make this public? - internal static void UpdateBackground(this UISearchBar uiSearchBar, ISearchBar searchBar) + public static void UpdateBackground(this UISearchBar uiSearchBar, ISearchBar searchBar) { var background = searchBar.Background; diff --git a/src/Core/src/PublicAPI/net-android/PublicAPI.Unshipped.txt b/src/Core/src/PublicAPI/net-android/PublicAPI.Unshipped.txt index ce01bf0fae0a..726a1746fcf0 100644 --- a/src/Core/src/PublicAPI/net-android/PublicAPI.Unshipped.txt +++ b/src/Core/src/PublicAPI/net-android/PublicAPI.Unshipped.txt @@ -76,6 +76,7 @@ static Microsoft.Maui.GridLength.operator !=(Microsoft.Maui.GridLength left, Mic static Microsoft.Maui.GridLength.operator ==(Microsoft.Maui.GridLength left, Microsoft.Maui.GridLength right) -> bool static Microsoft.Maui.Handlers.EditorHandler.MapIsSpellCheckEnabled(Microsoft.Maui.Handlers.IEditorHandler! handler, Microsoft.Maui.IEditor! editor) -> void static Microsoft.Maui.Handlers.EntryHandler.MapIsSpellCheckEnabled(Microsoft.Maui.Handlers.IEntryHandler! handler, Microsoft.Maui.IEntry! entry) -> void +static Microsoft.Maui.Handlers.ImageButtonHandler.MapBackground(Microsoft.Maui.Handlers.IImageButtonHandler! handler, Microsoft.Maui.IImageButton! imageButton) -> void static Microsoft.Maui.Handlers.SearchBarHandler.MapFocus(Microsoft.Maui.Handlers.ISearchBarHandler! handler, Microsoft.Maui.ISearchBar! searchBar, object? args) -> void static Microsoft.Maui.Handlers.SearchBarHandler.MapIsSpellCheckEnabled(Microsoft.Maui.Handlers.ISearchBarHandler! handler, Microsoft.Maui.ISearchBar! searchBar) -> void static Microsoft.Maui.Handlers.StepperHandler.MapIsEnabled(Microsoft.Maui.Handlers.IStepperHandler! handler, Microsoft.Maui.IStepper! stepper) -> void @@ -92,6 +93,7 @@ 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.UpdateNightMode(this Microsoft.Maui.IApplication! application) -> void static Microsoft.Maui.Platform.ShapeExtensions.ToPlatform(this Microsoft.Maui.Graphics.IShape! shape, Microsoft.Maui.Graphics.Rect bounds, float strokeThickness, bool innerPath = false) -> Android.Graphics.Path! +static Microsoft.Maui.Platform.ViewExtensions.UpdateBackground(this Android.Widget.EditText! platformView, Microsoft.Maui.IView! view) -> void static Microsoft.Maui.Platform.ViewGroupExtensions.TryGetFirstChildOfType(this Android.Views.ViewGroup! viewGroup, out T? result) -> bool static Microsoft.Maui.Platform.WebViewExtensions.UpdateUserAgent(this Android.Webkit.WebView! platformWebView, Microsoft.Maui.IWebView! webView) -> void *REMOVED*Microsoft.Maui.WeakEventManager.HandleEvent(object! sender, object! args, string! eventName) -> void diff --git a/src/Core/src/PublicAPI/net-ios/PublicAPI.Unshipped.txt b/src/Core/src/PublicAPI/net-ios/PublicAPI.Unshipped.txt index e34952ca4407..d6e7812a11ad 100644 --- a/src/Core/src/PublicAPI/net-ios/PublicAPI.Unshipped.txt +++ b/src/Core/src/PublicAPI/net-ios/PublicAPI.Unshipped.txt @@ -68,6 +68,7 @@ static Microsoft.Maui.GridLength.operator !=(Microsoft.Maui.GridLength left, Mic static Microsoft.Maui.GridLength.operator ==(Microsoft.Maui.GridLength left, Microsoft.Maui.GridLength right) -> bool static Microsoft.Maui.Handlers.EditorHandler.MapIsSpellCheckEnabled(Microsoft.Maui.Handlers.IEditorHandler! handler, Microsoft.Maui.IEditor! editor) -> void static Microsoft.Maui.Handlers.EntryHandler.MapIsSpellCheckEnabled(Microsoft.Maui.Handlers.IEntryHandler! handler, Microsoft.Maui.IEntry! entry) -> void +static Microsoft.Maui.Handlers.SearchBarHandler.MapBackground(Microsoft.Maui.Handlers.ISearchBarHandler! handler, Microsoft.Maui.ISearchBar! searchBar) -> void static Microsoft.Maui.Handlers.SearchBarHandler.MapIsSpellCheckEnabled(Microsoft.Maui.Handlers.ISearchBarHandler! handler, Microsoft.Maui.ISearchBar! searchBar) -> 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 @@ -75,6 +76,7 @@ static Microsoft.Maui.Layouts.LayoutExtensions.ArrangeContentUnbounded(this Micr static Microsoft.Maui.Handlers.SearchBarHandler.MapKeyboard(Microsoft.Maui.Handlers.ISearchBarHandler! handler, Microsoft.Maui.ISearchBar! searchBar) -> void static Microsoft.Maui.Platform.KeyboardAutoManagerScroll.Connect() -> void static Microsoft.Maui.Platform.KeyboardAutoManagerScroll.Disconnect() -> void +static Microsoft.Maui.Platform.SearchBarExtensions.UpdateBackground(this UIKit.UISearchBar! uiSearchBar, Microsoft.Maui.ISearchBar! searchBar) -> void static Microsoft.Maui.Platform.SearchBarExtensions.UpdateIsSpellCheckEnabled(this UIKit.UISearchBar! uiSearchBar, Microsoft.Maui.ISearchBar! searchBar, UIKit.UITextField? textField = null) -> void static Microsoft.Maui.Platform.SearchBarExtensions.UpdateIsTextPredictionEnabled(this UIKit.UISearchBar! uiSearchBar, Microsoft.Maui.ISearchBar! searchBar, UIKit.UITextField? textField = null) -> void static Microsoft.Maui.Platform.SearchBarExtensions.UpdateKeyboard(this UIKit.UISearchBar! uiSearchBar, Microsoft.Maui.ISearchBar! searchBar) -> void diff --git a/src/Core/src/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt b/src/Core/src/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt index b3f26d213972..d708ddfd9600 100644 --- a/src/Core/src/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt +++ b/src/Core/src/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt @@ -70,11 +70,13 @@ static Microsoft.Maui.GridLength.operator !=(Microsoft.Maui.GridLength left, Mic static Microsoft.Maui.GridLength.operator ==(Microsoft.Maui.GridLength left, Microsoft.Maui.GridLength right) -> bool static Microsoft.Maui.Handlers.EditorHandler.MapIsSpellCheckEnabled(Microsoft.Maui.Handlers.IEditorHandler! handler, Microsoft.Maui.IEditor! editor) -> void static Microsoft.Maui.Handlers.EntryHandler.MapIsSpellCheckEnabled(Microsoft.Maui.Handlers.IEntryHandler! handler, Microsoft.Maui.IEntry! entry) -> void +static Microsoft.Maui.Handlers.SearchBarHandler.MapBackground(Microsoft.Maui.Handlers.ISearchBarHandler! handler, Microsoft.Maui.ISearchBar! searchBar) -> void static Microsoft.Maui.Handlers.SearchBarHandler.MapIsSpellCheckEnabled(Microsoft.Maui.Handlers.ISearchBarHandler! handler, Microsoft.Maui.ISearchBar! searchBar) -> 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.SearchBarExtensions.UpdateBackground(this UIKit.UISearchBar! uiSearchBar, Microsoft.Maui.ISearchBar! searchBar) -> void static Microsoft.Maui.Platform.SearchBarExtensions.UpdateIsSpellCheckEnabled(this UIKit.UISearchBar! uiSearchBar, Microsoft.Maui.ISearchBar! searchBar, UIKit.UITextField? textField = null) -> void static Microsoft.Maui.Platform.SearchBarExtensions.UpdateIsTextPredictionEnabled(this UIKit.UISearchBar! uiSearchBar, Microsoft.Maui.ISearchBar! searchBar, UIKit.UITextField? textField = null) -> void static Microsoft.Maui.Platform.SearchBarExtensions.UpdateKeyboard(this UIKit.UISearchBar! uiSearchBar, Microsoft.Maui.ISearchBar! searchBar) -> void From e68b7949a3060c55a0524716e066307e52826b1e Mon Sep 17 00:00:00 2001 From: Rui Marinho Date: Mon, 31 Jul 2023 17:52:38 +0100 Subject: [PATCH 2/2] Keep extensions internal --- src/Core/src/Platform/Android/ViewExtensions.cs | 2 +- src/Core/src/Platform/iOS/SearchBarExtensions.cs | 2 +- src/Core/src/PublicAPI/net-android/PublicAPI.Unshipped.txt | 1 - src/Core/src/PublicAPI/net-ios/PublicAPI.Unshipped.txt | 1 - src/Core/src/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt | 1 - 5 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/Core/src/Platform/Android/ViewExtensions.cs b/src/Core/src/Platform/Android/ViewExtensions.cs index 6758232e4cfb..3f26ac0a189d 100644 --- a/src/Core/src/Platform/Android/ViewExtensions.cs +++ b/src/Core/src/Platform/Android/ViewExtensions.cs @@ -182,7 +182,7 @@ internal static void UpdateBackground(this AView platformView, IView view, bool internal static void UpdateBackground(this TextView platformView, IView view) => UpdateBackground(platformView, view, true); - public static void UpdateBackground(this EditText platformView, IView view) + internal static void UpdateBackground(this EditText platformView, IView view) { if (platformView is null || platformView.Context is null) { diff --git a/src/Core/src/Platform/iOS/SearchBarExtensions.cs b/src/Core/src/Platform/iOS/SearchBarExtensions.cs index d3c0779236b5..ccd13d9758a5 100644 --- a/src/Core/src/Platform/iOS/SearchBarExtensions.cs +++ b/src/Core/src/Platform/iOS/SearchBarExtensions.cs @@ -15,7 +15,7 @@ public static class SearchBarExtensions return searchBar.GetSearchTextField(); } - public static void UpdateBackground(this UISearchBar uiSearchBar, ISearchBar searchBar) + internal static void UpdateBackground(this UISearchBar uiSearchBar, ISearchBar searchBar) { var background = searchBar.Background; diff --git a/src/Core/src/PublicAPI/net-android/PublicAPI.Unshipped.txt b/src/Core/src/PublicAPI/net-android/PublicAPI.Unshipped.txt index 726a1746fcf0..eddaba293cc1 100644 --- a/src/Core/src/PublicAPI/net-android/PublicAPI.Unshipped.txt +++ b/src/Core/src/PublicAPI/net-android/PublicAPI.Unshipped.txt @@ -93,7 +93,6 @@ 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.UpdateNightMode(this Microsoft.Maui.IApplication! application) -> void static Microsoft.Maui.Platform.ShapeExtensions.ToPlatform(this Microsoft.Maui.Graphics.IShape! shape, Microsoft.Maui.Graphics.Rect bounds, float strokeThickness, bool innerPath = false) -> Android.Graphics.Path! -static Microsoft.Maui.Platform.ViewExtensions.UpdateBackground(this Android.Widget.EditText! platformView, Microsoft.Maui.IView! view) -> void static Microsoft.Maui.Platform.ViewGroupExtensions.TryGetFirstChildOfType(this Android.Views.ViewGroup! viewGroup, out T? result) -> bool static Microsoft.Maui.Platform.WebViewExtensions.UpdateUserAgent(this Android.Webkit.WebView! platformWebView, Microsoft.Maui.IWebView! webView) -> void *REMOVED*Microsoft.Maui.WeakEventManager.HandleEvent(object! sender, object! args, string! eventName) -> void diff --git a/src/Core/src/PublicAPI/net-ios/PublicAPI.Unshipped.txt b/src/Core/src/PublicAPI/net-ios/PublicAPI.Unshipped.txt index d6e7812a11ad..aad1fda77239 100644 --- a/src/Core/src/PublicAPI/net-ios/PublicAPI.Unshipped.txt +++ b/src/Core/src/PublicAPI/net-ios/PublicAPI.Unshipped.txt @@ -76,7 +76,6 @@ static Microsoft.Maui.Layouts.LayoutExtensions.ArrangeContentUnbounded(this Micr static Microsoft.Maui.Handlers.SearchBarHandler.MapKeyboard(Microsoft.Maui.Handlers.ISearchBarHandler! handler, Microsoft.Maui.ISearchBar! searchBar) -> void static Microsoft.Maui.Platform.KeyboardAutoManagerScroll.Connect() -> void static Microsoft.Maui.Platform.KeyboardAutoManagerScroll.Disconnect() -> void -static Microsoft.Maui.Platform.SearchBarExtensions.UpdateBackground(this UIKit.UISearchBar! uiSearchBar, Microsoft.Maui.ISearchBar! searchBar) -> void static Microsoft.Maui.Platform.SearchBarExtensions.UpdateIsSpellCheckEnabled(this UIKit.UISearchBar! uiSearchBar, Microsoft.Maui.ISearchBar! searchBar, UIKit.UITextField? textField = null) -> void static Microsoft.Maui.Platform.SearchBarExtensions.UpdateIsTextPredictionEnabled(this UIKit.UISearchBar! uiSearchBar, Microsoft.Maui.ISearchBar! searchBar, UIKit.UITextField? textField = null) -> void static Microsoft.Maui.Platform.SearchBarExtensions.UpdateKeyboard(this UIKit.UISearchBar! uiSearchBar, Microsoft.Maui.ISearchBar! searchBar) -> void diff --git a/src/Core/src/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt b/src/Core/src/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt index d708ddfd9600..627002f1ade9 100644 --- a/src/Core/src/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt +++ b/src/Core/src/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt @@ -76,7 +76,6 @@ static Microsoft.Maui.Layouts.FlexBasis.operator !=(Microsoft.Maui.Layouts.FlexB 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.SearchBarExtensions.UpdateBackground(this UIKit.UISearchBar! uiSearchBar, Microsoft.Maui.ISearchBar! searchBar) -> void static Microsoft.Maui.Platform.SearchBarExtensions.UpdateIsSpellCheckEnabled(this UIKit.UISearchBar! uiSearchBar, Microsoft.Maui.ISearchBar! searchBar, UIKit.UITextField? textField = null) -> void static Microsoft.Maui.Platform.SearchBarExtensions.UpdateIsTextPredictionEnabled(this UIKit.UISearchBar! uiSearchBar, Microsoft.Maui.ISearchBar! searchBar, UIKit.UITextField? textField = null) -> void static Microsoft.Maui.Platform.SearchBarExtensions.UpdateKeyboard(this UIKit.UISearchBar! uiSearchBar, Microsoft.Maui.ISearchBar! searchBar) -> void