summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKangho Hur <kangho.hur@samsung.com>2017-02-07 00:42:56 (GMT)
committerGerrit Code Review <gerrit@review.vlan103.tizen.org>2017-02-07 00:42:56 (GMT)
commit55c5428629000fe9c7b8fbdb491869711def44f9 (patch)
tree09a5a27f92cd6c913e2036800018e520ce30d86a
parentedf97c434e1149dfabd6a6f21cb42724cb4b442f (diff)
parent12d6d2143986f5dcef4e498ae53f3fd28f763555 (diff)
downloadxamarin-forms-55c5428629000fe9c7b8fbdb491869711def44f9.zip
xamarin-forms-55c5428629000fe9c7b8fbdb491869711def44f9.tar.gz
xamarin-forms-55c5428629000fe9c7b8fbdb491869711def44f9.tar.bz2
Merge "Refactoring Label Renderer" into tizen
-rw-r--r--Xamarin.Forms.Platform.Tizen/Native/LineBreakMode.cs7
-rw-r--r--Xamarin.Forms.Platform.Tizen/Native/Span.cs15
-rw-r--r--Xamarin.Forms.Platform.Tizen/Native/TextAlignment.cs5
-rw-r--r--Xamarin.Forms.Platform.Tizen/Renderers/LabelRenderer.cs27
4 files changed, 24 insertions, 30 deletions
diff --git a/Xamarin.Forms.Platform.Tizen/Native/LineBreakMode.cs b/Xamarin.Forms.Platform.Tizen/Native/LineBreakMode.cs
index 27253ad..e8727f4 100644
--- a/Xamarin.Forms.Platform.Tizen/Native/LineBreakMode.cs
+++ b/Xamarin.Forms.Platform.Tizen/Native/LineBreakMode.cs
@@ -6,6 +6,11 @@ namespace Xamarin.Forms.Platform.Tizen.Native
public enum LineBreakMode
{
/// <summary>
+ /// Follow base LineBreakMode.
+ /// </summary>
+ None,
+
+ /// <summary>
/// Do not wrap text.
/// </summary>
NoWrap,
@@ -38,6 +43,6 @@ namespace Xamarin.Forms.Platform.Tizen.Native
/// <summary>
/// Truncate the tail of text.
/// </summary>
- TailTruncation
+ TailTruncation,
}
}
diff --git a/Xamarin.Forms.Platform.Tizen/Native/Span.cs b/Xamarin.Forms.Platform.Tizen/Native/Span.cs
index 41a20b7..50d596a 100644
--- a/Xamarin.Forms.Platform.Tizen/Native/Span.cs
+++ b/Xamarin.Forms.Platform.Tizen/Native/Span.cs
@@ -121,9 +121,9 @@ namespace Xamarin.Forms.Platform.Tizen.Native
FontAttributes = FontAttributes.None;
ForegroundColor = EColor.Default;
BackgroundColor = EColor.Default;
- HorizontalTextAlignment = TextAlignment.Auto;
- VerticalTextAlignment = TextAlignment.Auto;
- LineBreakMode = LineBreakMode.MixedWrap;
+ HorizontalTextAlignment = TextAlignment.None;
+ VerticalTextAlignment = TextAlignment.None;
+ LineBreakMode = LineBreakMode.None;
Underline = false;
Strikethrough = false;
}
@@ -264,6 +264,9 @@ namespace Xamarin.Forms.Platform.Tizen.Native
case TextAlignment.Center:
_formattingString.Append("align=center ");
break;
+
+ case TextAlignment.None:
+ break;
}
switch (VerticalTextAlignment)
@@ -280,6 +283,9 @@ namespace Xamarin.Forms.Platform.Tizen.Native
case TextAlignment.Center:
_formattingString.Append("valign=middle ");
break;
+
+ case TextAlignment.None:
+ break;
}
switch (LineBreakMode)
@@ -311,6 +317,9 @@ namespace Xamarin.Forms.Platform.Tizen.Native
case LineBreakMode.TailTruncation:
_formattingString.Append("ellipsis=1.0");
break;
+
+ case LineBreakMode.None:
+ break;
}
return _formattingString;
diff --git a/Xamarin.Forms.Platform.Tizen/Native/TextAlignment.cs b/Xamarin.Forms.Platform.Tizen/Native/TextAlignment.cs
index c7e934b..33fa72b 100644
--- a/Xamarin.Forms.Platform.Tizen/Native/TextAlignment.cs
+++ b/Xamarin.Forms.Platform.Tizen/Native/TextAlignment.cs
@@ -6,6 +6,11 @@ namespace Xamarin.Forms.Platform.Tizen.Native
public enum TextAlignment
{
/// <summary>
+ /// Follow base TextAlignment
+ /// </summary>
+ None,
+
+ /// <summary>
/// Aligns horizontal text according to language. Top aligned for vertical text.
/// </summary>
Auto,
diff --git a/Xamarin.Forms.Platform.Tizen/Renderers/LabelRenderer.cs b/Xamarin.Forms.Platform.Tizen/Renderers/LabelRenderer.cs
index a1c0713..3f26f4e 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);
}