From 8ca9238616fbb8f8e90a608516f5ac343ce62999 Mon Sep 17 00:00:00 2001 From: Seungkeun Lee Date: Mon, 19 Dec 2016 09:18:31 +0900 Subject: Fix TextCell text color bug - Remove predefined default color in CellRenderers - handle Color.Default in Span Change-Id: I901f93c4b9d929b9d3e646ae29a5a3fb81237152 --- Xamarin.Forms.Platform.Tizen/Native/Span.cs | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'Xamarin.Forms.Platform.Tizen/Native') diff --git a/Xamarin.Forms.Platform.Tizen/Native/Span.cs b/Xamarin.Forms.Platform.Tizen/Native/Span.cs index 6c479e34..7ac4134f 100644 --- a/Xamarin.Forms.Platform.Tizen/Native/Span.cs +++ b/Xamarin.Forms.Platform.Tizen/Native/Span.cs @@ -8,6 +8,7 @@ namespace Xamarin.Forms.Platform.Tizen.Native /// public class Span { + static EColor s_defaultLineColor = EColor.Black; string _text; /// @@ -111,8 +112,8 @@ namespace Xamarin.Forms.Platform.Tizen.Native FontFamily = ""; FontSize = -1; FontAttributes = FontAttributes.None; - ForegroundColor = EColor.White; - BackgroundColor = EColor.Transparent; + ForegroundColor = EColor.Default; + BackgroundColor = EColor.Default; HorizontalTextAlignment = TextAlignment.Auto; VerticalTextAlignment = TextAlignment.Auto; LineBreakMode = LineBreakMode.MixedWrap; @@ -157,12 +158,15 @@ namespace Xamarin.Forms.Platform.Tizen.Native StringBuilder PrepareFormattingString(StringBuilder _formattingString) { - var foregroundColor = ForegroundColor.ToHex(); - - _formattingString.AppendFormat("color={0} ", foregroundColor); + if (!ForegroundColor.IsDefault) + { + _formattingString.AppendFormat("color={0} ", ForegroundColor.ToHex()); + } - _formattingString.AppendFormat("backing_color={0} ", BackgroundColor.ToHex()); - _formattingString.Append("backing=on "); + if (!BackgroundColor.IsDefault) + { + _formattingString.AppendFormat("backing_color={0} backing=on ", BackgroundColor.ToHex()); + } if (!string.IsNullOrEmpty(FontFamily)) { @@ -185,12 +189,14 @@ namespace Xamarin.Forms.Platform.Tizen.Native if (Underline) { - _formattingString.AppendFormat("underline=on underline_color={0} ", foregroundColor); + _formattingString.AppendFormat("underline=on underline_color={0} ", + ForegroundColor.IsDefault ? s_defaultLineColor.ToHex() : ForegroundColor.ToHex()); } if (Strikethrough) { - _formattingString.AppendFormat("strikethrough=on strikethrough_color={0} ", foregroundColor); + _formattingString.AppendFormat("strikethrough=on strikethrough_color={0} ", + ForegroundColor.IsDefault ? s_defaultLineColor.ToHex() : ForegroundColor.ToHex()); } switch (HorizontalTextAlignment) -- cgit v1.2.3