summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.Tizen/Forms.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Xamarin.Forms.Platform.Tizen/Forms.cs')
-rw-r--r--Xamarin.Forms.Platform.Tizen/Forms.cs30
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;
}