Skip to content

Commit

Permalink
[net8.0] use latest .NET 8 SDK and mobile workloads (#12520)
Browse files Browse the repository at this point in the history
Changes: dotnet/android@8a20803...c1efcb5
Changes: xamarin/xamarin-macios@df0151d...6b1b9f3
Changes: dotnet/installer@8c1708f...9962c6a
Changes: dotnet/runtime@5108757...5da4a9e
Changes: dotnet/emsdk@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`:

dotnet/sdk@f5cb7e3

* 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`:

dotnet/android@dc3ccf2

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:

dotnet/android#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:

dotnet/android@22f10b2

Fixes: #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 <jonathan.peppers@microsoft.com>
  • Loading branch information
dotnet-maestro[bot] and jonathanpeppers committed Jan 24, 2023
1 parent a4f2d9b commit eea6fea
Show file tree
Hide file tree
Showing 45 changed files with 105 additions and 593 deletions.
2 changes: 0 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,5 @@
<SuppressNETCoreSdkPreviewMessage>true</SuppressNETCoreSdkPreviewMessage>
<!-- Disables the transitive restore of packages like Microsoft.AspNetCore.App.Ref, Microsoft.WindowsDesktop.App.Ref -->
<DisableTransitiveFrameworkReferenceDownloads>true</DisableTransitiveFrameworkReferenceDownloads>
<!-- TODO: temporarily disable this to get past Android build error in Release builds -->
<AndroidEnableMarshalMethods>false</AndroidEnableMarshalMethods>
</PropertyGroup>
</Project>
9 changes: 0 additions & 9 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,6 @@
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
</PropertyGroup>

<!--
Comment out this section if you need to update Resource.designer.cs files.
See .github/DEVELOPMENT.md#Android for details.
-->
<PropertyGroup Condition="'$(_MauiTargetPlatformIsAndroid)' == 'True' AND '$(AndroidApplication)' != 'true'">
<AndroidGenerateResourceDesigner>false</AndroidGenerateResourceDesigner>
<AndroidUseIntermediateDesignerFile>false</AndroidUseIntermediateDesignerFile>
</PropertyGroup>

<!-- semi HACK: by default, WinUI includes all @(None) with .bmp/.png as @(Content) and adds that to the .pri -->
<ItemGroup Condition="'$(_MauiTargetPlatformIsWindows)' == 'True'">
<Content Remove="@(None->WithMetadataValue('Pack','true'))" />
Expand Down
32 changes: 16 additions & 16 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
<Dependencies>
<ProductDependencies>
<Dependency Name="Microsoft.Dotnet.Sdk.Internal" Version="8.0.100-alpha.1.22526.2" CoherentParentDependency="Microsoft.Android.Sdk.Windows">
<Dependency Name="Microsoft.Dotnet.Sdk.Internal" Version="8.0.100-alpha.1.23063.11" CoherentParentDependency="Microsoft.Android.Sdk.Windows">
<Uri>https://github.com/dotnet/installer</Uri>
<Sha>8c1708f37899815bc298ab30e5f2561ec47f1929</Sha>
<Sha>9962c6a686a31ba1e7c20983a810ba7989c3fc0c</Sha>
</Dependency>
<Dependency Name="Microsoft.NETCore.App.Ref" Version="8.0.0-alpha.1.22524.5" CoherentParentDependency="Microsoft.Android.Sdk.Windows">
<Dependency Name="Microsoft.NETCore.App.Ref" Version="8.0.0-alpha.1.23058.2" CoherentParentDependency="Microsoft.Android.Sdk.Windows">
<Uri>https://github.com/dotnet/runtime</Uri>
<Sha>5108757b997c59ab8ba1fc5309ab0d4e730e2b77</Sha>
<Sha>5da4a9e919dcee35f831ab69b6e475baaf798875</Sha>
</Dependency>
<Dependency Name="Microsoft.Android.Sdk.Windows" Version="34.0.0-preview.1.50">
<Dependency Name="Microsoft.Android.Sdk.Windows" Version="34.0.0-preview.1.127">
<Uri>https://github.com/xamarin/xamarin-android</Uri>
<Sha>8a2080306210302d5caca50ab9906240282825f4</Sha>
<Sha>c1efcb5678c8d93c4d5bdd0452a79a8ffab2f6b7</Sha>
</Dependency>
<Dependency Name="Microsoft.MacCatalyst.Sdk" Version="16.1.585-net8-p1">
<Dependency Name="Microsoft.MacCatalyst.Sdk" Version="16.2.126-net8-p1">
<Uri>https://github.com/xamarin/xamarin-macios</Uri>
<Sha>df0151d09a23a1630022ad653036d11ce4b396b8</Sha>
<Sha>6b1b9f3666c644af0560770bd02de9d455fdbc4c</Sha>
</Dependency>
<Dependency Name="Microsoft.macOS.Sdk" Version="13.0.1140-net8-p1">
<Dependency Name="Microsoft.macOS.Sdk" Version="13.1.126-net8-p1">
<Uri>https://github.com/xamarin/xamarin-macios</Uri>
<Sha>df0151d09a23a1630022ad653036d11ce4b396b8</Sha>
<Sha>6b1b9f3666c644af0560770bd02de9d455fdbc4c</Sha>
</Dependency>
<Dependency Name="Microsoft.iOS.Sdk" Version="16.1.585-net8-p1">
<Dependency Name="Microsoft.iOS.Sdk" Version="16.2.126-net8-p1">
<Uri>https://github.com/xamarin/xamarin-macios</Uri>
<Sha>df0151d09a23a1630022ad653036d11ce4b396b8</Sha>
<Sha>6b1b9f3666c644af0560770bd02de9d455fdbc4c</Sha>
</Dependency>
<Dependency Name="Microsoft.tvOS.Sdk" Version="16.1.585-net8-p1">
<Dependency Name="Microsoft.tvOS.Sdk" Version="16.1.914-net8-p1">
<Uri>https://github.com/xamarin/xamarin-macios</Uri>
<Sha>df0151d09a23a1630022ad653036d11ce4b396b8</Sha>
<Sha>6b1b9f3666c644af0560770bd02de9d455fdbc4c</Sha>
</Dependency>
<Dependency Name="Microsoft.NET.Workload.Emscripten.net7.Manifest-8.0.100" Version="8.0.0-alpha.1.22510.1" CoherentParentDependency="Microsoft.NETCore.App.Ref">
<Dependency Name="Microsoft.NET.Workload.Emscripten.net7.Manifest-8.0.100" Version="8.0.0-alpha.1.22620.1" CoherentParentDependency="Microsoft.NETCore.App.Ref">
<Uri>https://github.com/dotnet/emsdk</Uri>
<Sha>aecb1c71c70f6db44035602a879c57fa495d37e8</Sha>
<Sha>66b984594a008151bdb14dc60589373e3d44be83</Sha>
</Dependency>
<Dependency Name="Microsoft.WindowsAppSDK" Version="0.0.1">
<Uri>https://dev.azure.com/microsoft/ProjectReunion/_git/ProjectReunionInternal</Uri>
Expand Down
18 changes: 9 additions & 9 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,24 @@
<!-- Current previous .NET SDK major version's stable release of MAUI packages -->
<MicrosoftMauiPreviousDotNetReleasedVersion>6.0.547</MicrosoftMauiPreviousDotNetReleasedVersion>
<!-- dotnet/installer -->
<MicrosoftDotnetSdkInternalPackageVersion>8.0.100-alpha.1.22526.2</MicrosoftDotnetSdkInternalPackageVersion>
<MicrosoftDotnetSdkInternalPackageVersion>8.0.100-alpha.1.23063.11</MicrosoftDotnetSdkInternalPackageVersion>
<!-- dotnet/runtime -->
<MicrosoftNETCoreAppRefPackageVersion>8.0.0-alpha.1.22524.5</MicrosoftNETCoreAppRefPackageVersion>
<MicrosoftNETCoreAppRefPackageVersion>8.0.0-alpha.1.23058.2</MicrosoftNETCoreAppRefPackageVersion>
<!-- NOTE: should eventually revert back to $(MicrosoftNETCoreAppRefPackageVersion) in .NET 7 -->
<MicrosoftExtensionsPackageVersion>7.0.0</MicrosoftExtensionsPackageVersion>
<MicrosoftExtensionsServicingPackageVersion>7.0.0</MicrosoftExtensionsServicingPackageVersion>
<SystemCodeDomPackageVersion>7.0.0</SystemCodeDomPackageVersion>
<!-- xamarin/xamarin-android -->
<MicrosoftAndroidSdkWindowsPackageVersion>34.0.0-preview.1.50</MicrosoftAndroidSdkWindowsPackageVersion>
<MicrosoftAndroidSdkWindowsPackageVersion>34.0.0-preview.1.127</MicrosoftAndroidSdkWindowsPackageVersion>
<!-- xamarin/xamarin-macios -->
<MicrosoftMacCatalystSdkPackageVersion>16.1.585-net8-p1</MicrosoftMacCatalystSdkPackageVersion>
<MicrosoftmacOSSdkPackageVersion>13.0.1140-net8-p1</MicrosoftmacOSSdkPackageVersion>
<MicrosoftiOSSdkPackageVersion>16.1.585-net8-p1</MicrosoftiOSSdkPackageVersion>
<MicrosofttvOSSdkPackageVersion>16.1.585-net8-p1</MicrosofttvOSSdkPackageVersion>
<MicrosoftMacCatalystSdkPackageVersion>16.2.126-net8-p1</MicrosoftMacCatalystSdkPackageVersion>
<MicrosoftmacOSSdkPackageVersion>13.1.126-net8-p1</MicrosoftmacOSSdkPackageVersion>
<MicrosoftiOSSdkPackageVersion>16.2.126-net8-p1</MicrosoftiOSSdkPackageVersion>
<MicrosofttvOSSdkPackageVersion>16.1.914-net8-p1</MicrosofttvOSSdkPackageVersion>
<!-- Samsung/Tizen.NET -->
<SamsungTizenSdkPackageVersion>7.0.104</SamsungTizenSdkPackageVersion>
<!-- emsdk -->
<MicrosoftNETWorkloadEmscriptennet7Manifest80100PackageVersion>8.0.0-alpha.1.22510.1</MicrosoftNETWorkloadEmscriptennet7Manifest80100PackageVersion>
<MicrosoftNETWorkloadEmscriptennet7Manifest80100PackageVersion>8.0.0-alpha.1.22620.1</MicrosoftNETWorkloadEmscriptennet7Manifest80100PackageVersion>
<MicrosoftNETWorkloadEmscriptenPackageVersion>$(MicrosoftNETWorkloadEmscriptennet7Manifest80100PackageVersion)</MicrosoftNETWorkloadEmscriptenPackageVersion>
<!-- wasdk -->
<MicrosoftWindowsAppSDKPackageVersion>1.2.221209.1</MicrosoftWindowsAppSDKPackageVersion>
Expand All @@ -39,7 +39,7 @@
<MicrosoftAspNetCoreMetadataPackageVersion>7.0.1</MicrosoftAspNetCoreMetadataPackageVersion>
<MicrosoftJSInteropPackageVersion>7.0.2</MicrosoftJSInteropPackageVersion>
<!-- Other packages -->
<MicrosoftCodeAnalysisNetAnalyzersVersion>7.0.0</MicrosoftCodeAnalysisNetAnalyzersVersion>
<MicrosoftCodeAnalysisNetAnalyzersVersion>8.0.0-preview1.23067.2</MicrosoftCodeAnalysisNetAnalyzersVersion>
<MicrosoftCodeAnalysisPublicApiAnalyzersVersion>3.3.3</MicrosoftCodeAnalysisPublicApiAnalyzersVersion>
<MicrosoftCodeAnalysisBannedApiAnalyzersVersion>3.3.3</MicrosoftCodeAnalysisBannedApiAnalyzersVersion>
<SystemNumericsVectorsVersion>4.5.0</SystemNumericsVectorsVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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!
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 0 additions & 6 deletions src/Compatibility/Core/src/Android/Forms.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand All @@ -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);
}

Expand Down
3 changes: 2 additions & 1 deletion src/Compatibility/Core/src/Android/Renderers/PageRenderer.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using Android.Content;
Expand Down Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using Android.Content;
Expand Down Expand Up @@ -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);
}
Expand Down
87 changes: 0 additions & 87 deletions src/Compatibility/Core/src/Android/Resource.designer.cs

This file was deleted.

2 changes: 1 addition & 1 deletion src/Compatibility/Core/src/Compatibility.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<WindowsRoot>Windows\</WindowsRoot>
<TizenRoot>Tizen\</TizenRoot>
<IsPackable>false</IsPackable>
<IsTrimmable>true</IsTrimmable>
<IsTrimmable Condition=" !$(TargetFramework.StartsWith('netstandard')) ">true</IsTrimmable>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<NoWarn>$(NoWarn);CS1591</NoWarn>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
#nullable enable
Microsoft.Maui.Controls.Maps.Resource
Microsoft.Maui.Controls.Maps.Resource.Resource() -> void
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand All @@ -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);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
});
}

Expand Down
2 changes: 2 additions & 0 deletions src/Controls/src/Core/Platform/Android/ImeActionExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Loading

0 comments on commit eea6fea

Please sign in to comment.