Skip to content
This repository has been archived by the owner on May 15, 2024. It is now read-only.

Commit

Permalink
Merge branch 'main' into gh-512-spike
Browse files Browse the repository at this point in the history
  • Loading branch information
jfversluis committed Jan 18, 2022
2 parents 5ca36a0 + c6bc848 commit 7dfb78f
Show file tree
Hide file tree
Showing 191 changed files with 1,617 additions and 2,053 deletions.
20 changes: 1 addition & 19 deletions .github/ISSUE_TEMPLATE/feature-request.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,4 @@ labels: feature-request
assignees: ''

---

## Summary
Please provide a brief summary of your proposal. Two to three sentences is best here.

## API Changes

Include a list of all API changes, additions, subtractions as would be required by your proposal. These APIs should be considered placeholders, so the naming is not as important as getting the concepts correct. If possible you should include some "example" code of usage of your new API. You should also provide details of the level of availability for the feature on each of the supported platforms.

e.g.

In order to facilitate the new Shiny Button api, a bool is added to the Button class. This is done as a bool because it is simpler to data bind and other reasons...

var button = new Button ();
button.MakeShiny = true; // new API

The MakeShiny API works even if the button is already visible.

## Intended Use Case
Provide a detailed example of where your proposal would be used and for what purpose.
We are no longer accepting new feature request for Xamarin.Essentials. Please make your new feature requests in the .NET MAUI repo which contains .NET MAUI Essentials.
17 changes: 17 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
<!--
HOL' UP! JUST A SEC!
After January 31, 2021, feature related pull requests cannot be guaranteed to merge by Xamarin.Essentials.
We are in the process of merging Xamarin.Essentials into the MAUI repository for improved experience.
At this stage, MAUI will depend on Xamarin.Essentials, so we are moving it there so that they can be released together.
This repo can still be used for a time to fix any critical bugs and other issues. All new features will be postponed until the merge is complete.
Thanks for all the PRs in the past, we can't wait to have you contributing features very soon in our new and improved home!
PLEASE DELETE THE ALL THESE COMMENTS BEFORE SUBMITTING! THANKS!!!
-->

### Description of Change ###

