[EditorBrowsable(EditorBrowsableState.Never)]
public class TextFieldStyle : ViewStyle
{
- /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public static readonly BindableProperty TranslatablePlaceholderTextSelectorProperty = BindableProperty.Create("TranslatablePlaceholderTextSelector", typeof(Selector<string>), typeof(TextFieldStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
- {
- var textFieldStyle = (TextFieldStyle)bindable;
- textFieldStyle.translatablePlaceholderTextSelector = ((Selector<string>)newValue)?.Clone();
- },
- defaultValueCreator: (bindable) =>
- {
- var textFieldStyle = (TextFieldStyle)bindable;
- return textFieldStyle.translatablePlaceholderTextSelector;
- });
- /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public static readonly BindableProperty FontFamilySelectorProperty = BindableProperty.Create("FontFamilySelector", typeof(Selector<string>), typeof(TextFieldStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
{
private bool? enableSelection;
private bool? ellipsis;
private bool? matchSystemLanguageDirection;
- private Selector<string> translatablePlaceholderTextSelector;
private Selector<string> fontFamilySelector;
private Selector<Color> textColorSelector;
private Selector<float?> pointSizeSelector;
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public Selector<string> TranslatablePlaceholderText
- {
- get
- {
- Selector<string> tmp = (Selector<string>)GetValue(TranslatablePlaceholderTextSelectorProperty);
- return (null != tmp) ? tmp : translatablePlaceholderTextSelector = new Selector<string>();
- }
- set => SetValue(TranslatablePlaceholderTextSelectorProperty, value);
- }
-
- /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
public string PlaceholderText
{
get => (string)GetValue(PlaceholderTextProperty);
{
private string textFieldTextSid = null;
private string textFieldPlaceHolderTextSid = null;
+ private string textFieldPlaceHolderTextFocusedSid = null;
private bool systemlangTextFlag = false;
private InputMethodContext inputMethodCotext = null;
private TextFieldSelectorData selectorData;
}
/// <summary>
+ /// The TranslatablePlaceholderTextFocused property.<br />
+ /// The text can set the SID value.<br />
+ /// </summary>
+ /// <exception cref='ArgumentNullException'>
+ /// ResourceManager about multilingual is null.
+ /// </exception>
+ /// This will be public opened in tizen_6.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public string TranslatablePlaceholderTextFocused
+ {
+ get
+ {
+ return (string)GetValue(TranslatablePlaceholderTextFocusedProperty);
+ }
+ set
+ {
+ SetValue(TranslatablePlaceholderTextFocusedProperty, value);
+ selectorData?.TranslatablePlaceholderTextFocused?.Reset(this);
+ }
+ }
+ private string translatablePlaceholderTextFocused
+ {
+ get
+ {
+ return textFieldPlaceHolderTextFocusedSid;
+ }
+ set
+ {
+ if (NUIApplication.MultilingualResourceManager == null)
+ {
+ throw new ArgumentNullException(null, "ResourceManager about multilingual is null");
+ }
+ textFieldPlaceHolderTextFocusedSid = value;
+ PlaceholderTextFocused = SetTranslatable(textFieldPlaceHolderTextFocusedSid);
+ NotifyPropertyChanged();
+ }
+ }
+
+ /// <summary>
/// The Text property.
/// </summary>
/// <since_tizen> 3 </since_tizen>
{
PlaceholderText = NUIApplication.MultilingualResourceManager?.GetString(textFieldPlaceHolderTextSid, new CultureInfo(e.Value.Replace("_", "-")));
}
+ if (textFieldPlaceHolderTextFocusedSid != null)
+ {
+ PlaceholderTextFocused = NUIApplication.MultilingualResourceManager?.GetString(textFieldPlaceHolderTextFocusedSid, new CultureInfo(e.Value.Replace("_", "-")));
+ }
}
private void SystemSettingsFontSizeChanged(object sender, FontSizeChangedEventArgs e)
var textField = (TextField)bindable;
return textField.translatablePlaceholderText;
});
+ /// <summary>
+ /// TranslatablePlaceholderTextFocused property
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty TranslatablePlaceholderTextFocusedProperty = BindableProperty.Create(nameof(TranslatablePlaceholderTextFocused), typeof(string), typeof(TextField), string.Empty, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var textField = (TextField)bindable;
+ if (newValue != null)
+ {
+ textField.translatablePlaceholderTextFocused = (string)newValue;
+ }
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var textField = (TextField)bindable;
+ return textField.translatablePlaceholderTextFocused;
+ });
/// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public static readonly BindableProperty TextProperty = BindableProperty.Create(nameof(Text), typeof(string), typeof(TextField), string.Empty, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
var textField = (TextField)bindable;
return textField.GetSelector<string>(textField.selectorData?.TranslatablePlaceholderText, TextField.TranslatablePlaceholderTextProperty);
});
+ internal static readonly BindableProperty TranslatablePlaceholderTextFocusedSelectorProperty = BindableProperty.Create("TranslatablePlaceholderTextFocusedSelector", typeof(Selector<string>), typeof(TextField), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var textField = (TextField)bindable;
+ textField.EnsureSelectorData().EnsureTranslatablePlaceholderTextFocused().Update(textField, (Selector<string>)newValue, true);
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var textField = (TextField)bindable;
+ return textField.GetSelector<string>(textField.selectorData?.TranslatablePlaceholderTextFocused, TextField.TranslatablePlaceholderTextFocusedProperty);
+ });
internal static readonly BindableProperty TextSelectorProperty = BindableProperty.Create("TextSelector", typeof(Selector<string>), typeof(TextField), null, propertyChanged: (bindable, oldValue, newValue) =>
{
var textField = (TextField)bindable;
public TriggerableSelector<float?> PointSize { get; private set; }
public TriggerableSelector<float?> PixelSize { get; private set; }
public TriggerableSelector<string> TranslatablePlaceholderText { get; private set; }
+ public TriggerableSelector<string> TranslatablePlaceholderTextFocused { get; private set; }
public TriggerableSelector<Vector4> PlaceholderTextColor { get; private set; }
public TriggerableSelector<Vector4> PrimaryCursorColor { get; private set; }
public TriggerableSelector<float?> EnsurePointSize() => PointSize ?? (PointSize = new TriggerableSelector<float?>(TextField.PointSizeProperty));
public TriggerableSelector<float?> EnsurePixelSize() => PixelSize ?? (PixelSize = new TriggerableSelector<float?>(TextField.PixelSizeProperty));
public TriggerableSelector<string> EnsureTranslatablePlaceholderText() => TranslatablePlaceholderText ?? (TranslatablePlaceholderText = new TriggerableSelector<string>(TextField.TranslatablePlaceholderTextProperty));
+ public TriggerableSelector<string> EnsureTranslatablePlaceholderTextFocused() => TranslatablePlaceholderTextFocused ?? (TranslatablePlaceholderTextFocused = new TriggerableSelector<string>(TextField.TranslatablePlaceholderTextFocusedProperty));
public TriggerableSelector<Vector4> EnsurePlaceholderTextColor() => PlaceholderTextColor ?? (PlaceholderTextColor = new TriggerableSelector<Vector4>(TextField.PlaceholderTextColorProperty));
public TriggerableSelector<Vector4> EnsurePrimaryCursorColor() => PrimaryCursorColor ?? (PrimaryCursorColor = new TriggerableSelector<Vector4>(TextField.PrimaryCursorColorProperty));
PointSize?.Reset(view);
PixelSize?.Reset(view);
TranslatablePlaceholderText?.Reset(view);
+ TranslatablePlaceholderTextFocused?.Reset(view);
PlaceholderTextColor?.Reset(view);
PrimaryCursorColor?.Reset(view);
}