[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_ImageView_Property_PIXEL_AREA_get")]
public static extern int PixelAreaGet();
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_ImageView_Property_PLACEHOLDER_IMAGE_get")]
+ public static extern int PlaceHolderImageGet();
+
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_ImageView_Property_TRANSITION_EFFECT_get")]
+ public static extern int TransitionEffectGet();
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_ImageView_Property")]
public static extern global::System.IntPtr NewImageViewProperty();
}
private bool adjustViewSize = false;
+ /// <summary>
+ /// ImageView PlaceHolderUrl, type string.
+ /// This is one of mandatory property. Even if not set or null set, it sets empty string ("") internally.
+ /// When it is set as null, it gives empty string ("") to be read.
+ /// </summary>
+ /// <since_tizen> 11 </since_tizen>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public string PlaceHolderUrl
+ {
+ get
+ {
+ return (string)GetValue(PlaceHolderUrlProperty);
+ }
+ set
+ {
+ SetValue(PlaceHolderUrlProperty, value);
+ NotifyPropertyChanged();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets whether the image use TransitionEffect or not<br />
+ /// </summary>
+ /// <since_tizen> 11 </since_tizen>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public bool TransitionEffect
+ {
+ get
+ {
+ return (bool)GetValue(TransitionEffectProperty);
+ }
+ set
+ {
+ SetValue(TransitionEffectProperty, value);
+ NotifyPropertyChanged();
+ }
+ }
+
internal Selector<string> ResourceUrlSelector
{
get => GetSelector<string>(resourceUrlSelector, ImageView.ResourceUrlProperty);
internal static readonly int IMAGE = Interop.ImageView.ImageGet();
internal static readonly int PreMultipliedAlpha = Interop.ImageView.PreMultipliedAlphaGet();
internal static readonly int PixelArea = Interop.ImageView.PixelAreaGet();
+ internal static readonly int PlaceHolderUrl = Interop.ImageView.PlaceHolderImageGet();
+ internal static readonly int TransitionEffect = Interop.ImageView.TransitionEffectGet();
}
private enum ImageType
var instance = (Tizen.NUI.BaseComponents.ImageView)bindable;
return instance.adjustViewSize;
});
+
+ /// <summary>
+ /// PlaceHolderUrlProperty
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty PlaceHolderUrlProperty = BindableProperty.Create(nameof(PlaceHolderUrl), typeof(string), typeof(ImageView), string.Empty, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var imageView = (Tizen.NUI.BaseComponents.ImageView)bindable;
+ if (newValue != null)
+ {
+ Object.InternalSetPropertyString(imageView.SwigCPtr, ImageView.Property.PlaceHolderUrl, (string)newValue );
+ }
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var imageView = (Tizen.NUI.BaseComponents.ImageView)bindable;
+ return Object.InternalGetPropertyString(imageView.SwigCPtr, ImageView.Property.PlaceHolderUrl);
+ });
+
+ /// Intenal used, will never be opened.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty TransitionEffectProperty = BindableProperty.Create(nameof(TransitionEffect), typeof(bool), typeof(ImageView), false, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var imageView = (ImageView)bindable;
+ if (newValue != null)
+ {
+ Object.InternalSetPropertyBool(imageView.SwigCPtr, ImageView.Property.TransitionEffect, (bool)newValue);
+ }
+ },
+ defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
+ {
+ var imageView = (ImageView)bindable;
+ return Object.InternalGetPropertyBool(imageView.SwigCPtr, ImageView.Property.TransitionEffect);
+ }));
}
}
--- /dev/null
+/*
+ * Copyright(c) 2023 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+using Tizen.NUI.BaseComponents;
+
+namespace Tizen.NUI.Samples
+{
+ using log = Tizen.Log;
+ public class PlaceHolderImageSample : IExample
+ {
+ private const string tag = "NUITEST";
+ private Window mainWin;
+ private ImageView[] imageViews = null;
+ const int imageWidth = 500;
+ const int imageHeight = 500;
+ const int imageMax = 6;
+ Timer mTimer;
+ int image_count = 0;
+
+ private static string[] url = new string[]
+ {
+ "https://images.pexels.com/photos/16027424/pexels-photo-16027424.jpeg",
+ "https://images.pexels.com/photos/214574/pexels-photo-214574.jpeg",
+ "https://images.pexels.com/photos/39853/woman-girl-freedom-happy-39853.jpeg",
+ "https://images.pexels.com/photos/842711/pexels-photo-842711.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=2",
+ "https://images.pexels.com/photos/15828302/pexels-photo-15828302.jpeg",
+ "",
+ };
+
+ public void Activate()
+ {
+ Initialize();
+ }
+
+ public void Deactivate()
+ {
+ }
+
+ private void Initialize()
+ {
+ mainWin = NUIApplication.GetDefaultWindow();
+ mainWin.BackgroundColor = Color.White;
+ mainWin.WindowSize = new Size2D(1920,1080);
+ Size2D windowSize = new Size2D(mainWin.Size.Width,mainWin.Size.Height);
+
+ imageViews = new ImageView[imageMax];
+ for(int i=0; i<imageMax; i++)
+ {
+ int width = (i%(imageMax/2))*imageWidth;
+ int height = (i/(imageMax/2))*imageHeight;
+ imageViews[i] = new ImageView();
+ imageViews[i].Size2D = new Size2D(imageWidth, imageHeight);
+ imageViews[i].Position2D = new Position2D(width,height);
+ imageViews[i].ResourceUrl = url[i];
+ imageViews[i].PlaceHolderUrl = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "images/placeholder_image.png";
+ imageViews[i].TransitionEffect = true;
+ mainWin.Add(imageViews[i]);
+ }
+
+ mTimer = new Timer(5000);
+ mTimer.Tick += ((object target, Timer.TickEventArgs args) =>
+ {
+ image_count++;
+ for(int i=0;i<imageMax;i++)
+ {
+ imageViews[i].ResourceUrl = url[(image_count+i)%imageMax];
+ }
+ return true;
+ });
+
+ mTimer.Start();
+ }
+ }
+}