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

Commit

Permalink
Merge in 1.3.0 (#870)
Browse files Browse the repository at this point in the history
* GH-23: Added Tizen backend (#555)

* Adding the initial work to get Tizen started. #23

* Adding the initial work to get Tizen started. #23

* Use the overloads properly.

* Use the overloads properly.

* Tizen needs to have a background explicitly set

* Added the Vibration API

* Added the Vibration API

* Refactoring a little bit

* Refactoring a little bit

* Added the Browser API and some basic permissions checking

* Added the Browser API and some basic permissions checking

* Added the Battery API

* Added the Battery API

* Added the Acceleromerter API

* Added the Acceleromerter API

* Added the Filesystem API

* Added the Filesystem API

* Update Accelerometer Initialize using GetDefaultSensor

* Update Accelerometer Initialize using GetDefaultSensor

* Added the Gyroscope API

* Added the Gyroscope API

* Added the Magnetometer API

* Added the Magnetometer API

* Added the Compass API

* Added the Compass API

* Added the Connectivity API

* Added the Connectivity API

* Added the Flashlight API

* Added the Flashlight API

* Added the SecureStorage API

* Added the SecureStorage API

* Added the Vibration API

* Added the Vibration API

* Fixed build break

* Fixed build break

* Added the OrientationSensor API

* Fixed build break

* Initialized Maps/Launcher for Tizen

* Added the Permissions API

* Added the Geolocation API

* Added the Geocoding API

* Fixed build break

* Initialize Barometer API

* Added the Barometer API

* Added the TextToSpeech API

* Added the Launcher APIs

* Fixed bugs

* Update Location property name

* Update several modules

- Update AppInfo, Browser, Clipboard, Compass, Connectivity,
  DisplayInfo, DeviceInfo, Geocoding, TextToSpeech modules
- Change module name DataTrasfer to Share, Maps to Map
- Integrated module Power to Battery, ScreenLock to DeviceDisplay

* Throw PlatformNotSupportedException for Tizen

* Change the exception for the power saver feature

* Add tizen privileges

* Add FileBase

* Add ShareFileRequest

* Change enum for Browser

* Change parameter for Permissions

* Add SensorSpeedExtensions

* Add Launcher for OpenFileRequest

* Fix .csproj for VS2019

* Fix sample for watch

* Fix Geolocation speed

* Fix TextToSpeech ptich

* Fixed missing using System;

This was needed for the Math calls

* Add Support for  ⌚OS and 📺OS  (#827)

* Add Support for watchOS and tvOS

* Fix up exception from shared netstandard code to figure out what to send.

* Update Battery.ios.watchos.cs

* Integrate Tizen into the netstandard not supported area.

* [Tizen] Fix reference for avoid duplication (#850)

* Fix reference to avoid version collision

* Remove Vector3 reference on Tizen

* Fix iPad not show share sheet (#873)

Need to specify bottom center of the screen.

* Added the Main Thread helpers from Xamarin.Forms (#849)

* Added Invoke methods from Xamarin.Forms

* Updated to use Essentials approach to calling the MainThread

* Updated the docs with the new MainThread methods

* Make overload more readable

The old code was I think incorrect in that the `funcTask()` was never awaited or returned as a task.  This is the same code as the overload with the generic type parameter, but without the type param.

* Updated to use UrlEncode in GetMailToUrl (#848)

* Updated to use UrlEncode in GetMailToUrl

Fixes #843

* Added missing using

* Fixed Using order and spacings

* Use WebUtility.UrlEncode on placemark extensions

* Added volatile to MainThread.Android (#877)

Fixes #838

* Add Launcher.TryOpenAsync (#839)

* Add Launcher.TryOpenAsync

* Added ConfigureAwait(false)

* Removed unnecessary async

* Updated launcher docs

* Updated the docs

* Added Launch Tests

* Add aka.ms for release notes (#883)

* Remove experimental flags & fix launcher teasts (#887)
  • Loading branch information
jamesmontemagno authored and Redth committed Aug 20, 2019
1 parent 0bfbae9 commit ff6dd3e
Show file tree
Hide file tree
Showing 138 changed files with 6,606 additions and 219 deletions.
2,913 changes: 2,913 additions & 0 deletions DeviceTests/DeviceTests.Android/Resources/Resource.designer.cs

Large diffs are not rendered by default.

30 changes: 30 additions & 0 deletions DeviceTests/DeviceTests.Shared/Launcher_Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,5 +99,35 @@ public async Task CanNotOpen(string uri)
{
Assert.False(await Launcher.CanOpenAsync(uri));
}

[Theory]
[InlineData("http://www.example.com")]
[InlineData("http://example.com/?query=blah")]
[InlineData("https://example.com/?query=blah")]
[InlineData("mailto://[email protected]")]
[InlineData("mailto://[email protected]?subject=test")]
[InlineData("tel:+1 555 010 9999")]
[InlineData("sms:5550109999")]
[Trait(Traits.InteractionType, Traits.InteractionTypes.Human)]
public async Task TryOpen(string uri)
{
#if __IOS__
if (DeviceInfo.DeviceType == DeviceType.Virtual && (uri.Contains("tel:") || uri.Contains("mailto:")))
{
Assert.False(await Launcher.TryOpenAsync(uri));
return;
}
#endif

Assert.True(await Launcher.TryOpenAsync(uri));
}

[Theory]
[InlineData("ms-invalidurifortest:abc")]
[Trait(Traits.InteractionType, Traits.InteractionTypes.Human)]
public async Task CanNotTryOpen(string uri)
{
Assert.False(await Launcher.TryOpenAsync(new Uri(uri)));
}
}
}
18 changes: 18 additions & 0 deletions Samples/Samples.Tizen/CustomViewCellRenderer.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using ElmSharp;
using Samples.Tizen;
using Xamarin.Forms;
using Xamarin.Forms.Platform.Tizen;

[assembly: ExportCell(typeof(ViewCell), typeof(CustomViewCellRenderer))]
namespace Samples.Tizen
{
public sealed class CustomViewCellRenderer : ViewCellRenderer
{
protected override EvasObject OnGetContent(Cell cell, string part)
{
var view = base.OnGetContent(cell, part);
view.PropagateEvents = true;
return view;
}
}
}
25 changes: 25 additions & 0 deletions Samples/Samples.Tizen/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using Xamarin.Forms;
using Xamarin.Forms.Platform.Tizen;

namespace Samples.Tizen
{
class Program : FormsApplication
{
protected override void OnCreate()
{
base.OnCreate();

LoadApplication(new App());
}

static void Main(string[] args)
{
var app = new Program();
Forms.Init(app);
if (Device.Idiom == TargetIdiom.Watch)
global::Tizen.Wearable.CircularUI.Forms.Renderer.FormsCircularUI.Init();
Xamarin.Essentials.Platform.MapServiceToken = "MAP_SERVICE_KEY";
app.Run(args);
}
}
}
34 changes: 34 additions & 0 deletions Samples/Samples.Tizen/Samples.Tizen.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<Project Sdk="Tizen.NET.Sdk/1.0.3">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>tizen40</TargetFramework>
<TizenNetPackageVersion>4.0.0</TizenNetPackageVersion>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugType>portable</DebugType>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>None</DebugType>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\Xamarin.Essentials\Xamarin.Essentials.csproj" />
<ProjectReference Include="..\Samples\Samples.csproj" />
</ItemGroup>

<ItemGroup>
<Folder Include="lib\" />
<Folder Include="res\" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Tizen.Wearable.CircularUI" Version="1.3.0-pre1-00043" />
<PackageReference Include="System.Numerics.Vectors" Version="4.5.0">
<ExcludeAssets>Runtime</ExcludeAssets>
</PackageReference>
</ItemGroup>

<Import Project="$(MSBuildThisFileDirectory)..\..\CodeStyles.targets" />
</Project>
4 changes: 4 additions & 0 deletions Samples/Samples.Tizen/res/FileSystemTemplate.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
This file was loaded from the app package.

You can use this as a starting point for your comments...

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 27 additions & 0 deletions Samples/Samples.Tizen/tizen-manifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="com.xamarin.essentials" version="1.0.0" api-version="4" xmlns="http://tizen.org/ns/packages">
<profile name="common" />
<ui-application appid="com.xamarin.essentials" exec="Samples.Tizen.dll" multiple="false" nodisplay="false" taskmanage="true" splash-screen-display="true" type="dotnet" launch_mode="single">
<label>Xamarin.Essentials</label>
<icon>Samples.Tizen.png</icon>
<metadata key="http://tizen.org/metadata/prefer_dotnet_aot" value="true" />
</ui-application>
<privileges>
<privilege>http://tizen.org/privilege/appmanager.launch</privilege>
<privilege>http://tizen.org/privilege/externalstorage</privilege>
<privilege>http://tizen.org/privilege/haptic</privilege>
<privilege>http://tizen.org/privilege/internet</privilege>
<privilege>http://tizen.org/privilege/led</privilege>
<privilege>http://tizen.org/privilege/location</privilege>
<privilege>http://tizen.org/privilege/mapservice</privilege>
<privilege>http://tizen.org/privilege/mediastorage</privilege>
<privilege>http://tizen.org/privilege/message.read</privilege>
<privilege>http://tizen.org/privilege/network.get</privilege>
</privileges>
<provides-appdefined-privileges />
<feature name="http://tizen.org/feature/location">true</feature>
<feature name="http://tizen.org/feature/location.gps">true</feature>
<feature name="http://tizen.org/feature/location.wps">true</feature>
<feature name="http://tizen.org/feature/maps">true</feature>
<feature name="http://tizen.org/feature/speech.synthesis">true</feature>
</manifest>
4 changes: 0 additions & 4 deletions Samples/Samples/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ public App()
InitializeComponent();

// Enable currently experimental features
ExperimentalFeatures.Enable(
ExperimentalFeatures.EmailAttachments,
ExperimentalFeatures.ShareFileRequest,
ExperimentalFeatures.OpenFileRequest);

VersionTracking.Track();

Expand Down
2 changes: 2 additions & 0 deletions Samples/Samples/View/BasePage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ public class BasePage : ContentPage
public BasePage()
{
NavigationPage.SetBackButtonTitle(this, "Back");
if (Device.Idiom == TargetIdiom.Watch)
NavigationPage.SetHasNavigationBar(this, false);
}

protected override void OnAppearing()
Expand Down
5 changes: 1 addition & 4 deletions Tests/Launcher_Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,7 @@ public async Task Open_Uri_NetStandard() =>
await Assert.ThrowsAsync<NotImplementedInReferenceAssemblyException>(() => Launcher.OpenAsync(new Uri("http://www.xamarin.com")));

[Fact]
public async Task Open_File_NetStandard()
{
TestUtils.EnableExperimentalFeatures();
public async Task Open_File_NetStandard() =>
await Assert.ThrowsAsync<NotImplementedInReferenceAssemblyException>(() => Launcher.OpenAsync(new OpenFileRequest()));
}
}
}
5 changes: 1 addition & 4 deletions Tests/Share_Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@ public async Task Request_Text_Request_NetStandard() =>
await Assert.ThrowsAsync<NotImplementedInReferenceAssemblyException>(() => Share.RequestAsync(new ShareTextRequest()));

[Fact]
public async Task Request_File_Request_NetStandard()
{
TestUtils.EnableExperimentalFeatures();
public async Task Request_File_Request_NetStandard() =>
await Assert.ThrowsAsync<NotImplementedInReferenceAssemblyException>(() => Share.RequestAsync(new ShareFileRequest()));
}
}
}
4 changes: 0 additions & 4 deletions Tests/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ public static class TestUtils
{
public static void EnableExperimentalFeatures()
{
ExperimentalFeatures.Enable(
ExperimentalFeatures.EmailAttachments,
ExperimentalFeatures.ShareFileRequest,
ExperimentalFeatures.OpenFileRequest);
}
}
}
51 changes: 51 additions & 0 deletions Xamarin.Essentials.sln
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DeviceTests.UWP", "DeviceTe
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DeviceTests.Shared", "DeviceTests\DeviceTests.Shared\DeviceTests.Shared.csproj", "{BE0DE9A3-D92C-47C5-9EC4-DFB546BBDF77}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Samples.Tizen", "Samples\Samples.Tizen\Samples.Tizen.csproj", "{4B1850CF-C568-4C16-8B42-3E9977DE5F56}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -614,6 +616,54 @@ Global
{BE0DE9A3-D92C-47C5-9EC4-DFB546BBDF77}.Samples|x64.Build.0 = Samples|Any CPU
{BE0DE9A3-D92C-47C5-9EC4-DFB546BBDF77}.Samples|x86.ActiveCfg = Samples|Any CPU
{BE0DE9A3-D92C-47C5-9EC4-DFB546BBDF77}.Samples|x86.Build.0 = Samples|Any CPU
{4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Debug|ARM.ActiveCfg = Debug|Any CPU
{4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Debug|ARM.Build.0 = Debug|Any CPU
{4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Debug|iPhone.ActiveCfg = Debug|Any CPU
{4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Debug|iPhone.Build.0 = Debug|Any CPU
{4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
{4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Debug|x64.ActiveCfg = Debug|Any CPU
{4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Debug|x64.Build.0 = Debug|Any CPU
{4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Debug|x86.ActiveCfg = Debug|Any CPU
{4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Debug|x86.Build.0 = Debug|Any CPU
{4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Docs|Any CPU.ActiveCfg = Debug|Any CPU
{4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Docs|Any CPU.Build.0 = Debug|Any CPU
{4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Docs|ARM.ActiveCfg = Debug|Any CPU
{4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Docs|ARM.Build.0 = Debug|Any CPU
{4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Docs|iPhone.ActiveCfg = Debug|Any CPU
{4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Docs|iPhone.Build.0 = Debug|Any CPU
{4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Docs|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Docs|iPhoneSimulator.Build.0 = Debug|Any CPU
{4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Docs|x64.ActiveCfg = Debug|Any CPU
{4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Docs|x64.Build.0 = Debug|Any CPU
{4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Docs|x86.ActiveCfg = Debug|Any CPU
{4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Docs|x86.Build.0 = Debug|Any CPU
{4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Release|Any CPU.Build.0 = Release|Any CPU
{4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Release|ARM.ActiveCfg = Release|Any CPU
{4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Release|ARM.Build.0 = Release|Any CPU
{4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Release|iPhone.ActiveCfg = Release|Any CPU
{4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Release|iPhone.Build.0 = Release|Any CPU
{4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
{4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Release|x64.ActiveCfg = Release|Any CPU
{4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Release|x64.Build.0 = Release|Any CPU
{4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Release|x86.ActiveCfg = Release|Any CPU
{4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Release|x86.Build.0 = Release|Any CPU
{4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Samples|Any CPU.ActiveCfg = Release|Any CPU
{4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Samples|Any CPU.Build.0 = Release|Any CPU
{4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Samples|ARM.ActiveCfg = Release|Any CPU
{4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Samples|ARM.Build.0 = Release|Any CPU
{4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Samples|iPhone.ActiveCfg = Release|Any CPU
{4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Samples|iPhone.Build.0 = Release|Any CPU
{4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Samples|iPhoneSimulator.ActiveCfg = Release|Any CPU
{4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Samples|iPhoneSimulator.Build.0 = Release|Any CPU
{4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Samples|x64.ActiveCfg = Release|Any CPU
{4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Samples|x64.Build.0 = Release|Any CPU
{4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Samples|x86.ActiveCfg = Release|Any CPU
{4B1850CF-C568-4C16-8B42-3E9977DE5F56}.Samples|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -629,6 +679,7 @@ Global
{EE8FC716-27FC-405B-BD27-AF17E01A6671} = {EA9AC363-45BC-4959-BD17-FE3A1B724529}
{4BD0D88F-7E7A-4C3B-9E34-BF3717A8FF4B} = {EA9AC363-45BC-4959-BD17-FE3A1B724529}
{BE0DE9A3-D92C-47C5-9EC4-DFB546BBDF77} = {EA9AC363-45BC-4959-BD17-FE3A1B724529}
{4B1850CF-C568-4C16-8B42-3E9977DE5F56} = {706C0487-6930-4E55-8720-C17D9FE6CA91}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {105B0052-C7EA-44D0-8697-37A45E1392AF}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
public static partial class Accelerometer
{
internal static bool IsSupported =>
throw new NotImplementedInReferenceAssemblyException();
throw ExceptionUtils.NotSupportedOrImplementedException;

static void PlatformStart(SensorSpeed sensorSpeed) =>
throw new NotImplementedInReferenceAssemblyException();
throw ExceptionUtils.NotSupportedOrImplementedException;

static void PlatformStop() =>
throw new NotImplementedInReferenceAssemblyException();
throw ExceptionUtils.NotSupportedOrImplementedException;
}
}
32 changes: 32 additions & 0 deletions Xamarin.Essentials/Accelerometer/Accelerometer.tizen.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
using Tizen.Sensor;
using TizenAccelerometer = Tizen.Sensor.Accelerometer;

namespace Xamarin.Essentials
{
public static partial class Accelerometer
{
internal static TizenAccelerometer DefaultSensor =>
(TizenAccelerometer)Platform.GetDefaultSensor(SensorType.Accelerometer);

internal static bool IsSupported =>
TizenAccelerometer.IsSupported;

static void PlatformStart(SensorSpeed sensorSpeed)
{
DefaultSensor.Interval = sensorSpeed.ToPlatform();
DefaultSensor.DataUpdated += DataUpdated;
DefaultSensor.Start();
}

static void PlatformStop()
{
DefaultSensor.DataUpdated -= DataUpdated;
DefaultSensor.Stop();
}

static void DataUpdated(object sender, AccelerometerDataUpdatedEventArgs e)
{
OnChanged(new AccelerometerData(e.X, e.Y, e.Z));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@ public static partial class AppInfo
static string GetBundleValue(string key)
=> NSBundle.MainBundle.ObjectForInfoDictionary(key)?.ToString();

#if __IOS__ || __TVOS__
static void PlatformShowSettingsUI() =>
UIApplication.SharedApplication.OpenUrl(new NSUrl(UIApplication.OpenSettingsUrlString));
#else
static void PlatformShowSettingsUI() =>
throw new FeatureNotSupportedException();
#endif
}
}
10 changes: 5 additions & 5 deletions Xamarin.Essentials/AppInfo/AppInfo.netstandard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
{
public static partial class AppInfo
{
static string PlatformGetPackageName() => throw new NotImplementedInReferenceAssemblyException();
static string PlatformGetPackageName() => throw ExceptionUtils.NotSupportedOrImplementedException;

static string PlatformGetName() => throw new NotImplementedInReferenceAssemblyException();
static string PlatformGetName() => throw ExceptionUtils.NotSupportedOrImplementedException;

static string PlatformGetVersionString() => throw new NotImplementedInReferenceAssemblyException();
static string PlatformGetVersionString() => throw ExceptionUtils.NotSupportedOrImplementedException;

static string PlatformGetBuild() => throw new NotImplementedInReferenceAssemblyException();
static string PlatformGetBuild() => throw ExceptionUtils.NotSupportedOrImplementedException;

static void PlatformShowSettingsUI() => throw new NotImplementedInReferenceAssemblyException();
static void PlatformShowSettingsUI() => throw ExceptionUtils.NotSupportedOrImplementedException;
}
}
26 changes: 26 additions & 0 deletions Xamarin.Essentials/AppInfo/AppInfo.tizen.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using System.Globalization;
using Tizen.Applications;

namespace Xamarin.Essentials
{
public static partial class AppInfo
{
static string PlatformGetPackageName()
=> Application.Current.ApplicationInfo.PackageId;

static string PlatformGetName()
=> Application.Current.ApplicationInfo.Label;

static string PlatformGetVersionString()
=> Platform.CurrentPackage.Version;

static string PlatformGetBuild()
=> Version.Build.ToString(CultureInfo.InvariantCulture);

static void PlatformShowSettingsUI()
{
Permissions.EnsureDeclared(PermissionType.LaunchApp);
AppControl.SendLaunchRequest(new AppControl() { Operation = AppControlOperations.Setting });
}
}
}
Loading

0 comments on commit ff6dd3e

Please sign in to comment.