MAUI Extension Continued (#754)
Adds Xamarin Project Component Identifier, maui targetframework filter, maui tfm filter tests, package maps for Droid and iOS, End to end tests and restore tool script for pipeline to install maui-workloads
|
@ -170,6 +170,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "windows", "windows", "{98B5
|
|||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.DotNet.UpgradeAssistant.Extensions.Windows.Tests", "tests\extensions\windows\Microsoft.DotNet.UpgradeAssistant.Extensions.Windows.Tests.csproj", "{025C3A17-0FBB-4B5E-9386-6A5E979FAA56}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "maui", "maui", "{7304F25F-0F4D-450F-A529-3C7AFE9D98CA}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.DotNet.UpgradeAssistant.Extensions.Maui.Tests", "tests\extensions\maui\Microsoft.DotNet.UpgradeAssistant.Extensions.Maui.Tests\Microsoft.DotNet.UpgradeAssistant.Extensions.Maui.Tests.csproj", "{CEDAAB8D-613C-4A3F-8114-7D6B480F1EE3}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
|
@ -732,6 +736,18 @@ Global
|
|||
{025C3A17-0FBB-4B5E-9386-6A5E979FAA56}.Release|x64.Build.0 = Release|Any CPU
|
||||
{025C3A17-0FBB-4B5E-9386-6A5E979FAA56}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{025C3A17-0FBB-4B5E-9386-6A5E979FAA56}.Release|x86.Build.0 = Release|Any CPU
|
||||
{CEDAAB8D-613C-4A3F-8114-7D6B480F1EE3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{CEDAAB8D-613C-4A3F-8114-7D6B480F1EE3}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{CEDAAB8D-613C-4A3F-8114-7D6B480F1EE3}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{CEDAAB8D-613C-4A3F-8114-7D6B480F1EE3}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{CEDAAB8D-613C-4A3F-8114-7D6B480F1EE3}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{CEDAAB8D-613C-4A3F-8114-7D6B480F1EE3}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{CEDAAB8D-613C-4A3F-8114-7D6B480F1EE3}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{CEDAAB8D-613C-4A3F-8114-7D6B480F1EE3}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{CEDAAB8D-613C-4A3F-8114-7D6B480F1EE3}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{CEDAAB8D-613C-4A3F-8114-7D6B480F1EE3}.Release|x64.Build.0 = Release|Any CPU
|
||||
{CEDAAB8D-613C-4A3F-8114-7D6B480F1EE3}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{CEDAAB8D-613C-4A3F-8114-7D6B480F1EE3}.Release|x86.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
@ -804,6 +820,8 @@ Global
|
|||
{69B55184-9DB6-4492-9501-E54207F4BED7} = {1D8A46E6-D0C5-429A-A7B6-8F1BE9551AD7}
|
||||
{98B57945-2141-4880-B6C2-51B44C67E300} = {82BC0AAB-94CA-4D5B-BF95-F7329D1150CB}
|
||||
{025C3A17-0FBB-4B5E-9386-6A5E979FAA56} = {98B57945-2141-4880-B6C2-51B44C67E300}
|
||||
{7304F25F-0F4D-450F-A529-3C7AFE9D98CA} = {82BC0AAB-94CA-4D5B-BF95-F7329D1150CB}
|
||||
{CEDAAB8D-613C-4A3F-8114-7D6B480F1EE3} = {7304F25F-0F4D-450F-A529-3C7AFE9D98CA}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {D02F665B-C14D-43C2-955C-9338A23836E0}
|
||||
|
|
|
@ -9,6 +9,8 @@
|
|||
<add key="dotnet-tools" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json" />
|
||||
<add key="dotnet-eng" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json" />
|
||||
<add key="vs-buildservices" value="https://pkgs.dev.azure.com/azure-public/vside/_packaging/vs-buildservices/nuget/v3/index.json" />
|
||||
<add key="xamarin-impl" value="https://pkgs.dev.azure.com/azure-public/vside/_packaging/xamarin-impl/nuget/v3/index.json" />
|
||||
<add key="maui-nugets" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/6.0.100-preview.6.21355.2-shipping/nuget/v3/index.json" />
|
||||
</packageSources>
|
||||
<disabledPackageSources>
|
||||
<clear />
|
||||
|
|
|
@ -113,4 +113,4 @@ stages:
|
|||
-TsaIterationPath $(_TsaIterationPath)
|
||||
-TsaRepositoryName "Dotnet-Upgrade-Assistant"
|
||||
-TsaCodebaseName "Dotnet-Upgrade-Assistant"
|
||||
-TsaPublish $True'
|
||||
-TsaPublish $True'
|
|
@ -0,0 +1,12 @@
|
|||
$dotnetRoot = Join-Path $RepoRoot '.dotnet'
|
||||
|
||||
try {
|
||||
dotnet workload install microsoft-android-sdk-full microsoft-ios-sdk-full --verbosity diag --temp-dir $dotnetRoot
|
||||
}
|
||||
catch {
|
||||
Write-Host $_.ScriptStackTrace
|
||||
Write-PipelineTelemetryError -Category 'RestoreToolset' -Message $_
|
||||
ExitWithExitCode 1
|
||||
}
|
||||
|
||||
ExitWithExitCode 0
|
|
@ -1,6 +1,5 @@
|
|||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
|
||||
namespace System
|
||||
{
|
||||
internal static class SR
|
||||
|
@ -8,6 +7,9 @@ namespace System
|
|||
public static string Format(string str, object? arg0)
|
||||
=> string.Format(System.Globalization.CultureInfo.InvariantCulture, str, arg0);
|
||||
|
||||
public static string Format(string str, object? arg0, object? arg1)
|
||||
=> string.Format(System.Globalization.CultureInfo.InvariantCulture, str, arg0, arg1);
|
||||
|
||||
public static string Format(string str, object? arg0, object? arg1, object? arg2)
|
||||
=> string.Format(System.Globalization.CultureInfo.InvariantCulture, str, arg0, arg1, arg2);
|
||||
}
|
||||
|
|
|
@ -15,5 +15,7 @@ namespace Microsoft.DotNet.UpgradeAssistant
|
|||
Wpf = 1 << 3,
|
||||
WinForms = 1 << 4,
|
||||
AspNetCore = 1 << 5,
|
||||
XamarinAndroid = 1 << 6,
|
||||
XamariniOS = 1 << 7,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,6 +30,9 @@ namespace Microsoft.DotNet.UpgradeAssistant
|
|||
public static readonly TargetFrameworkMoniker Net60 = Net50 with { FrameworkVersion = new Version(6, 0) };
|
||||
public static readonly TargetFrameworkMoniker Net60_Linux = Net60 with { Platform = Platforms.Linux };
|
||||
public static readonly TargetFrameworkMoniker Net60_Windows = Net60 with { Platform = Platforms.Windows };
|
||||
public static readonly TargetFrameworkMoniker Net60_Android = Net60 with { Platform = Platforms.Android };
|
||||
public static readonly TargetFrameworkMoniker Net60_iOS = Net60 with { Platform = Platforms.IOS };
|
||||
|
||||
#pragma warning restore CA1707 // Identifiers should not contain underscores
|
||||
|
||||
#pragma warning disable CA1034 // Nested types should not be visible
|
||||
|
@ -45,6 +48,8 @@ namespace Microsoft.DotNet.UpgradeAssistant
|
|||
{
|
||||
public const string Windows = "windows";
|
||||
public const string Linux = "linux";
|
||||
public const string Android = "android";
|
||||
public const string IOS = "ios";
|
||||
}
|
||||
#pragma warning restore CA1034 // Nested types should not be visible
|
||||
|
||||
|
|
|
@ -7,6 +7,10 @@
|
|||
]
|
||||
},
|
||||
|
||||
"PackageUpdater": {
|
||||
"PackageMapPath": "PackageMaps"
|
||||
},
|
||||
|
||||
"ExtensionServiceProviders": [
|
||||
"Microsoft.DotNet.UpgradeAssistant.Extensions.Maui.dll"
|
||||
]
|
||||
|
|
|
@ -0,0 +1,57 @@
|
|||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Microsoft.DotNet.UpgradeAssistant.Extensions.Maui
|
||||
{
|
||||
public class MauiComponentIdentifier : IComponentIdentifier
|
||||
{
|
||||
private readonly string[] _xamarinAndroidReferences = new[] { "Mono.Android" };
|
||||
private readonly string[] _xamariniOSReferences = new[] { "Xamarin.iOS" };
|
||||
private readonly string[] _androidTFM = new[] { TargetFrameworkMoniker.Net60_Android.ToString() };
|
||||
private readonly string[] _iosTFM = new[] { TargetFrameworkMoniker.Net60_iOS.ToString() };
|
||||
|
||||
public ValueTask<ProjectComponents> GetComponentsAsync(IProject project, CancellationToken token)
|
||||
{
|
||||
if (project is null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(project));
|
||||
}
|
||||
|
||||
var file = project.GetFile();
|
||||
var components = ProjectComponents.None;
|
||||
|
||||
var references = project.References.Select(r => r.Name);
|
||||
|
||||
if (references.Any(r => _xamarinAndroidReferences.Contains(r, StringComparer.OrdinalIgnoreCase)))
|
||||
{
|
||||
components |= ProjectComponents.XamarinAndroid;
|
||||
}
|
||||
|
||||
if (references.Any(r => _xamariniOSReferences.Contains(r, StringComparer.OrdinalIgnoreCase)))
|
||||
{
|
||||
components |= ProjectComponents.XamariniOS;
|
||||
}
|
||||
|
||||
var targetFrameworkNames = project.TargetFrameworks.Select(r => r.Name);
|
||||
|
||||
if (targetFrameworkNames.Any(r => _androidTFM.Contains(r, StringComparer.OrdinalIgnoreCase)))
|
||||
{
|
||||
components |= ProjectComponents.XamarinAndroid;
|
||||
}
|
||||
|
||||
if (targetFrameworkNames.Any(r => _iosTFM.Contains(r, StringComparer.OrdinalIgnoreCase)))
|
||||
{
|
||||
components |= ProjectComponents.XamariniOS;
|
||||
}
|
||||
|
||||
return new ValueTask<ProjectComponents>(components);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,135 @@
|
|||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace Microsoft.DotNet.UpgradeAssistant.Extensions.Maui
|
||||
{
|
||||
public class MauiPlatformTargetFrameworkUpgradeStep : UpgradeStep
|
||||
{
|
||||
private readonly ITargetFrameworkSelector _tfmSelector;
|
||||
|
||||
public override string Title => "Add TargetFramework for .NET MAUI Project";
|
||||
|
||||
public override string Description => "Add Platform TargetFramework for XamarinForms projects being converted";
|
||||
|
||||
public MauiPlatformTargetFrameworkUpgradeStep(ITargetFrameworkSelector tfmSelector, ILogger<MauiPlatformTargetFrameworkUpgradeStep> logger)
|
||||
: base(logger)
|
||||
{
|
||||
_tfmSelector = tfmSelector;
|
||||
}
|
||||
|
||||
public override IEnumerable<string> DependsOn { get; } = new[]
|
||||
{
|
||||
WellKnownStepIds.BackupStepId,
|
||||
WellKnownStepIds.TryConvertProjectConverterStepId,
|
||||
};
|
||||
|
||||
public override IEnumerable<string> DependencyOf { get; } = new[]
|
||||
{
|
||||
WellKnownStepIds.NextProjectStepId,
|
||||
WellKnownStepIds.SetTFMStepId,
|
||||
};
|
||||
|
||||
protected override async Task<UpgradeStepApplyResult> ApplyImplAsync(IUpgradeContext context, CancellationToken token)
|
||||
{
|
||||
if (context is null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(context));
|
||||
}
|
||||
|
||||
var componentFlagProperty = context.Properties.GetPropertyValue("componentFlag");
|
||||
if (componentFlagProperty is null)
|
||||
{
|
||||
return new UpgradeStepApplyResult(UpgradeStepStatus.Failed, $"componentFlag Context property was null.");
|
||||
}
|
||||
|
||||
var targetTfm = GetExpectedTargetFramework(componentFlagProperty);
|
||||
|
||||
var project = context.CurrentProject.Required();
|
||||
var file = project.GetFile();
|
||||
|
||||
file.SetTFM(targetTfm);
|
||||
|
||||
await file.SaveAsync(token).ConfigureAwait(false);
|
||||
|
||||
Logger.LogInformation("Added TFM to {TargetTFM}", targetTfm);
|
||||
return new UpgradeStepApplyResult(UpgradeStepStatus.Complete, $"Added TFM {targetTfm} to MAUI project ");
|
||||
}
|
||||
|
||||
protected override Task<UpgradeStepInitializeResult> InitializeImplAsync(IUpgradeContext context, CancellationToken token)
|
||||
{
|
||||
if (context is null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(context));
|
||||
}
|
||||
|
||||
var project = context.CurrentProject.Required();
|
||||
|
||||
var componentFlagProperty = context.Properties.GetPropertyValue("componentFlag");
|
||||
if (componentFlagProperty is null)
|
||||
{
|
||||
return Task.FromResult(new UpgradeStepInitializeResult(UpgradeStepStatus.Incomplete, "componentFlag Property in Context was null", BuildBreakRisk.High));
|
||||
}
|
||||
|
||||
var targetTfm = GetExpectedTargetFramework(componentFlagProperty);
|
||||
|
||||
if (project.TargetFrameworks.Any(tfm => tfm == targetTfm))
|
||||
{
|
||||
return Task.FromResult(new UpgradeStepInitializeResult(UpgradeStepStatus.Complete, "TFM is already set to target value.", BuildBreakRisk.None));
|
||||
}
|
||||
else
|
||||
{
|
||||
Logger.LogInformation("TFM needs updated to {TargetTFM}", targetTfm);
|
||||
return Task.FromResult(new UpgradeStepInitializeResult(UpgradeStepStatus.Incomplete, $"TFM needs to be updated to {targetTfm}", BuildBreakRisk.High));
|
||||
}
|
||||
}
|
||||
|
||||
private static TargetFrameworkMoniker GetExpectedTargetFramework(string componentFlagProperty)
|
||||
{
|
||||
var propertyValue = Enum.Parse(typeof(ProjectComponents), componentFlagProperty);
|
||||
if (ProjectComponents.XamarinAndroid.CompareTo(propertyValue) == 0)
|
||||
{
|
||||
return TargetFrameworkMoniker.Net60_Android;
|
||||
}
|
||||
else
|
||||
{
|
||||
return TargetFrameworkMoniker.Net60_iOS;
|
||||
}
|
||||
}
|
||||
|
||||
protected override async Task<bool> IsApplicableImplAsync(IUpgradeContext context, CancellationToken token)
|
||||
{
|
||||
if (context is null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (context.CurrentProject is null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var project = context.CurrentProject.Required();
|
||||
|
||||
var components = await project.GetComponentsAsync(token).ConfigureAwait(false);
|
||||
|
||||
if (components.HasFlag(ProjectComponents.XamarinAndroid) || components.HasFlag(ProjectComponents.XamariniOS))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(context.Properties.GetPropertyValue("componentFlag")))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -2,6 +2,7 @@
|
|||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
|
||||
using System;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace Microsoft.DotNet.UpgradeAssistant.Extensions.Maui
|
||||
{
|
||||
|
@ -13,6 +14,11 @@ namespace Microsoft.DotNet.UpgradeAssistant.Extensions.Maui
|
|||
{
|
||||
throw new ArgumentNullException(nameof(services));
|
||||
}
|
||||
|
||||
services.Services.AddTransient<IUpgradeReadyCheck, XamarinFormsCheck>();
|
||||
services.Services.AddTransient<ITargetFrameworkSelectorFilter, MauiTargetFrameworkSelectorFilter>();
|
||||
services.Services.AddTransient<IComponentIdentifier, MauiComponentIdentifier>();
|
||||
services.Services.AddUpgradeStep<MauiPlatformTargetFrameworkUpgradeStep>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,40 @@
|
|||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace Microsoft.DotNet.UpgradeAssistant.Extensions.Maui
|
||||
{
|
||||
public class MauiTargetFrameworkSelectorFilter : ITargetFrameworkSelectorFilter
|
||||
{
|
||||
private readonly ILogger<MauiTargetFrameworkSelectorFilter> _logger;
|
||||
|
||||
public MauiTargetFrameworkSelectorFilter(ILogger<MauiTargetFrameworkSelectorFilter> logger)
|
||||
{
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public void Process(ITargetFrameworkSelectorFilterState tfm)
|
||||
{
|
||||
if (tfm is null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(tfm));
|
||||
}
|
||||
|
||||
if (tfm.Components.HasFlag(ProjectComponents.XamarinAndroid))
|
||||
{
|
||||
_logger.LogInformation("Project {Name} is of type Xamarin.Android, migration to .NET MAUI requires to be least net6.0-android.", tfm.Project);
|
||||
tfm.TryUpdate(TargetFrameworkMoniker.Net60_Android);
|
||||
}
|
||||
|
||||
if (tfm.Components.HasFlag(ProjectComponents.XamariniOS))
|
||||
{
|
||||
_logger.LogInformation("Project {Name} is of type Xamarin.iOS, migration to .NET MAUI requires to be least net6.0-ios.", tfm.Project);
|
||||
tfm.TryUpdate(TargetFrameworkMoniker.Net60_iOS);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -13,9 +13,15 @@
|
|||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="ExtensionManifest.json">
|
||||
|
||||
<Content Include="ExtensionManifest.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</Content>
|
||||
|
||||
<Content Include="PackageMaps\*.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
|
@ -0,0 +1,308 @@
|
|||
[
|
||||
{
|
||||
"PackageSetName": "Xamarin Packages",
|
||||
"NetFrameworkPackages": [
|
||||
{
|
||||
"Name": "Xamarin.Forms",
|
||||
"Version": "*"
|
||||
},
|
||||
{
|
||||
"Name": "Xamarin.Essentials",
|
||||
"Version": "*"
|
||||
}
|
||||
],
|
||||
"NetCorePackages": []
|
||||
},
|
||||
{
|
||||
"PackageSetName": "Xamarin.Android Support Packages",
|
||||
"NetFrameworkPackages": [
|
||||
{
|
||||
"Name": "Xamarin.Android.Support.Compat",
|
||||
"Version": "*"
|
||||
},
|
||||
{
|
||||
"Name": "Xamarin.Android.Support.Annotations",
|
||||
"Version": "*"
|
||||
},
|
||||
{
|
||||
"Name": "Xamarin.Android.Support.Core.Utils",
|
||||
"Version": "*"
|
||||
},
|
||||
{
|
||||
"Name": "Xamarin.Android.Support.Fragment",
|
||||
"Version": "*"
|
||||
},
|
||||
{
|
||||
"Name": "Xamarin.Android.Support.v4",
|
||||
"Version": "*"
|
||||
},
|
||||
{
|
||||
"Name": "Xamarin.Android.Support.Design",
|
||||
"Version": "*"
|
||||
},
|
||||
{
|
||||
"Name": "Xamarin.Android.Support.Media.Compat",
|
||||
"Version": "*"
|
||||
},
|
||||
{
|
||||
"Name": "Xamarin.Android.Support.Core.UI",
|
||||
"Version": "*"
|
||||
},
|
||||
{
|
||||
"Name": "Xamarin.Android.Support.Vector.Drawable",
|
||||
"Version": "*"
|
||||
},
|
||||
{
|
||||
"Name": "Xamarin.Android.Support.v7.AppCompat ",
|
||||
"Version": "*"
|
||||
},
|
||||
{
|
||||
"Name": "Xamarin.Android.Support.Animated.Vector.Drawable",
|
||||
"Version": "*"
|
||||
},
|
||||
{
|
||||
"Name": "Xamarin.Android.Support.v7.RecyclerView",
|
||||
"Version": "*"
|
||||
},
|
||||
{
|
||||
"Name": "Xamarin.Android.Support.Transition",
|
||||
"Version": "*"
|
||||
},
|
||||
{
|
||||
"Name": "Xamarin.Android.Support.v7.CardView",
|
||||
"Version": "*"
|
||||
},
|
||||
{
|
||||
"Name": "Xamarin.Android.Support.v7.MediaRouter",
|
||||
"Version": "*"
|
||||
},
|
||||
{
|
||||
"Name": "Xamarin.Android.Support.Interpolator",
|
||||
"Version": "*"
|
||||
},
|
||||
{
|
||||
"Name": "Xamarin.Android.Support.Collections",
|
||||
"Version": "*"
|
||||
},
|
||||
{
|
||||
"Name": "Xamarin.Android.Support.CustomTabs",
|
||||
"Version": "*"
|
||||
},
|
||||
{
|
||||
"Name": "Xamarin.Android.Support.Loader",
|
||||
"Version": "*"
|
||||
},
|
||||
{
|
||||
"Name": "Xamarin.Android.Support.Print",
|
||||
"Version": "*"
|
||||
},
|
||||
{
|
||||
"Name": "Xamarin.Android.Support.DocumentFile",
|
||||
"Version": "*"
|
||||
},
|
||||
{
|
||||
"Name": "Xamarin.Android.Support.CursorAdapter",
|
||||
"Version": "*"
|
||||
},
|
||||
{
|
||||
"Name": "Xamarin.Android.Support.v7.Palette",
|
||||
"Version": "*"
|
||||
},
|
||||
{
|
||||
"Name": "Xamarin.Android.Support.ViewPager",
|
||||
"Version": "*"
|
||||
},
|
||||
{
|
||||
"Name": "Xamarin.Android.Support.VersionedParcelable",
|
||||
"Version": "*"
|
||||
},
|
||||
{
|
||||
"Name": "Xamarin.Android.Support.CustomView",
|
||||
"Version": "*"
|
||||
},
|
||||
{
|
||||
"Name": "Xamarin.Android.Support.DrawerLayout",
|
||||
"Version": "*"
|
||||
},
|
||||
{
|
||||
"Name": "Xamarin.Android.Support.CoordinaterLayout",
|
||||
"Version": "*"
|
||||
},
|
||||
{
|
||||
"Name": "Xamarin.Android.Support.LocalBroadcastManager",
|
||||
"Version": "*"
|
||||
},
|
||||
{
|
||||
"Name": "Xamarin.Android.Support.SlidingPaneLayout",
|
||||
"Version": "*"
|
||||
},
|
||||
{
|
||||
"Name": "Xamarin.Android.Support.SwipeRefreshLayout",
|
||||
"Version": "*"
|
||||
},
|
||||
{
|
||||
"Name": "Xamarin.Android.Support.AsyncLayoutInflater",
|
||||
"Version": "*"
|
||||
},
|
||||
{
|
||||
"Name": "Xamarin.Android.Support.Exif",
|
||||
"Version": "*"
|
||||
},
|
||||
{
|
||||
"Name": "Xamarin.Android.Support.v13",
|
||||
"Version": "*"
|
||||
},
|
||||
{
|
||||
"Name": "Xamarin.Android.Support.Constraint.Layout",
|
||||
"Version": "*"
|
||||
},
|
||||
{
|
||||
"Name": "Xamarin.Android.Support.Percent",
|
||||
"Version": "*"
|
||||
},
|
||||
{
|
||||
"Name": "Xamarin.Android.Support.Constraint.Layout.Solver",
|
||||
"Version": "*"
|
||||
},
|
||||
{
|
||||
"Name": "Xamarin.Android.Support.v17.Leanback",
|
||||
"Version": "*"
|
||||
},
|
||||
{
|
||||
"Name": "Xamarin.Android.Support.v7.GridLayout",
|
||||
"Version": "*"
|
||||
},
|
||||
{
|
||||
"Name": "Xamarin.Android.Support.v7.Preference",
|
||||
"Version": "*"
|
||||
},
|
||||
{
|
||||
"Name": "Xamarin.Android.Support.v14.Preference",
|
||||
"Version": "*"
|
||||
},
|
||||
{
|
||||
"Name": "Xamarin.Android.Support.v8.RenderScript",
|
||||
"Version": "*"
|
||||
},
|
||||
{
|
||||
"Name": "Xamarin.Android.Support.Emoji",
|
||||
"Version": "*"
|
||||
},
|
||||
{
|
||||
"Name": "Xamarin.Android.Support.v17.Preference.Leanback",
|
||||
"Version": "*"
|
||||
},
|
||||
{
|
||||
"Name": "Xamarin.Android.Support.Emoji.AppCompat",
|
||||
"Version": "*"
|
||||
},
|
||||
{
|
||||
"Name": "Xamarin.Android.Support.Wear",
|
||||
"Version": "*"
|
||||
},
|
||||
{
|
||||
"Name": "Xamarin.Android.Support.Emoji.Bundled",
|
||||
"Version": "*"
|
||||
},
|
||||
{
|
||||
"Name": "Xamarin.Android.Support.TV.Provider",
|
||||
"Version": "*"
|
||||
},
|
||||
{
|
||||
"Name": "Xamarin.Android.Support.Slices.Core",
|
||||
"Version": "*"
|
||||
},
|
||||
{
|
||||
"Name": "Xamarin.Android.Support.Slices.Builders",
|
||||
"Version": "*"
|
||||
},
|
||||
{
|
||||
"Name": "Xamarin.Android.Support.Slices.View",
|
||||
"Version": "*"
|
||||
},
|
||||
{
|
||||
"Name": "Xamarin.Android.Support.HeifWriter",
|
||||
"Version": "*"
|
||||
},
|
||||
{
|
||||
"Name": "Xamarin.Android.Support.WebKit",
|
||||
"Version": "*"
|
||||
},
|
||||
{
|
||||
"Name": "Xamarin.Android.Support.Content",
|
||||
"Version": "*"
|
||||
},
|
||||
{
|
||||
"Name": "Xamarin.Android.Support.Wearable",
|
||||
"Version": "*"
|
||||
},
|
||||
{
|
||||
"Name": "Xamarin.Android.Support.InstantVideo",
|
||||
"Version": "*"
|
||||
}
|
||||
],
|
||||
"NetCorePackages": []
|
||||
},
|
||||
{
|
||||
"PackageSetName": "Xamarin.Android Arch Packages",
|
||||
"NetFrameworkPackages": [
|
||||
{
|
||||
"Name": "Xamarin.Android.Arch.Core.Common",
|
||||
"Version": "*"
|
||||
},
|
||||
{
|
||||
"Name": "Xamarin.Android.Arch.Lifecycle.Common",
|
||||
"Version": "*"
|
||||
},
|
||||
{
|
||||
"Name": "Xamarin.Android.Arch.Lifecycle.Runtime",
|
||||
"Version": "*"
|
||||
},
|
||||
{
|
||||
"Name": "Xamarin.Android.Arch.Core.Runtime",
|
||||
"Version": "*"
|
||||
},
|
||||
{
|
||||
"Name": "Xamarin.Android.Arch.Lifecycle.LiveData",
|
||||
"Version": "*"
|
||||
},
|
||||
{
|
||||
"Name": "Xamarin.Android.Arch.Lifecycle.ViewModel",
|
||||
"Version": "*"
|
||||
},
|
||||
{
|
||||
"Name": "Xamarin.Android.Arch.Lifecycle.LiveData.Core",
|
||||
"Version": "*"
|
||||
},
|
||||
{
|
||||
"Name": "Xamarin.Android.Arch.Lifecycle.Extensions ",
|
||||
"Version": "*"
|
||||
},
|
||||
{
|
||||
"Name": "Xamarin.Android.Arch.Work.Runtime",
|
||||
"Version": "*"
|
||||
},
|
||||
{
|
||||
"Name": "Xamarin.Android.Arch.Persistence.Db",
|
||||
"Version": "*"
|
||||
},
|
||||
{
|
||||
"Name": "Xamarin.Android.Arch.Persistence.Room.Common",
|
||||
"Version": "*"
|
||||
},
|
||||
{
|
||||
"Name": "Xamarin.Android.Arch.Persistence.Room.Runtime",
|
||||
"Version": "*"
|
||||
},
|
||||
{
|
||||
"Name": "Xamarin.Android.Arch.Persistence.Db.Framework",
|
||||
"Version": "*"
|
||||
},
|
||||
{
|
||||
"Name": "Xamarin.Android.Support.Dynamic.Animation",
|
||||
"Version": "*"
|
||||
}
|
||||
],
|
||||
"NetCorePackages": []
|
||||
}
|
||||
]
|
|
@ -0,0 +1,81 @@
|
|||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace Microsoft.DotNet.UpgradeAssistant.Extensions.Maui
|
||||
{
|
||||
/// <summary>
|
||||
/// Users using Xamarin.Forms lower than version 4.8 should be informed to update to a higher version
|
||||
/// before they run this tool.
|
||||
/// </summary>
|
||||
public class XamarinFormsCheck : IUpgradeReadyCheck
|
||||
{
|
||||
private const string CATEGORY = ".NET MAUI Upgrade";
|
||||
private const string UPGRADE_LINK = "https://aka.ms/upgradeassistant/maui/requirements";
|
||||
private const string XAMARIN_FORMS_MESSAGE = "Support for {0} is limited to Xamarin.Forms version 4.8 or higher. To learn more please read: {1}";
|
||||
private const string MINIMUM_XAMARIN_VERSION = "4.8";
|
||||
|
||||
private readonly ILogger<XamarinFormsCheck> _logger;
|
||||
private readonly IVersionComparer _comparer;
|
||||
|
||||
public XamarinFormsCheck(IVersionComparer comparer, ILogger<XamarinFormsCheck> logger)
|
||||
{
|
||||
_comparer = comparer ?? throw new ArgumentNullException(nameof(comparer));
|
||||
_logger = logger ?? throw new ArgumentNullException(nameof(logger));
|
||||
}
|
||||
|
||||
public string Id => "Xamarin.Forms minimum version check";
|
||||
|
||||
public string UpgradeMessage => SR.Format(XAMARIN_FORMS_MESSAGE, CATEGORY, UPGRADE_LINK);
|
||||
|
||||
public async Task<UpgradeReadiness> IsReadyAsync(IProject project, UpgradeReadinessOptions options, CancellationToken token)
|
||||
{
|
||||
if (project is null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(project));
|
||||
}
|
||||
|
||||
if (options is null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(options));
|
||||
}
|
||||
|
||||
var components = await project.GetComponentsAsync(token).ConfigureAwait(false);
|
||||
if (components.HasFlag(ProjectComponents.XamarinAndroid) || components.HasFlag(ProjectComponents.XamariniOS))
|
||||
{
|
||||
if (!DoesHaveMinimumXamarinVersion(project, _comparer))
|
||||
{
|
||||
_logger.LogError(XAMARIN_FORMS_MESSAGE, CATEGORY, UPGRADE_LINK);
|
||||
return UpgradeReadiness.Unsupported;
|
||||
}
|
||||
}
|
||||
|
||||
return UpgradeReadiness.Ready;
|
||||
}
|
||||
|
||||
private static bool DoesHaveMinimumXamarinVersion(IProject project, IVersionComparer comparer)
|
||||
{
|
||||
var packageReferences = project.NuGetReferences.PackageReferences;
|
||||
|
||||
foreach (var package in packageReferences)
|
||||
{
|
||||
if (package.Name == "Xamarin.Forms")
|
||||
{
|
||||
if (comparer.Compare(package.Version, MINIMUM_XAMARIN_VERSION) > 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -54,6 +54,13 @@ namespace Microsoft.DotNet.UpgradeAssistant.Steps.ProjectFormat
|
|||
throw new ArgumentNullException(nameof(context));
|
||||
}
|
||||
|
||||
var project = context.CurrentProject.Required();
|
||||
var components = await project.GetComponentsAsync(token).ConfigureAwait(false);
|
||||
if (components.HasFlag(ProjectComponents.XamarinAndroid) || components.HasFlag(ProjectComponents.XamariniOS))
|
||||
{
|
||||
context.Properties.SetPropertyValue("componentFlag", components.ToString(), true);
|
||||
}
|
||||
|
||||
var result = await RunTryConvertAsync(context, context.CurrentProject.Required(), token).ConfigureAwait(false);
|
||||
|
||||
await _restorer.RestorePackagesAsync(context, context.CurrentProject.Required(), token).ConfigureAwait(false);
|
||||
|
|
|
@ -35,6 +35,8 @@ namespace Microsoft.DotNet.UpgradeAssistant
|
|||
public const string Net60_Windows_10_0_5 = "net6.0-windows10.0.5";
|
||||
public const string Net60_Windows_10_1_5 = "net6.0-windows10.1.5";
|
||||
public const string Net60_Windows_10_0_19041_0 = "net6.0-windows10.0.19041.0";
|
||||
public const string Net60_Android = "net6.0-android";
|
||||
public const string Net60_iOS = "net6.0-ios";
|
||||
|
||||
public const string Current = Net50;
|
||||
public const string Preview = Net60;
|
||||
|
@ -68,6 +70,8 @@ namespace Microsoft.DotNet.UpgradeAssistant
|
|||
{ Net60_Windows_10_0_5, TargetFrameworkMoniker.Net60_Windows with { PlatformVersion = new Version(10, 0, 5) } },
|
||||
{ Net60_Windows_10_1_5, TargetFrameworkMoniker.Net60_Windows with { PlatformVersion = new Version(10, 1, 5) } },
|
||||
{ Net60_Windows_10_0_19041_0, TargetFrameworkMoniker.Net60_Windows with { PlatformVersion = new Version(10, 0, 19041, 0) } },
|
||||
{ Net60_Android, TargetFrameworkMoniker.Net60_Android },
|
||||
{ Net60_iOS, TargetFrameworkMoniker.Net60_iOS },
|
||||
};
|
||||
|
||||
[return: NotNullIfNotNull("input")]
|
||||
|
|
|
@ -0,0 +1,38 @@
|
|||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
|
||||
using Autofac.Extras.Moq;
|
||||
using AutoFixture;
|
||||
using Moq;
|
||||
using Xunit;
|
||||
using static Microsoft.DotNet.UpgradeAssistant.TargetFrameworkMonikerParser;
|
||||
|
||||
namespace Microsoft.DotNet.UpgradeAssistant.Extensions.Maui.Tests
|
||||
{
|
||||
public class MauiProjectTargetFrameworkSelectorFilterTests
|
||||
{
|
||||
[InlineData(ProjectComponents.XamarinAndroid, Net60_Android, true)]
|
||||
[InlineData(ProjectComponents.XamariniOS, Net60_iOS, true)]
|
||||
[Theory]
|
||||
public void ProcessTests(ProjectComponents components, string expectedTfmString, bool tryUpdate)
|
||||
{
|
||||
// Arrange
|
||||
var fixture = new Fixture();
|
||||
using var mock = AutoMock.GetLoose();
|
||||
|
||||
var expectedTfm = ParseTfm(expectedTfmString);
|
||||
|
||||
var state = new Mock<ITargetFrameworkSelectorFilterState>();
|
||||
state.Setup(s => s.Components).Returns(components);
|
||||
|
||||
var filter = mock.Create<MauiTargetFrameworkSelectorFilter>();
|
||||
|
||||
// Act
|
||||
filter.Process(state.Object);
|
||||
|
||||
// Assert
|
||||
var count = tryUpdate ? Times.Once() : Times.Never();
|
||||
state.Verify(s => s.TryUpdate(expectedTfm), count);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\..\src\extensions\maui\Microsoft.DotNet.UpgradeAssistant.Extensions.Maui\Microsoft.DotNet.UpgradeAssistant.Extensions.Maui.csproj" />
|
||||
<ProjectReference Include="..\..\..\Microsoft.DotNet.UpgradeAssistant.TestHelpers\Microsoft.DotNet.UpgradeAssistant.TestHelpers.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
|
@ -40,6 +40,8 @@ namespace Integration.Tests
|
|||
[InlineData("WebLibrary/csharp", "WebLibrary.csproj", "")]
|
||||
[InlineData("WpfSample/csharp", "BeanTrader.sln", "BeanTraderClient.csproj")]
|
||||
[InlineData("WpfSample/vb", "WpfApp1.sln", "")]
|
||||
[InlineData("MauiSample/droid", "EwDavidForms.sln", "EwDavidForms.Android.csproj")]
|
||||
[InlineData("MauiSample/ios", "EwDavidForms.sln", "EwDavidForms.iOS.csproj")]
|
||||
[Theory]
|
||||
public async Task UpgradeTest(string scenarioPath, string inputFileName, string entrypoint)
|
||||
{
|
||||
|
|
|
@ -0,0 +1,83 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.31320.298
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EwDavidForms.Android", "EwDavidForms\EwDavidForms.Android\EwDavidForms.Android.csproj", "{131C1751-9CFD-4073-8906-235013C96163}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EwDavidForms.iOS", "EwDavidForms\EwDavidForms.iOS\EwDavidForms.iOS.csproj", "{35C28E64-61AE-4542-A38D-EF095D68A656}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EwDavidForms", "EwDavidForms\EwDavidForms\EwDavidForms.csproj", "{B68AA3FC-9536-4BB1-81B5-2C5BD168B967}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Debug|iPhone = Debug|iPhone
|
||||
Debug|iPhoneSimulator = Debug|iPhoneSimulator
|
||||
Release|Any CPU = Release|Any CPU
|
||||
Release|iPhone = Release|iPhone
|
||||
Release|iPhoneSimulator = Release|iPhoneSimulator
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{131C1751-9CFD-4073-8906-235013C96163}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{131C1751-9CFD-4073-8906-235013C96163}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{131C1751-9CFD-4073-8906-235013C96163}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
|
||||
{131C1751-9CFD-4073-8906-235013C96163}.Debug|iPhone.ActiveCfg = Debug|Any CPU
|
||||
{131C1751-9CFD-4073-8906-235013C96163}.Debug|iPhone.Build.0 = Debug|Any CPU
|
||||
{131C1751-9CFD-4073-8906-235013C96163}.Debug|iPhone.Deploy.0 = Debug|Any CPU
|
||||
{131C1751-9CFD-4073-8906-235013C96163}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
|
||||
{131C1751-9CFD-4073-8906-235013C96163}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
|
||||
{131C1751-9CFD-4073-8906-235013C96163}.Debug|iPhoneSimulator.Deploy.0 = Debug|Any CPU
|
||||
{131C1751-9CFD-4073-8906-235013C96163}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{131C1751-9CFD-4073-8906-235013C96163}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{131C1751-9CFD-4073-8906-235013C96163}.Release|Any CPU.Deploy.0 = Release|Any CPU
|
||||
{131C1751-9CFD-4073-8906-235013C96163}.Release|iPhone.ActiveCfg = Release|Any CPU
|
||||
{131C1751-9CFD-4073-8906-235013C96163}.Release|iPhone.Build.0 = Release|Any CPU
|
||||
{131C1751-9CFD-4073-8906-235013C96163}.Release|iPhone.Deploy.0 = Release|Any CPU
|
||||
{131C1751-9CFD-4073-8906-235013C96163}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
|
||||
{131C1751-9CFD-4073-8906-235013C96163}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
|
||||
{131C1751-9CFD-4073-8906-235013C96163}.Release|iPhoneSimulator.Deploy.0 = Release|Any CPU
|
||||
{35C28E64-61AE-4542-A38D-EF095D68A656}.Debug|Any CPU.ActiveCfg = Debug|iPhone
|
||||
{35C28E64-61AE-4542-A38D-EF095D68A656}.Debug|Any CPU.Build.0 = Debug|iPhone
|
||||
{35C28E64-61AE-4542-A38D-EF095D68A656}.Debug|Any CPU.Deploy.0 = Debug|iPhone
|
||||
{35C28E64-61AE-4542-A38D-EF095D68A656}.Debug|iPhone.ActiveCfg = Debug|iPhone
|
||||
{35C28E64-61AE-4542-A38D-EF095D68A656}.Debug|iPhone.Build.0 = Debug|iPhone
|
||||
{35C28E64-61AE-4542-A38D-EF095D68A656}.Debug|iPhone.Deploy.0 = Debug|iPhone
|
||||
{35C28E64-61AE-4542-A38D-EF095D68A656}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator
|
||||
{35C28E64-61AE-4542-A38D-EF095D68A656}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator
|
||||
{35C28E64-61AE-4542-A38D-EF095D68A656}.Debug|iPhoneSimulator.Deploy.0 = Debug|iPhoneSimulator
|
||||
{35C28E64-61AE-4542-A38D-EF095D68A656}.Release|Any CPU.ActiveCfg = Release|iPhoneSimulator
|
||||
{35C28E64-61AE-4542-A38D-EF095D68A656}.Release|Any CPU.Build.0 = Release|iPhoneSimulator
|
||||
{35C28E64-61AE-4542-A38D-EF095D68A656}.Release|Any CPU.Deploy.0 = Release|iPhoneSimulator
|
||||
{35C28E64-61AE-4542-A38D-EF095D68A656}.Release|iPhone.ActiveCfg = Release|iPhone
|
||||
{35C28E64-61AE-4542-A38D-EF095D68A656}.Release|iPhone.Build.0 = Release|iPhone
|
||||
{35C28E64-61AE-4542-A38D-EF095D68A656}.Release|iPhone.Deploy.0 = Release|iPhone
|
||||
{35C28E64-61AE-4542-A38D-EF095D68A656}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator
|
||||
{35C28E64-61AE-4542-A38D-EF095D68A656}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator
|
||||
{35C28E64-61AE-4542-A38D-EF095D68A656}.Release|iPhoneSimulator.Deploy.0 = Release|iPhoneSimulator
|
||||
{B68AA3FC-9536-4BB1-81B5-2C5BD168B967}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{B68AA3FC-9536-4BB1-81B5-2C5BD168B967}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{B68AA3FC-9536-4BB1-81B5-2C5BD168B967}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
|
||||
{B68AA3FC-9536-4BB1-81B5-2C5BD168B967}.Debug|iPhone.ActiveCfg = Debug|Any CPU
|
||||
{B68AA3FC-9536-4BB1-81B5-2C5BD168B967}.Debug|iPhone.Build.0 = Debug|Any CPU
|
||||
{B68AA3FC-9536-4BB1-81B5-2C5BD168B967}.Debug|iPhone.Deploy.0 = Debug|Any CPU
|
||||
{B68AA3FC-9536-4BB1-81B5-2C5BD168B967}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
|
||||
{B68AA3FC-9536-4BB1-81B5-2C5BD168B967}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
|
||||
{B68AA3FC-9536-4BB1-81B5-2C5BD168B967}.Debug|iPhoneSimulator.Deploy.0 = Debug|Any CPU
|
||||
{B68AA3FC-9536-4BB1-81B5-2C5BD168B967}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{B68AA3FC-9536-4BB1-81B5-2C5BD168B967}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{B68AA3FC-9536-4BB1-81B5-2C5BD168B967}.Release|Any CPU.Deploy.0 = Release|Any CPU
|
||||
{B68AA3FC-9536-4BB1-81B5-2C5BD168B967}.Release|iPhone.ActiveCfg = Release|Any CPU
|
||||
{B68AA3FC-9536-4BB1-81B5-2C5BD168B967}.Release|iPhone.Build.0 = Release|Any CPU
|
||||
{B68AA3FC-9536-4BB1-81B5-2C5BD168B967}.Release|iPhone.Deploy.0 = Release|Any CPU
|
||||
{B68AA3FC-9536-4BB1-81B5-2C5BD168B967}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
|
||||
{B68AA3FC-9536-4BB1-81B5-2C5BD168B967}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
|
||||
{B68AA3FC-9536-4BB1-81B5-2C5BD168B967}.Release|iPhoneSimulator.Deploy.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {8D7FCFD4-DB78-4B64-A50F-455B55B4F941}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
|
@ -0,0 +1,19 @@
|
|||
Any raw assets you want to be deployed with your application can be placed in
|
||||
this directory (and child directories) and given a Build Action of "AndroidAsset".
|
||||
|
||||
These files will be deployed with your package and will be accessible using Android's
|
||||
AssetManager, like this:
|
||||
|
||||
public class ReadAsset : Activity
|
||||
{
|
||||
protected override void OnCreate (Bundle bundle)
|
||||
{
|
||||
base.OnCreate (bundle);
|
||||
|
||||
InputStream input = Assets.Open ("my_asset.txt");
|
||||
}
|
||||
}
|
||||
|
||||
Additionally, some Android functions will automatically load asset files:
|
||||
|
||||
Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf");
|
|
@ -0,0 +1,108 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{131C1751-9CFD-4073-8906-235013C96163}</ProjectGuid>
|
||||
<ProjectTypeGuids>{EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<TemplateGuid>{c9e5eea5-ca05-42a1-839b-61506e0a37df}</TemplateGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>EwDavidForms.Droid</RootNamespace>
|
||||
<AssemblyName>EwDavidForms.Android</AssemblyName>
|
||||
<Deterministic>True</Deterministic>
|
||||
<AndroidApplication>True</AndroidApplication>
|
||||
<AndroidResgenFile>Resources\Resource.designer.cs</AndroidResgenFile>
|
||||
<AndroidResgenClass>Resource</AndroidResgenClass>
|
||||
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
|
||||
<MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix>
|
||||
<MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix>
|
||||
<AndroidUseLatestPlatformSdk>false</AndroidUseLatestPlatformSdk>
|
||||
<TargetFrameworkVersion>v11.0</TargetFrameworkVersion>
|
||||
<AndroidEnableSGenConcurrent>true</AndroidEnableSGenConcurrent>
|
||||
<AndroidUseAapt2>true</AndroidUseAapt2>
|
||||
<AndroidHttpClientHandlerType>Xamarin.Android.Net.AndroidClientHandler</AndroidHttpClientHandlerType>
|
||||
<NuGetPackageImportStamp>
|
||||
</NuGetPackageImportStamp>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>portable</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug</OutputPath>
|
||||
<DefineConstants>DEBUG;</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<AndroidLinkMode>None</AndroidLinkMode>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>portable</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release</OutputPath>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<AndroidManagedSymbols>true</AndroidManagedSymbols>
|
||||
<AndroidUseSharedRuntime>false</AndroidUseSharedRuntime>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Mono.Android" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Numerics" />
|
||||
<Reference Include="System.Numerics.Vectors" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AppCenter.Analytics">
|
||||
<Version>4.3.0</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.AppCenter.Crashes">
|
||||
<Version>4.3.0</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Xamarin.CommunityToolkit">
|
||||
<Version>1.2.0</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2012" />
|
||||
<PackageReference Include="Xamarin.Essentials" Version="1.6.1" />
|
||||
<PackageReference Include="Xamarin.Android.Support.Design" Version="27.0.2" />
|
||||
<PackageReference Include="Xamarin.Android.Support.v7.AppCompat" Version="27.0.2" />
|
||||
<PackageReference Include="Xamarin.Android.Support.v4" Version="27.0.2" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="MainActivity.cs" />
|
||||
<Compile Include="Resources\Resource.designer.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Resources\AboutResources.txt" />
|
||||
<None Include="Assets\AboutAssets.txt" />
|
||||
<None Include="Properties\AndroidManifest.xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\values\styles.xml" />
|
||||
<AndroidResource Include="Resources\values\colors.xml" />
|
||||
<AndroidResource Include="Resources\mipmap-anydpi-v26\icon.xml" />
|
||||
<AndroidResource Include="Resources\mipmap-anydpi-v26\icon_round.xml" />
|
||||
<AndroidResource Include="Resources\mipmap-hdpi\icon.png" />
|
||||
<AndroidResource Include="Resources\mipmap-hdpi\launcher_foreground.png" />
|
||||
<AndroidResource Include="Resources\mipmap-mdpi\icon.png" />
|
||||
<AndroidResource Include="Resources\mipmap-mdpi\launcher_foreground.png" />
|
||||
<AndroidResource Include="Resources\mipmap-xhdpi\icon.png" />
|
||||
<AndroidResource Include="Resources\mipmap-xhdpi\launcher_foreground.png" />
|
||||
<AndroidResource Include="Resources\mipmap-xxhdpi\icon.png" />
|
||||
<AndroidResource Include="Resources\mipmap-xxhdpi\launcher_foreground.png" />
|
||||
<AndroidResource Include="Resources\mipmap-xxxhdpi\icon.png" />
|
||||
<AndroidResource Include="Resources\mipmap-xxxhdpi\launcher_foreground.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Resources\drawable\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\EwDavidForms\EwDavidForms.csproj">
|
||||
<Project>{9574F61B-3134-4A20-A45C-45D6989015EB}</Project>
|
||||
<Name>EwDavidForms</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
|
||||
</Project>
|
|
@ -0,0 +1,28 @@
|
|||
using System;
|
||||
|
||||
using Android.App;
|
||||
using Android.Content.PM;
|
||||
using Android.Runtime;
|
||||
using Android.OS;
|
||||
|
||||
namespace EwDavidForms.Droid
|
||||
{
|
||||
[Activity(Label = "EwDavidForms", Icon = "@mipmap/icon", Theme = "@style/MainTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize )]
|
||||
public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
|
||||
{
|
||||
protected override void OnCreate(Bundle savedInstanceState)
|
||||
{
|
||||
base.OnCreate(savedInstanceState);
|
||||
|
||||
Xamarin.Essentials.Platform.Init(this, savedInstanceState);
|
||||
global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
|
||||
LoadApplication(new App());
|
||||
}
|
||||
public override void OnRequestPermissionsResult(int requestCode, string[] permissions, [GeneratedEnum] Android.Content.PM.Permission[] grantResults)
|
||||
{
|
||||
Xamarin.Essentials.Platform.OnRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||
|
||||
base.OnRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="com.companyname.ewdavidforms">
|
||||
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="30" />
|
||||
<application android:label="EwDavidForms.Android" android:theme="@style/MainTheme"></application>
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
</manifest>
|
|
@ -0,0 +1,30 @@
|
|||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using Android.App;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("EwDavidForms.Android")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("EwDavidForms.Android")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2014")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
|
||||
// Add some common permissions, these can be removed if not needed
|
||||
[assembly: UsesPermission(Android.Manifest.Permission.Internet)]
|
||||
[assembly: UsesPermission(Android.Manifest.Permission.WriteExternalStorage)]
|
|
@ -0,0 +1,50 @@
|
|||
Images, layout descriptions, binary blobs and string dictionaries can be included
|
||||
in your application as resource files. Various Android APIs are designed to
|
||||
operate on the resource IDs instead of dealing with images, strings or binary blobs
|
||||
directly.
|
||||
|
||||
For example, a sample Android app that contains a user interface layout (main.xml),
|
||||
an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png)
|
||||
would keep its resources in the "Resources" directory of the application:
|
||||
|
||||
Resources/
|
||||
drawable-hdpi/
|
||||
icon.png
|
||||
|
||||
drawable-ldpi/
|
||||
icon.png
|
||||
|
||||
drawable-mdpi/
|
||||
icon.png
|
||||
|
||||
layout/
|
||||
main.xml
|
||||
|
||||
values/
|
||||
strings.xml
|
||||
|
||||
In order to get the build system to recognize Android resources, set the build action to
|
||||
"AndroidResource". The native Android APIs do not operate directly with filenames, but
|
||||
instead operate on resource IDs. When you compile an Android application that uses resources,
|
||||
the build system will package the resources for distribution and generate a class called
|
||||
"Resource" that contains the tokens for each one of the resources included. For example,
|
||||
for the above Resources layout, this is what the Resource class would expose:
|
||||
|
||||
public class Resource {
|
||||
public class drawable {
|
||||
public const int icon = 0x123;
|
||||
}
|
||||
|
||||
public class layout {
|
||||
public const int main = 0x456;
|
||||
}
|
||||
|
||||
public class strings {
|
||||
public const int first_string = 0xabc;
|
||||
public const int second_string = 0xbcd;
|
||||
}
|
||||
}
|
||||
|
||||
You would then use R.drawable.icon to reference the drawable/icon.png file, or Resource.layout.main
|
||||
to reference the layout/main.xml file, or Resource.strings.first_string to reference the first
|
||||
string in the dictionary file values/strings.xml.
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@color/launcher_background" />
|
||||
<foreground android:drawable="@mipmap/launcher_foreground" />
|
||||
</adaptive-icon>
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@color/launcher_background" />
|
||||
<foreground android:drawable="@mipmap/launcher_foreground" />
|
||||
</adaptive-icon>
|
После Ширина: | Высота: | Размер: 4.6 KiB |
После Ширина: | Высота: | Размер: 11 KiB |
После Ширина: | Высота: | Размер: 2.7 KiB |
После Ширина: | Высота: | Размер: 6.3 KiB |
После Ширина: | Высота: | Размер: 6.9 KiB |
После Ширина: | Высота: | Размер: 18 KiB |
После Ширина: | Высота: | Размер: 12 KiB |
После Ширина: | Высота: | Размер: 33 KiB |
После Ширина: | Высота: | Размер: 19 KiB |
После Ширина: | Высота: | Размер: 51 KiB |
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="launcher_background">#FFFFFF</color>
|
||||
<color name="colorPrimary">#3F51B5</color>
|
||||
<color name="colorPrimaryDark">#303F9F</color>
|
||||
<color name="colorAccent">#FF4081</color>
|
||||
</resources>
|
|
@ -0,0 +1,18 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<resources>
|
||||
|
||||
<style name="MainTheme" parent="MainTheme.Base">
|
||||
<!-- As of Xamarin.Forms 4.6 the theme has moved into the Forms binary -->
|
||||
<!-- If you want to override anything you can do that here. -->
|
||||
<!-- Underneath are a couple of entries to get you started. -->
|
||||
|
||||
<!-- Set theme colors from https://aka.ms/material-colors -->
|
||||
<!-- colorPrimary is used for the default action bar background -->
|
||||
<!--<item name="colorPrimary">#2196F3</item>-->
|
||||
<!-- colorPrimaryDark is used for the status bar -->
|
||||
<!--<item name="colorPrimaryDark">#1976D2</item>-->
|
||||
<!-- colorAccent is used as the default value for colorControlActivated
|
||||
which is used to tint widgets -->
|
||||
<!--<item name="colorAccent">#FF4081</item>-->
|
||||
</style>
|
||||
</resources>
|
|
@ -0,0 +1,31 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
using Foundation;
|
||||
using UIKit;
|
||||
|
||||
namespace EwDavidForms.iOS
|
||||
{
|
||||
// The UIApplicationDelegate for the application. This class is responsible for launching the
|
||||
// User Interface of the application, as well as listening (and optionally responding) to
|
||||
// application events from iOS.
|
||||
[Register("AppDelegate")]
|
||||
public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate
|
||||
{
|
||||
//
|
||||
// This method is invoked when the application has loaded and is ready to run. In this
|
||||
// method you should instantiate the window, load the UI into it and then make the window
|
||||
// visible.
|
||||
//
|
||||
// You have 17 seconds to return from this method, or iOS will terminate your application.
|
||||
//
|
||||
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
|
||||
{
|
||||
global::Xamarin.Forms.Forms.Init();
|
||||
LoadApplication(new App());
|
||||
|
||||
return base.FinishedLaunching(app, options);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,117 @@
|
|||
{
|
||||
"images": [
|
||||
{
|
||||
"scale": "2x",
|
||||
"size": "20x20",
|
||||
"idiom": "iphone",
|
||||
"filename": "Icon40.png"
|
||||
},
|
||||
{
|
||||
"scale": "3x",
|
||||
"size": "20x20",
|
||||
"idiom": "iphone",
|
||||
"filename": "Icon60.png"
|
||||
},
|
||||
{
|
||||
"scale": "2x",
|
||||
"size": "29x29",
|
||||
"idiom": "iphone",
|
||||
"filename": "Icon58.png"
|
||||
},
|
||||
{
|
||||
"scale": "3x",
|
||||
"size": "29x29",
|
||||
"idiom": "iphone",
|
||||
"filename": "Icon87.png"
|
||||
},
|
||||
{
|
||||
"scale": "2x",
|
||||
"size": "40x40",
|
||||
"idiom": "iphone",
|
||||
"filename": "Icon80.png"
|
||||
},
|
||||
{
|
||||
"scale": "3x",
|
||||
"size": "40x40",
|
||||
"idiom": "iphone",
|
||||
"filename": "Icon120.png"
|
||||
},
|
||||
{
|
||||
"scale": "2x",
|
||||
"size": "60x60",
|
||||
"idiom": "iphone",
|
||||
"filename": "Icon120.png"
|
||||
},
|
||||
{
|
||||
"scale": "3x",
|
||||
"size": "60x60",
|
||||
"idiom": "iphone",
|
||||
"filename": "Icon180.png"
|
||||
},
|
||||
{
|
||||
"scale": "1x",
|
||||
"size": "20x20",
|
||||
"idiom": "ipad",
|
||||
"filename": "Icon20.png"
|
||||
},
|
||||
{
|
||||
"scale": "2x",
|
||||
"size": "20x20",
|
||||
"idiom": "ipad",
|
||||
"filename": "Icon40.png"
|
||||
},
|
||||
{
|
||||
"scale": "1x",
|
||||
"size": "29x29",
|
||||
"idiom": "ipad",
|
||||
"filename": "Icon29.png"
|
||||
},
|
||||
{
|
||||
"scale": "2x",
|
||||
"size": "29x29",
|
||||
"idiom": "ipad",
|
||||
"filename": "Icon58.png"
|
||||
},
|
||||
{
|
||||
"scale": "1x",
|
||||
"size": "40x40",
|
||||
"idiom": "ipad",
|
||||
"filename": "Icon40.png"
|
||||
},
|
||||
{
|
||||
"scale": "2x",
|
||||
"size": "40x40",
|
||||
"idiom": "ipad",
|
||||
"filename": "Icon80.png"
|
||||
},
|
||||
{
|
||||
"scale": "1x",
|
||||
"size": "76x76",
|
||||
"idiom": "ipad",
|
||||
"filename": "Icon76.png"
|
||||
},
|
||||
{
|
||||
"scale": "2x",
|
||||
"size": "76x76",
|
||||
"idiom": "ipad",
|
||||
"filename": "Icon152.png"
|
||||
},
|
||||
{
|
||||
"scale": "2x",
|
||||
"size": "83.5x83.5",
|
||||
"idiom": "ipad",
|
||||
"filename": "Icon167.png"
|
||||
},
|
||||
{
|
||||
"scale": "1x",
|
||||
"size": "1024x1024",
|
||||
"idiom": "ios-marketing",
|
||||
"filename": "Icon1024.png"
|
||||
}
|
||||
],
|
||||
"properties": {},
|
||||
"info": {
|
||||
"version": 1,
|
||||
"author": "xcode"
|
||||
}
|
||||
}
|
После Ширина: | Высота: | Размер: 69 KiB |
После Ширина: | Высота: | Размер: 3.7 KiB |
После Ширина: | Высота: | Размер: 4.6 KiB |
После Ширина: | Высота: | Размер: 4.6 KiB |
После Ширина: | Высота: | Размер: 5.1 KiB |
После Ширина: | Высота: | Размер: 1.3 KiB |
После Ширина: | Высота: | Размер: 845 B |
После Ширина: | Высота: | Размер: 1.1 KiB |
После Ширина: | Высота: | Размер: 1.7 KiB |
После Ширина: | Высота: | Размер: 2.5 KiB |
После Ширина: | Высота: | Размер: 2.3 KiB |
После Ширина: | Высота: | Размер: 2.4 KiB |
После Ширина: | Высота: | Размер: 2.7 KiB |
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
</dict>
|
||||
</plist>
|
||||
|
|
@ -0,0 +1,145 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">iPhoneSimulator</Platform>
|
||||
<ProductVersion>8.0.30703</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{35C28E64-61AE-4542-A38D-EF095D68A656}</ProjectGuid>
|
||||
<ProjectTypeGuids>{FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<TemplateGuid>{6143fdea-f3c2-4a09-aafa-6e230626515e}</TemplateGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
<RootNamespace>EwDavidForms.iOS</RootNamespace>
|
||||
<IPhoneResourcePrefix>Resources</IPhoneResourcePrefix>
|
||||
<AssemblyName>EwDavidForms.iOS</AssemblyName>
|
||||
<MtouchEnableSGenConc>true</MtouchEnableSGenConc>
|
||||
<MtouchHttpClientHandler>NSUrlSessionHandler</MtouchHttpClientHandler>
|
||||
<ProvisioningType>automatic</ProvisioningType>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>portable</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\iPhoneSimulator\Debug</OutputPath>
|
||||
<DefineConstants>DEBUG</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<MtouchArch>x86_64</MtouchArch>
|
||||
<MtouchLink>None</MtouchLink>
|
||||
<MtouchDebug>true</MtouchDebug>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' ">
|
||||
<DebugType>none</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\iPhoneSimulator\Release</OutputPath>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<MtouchLink>None</MtouchLink>
|
||||
<MtouchArch>x86_64</MtouchArch>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhone' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>portable</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\iPhone\Debug</OutputPath>
|
||||
<DefineConstants>DEBUG</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<MtouchArch>ARM64</MtouchArch>
|
||||
<CodesignKey>iPhone Developer</CodesignKey>
|
||||
<MtouchDebug>true</MtouchDebug>
|
||||
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
|
||||
<MtouchLink>None</MtouchLink>
|
||||
<MtouchInterpreter>-all</MtouchInterpreter>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
|
||||
<DebugType>none</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\iPhone\Release</OutputPath>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<MtouchArch>ARM64</MtouchArch>
|
||||
<CodesignKey>iPhone Developer</CodesignKey>
|
||||
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Main.cs" />
|
||||
<Compile Include="AppDelegate.cs" />
|
||||
<None Include="Entitlements.plist" />
|
||||
<None Include="Info.plist" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<InterfaceDefinition Include="Resources\LaunchScreen.storyboard" />
|
||||
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Contents.json">
|
||||
<Visible>false</Visible>
|
||||
</ImageAsset>
|
||||
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Icon1024.png">
|
||||
<Visible>false</Visible>
|
||||
</ImageAsset>
|
||||
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Icon180.png">
|
||||
<Visible>false</Visible>
|
||||
</ImageAsset>
|
||||
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Icon167.png">
|
||||
<Visible>false</Visible>
|
||||
</ImageAsset>
|
||||
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Icon152.png">
|
||||
<Visible>false</Visible>
|
||||
</ImageAsset>
|
||||
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Icon120.png">
|
||||
<Visible>false</Visible>
|
||||
</ImageAsset>
|
||||
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Icon87.png">
|
||||
<Visible>false</Visible>
|
||||
</ImageAsset>
|
||||
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Icon80.png">
|
||||
<Visible>false</Visible>
|
||||
</ImageAsset>
|
||||
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Icon76.png">
|
||||
<Visible>false</Visible>
|
||||
</ImageAsset>
|
||||
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Icon60.png">
|
||||
<Visible>false</Visible>
|
||||
</ImageAsset>
|
||||
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Icon58.png">
|
||||
<Visible>false</Visible>
|
||||
</ImageAsset>
|
||||
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Icon40.png">
|
||||
<Visible>false</Visible>
|
||||
</ImageAsset>
|
||||
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Icon29.png">
|
||||
<Visible>false</Visible>
|
||||
</ImageAsset>
|
||||
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Icon20.png">
|
||||
<Visible>false</Visible>
|
||||
</ImageAsset>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="Xamarin.iOS" />
|
||||
<Reference Include="System.Numerics" />
|
||||
<Reference Include="System.Numerics.Vectors" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AppCenter.Analytics">
|
||||
<Version>4.3.0</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.AppCenter.Crashes">
|
||||
<Version>4.3.0</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Xamarin.CommunityToolkit">
|
||||
<Version>1.2.0</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2012" />
|
||||
<PackageReference Include="Xamarin.Essentials" Version="1.6.1" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\EwDavidForms\EwDavidForms.csproj">
|
||||
<Project>{9574F61B-3134-4A20-A45C-45D6989015EB}</Project>
|
||||
<Name>EwDavidForms</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,38 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>UIDeviceFamily</key>
|
||||
<array>
|
||||
<integer>1</integer>
|
||||
<integer>2</integer>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations~ipad</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationPortraitUpsideDown</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>MinimumOSVersion</key>
|
||||
<string>8.0</string>
|
||||
<key>CFBundleDisplayName</key>
|
||||
<string>EwDavidForms</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.companyname.EwDavidForms</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.0</string>
|
||||
<key>UILaunchStoryboardName</key>
|
||||
<string>LaunchScreen</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>EwDavidForms</string>
|
||||
<key>XSAppIconAssets</key>
|
||||
<string>Assets.xcassets/AppIcon.appiconset</string>
|
||||
</dict>
|
||||
</plist>
|
|
@ -0,0 +1,20 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
using Foundation;
|
||||
using UIKit;
|
||||
|
||||
namespace EwDavidForms.iOS
|
||||
{
|
||||
public class Application
|
||||
{
|
||||
// This is the main entry point of the application.
|
||||
static void Main(string[] args)
|
||||
{
|
||||
// if you want to use a different Application Delegate class from "AppDelegate"
|
||||
// you can specify it here.
|
||||
UIApplication.Main(args, null, "AppDelegate");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("EwDavidForms.iOS")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("EwDavidForms.iOS")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2014")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("72bdc44f-c588-44f3-b6df-9aace7daafdd")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
После Ширина: | Высота: | Размер: 8.7 KiB |
После Ширина: | Высота: | Размер: 10 KiB |
После Ширина: | Высота: | Размер: 34 KiB |
После Ширина: | Высота: | Размер: 7.1 KiB |
После Ширина: | Высота: | Размер: 8.2 KiB |
|
@ -0,0 +1,39 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6245" systemVersion="13F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="X5k-f2-b5h">
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6238"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--View Controller-->
|
||||
<scene sceneID="gAE-YM-kbH">
|
||||
<objects>
|
||||
<viewController id="X5k-f2-b5h" sceneMemberID="viewController">
|
||||
<layoutGuides>
|
||||
<viewControllerLayoutGuide type="top" id="Y8P-hJ-Z43"/>
|
||||
<viewControllerLayoutGuide type="bottom" id="9ZL-r4-8FZ"/>
|
||||
</layoutGuides>
|
||||
<view key="view" contentMode="scaleToFill" id="yd7-JS-zBw">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" misplaced="YES" image="Icon-60.png" translatesAutoresizingMaskIntoConstraints="NO" id="23">
|
||||
<rect key="frame" x="270" y="270" width="60" height="60"/>
|
||||
<rect key="contentStretch" x="0.0" y="0.0" width="0.0" height="0.0"/>
|
||||
</imageView>
|
||||
</subviews>
|
||||
<color key="backgroundColor" red="0.20392156862745098" green="0.59607843137254901" blue="0.85882352941176465" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<constraints>
|
||||
<constraint firstItem="23" firstAttribute="centerY" secondItem="yd7-JS-zBw" secondAttribute="centerY" priority="1" id="39"/>
|
||||
<constraint firstItem="23" firstAttribute="centerX" secondItem="yd7-JS-zBw" secondAttribute="centerX" priority="1" id="41"/>
|
||||
</constraints>
|
||||
</view>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="XAI-xm-WK6" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="349" y="339"/>
|
||||
</scene>
|
||||
</scenes>
|
||||
<resources>
|
||||
<image name="Icon-60.png" width="180" height="180"/>
|
||||
</resources>
|
||||
</document>
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<Application xmlns="http://xamarin.com/schemas/2014/forms"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
x:Class="EwDavidForms.App">
|
||||
<Application.Resources>
|
||||
|
||||
</Application.Resources>
|
||||
</Application>
|
|
@ -0,0 +1,28 @@
|
|||
using System;
|
||||
using Xamarin.Forms;
|
||||
using Xamarin.Forms.Xaml;
|
||||
|
||||
namespace EwDavidForms
|
||||
{
|
||||
public partial class App : Application
|
||||
{
|
||||
public App ()
|
||||
{
|
||||
InitializeComponent ();
|
||||
|
||||
MainPage = new MainPage ();
|
||||
}
|
||||
|
||||
protected override void OnStart ()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnSleep ()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnResume ()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
using Xamarin.Forms.Xaml;
|
||||
|
||||
[assembly: XamlCompilation (XamlCompilationOptions.Compile)]
|
|
@ -0,0 +1,21 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
<ProduceReferenceAssembly>true</ProduceReferenceAssembly>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
<DebugType>portable</DebugType>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AppCenter.Analytics" Version="4.3.0" />
|
||||
<PackageReference Include="Microsoft.AppCenter.Crashes" Version="4.3.0" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
|
||||
<PackageReference Include="Xamarin.CommunityToolkit" Version="1.2.0" />
|
||||
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2012" />
|
||||
<PackageReference Include="Xamarin.Essentials" Version="1.6.1" />
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,24 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
x:Class="EwDavidForms.MainPage">
|
||||
|
||||
<StackLayout>
|
||||
<Frame BackgroundColor="#2196F3" Padding="24" CornerRadius="0">
|
||||
<Label Text="Welcome to Xamarin.Forms!" HorizontalTextAlignment="Center" TextColor="White" FontSize="36"/>
|
||||
</Frame>
|
||||
<Label Text="Start developing now" FontSize="Title" Padding="30,10,30,10"/>
|
||||
<Label Text="Make changes to your XAML file and save to see your UI update in the running app with XAML Hot Reload. Give it a try!" FontSize="16" Padding="30,0,30,0"/>
|
||||
<Label FontSize="16" Padding="30,24,30,0">
|
||||
<Label.FormattedText>
|
||||
<FormattedString>
|
||||
<FormattedString.Spans>
|
||||
<Span Text="Learn more at "/>
|
||||
<Span Text="https://aka.ms/xamarin-quickstart" FontAttributes="Bold"/>
|
||||
</FormattedString.Spans>
|
||||
</FormattedString>
|
||||
</Label.FormattedText>
|
||||
</Label>
|
||||
</StackLayout>
|
||||
|
||||
</ContentPage>
|
|
@ -0,0 +1,18 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace EwDavidForms
|
||||
{
|
||||
public partial class MainPage : ContentPage
|
||||
{
|
||||
public MainPage ()
|
||||
{
|
||||
InitializeComponent ();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,83 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.31320.298
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EwDavidForms.Android", "EwDavidForms\EwDavidForms.Android\EwDavidForms.Android.csproj", "{131C1751-9CFD-4073-8906-235013C96163}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EwDavidForms.iOS", "EwDavidForms\EwDavidForms.iOS\EwDavidForms.iOS.csproj", "{35C28E64-61AE-4542-A38D-EF095D68A656}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EwDavidForms", "EwDavidForms\EwDavidForms\EwDavidForms.csproj", "{B68AA3FC-9536-4BB1-81B5-2C5BD168B967}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Debug|iPhone = Debug|iPhone
|
||||
Debug|iPhoneSimulator = Debug|iPhoneSimulator
|
||||
Release|Any CPU = Release|Any CPU
|
||||
Release|iPhone = Release|iPhone
|
||||
Release|iPhoneSimulator = Release|iPhoneSimulator
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{131C1751-9CFD-4073-8906-235013C96163}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{131C1751-9CFD-4073-8906-235013C96163}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{131C1751-9CFD-4073-8906-235013C96163}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
|
||||
{131C1751-9CFD-4073-8906-235013C96163}.Debug|iPhone.ActiveCfg = Debug|Any CPU
|
||||
{131C1751-9CFD-4073-8906-235013C96163}.Debug|iPhone.Build.0 = Debug|Any CPU
|
||||
{131C1751-9CFD-4073-8906-235013C96163}.Debug|iPhone.Deploy.0 = Debug|Any CPU
|
||||
{131C1751-9CFD-4073-8906-235013C96163}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
|
||||
{131C1751-9CFD-4073-8906-235013C96163}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
|
||||
{131C1751-9CFD-4073-8906-235013C96163}.Debug|iPhoneSimulator.Deploy.0 = Debug|Any CPU
|
||||
{131C1751-9CFD-4073-8906-235013C96163}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{131C1751-9CFD-4073-8906-235013C96163}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{131C1751-9CFD-4073-8906-235013C96163}.Release|Any CPU.Deploy.0 = Release|Any CPU
|
||||
{131C1751-9CFD-4073-8906-235013C96163}.Release|iPhone.ActiveCfg = Release|Any CPU
|
||||
{131C1751-9CFD-4073-8906-235013C96163}.Release|iPhone.Build.0 = Release|Any CPU
|
||||
{131C1751-9CFD-4073-8906-235013C96163}.Release|iPhone.Deploy.0 = Release|Any CPU
|
||||
{131C1751-9CFD-4073-8906-235013C96163}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
|
||||
{131C1751-9CFD-4073-8906-235013C96163}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
|
||||
{131C1751-9CFD-4073-8906-235013C96163}.Release|iPhoneSimulator.Deploy.0 = Release|Any CPU
|
||||
{35C28E64-61AE-4542-A38D-EF095D68A656}.Debug|Any CPU.ActiveCfg = Debug|iPhone
|
||||
{35C28E64-61AE-4542-A38D-EF095D68A656}.Debug|Any CPU.Build.0 = Debug|iPhone
|
||||
{35C28E64-61AE-4542-A38D-EF095D68A656}.Debug|Any CPU.Deploy.0 = Debug|iPhone
|
||||
{35C28E64-61AE-4542-A38D-EF095D68A656}.Debug|iPhone.ActiveCfg = Debug|iPhone
|
||||
{35C28E64-61AE-4542-A38D-EF095D68A656}.Debug|iPhone.Build.0 = Debug|iPhone
|
||||
{35C28E64-61AE-4542-A38D-EF095D68A656}.Debug|iPhone.Deploy.0 = Debug|iPhone
|
||||
{35C28E64-61AE-4542-A38D-EF095D68A656}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator
|
||||
{35C28E64-61AE-4542-A38D-EF095D68A656}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator
|
||||
{35C28E64-61AE-4542-A38D-EF095D68A656}.Debug|iPhoneSimulator.Deploy.0 = Debug|iPhoneSimulator
|
||||
{35C28E64-61AE-4542-A38D-EF095D68A656}.Release|Any CPU.ActiveCfg = Release|iPhoneSimulator
|
||||
{35C28E64-61AE-4542-A38D-EF095D68A656}.Release|Any CPU.Build.0 = Release|iPhoneSimulator
|
||||
{35C28E64-61AE-4542-A38D-EF095D68A656}.Release|Any CPU.Deploy.0 = Release|iPhoneSimulator
|
||||
{35C28E64-61AE-4542-A38D-EF095D68A656}.Release|iPhone.ActiveCfg = Release|iPhone
|
||||
{35C28E64-61AE-4542-A38D-EF095D68A656}.Release|iPhone.Build.0 = Release|iPhone
|
||||
{35C28E64-61AE-4542-A38D-EF095D68A656}.Release|iPhone.Deploy.0 = Release|iPhone
|
||||
{35C28E64-61AE-4542-A38D-EF095D68A656}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator
|
||||
{35C28E64-61AE-4542-A38D-EF095D68A656}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator
|
||||
{35C28E64-61AE-4542-A38D-EF095D68A656}.Release|iPhoneSimulator.Deploy.0 = Release|iPhoneSimulator
|
||||
{B68AA3FC-9536-4BB1-81B5-2C5BD168B967}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{B68AA3FC-9536-4BB1-81B5-2C5BD168B967}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{B68AA3FC-9536-4BB1-81B5-2C5BD168B967}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
|
||||
{B68AA3FC-9536-4BB1-81B5-2C5BD168B967}.Debug|iPhone.ActiveCfg = Debug|Any CPU
|
||||
{B68AA3FC-9536-4BB1-81B5-2C5BD168B967}.Debug|iPhone.Build.0 = Debug|Any CPU
|
||||
{B68AA3FC-9536-4BB1-81B5-2C5BD168B967}.Debug|iPhone.Deploy.0 = Debug|Any CPU
|
||||
{B68AA3FC-9536-4BB1-81B5-2C5BD168B967}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
|
||||
{B68AA3FC-9536-4BB1-81B5-2C5BD168B967}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
|
||||
{B68AA3FC-9536-4BB1-81B5-2C5BD168B967}.Debug|iPhoneSimulator.Deploy.0 = Debug|Any CPU
|
||||
{B68AA3FC-9536-4BB1-81B5-2C5BD168B967}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{B68AA3FC-9536-4BB1-81B5-2C5BD168B967}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{B68AA3FC-9536-4BB1-81B5-2C5BD168B967}.Release|Any CPU.Deploy.0 = Release|Any CPU
|
||||
{B68AA3FC-9536-4BB1-81B5-2C5BD168B967}.Release|iPhone.ActiveCfg = Release|Any CPU
|
||||
{B68AA3FC-9536-4BB1-81B5-2C5BD168B967}.Release|iPhone.Build.0 = Release|Any CPU
|
||||
{B68AA3FC-9536-4BB1-81B5-2C5BD168B967}.Release|iPhone.Deploy.0 = Release|Any CPU
|
||||
{B68AA3FC-9536-4BB1-81B5-2C5BD168B967}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
|
||||
{B68AA3FC-9536-4BB1-81B5-2C5BD168B967}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
|
||||
{B68AA3FC-9536-4BB1-81B5-2C5BD168B967}.Release|iPhoneSimulator.Deploy.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {8D7FCFD4-DB78-4B64-A50F-455B55B4F941}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
|
@ -0,0 +1,19 @@
|
|||
Any raw assets you want to be deployed with your application can be placed in
|
||||
this directory (and child directories) and given a Build Action of "AndroidAsset".
|
||||
|
||||
These files will be deployed with your package and will be accessible using Android's
|
||||
AssetManager, like this:
|
||||
|
||||
public class ReadAsset : Activity
|
||||
{
|
||||
protected override void OnCreate (Bundle bundle)
|
||||
{
|
||||
base.OnCreate (bundle);
|
||||
|
||||
InputStream input = Assets.Open ("my_asset.txt");
|
||||
}
|
||||
}
|
||||
|
||||
Additionally, some Android functions will automatically load asset files:
|
||||
|
||||
Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf");
|
|
@ -0,0 +1,33 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<AndroidApplication>True</AndroidApplication>
|
||||
<AndroidResgenFile>Resources\Resource.designer.cs</AndroidResgenFile>
|
||||
<AndroidResgenClass>Resource</AndroidResgenClass>
|
||||
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
|
||||
<MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix>
|
||||
<MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix>
|
||||
<AndroidUseLatestPlatformSdk>false</AndroidUseLatestPlatformSdk>
|
||||
<AndroidEnableSGenConcurrent>true</AndroidEnableSGenConcurrent>
|
||||
<AndroidUseAapt2>true</AndroidUseAapt2>
|
||||
<AndroidHttpClientHandlerType>Xamarin.Android.Net.AndroidClientHandler</AndroidHttpClientHandlerType>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<AndroidLinkMode>None</AndroidLinkMode>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<AndroidManagedSymbols>true</AndroidManagedSymbols>
|
||||
<AndroidUseSharedRuntime>false</AndroidUseSharedRuntime>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0-android</TargetFramework>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\EwDavidForms\EwDavidForms.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers" Version="0.2.222702">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,28 @@
|
|||
using System;
|
||||
|
||||
using Android.App;
|
||||
using Android.Content.PM;
|
||||
using Android.Runtime;
|
||||
using Android.OS;
|
||||
|
||||
namespace EwDavidForms.Droid
|
||||
{
|
||||
[Activity(Label = "EwDavidForms", Icon = "@mipmap/icon", Theme = "@style/MainTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize )]
|
||||
public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
|
||||
{
|
||||
protected override void OnCreate(Bundle savedInstanceState)
|
||||
{
|
||||
base.OnCreate(savedInstanceState);
|
||||
|
||||
Xamarin.Essentials.Platform.Init(this, savedInstanceState);
|
||||
global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
|
||||
LoadApplication(new App());
|
||||
}
|
||||
public override void OnRequestPermissionsResult(int requestCode, string[] permissions, [GeneratedEnum] Android.Content.PM.Permission[] grantResults)
|
||||
{
|
||||
Xamarin.Essentials.Platform.OnRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||
|
||||
base.OnRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="com.companyname.ewdavidforms">
|
||||
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="30" />
|
||||
<application android:label="EwDavidForms.Android" android:theme="@style/MainTheme"></application>
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
</manifest>
|
|
@ -0,0 +1,30 @@
|
|||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using Android.App;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("EwDavidForms.Android")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("EwDavidForms.Android")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2014")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
|
||||
// Add some common permissions, these can be removed if not needed
|
||||
[assembly: UsesPermission(Android.Manifest.Permission.Internet)]
|
||||
[assembly: UsesPermission(Android.Manifest.Permission.WriteExternalStorage)]
|
|
@ -0,0 +1,50 @@
|
|||
Images, layout descriptions, binary blobs and string dictionaries can be included
|
||||
in your application as resource files. Various Android APIs are designed to
|
||||
operate on the resource IDs instead of dealing with images, strings or binary blobs
|
||||
directly.
|
||||
|
||||
For example, a sample Android app that contains a user interface layout (main.xml),
|
||||
an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png)
|
||||
would keep its resources in the "Resources" directory of the application:
|
||||
|
||||
Resources/
|
||||
drawable-hdpi/
|
||||
icon.png
|
||||
|
||||
drawable-ldpi/
|
||||
icon.png
|
||||
|
||||
drawable-mdpi/
|
||||
icon.png
|
||||
|
||||
layout/
|
||||
main.xml
|
||||
|
||||
values/
|
||||
strings.xml
|
||||
|
||||
In order to get the build system to recognize Android resources, set the build action to
|
||||
"AndroidResource". The native Android APIs do not operate directly with filenames, but
|
||||
instead operate on resource IDs. When you compile an Android application that uses resources,
|
||||
the build system will package the resources for distribution and generate a class called
|
||||
"Resource" that contains the tokens for each one of the resources included. For example,
|
||||
for the above Resources layout, this is what the Resource class would expose:
|
||||
|
||||
public class Resource {
|
||||
public class drawable {
|
||||
public const int icon = 0x123;
|
||||
}
|
||||
|
||||
public class layout {
|
||||
public const int main = 0x456;
|
||||
}
|
||||
|
||||
public class strings {
|
||||
public const int first_string = 0xabc;
|
||||
public const int second_string = 0xbcd;
|
||||
}
|
||||
}
|
||||
|
||||
You would then use R.drawable.icon to reference the drawable/icon.png file, or Resource.layout.main
|
||||
to reference the layout/main.xml file, or Resource.strings.first_string to reference the first
|
||||
string in the dictionary file values/strings.xml.
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@color/launcher_background" />
|
||||
<foreground android:drawable="@mipmap/launcher_foreground" />
|
||||
</adaptive-icon>
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@color/launcher_background" />
|
||||
<foreground android:drawable="@mipmap/launcher_foreground" />
|
||||
</adaptive-icon>
|
После Ширина: | Высота: | Размер: 4.6 KiB |
После Ширина: | Высота: | Размер: 11 KiB |
После Ширина: | Высота: | Размер: 2.7 KiB |
После Ширина: | Высота: | Размер: 6.3 KiB |
После Ширина: | Высота: | Размер: 6.9 KiB |
После Ширина: | Высота: | Размер: 18 KiB |
После Ширина: | Высота: | Размер: 12 KiB |
После Ширина: | Высота: | Размер: 33 KiB |
После Ширина: | Высота: | Размер: 19 KiB |
После Ширина: | Высота: | Размер: 51 KiB |
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="launcher_background">#FFFFFF</color>
|
||||
<color name="colorPrimary">#3F51B5</color>
|
||||
<color name="colorPrimaryDark">#303F9F</color>
|
||||
<color name="colorAccent">#FF4081</color>
|
||||
</resources>
|
|
@ -0,0 +1,18 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<resources>
|
||||
|
||||
<style name="MainTheme" parent="MainTheme.Base">
|
||||
<!-- As of Xamarin.Forms 4.6 the theme has moved into the Forms binary -->
|
||||
<!-- If you want to override anything you can do that here. -->
|
||||
<!-- Underneath are a couple of entries to get you started. -->
|
||||
|
||||
<!-- Set theme colors from https://aka.ms/material-colors -->
|
||||
<!-- colorPrimary is used for the default action bar background -->
|
||||
<!--<item name="colorPrimary">#2196F3</item>-->
|
||||
<!-- colorPrimaryDark is used for the status bar -->
|
||||
<!--<item name="colorPrimaryDark">#1976D2</item>-->
|
||||
<!-- colorAccent is used as the default value for colorControlActivated
|
||||
which is used to tint widgets -->
|
||||
<!--<item name="colorAccent">#FF4081</item>-->
|
||||
</style>
|
||||
</resources>
|
|
@ -0,0 +1,31 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
using Foundation;
|
||||
using UIKit;
|
||||
|
||||
namespace EwDavidForms.iOS
|
||||
{
|
||||
// The UIApplicationDelegate for the application. This class is responsible for launching the
|
||||
// User Interface of the application, as well as listening (and optionally responding) to
|
||||
// application events from iOS.
|
||||
[Register("AppDelegate")]
|
||||
public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate
|
||||
{
|
||||
//
|
||||
// This method is invoked when the application has loaded and is ready to run. In this
|
||||
// method you should instantiate the window, load the UI into it and then make the window
|
||||
// visible.
|
||||
//
|
||||
// You have 17 seconds to return from this method, or iOS will terminate your application.
|
||||
//
|
||||
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
|
||||
{
|
||||
global::Xamarin.Forms.Forms.Init();
|
||||
LoadApplication(new App());
|
||||
|
||||
return base.FinishedLaunching(app, options);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,117 @@
|
|||
{
|
||||
"images": [
|
||||
{
|
||||
"scale": "2x",
|
||||
"size": "20x20",
|
||||
"idiom": "iphone",
|
||||
"filename": "Icon40.png"
|
||||
},
|
||||
{
|
||||
"scale": "3x",
|
||||
"size": "20x20",
|
||||
"idiom": "iphone",
|
||||
"filename": "Icon60.png"
|
||||
},
|
||||
{
|
||||
"scale": "2x",
|
||||
"size": "29x29",
|
||||
"idiom": "iphone",
|
||||
"filename": "Icon58.png"
|
||||
},
|
||||
{
|
||||
"scale": "3x",
|
||||
"size": "29x29",
|
||||
"idiom": "iphone",
|
||||
"filename": "Icon87.png"
|
||||
},
|
||||
{
|
||||
"scale": "2x",
|
||||
"size": "40x40",
|
||||
"idiom": "iphone",
|
||||
"filename": "Icon80.png"
|
||||
},
|
||||
{
|
||||
"scale": "3x",
|
||||
"size": "40x40",
|
||||
"idiom": "iphone",
|
||||
"filename": "Icon120.png"
|
||||
},
|
||||
{
|
||||
"scale": "2x",
|
||||
"size": "60x60",
|
||||
"idiom": "iphone",
|
||||
"filename": "Icon120.png"
|
||||
},
|
||||
{
|
||||
"scale": "3x",
|
||||
"size": "60x60",
|
||||
"idiom": "iphone",
|
||||
"filename": "Icon180.png"
|
||||
},
|
||||
{
|
||||
"scale": "1x",
|
||||
"size": "20x20",
|
||||
"idiom": "ipad",
|
||||
"filename": "Icon20.png"
|
||||
},
|
||||
{
|
||||
"scale": "2x",
|
||||
"size": "20x20",
|
||||
"idiom": "ipad",
|
||||
"filename": "Icon40.png"
|
||||
},
|
||||
{
|
||||
"scale": "1x",
|
||||
"size": "29x29",
|
||||
"idiom": "ipad",
|
||||
"filename": "Icon29.png"
|
||||
},
|
||||
{
|
||||
"scale": "2x",
|
||||
"size": "29x29",
|
||||
"idiom": "ipad",
|
||||
"filename": "Icon58.png"
|
||||
},
|
||||
{
|
||||
"scale": "1x",
|
||||
"size": "40x40",
|
||||
"idiom": "ipad",
|
||||
"filename": "Icon40.png"
|
||||
},
|
||||
{
|
||||
"scale": "2x",
|
||||
"size": "40x40",
|
||||
"idiom": "ipad",
|
||||
"filename": "Icon80.png"
|
||||
},
|
||||
{
|
||||
"scale": "1x",
|
||||
"size": "76x76",
|
||||
"idiom": "ipad",
|
||||
"filename": "Icon76.png"
|
||||
},
|
||||
{
|
||||
"scale": "2x",
|
||||
"size": "76x76",
|
||||
"idiom": "ipad",
|
||||
"filename": "Icon152.png"
|
||||
},
|
||||
{
|
||||
"scale": "2x",
|
||||
"size": "83.5x83.5",
|
||||
"idiom": "ipad",
|
||||
"filename": "Icon167.png"
|
||||
},
|
||||
{
|
||||
"scale": "1x",
|
||||
"size": "1024x1024",
|
||||
"idiom": "ios-marketing",
|
||||
"filename": "Icon1024.png"
|
||||
}
|
||||
],
|
||||
"properties": {},
|
||||
"info": {
|
||||
"version": 1,
|
||||
"author": "xcode"
|
||||
}
|
||||
}
|
После Ширина: | Высота: | Размер: 69 KiB |
После Ширина: | Высота: | Размер: 3.7 KiB |