Describe your changes here.
Expand Down
11 changes: 5 additions & 6 deletions DeviceTests/DeviceTests.Android/DeviceTests.Android.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
<RootNamespace>DeviceTests.Droid</RootNamespace>
<AssemblyName>XamarinEssentialsDeviceTestsAndroid</AssemblyName>
<TargetFrameworkVersion>v10.0</TargetFrameworkVersion>
<AndroidUseLatestPlatformSdk>false</AndroidUseLatestPlatformSdk>
<AndroidApplication>True</AndroidApplication>
<AndroidUseIntermediateDesignerFile>true</AndroidUseIntermediateDesignerFile>
<AndroidResgenClass>Resource</AndroidResgenClass>
Expand All @@ -19,6 +18,7 @@
<AndroidEnableSGenConcurrent>true</AndroidEnableSGenConcurrent>
<AndroidUseAapt2>true</AndroidUseAapt2>
<AndroidHttpClientHandlerType>Xamarin.Android.Net.AndroidClientHandler</AndroidHttpClientHandlerType>
<AndroidSupportedAbis>armeabi-v7a;x86;x86_64;arm64-v8a</AndroidSupportedAbis>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand All @@ -29,7 +29,6 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AndroidLinkMode>None</AndroidLinkMode>
<AndroidSupportedAbis>armeabi-v7a;x86;x86_64;arm64-v8a</AndroidSupportedAbis>
<JavaMaximumHeapSize>1G</JavaMaximumHeapSize>
<AotAssemblies>false</AotAssemblies>
<EnableLLVM>false</EnableLLVM>
Expand All @@ -47,7 +46,6 @@
<WarningLevel>4</WarningLevel>
<AndroidManagedSymbols>true</AndroidManagedSymbols>
<AndroidUseSharedRuntime>false</AndroidUseSharedRuntime>
<AndroidSupportedAbis>armeabi-v7a;x86;x86_64;arm64-v8a</AndroidSupportedAbis>
<EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk>
<JavaMaximumHeapSize>1G</JavaMaximumHeapSize>
</PropertyGroup>
Expand All @@ -59,12 +57,13 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Xamarin.Forms" Version="4.8.0.1687" />
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2083" />
<PackageReference Include="System.Numerics.Vectors" Version="4.5.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.devices" Version="2.5.25" />
<PackageReference Include="Microsoft.DotNet.XHarness.TestRunners.Xunit" Version="1.0.0-prerelease.20602.1" />
<PackageReference Include="Xamarin.AndroidX.MediaRouter" Version="1.1.0.1" />
<PackageReference Include="Microsoft.DotNet.XHarness.TestRunners.Xunit" Version="1.0.0-prerelease.21620.1" />
<PackageReference Include="Xamarin.AndroidX.MediaRouter" Version="1.2.0.1" />
<PackageReference Include="Xamarin.AndroidX.Palette" Version="1.0.0.6" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Xamarin.Essentials\Xamarin.Essentials.csproj">
Expand Down
31 changes: 31 additions & 0 deletions DeviceTests/DeviceTests.Android/Properties/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,36 @@
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<queries>
<!-- Email -->
<intent>
<action android:name="android.intent.action.SENDTO" />
<data android:scheme="mailto" />
</intent>
<!-- Browser -->
<intent>
<action android:name="android.intent.action.VIEW" />
<data android:scheme="http" />
</intent>
<!-- Browser -->
<intent>
<action android:name="android.intent.action.VIEW" />
<data android:scheme="https" />
</intent>
<!-- Sms -->
<intent>
<action android:name="android.intent.action.VIEW" />
<data android:scheme="smsto" />
</intent>
<!-- PhoneDialer -->
<intent>
<action android:name="android.intent.action.DIAL" />
<data android:scheme="tel" />
</intent>
<!-- MediaPicker -->
<intent>
<action android:name="android.media.action.IMAGE_CAPTURE" />
</intent>
</queries>
<application android:label="@string/app_name" android:icon="@mipmap/ic_launcher" android:roundIcon="@mipmap/ic_launcher_round" android:theme="@style/MainTheme"></application>
</manifest>
16 changes: 4 additions & 12 deletions DeviceTests/DeviceTests.Shared/DeviceTests.Shared.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="MSBuild.Sdk.Extras/2.0.54">
<Project Sdk="MSBuild.Sdk.Extras/3.0.22">
<PropertyGroup>
<TargetFrameworks Condition=" '$(OS)' == 'Windows_NT' ">Xamarin.iOS10;MonoAndroid90;uap10.0.16299</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">Xamarin.iOS10;MonoAndroid90;</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' == 'Windows_NT' ">Xamarin.iOS10;MonoAndroid10.0;uap10.0.16299</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">Xamarin.iOS10;MonoAndroid10.0;</TargetFrameworks>
<AssemblyName>XamarinEssentialsDeviceTestsShared</AssemblyName>
<RootNamespace>DeviceTests.Shared</RootNamespace>
<Product>$(AssemblyName) ($(TargetFramework))</Product>
Expand All @@ -23,7 +23,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.Numerics.Vectors" Version="4.5.0" />
<PackageReference Include="Xamarin.Forms" Version="4.8.0.1687" />
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2083" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.devices" Version="2.5.25" />
<PackageReference Include="UnitTests.HeadlessRunner" Version="2.0.0" />
Expand All @@ -37,14 +37,6 @@
</SDKReference>
</ItemGroup>
<ItemGroup Condition=" $(TargetFramework.StartsWith('MonoAndroid')) ">
<PackageReference Include="Xamarin.Android.Support.Design" Version="28.0.0.3" />
<PackageReference Include="Xamarin.Android.Support.v7.AppCompat" Version="28.0.0.3" />
<PackageReference Include="Xamarin.Android.Support.v4" Version="28.0.0.3" />
<PackageReference Include="Xamarin.Android.Support.v7.CardView" Version="28.0.0.3" />
<PackageReference Include="Xamarin.Android.Support.v7.MediaRouter" Version="28.0.0.3" />
<PackageReference Include="Xamarin.Android.Support.CustomTabs" Version="28.0.0.3" />
<PackageReference Include="Xamarin.Android.Support.Compat" Version="28.0.0.3" />
<PackageReference Include="Xamarin.Android.Support.Core.Utils" Version="28.0.0.3" />
<Reference Include="System.Numerics" />
<Reference Include="System.Numerics.Vectors" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion DeviceTests/DeviceTests.Shared/Geocoding_Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public async Task Get_Placemarks_Location(double latitude, double longitude)
}

