summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPawel Andruszkiewicz <p.andruszkie@samsung.com>2017-01-03 08:46:09 (GMT)
committerPawel Andruszkiewicz <p.andruszkie@samsung.com>2017-01-03 08:46:09 (GMT)
commit7120d48f92fdb17d0eca935a5e35535719c5cd98 (patch)
tree177b3ebbad14a1f248a36e3e0fbbbd753c5c24c4
parent038e97bf21c5099df2be7ab46bbc52eb6d84cfe4 (diff)
downloadxamarin-forms-7120d48f92fdb17d0eca935a5e35535719c5cd98.zip
xamarin-forms-7120d48f92fdb17d0eca935a5e35535719c5cd98.tar.gz
xamarin-forms-7120d48f92fdb17d0eca935a5e35535719c5cd98.tar.bz2
Initialize DeviceInfo with system informationrefs/changes/86/108186/1
Change-Id: Ia70b9ffec0f54b3d0440e448dfae41bc22c546c1 Signed-off-by: Pawel Andruszkiewicz <p.andruszkie@samsung.com>
-rw-r--r--Xamarin.Forms.Platform.Tizen/Forms.cs14
-rw-r--r--Xamarin.Forms.Platform.Tizen/Xamarin.Forms.Platform.Tizen.project.json3
-rw-r--r--packaging/xamarin-forms-tizen.spec1
3 files changed, 13 insertions, 5 deletions
diff --git a/Xamarin.Forms.Platform.Tizen/Forms.cs b/Xamarin.Forms.Platform.Tizen/Forms.cs
index f5989e0..34828a4 100644
--- a/Xamarin.Forms.Platform.Tizen/Forms.cs
+++ b/Xamarin.Forms.Platform.Tizen/Forms.cs
@@ -5,6 +5,7 @@ using System.Linq.Expressions;
using System.Reflection;
using ElmSharp;
using Tizen.Applications;
+using TSystemInfo = Tizen.System.SystemInfo;
namespace Xamarin.Forms.Platform.Tizen
{
@@ -44,10 +45,15 @@ namespace Xamarin.Forms.Platform.Tizen
public TizenDeviceInfo(FormsApplication formsApplication)
{
- // TODO: obtain screen data from device
- pixelScreenSize = new Size();
- scaledScreenSize = new Size();
- scalingFactor = 0.0;
+ int width = 0;
+ int height = 0;
+
+ TSystemInfo.TryGetValue("http://tizen.org/feature/screen.width", out width);
+ TSystemInfo.TryGetValue("http://tizen.org/feature/screen.height", out height);
+
+ scalingFactor = 1.0; // scaling is disabled, we're using pixels as Xamarin's geometry units
+ pixelScreenSize = new Size(width, height);
+ scaledScreenSize = new Size(width / scalingFactor, height / scalingFactor);
}
}
diff --git a/Xamarin.Forms.Platform.Tizen/Xamarin.Forms.Platform.Tizen.project.json b/Xamarin.Forms.Platform.Tizen/Xamarin.Forms.Platform.Tizen.project.json
index 02b62b9..1e97eea 100644
--- a/Xamarin.Forms.Platform.Tizen/Xamarin.Forms.Platform.Tizen.project.json
+++ b/Xamarin.Forms.Platform.Tizen/Xamarin.Forms.Platform.Tizen.project.json
@@ -3,7 +3,8 @@
"ElmSharp": "1.1.0-*",
"NETStandard.Library": "1.6.0",
"System.Runtime.Serialization.Xml": "4.1.1",
- "Tizen.Applications": "1.0.2"
+ "Tizen.Applications": "1.0.2",
+ "Tizen.System": "1.0.5"
},
"frameworks": {
"netstandard1.6": {
diff --git a/packaging/xamarin-forms-tizen.spec b/packaging/xamarin-forms-tizen.spec
index 074629b..c0fc490 100644
--- a/packaging/xamarin-forms-tizen.spec
+++ b/packaging/xamarin-forms-tizen.spec
@@ -38,6 +38,7 @@ BuildRequires: dotnet-build-tools
# C# API Requires
BuildRequires: csapi-tizen-nuget
BuildRequires: csapi-application-nuget
+BuildRequires: csapi-system-nuget
BuildRequires: elm-sharp-nuget
%description