summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.Tizen/Native
diff options
context:
space:
mode:
authorSeungkeun Lee <sngn.lee@samsung.com>2016-12-19 09:18:31 +0900
committerKangho Hur <kangho.hur@samsung.com>2017-03-24 13:18:57 +0900
commit8ca9238616fbb8f8e90a608516f5ac343ce62999 (patch)
tree654fd978bc7179f75ea7f5c58c206c2129f0a6ea /Xamarin.Forms.Platform.Tizen/Native
parent4f0149dae93bf80770664d74a33f27c8f0821310 (diff)
downloadxamarin-forms-8ca9238616fbb8f8e90a608516f5ac343ce62999.tar.gz
xamarin-forms-8ca9238616fbb8f8e90a608516f5ac343ce62999.tar.bz2
xamarin-forms-8ca9238616fbb8f8e90a608516f5ac343ce62999.zip
Fix TextCell text color bug
- Remove predefined default color in CellRenderers - handle Color.Default in Span Change-Id: I901f93c4b9d929b9d3e646ae29a5a3fb81237152
Diffstat (limited to 'Xamarin.Forms.Platform.Tizen/Native')
-rw-r--r--Xamarin.Forms.Platform.Tizen/Native/Span.cs24
1 files changed, 15 insertions, 9 deletions
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
/// </summary>
public class Span
{
+ static EColor s_defaultLineColor = EColor.Black;
string _text;
/// <summary>
@@ -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)