summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.Tizen
diff options
context:
space:
mode:
authorKangho Hur <kangho.hur@samsung.com>2017-04-05 23:55:46 -0700
committerGerrit Code Review <gerrit@review.vlan103.tizen.org>2017-04-05 23:55:46 -0700
commitbb185bd7545f26dff8a53d799c779f8c4524c602 (patch)
treea98ceffcd9ce0b5b651df4f6b973134e59441717 /Xamarin.Forms.Platform.Tizen
parentda5c5a3da5f1828337bbb1a2f810220dc28e73e8 (diff)
parent2722ecf0e021b81fccc02fefe8247bc2a4122770 (diff)
downloadxamarin-forms-bb185bd7545f26dff8a53d799c779f8c4524c602.tar.gz
xamarin-forms-bb185bd7545f26dff8a53d799c779f8c4524c602.tar.bz2
xamarin-forms-bb185bd7545f26dff8a53d799c779f8c4524c602.zip
Merge changes I502700db,I895c32d2 into tizen
* changes: Remove VerticalTextAlignment functionality in Label Fix Label layout issue
Diffstat (limited to 'Xamarin.Forms.Platform.Tizen')
-rw-r--r--Xamarin.Forms.Platform.Tizen/Native/Label.cs32
-rw-r--r--Xamarin.Forms.Platform.Tizen/Native/Span.cs26
-rw-r--r--Xamarin.Forms.Platform.Tizen/Renderers/LabelRenderer.cs2
3 files changed, 5 insertions, 55 deletions
diff --git a/Xamarin.Forms.Platform.Tizen/Native/Label.cs b/Xamarin.Forms.Platform.Tizen/Native/Label.cs
index a75e6aa8..44eb5cb9 100644
--- a/Xamarin.Forms.Platform.Tizen/Native/Label.cs
+++ b/Xamarin.Forms.Platform.Tizen/Native/Label.cs
@@ -243,19 +243,9 @@ namespace Xamarin.Forms.Platform.Tizen.Native
/// <value>The vertical text alignment.</value>
public TextAlignment VerticalTextAlignment
{
- get
- {
- return _span.VerticalTextAlignment;
- }
-
- set
- {
- if (value != _span.VerticalTextAlignment)
- {
- _span.VerticalTextAlignment = value;
- ApplyTextAndStyle();
- }
- }
+ // TODO. need to EFL new API
+ get;
+ set;
}
/// <summary>
@@ -312,32 +302,18 @@ namespace Xamarin.Forms.Platform.Tizen.Native
Resize(availableWidth, size.Height);
- var rawSize = Native.TextHelper.GetRawTextBlockSize(this);
var formattedSize = Native.TextHelper.GetFormattedTextBlockSize(this);
Resize(size.Width, size.Height);
// Set bottom padding for lower case letters that have segments below the bottom line of text (g, j, p, q, y).
var verticalPadding = (int)Math.Ceiling(0.05 * FontSize);
- rawSize.Height += verticalPadding;
formattedSize.Height += verticalPadding;
// This is the EFL team's guide.
// For wrap to work properly, the label must be 1 pixel larger than the size of the formatted text.
- rawSize.Width += 1;
formattedSize.Width += 1;
- if (rawSize.Width > availableWidth)
- {
- return new ESize()
- {
- Width = formattedSize.Width,
- Height = Math.Min(formattedSize.Height, Math.Max(rawSize.Height, availableHeight)),
- };
- }
- else
- {
- return formattedSize;
- }
+ return formattedSize;
}
void ApplyTextAndStyle()
diff --git a/Xamarin.Forms.Platform.Tizen/Native/Span.cs b/Xamarin.Forms.Platform.Tizen/Native/Span.cs
index 99fe008e..2f266494 100644
--- a/Xamarin.Forms.Platform.Tizen/Native/Span.cs
+++ b/Xamarin.Forms.Platform.Tizen/Native/Span.cs
@@ -95,12 +95,6 @@ namespace Xamarin.Forms.Platform.Tizen.Native
public TextAlignment HorizontalTextAlignment { get; set; }
/// <summary>
- /// Gets or sets the vertical alignment mode for the text.
- /// See <see cref="TextAlignment"/> for information about TextAlignment.
- /// </summary>
- public TextAlignment VerticalTextAlignment { get; set; }
-
- /// <summary>
/// Gets or sets the value that indicates whether the text has underline.
/// </summary>
public bool Underline { get; set; }
@@ -123,7 +117,6 @@ namespace Xamarin.Forms.Platform.Tizen.Native
ForegroundColor = EColor.Default;
BackgroundColor = EColor.Default;
HorizontalTextAlignment = TextAlignment.None;
- VerticalTextAlignment = TextAlignment.None;
LineBreakMode = LineBreakMode.None;
Underline = false;
Strikethrough = false;
@@ -238,25 +231,6 @@ namespace Xamarin.Forms.Platform.Tizen.Native
break;
}
- switch (VerticalTextAlignment)
- {
- case TextAlignment.Auto:
- case TextAlignment.Start:
- _formattingString.Append("valign=top ");
- break;
-
- case TextAlignment.End:
- _formattingString.Append("valign=bottom ");
- break;
-
- case TextAlignment.Center:
- _formattingString.Append("valign=middle ");
- break;
-
- case TextAlignment.None:
- break;
- }
-
switch (LineBreakMode)
{
case LineBreakMode.NoWrap:
diff --git a/Xamarin.Forms.Platform.Tizen/Renderers/LabelRenderer.cs b/Xamarin.Forms.Platform.Tizen/Renderers/LabelRenderer.cs
index 49611e4b..be5de861 100644
--- a/Xamarin.Forms.Platform.Tizen/Renderers/LabelRenderer.cs
+++ b/Xamarin.Forms.Platform.Tizen/Renderers/LabelRenderer.cs
@@ -44,7 +44,7 @@ namespace Xamarin.Forms.Platform.Tizen
protected override Size MinimumSize()
{
- return new Size(Control.MinimumWidth, Control.MinimumHeight);
+ return Control.Measure(Control.MinimumWidth, Control.MinimumHeight).ToDP();
}
Native.FormattedString ConvertFormattedText(FormattedString formattedString)