[Theory]
[InlineData("Microsoft Building 25 Redmond WA USA")]
[InlineData("Redmond, WA, USA")]
public async Task Get_Locations(string address)
{
try
Expand Down
2 changes: 1 addition & 1 deletion DeviceTests/DeviceTests.UWP/DeviceTests.UWP.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="UnitTests.HeadlessRunner" Version="2.0.0" />
<PackageReference Include="Xamarin.Forms" Version="4.8.0.1687" />
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2083" />
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="6.2.9" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.devices" Version="2.5.25" />
Expand Down
4 changes: 2 additions & 2 deletions DeviceTests/DeviceTests.iOS/DeviceTests.iOS.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@
<Reference Include="Xamarin.iOS" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Xamarin.Forms" Version="4.8.0.1687" />
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2083" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.devices" Version="2.5.25" />
<PackageReference Include="Microsoft.DotNet.XHarness.TestRunners.Xunit" Version="1.0.0-prerelease.20602.1" />
<PackageReference Include="Microsoft.DotNet.XHarness.TestRunners.Xunit" Version="1.0.0-prerelease.21620.1" />
<PackageReference Include="System.Numerics.Vectors" Version="4.5.0" />
</ItemGroup>
<ItemGroup>
Expand Down
9 changes: 5 additions & 4 deletions DeviceTests/DeviceTests.iOS/Main.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
using UIKit;
using System;
using UIKit;

namespace DeviceTests.iOS
{
public class Application
{
static void Main(string[] args)
{
if (args?.Length > 0) // usually means this is from xharness
UIApplication.Main(args, null, nameof(TestApplicationDelegate));
if (!string.IsNullOrWhiteSpace(Environment.GetEnvironmentVariable("ci-run")))
UIApplication.Main(args, null, typeof(TestApplicationDelegate));
else
UIApplication.Main(args, null, nameof(AppDelegate));
UIApplication.Main(args, null, typeof(AppDelegate));
}
}
}
9 changes: 7 additions & 2 deletions DeviceTests/build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ System.Environment.SetEnvironmentVariable("PATH",
$"{ANDROID_HOME}/emulator" + System.IO.Path.PathSeparator +
EnvironmentVariable("PATH"));

var RESTORE_CONFIG = MakeAbsolute((FilePath)"../devopsnuget.config").FullPath;

// utils

Expand Down Expand Up @@ -99,6 +100,7 @@ Task("build-ios")
c.Properties["Platform"] = new List<string> { "iPhoneSimulator" };
c.Properties["BuildIpa"] = new List<string> { "true" };
c.Properties["ContinuousIntegrationBuild"] = new List<string> { "false" };
c.Properties["RestoreConfigFile"] = new List<string> { RESTORE_CONFIG };
c.Targets.Clear();
c.Targets.Add("Rebuild");
c.BinaryLogger = new MSBuildBinaryLogSettings {
Expand All @@ -116,11 +118,12 @@ Task("test-ios-emu")
CleanDirectories(IOS_TEST_RESULTS_PATH.FullPath);
// Run the tests
var resultCode = StartProcess("xharness", "ios test " +
var resultCode = StartProcess("xharness", "apple test " +
$"--app=\"{IOS_IPA_PATH}\" " +
$"--targets=\"ios-simulator-64\" " +
$"--output-directory=\"{IOS_TEST_RESULTS_PATH}\" " +
$"--verbosity=\"Debug\" ");
$"--verbosity=\"Debug\" " +
$"--set-env=ci-run=true ");
// Rename test result files
var resultFiles = GetFiles($"{IOS_TEST_RESULTS_PATH}/*.xml");
Expand All @@ -142,6 +145,7 @@ Task("build-android")
c.Configuration = "Debug"; // needs to be debug so unit tests get discovered
c.Restore = true;
c.Properties["ContinuousIntegrationBuild"] = new List<string> { "false" };
c.Properties["RestoreConfigFile"] = new List<string> { RESTORE_CONFIG };
c.Targets.Clear();
c.Targets.Add("Rebuild");
c.Targets.Add("SignAndroidPackage");
Expand Down Expand Up @@ -221,6 +225,7 @@ Task("build-uwp")
c.Properties["AppxBundlePlatforms"] = new List<string> { "x86" };
c.Properties["AppxBundle"] = new List<string> { "Always" };
c.Properties["AppxPackageSigningEnabled"] = new List<string> { "true" };
c.Properties["RestoreConfigFile"] = new List<string> { RESTORE_CONFIG };
c.Targets.Clear();
c.Targets.Add("Rebuild");
c.BinaryLogger = new MSBuildBinaryLogSettings {
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,5 @@ Here are some frequently asked questions about Xamarin.Essentials, but be sure t

Please see the [License](LICENSE).

## Stats
<img src="https://repobeats.axiom.co/api/embed/f917a77cbbdeee19b87fa1f2f932895d1df18b31.svg" />
6 changes: 2 additions & 4 deletions Samples/Samples.Android/Samples.Android.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,9 @@
<PackageReference Include="Microsoft.AppCenter.Analytics" Version="3.0.0" />
<PackageReference Include="Microsoft.AppCenter.Crashes" Version="3.0.0" />
<PackageReference Include="Microsoft.AppCenter.Distribute" Version="3.0.0" />
<PackageReference Include="Xamarin.Forms" Version="4.8.0.1687" />
<PackageReference Include="Xamarin.Forms.Visual.Material" Version="4.8.0.1687" />
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2083" />
<PackageReference Include="Xamarin.Forms.Visual.Material" Version="5.0.0.2083" />
<PackageReference Include="System.Numerics.Vectors" Version="4.5.0" />
<PackageReference Include="Xamarin.Google.Android.Material" Version="1.1.0-rc2" />
<PackageReference Include="Xamarin.AndroidX.AppCompat.AppCompatResources" Version="1.1.0.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Xamarin.Essentials\Xamarin.Essentials.csproj">
Expand Down
4 changes: 2 additions & 2 deletions Samples/Samples.Mac/Samples.Mac.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@
<PackageReference Include="Microsoft.AppCenter.Analytics" Version="3.0.0" />
<PackageReference Include="Microsoft.AppCenter.Crashes" Version="3.0.0" />
<PackageReference Include="Microsoft.AppCenter.Distribute" Version="3.0.0" />
<PackageReference Include="Xamarin.Forms" Version="4.8.0.1687" />
<PackageReference Include="Xamarin.Forms.Visual.Material" Version="4.8.0.1687" />
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2083" />
<PackageReference Include="Xamarin.Forms.Visual.Material" Version="5.0.0.2083" />
<PackageReference Include="System.Numerics.Vectors" Version="4.5.0" />
</ItemGroup>
<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions Samples/Samples.UWP/Samples.UWP.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@
<PackageReference Include="Microsoft.AppCenter.Analytics" Version="3.0.0" />
<PackageReference Include="Microsoft.AppCenter.Crashes" Version="3.0.0" />
<PackageReference Include="Microsoft.AppCenter.Distribute" Version="3.0.0" />
<PackageReference Include="Xamarin.Forms" Version="4.8.0.1687" />
<PackageReference Include="Xamarin.Forms.Visual.Material" Version="4.8.0.1687" />
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2083" />
<PackageReference Include="Xamarin.Forms.Visual.Material" Version="5.0.0.2083" />
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="6.2.9" />
<PackageReference Include="System.Numerics.Vectors" Version="4.5.0" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion Samples/Samples.iOS/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ public class Application
{
static void Main(string[] args)
{
UIApplication.Main(args, null, nameof(AppDelegate));
UIApplication.Main(args, null, typeof(AppDelegate));
}
}
}
4 changes: 2 additions & 2 deletions Samples/Samples.iOS/Samples.iOS.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@
<PackageReference Include="Microsoft.AppCenter.Analytics" Version="3.0.0" />
<PackageReference Include="Microsoft.AppCenter.Crashes" Version="3.0.0" />
<PackageReference Include="Microsoft.AppCenter.Distribute" Version="3.0.0" />
<PackageReference Include="Xamarin.Forms" Version="4.8.0.1687" />
<PackageReference Include="Xamarin.Forms.Visual.Material" Version="4.8.0.1687" />
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2083" />
<PackageReference Include="Xamarin.Forms.Visual.Material" Version="5.0.0.2083" />
<PackageReference Include="System.Numerics.Vectors" Version="4.5.0" />
</ItemGroup>
<ItemGroup>
Expand Down
15 changes: 15 additions & 0 deletions Samples/Samples/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,21 @@
<Style TargetType="Page" ApplyToDerivedTypes="True">
<Setter Property="Visual" Value="{x:Static local:App.PreferredVisual}" />
</Style>
<Style TargetType="Editor">
<Setter Property="TextColor" Value="{OnPlatform iOS='Black'}" />
</Style>
<Style TargetType="Entry">
<Setter Property="TextColor" Value="{OnPlatform iOS='Black'}" />
</Style>
<Style TargetType="Picker">
<Setter Property="TextColor" Value="{OnPlatform iOS='Black'}" />
</Style>
<Style TargetType="DatePicker">
<Setter Property="TextColor" Value="{OnPlatform iOS='Black'}" />
</Style>
<Style TargetType="TimePicker">
<Setter Property="TextColor" Value="{OnPlatform iOS='Black'}" />
</Style>
</ResourceDictionary>
</Application.Resources>
</Application>
4 changes: 2 additions & 2 deletions Samples/Samples/Samples.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
<PackageReference Include="Microsoft.AppCenter.Analytics" Version="3.0.0" />
<PackageReference Include="Microsoft.AppCenter.Crashes" Version="3.0.0" />
<PackageReference Include="Microsoft.AppCenter.Distribute" Version="3.0.0" />
<PackageReference Include="Xamarin.Forms" Version="4.8.0.1687" />
<PackageReference Include="Xamarin.Forms.Visual.Material" Version="4.8.0.1687" />
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2083" />
<PackageReference Include="Xamarin.Forms.Visual.Material" Version="5.0.0.2083" />
<PackageReference Include="System.Numerics.Vectors" Version="4.5.0" />
</ItemGroup>

Expand Down
1 change: 1 addition & 0 deletions Samples/Samples/View/DeviceInfoPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
<Label Text="{Binding ScreenMetrics.Density, StringFormat='Density: {0}'}" />
<Label Text="{Binding ScreenMetrics.Orientation, StringFormat='Orientation: {0}'}" />
<Label Text="{Binding ScreenMetrics.Rotation, StringFormat='Rotation: {0}'}" />
<Label Text="{Binding ScreenMetrics.RefreshRate, StringFormat='Refresh Rate: {0}'}" />
</StackLayout>
</ScrollView>
</StackLayout>
Expand Down
4 changes: 2 additions & 2 deletions Samples/Samples/View/LauncherPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
<Label Text="File Contents:" />
<Editor Text="{Binding FileAttachmentContents}" AutoSize="TextChanges" />

<Button Text="Open File" Command="{Binding LaunchFileCommand}" />

<Button Text="Open File" Command="{Binding LaunchFileCommand}"
CommandParameter="{Binding Source={RelativeSource Self}}" />
</StackLayout>
</Grid>
</ScrollView>
Expand Down
2 changes: 1 addition & 1 deletion Samples/Samples/View/MediaPickerPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<Button Text="Capture video" Command="{Binding CaptureVideoCommand}" />

<Image VerticalOptions="FillAndExpand" Source="{Binding PhotoPath}" IsVisible="{Binding ShowPhoto}" />
<MediaElement VerticalOptions="FillAndExpand" Source="{Binding VideoPath}" IsVisible="{Binding ShowVideo}" />
<!--<MediaElement VerticalOptions="FillAndExpand" Source="{Binding VideoPath}" IsVisible="{Binding ShowVideo}" />-->
</StackLayout>
</ScrollView>

Expand Down

0 comments on commit 7dfb78f

Please sign in to comment.