diff options
author | darkleem <cdark.lim@samsung.com> | 2017-06-21 15:43:46 +0900 |
---|---|---|
committer | Kangho Hur <kangho.hur@samsung.com> | 2017-07-10 11:11:27 +0900 |
commit | 217712866c28213ec574662eef9a65764577f15f (patch) | |
tree | 80d0e5afa360aaba833664c50c53663de76ea14f /Xamarin.Forms.Platform.Tizen/Native | |
parent | 535265c5ad415d89ea596385ac4d75436f957a3a (diff) | |
download | xamarin-forms-217712866c28213ec574662eef9a65764577f15f.tar.gz xamarin-forms-217712866c28213ec574662eef9a65764577f15f.tar.bz2 xamarin-forms-217712866c28213ec574662eef9a65764577f15f.zip |
fix Date/TimePicker crash and handle issue
- TASK=TCAP-2529
- editfield style handle issue(opacity, enabled..)
Change-Id: Ie07113aa5d1f625a6dcc69492d38c5ca1d98aad1
Signed-off-by: darkleem <cdark.lim@samsung.com>
Diffstat (limited to 'Xamarin.Forms.Platform.Tizen/Native')
-rw-r--r-- | Xamarin.Forms.Platform.Tizen/Native/EditfieldEntry.cs | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/Xamarin.Forms.Platform.Tizen/Native/EditfieldEntry.cs b/Xamarin.Forms.Platform.Tizen/Native/EditfieldEntry.cs new file mode 100644 index 00000000..0091d253 --- /dev/null +++ b/Xamarin.Forms.Platform.Tizen/Native/EditfieldEntry.cs @@ -0,0 +1,49 @@ +using ElmSharp; +using System; +using ELayout = ElmSharp.Layout; + +namespace Xamarin.Forms.Platform.Tizen.Native +{ + public class EditfieldEntry : Native.Entry, IMeasurable + { + ELayout _editfieldLayout; + int _heightPadding = 0; + + public EditfieldEntry(EvasObject parent) : base(parent) + { + } + + protected override IntPtr CreateHandle(EvasObject parent) + { + var bg = new ELayout(parent); + bg.SetTheme("layout", "background", "default"); + _editfieldLayout = new ELayout(parent); + _editfieldLayout.SetTheme("layout", "editfield", "singleline"); + + Handle = base.CreateHandle(parent); + _editfieldLayout.SetPartContent("elm.swallow.content", this); + bg.SetPartContent("elm.swallow.content", _editfieldLayout); + + // The minimun size for the Content area of an Editfield. This is used to calculate the size when layouting. + _heightPadding = _editfieldLayout.EdjeObject["elm.swallow.content"].Geometry.Height; + return bg; + } + + public new ElmSharp.Size Measure(int availableWidth, int availableHeight) + { + var textBlockSize = base.Measure(availableWidth, availableHeight); + + // Calculate the minimum size by adding the width of a TextBlock and an Editfield. + textBlockSize.Width += _editfieldLayout.MinimumWidth; + + // If the height of a TextBlock is shorter than Editfield, use the minimun height of the Editfield. + // Or add the height of the EditField to the TextBlock + if (textBlockSize.Height < _editfieldLayout.MinimumHeight) + textBlockSize.Height = _editfieldLayout.MinimumHeight; + else + textBlockSize.Height += _heightPadding; + + return textBlockSize; + } + } +}
\ No newline at end of file |