From: dongsug-song <35130733+dongsug-song@users.noreply.github.com> Date: Tue, 25 Jun 2019 05:18:52 +0000 (+0900) Subject: [NUI] Add TextFit in TextLabel (#898) X-Git-Tag: submit/tizen/20190626.005203~1^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3510cf6e6c1b1363feb3ec36a64397478447b729;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [NUI] Add TextFit in TextLabel (#898) --- diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.TextLabel.cs b/src/Tizen.NUI/src/internal/Interop/Interop.TextLabel.cs index 3db9091cb..b398f6056 100755 --- a/src/Tizen.NUI/src/internal/Interop/Interop.TextLabel.cs +++ b/src/Tizen.NUI/src/internal/Interop/Interop.TextLabel.cs @@ -160,6 +160,10 @@ namespace Tizen.NUI [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_SWIGUpcast")] public static extern global::System.IntPtr TextLabel_SWIGUpcast(global::System.IntPtr jarg1); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_TextLabel_Property_TEXT_FIT_get")] + public static extern int TextLabel_Property_TEXT_FIT_get(); + } } } diff --git a/src/Tizen.NUI/src/public/BaseComponents/TextLabel.cs b/src/Tizen.NUI/src/public/BaseComponents/TextLabel.cs index a0311d981..820f38a30 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/TextLabel.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/TextLabel.cs @@ -505,6 +505,24 @@ namespace Tizen.NUI.BaseComponents return temp; }); + /// Only for XAML. No need of public API. Make hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty TextFitProperty = BindableProperty.Create(nameof(TextFit), typeof(PropertyMap), typeof(TextLabel), null, propertyChanged: (bindable, oldValue, newValue) => + { + var textLabel = (TextLabel)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.TEXT_FIT, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textLabel = (TextLabel)bindable; + PropertyMap temp = new PropertyMap(); + Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.TEXT_FIT).Get(temp); + return temp; + }); + private global::System.Runtime.InteropServices.HandleRef swigCPtr; private string textLabelSid = null; private bool systemlangTextFlag = false; @@ -1211,6 +1229,30 @@ namespace Tizen.NUI.BaseComponents } } + /// + /// The text fit parameters.
+ /// The textFit map contains the following keys :
+ /// - enable (bool type) : True to enable the text fit or false to disable(the default value is false)
+ /// - minSize (float type) : Minimum Size for text fit(the default value is 10.f)
+ /// - maxSize (float type) : Maximum Size for text fit(the default value is 100.f)
+ /// - stepSize (float type) : Step Size for font increase(the default value is 1.f)
+ /// - fontSize (string type) : The size type of font, You can choose between "pointSize" or "pixelSize". (the default value is "pointSize")
+ ///
+ /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public PropertyMap TextFit + { + get + { + return (PropertyMap)GetValue(TextFitProperty); + } + set + { + SetValue(TextFitProperty, value); + NotifyPropertyChanged(); + } + } + /// /// Downcasts a handle to textLabel handle /// @@ -1315,6 +1357,7 @@ namespace Tizen.NUI.BaseComponents internal static readonly int TEXT_DIRECTION = Interop.TextLabel.TextLabel_Property_TEXT_DIRECTION_get(); internal static readonly int VERTICAL_LINE_ALIGNMENT = Interop.TextLabel.TextLabel_Property_VERTICAL_LINE_ALIGNMENT_get(); internal static readonly int MATCH_SYSTEM_LANGUAGE_DIRECTION = Interop.TextLabel.TextLabel_Property_MATCH_SYSTEM_LANGUAGE_DIRECTION_get(); + internal static readonly int TEXT_FIT = Interop.TextLabel.TextLabel_Property_TEXT_FIT_get(); } } }