summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Xamarin.Forms.Platform.Tizen/Cells/CellRenderer.cs8
-rw-r--r--Xamarin.Forms.Platform.Tizen/Cells/EntryCellRenderer.cs5
-rw-r--r--Xamarin.Forms.Platform.Tizen/Cells/TextCellRenderer.cs6
-rw-r--r--Xamarin.Forms.Platform.Tizen/Native/Span.cs24
4 files changed, 24 insertions, 19 deletions
diff --git a/Xamarin.Forms.Platform.Tizen/Cells/CellRenderer.cs b/Xamarin.Forms.Platform.Tizen/Cells/CellRenderer.cs
index 1cda74c2..47019051 100644
--- a/Xamarin.Forms.Platform.Tizen/Cells/CellRenderer.cs
+++ b/Xamarin.Forms.Platform.Tizen/Cells/CellRenderer.cs
@@ -7,8 +7,6 @@ namespace Xamarin.Forms.Platform.Tizen
public abstract class CellRenderer : IRegisterable
{
const string _heightProperty = "Height";
- protected static readonly EColor s_defaultTextColor = EColor.Black;
- protected static readonly EColor s_defaultBackgroundColor = EColor.White;
readonly Dictionary<Cell, Dictionary<string, EvasObject>> _realizedNativeViews = new Dictionary<Cell, Dictionary<string, EvasObject>>();
protected CellRenderer(string style)
@@ -69,9 +67,9 @@ namespace Xamarin.Forms.Platform.Tizen
{
var nativeSpan = new Native.Span();
nativeSpan.Text = span.Text;
- nativeSpan.ForegroundColor = span.ForegroundColor.IsDefault ? s_defaultTextColor : span.ForegroundColor.ToNative();
+ nativeSpan.ForegroundColor = span.ForegroundColor.ToNative();
nativeSpan.FontAttributes = span.FontAttributes;
- nativeSpan.BackgroundColor = span.BackgroundColor.IsDefault ? s_defaultBackgroundColor : span.BackgroundColor.ToNative();
+ nativeSpan.BackgroundColor = span.BackgroundColor.ToNative();
nativeSpan.FontSize = span.FontSize;
nativeSpan.FontFamily = span.FontFamily;
return nativeSpan;
@@ -106,7 +104,7 @@ namespace Xamarin.Forms.Platform.Tizen
string GetText(object data, string part)
{
var span = OnGetText((data as Native.ListView.ItemContext).Cell, part);
- return span != null ? ToNative(span).GetDecoratedText() : null;
+ return span != null ? ToNative(span).GetMarkupText() : null;
}
EvasObject GetContent(object data, string part)
diff --git a/Xamarin.Forms.Platform.Tizen/Cells/EntryCellRenderer.cs b/Xamarin.Forms.Platform.Tizen/Cells/EntryCellRenderer.cs
index c07985f8..4c4e7f19 100644
--- a/Xamarin.Forms.Platform.Tizen/Cells/EntryCellRenderer.cs
+++ b/Xamarin.Forms.Platform.Tizen/Cells/EntryCellRenderer.cs
@@ -8,6 +8,7 @@ namespace Xamarin.Forms.Platform.Tizen
public class EntryCellRenderer : ViewCellRenderer
{
const int _defaultHeight = 120;
+ static readonly EColor s_defaultLabelColor = EColor.Black;
readonly Dictionary<EvasObject, NativeEntryComponent> _realizedComponent = new Dictionary<EvasObject, NativeEntryComponent>();
public EntryCellRenderer()
@@ -46,9 +47,7 @@ namespace Xamarin.Forms.Platform.Tizen
{
IsSingleLine = true,
Text = entryCell.Text,
- TextColor = s_defaultTextColor,
Placeholder = entryCell.Placeholder,
- PlaceholderColor = s_defaultTextColor,
Keyboard = entryCell.Keyboard.ToNative(),
HorizontalTextAlignment = entryCell.HorizontalTextAlignment.ToNative(),
};
@@ -151,7 +150,7 @@ namespace Xamarin.Forms.Platform.Tizen
EColor GetLabelColor(EntryCell cell)
{
- return cell.LabelColor.IsDefault ? s_defaultTextColor : cell.LabelColor.ToNative();
+ return cell.LabelColor.IsDefault ? s_defaultLabelColor : cell.LabelColor.ToNative();
}
class NativeEntryComponent
diff --git a/Xamarin.Forms.Platform.Tizen/Cells/TextCellRenderer.cs b/Xamarin.Forms.Platform.Tizen/Cells/TextCellRenderer.cs
index 2bea3848..1f9594a1 100644
--- a/Xamarin.Forms.Platform.Tizen/Cells/TextCellRenderer.cs
+++ b/Xamarin.Forms.Platform.Tizen/Cells/TextCellRenderer.cs
@@ -34,7 +34,8 @@ namespace Xamarin.Forms.Platform.Tizen
return new Span()
{
Text = cell.Text,
- ForegroundColor = cell.TextColor
+ ForegroundColor = cell.TextColor,
+ FontSize = -1
};
}
@@ -43,7 +44,8 @@ namespace Xamarin.Forms.Platform.Tizen
return new Span()
{
Text = cell.Detail,
- ForegroundColor = cell.DetailColor
+ ForegroundColor = cell.DetailColor,
+ FontSize = -1
};
}
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)