ImageVisualProperty.SynchronousLoading,
Visual.Property.PremultipliedAlpha,
ImageVisualProperty.OrientationCorrection,
+ ImageVisualProperty.FastTrackUploading,
NpatchImageVisualProperty.Border,
NpatchImageVisualProperty.BorderOnly,
};
private string _resourceUrl = "";
private int _desired_width = -1;
private int _desired_height = -1;
+ private bool _fastTrackUploading = false;
private TriggerableSelector<string> resourceUrlSelector;
private TriggerableSelector<Rectangle> borderSelector;
}
/// <summary>
+ /// Gets or sets whether to apply fast track uploading or not.<br />
+ /// </summary>
+ /// <remarks>
+ /// If we use fast track uploading feature, It can upload texture without event-thead dependency. But also,<br />
+ /// - Texture size is invalid until ResourceReady signal comes.<br />
+ /// - Texture cannot be cached (We always try to load new image).<br />
+ /// - Seamless visual change didn't supported.<br />
+ /// - Alpha masking didn't supported. If you try, It will load as normal case.<br />
+ /// - Synchronous loading didn't supported. If you try, It will load as normal case.<br />
+ /// - Reload action didn't supported. If you try, It will load as normal case.<br />
+ /// - Atlas loading didn't supported. If you try, It will load as normal case.<br />
+ /// - Custom shader didn't supported. If you try, It will load as normal case.
+ /// </remarks>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public bool FastTrackUploading
+ {
+ get
+ {
+ return (bool)GetValue(FastTrackUploadingProperty);
+ }
+ set
+ {
+ SetValue(FastTrackUploadingProperty, value);
+ NotifyPropertyChanged();
+ }
+ }
+
+ private bool InternalFastTrackUploading
+ {
+ get
+ {
+ PropertyValue fastTrackUploading = GetCachedImageVisualProperty(ImageVisualProperty.FastTrackUploading);
+ fastTrackUploading?.Get(out _fastTrackUploading);
+ fastTrackUploading?.Dispose();
+
+ return _fastTrackUploading;
+ }
+ set
+ {
+ if (_fastTrackUploading != value)
+ {
+ _fastTrackUploading = value;
+
+ PropertyValue setValue = new PropertyValue(_fastTrackUploading);
+ UpdateImage(ImageVisualProperty.FastTrackUploading, setValue);
+ setValue?.Dispose();
+
+ if (_fastTrackUploading && !string.IsNullOrEmpty(_resourceUrl))
+ {
+ // Special case. If user set FastTrackUploading mean, user want to upload image As-Soon-As-Possible.
+ // Create ImageVisual synchronously.
+ UpdateImage();
+ }
+ }
+ }
+ }
+
+ /// <summary>
/// Gets the loading state of the visual resource.
/// </summary>
/// <since_tizen> 5 </since_tizen>
{
UpdateImage(ImageVisualProperty.URL, setValue);
}
- // Special case. If we set GeneratedUrl, Create ImageVisual synchronously.
- if (value.StartsWith("dali://") || value.StartsWith("enbuf://"))
+ // Special case. If we set GeneratedUrl, or FastTrackUploading, Create ImageVisual synchronously.
+ if (value.StartsWith("dali://") || value.StartsWith("enbuf://") || _fastTrackUploading)
{
UpdateImage();
}
// Update image property map value as inputed value.
if (key != 0)
{
- if(!HasBody())
+ if (!HasBody())
{
// Throw exception if ImageView is disposed.
throw new global::System.InvalidOperationException("[NUI][ImageVIew] Someone try to change disposed ImageView's property.\n");
});
/// <summary>
+ /// FastTrackUploadingProperty
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty FastTrackUploadingProperty = BindableProperty.Create(nameof(FastTrackUploading), typeof(bool), typeof(ImageView), false, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var instance = (Tizen.NUI.BaseComponents.ImageView)bindable;
+ if (newValue != null)
+ {
+ instance.InternalFastTrackUploading = (bool)newValue;
+ }
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var instance = (Tizen.NUI.BaseComponents.ImageView)bindable;
+ return instance.InternalFastTrackUploading;
+ });
+
+ /// <summary>
/// ImageMapProperty
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
var imageView = (Tizen.NUI.BaseComponents.ImageView)bindable;
if (newValue != null)
{
- Object.InternalSetPropertyString(imageView.SwigCPtr, ImageView.Property.PlaceHolderUrl, (string)newValue );
+ Object.InternalSetPropertyString(imageView.SwigCPtr, ImageView.Property.PlaceHolderUrl, (string)newValue);
}
},
defaultValueCreator: (bindable) =>