diff options
Diffstat (limited to 'Xamarin.Forms.Platform.Tizen')
8 files changed, 10 insertions, 132 deletions
diff --git a/Xamarin.Forms.Platform.Tizen/Native/Entry.cs b/Xamarin.Forms.Platform.Tizen/Native/Entry.cs index 003a298b..26b775c8 100644 --- a/Xamarin.Forms.Platform.Tizen/Native/Entry.cs +++ b/Xamarin.Forms.Platform.Tizen/Native/Entry.cs @@ -183,7 +183,7 @@ namespace Xamarin.Forms.Platform.Tizen.Native /// Gets or sets the font weight for the text. /// </summary> /// <value>The weight of the font.</value> - public FontWeight FontWeight + public string FontWeight { get { diff --git a/Xamarin.Forms.Platform.Tizen/Native/FontWeight.cs b/Xamarin.Forms.Platform.Tizen/Native/FontWeight.cs deleted file mode 100644 index 90bb6370..00000000 --- a/Xamarin.Forms.Platform.Tizen/Native/FontWeight.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace Xamarin.Forms.Platform.Tizen.Native -{ - /// <summary> - /// Enumerates values that describe options for line braking. - /// </summary> - public enum FontWeight - { - None, - Normal, - Thin, - UltraLight, - Light, - Book, - Medium, - SemiBold, - Bold, - UltraBold, - Black, - ExtraBlack - } -} diff --git a/Xamarin.Forms.Platform.Tizen/Native/Label.cs b/Xamarin.Forms.Platform.Tizen/Native/Label.cs index 231127c2..a75e6aa8 100644 --- a/Xamarin.Forms.Platform.Tizen/Native/Label.cs +++ b/Xamarin.Forms.Platform.Tizen/Native/Label.cs @@ -178,7 +178,7 @@ namespace Xamarin.Forms.Platform.Tizen.Native /// Gets or sets the font weight for the text. /// </summary> /// <value>The weight of the font.</value> - public FontWeight FontWeight + public string FontWeight { get { diff --git a/Xamarin.Forms.Platform.Tizen/Native/Span.cs b/Xamarin.Forms.Platform.Tizen/Native/Span.cs index 50d596a4..8120105f 100644 --- a/Xamarin.Forms.Platform.Tizen/Native/Span.cs +++ b/Xamarin.Forms.Platform.Tizen/Native/Span.cs @@ -1,6 +1,7 @@ using System; using System.Text; using EColor = ElmSharp.Color; +using Specific = Xamarin.Forms.PlatformConfiguration.TizenSpecific; namespace Xamarin.Forms.Platform.Tizen.Native { @@ -79,7 +80,7 @@ namespace Xamarin.Forms.Platform.Tizen.Native /// <summary> /// Gets or sets the font weight for the text. /// </summary> - public FontWeight FontWeight { get; set; } + public string FontWeight { get; set; } /// <summary> /// Gets or sets the line break mode for the text. @@ -117,7 +118,7 @@ namespace Xamarin.Forms.Platform.Tizen.Native Text = ""; FontFamily = ""; FontSize = -1; - FontWeight = FontWeight.None; + FontWeight = Specific.FontWeight.None; FontAttributes = FontAttributes.None; ForegroundColor = EColor.Default; BackgroundColor = EColor.Default; @@ -192,41 +193,9 @@ namespace Xamarin.Forms.Platform.Tizen.Native else { // FontWeight is only available in case of FontAttributes.Bold is not used. - switch (FontWeight) + if(FontWeight != Specific.FontWeight.None) { - case FontWeight.Bold: - _formattingString.Append("font_weight=Bold "); - break; - case FontWeight.SemiBold: - _formattingString.Append("font_weight=SemiBold "); - break; - case FontWeight.UltraBold: - _formattingString.Append("font_weight=UltraBold "); - break; - case FontWeight.Black: - _formattingString.Append("font_weight=Black "); - break; - case FontWeight.ExtraBlack: - _formattingString.Append("font_weight=ExtraBlack "); - break; - case FontWeight.Book: - _formattingString.Append("font_weight=Book "); - break; - case FontWeight.Light: - _formattingString.Append("font_weight=Light "); - break; - case FontWeight.Medium: - _formattingString.Append("font_weight=Medium "); - break; - case FontWeight.Normal: - _formattingString.Append("font_weight=Normal "); - break; - case FontWeight.Thin: - _formattingString.Append("font_weight=Thin "); - break; - case FontWeight.UltraLight: - _formattingString.Append("font_weight=UltraLight "); - break; + _formattingString.AppendFormat("font_weight={0} ", FontWeight); } } diff --git a/Xamarin.Forms.Platform.Tizen/Renderers/ButtonRenderer.cs b/Xamarin.Forms.Platform.Tizen/Renderers/ButtonRenderer.cs index eea46e80..39f26b4f 100644 --- a/Xamarin.Forms.Platform.Tizen/Renderers/ButtonRenderer.cs +++ b/Xamarin.Forms.Platform.Tizen/Renderers/ButtonRenderer.cs @@ -1,7 +1,5 @@ using System; -using System.ComponentModel; using EColor = ElmSharp.Color; -using Xamarin.Forms.PlatformConfiguration.TizenSpecific; using Specific = Xamarin.Forms.PlatformConfiguration.TizenSpecific.VisualElement; namespace Xamarin.Forms.Platform.Tizen diff --git a/Xamarin.Forms.Platform.Tizen/Renderers/EntryRenderer.cs b/Xamarin.Forms.Platform.Tizen/Renderers/EntryRenderer.cs index 46af3520..7e7c8925 100644 --- a/Xamarin.Forms.Platform.Tizen/Renderers/EntryRenderer.cs +++ b/Xamarin.Forms.Platform.Tizen/Renderers/EntryRenderer.cs @@ -130,39 +130,7 @@ namespace Xamarin.Forms.Platform.Tizen void UpdateFontWeight() { - var weight = Specific.GetFontWeight(Element); - Control.FontWeight = ConvertToNativeFontWeight(weight); - } - - Native.FontWeight ConvertToNativeFontWeight(FontWeight weight) - { - switch (weight) - { - case FontWeight.Bold: - return Native.FontWeight.Bold; - case FontWeight.SemiBold: - return Native.FontWeight.SemiBold; - case FontWeight.UltraBold: - return Native.FontWeight.UltraBold; - case FontWeight.Black: - return Native.FontWeight.Black; - case FontWeight.ExtraBlack: - return Native.FontWeight.ExtraBlack; - case FontWeight.Book: - return Native.FontWeight.Book; - case FontWeight.Light: - return Native.FontWeight.Light; - case FontWeight.Medium: - return Native.FontWeight.Medium; - case FontWeight.Normal: - return Native.FontWeight.Normal; - case FontWeight.Thin: - return Native.FontWeight.Thin; - case FontWeight.UltraLight: - return Native.FontWeight.UltraLight; - default: - return Native.FontWeight.None; - } + Control.FontWeight = Specific.GetFontWeight(Element); } } } diff --git a/Xamarin.Forms.Platform.Tizen/Renderers/LabelRenderer.cs b/Xamarin.Forms.Platform.Tizen/Renderers/LabelRenderer.cs index 3f26f4ea..49611e4b 100644 --- a/Xamarin.Forms.Platform.Tizen/Renderers/LabelRenderer.cs +++ b/Xamarin.Forms.Platform.Tizen/Renderers/LabelRenderer.cs @@ -1,5 +1,3 @@ -using Xamarin.Forms.PlatformConfiguration.TizenSpecific; - using EColor = ElmSharp.Color; using Specific = Xamarin.Forms.PlatformConfiguration.TizenSpecific.Label; @@ -75,7 +73,7 @@ namespace Xamarin.Forms.Platform.Tizen void UpdateFormattedText() { - if(Element.FormattedText != null) + if (Element.FormattedText != null) Control.FormattedText = ConvertFormattedText(Element.FormattedText); } @@ -104,9 +102,7 @@ namespace Xamarin.Forms.Platform.Tizen void UpdateFontWeight() { - var weight = Specific.GetFontWeight(Element); - - Control.FontWeight = ConvertToNativeFontWeight(weight); + Control.FontWeight = Specific.GetFontWeight(Element); } Native.LineBreakMode ConvertToNativeLineBreakMode(LineBreakMode mode) @@ -128,36 +124,5 @@ namespace Xamarin.Forms.Platform.Tizen return Native.LineBreakMode.WordWrap; } } - - Native.FontWeight ConvertToNativeFontWeight(FontWeight weight) - { - switch (weight) - { - case FontWeight.Bold: - return Native.FontWeight.Bold; - case FontWeight.SemiBold: - return Native.FontWeight.SemiBold; - case FontWeight.UltraBold: - return Native.FontWeight.UltraBold; - case FontWeight.Black: - return Native.FontWeight.Black; - case FontWeight.ExtraBlack: - return Native.FontWeight.ExtraBlack; - case FontWeight.Book: - return Native.FontWeight.Book; - case FontWeight.Light: - return Native.FontWeight.Light; - case FontWeight.Medium: - return Native.FontWeight.Medium; - case FontWeight.Normal: - return Native.FontWeight.Normal; - case FontWeight.Thin: - return Native.FontWeight.Thin; - case FontWeight.UltraLight: - return Native.FontWeight.UltraLight; - default: - return Native.FontWeight.None; - } - } } } diff --git a/Xamarin.Forms.Platform.Tizen/Xamarin.Forms.Platform.Tizen.csproj b/Xamarin.Forms.Platform.Tizen/Xamarin.Forms.Platform.Tizen.csproj index 5c8ac950..6f8a65c9 100644 --- a/Xamarin.Forms.Platform.Tizen/Xamarin.Forms.Platform.Tizen.csproj +++ b/Xamarin.Forms.Platform.Tizen/Xamarin.Forms.Platform.Tizen.csproj @@ -80,7 +80,6 @@ <Compile Include="Native\Keyboard.cs" /> <Compile Include="Native\Label.cs" /> <Compile Include="Native\LayoutEventArgs.cs" /> - <Compile Include="Native\FontWeight.cs" /> <Compile Include="Native\LineBreakMode.cs" /> <Compile Include="Native\ListView.cs" /> <Compile Include="Native\MasterDetailPage.cs" /> |