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

Commit b415c9d

Browse files
authored
Merge pull request #1382 from xamarin/develop
Merging v1.6 into main
2 parents 972bdda + b8c56c7 commit b415c9d

File tree

298 files changed

+11319
-793
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

298 files changed

+11319
-793
lines changed

.openpublishing.publish.config.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,5 +80,8 @@
8080
"target_framework": "net45",
8181
"version": "latest"
8282
}
83-
]
83+
],
84+
"docs_build_engine": {
85+
"name": "docfx_v3"
86+
}
8487
}

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ Every pull request which affects public types or members should include correspo
8787

8888
If you're looking for something to fix, please browse [open issues](https://github.com/xamarin/Essentials/issues).
8989

90-
Follow the style used by the [.NET Foundation](https://github.com/dotnet/corefx/blob/master/Documentation/coding-guidelines/coding-style.md), with two primary exceptions:
90+
Follow the style used by the [.NET Foundation](https://github.com/dotnet/runtime/blob/master/docs/coding-guidelines/coding-style.md), with two primary exceptions:
9191

9292
- We do not use the `private` keyword as it is the default accessibility level in C#.
9393
- We will **not** use `_` or `s_` as a prefix for internal or private field names

DeviceTests/DeviceTests.Android/DeviceTests.Android.csproj

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -49,22 +49,12 @@
4949
<Reference Include="System.Xml" />
5050
</ItemGroup>
5151
<ItemGroup>
52-
<PackageReference Include="Xamarin.Forms" Version="4.2.0.848062" />
53-
<PackageReference Include="Xamarin.Android.Support.Design" Version="28.0.0.3" />
54-
<PackageReference Include="Xamarin.Android.Support.v7.AppCompat" Version="28.0.0.3" />
55-
<PackageReference Include="Xamarin.Android.Support.v4" Version="28.0.0.3" />
56-
<PackageReference Include="Xamarin.Android.Support.v7.CardView" Version="28.0.0.3" />
57-
<PackageReference Include="Xamarin.Android.Support.v7.MediaRouter" Version="28.0.0.3" />
58-
<PackageReference Include="Xamarin.Android.Support.CustomTabs" Version="28.0.0.3" />
59-
<PackageReference Include="Xamarin.Android.Support.Core.Utils" Version="28.0.0.3" />
60-
<PackageReference Include="Xamarin.AndroidX.Lifecycle.LiveData" Version="2.1.0" />
61-
<PackageReference Include="Xamarin.Google.Android.Material" Version="1.0.0" />
62-
<PackageReference Include="Xamarin.AndroidX.Legacy.Support.V4" Version="1.0.0" />
63-
<PackageReference Include="Xamarin.AndroidX.MediaRouter" Version="1.1.0" />
52+
<PackageReference Include="Xamarin.Forms" Version="4.7.0.1239" />
6453
<PackageReference Include="System.Numerics.Vectors" Version="4.5.0" />
6554
<PackageReference Include="xunit" Version="2.4.1" />
6655
<PackageReference Include="xunit.runner.devices" Version="2.5.25" />
6756
<PackageReference Include="UnitTests.HeadlessRunner" Version="2.0.0" />
57+
<PackageReference Include="Xamarin.AndroidX.MediaRouter" Version="1.1.0.1" />
6858
</ItemGroup>
6959
<ItemGroup>
7060
<ProjectReference Include="..\..\Xamarin.Essentials\Xamarin.Essentials.csproj">

DeviceTests/DeviceTests.Android/MainActivity.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ protected override void OnCreate(Bundle bundle)
1818
Xamarin.Essentials.Platform.Init(this, bundle);
1919

2020
var hostIp = Intent.Extras?.GetString("HOST_IP", null);
21-
var hostPort = Intent.Extras?.GetInt("HOST_PORT", 10578) ?? 10578;
21+
var hostPort = Intent.Extras?.GetInt("HOST_PORT", 63559) ?? 63559;
2222

2323
if (!string.IsNullOrEmpty(hostIp))
2424
{

DeviceTests/DeviceTests.Android/Properties/AndroidManifest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
77
<uses-permission android:name="android.permission.BATTERY_STATS" />
88
<uses-permission android:name="android.permission.CAMERA" />
9+
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
910
<uses-permission android:name="android.permission.FLASHLIGHT" />
1011
<uses-permission android:name="android.permission.INTERNET" />
1112
<uses-permission android:name="android.permission.VIBRATE" />

DeviceTests/DeviceTests.Android/Tests/FileProvider_Tests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public void Share_Simple_Text_File_Test()
2020
Assert.False(FileProvider.IsFileInPublicLocation(file));
2121

2222
// Actually get a safe shareable file uri
23-
var shareableUri = Platform.GetShareableFileUri(file);
23+
var shareableUri = Platform.GetShareableFileUri(new ReadOnlyFile(file));
2424

2525
// Launch an intent to let tye user pick where to open this content
2626
var intent = new Android.Content.Intent(Android.Content.Intent.ActionSend);
@@ -232,7 +232,7 @@ static Android.Net.Uri GetShareableUri(string file, FileProviderLocation locatio
232232
FileProvider.TemporaryLocation = location;
233233

234234
// get the uri
235-
return Platform.GetShareableFileUri(file);
235+
return Platform.GetShareableFileUri(new ReadOnlyFile(file));
236236
}
237237
finally
238238
{
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
using System.Collections.Generic;
2+
using System.Threading.Tasks;
3+
using Xamarin.Essentials;
4+
using Xamarin.Forms;
5+
using Xunit;
6+
7+
namespace DeviceTests
8+
{
9+
public class AppActions_Tests
10+
{
11+
[Fact]
12+
public void IsSupported()
13+
{
14+
var expectSupported = false;
15+
16+
#if __ANDROID_25__
17+
expectSupported = true;
18+
#endif
19+
20+
#if __IOS__
21+
if (Platform.HasOSVersion(9, 0))
22+
expectSupported = true;
23+
#endif
24+
Assert.Equal(expectSupported, AppActions.IsSupported);
25+
}
26+
27+
#if __ANDROID_25__ || __IOS__
28+
[Fact]
29+
public async Task GetSetItems()
30+
{
31+
if (!AppActions.IsSupported)
32+
return;
33+
34+
var actions = new List<AppAction>
35+
{
36+
new AppAction("TEST1", "Test 1", "This is a test", "myapp://test1"),
37+
new AppAction("TEST2", "Test 2", "This is a test 2", "myapp://test2"),
38+
};
39+
40+
await AppActions.SetAsync(actions);
41+
42+
var get = await AppActions.GetAsync();
43+
44+
Assert.Contains(get, a => a.Id == "TEST1");
45+
}
46+
#endif
47+
}
48+
}

DeviceTests/DeviceTests.Shared/DeviceTests.Shared.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
</PropertyGroup>
2424
<ItemGroup>
2525
<PackageReference Include="System.Numerics.Vectors" Version="4.5.0" />
26-
<PackageReference Include="Xamarin.Forms" Version="4.2.0.848062" />
26+
<PackageReference Include="Xamarin.Forms" Version="4.7.0.1239" />
2727
<PackageReference Include="xunit" Version="2.4.1" />
2828
<PackageReference Include="xunit.runner.devices" Version="2.5.25" />
2929
<PackageReference Include="UnitTests.HeadlessRunner" Version="2.0.0" />
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
using System;
2+
using Xamarin.Essentials;
3+
using Xunit;
4+
5+
namespace DeviceTests
6+
{
7+
public class HapticFeedback_Tests
8+
{
9+
[Fact]
10+
public void Click() => HapticFeedback.Perform(HapticFeedbackType.Click);
11+
12+
[Fact]
13+
public void LongPress() => HapticFeedback.Perform(HapticFeedbackType.LongPress);
14+
}
15+
}

DeviceTests/DeviceTests.UWP/DeviceTests.UWP.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@
114114
</PropertyGroup>
115115
<ItemGroup>
116116
<PackageReference Include="UnitTests.HeadlessRunner" Version="2.0.0" />
117-
<PackageReference Include="Xamarin.Forms" Version="4.2.0.848062" />
117+
<PackageReference Include="Xamarin.Forms" Version="4.7.0.1239" />
118118
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="6.2.9" />
119119
<PackageReference Include="xunit" Version="2.4.1" />
120120
<PackageReference Include="xunit.runner.devices" Version="2.5.25" />

0 commit comments

Comments
 (0)