diff --git a/eng/BannedSymbols.txt b/eng/BannedSymbols.txt index 9adcf5a06bf3..12123bcfc629 100644 --- a/eng/BannedSymbols.txt +++ b/eng/BannedSymbols.txt @@ -1,5 +1,6 @@ M:Microsoft.Extensions.DependencyInjection.Extensions.ServiceCollectionDescriptorExtensions.TryAddSingleton`2(Microsoft.Extensions.DependencyInjection.IServiceCollection);Use a Factory method to create the service instead M:Android.Content.Res.ColorStateList.#ctor(System.Int32[][],System.Int32[]);Use Microsoft.Maui.PlatformInterop.Get*ColorStateList() Java methods instead +M:Android.Widget.ImageView.GetScaleType();Use PlatformInterop.IsImageViewCenterCrop instead (or add a new method) P:Microsoft.Maui.MauiWinUIApplication.Services;Use the IPlatformApplication.Current.Services instead P:Microsoft.Maui.MauiWinUIApplication.Application;Use the IPlatformApplication.Current.Application instead P:Microsoft.UI.Xaml.Window.AppWindow;This API doesn't have null safety. Use GetAppWindow() and make sure to account for the possibility that GetAppWindow() might be null. diff --git a/src/Compatibility/Core/src/Android/FastRenderers/ImageElementManager.cs b/src/Compatibility/Core/src/Android/FastRenderers/ImageElementManager.cs index 15ae12b64739..9d4e7e5fc9c0 100644 --- a/src/Compatibility/Core/src/Android/FastRenderers/ImageElementManager.cs +++ b/src/Compatibility/Core/src/Android/FastRenderers/ImageElementManager.cs @@ -26,7 +26,7 @@ static void OnLayoutChange(object sender, global::Android.Views.View.LayoutChang { if (sender is IVisualElementRenderer renderer && renderer.View is ImageView imageView) #pragma warning disable CS0618 // Obsolete - AViewCompat.SetClipBounds(imageView, imageView.GetScaleType() == AScaleType.CenterCrop ? new ARect(0, 0, e.Right - e.Left, e.Bottom - e.Top) : null); + AViewCompat.SetClipBounds(imageView, PlatformInterop.IsImageViewCenterCrop(imageView) ? new ARect(0, 0, e.Right - e.Left, e.Bottom - e.Top) : null); #pragma warning restore CS0618 // Obsolete } diff --git a/src/Controls/samples/Controls.Sample.Embedding/Resources/Styles/Styles.xaml b/src/Controls/samples/Controls.Sample.Embedding/Resources/Styles/Styles.xaml index f5a50bde66c5..a49bfd73cfa0 100644 --- a/src/Controls/samples/Controls.Sample.Embedding/Resources/Styles/Styles.xaml +++ b/src/Controls/samples/Controls.Sample.Embedding/Resources/Styles/Styles.xaml @@ -173,10 +173,6 @@ - - - - - -