diff options
author | Kangho Hur <kangho.hur@samsung.com> | 2017-01-20 14:05:56 +0900 |
---|---|---|
committer | Kangho Hur <kangho.hur@samsung.com> | 2017-10-23 13:34:27 +0900 |
commit | e3241afd09ec70fdeeb731c662fc86b35fa4bda5 (patch) | |
tree | 045c0fa639448aa2749e3daf4f89b4d58d7a2356 /Xamarin.Forms.Platform.Tizen/Forms.cs | |
parent | 60e85186c94516ba4ed1fd3c81b456ba1d3565cc (diff) | |
download | xamarin-forms-e3241afd09ec70fdeeb731c662fc86b35fa4bda5.tar.gz xamarin-forms-e3241afd09ec70fdeeb731c662fc86b35fa4bda5.tar.bz2 xamarin-forms-e3241afd09ec70fdeeb731c662fc86b35fa4bda5.zip |
Consider TV profile as TargetIdiom
- Currently, We assumed TV as TargetIdiom.Desktop. This is because there is no TargetIdiom.TV in Xamarin.Forms mainstream.
- I'll do a PR to adding TargetIdiom.TV. Also, I'll fix it correctly when TargetIdio.TV is merged.
Change-Id: Idb7b1cd2510f9d4cecb70bd1e9d4dae1c2a61b05
Diffstat (limited to 'Xamarin.Forms.Platform.Tizen/Forms.cs')
-rw-r--r-- | Xamarin.Forms.Platform.Tizen/Forms.cs | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/Xamarin.Forms.Platform.Tizen/Forms.cs b/Xamarin.Forms.Platform.Tizen/Forms.cs index a12d9513..51914250 100644 --- a/Xamarin.Forms.Platform.Tizen/Forms.cs +++ b/Xamarin.Forms.Platform.Tizen/Forms.cs @@ -25,6 +25,8 @@ namespace Xamarin.Forms.Platform.Tizen readonly double scalingFactor; + readonly string profile; + public override Size PixelScreenSize { get @@ -49,6 +51,14 @@ namespace Xamarin.Forms.Platform.Tizen } } + public string Profile + { + get + { + return this.profile; + } + } + public TizenDeviceInfo(FormsApplication formsApplication) { int width = 0; @@ -60,6 +70,9 @@ namespace Xamarin.Forms.Platform.Tizen 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); + + //TODO : Fix me if elm_config_profile_get() unavailable + profile = Elementary.GetProfile(); } } @@ -165,8 +178,21 @@ namespace Xamarin.Forms.Platform.Tizen }); } - // FIXME: We should consider TV and Common (Desktop) profiles also. - Device.Idiom = TargetIdiom.Phone; + // TODO: We should consider various tizen profiles such as TV, Wearable and so on. + string profile = ((TizenDeviceInfo)Device.Info).Profile; + if (profile == "mobile") + { + Device.Idiom = TargetIdiom.Phone; + } + else if (profile == "tv" || profile == "desktop") + { + Device.Idiom = TargetIdiom.Desktop; + } + else + { + Device.Idiom = TargetIdiom.Unsupported; + } + ExpressionSearch.Default = new TizenExpressionSearch(); IsInitialized = true; } |