diff options
author | Pawel Andruszkiewicz <p.andruszkie@samsung.com> | 2017-01-03 09:46:09 +0100 |
---|---|---|
committer | Kangho Hur <kangho.hur@samsung.com> | 2017-10-23 13:34:25 +0900 |
commit | 66c301c45668a7e76e2e701b0ff35498737ba2be (patch) | |
tree | be7bec103b3558a5a39dbb3ab5d577cdd10f0048 /Xamarin.Forms.Platform.Tizen/Forms.cs | |
parent | 9f195bf190b6909a2cde5f3c89eb7b1211b508ad (diff) | |
download | xamarin-forms-66c301c45668a7e76e2e701b0ff35498737ba2be.tar.gz xamarin-forms-66c301c45668a7e76e2e701b0ff35498737ba2be.tar.bz2 xamarin-forms-66c301c45668a7e76e2e701b0ff35498737ba2be.zip |
Initialize DeviceInfo with system information
Change-Id: Ia70b9ffec0f54b3d0440e448dfae41bc22c546c1
Signed-off-by: Pawel Andruszkiewicz <p.andruszkie@samsung.com>
Diffstat (limited to 'Xamarin.Forms.Platform.Tizen/Forms.cs')
-rw-r--r-- | Xamarin.Forms.Platform.Tizen/Forms.cs | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/Xamarin.Forms.Platform.Tizen/Forms.cs b/Xamarin.Forms.Platform.Tizen/Forms.cs index f5989e05..34828a41 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); } } |