If we never set text into TextLabel before, the result of Text propert getter is always empty.
To avoid useless C# - native network, let we just ignore text getter function if we can assume that previous text was empty.
Signed-off-by: Eunki Hong <eunkiki.hong@samsung.com>
private TextLabelSelectorData selectorData;
private string fontFamily = defaultFontFamily;
private float fontSizeScale = 1.0f;
private TextLabelSelectorData selectorData;
private string fontFamily = defaultFontFamily;
private float fontSizeScale = 1.0f;
+
+ private bool textIsEmpty = true;
+
private bool hasSystemLanguageChanged = false;
private bool hasSystemFontSizeChanged = false;
private bool hasSystemFontTypeChanged = false;
private bool hasSystemLanguageChanged = false;
private bool hasSystemFontSizeChanged = false;
private bool hasSystemFontTypeChanged = false;
public TextLabel(string text) : this(Interop.TextLabel.New(text, ThemeManager.GetStyle(defaultStyleName) == null ? false : true), true)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
public TextLabel(string text) : this(Interop.TextLabel.New(text, ThemeManager.GetStyle(defaultStyleName) == null ? false : true), true)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ textIsEmpty = string.IsNullOrEmpty(text);
public TextLabel(string text, bool shown) : this(Interop.TextLabel.New(text, ThemeManager.GetStyle(defaultStyleName) == null ? false : true), true)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
public TextLabel(string text, bool shown) : this(Interop.TextLabel.New(text, ThemeManager.GetStyle(defaultStyleName) == null ? false : true), true)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ textIsEmpty = string.IsNullOrEmpty(text);
{
var textLabel = (TextLabel)bindable;
{
var textLabel = (TextLabel)bindable;
- return Object.InternalGetPropertyString(textLabel.SwigCPtr, TextLabel.Property.TEXT);
+ // Do not try to get string if we know that previous text was empty.
+ return textLabel.textIsEmpty ? "" : Object.InternalGetPropertyString(textLabel.SwigCPtr, TextLabel.Property.TEXT);
}));
/// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
}));
/// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
+ textIsEmpty = string.IsNullOrEmpty(value);
Object.InternalSetPropertyString(SwigCPtr, TextLabel.Property.TEXT, value);
RequestLayout();
Object.InternalSetPropertyString(SwigCPtr, TextLabel.Property.TEXT, value);
RequestLayout();