From eea6fea9897faf736306aeb4c250dafedaac18c9 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Tue, 24 Jan 2023 18:12:44 +0000 Subject: [PATCH] [net8.0] use latest .NET 8 SDK and mobile workloads (#12520) Changes: https://github.com/xamarin/xamarin-android/compare/8a20803...c1efcb5 Changes: https://github.com/xamarin/xamarin-macios/compare/df0151d...6b1b9f3 Changes: https://github.com/dotnet/installer/compare/8c1708f...9962c6a Changes: https://github.com/dotnet/runtime/compare/5108757...5da4a9e Changes: https://github.com/dotnet/emsdk/compare/aecb1c7...66b9845 Updates: * Microsoft.Android.Sdk.Windows: from 34.0.0-preview.1.50 to 34.0.0-preview.1.127 * Microsoft.iOS.Sdk: from 16.1.585-net8-p1 to 16.2.126-net8-p1 * Microsoft.Dotnet.Sdk.Internal: from 8.0.100-alpha.1.22526.2 to 8.0.100-alpha.1.23063.11 * Microsoft.NETCore.App.Ref: from 8.0.0-alpha.1.22524.5 to 8.0.0-alpha.1.23058.2 * Microsoft.NET.Workload.Emscripten.net7.Manifest-8.0.100: from 8.0.0-alpha.1.22510.1 to 8.0.0-alpha.1.22620.1 ~~ Workloads ~~ The .NET SDK has a workaround for `microsoft.net.workload.mono.toolchain`: https://github.com/dotnet/sdk/commit/f5cb7e3c3eb631d13a1bdc6033f399cf8a1ceadb * HACK: copy folder to `microsoft.net.workload.mono.toolchain.net8` for now until this is resolved. ~~ Android ~~ The biggest changes now in xamarin-android/main are: * Android enums now have appropriate `[SupportedOSPlatform]` attributes. This caused various new warnings in MAUI. Example: src/Essentials/test/DeviceTests/Tests/Vibration_Tests.cs(16,62): error CA1416: This call site is reachable on: 'Android' 21.0 and later. 'BuildVersionCodes.M' is only supported on: 'android' 23.0 and later. src/Essentials/test/DeviceTests/Tests/Vibration_Tests.cs(34,62): error CA1416: This call site is reachable on: 'Android' 21.0 and later. 'BuildVersionCodes.M' is only supported on: 'android' 23.0 and later. * Android now has a new implementation of `Resource.designer.cs`: https://github.com/xamarin/xamarin-android/commit/dc3ccf28cdbe9f8c0a705400b83c11a85c81a980 We had to make various API changes for a new `Resource` type. Some we we be able to get rid of in the future, after we get: https://github.com/xamarin/xamarin-android/pull/7721 * Remove IsMarshmallowOrNewer, IsNougatOrNewer It appears the analyzer can't tell these values are using `OperatingSystem.IsAndroidVersionAtLeast()`. It seems we can just use this API directly instead. * Allow `$(AndroidEnableMarshalMethods)` again This has the fix: https://github.com/xamarin/xamarin-android/commit/22f10b2edec9e40a139c04564f96d8c1b3c17526 Fixes: https://github.com/dotnet/maui/issues/11605 ~~ Other changes ~~ * [essentials, compatibility] disable trimming for netstandard * Minor iOS API Changes * Fix CA2200 in test Fixes: src\Controls\tests\Core.UnitTests\ImageButtonUnitTest.cs(215,6): error CA2200: Re-throwing caught exception changes stack information Co-authored-by: Jonathan Peppers --- Directory.Build.props | 2 - Directory.Build.targets | 9 - eng/Version.Details.xml | 32 +-- eng/Versions.props | 18 +- .../net-android/PublicAPI.Unshipped.txt | 2 + .../CollectionView/SelectableViewHolder.cs | 2 +- .../src/Android/DragAndDropGestureHandler.cs | 6 +- .../Extensions/EntryRendererExtensions.cs | 2 + .../Android/FastRenderers/LabelRenderer.cs | 2 +- src/Compatibility/Core/src/Android/Forms.cs | 6 - .../src/Android/Renderers/CircularProgress.cs | 2 +- .../src/Android/Renderers/LabelRenderer.cs | 2 +- .../src/Android/Renderers/ListViewRenderer.cs | 4 + .../src/Android/Renderers/PageRenderer.cs | 3 +- .../Android/Renderers/SearchBarRenderer.cs | 5 +- .../Core/src/Android/Resource.designer.cs | 87 -------- .../Core/src/Compatibility.csproj | 2 +- .../net-android/PublicAPI.Unshipped.txt | 2 + .../ListView/Android/ListViewRenderer.cs | 4 + .../Android/DragAndDropGestureHandler.cs | 4 +- .../Platform/Android/ImeActionExtensions.cs | 2 + .../Platform/Android/Resource.designer.cs | 210 ------------------ .../net-android/PublicAPI.Shipped.txt | 47 ---- .../net-android/PublicAPI.Unshipped.txt | 2 + .../Core.UnitTests/ImageButtonUnitTest.cs | 2 +- .../net-android/PublicAPI.Unshipped.txt | 2 + .../ImageSources/iOS/ImageSourceExtensions.cs | 2 +- .../Android/LocalizedDigitsKeyListener.cs | 8 +- .../src/Platform/Android/Resource.designer.cs | 142 ------------ .../Platform/Android/TextViewExtensions.cs | 4 + src/Core/src/Platform/iOS/LabelExtensions.cs | 2 +- .../net-android/PublicAPI.Shipped.txt | 36 --- .../Core.DeviceTests.Shared.csproj | 2 + src/DotNet/DotNet.csproj | 9 + src/Essentials/src/AppInfo/AppInfo.android.cs | 4 +- src/Essentials/src/Essentials.csproj | 2 +- .../src/FileSystem/FileSystemUtils.android.cs | 2 + .../HapticFeedback/HapticFeedback.android.cs | 2 + .../src/Permissions/Permissions.android.cs | 4 +- .../net-android/PublicAPI.Unshipped.txt | 2 + .../WebAuthenticator.ios.tvos.cs | 2 + .../test/DeviceTests/Tests/Vibration_Tests.cs | 4 +- .../net-android/PublicAPI.Unshipped.txt | 2 + .../Platforms/Android/PlatformCanvas.cs | 6 +- .../net-android/PublicAPI.Unshipped.txt | 2 + 45 files changed, 105 insertions(+), 593 deletions(-) delete mode 100644 src/Compatibility/Core/src/Android/Resource.designer.cs delete mode 100644 src/Controls/src/Core/Platform/Android/Resource.designer.cs delete mode 100644 src/Core/src/Platform/Android/Resource.designer.cs diff --git a/Directory.Build.props b/Directory.Build.props index 8e6e57a5ad9f..008616235f54 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -161,7 +161,5 @@ true true - - false diff --git a/Directory.Build.targets b/Directory.Build.targets index 7aa05840c828..9abbbf7d4d53 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -54,15 +54,6 @@ 10.0.17763.0 - - - false - false - - diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index a9c00eadc082..dfd1defedb54 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -1,36 +1,36 @@ - + https://github.com/dotnet/installer - 8c1708f37899815bc298ab30e5f2561ec47f1929 + 9962c6a686a31ba1e7c20983a810ba7989c3fc0c - + https://github.com/dotnet/runtime - 5108757b997c59ab8ba1fc5309ab0d4e730e2b77 + 5da4a9e919dcee35f831ab69b6e475baaf798875 - + https://github.com/xamarin/xamarin-android - 8a2080306210302d5caca50ab9906240282825f4 + c1efcb5678c8d93c4d5bdd0452a79a8ffab2f6b7 - + https://github.com/xamarin/xamarin-macios - df0151d09a23a1630022ad653036d11ce4b396b8 + 6b1b9f3666c644af0560770bd02de9d455fdbc4c - + https://github.com/xamarin/xamarin-macios - df0151d09a23a1630022ad653036d11ce4b396b8 + 6b1b9f3666c644af0560770bd02de9d455fdbc4c - + https://github.com/xamarin/xamarin-macios - df0151d09a23a1630022ad653036d11ce4b396b8 + 6b1b9f3666c644af0560770bd02de9d455fdbc4c - + https://github.com/xamarin/xamarin-macios - df0151d09a23a1630022ad653036d11ce4b396b8 + 6b1b9f3666c644af0560770bd02de9d455fdbc4c - + https://github.com/dotnet/emsdk - aecb1c71c70f6db44035602a879c57fa495d37e8 + 66b984594a008151bdb14dc60589373e3d44be83 https://dev.azure.com/microsoft/ProjectReunion/_git/ProjectReunionInternal diff --git a/eng/Versions.props b/eng/Versions.props index cd3a9888fdb8..c34716b4021f 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -3,24 +3,24 @@ 6.0.547 - 8.0.100-alpha.1.22526.2 + 8.0.100-alpha.1.23063.11 - 8.0.0-alpha.1.22524.5 + 8.0.0-alpha.1.23058.2 7.0.0 7.0.0 7.0.0 - 34.0.0-preview.1.50 + 34.0.0-preview.1.127 - 16.1.585-net8-p1 - 13.0.1140-net8-p1 - 16.1.585-net8-p1 - 16.1.585-net8-p1 + 16.2.126-net8-p1 + 13.1.126-net8-p1 + 16.2.126-net8-p1 + 16.1.914-net8-p1 7.0.104 - 8.0.0-alpha.1.22510.1 + 8.0.0-alpha.1.22620.1 $(MicrosoftNETWorkloadEmscriptennet7Manifest80100PackageVersion) 1.2.221209.1 @@ -39,7 +39,7 @@ 7.0.1 7.0.2 - 7.0.0 + 8.0.0-preview1.23067.2 3.3.3 3.3.3 4.5.0 diff --git a/src/BlazorWebView/src/Maui/PublicAPI/net-android/PublicAPI.Unshipped.txt b/src/BlazorWebView/src/Maui/PublicAPI/net-android/PublicAPI.Unshipped.txt index 0ba16b44f84b..f42a7a199d08 100644 --- a/src/BlazorWebView/src/Maui/PublicAPI/net-android/PublicAPI.Unshipped.txt +++ b/src/BlazorWebView/src/Maui/PublicAPI/net-android/PublicAPI.Unshipped.txt @@ -3,4 +3,6 @@ Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebView.StartPath.get -> stri Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebView.StartPath.set -> void Microsoft.AspNetCore.Components.WebView.Maui.IBlazorWebView.StartPath.get -> string! Microsoft.AspNetCore.Components.WebView.Maui.IBlazorWebView.StartPath.set -> void +Microsoft.AspNetCore.Components.WebView.Maui.Resource +Microsoft.AspNetCore.Components.WebView.Maui.Resource.Resource() -> void static readonly Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebView.StartPathProperty -> Microsoft.Maui.Controls.BindableProperty! diff --git a/src/Compatibility/Core/src/Android/CollectionView/SelectableViewHolder.cs b/src/Compatibility/Core/src/Android/CollectionView/SelectableViewHolder.cs index 9b8f16d2380a..09a4058fb28f 100644 --- a/src/Compatibility/Core/src/Android/CollectionView/SelectableViewHolder.cs +++ b/src/Compatibility/Core/src/Android/CollectionView/SelectableViewHolder.cs @@ -65,7 +65,7 @@ void SetSelectionStates(bool isSelected) return; } - if (Forms.IsMarshmallowOrNewer) + if (OperatingSystem.IsAndroidVersionAtLeast(23)) { // We're looking for the foreground ripple effect, which is not available on older APIs // Limiting this to Marshmallow and newer, because View.setForeground() is not available on lower APIs diff --git a/src/Compatibility/Core/src/Android/DragAndDropGestureHandler.cs b/src/Compatibility/Core/src/Android/DragAndDropGestureHandler.cs index 68ee903c0363..86d1945bcf22 100644 --- a/src/Compatibility/Core/src/Android/DragAndDropGestureHandler.cs +++ b/src/Compatibility/Core/src/Android/DragAndDropGestureHandler.cs @@ -319,12 +319,12 @@ public void OnLongPress(MotionEvent e) customLocalStateData.SourceNativeView = v; customLocalStateData.SourceElement = renderer?.Element; - if (Forms.IsNougatOrNewer) + if (OperatingSystem.IsAndroidVersionAtLeast(24)) v.StartDragAndDrop(data, dragShadowBuilder, customLocalStateData, (int)ADragFlags.Global | (int)ADragFlags.GlobalUriRead); else -#pragma warning disable CS0618 // Type or member is obsolete +#pragma warning disable CA1416 // DragFlags.Global added in API 24: https://developer.android.com/reference/android/view/View#DRAG_FLAG_GLOBAL v.StartDrag(data, dragShadowBuilder, customLocalStateData, (int)ADragFlags.Global | (int)ADragFlags.GlobalUriRead); -#pragma warning restore CS0618 // Type or member is obsolete +#pragma warning restore CA1416 }); } diff --git a/src/Compatibility/Core/src/Android/Extensions/EntryRendererExtensions.cs b/src/Compatibility/Core/src/Android/Extensions/EntryRendererExtensions.cs index be3c31ed1ef5..653315f835eb 100644 --- a/src/Compatibility/Core/src/Android/Extensions/EntryRendererExtensions.cs +++ b/src/Compatibility/Core/src/Android/Extensions/EntryRendererExtensions.cs @@ -46,7 +46,9 @@ public static ImeAction ToAndroidImeOptions(this PlatformConfiguration.AndroidSp case PlatformConfiguration.AndroidSpecific.ImeFlags.ImeMaskAction: return ImeAction.ImeMaskAction; case PlatformConfiguration.AndroidSpecific.ImeFlags.NoPersonalizedLearning: +#pragma warning disable CA1416 // Introduced in API 26: https://developer.android.com/reference/android/view/inputmethod/EditorInfo#IME_FLAG_NO_PERSONALIZED_LEARNING return (ImeAction)ImeFlags.NoPersonalizedLearning; +#pragma warning restore CA1416 case PlatformConfiguration.AndroidSpecific.ImeFlags.NoExtractUi: return (ImeAction)ImeFlags.NoExtractUi; case PlatformConfiguration.AndroidSpecific.ImeFlags.NoAccessoryAction: diff --git a/src/Compatibility/Core/src/Android/FastRenderers/LabelRenderer.cs b/src/Compatibility/Core/src/Android/FastRenderers/LabelRenderer.cs index 20679ff6ef12..cf1b7523e61f 100644 --- a/src/Compatibility/Core/src/Android/FastRenderers/LabelRenderer.cs +++ b/src/Compatibility/Core/src/Android/FastRenderers/LabelRenderer.cs @@ -402,7 +402,7 @@ void UpdateText() switch (Element.TextType) { case TextType.Html: - if (Forms.IsNougatOrNewer) + if (OperatingSystem.IsAndroidVersionAtLeast(24)) Control.SetText(Html.FromHtml(Element.Text ?? string.Empty, FromHtmlOptions.ModeCompact), BufferType.Spannable); else #pragma warning disable CS0618 // Type or member is obsolete diff --git a/src/Compatibility/Core/src/Android/Forms.cs b/src/Compatibility/Core/src/Android/Forms.cs index 74a31070c099..1d9e8ad73840 100644 --- a/src/Compatibility/Core/src/Android/Forms.cs +++ b/src/Compatibility/Core/src/Android/Forms.cs @@ -66,12 +66,6 @@ public static class Forms static Color _ColorButtonNormal = null; public static Color ColorButtonNormalOverride { get; set; } - [SupportedOSPlatformGuard("android23.0")] - internal static readonly bool IsMarshmallowOrNewer = OperatingSystem.IsAndroidVersionAtLeast((int)BuildVersionCodes.M); - - [SupportedOSPlatformGuard("android24.0")] - internal static readonly bool IsNougatOrNewer = OperatingSystem.IsAndroidVersionAtLeast((int)BuildVersionCodes.N); - public static float GetFontSizeNormal(Context context) { float size = 50; diff --git a/src/Compatibility/Core/src/Android/Renderers/CircularProgress.cs b/src/Compatibility/Core/src/Android/Renderers/CircularProgress.cs index 351aa0c4ad66..4b7cdca2ca84 100644 --- a/src/Compatibility/Core/src/Android/Renderers/CircularProgress.cs +++ b/src/Compatibility/Core/src/Android/Renderers/CircularProgress.cs @@ -93,7 +93,7 @@ public override void Layout(int l, int t, int r, int b) l += (width - squareSize) / 2; t += (height - squareSize) / 2; int strokeWidth; - if (!Forms.IsNougatOrNewer) + if (!OperatingSystem.IsAndroidVersionAtLeast(24)) strokeWidth = squareSize / _paddingRatio23; else strokeWidth = squareSize / _paddingRatio; diff --git a/src/Compatibility/Core/src/Android/Renderers/LabelRenderer.cs b/src/Compatibility/Core/src/Android/Renderers/LabelRenderer.cs index c1c7c194c938..46fcdde5911f 100644 --- a/src/Compatibility/Core/src/Android/Renderers/LabelRenderer.cs +++ b/src/Compatibility/Core/src/Android/Renderers/LabelRenderer.cs @@ -290,7 +290,7 @@ void UpdateText() { case TextType.Html: - if (Forms.IsNougatOrNewer) + if (OperatingSystem.IsAndroidVersionAtLeast(24)) Control.SetText(Html.FromHtml(Element.Text ?? string.Empty, FromHtmlOptions.ModeCompact), TextView.BufferType.Spannable); else #pragma warning disable CS0618 // Type or member is obsolete diff --git a/src/Compatibility/Core/src/Android/Renderers/ListViewRenderer.cs b/src/Compatibility/Core/src/Android/Renderers/ListViewRenderer.cs index 62e90c27ad3c..e5aaf91bf77a 100644 --- a/src/Compatibility/Core/src/Android/Renderers/ListViewRenderer.cs +++ b/src/Compatibility/Core/src/Android/Renderers/ListViewRenderer.cs @@ -203,7 +203,9 @@ internal void ClickOn(AView viewCell) var position = Control.GetPositionForView(viewCell); var id = Control.GetItemIdAtPosition(position); +#pragma warning disable CA1416 // Introduced in API 23: https://developer.android.com/reference/android/view/HapticFeedbackConstants#CONTEXT_CLICK viewCell.PerformHapticFeedback(FeedbackConstants.ContextClick); +#pragma warning restore CA1416 _adapter.OnItemClick(Control, viewCell, position, id); } @@ -217,7 +219,9 @@ internal void LongClickOn(AView viewCell) var position = Control.GetPositionForView(viewCell); var id = Control.GetItemIdAtPosition(position); +#pragma warning disable CA1416 // Introduced in API 23: https://developer.android.com/reference/android/view/HapticFeedbackConstants#CONTEXT_CLICK viewCell.PerformHapticFeedback(FeedbackConstants.ContextClick); +#pragma warning restore CA1416 _adapter.OnItemLongClick(Control, viewCell, position, id); } diff --git a/src/Compatibility/Core/src/Android/Renderers/PageRenderer.cs b/src/Compatibility/Core/src/Android/Renderers/PageRenderer.cs index 07cdb834b55b..0e085e282c73 100644 --- a/src/Compatibility/Core/src/Android/Renderers/PageRenderer.cs +++ b/src/Compatibility/Core/src/Android/Renderers/PageRenderer.cs @@ -1,3 +1,4 @@ +using System; using System.Collections.Generic; using System.ComponentModel; using Android.Content; @@ -142,7 +143,7 @@ void UpdateBackground(bool setBkndColorEvenWhenItsDefault) if (isInShell && isDefaultBackgroundColor) { - var color = Forms.IsMarshmallowOrNewer ? + var color = OperatingSystem.IsAndroidVersionAtLeast(23) ? Context.Resources.GetColor(AColorRes.BackgroundLight, Context.Theme) : new AColor(ContextCompat.GetColor(Context, AColorRes.BackgroundLight)); SetBackgroundColor(color); diff --git a/src/Compatibility/Core/src/Android/Renderers/SearchBarRenderer.cs b/src/Compatibility/Core/src/Android/Renderers/SearchBarRenderer.cs index d107e627539d..16a6a2d87d84 100644 --- a/src/Compatibility/Core/src/Android/Renderers/SearchBarRenderer.cs +++ b/src/Compatibility/Core/src/Android/Renderers/SearchBarRenderer.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using System.ComponentModel; using System.Linq; using Android.Content; @@ -49,7 +50,7 @@ bool SearchView.IOnQueryTextListener.OnQueryTextSubmit(string query) public override SizeRequest GetDesiredSize(int widthConstraint, int heightConstraint) { var sizerequest = base.GetDesiredSize(widthConstraint, heightConstraint); - if (Forms.IsNougatOrNewer && heightConstraint == 0 && sizerequest.Request.Height == 0) + if (OperatingSystem.IsAndroidVersionAtLeast(24) && heightConstraint == 0 && sizerequest.Request.Height == 0) { sizerequest.Request = new Size(sizerequest.Request.Width, _defaultHeight); } diff --git a/src/Compatibility/Core/src/Android/Resource.designer.cs b/src/Compatibility/Core/src/Android/Resource.designer.cs deleted file mode 100644 index 47311f5aeee4..000000000000 --- a/src/Compatibility/Core/src/Android/Resource.designer.cs +++ /dev/null @@ -1,87 +0,0 @@ -#pragma warning disable 1591 -//------------------------------------------------------------------------------ -// This file was manually curated so we could avoid 5,172 fields. -// See .github/DEVELOPMENT.md#Android for details on updating this file. -//------------------------------------------------------------------------------ - -[assembly: global::Android.Runtime.ResourceDesignerAttribute("Microsoft.Maui.Controls.Compatibility.Resource", IsApplication=false)] - -namespace Microsoft.Maui.Controls.Compatibility -{ - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "12.0.99.31")] - public partial class Resource - { - static Resource() - { - global::Android.Runtime.ResourceIdManager.UpdateIdValues(); - } - - public partial class Animation - { - static Animation() - { - global::Android.Runtime.ResourceIdManager.UpdateIdValues(); - } - } - - public partial class Attribute - { - // aapt resource value: 0x7F030007 - public static int actionBarSize = 2130903047; - - // aapt resource value: 0x7F0300CE - public static int collectionViewStyle = 2130903246; - - // aapt resource value: 0x7F030301 - public static int scrollViewStyle = 2130903809; - - static Attribute() - { - global::Android.Runtime.ResourceIdManager.UpdateIdValues(); - } - } - - public partial class Drawable - { - // aapt resource value: 0x7F07001D - public static int abc_ic_clear_material = 2131165213; - - // aapt resource value: 0x7F070026 - public static int abc_ic_search_api_material = 2131165222; - - static Drawable() - { - global::Android.Runtime.ResourceIdManager.UpdateIdValues(); - } - } - - public partial class Layout - { - // aapt resource value: 0x7F0B0072 - public static int tabbar = 2131427442; - - // aapt resource value: 0x7F0B0082 - public static int toolbar = 2131427458; - - static Layout() - { - global::Android.Runtime.ResourceIdManager.UpdateIdValues(); - } - } - - public partial class Style - { - // aapt resource value: 0x7F0E02DF - public static int collectionViewTheme = 2131624671; - - // aapt resource value: 0x7F0E02E1 - public static int scrollViewTheme = 2131624673; - - static Style() - { - global::Android.Runtime.ResourceIdManager.UpdateIdValues(); - } - } - } -} -#pragma warning restore 1591 diff --git a/src/Compatibility/Core/src/Compatibility.csproj b/src/Compatibility/Core/src/Compatibility.csproj index dc6d71ae5f07..84fd504f6897 100644 --- a/src/Compatibility/Core/src/Compatibility.csproj +++ b/src/Compatibility/Core/src/Compatibility.csproj @@ -9,7 +9,7 @@ Windows\ Tizen\ false - true + true true $(NoWarn);CS1591 diff --git a/src/Controls/Maps/src/PublicAPI/net-android/PublicAPI.Unshipped.txt b/src/Controls/Maps/src/PublicAPI/net-android/PublicAPI.Unshipped.txt index 7dc5c58110bf..b72069e0f6db 100644 --- a/src/Controls/Maps/src/PublicAPI/net-android/PublicAPI.Unshipped.txt +++ b/src/Controls/Maps/src/PublicAPI/net-android/PublicAPI.Unshipped.txt @@ -1 +1,3 @@ #nullable enable +Microsoft.Maui.Controls.Maps.Resource +Microsoft.Maui.Controls.Maps.Resource.Resource() -> void diff --git a/src/Controls/src/Core/Compatibility/Handlers/ListView/Android/ListViewRenderer.cs b/src/Controls/src/Core/Compatibility/Handlers/ListView/Android/ListViewRenderer.cs index 71ef2996d61b..c2c4e30b8954 100644 --- a/src/Controls/src/Core/Compatibility/Handlers/ListView/Android/ListViewRenderer.cs +++ b/src/Controls/src/Core/Compatibility/Handlers/ListView/Android/ListViewRenderer.cs @@ -191,7 +191,9 @@ internal void ClickOn(AView viewCell) var position = Control.GetPositionForView(viewCell); var id = Control.GetItemIdAtPosition(position); +#pragma warning disable CA1416 // Introduced in API 23: https://developer.android.com/reference/android/view/HapticFeedbackConstants#CONTEXT_CLICK viewCell.PerformHapticFeedback(FeedbackConstants.ContextClick); +#pragma warning restore CA1416 _adapter.OnItemClick(Control, viewCell, position, id); } @@ -205,7 +207,9 @@ internal void LongClickOn(AView viewCell) var position = Control.GetPositionForView(viewCell); var id = Control.GetItemIdAtPosition(position); +#pragma warning disable CA1416 // Introduced in API 23: https://developer.android.com/reference/android/view/HapticFeedbackConstants#CONTEXT_CLICK viewCell.PerformHapticFeedback(FeedbackConstants.ContextClick); +#pragma warning restore CA1416 _adapter.OnItemLongClick(Control, viewCell, position, id); } diff --git a/src/Controls/src/Core/Platform/Android/DragAndDropGestureHandler.cs b/src/Controls/src/Core/Platform/Android/DragAndDropGestureHandler.cs index 660f72c9f698..70cec25ab3fb 100644 --- a/src/Controls/src/Core/Platform/Android/DragAndDropGestureHandler.cs +++ b/src/Controls/src/Core/Platform/Android/DragAndDropGestureHandler.cs @@ -325,9 +325,9 @@ public void OnLongPress(MotionEvent e) if (OperatingSystem.IsAndroidVersionAtLeast(24)) v.StartDragAndDrop(data, dragShadowBuilder, customLocalStateData, (int)ADragFlags.Global | (int)ADragFlags.GlobalUriRead); else -#pragma warning disable CS0618 // Type or member is obsolete +#pragma warning disable CA1416 // DragFlags.Global added in API 24: https://developer.android.com/reference/android/view/View#DRAG_FLAG_GLOBAL v.StartDrag(data, dragShadowBuilder, customLocalStateData, (int)ADragFlags.Global | (int)ADragFlags.GlobalUriRead); -#pragma warning restore CS0618 // Type or member is obsolete +#pragma warning restore CA1416 }); } diff --git a/src/Controls/src/Core/Platform/Android/ImeActionExtensions.cs b/src/Controls/src/Core/Platform/Android/ImeActionExtensions.cs index 8da1b1c0b63a..59e4f90c1cc2 100644 --- a/src/Controls/src/Core/Platform/Android/ImeActionExtensions.cs +++ b/src/Controls/src/Core/Platform/Android/ImeActionExtensions.cs @@ -24,7 +24,9 @@ public static ImeAction ToPlatform(this PlatformConfiguration.AndroidSpecific.Im case PlatformConfiguration.AndroidSpecific.ImeFlags.ImeMaskAction: return ImeAction.ImeMaskAction; case PlatformConfiguration.AndroidSpecific.ImeFlags.NoPersonalizedLearning: +#pragma warning disable CA1416 // Introduced in API 26: https://developer.android.com/reference/android/view/inputmethod/EditorInfo#IME_FLAG_NO_PERSONALIZED_LEARNING return (ImeAction)ImeFlags.NoPersonalizedLearning; +#pragma warning restore CA1416 case PlatformConfiguration.AndroidSpecific.ImeFlags.NoExtractUi: return (ImeAction)ImeFlags.NoExtractUi; case PlatformConfiguration.AndroidSpecific.ImeFlags.NoAccessoryAction: diff --git a/src/Controls/src/Core/Platform/Android/Resource.designer.cs b/src/Controls/src/Core/Platform/Android/Resource.designer.cs deleted file mode 100644 index acda50791b9f..000000000000 --- a/src/Controls/src/Core/Platform/Android/Resource.designer.cs +++ /dev/null @@ -1,210 +0,0 @@ -#nullable disable -#pragma warning disable 1591 -//------------------------------------------------------------------------------ -// This file was manually curated so we could avoid 5,167 fields. -// See .github/DEVELOPMENT.md#Android for details on updating this file. -//----------------------------------------------------------------------------- - -[assembly: global::Android.Runtime.ResourceDesignerAttribute("Microsoft.Maui.Controls.Resource", IsApplication=false)] - -namespace Microsoft.Maui.Controls -{ - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "12.0.99.31")] - public partial class Resource - { - static Resource() - { - global::Android.Runtime.ResourceIdManager.UpdateIdValues(); - } - - public partial class Animation - { - // aapt resource value: 0x7F01001C - public static int enterfromleft = 2130771996; - - // aapt resource value: 0x7F01001D - public static int enterfromright = 2130771997; - - // aapt resource value: 0x7F01001E - public static int exittoleft = 2130771998; - - // aapt resource value: 0x7F01001F - public static int exittoright = 2130771999; - - static Animation() - { - global::Android.Runtime.ResourceIdManager.UpdateIdValues(); - } - } - - public partial class Attribute - { - // aapt resource value: 0x7F030007 - public static int actionBarSize = 2130903047; - - // aapt resource value: 0x7F030033 - public static int appBarLayoutStyle = 2130903091; - - // aapt resource value: 0x7F030066 - public static int bottomNavigationViewStyle = 2130903142; - - // aapt resource value: 0x7F0303F1 - public static int toolbarStyle = 2130904049; - - static Attribute() - { - global::Android.Runtime.ResourceIdManager.UpdateIdValues(); - } - } - - public partial class Drawable - { - // aapt resource value: 0x7F07001D - public static int abc_ic_clear_material = 2131165213; - - // aapt resource value: 0x7F070022 - public static int abc_ic_menu_overflow_material = 2131165218; - - // aapt resource value: 0x7F070026 - public static int abc_ic_search_api_material = 2131165222; - - static Drawable() - { - global::Android.Runtime.ResourceIdManager.UpdateIdValues(); - } - } - - public partial class Id - { - // aapt resource value: 0x7F080063 - public static int navigationlayout_bottomtabs = 2131230819; - - // aapt resource value: 0x7F08013E - public static int navigationlayout_content = 2131231038; - - // aapt resource value: 0x7F0801CD - public static int navigationlayout_toptabs = 2131231181; - - // aapt resource value: 0x7F08017D - public static int shellcontent_toolbar = 2131231101; - - // aapt resource value: 0x7F08017C - public static int shellcontent_appbar = 2131231100; - - // aapt resource value: 0x7F080061 - public static int bottomtab_navarea = 2131230817; - - // aapt resource value: 0x7F080062 - public static int bottomtab_tabbar = 2131230818; - - // aapt resource value: 0x7F0800C7 - public static int flyoutcontent_appbar = 2131230919; - - static Id() - { - global::Android.Runtime.ResourceIdManager.UpdateIdValues(); - } - } - - public partial class Layout - { - // aapt resource value: 0x7F0B002E - public static int fragment_backstack = 2131427374; - - // aapt resource value: 0x7F0B002F - public static int flyoutcontent = 2131427375; - - // aapt resource value: 0x7F0B006F - public static int shellcontent = 2131427439; - - static Layout() - { - global::Android.Runtime.ResourceIdManager.UpdateIdValues(); - } - } - - public partial class Dimension - { - // aapt resource value: 0x7F060067 - public static int design_bottom_navigation_height = 2131099751; - - static Dimension() - { - global::Android.Runtime.ResourceIdManager.UpdateIdValues(); - } - } - - public partial class Style - { - // aapt resource value: 0x7F0E01E8 - public static int ThemeOverlay_AppCompat_Light = 2131624424; - - static Style() - { - global::Android.Runtime.ResourceIdManager.UpdateIdValues(); - } - } - - public partial class Styleable - { - // aapt resource value: { 0x10100AF,0x1010140,0x7F03007B,0x7F0300C8,0x7F0300C9,0x7F0300EE,0x7F0300EF,0x7F0300F0,0x7F0300F1,0x7F0300F2,0x7F0300F3,0x7F03024B,0x7F03024C,0x7F03026C,0x7F030274,0x7F0302A2,0x7F0302A3,0x7F0302DA,0x7F030342,0x7F030344,0x7F030345,0x7F0303B0,0x7F0303B4,0x7F0303B5,0x7F0303B6,0x7F0303B7,0x7F0303B8,0x7F0303B9,0x7F0303BA,0x7F0303BB } - public static int[] Toolbar = new int[] { - 16842927, - 16843072, - 2130903163, - 2130903240, - 2130903241, - 2130903278, - 2130903279, - 2130903280, - 2130903281, - 2130903282, - 2130903283, - 2130903627, - 2130903628, - 2130903660, - 2130903668, - 2130903714, - 2130903715, - 2130903770, - 2130903874, - 2130903876, - 2130903877, - 2130903984, - 2130903988, - 2130903989, - 2130903990, - 2130903991, - 2130903992, - 2130903993, - 2130903994, - 2130903995}; - - // aapt resource value: 29 - public static int Toolbar_titleTextColor = 29; - - static Styleable() - { - global::Android.Runtime.ResourceIdManager.UpdateIdValues(); - } - } - - public partial class String - { - // aapt resource value: 0x7F0D0065 - public static int nav_app_bar_navigate_up_description = 2131558501; - - // aapt resource value: 0x7F0D0066 - public static int nav_app_bar_open_drawer_description = 2131558502; - - // aapt resource value: 0x7F0D0067 - public static int overflow_tab_title = 2131558503; - - static String() - { - global::Android.Runtime.ResourceIdManager.UpdateIdValues(); - } - } - } -} -#pragma warning restore 1591 diff --git a/src/Controls/src/Core/PublicAPI/net-android/PublicAPI.Shipped.txt b/src/Controls/src/Core/PublicAPI/net-android/PublicAPI.Shipped.txt index 882898f18662..3c9ec47a6ff5 100644 --- a/src/Controls/src/Core/PublicAPI/net-android/PublicAPI.Shipped.txt +++ b/src/Controls/src/Core/PublicAPI/net-android/PublicAPI.Shipped.txt @@ -3231,7 +3231,6 @@ ~static Microsoft.Maui.Controls.Region.FromLines(double[] lineHeights, double maxWidth, double startX, double endX, double startY) -> Microsoft.Maui.Controls.Region ~static Microsoft.Maui.Controls.RelativeBindingSource.Self.get -> Microsoft.Maui.Controls.RelativeBindingSource ~static Microsoft.Maui.Controls.RelativeBindingSource.TemplatedParent.get -> Microsoft.Maui.Controls.RelativeBindingSource -~static Microsoft.Maui.Controls.Resource.Styleable.Toolbar -> int[] ~static Microsoft.Maui.Controls.Routing.FormatRoute(string route) -> string ~static Microsoft.Maui.Controls.Routing.FormatRoute(System.Collections.Generic.List segments) -> string ~static Microsoft.Maui.Controls.Routing.GetOrCreateContent(string route, System.IServiceProvider services = null) -> Microsoft.Maui.Controls.Element @@ -6416,25 +6415,7 @@ Microsoft.Maui.Controls.ReorderableItemsView.ReorderCompleted -> System.EventHan Microsoft.Maui.Controls.ReorderableItemsView.SendReorderCompleted() -> void Microsoft.Maui.Controls.ResolutionGroupNameAttribute Microsoft.Maui.Controls.Resource -Microsoft.Maui.Controls.Resource.Animation -Microsoft.Maui.Controls.Resource.Animation.Animation() -> void -Microsoft.Maui.Controls.Resource.Attribute -Microsoft.Maui.Controls.Resource.Attribute.Attribute() -> void -Microsoft.Maui.Controls.Resource.Dimension -Microsoft.Maui.Controls.Resource.Dimension.Dimension() -> void -Microsoft.Maui.Controls.Resource.Drawable -Microsoft.Maui.Controls.Resource.Drawable.Drawable() -> void -Microsoft.Maui.Controls.Resource.Id -Microsoft.Maui.Controls.Resource.Id.Id() -> void -Microsoft.Maui.Controls.Resource.Layout -Microsoft.Maui.Controls.Resource.Layout.Layout() -> void Microsoft.Maui.Controls.Resource.Resource() -> void -Microsoft.Maui.Controls.Resource.String -Microsoft.Maui.Controls.Resource.String.String() -> void -Microsoft.Maui.Controls.Resource.Style -Microsoft.Maui.Controls.Resource.Style.Style() -> void -Microsoft.Maui.Controls.Resource.Styleable -Microsoft.Maui.Controls.Resource.Styleable.Styleable() -> void Microsoft.Maui.Controls.ResourceDictionary Microsoft.Maui.Controls.ResourceDictionary.Clear() -> void Microsoft.Maui.Controls.ResourceDictionary.Count.get -> int @@ -7707,34 +7688,6 @@ static Microsoft.Maui.Controls.Platform.FormattedStringExtensions.ToSpannableStr static Microsoft.Maui.Controls.Platform.SemanticExtensions.UpdateSemanticNodeInfo(this Microsoft.Maui.Controls.View! virtualView, AndroidX.Core.View.Accessibility.AccessibilityNodeInfoCompat? info) -> void static Microsoft.Maui.Controls.RadioButton.MapContent(Microsoft.Maui.Handlers.IRadioButtonHandler! handler, Microsoft.Maui.Controls.RadioButton! radioButton) -> void static Microsoft.Maui.Controls.RadioButton.MapContent(Microsoft.Maui.Handlers.RadioButtonHandler! handler, Microsoft.Maui.Controls.RadioButton! radioButton) -> void -static Microsoft.Maui.Controls.Resource.Animation.enterfromleft -> int -static Microsoft.Maui.Controls.Resource.Animation.enterfromright -> int -static Microsoft.Maui.Controls.Resource.Animation.exittoleft -> int -static Microsoft.Maui.Controls.Resource.Animation.exittoright -> int -static Microsoft.Maui.Controls.Resource.Attribute.actionBarSize -> int -static Microsoft.Maui.Controls.Resource.Attribute.appBarLayoutStyle -> int -static Microsoft.Maui.Controls.Resource.Attribute.bottomNavigationViewStyle -> int -static Microsoft.Maui.Controls.Resource.Attribute.toolbarStyle -> int -static Microsoft.Maui.Controls.Resource.Dimension.design_bottom_navigation_height -> int -static Microsoft.Maui.Controls.Resource.Drawable.abc_ic_clear_material -> int -static Microsoft.Maui.Controls.Resource.Drawable.abc_ic_menu_overflow_material -> int -static Microsoft.Maui.Controls.Resource.Drawable.abc_ic_search_api_material -> int -static Microsoft.Maui.Controls.Resource.Id.bottomtab_navarea -> int -static Microsoft.Maui.Controls.Resource.Id.bottomtab_tabbar -> int -static Microsoft.Maui.Controls.Resource.Id.flyoutcontent_appbar -> int -static Microsoft.Maui.Controls.Resource.Id.navigationlayout_bottomtabs -> int -static Microsoft.Maui.Controls.Resource.Id.navigationlayout_content -> int -static Microsoft.Maui.Controls.Resource.Id.navigationlayout_toptabs -> int -static Microsoft.Maui.Controls.Resource.Id.shellcontent_appbar -> int -static Microsoft.Maui.Controls.Resource.Id.shellcontent_toolbar -> int -static Microsoft.Maui.Controls.Resource.Layout.flyoutcontent -> int -static Microsoft.Maui.Controls.Resource.Layout.fragment_backstack -> int -static Microsoft.Maui.Controls.Resource.Layout.shellcontent -> int -static Microsoft.Maui.Controls.Resource.String.nav_app_bar_navigate_up_description -> int -static Microsoft.Maui.Controls.Resource.String.nav_app_bar_open_drawer_description -> int -static Microsoft.Maui.Controls.Resource.String.overflow_tab_title -> int -static Microsoft.Maui.Controls.Resource.Style.ThemeOverlay_AppCompat_Light -> int -static Microsoft.Maui.Controls.Resource.Styleable.Toolbar_titleTextColor -> int static Microsoft.Maui.Controls.Shapes.Matrix.Identity.get -> Microsoft.Maui.Controls.Shapes.Matrix static Microsoft.Maui.Controls.Shapes.Matrix.Multiply(Microsoft.Maui.Controls.Shapes.Matrix trans1, Microsoft.Maui.Controls.Shapes.Matrix trans2) -> Microsoft.Maui.Controls.Shapes.Matrix static Microsoft.Maui.Controls.Shapes.Matrix.operator *(Microsoft.Maui.Controls.Shapes.Matrix trans1, Microsoft.Maui.Controls.Shapes.Matrix trans2) -> Microsoft.Maui.Controls.Shapes.Matrix diff --git a/src/Controls/src/Xaml/PublicAPI/net-android/PublicAPI.Unshipped.txt b/src/Controls/src/Xaml/PublicAPI/net-android/PublicAPI.Unshipped.txt index 7dc5c58110bf..b292ce61ab5b 100644 --- a/src/Controls/src/Xaml/PublicAPI/net-android/PublicAPI.Unshipped.txt +++ b/src/Controls/src/Xaml/PublicAPI/net-android/PublicAPI.Unshipped.txt @@ -1 +1,3 @@ #nullable enable +Microsoft.Maui.Controls.Xaml.Resource +Microsoft.Maui.Controls.Xaml.Resource.Resource() -> void diff --git a/src/Controls/tests/Core.UnitTests/ImageButtonUnitTest.cs b/src/Controls/tests/Core.UnitTests/ImageButtonUnitTest.cs index 270654c3f36a..39e43dce1a27 100644 --- a/src/Controls/tests/Core.UnitTests/ImageButtonUnitTest.cs +++ b/src/Controls/tests/Core.UnitTests/ImageButtonUnitTest.cs @@ -212,7 +212,7 @@ async Task GetStreamAsync(CancellationToken cancellationToken) catch (TaskCanceledException ex) { cancelled = true; - throw ex; + throw; } if (cancellationToken.IsCancellationRequested) diff --git a/src/Core/maps/src/PublicAPI/net-android/PublicAPI.Unshipped.txt b/src/Core/maps/src/PublicAPI/net-android/PublicAPI.Unshipped.txt index 7dc5c58110bf..3480c3445e07 100644 --- a/src/Core/maps/src/PublicAPI/net-android/PublicAPI.Unshipped.txt +++ b/src/Core/maps/src/PublicAPI/net-android/PublicAPI.Unshipped.txt @@ -1 +1,3 @@ #nullable enable +Microsoft.Maui.Maps.Resource +Microsoft.Maui.Maps.Resource.Resource() -> void diff --git a/src/Core/src/ImageSources/iOS/ImageSourceExtensions.cs b/src/Core/src/ImageSources/iOS/ImageSourceExtensions.cs index 77a5163e775b..272a18ee950f 100644 --- a/src/Core/src/ImageSources/iOS/ImageSourceExtensions.cs +++ b/src/Core/src/ImageSources/iOS/ImageSourceExtensions.cs @@ -18,7 +18,7 @@ public static partial class ImageSourceExtensions var glyph = (NSString)imageSource.Glyph; var attString = new NSAttributedString(glyph, font, color); - var imagesize = glyph.GetSizeUsingAttributes(attString.GetUIKitAttributes(0, out _)); + var imagesize = glyph.GetSizeUsingAttributes(attString.GetUIKitAttributes(0, out _)!); UIGraphics.BeginImageContextWithOptions(imagesize, false, scale); var ctx = new NSStringDrawingContext(); diff --git a/src/Core/src/Platform/Android/LocalizedDigitsKeyListener.cs b/src/Core/src/Platform/Android/LocalizedDigitsKeyListener.cs index e11711b11fdc..3fd09783f99f 100644 --- a/src/Core/src/Platform/Android/LocalizedDigitsKeyListener.cs +++ b/src/Core/src/Platform/Android/LocalizedDigitsKeyListener.cs @@ -33,9 +33,9 @@ public static NumberKeyListener Create(InputTypes inputTypes) if ((inputTypes & InputTypes.NumberFlagDecimal) == 0) { // If decimal isn't allowed, we can just use the Android version -#pragma warning disable 0618 +#pragma warning disable CS0618, CA1416, CA1422 // Deprecated in API 26: https://developer.android.com/reference/android/text/method/DigitsKeyListener#getInstance(boolean,%20boolean) return DigitsKeyListener.GetInstance(inputTypes.HasFlag(InputTypes.NumberFlagSigned), false); -#pragma warning restore 0618 +#pragma warning restore CS0618, CA1416, CA1422 } // Figure out what the decimal separator is for the current locale @@ -44,9 +44,9 @@ public static NumberKeyListener Create(InputTypes inputTypes) if (decimalSeparator == '.') { // If it's '.', then we can just use the default Android version -#pragma warning disable 0618 +#pragma warning disable CS0618, CA1416, CA1422 // Deprecated in API 26: https://developer.android.com/reference/android/text/method/DigitsKeyListener#getInstance(boolean,%20boolean) return DigitsKeyListener.GetInstance(inputTypes.HasFlag(InputTypes.NumberFlagSigned), true); -#pragma warning restore 0618 +#pragma warning restore CS0618, CA1416, CA1422 } // If decimals are enabled and the locale's decimal separator is not '.' diff --git a/src/Core/src/Platform/Android/Resource.designer.cs b/src/Core/src/Platform/Android/Resource.designer.cs deleted file mode 100644 index e713f8ef46e1..000000000000 --- a/src/Core/src/Platform/Android/Resource.designer.cs +++ /dev/null @@ -1,142 +0,0 @@ -#pragma warning disable 1591 -//------------------------------------------------------------------------------ -// This file was manually curated so we could avoid 5,310 fields. -// See .github/DEVELOPMENT.md#Android for details on updating this file. -//----------------------------------------------------------------------------- - -[assembly: global::Android.Runtime.ResourceDesignerAttribute("Microsoft.Maui.Resource", IsApplication=false)] - -namespace Microsoft.Maui -{ - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "12.0.99.31")] - public partial class Resource - { - static Resource() - { - global::Android.Runtime.ResourceIdManager.UpdateIdValues(); - } - - public partial class Attribute - { - // aapt resource value: 0x7F030007 - public static int actionBarSize = 2130903047; - - // aapt resource value: 0x7F0300E4 - public static int colorSwitchThumbNormal = 2130903268; - - // aapt resource value: 0x7F030269 - public static int maui_splash = 2130903657; - - // aapt resource value: 0x7F030301 - public static int scrollViewStyle = 2130903809; - - static Attribute() - { - global::Android.Runtime.ResourceIdManager.UpdateIdValues(); - } - } - - public partial class Animation - { - // aapt resource value: 0x7F010020 - public static int nav_default_enter_anim = 2130772000; - - // aapt resource value: 0x7F010021 - public static int nav_default_exit_anim = 2130772001; - - // aapt resource value: 0x7F010022 - public static int nav_default_pop_enter_anim = 2130772002; - - // aapt resource value: 0x7F010023 - public static int nav_default_pop_exit_anim = 2130772003; - - static Animation() - { - global::Android.Runtime.ResourceIdManager.UpdateIdValues(); - } - } - - public partial class Drawable - { - // aapt resource value: 0x7F07001D - public static int abc_ic_clear_material = 2131165213; - - static Drawable() - { - global::Android.Runtime.ResourceIdManager.UpdateIdValues(); - } - } - - public partial class Id - { - // aapt resource value: 0x7F080132 - public static int navigation_layout = 2131231026; - - // aapt resource value: 0x7F08013C - public static int navigationlayout_appbar = 2131231036; - - // aapt resource value: 0x7F08013D - public static int navigationlayout_bottomtabs = 2131231037; - - // aapt resource value: 0x7F08013E - public static int navigationlayout_content = 2131231038; - - // aapt resource value: 0x7F080140 - public static int navigationlayout_toptabs = 2131231040; - - // aapt resource value: 0x7F080135 - public static int nav_host = 2131231029; - - // aapt resource value: 0x7F080136 - public static int nav_host_fragment_container = 2131231030; - - // aapt resource value: 0x7F08016A - public static int search_button = 2131231082; - - // aapt resource value: 0x7F08016B - public static int search_close_btn = 2131231083; - - static Id() - { - global::Android.Runtime.ResourceIdManager.UpdateIdValues(); - } - } - - public partial class Layout - { - // aapt resource value: 0x7F0B002E - public static int drawer_layout = 2131427374; - - // aapt resource value: 0x7F0B005A - public static int navigationlayout = 2131427418; - - // aapt resource value: 0x7F0B002E - public static int fragment_backstack = 2131427374; - - - - static Layout() - { - global::Android.Runtime.ResourceIdManager.UpdateIdValues(); - } - } - - public partial class Style - { - // aapt resource value: 0x7F0E00F8 - public static int Maui_MainTheme_NoActionBar = 2131624184; - - // aapt resource value: 0x7F0E01E8 - public static int ThemeOverlay_AppCompat_Light = 2131624424; - - // aapt resource value: 0x7F0E02E1 - public static int scrollViewTheme = 2131624673; - - static Style() - { - global::Android.Runtime.ResourceIdManager.UpdateIdValues(); - } - } - } -} -#pragma warning restore 1591 diff --git a/src/Core/src/Platform/Android/TextViewExtensions.cs b/src/Core/src/Platform/Android/TextViewExtensions.cs index 2dbfa8413129..e51fffdd7f63 100644 --- a/src/Core/src/Platform/Android/TextViewExtensions.cs +++ b/src/Core/src/Platform/Android/TextViewExtensions.cs @@ -104,11 +104,15 @@ public static void UpdateFlowDirection(this TextView platformView, IView view) break; case FlowDirection.RightToLeft: platformView.LayoutDirection = ALayoutDirection.Rtl; +#pragma warning disable CA1416 // Introduced in API 23: https://developer.android.com/reference/android/view/View#TEXT_DIRECTION_FIRST_STRONG_RTL platformView.TextDirection = ATextDirection.FirstStrongRtl; +#pragma warning restore CA1416 break; case FlowDirection.LeftToRight: platformView.LayoutDirection = ALayoutDirection.Ltr; +#pragma warning disable CA1416 // Introduced in API 23: https://developer.android.com/reference/android/view/View#TEXT_DIRECTION_FIRST_STRONG_LTR platformView.TextDirection = ATextDirection.FirstStrongLtr; +#pragma warning restore CA1416 break; } } diff --git a/src/Core/src/Platform/iOS/LabelExtensions.cs b/src/Core/src/Platform/iOS/LabelExtensions.cs index 0d26e48bf82b..e7a7c96535dc 100644 --- a/src/Core/src/Platform/iOS/LabelExtensions.cs +++ b/src/Core/src/Platform/iOS/LabelExtensions.cs @@ -83,7 +83,7 @@ internal static void UpdateTextHtml(this UILabel platformLabel, ILabel label) StringEncoding = NSStringEncoding.UTF8 }; - NSError? nsError = null; + NSError nsError = new(); platformLabel.AttributedText = new NSAttributedString(text, attr, ref nsError); } diff --git a/src/Core/src/PublicAPI/net-android/PublicAPI.Shipped.txt b/src/Core/src/PublicAPI/net-android/PublicAPI.Shipped.txt index 226d36e0fbd4..02eae4eb87e6 100644 --- a/src/Core/src/PublicAPI/net-android/PublicAPI.Shipped.txt +++ b/src/Core/src/PublicAPI/net-android/PublicAPI.Shipped.txt @@ -1843,19 +1843,7 @@ Microsoft.Maui.RectangleAdorner.VisualView.get -> Microsoft.Maui.IView! Microsoft.Maui.RectangleGridAdorner Microsoft.Maui.RectangleGridAdorner.RectangleGridAdorner(Microsoft.Maui.IView! view, float density = 1, Microsoft.Maui.Graphics.Point? offset = null, Microsoft.Maui.Graphics.Color? fillColor = null, Microsoft.Maui.Graphics.Color? strokeColor = null) -> void Microsoft.Maui.Resource -Microsoft.Maui.Resource.Animation -Microsoft.Maui.Resource.Animation.Animation() -> void -Microsoft.Maui.Resource.Attribute -Microsoft.Maui.Resource.Attribute.Attribute() -> void -Microsoft.Maui.Resource.Drawable -Microsoft.Maui.Resource.Drawable.Drawable() -> void -Microsoft.Maui.Resource.Id -Microsoft.Maui.Resource.Id.Id() -> void -Microsoft.Maui.Resource.Layout -Microsoft.Maui.Resource.Layout.Layout() -> void Microsoft.Maui.Resource.Resource() -> void -Microsoft.Maui.Resource.Style -Microsoft.Maui.Resource.Style.Style() -> void Microsoft.Maui.RetrievePlatformValueRequest Microsoft.Maui.RetrievePlatformValueRequest.Result.get -> T Microsoft.Maui.RetrievePlatformValueRequest.RetrievePlatformValueRequest() -> void @@ -3062,30 +3050,6 @@ static Microsoft.Maui.Primitives.Dimension.ResolveMinimum(double value) -> doubl static Microsoft.Maui.PropertyMapperExtensions.AppendToMapping(this Microsoft.Maui.IPropertyMapper! propertyMapper, string! key, System.Action! method) -> void static Microsoft.Maui.PropertyMapperExtensions.ModifyMapping(this Microsoft.Maui.IPropertyMapper! propertyMapper, string! key, System.Action?>! method) -> void static Microsoft.Maui.PropertyMapperExtensions.PrependToMapping(this Microsoft.Maui.IPropertyMapper! propertyMapper, string! key, System.Action! method) -> void -static Microsoft.Maui.Resource.Animation.nav_default_enter_anim -> int -static Microsoft.Maui.Resource.Animation.nav_default_exit_anim -> int -static Microsoft.Maui.Resource.Animation.nav_default_pop_enter_anim -> int -static Microsoft.Maui.Resource.Animation.nav_default_pop_exit_anim -> int -static Microsoft.Maui.Resource.Attribute.actionBarSize -> int -static Microsoft.Maui.Resource.Attribute.colorSwitchThumbNormal -> int -static Microsoft.Maui.Resource.Attribute.maui_splash -> int -static Microsoft.Maui.Resource.Attribute.scrollViewStyle -> int -static Microsoft.Maui.Resource.Drawable.abc_ic_clear_material -> int -static Microsoft.Maui.Resource.Id.nav_host -> int -static Microsoft.Maui.Resource.Id.nav_host_fragment_container -> int -static Microsoft.Maui.Resource.Id.navigation_layout -> int -static Microsoft.Maui.Resource.Id.navigationlayout_appbar -> int -static Microsoft.Maui.Resource.Id.navigationlayout_bottomtabs -> int -static Microsoft.Maui.Resource.Id.navigationlayout_content -> int -static Microsoft.Maui.Resource.Id.navigationlayout_toptabs -> int -static Microsoft.Maui.Resource.Id.search_button -> int -static Microsoft.Maui.Resource.Id.search_close_btn -> int -static Microsoft.Maui.Resource.Layout.drawer_layout -> int -static Microsoft.Maui.Resource.Layout.fragment_backstack -> int -static Microsoft.Maui.Resource.Layout.navigationlayout -> int -static Microsoft.Maui.Resource.Style.Maui_MainTheme_NoActionBar -> int -static Microsoft.Maui.Resource.Style.scrollViewTheme -> int -static Microsoft.Maui.Resource.Style.ThemeOverlay_AppCompat_Light -> int static Microsoft.Maui.SemanticExtensions.SetSemanticFocus(this Microsoft.Maui.IView! element) -> void static Microsoft.Maui.SizeRequest.implicit operator Microsoft.Maui.Graphics.Size(Microsoft.Maui.SizeRequest size) -> Microsoft.Maui.Graphics.Size static Microsoft.Maui.SizeRequest.implicit operator Microsoft.Maui.SizeRequest(Microsoft.Maui.Graphics.Size size) -> Microsoft.Maui.SizeRequest diff --git a/src/Core/tests/DeviceTests.Shared/Core.DeviceTests.Shared.csproj b/src/Core/tests/DeviceTests.Shared/Core.DeviceTests.Shared.csproj index 72fbfe71ffaf..e59e89980236 100644 --- a/src/Core/tests/DeviceTests.Shared/Core.DeviceTests.Shared.csproj +++ b/src/Core/tests/DeviceTests.Shared/Core.DeviceTests.Shared.csproj @@ -5,6 +5,8 @@ true Microsoft.Maui.DeviceTests Microsoft.Maui.DeviceTests.Shared + + Microsoft.Maui.DeviceTests.Shared $(NoWarn),CA1416 diff --git a/src/DotNet/DotNet.csproj b/src/DotNet/DotNet.csproj index 2d33dbd3dee9..05b547dac9c8 100644 --- a/src/DotNet/DotNet.csproj +++ b/src/DotNet/DotNet.csproj @@ -159,6 +159,15 @@ Files="@(_WorkloadFiles)" WorkloadDirectory="$(DotNetSdkManifestsDirectory)" /> + + + <_WorkloadFilesToFixup Include="$(_WorkloadManifestDir)microsoft.net.workload.mono.toolchain.manifest-$(DotNetMonoManifestVersionBand)/*/data/WorkloadManifest.*" /> + + diff --git a/src/Essentials/src/AppInfo/AppInfo.android.cs b/src/Essentials/src/AppInfo/AppInfo.android.cs index e274e756826e..579607ea72c2 100644 --- a/src/Essentials/src/AppInfo/AppInfo.android.cs +++ b/src/Essentials/src/AppInfo/AppInfo.android.cs @@ -13,9 +13,9 @@ class AppInfoImplementation : IAppInfo { static readonly Lazy _name = new Lazy(() => Application.Context.ApplicationInfo.LoadLabel(Application.Context.PackageManager)); static readonly Lazy _packageName = new Lazy(() => Application.Context.PackageName); -#pragma warning disable 618 +#pragma warning disable CA1416, CA1422 // Deprecated in API 33: https://developer.android.com/reference/android/content/pm/PackageManager#getPackageInfo(java.lang.String,%20int) static readonly Lazy _packageInfo = new Lazy(() => Application.Context.PackageManager.GetPackageInfo(_packageName.Value, PackageInfoFlags.MetaData)); -#pragma warning restore 618 +#pragma warning restore CA1416, CA1422 static readonly Lazy _requestedTheme = new Lazy(GetRequestedTheme); static readonly Lazy _layoutDirection = new Lazy(GetLayoutDirection); diff --git a/src/Essentials/src/Essentials.csproj b/src/Essentials/src/Essentials.csproj index 0a2e69168c75..128689c60c8d 100644 --- a/src/Essentials/src/Essentials.csproj +++ b/src/Essentials/src/Essentials.csproj @@ -6,7 +6,7 @@ false BI1234 false - true + true true $(NoWarn);CS1591;NU5104;RS0041;RS0026 $(NoWarn);CA1420 diff --git a/src/Essentials/src/FileSystem/FileSystemUtils.android.cs b/src/Essentials/src/FileSystem/FileSystemUtils.android.cs index e293e8b1383f..16c1dfdb70d4 100644 --- a/src/Essentials/src/FileSystem/FileSystemUtils.android.cs +++ b/src/Essentials/src/FileSystem/FileSystemUtils.android.cs @@ -261,7 +261,9 @@ static bool IsVirtualFile(AndroidUri uri) if (!string.IsNullOrEmpty(value) && int.TryParse(value, out var flagsInt)) { var flags = (DocumentContractFlags)flagsInt; +#pragma warning disable CA1416 // Introduced in API 24: https://developer.android.com/reference/android/provider/DocumentsContract.Document#FLAG_VIRTUAL_DOCUMENT return flags.HasFlag(DocumentContractFlags.VirtualDocument); +#pragma warning restore CA1416 } return false; diff --git a/src/Essentials/src/HapticFeedback/HapticFeedback.android.cs b/src/Essentials/src/HapticFeedback/HapticFeedback.android.cs index b02b751baa63..8e76f8977497 100644 --- a/src/Essentials/src/HapticFeedback/HapticFeedback.android.cs +++ b/src/Essentials/src/HapticFeedback/HapticFeedback.android.cs @@ -28,7 +28,9 @@ static FeedbackConstants ConvertType(HapticFeedbackType type) => type switch { HapticFeedbackType.LongPress => FeedbackConstants.LongPress, +#pragma warning disable CA1416 // Introduced in API 23: https://developer.android.com/reference/android/view/HapticFeedbackConstants#CONTEXT_CLICK _ => FeedbackConstants.ContextClick +#pragma warning restore CA1416 }; } } diff --git a/src/Essentials/src/Permissions/Permissions.android.cs b/src/Essentials/src/Permissions/Permissions.android.cs index 35725ba97448..461d8b8e08a3 100644 --- a/src/Essentials/src/Permissions/Permissions.android.cs +++ b/src/Essentials/src/Permissions/Permissions.android.cs @@ -16,9 +16,9 @@ public static partial class Permissions public static bool IsDeclaredInManifest(string permission) { var context = Application.Context; -#pragma warning disable 618 +#pragma warning disable CA1416, CA1422 // Deprecated in API 33: https://developer.android.com/reference/android/content/pm/PackageManager#getPackageInfo(java.lang.String,%20int) var packageInfo = context.PackageManager.GetPackageInfo(context.PackageName, PackageInfoFlags.Permissions); -#pragma warning restore 618 +#pragma warning restore CA1416, CA1422 var requestedPermissions = packageInfo?.RequestedPermissions; return requestedPermissions?.Any(r => r.Equals(permission, StringComparison.OrdinalIgnoreCase)) ?? false; diff --git a/src/Essentials/src/PublicAPI/net-android/PublicAPI.Unshipped.txt b/src/Essentials/src/PublicAPI/net-android/PublicAPI.Unshipped.txt index 1e2c3171b21e..4e35dc5bcd05 100644 --- a/src/Essentials/src/PublicAPI/net-android/PublicAPI.Unshipped.txt +++ b/src/Essentials/src/PublicAPI/net-android/PublicAPI.Unshipped.txt @@ -1,5 +1,7 @@ #nullable enable *REMOVED*Microsoft.Maui.Storage.ISecureStorage.GetAsync(string! key) -> System.Threading.Tasks.Task! *REMOVED*static Microsoft.Maui.Storage.SecureStorage.GetAsync(string! key) -> System.Threading.Tasks.Task! +Microsoft.Maui.Essentials.Resource +Microsoft.Maui.Essentials.Resource.Resource() -> void Microsoft.Maui.Storage.ISecureStorage.GetAsync(string! key) -> System.Threading.Tasks.Task! static Microsoft.Maui.Storage.SecureStorage.GetAsync(string! key) -> System.Threading.Tasks.Task! diff --git a/src/Essentials/src/WebAuthenticator/WebAuthenticator.ios.tvos.cs b/src/Essentials/src/WebAuthenticator/WebAuthenticator.ios.tvos.cs index 65c64fb88e2f..50f160d73132 100644 --- a/src/Essentials/src/WebAuthenticator/WebAuthenticator.ios.tvos.cs +++ b/src/Essentials/src/WebAuthenticator/WebAuthenticator.ios.tvos.cs @@ -95,6 +95,7 @@ void AuthSessionCallback(NSUrl cbUrl, NSError error) if (prefersEphemeralWebBrowserSession) ClearCookies(); +#pragma warning disable CA1422 // 'SFAuthenticationSession' is obsoleted on: 'ios' 12.0 and later if (OperatingSystem.IsIOSVersionAtLeast(11)) { sf = new SFAuthenticationSession(WebUtils.GetNativeUrl(url), scheme, AuthSessionCallback); @@ -104,6 +105,7 @@ void AuthSessionCallback(NSUrl cbUrl, NSError error) return await tcsResponse.Task; } } +#pragma warning restore CA1422 // This is only on iOS9+ but we only support 10+ in Essentials anyway var controller = new SFSafariViewController(WebUtils.GetNativeUrl(url), false) diff --git a/src/Essentials/test/DeviceTests/Tests/Vibration_Tests.cs b/src/Essentials/test/DeviceTests/Tests/Vibration_Tests.cs index 8b962e03187b..f8a29856bfe2 100644 --- a/src/Essentials/test/DeviceTests/Tests/Vibration_Tests.cs +++ b/src/Essentials/test/DeviceTests/Tests/Vibration_Tests.cs @@ -13,7 +13,7 @@ public void Vibrate() #if __ANDROID__ // API 23+ we need user interaction for camera permission // can't really test so easily on device. - if (OperatingSystem.IsAndroidVersionAtLeast((int)Android.OS.BuildVersionCodes.M)) + if (OperatingSystem.IsAndroidVersionAtLeast(23)) return; #elif __IOS__ // TODO: remove this as soon as the test harness can filter @@ -31,7 +31,7 @@ public void Vibrate_Cancel() #if __ANDROID__ // API 23+ we need user interaction for camera permission // can't really test so easily on device. - if (OperatingSystem.IsAndroidVersionAtLeast((int)Android.OS.BuildVersionCodes.M)) + if (OperatingSystem.IsAndroidVersionAtLeast(23)) return; #elif __IOS__ // TODO: remove this as soon as the test harness can filter diff --git a/src/Graphics/src/Graphics.Skia/PublicAPI/net-android/PublicAPI.Unshipped.txt b/src/Graphics/src/Graphics.Skia/PublicAPI/net-android/PublicAPI.Unshipped.txt index ab7280577050..e24e28764a36 100644 --- a/src/Graphics/src/Graphics.Skia/PublicAPI/net-android/PublicAPI.Unshipped.txt +++ b/src/Graphics/src/Graphics.Skia/PublicAPI/net-android/PublicAPI.Unshipped.txt @@ -2,6 +2,8 @@ Microsoft.Maui.Graphics.Skia.FontExtensions Microsoft.Maui.Graphics.Skia.PlatformBitmapExportService Microsoft.Maui.Graphics.Skia.PlatformBitmapExportService.PlatformBitmapExportService() -> void +Microsoft.Maui.Graphics.Skia.Resource +Microsoft.Maui.Graphics.Skia.Resource.Resource() -> void Microsoft.Maui.Graphics.Skia.SKColorExtensions Microsoft.Maui.Graphics.Skia.SKGraphicsExtensions Microsoft.Maui.Graphics.Skia.SkiaBitmapExportContext diff --git a/src/Graphics/src/Graphics/Platforms/Android/PlatformCanvas.cs b/src/Graphics/src/Graphics/Platforms/Android/PlatformCanvas.cs index 8b4e0e91418b..dd02d51086e3 100644 --- a/src/Graphics/src/Graphics/Platforms/Android/PlatformCanvas.cs +++ b/src/Graphics/src/Graphics/Platforms/Android/PlatformCanvas.cs @@ -539,9 +539,9 @@ public override void FillEllipse(float x, float y, float width, float height) public override void SubtractFromClip(float x, float y, float width, float height) { -#pragma warning disable CS0618 // Type or member is obsolete +#pragma warning disable CS0618, CA1416, CA1422 // clipRect(Region.Op) method deprecated in API 26 https://developer.android.com/reference/android/graphics/Canvas#clipRect(float,%20float,%20float,%20float,%20android.graphics.Region.Op) _canvas.ClipRect(x, y, x + width, y + height, Region.Op.Difference); -#pragma warning restore CS0618 // Type or member is obsolete +#pragma warning restore CS0618, CA1416, CA1422 // clipRect(Region.Op) method deprecated } protected override void PlatformDrawPath(PathF aPath) @@ -735,7 +735,9 @@ protected override void PlatformTranslate(float tx, float ty) protected override void PlatformConcatenateTransform(Matrix3x2 transform) { +#pragma warning disable CS0618 // getMatrix() method deprecated in API 16 https://developer.android.com/reference/android/graphics/Canvas#getMatrix() var matrix = new Matrix(_canvas.Matrix); +#pragma warning restore CS0618 // getMatrix() method deprecated matrix.PostConcat(transform.AsMatrix()); _canvas.Matrix = matrix; } diff --git a/src/Graphics/src/Graphics/PublicAPI/net-android/PublicAPI.Unshipped.txt b/src/Graphics/src/Graphics/PublicAPI/net-android/PublicAPI.Unshipped.txt index d7ee0ca3d13c..6502641389af 100644 --- a/src/Graphics/src/Graphics/PublicAPI/net-android/PublicAPI.Unshipped.txt +++ b/src/Graphics/src/Graphics/PublicAPI/net-android/PublicAPI.Unshipped.txt @@ -626,6 +626,8 @@ Microsoft.Maui.Graphics.ResizeMode Microsoft.Maui.Graphics.ResizeMode.Bleed = 1 -> Microsoft.Maui.Graphics.ResizeMode Microsoft.Maui.Graphics.ResizeMode.Fit = 0 -> Microsoft.Maui.Graphics.ResizeMode Microsoft.Maui.Graphics.ResizeMode.Stretch = 2 -> Microsoft.Maui.Graphics.ResizeMode +Microsoft.Maui.Graphics.Resource +Microsoft.Maui.Graphics.Resource.Resource() -> void Microsoft.Maui.Graphics.ScalingCanvas Microsoft.Maui.Graphics.ScalingCanvas.Alpha.set -> void Microsoft.Maui.Graphics.ScalingCanvas.Antialias.set -> void