diff options
author | Seungkeun Lee <sngn.lee@samsung.com> | 2017-01-04 14:01:48 +0900 |
---|---|---|
committer | Kangho Hur <kangho.hur@samsung.com> | 2017-03-24 13:18:58 +0900 |
commit | e0ddba84cc75f834fe4d5fc4bacc6b27f1c87021 (patch) | |
tree | 752a2f24845f01199c33cf20530b41f33a37f857 /Xamarin.Forms.Platform.Tizen/Forms.cs | |
parent | 475d120aebd066d11b943080b03e06b0cc78f70d (diff) | |
download | xamarin-forms-e0ddba84cc75f834fe4d5fc4bacc6b27f1c87021.tar.gz xamarin-forms-e0ddba84cc75f834fe4d5fc4bacc6b27f1c87021.tar.bz2 xamarin-forms-e0ddba84cc75f834fe4d5fc4bacc6b27f1c87021.zip |
Support Density Independent Pixel on FontSize
- FontSize on Span was use DP unit
Change-Id: I1a0a50dbeae3ede0c61a67f60f7238631684537d
Diffstat (limited to 'Xamarin.Forms.Platform.Tizen/Forms.cs')
-rw-r--r-- | Xamarin.Forms.Platform.Tizen/Forms.cs | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/Xamarin.Forms.Platform.Tizen/Forms.cs b/Xamarin.Forms.Platform.Tizen/Forms.cs index 34828a41..453bab82 100644 --- a/Xamarin.Forms.Platform.Tizen/Forms.cs +++ b/Xamarin.Forms.Platform.Tizen/Forms.cs @@ -11,6 +11,12 @@ namespace Xamarin.Forms.Platform.Tizen { public static class Forms { + static Lazy<int> s_dpi = new Lazy<int>(() => + { + int dpi = 0; + TSystemInfo.TryGetValue<int>("http://tizen.org/feature/screen.dpi", out dpi); + return dpi; + }); class TizenDeviceInfo : DeviceInfo { readonly Size pixelScreenSize; @@ -178,6 +184,11 @@ namespace Xamarin.Forms.Platform.Tizen // TODO: implement me return Color.Black; } + + internal static int ConvertToPixel(double dp) + { + return (int)Math.Round(dp * s_dpi.Value / 160.0); + } } class TizenExpressionSearch : ExpressionVisitor, IExpressionSearch @@ -206,4 +217,4 @@ namespace Xamarin.Forms.Platform.Tizen return base.VisitMember(node); } } -}
\ No newline at end of file +} |