From 5e828471918bb78da16d28a640a04edc7ed7019b Mon Sep 17 00:00:00 2001 From: Seungkeun Lee Date: Tue, 4 Apr 2017 16:58:12 +0900 Subject: Fix Label layout issue - TCAPI-2251 - This issuse was caused by wrong minimum size - Layout class was depend on request size and minium size to layouting If minium size was (0,0) layout will resize to smaller than request size So, Label should be set proper minimum size Change-Id: I895c32d26ca7b090b185f5ff3793638cec6229a2 --- Xamarin.Forms.Platform.Tizen/Native/Label.cs | 16 +--------------- Xamarin.Forms.Platform.Tizen/Renderers/LabelRenderer.cs | 2 +- 2 files changed, 2 insertions(+), 16 deletions(-) (limited to 'Xamarin.Forms.Platform.Tizen') diff --git a/Xamarin.Forms.Platform.Tizen/Native/Label.cs b/Xamarin.Forms.Platform.Tizen/Native/Label.cs index a75e6aa8..b81a24e2 100644 --- a/Xamarin.Forms.Platform.Tizen/Native/Label.cs +++ b/Xamarin.Forms.Platform.Tizen/Native/Label.cs @@ -312,32 +312,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/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) -- cgit v1.2.3 From 2722ecf0e021b81fccc02fefe8247bc2a4122770 Mon Sep 17 00:00:00 2001 From: Seungkeun Lee Date: Wed, 5 Apr 2017 13:38:22 +0900 Subject: Remove VerticalTextAlignment functionality in Label - EFL dose not support yet - Remove VerticalTextAlignment property in Native.Span it was wrong implemented, valign in EFL is semantically different from Xamarin.Forms VerticalTextAlignment - If provide VerticalTextAlignment API in EFL, this feature need to reimplement Change-Id: I502700db74c7410529e46898578640abbd1253ef --- Xamarin.Forms.Platform.Tizen/Native/Label.cs | 16 +++------------- Xamarin.Forms.Platform.Tizen/Native/Span.cs | 26 -------------------------- 2 files changed, 3 insertions(+), 39 deletions(-) (limited to 'Xamarin.Forms.Platform.Tizen') diff --git a/Xamarin.Forms.Platform.Tizen/Native/Label.cs b/Xamarin.Forms.Platform.Tizen/Native/Label.cs index b81a24e2..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 /// The vertical text alignment. public TextAlignment VerticalTextAlignment { - get - { - return _span.VerticalTextAlignment; - } - - set - { - if (value != _span.VerticalTextAlignment) - { - _span.VerticalTextAlignment = value; - ApplyTextAndStyle(); - } - } + // TODO. need to EFL new API + get; + set; } /// 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 @@ -94,12 +94,6 @@ namespace Xamarin.Forms.Platform.Tizen.Native /// public TextAlignment HorizontalTextAlignment { get; set; } - /// - /// Gets or sets the vertical alignment mode for the text. - /// See for information about TextAlignment. - /// - public TextAlignment VerticalTextAlignment { get; set; } - /// /// Gets or sets the value that indicates whether the text has underline. /// @@ -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: -- cgit v1.2.3