diff options
author | Seungkeun Lee <sngn.lee@samsung.com> | 2017-02-06 13:41:42 +0900 |
---|---|---|
committer | Kangho Hur <kangho.hur@samsung.com> | 2017-04-24 13:36:53 +0900 |
commit | ccf5c7c8f3a41a2b8708a7878b2dbbcb8ccd239c (patch) | |
tree | 4b20f7da9647ca53094163489f7ab51ecf735baf /Xamarin.Forms.Platform.Tizen/Renderers | |
parent | 4d6965f38d159879ec9d1fba45cb7d146470c99f (diff) | |
download | xamarin-forms-ccf5c7c8f3a41a2b8708a7878b2dbbcb8ccd239c.tar.gz xamarin-forms-ccf5c7c8f3a41a2b8708a7878b2dbbcb8ccd239c.tar.bz2 xamarin-forms-ccf5c7c8f3a41a2b8708a7878b2dbbcb8ccd239c.zip |
Refactoring Label Renderer
- Optimize FormattedText handling
- Define a new Value of TextAlignment, LineBreakMode for default value
- Old-version of Span used a wrong specific value of Alignement and LineBreakMode
Change-Id: I78baded712ce18f279774b09608c2a2d19931a69
Diffstat (limited to 'Xamarin.Forms.Platform.Tizen/Renderers')
-rw-r--r-- | Xamarin.Forms.Platform.Tizen/Renderers/LabelRenderer.cs | 27 |
1 files changed, 1 insertions, 26 deletions
diff --git a/Xamarin.Forms.Platform.Tizen/Renderers/LabelRenderer.cs b/Xamarin.Forms.Platform.Tizen/Renderers/LabelRenderer.cs index a1c07134..3f26f4ea 100644 --- a/Xamarin.Forms.Platform.Tizen/Renderers/LabelRenderer.cs +++ b/Xamarin.Forms.Platform.Tizen/Renderers/LabelRenderer.cs @@ -65,9 +65,6 @@ namespace Xamarin.Forms.Platform.Tizen nativeSpan.FontAttributes = span.FontAttributes; nativeSpan.FontFamily = span.FontFamily; nativeSpan.FontSize = span.FontSize; - nativeSpan.LineBreakMode = Control.LineBreakMode; - nativeSpan.HorizontalTextAlignment = Control.HorizontalTextAlignment; - nativeSpan.VerticalTextAlignment = Control.VerticalTextAlignment; nativeSpan.ForegroundColor = span.ForegroundColor.ToNative(); nativeSpan.BackgroundColor = span.BackgroundColor.ToNative(); nativeString.Spans.Add(nativeSpan); @@ -89,15 +86,6 @@ namespace Xamarin.Forms.Platform.Tizen void UpdateTextAlignment() { - if (Control.FormattedText != null) - { - foreach (var span in Control.FormattedText.Spans) - { - span.HorizontalTextAlignment = Element.HorizontalTextAlignment.ToNative(); - span.VerticalTextAlignment = Element.VerticalTextAlignment.ToNative(); - } - } - Control.HorizontalTextAlignment = Element.HorizontalTextAlignment.ToNative(); Control.VerticalTextAlignment = Element.VerticalTextAlignment.ToNative(); } @@ -111,26 +99,13 @@ namespace Xamarin.Forms.Platform.Tizen void UpdateLineBreakMode() { - if (Control.FormattedText != null) - { - foreach (var span in Control.FormattedText.Spans) - { - span.LineBreakMode = ConvertToNativeLineBreakMode(Element.LineBreakMode); - } - } Control.LineBreakMode = ConvertToNativeLineBreakMode(Element.LineBreakMode); } void UpdateFontWeight() { var weight = Specific.GetFontWeight(Element); - if (Control.FormattedText != null) - { - foreach (var span in Control.FormattedText.Spans) - { - span.FontWeight = ConvertToNativeFontWeight(weight); - } - } + Control.FontWeight = ConvertToNativeFontWeight(weight); } |