# Auto-generated from csapi-tizenfx.spec.in by makespec.sh
%define TIZEN_NET_API_VERSION 10
-%define TIZEN_NET_RPM_VERSION 10.0.0.17357+nui22135
-%define TIZEN_NET_NUGET_VERSION 10.0.0.17357
+%define TIZEN_NET_RPM_VERSION 10.0.0.999+nui22136
+%define TIZEN_NET_NUGET_VERSION 10.0.0.99999
%define DOTNET_ASSEMBLY_PATH /usr/share/dotnet.tizen/framework
%define DOTNET_ASSEMBLY_DUMMY_PATH %{DOTNET_ASSEMBLY_PATH}/ref
NUGET_VERSION=10.0.0.99999
# RPM Version Suffix
-RPM_VERSION_SUFFIX=nui22135
+RPM_VERSION_SUFFIX=nui22136
{
base.OnInitialize();
AccessibilityRole = Role.Dialog;
- AccessibilityAttributes["sub-role"] = "Alert";
Show(); // calls RegisterDefaultLabel(); Hide() will call UnregisterDefaultLabel()
}
{
base.OnInitialize();
AccessibilityRole = Role.Dialog;
- AccessibilityAttributes["sub-role"] = "Alert";
Show(); // calls RegisterDefaultLabel(); Hide() will call UnregisterDefaultLabel()
}
{
base.OnInitialize();
AccessibilityRole = Role.PopupMenu;
- AccessibilityAttributes["sub-role"] = "Alert";
}
/// <summary>
{
base.OnInitialize();
AccessibilityRole = Role.Dialog;
- AccessibilityAttributes["sub-role"] = "Alert";
container.Add(this);
container.SetTouchConsumed(true);
{
internal static partial class Interop
{
- internal static partial class ModelView
+ internal static partial class Model
{
[global::System.Runtime.InteropServices.DllImport(Libraries.Scene3D, EntryPoint = "CSharp_Dali_ModelView_New_SWIG_1")]
- public static extern global::System.IntPtr ModelViewNew(string jarg1, string jarg2);
+ public static extern global::System.IntPtr ModelNew(string jarg1, string jarg2);
[global::System.Runtime.InteropServices.DllImport(Libraries.Scene3D, EntryPoint = "CSharp_Dali_new_ModelView_SWIG_0")]
- public static extern global::System.IntPtr NewModelView();
+ public static extern global::System.IntPtr NewModel();
[global::System.Runtime.InteropServices.DllImport(Libraries.Scene3D, EntryPoint = "CSharp_Dali_new_ModelView_SWIG_1")]
- public static extern global::System.IntPtr NewModelView(global::System.Runtime.InteropServices.HandleRef jarg1);
+ public static extern global::System.IntPtr NewModel(global::System.Runtime.InteropServices.HandleRef jarg1);
[global::System.Runtime.InteropServices.DllImport(Libraries.Scene3D, EntryPoint = "CSharp_Dali_delete_ModelView")]
- public static extern void DeleteModelView(global::System.Runtime.InteropServices.HandleRef jarg1);
+ public static extern void DeleteModel(global::System.Runtime.InteropServices.HandleRef jarg1);
[global::System.Runtime.InteropServices.DllImport(Libraries.Scene3D, EntryPoint = "CSharp_Dali_ModelView_Assign")]
- public static extern global::System.IntPtr ModelViewAssign(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
+ public static extern global::System.IntPtr ModelAssign(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
[global::System.Runtime.InteropServices.DllImport(Libraries.Scene3D, EntryPoint = "CSharp_Dali_ModelView_DownCast")]
- public static extern global::System.IntPtr ModelViewDownCast(global::System.Runtime.InteropServices.HandleRef jarg1);
+ public static extern global::System.IntPtr ModelDownCast(global::System.Runtime.InteropServices.HandleRef jarg1);
[global::System.Runtime.InteropServices.DllImport(Libraries.Scene3D, EntryPoint = "CSharp_Dali_ModelView_GetModelRoot")]
public static extern global::System.IntPtr GetModelRoot(global::System.Runtime.InteropServices.HandleRef jarg1);
using System;
using System.Runtime.InteropServices;
using System.ComponentModel;
+using Tizen.NUI;
using Tizen.NUI.Binding;
using Tizen.NUI.BaseComponents;
namespace Tizen.NUI.Scene3D
{
/// <summary>
- /// ModelView is a View to show 3D model objects.
- /// ModelView supports to load glTF 2.0 and DLI models for the input format
+ /// Model is a Class to show 3D mesh objects.
+ /// Model supports to load glTF 2.0 and DLI models for the input format
/// and also supports Physically Based Rendering with Image Based Lighting.
///
- /// The Animations defined in the glTF or DLI models are also loaded and can be retrieved by using GetAnimation() method.
+ /// The Animations defined in the glTF or DLI are also loaded and can be retrieved by using GetAnimation() method.
/// The number of animation is also retrieved by GetAnimationCount() method.
///
- /// By default, The loaded model has it's own position and size which are defined in vertex buffer regardless of the View size.
- /// The model can be resized and repositioned to fit to the ModelView with UseSizeOfView and UseCenterOfView properties.
+ /// By default, The loaded mesh has it's own size inferred from position of vertices.
+ /// If user set size property, the mesh will be scaled to the input size.
+ ///
+ /// Both of the default value of PivotPoint and ParentOrigin of the Model is Center.
+ ///
/// </summary>
/// <code>
- /// ModelView modelView = new ModelView(modelUrl)
+ /// Model model = new Model(modelUrl)
/// {
/// Size = new Size(width, height),
- /// PositionUsesPivotPoint = true,
- /// PivotPoint = PivotPoint.Center,
- /// ParentOrigin = ParentOrigin.Center,
- /// UseSizeOfView = true,
- /// UseCenterOfView = true,
/// };
- /// modelView.SetImageBasedLightSource(diffuseUrl, specularUrl, scaleFactor);
- /// window.Add(modelView);
- /// int animationCount = modelView.GetAnimationCount();
+ /// model.SetImageBasedLightSource(diffuseUrl, specularUrl, scaleFactor);
+ /// window.Add(model);
+ ///
+ /// int animationCount = model.GetAnimationCount();
/// if(animationCount > 0)
/// {
- /// modelView.GetAnimation(0).Play();
+ /// model.GetAnimation(0).Play();
/// }
/// </code>
// This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
[EditorBrowsable(EditorBrowsableState.Never)]
- public class ModelView : View
+ public class Model : View
{
- private bool useSizeOfView = false;
- private bool useCenterOfView = false;
-
- internal ModelView(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
+ internal Model(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
{
}
/// <summary>
- /// Create an initialized ModelView.
+ /// Create an initialized Model.
/// </summary>
/// <param name="modelPath">model file path.(e.g., glTF, and DLI).</param>
/// <param name="resourcePath">resource file path that includes binary, image etc.</param>
/// <note> If resourcePath is empty, the parent directory path of modelPath is used for resource path. </note>
// This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
[EditorBrowsable(EditorBrowsableState.Never)]
- public ModelView(string modelPath, string resourcePath = "") : this(Interop.ModelView.ModelViewNew(modelPath, resourcePath), true)
+ public Model(string modelPath, string resourcePath = "") : this(Interop.Model.ModelNew(modelPath, resourcePath), true)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ Interop.Model.FitSize(SwigCPtr, true);
+ this.ParentOrigin = Tizen.NUI.ParentOrigin.Center;
+ this.PivotPoint = Tizen.NUI.PivotPoint.Center;
+ this.PositionUsesAnchorPoint = true;
}
/// <summary>
/// <param name="modelView">Handle to an object.</param>
// This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
[EditorBrowsable(EditorBrowsableState.Never)]
- public ModelView(ModelView modelView) : this(Interop.ModelView.NewModelView(ModelView.getCPtr(modelView)), true)
+ public Model(Model modelView) : this(Interop.Model.NewModel(Model.getCPtr(modelView)), true)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/// <summary>
- /// Retrieves model root View.
- /// </summary>
- /// <note>
- /// This ModelRoot means a root View that contains 3D models to render.
- /// The light source is only applied on the models under this ModelRoot.
- /// </note>
- // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
- [EditorBrowsable(EditorBrowsableState.Never)]
- public View ModelRoot
- {
- get
- {
- return GetModelRoot();
- }
- }
-
- /// <summary>
- /// Fits the model to the View size.
- /// If this property is true, the model is resized to fit the width or height of the View by scaling the ModelRoot.
- /// <note>
- /// This property only changes model size not the pivot.
- /// </note>
- /// </summary>
- // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
- [EditorBrowsable(EditorBrowsableState.Never)]
- public bool UseSizeOfView
- {
- get
- {
- return useSizeOfView;
- }
- set
- {
- useSizeOfView = value;
- Interop.ModelView.FitSize(SwigCPtr, useSizeOfView);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- }
- }
-
- /// <summary>
- /// Moves the model to the center of ModelView.
- /// If this property is true, the model moves so that the center is located at the center of the View by change PivotPoint of ModelRoot.
- /// </summary>
- // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
- [EditorBrowsable(EditorBrowsableState.Never)]
- public bool UseCenterOfView
- {
- get
- {
- return useCenterOfView;
- }
- set
- {
- useCenterOfView = value;
- Interop.ModelView.FitCenter(SwigCPtr, useCenterOfView);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- }
- }
-
- /// <summary>
/// Assignment operator.
/// </summary>
/// <param name="modelView">Handle to an object.</param>
/// <returns>Reference to this.</returns>
- internal ModelView Assign(ModelView modelView)
+ internal Model Assign(Model modelView)
{
- ModelView ret = new ModelView(Interop.ModelView.ModelViewAssign(SwigCPtr, ModelView.getCPtr(modelView)), false);
+ Model ret = new Model(Interop.Model.ModelAssign(SwigCPtr, Model.getCPtr(modelView)), false);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
/// <summary>
/// Changes Image Based Light as the input textures.
/// </summary>
- /// <param name="diffuse">Cube map that can be used as a diffuse IBL source.</param>
- /// <param name="specular">Cube map that can be used as a specular IBL source.</param>
+ /// <param name="diffuseUrl">The path of Cube map image that can be used as a diffuse IBL source.</param>
+ /// <param name="specularUrl">The path of Cube map image that can be used as a specular IBL source.</param>
/// <param name="scaleFactor">Scale factor that controls light source intensity in [0.0f, 1.0f]. Default value is 1.0f.</param>
// This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
[EditorBrowsable(EditorBrowsableState.Never)]
- public void SetImageBasedLightSource(string diffuse, string specular, float scaleFactor = 1.0f)
+ public void SetImageBasedLightSource(string diffuseUrl, string specularUrl, float scaleFactor = 1.0f)
{
- Interop.ModelView.SetImageBasedLightSource(SwigCPtr, diffuse, specular, scaleFactor);
+ Interop.Model.SetImageBasedLightSource(SwigCPtr, diffuseUrl, specularUrl, scaleFactor);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
[EditorBrowsable(EditorBrowsableState.Never)]
public uint GetAnimationCount()
{
- uint ret = Interop.ModelView.GetAnimationCount(SwigCPtr);
+ uint ret = Interop.Model.GetAnimationCount(SwigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
[EditorBrowsable(EditorBrowsableState.Never)]
public Animation GetAnimation(uint index)
{
- Animation ret = new Animation(Interop.ModelView.GetAnimation(SwigCPtr, index), false);
+ Animation ret = new Animation(Interop.Model.GetAnimation(SwigCPtr, index), false);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
[EditorBrowsable(EditorBrowsableState.Never)]
public Animation GetAnimation(string name)
{
- Animation ret = new Animation(Interop.ModelView.GetAnimation(SwigCPtr, name), false);
+ Animation ret = new Animation(Interop.Model.GetAnimation(SwigCPtr, name), false);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
[EditorBrowsable(EditorBrowsableState.Never)]
private View GetModelRoot()
{
- View ret = new View(Interop.ModelView.GetModelRoot(SwigCPtr), false);
+ View ret = new View(Interop.Model.GetModelRoot(SwigCPtr), false);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
[EditorBrowsable(EditorBrowsableState.Never)]
protected override void ReleaseSwigCPtr(global::System.Runtime.InteropServices.HandleRef swigCPtr)
{
- Interop.ModelView.DeleteModelView(swigCPtr);
+ Interop.Model.DeleteModel(swigCPtr);
}
}
}
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_ResourceReadySignal")]
public static extern global::System.IntPtr ResourceReadySignal(global::System.Runtime.InteropServices.HandleRef jarg1);
-
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_View_GetVisualResourceStatus")]
public static extern int View_GetVisualResourceStatus(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2);
+
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_View_DoActionExtension")]
+ public static extern void DoActionExtension(global::System.Runtime.InteropServices.HandleRef control, int visualIndex, int actionId, int id, string keyPath, int property, global::System.IntPtr callback);
}
}
}
{
internal static partial class WebHttpRequestInterceptor
{
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebRequestInterceptor_GetWebView")]
+ public static extern global::System.IntPtr GetWebView(global::System.Runtime.InteropServices.HandleRef jarg1);
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebRequestInterceptor_GetUrl")]
public static extern string GetUrl(global::System.Runtime.InteropServices.HandleRef jarg1);
public static extern void Maximize(global::System.Runtime.InteropServices.HandleRef window, bool maximize);
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Window_IsMaximized")]
+ [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)]
public static extern bool IsMaximized(global::System.Runtime.InteropServices.HandleRef window);
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Window_Set_Maximum_Size")]
public static extern void Minimize(global::System.Runtime.InteropServices.HandleRef window, bool minimize);
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Window_IsMinimized")]
+ [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)]
public static extern bool IsMinimized(global::System.Runtime.InteropServices.HandleRef window);
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Window_Set_Minimum_Size")]
}
/// <summary>
+ /// Gets webview in which request is intercepted.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public BaseComponents.WebView InterceptedWebView
+ {
+ get
+ {
+ return new BaseComponents.WebView(Interop.WebHttpRequestInterceptor.GetWebView(interceptorHandle), true);
+ }
+ }
+
+ /// <summary>
/// Gets url of intercepted request.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
return;
}
+ CleanCallbackDictionaries();
+
//Release your own unmanaged resources here.
//You should not access any managed member here except static instance.
//because the execution order of Finalizes is non-deterministic.
//disconnect event signal
if (finishedEventHandler != null && visualEventSignalCallback != null)
{
- VisualEventSignal().Disconnect(visualEventSignalCallback);
+ using VisualEventSignal visualEvent = VisualEventSignal();
+ visualEvent.Disconnect(visualEventSignalCallback);
finishedEventHandler = null;
NUILog.Debug($"disconnect event signal");
}
base.Dispose(type);
}
+
+ // This is used for internal purpose. hidden API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ protected override void Dispose(bool disposing)
+ {
+ CleanCallbackDictionaries();
+ base.Dispose(disposing);
+ }
#endregion Constructor, Destructor, Dispose
NUILog.Debug($"<[{GetId()}]SET url={currentStates.url}");
- PropertyMap map = new PropertyMap();
- map.Add(Visual.Property.Type, new PropertyValue((int)DevelVisual.Type.AnimatedVectorImage))
- .Add(ImageVisualProperty.URL, new PropertyValue(currentStates.url))
- .Add(ImageVisualProperty.LoopCount, new PropertyValue(currentStates.loopCount))
- .Add(ImageVisualProperty.StopBehavior, new PropertyValue((int)currentStates.stopEndAction))
- .Add(ImageVisualProperty.LoopingMode, new PropertyValue((int)currentStates.loopMode));
+ using PropertyMap map = new PropertyMap();
+ using PropertyValue type = new PropertyValue((int)DevelVisual.Type.AnimatedVectorImage);
+ using PropertyValue url = new PropertyValue(currentStates.url);
+ using PropertyValue loopCnt = new PropertyValue(currentStates.loopCount);
+ using PropertyValue stopAction = new PropertyValue((int)currentStates.stopEndAction);
+ using PropertyValue loopMode = new PropertyValue((int)currentStates.loopMode);
+
+ map.Add(Visual.Property.Type, type)
+ .Add(ImageVisualProperty.URL, url)
+ .Add(ImageVisualProperty.LoopCount, loopCnt)
+ .Add(ImageVisualProperty.StopBehavior, stopAction)
+ .Add(ImageVisualProperty.LoopingMode, loopMode);
Image = map;
currentStates.contentInfo = null;
string ret = currentStates.url;
NUILog.Debug($"<[{GetId()}] GET");
- PropertyMap map = base.Image;
+ using PropertyMap map = base.Image;
if (map != null)
{
- PropertyValue val = map.Find(ImageVisualProperty.URL);
+ using PropertyValue val = map.Find(ImageVisualProperty.URL);
if (val != null)
{
if (val.Get(out ret))
get
{
NUILog.Debug($"< Get!");
- PropertyMap map = base.Image;
+ using PropertyMap map = base.Image;
var ret = 0;
if (map != null)
{
- PropertyValue val = map.Find(ImageVisualProperty.PlayState);
+ using PropertyValue val = map.Find(ImageVisualProperty.PlayState);
if (val != null)
{
if (val.Get(out ret))
get
{
int ret = -1;
- PropertyMap map = base.Image;
+ using PropertyMap map = base.Image;
if (map != null)
{
- PropertyValue val = map.Find(ImageVisualProperty.TotalFrameNumber);
+ using PropertyValue val = map.Find(ImageVisualProperty.TotalFrameNumber);
if (val != null)
{
if (val.Get(out ret))
{
- //NUILog.Debug( $"TotalFrameNumber get! ret={ret}");
+ NUILog.Debug($"TotalFrameNumber get! ret={ret}");
currentStates.totalFrame = ret;
return ret;
}
{
currentStates.frame = value;
NUILog.Debug($"<[{GetId()}]SET frame={currentStates.frame}>");
- DoAction(ImageView.Property.IMAGE, ActionJumpTo, new PropertyValue(currentStates.frame));
+ using PropertyValue attribute = new PropertyValue(currentStates.frame);
+ DoAction(ImageView.Property.IMAGE, ActionJumpTo, attribute);
}
get
{
int ret = 0;
- PropertyMap map = base.Image;
+ using PropertyMap map = base.Image;
if (map != null)
{
- PropertyValue val = map.Find(ImageVisualProperty.CurrentFrameNumber);
+ using PropertyValue val = map.Find(ImageVisualProperty.CurrentFrameNumber);
if (val != null)
{
if (val.Get(out ret))
{
- //NUILog.Debug( $"CurrentFrameNumber get! val={ret}");
+ NUILog.Debug($"CurrentFrameNumber get! val={ret}");
return ret;
}
}
currentStates.changed = true;
NUILog.Debug($"<[{GetId()}] SET loopMode={currentStates.loopMode}>");
- PropertyMap map = new PropertyMap();
- map.Add(ImageVisualProperty.LoopingMode, new PropertyValue((int)currentStates.loopMode));
- DoAction(ImageView.Property.IMAGE, ActionUpdateProperty, new PropertyValue(map));
+ using PropertyMap map = new PropertyMap();
+ using PropertyValue loopMode = new PropertyValue((int)currentStates.loopMode);
+ map.Add(ImageVisualProperty.LoopingMode, loopMode);
+ using PropertyValue attribute = new PropertyValue(map);
+ DoAction(ImageView.Property.IMAGE, ActionUpdateProperty, attribute);
}
get
{
- //NUILog.Debug( $"LoopMode get!");
- PropertyMap map = base.Image;
+ NUILog.Debug($"LoopMode get!");
+ using PropertyMap map = base.Image;
var ret = 0;
if (map != null)
{
- PropertyValue val = map.Find(ImageVisualProperty.LoopingMode);
+ using PropertyValue val = map.Find(ImageVisualProperty.LoopingMode);
if (val != null)
{
if (val.Get(out ret))
{
- //NUILog.Debug( $"gotten LoopMode={ret}");
+ NUILog.Debug($"gotten LoopMode={ret}");
if (ret != (int)currentStates.loopMode && ret > 0)
{
NUILog.Debug($" [ERROR][{GetId()}](LottieAnimationView) different LoopMode! gotten={ret}, loopMode={currentStates.loopMode}");
currentStates.changed = true;
currentStates.loopCount = value;
NUILog.Debug($"<[{GetId()}]SET currentStates.loopCount={currentStates.loopCount}>");
- PropertyMap map = new PropertyMap();
- map.Add(ImageVisualProperty.LoopCount, new PropertyValue(currentStates.loopCount));
- DoAction(ImageView.Property.IMAGE, ActionUpdateProperty, new PropertyValue(map));
+ using PropertyMap map = new PropertyMap();
+ using PropertyValue loopCnt = new PropertyValue(currentStates.loopCount);
+ map.Add(ImageVisualProperty.LoopCount, loopCnt);
+ using PropertyValue attribute = new PropertyValue(map);
+ DoAction(ImageView.Property.IMAGE, ActionUpdateProperty, attribute);
}
get
{
- //NUILog.Debug( $"LoopCount get!");
- PropertyMap map = base.Image;
+ NUILog.Debug($"LoopCount get!");
+ using PropertyMap map = base.Image;
var ret = 0;
if (map != null)
{
- PropertyValue val = map.Find(ImageVisualProperty.LoopCount);
+ using PropertyValue val = map.Find(ImageVisualProperty.LoopCount);
if (val != null)
{
if (val.Get(out ret))
{
- //NUILog.Debug( $"gotten loop count={ret}");
+ NUILog.Debug($"gotten loop count={ret}");
if (ret != currentStates.loopCount && ret > 0)
{
NUILog.Debug($"<[ERROR][{GetId()}](LottieAnimationView) different loop count! gotten={ret}, loopCount={currentStates.loopCount}>");
currentStates.changed = true;
NUILog.Debug($"<[{GetId()}]SET val={currentStates.stopEndAction}>");
- PropertyMap map = new PropertyMap();
- map.Add(ImageVisualProperty.StopBehavior, new PropertyValue((int)currentStates.stopEndAction));
- DoAction(ImageView.Property.IMAGE, ActionUpdateProperty, new PropertyValue(map));
+ using PropertyMap map = new PropertyMap();
+ using PropertyValue stopAction = new PropertyValue((int)currentStates.stopEndAction);
+ map.Add(ImageVisualProperty.StopBehavior, stopAction);
+ using PropertyValue attribute = new PropertyValue(map);
+ DoAction(ImageView.Property.IMAGE, ActionUpdateProperty, attribute);
}
get
{
- //NUILog.Debug( $"StopBehavior get!");
- PropertyMap map = base.Image;
+ NUILog.Debug($"StopBehavior get!");
+ using PropertyMap map = base.Image;
var ret = 0;
if (map != null)
{
- PropertyValue val = map.Find(ImageVisualProperty.StopBehavior);
+ using PropertyValue val = map.Find(ImageVisualProperty.StopBehavior);
if (val != null)
{
if (val.Get(out ret))
{
- //NUILog.Debug( $"gotten StopBehavior={ret}");
+ NUILog.Debug($"gotten StopBehavior={ret}");
if (ret != (int)currentStates.stopEndAction)
{
NUILog.Debug($"<[ERROR][{GetId()}](LottieAnimationView) different StopBehavior! gotten={ret}, StopBehavior={currentStates.stopEndAction}>");
currentStates.changed = true;
currentStates.redrawInScalingDown = value;
NUILog.Debug($"<[{GetId()}]SET currentStates.redrawInScalingDown={currentStates.redrawInScalingDown}>");
- PropertyMap map = new PropertyMap();
- map.Add(ImageVisualProperty.RedrawInScalingDown, new PropertyValue(currentStates.redrawInScalingDown));
- DoAction(ImageView.Property.IMAGE, ActionUpdateProperty, new PropertyValue(map));
+ using PropertyMap map = new PropertyMap();
+ using PropertyValue redraw = new PropertyValue(currentStates.redrawInScalingDown);
+ map.Add(ImageVisualProperty.RedrawInScalingDown, redraw);
+ using PropertyValue action = new PropertyValue(map);
+ DoAction(ImageView.Property.IMAGE, ActionUpdateProperty, action);
}
get
{
var ret = true;
if (map != null)
{
- PropertyValue val = map.Find(ImageVisualProperty.RedrawInScalingDown);
+ using PropertyValue val = map.Find(ImageVisualProperty.RedrawInScalingDown);
if (val != null)
{
if (val.Get(out ret))
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
protected int ActionJumpTo { get; set; } = Interop.LottieAnimationView.AnimatedVectorImageVisualActionJumpToGet();
+
+ // This is used for internal purpose. hidden API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ protected int SetDynamicProperty => ActionJumpTo + 1;
#endregion Property
currentStates.framePlayRangeMin = minFrame;
currentStates.framePlayRangeMax = maxFrame;
- PropertyArray array = new PropertyArray();
- array.PushBack(new PropertyValue(currentStates.framePlayRangeMin));
- array.PushBack(new PropertyValue(currentStates.framePlayRangeMax));
-
- PropertyMap map = new PropertyMap();
- map.Add(ImageVisualProperty.PlayRange, new PropertyValue(array));
- DoAction(ImageView.Property.IMAGE, ActionUpdateProperty, new PropertyValue(map));
+ using PropertyArray array = new PropertyArray();
+ using PropertyValue min = new PropertyValue(currentStates.framePlayRangeMin);
+ using PropertyValue max = new PropertyValue(currentStates.framePlayRangeMax);
+ array.PushBack(min);
+ array.PushBack(max);
+
+ using PropertyMap map = new PropertyMap();
+ using PropertyValue range = new PropertyValue(array);
+ map.Add(ImageVisualProperty.PlayRange, range);
+ using PropertyValue action = new PropertyValue(map);
+ DoAction(ImageView.Property.IMAGE, ActionUpdateProperty, action);
NUILog.Debug($" [{GetId()}] currentStates.min:({currentStates.framePlayRangeMin}, max:{currentStates.framePlayRangeMax})>");
}
public List<Tuple<string, int, int>> GetContentInfo()
{
NUILog.Debug($"<");
+
if (currentStates.contentInfo != null)
{
return currentStates.contentInfo;
}
PropertyMap imageMap = base.Image;
- PropertyMap contentMap = new PropertyMap();
if (imageMap != null)
{
PropertyValue val = imageMap.Find(ImageVisualProperty.ContentInfo);
- if (val != null)
+ PropertyMap contentMap = new PropertyMap();
+ if (val?.Get(ref contentMap) == true)
{
- if (val.Get(contentMap))
+ currentStates.contentInfo = new List<Tuple<string, int, int>>();
+ for (uint i = 0; i < contentMap.Count(); i++)
{
- currentStates.contentInfo = new List<Tuple<string, int, int>>();
- for (uint i = 0; i < contentMap.Count(); i++)
+ using PropertyKey propertyKey = contentMap.GetKeyAt(i);
+ string key = propertyKey.StringKey;
+
+ using PropertyValue arrVal = contentMap.GetValue(i);
+ using PropertyArray arr = new PropertyArray();
+ if (arrVal.Get(arr))
{
- string key = contentMap.GetKeyAt(i).StringKey;
- PropertyArray arr = new PropertyArray();
- contentMap.GetValue(i).Get(arr);
- if (arr != null)
- {
- int startFrame, endFrame;
- arr.GetElementAt(0).Get(out startFrame);
- arr.GetElementAt(1).Get(out endFrame);
+ int startFrame = -1;
+ using PropertyValue start = arr.GetElementAt(0);
+ start?.Get(out startFrame);
- NUILog.Debug($"[{i}] layer name={key}, startFrame={startFrame}, endFrame={endFrame}");
+ int endFrame = -1;
+ using PropertyValue end = arr.GetElementAt(1);
+ end?.Get(out endFrame);
- Tuple<string, int, int> item = new Tuple<string, int, int>(key, startFrame, endFrame);
+ NUILog.Debug($"[{i}] layer name={key}, startFrame={startFrame}, endFrame={endFrame}");
- currentStates.contentInfo?.Add(item);
- }
+ Tuple<string, int, int> item = new Tuple<string, int, int>(key, startFrame, endFrame);
+
+ currentStates.contentInfo?.Add(item);
}
}
}
+ contentMap.Dispose();
+ val.Dispose();
}
NUILog.Debug($">");
+
return currentStates.contentInfo;
}
currentStates.mark1 = marker1;
currentStates.mark2 = marker2;
- PropertyArray array = new PropertyArray();
- array.PushBack(new PropertyValue(currentStates.mark1));
+ using PropertyArray array = new PropertyArray();
+ using PropertyValue mark1 = new PropertyValue(currentStates.mark1);
+ array.PushBack(mark1);
+ using PropertyValue mark2 = new PropertyValue(currentStates.mark2);
if (marker2 != null)
{
- array.PushBack(new PropertyValue(currentStates.mark2));
+ array.PushBack(mark2);
}
- PropertyMap map = new PropertyMap();
- map.Add(ImageVisualProperty.PlayRange, new PropertyValue(array));
- DoAction(ImageView.Property.IMAGE, ActionUpdateProperty, new PropertyValue(map));
+ using PropertyMap map = new PropertyMap();
+ using PropertyValue range = new PropertyValue(array);
+ map.Add(ImageVisualProperty.PlayRange, range);
+ using PropertyValue actionProperty = new PropertyValue(map);
+ DoAction(ImageView.Property.IMAGE, ActionUpdateProperty, actionProperty);
NUILog.Debug($" [{GetId()}] currentStates.mark1:{currentStates.mark1}, mark2:{currentStates.mark2} >");
}
{
NUILog.Debug($"< [{GetId()}] GetMinMaxFrame()! total frame={currentStates.totalFrame}");
- PropertyMap map = Image;
+ using PropertyMap map = Image;
if (map != null)
{
- PropertyValue val = map.Find(ImageVisualProperty.PlayRange);
+ using PropertyValue val = map.Find(ImageVisualProperty.PlayRange);
if (val != null)
{
- PropertyArray array = new PropertyArray();
+ using PropertyArray array = new PropertyArray();
if (val.Get(array))
{
uint cnt = array.Count();
int item1 = -1, item2 = -1;
for (uint i = 0; i < cnt; i++)
{
- PropertyValue v = array.GetElementAt(i);
+ using PropertyValue v = array.GetElementAt(i);
int intRet;
if (v.Get(out intRet))
{
Tizen.Log.Error("NUI", $"[ERR] fail to get play range from dali! case#2");
return new Tuple<int, int>(-1, -1);
}
+
+ // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public void DoActionExtension(LottieAnimationViewDynamicProperty info)
+ {
+ dynamicPropertyCallbackId++;
+
+ weakReferencesOfLottie?.Add(dynamicPropertyCallbackId, new WeakReference<LottieAnimationView>(this));
+ InternalSavedDynamicPropertyCallbacks?.Add(dynamicPropertyCallbackId, info.Callback);
+
+ Interop.View.DoActionExtension(SwigCPtr, ImageView.Property.IMAGE, SetDynamicProperty, dynamicPropertyCallbackId, info.KeyPath, (int)info.Property, Marshal.GetFunctionPointerForDelegate<System.Delegate>(rootCallback));
+
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+
+ private void CleanCallbackDictionaries()
+ {
+ if (weakReferencesOfLottie?.Count > 0 && InternalSavedDynamicPropertyCallbacks != null)
+ {
+ foreach (var key in InternalSavedDynamicPropertyCallbacks?.Keys)
+ {
+ if (weakReferencesOfLottie.ContainsKey(key))
+ {
+ weakReferencesOfLottie.Remove(key);
+ }
+ }
+ }
+ InternalSavedDynamicPropertyCallbacks?.Clear();
+ InternalSavedDynamicPropertyCallbacks = null;
+ }
#endregion Method
{
NUILog.Debug($"<[{GetId()}] Finished eventhandler added>");
visualEventSignalCallback = onVisualEventSignal;
- VisualEventSignal().Connect(visualEventSignalCallback);
+ using VisualEventSignal visualEvent = VisualEventSignal();
+ visualEvent.Connect(visualEventSignalCallback);
}
finishedEventHandler += value;
}
finishedEventHandler -= value;
if (finishedEventHandler == null && visualEventSignalCallback != null)
{
- VisualEventSignal().Disconnect(visualEventSignalCallback);
+ using VisualEventSignal visualEvent = VisualEventSignal();
+ visualEvent.Disconnect(visualEventSignalCallback);
+ if (visualEvent?.Empty() == true)
+ {
+ visualEventSignalCallback = null;
+ }
}
}
}
/// <since_tizen> 7 </since_tizen>
AutoReverse
}
+
+ /// <summary>
+ /// Vector Property
+ /// </summary>
+ // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public enum VectorProperty
+ {
+ /// <summary>
+ /// Fill color of the object, Type of <see cref="Vector3"/>
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ FillColor,
+
+ /// <summary>
+ /// Fill opacity of the object, Type of float
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ FillOpacity,
+
+ /// <summary>
+ /// Stroke color of the object, Type of <see cref="Vector3"/>
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ StrokeColor,
+
+ /// <summary>
+ /// Stroke opacity of the object, Type of float
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ StrokeOpacity,
+
+ /// <summary>
+ /// Stroke width of the object, Type of float
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ StrokeWidth,
+
+ /// <summary>
+ /// Transform anchor of the Layer and Group object, Type of <see cref="Vector2"/>
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ TransformAnchor,
+
+ /// <summary>
+ /// Transform position of the Layer and Group object, Type of <see cref="Vector2"/>
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ TransformPosition,
+
+ /// <summary>
+ /// Transform scale of the Layer and Group object, Type of <see cref="Vector2"/>, Value range of [0..100]
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ TransformScale,
+
+ /// <summary>
+ /// Transform rotation of the Layer and Group object, Type of float, Value range of [0..360] in degrees
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ TransformRotation,
+
+ /// <summary>
+ /// Transform opacity of the Layer and Group object, Type of float
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ TransformOpacity
+ };
+
+ // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+ public delegate PropertyValue DynamicPropertyCallbackType(int returnType, uint frameNumber);
#endregion Event, Enum, Struct, ETC
if (visualEventSignalHandler == null)
{
visualEventSignalCallback = onVisualEventSignal;
- VisualEventSignal().Connect(visualEventSignalCallback);
+ using VisualEventSignal visualEvent = VisualEventSignal();
+ visualEvent?.Connect(visualEventSignalCallback);
}
visualEventSignalHandler += value;
}
remove
{
visualEventSignalHandler -= value;
- if (visualEventSignalHandler == null && VisualEventSignal().Empty() == false)
+ if (visualEventSignalHandler == null && visualEventSignalCallback != null)
{
- VisualEventSignal().Disconnect(visualEventSignalCallback);
+ using VisualEventSignal visualEvent = VisualEventSignal();
+ visualEvent?.Disconnect(visualEventSignalCallback);
+ if (visualEvent?.Empty() == true)
+ {
+ visualEventSignalCallback = null;
+ }
}
}
}
internal void EmitVisualEventSignal(int visualIndex, int signalId)
{
- VisualEventSignal().Emit(this, visualIndex, signalId);
+ using VisualEventSignal visualEvent = VisualEventSignal();
+ visualEvent?.Emit(this, visualIndex, signalId);
}
internal VisualEventSignal VisualEventSignal()
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
+
+ internal Dictionary<int, DynamicPropertyCallbackType> InternalSavedDynamicPropertyCallbacks = new Dictionary<int, DynamicPropertyCallbackType>();
+
+ [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+ internal delegate void RootCallbackType(int id, int returnType, uint frameNumber, ref float val1, ref float val2, ref float val3);
+
+ internal RootCallbackType rootCallback = RootCallback;
+
+ static internal void RootCallback(int id, int returnType, uint frameNumber, ref float val1, ref float val2, ref float val3)
+ {
+ WeakReference<LottieAnimationView> current = null;
+ LottieAnimationView currentView = null;
+ DynamicPropertyCallbackType currentCallback = null;
+ PropertyValue ret = null;
+
+ if (weakReferencesOfLottie.TryGetValue(id, out current))
+ {
+ if (current.TryGetTarget(out currentView))
+ {
+ if (currentView.InternalSavedDynamicPropertyCallbacks.TryGetValue(id, out currentCallback) && currentView != null
+ && currentView.InternalSavedDynamicPropertyCallbacks != null)
+ {
+ ret = currentCallback?.Invoke(returnType, frameNumber);
+ }
+ else
+ {
+ Tizen.Log.Error("NUI", "can't find the callback in LottieAnimationView, just return here!");
+ return;
+ }
+ }
+ else
+ {
+ Tizen.Log.Error("NUI", "can't find the callback in LottieAnimationView, just return here!");
+ return;
+ }
+ }
+ else
+ {
+ Tizen.Log.Error("NUI", "can't find LottieAnimationView by id, just return here!");
+ return;
+ }
+
+ switch (returnType)
+ {
+ case (int)(VectorProperty.FillColor):
+ case (int)(VectorProperty.StrokeColor):
+ Vector3 tmpVector3 = new Vector3(-1, -1, -1);
+ if (ret.Get(tmpVector3))
+ {
+ val1 = tmpVector3.X;
+ val2 = tmpVector3.Y;
+ val3 = tmpVector3.Z;
+ }
+ tmpVector3.Dispose();
+ break;
+
+ case (int)(VectorProperty.TransformAnchor):
+ case (int)(VectorProperty.TransformPosition):
+ case (int)(VectorProperty.TransformScale):
+ Vector2 tmpVector2 = new Vector2(-1, -1);
+ if (ret.Get(tmpVector2))
+ {
+ val1 = tmpVector2.X;
+ val2 = tmpVector2.Y;
+ }
+ tmpVector2.Dispose();
+ break;
+
+ case (int)(VectorProperty.FillOpacity):
+ case (int)(VectorProperty.StrokeOpacity):
+ case (int)(VectorProperty.StrokeWidth):
+ case (int)(VectorProperty.TransformRotation):
+ case (int)(VectorProperty.TransformOpacity):
+ float tmpFloat = -1;
+ if (ret.Get(out tmpFloat))
+ {
+ val1 = tmpFloat;
+ }
+ break;
+ default:
+ //do nothing
+ break;
+ }
+ ret.Dispose();
+ }
#endregion Internal
private VisualEventSignalCallbackType visualEventSignalCallback;
private EventHandler<VisualEventSignalArgs> visualEventSignalHandler;
+ static private int dynamicPropertyCallbackId = 0;
+ //static private Dictionary<int, DynamicPropertyCallbackType> dynamicPropertyCallbacks = new Dictionary<int, DynamicPropertyCallbackType>();
+ static private Dictionary<int, WeakReference<LottieAnimationView>> weakReferencesOfLottie = new Dictionary<int, WeakReference<LottieAnimationView>>();
+
private void debugPrint()
{
NUILog.Debug($"===================================");
NUILog.Debug($" RedrawInScalingDown={RedrawInScalingDown} >");
NUILog.Debug($"===================================");
}
+
#endregion Private
}
/// <param name="lottieView">The target LottieAnimationView to play.</param>
/// <param name="noPlay">Whether go direct to the EndFrame. It is false by default.</param>
[EditorBrowsable(EditorBrowsableState.Never)]
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1062: Validate arguments of public methods", Justification = "The null checking is done by BeReadyToShow()")]
public void Show(LottieAnimationView lottieView, bool noPlay = false)
{
if (!BeReadyToShow(lottieView))
return true;
}
}
+
+ // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public struct LottieAnimationViewDynamicProperty : IEquatable<LottieAnimationViewDynamicProperty>
+ {
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public string KeyPath { get; set; }
+
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public LottieAnimationView.VectorProperty Property { get; set; }
+
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public LottieAnimationView.DynamicPropertyCallbackType Callback { get; set; }
+
+ public override bool Equals(object obj)
+ {
+ if (obj is LottieAnimationViewDynamicProperty target)
+ {
+ if (KeyPath == target.KeyPath && Property == target.Property && Callback == target.Callback)
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public override int GetHashCode()
+ {
+ return base.GetHashCode();
+ }
+
+ public static bool operator ==(LottieAnimationViewDynamicProperty left, LottieAnimationViewDynamicProperty right)
+ {
+ return left.Equals(right);
+ }
+
+ public static bool operator !=(LottieAnimationViewDynamicProperty left, LottieAnimationViewDynamicProperty right)
+ {
+ return !(left == right);
+ }
+
+ public bool Equals(LottieAnimationViewDynamicProperty other)
+ {
+ if (other != null)
+ {
+ if (KeyPath == other.KeyPath && Property == other.Property && Callback == other.Callback)
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+ }
+
}
}
/// <summary>
- /// Retrieves the position of the view.<br />
- /// The coordinates are relative to the view's parent.<br />
+ /// Retrieves the position of the view.
+ /// The coordinates are relative to the view's parent.
/// </summary>
+ /// <remarks>
+ /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
+ /// Therefore, it is not updated in real time when the value is changed in the render thread (for example, the value is changed during animation).
+ /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
+ /// and users can get the current actual values through them.
+ /// </remarks>
/// <since_tizen> 3 </since_tizen>
public Position CurrentPosition
{
}
/// <summary>
- /// Retrieves the size of the view.<br />
- /// The coordinates are relative to the view's parent.<br />
+ /// Retrieves the size of the view.
+ /// The coordinates are relative to the view's parent.
/// </summary>
+ /// <remarks>
+ /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
+ /// Therefore, it is not updated in real time when the value is changed in the render thread (for example, the value is changed during animation).
+ /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
+ /// and users can get the current actual values through them.
+ /// </remarks>
/// <since_tizen> 3 </since_tizen>
public Size2D CurrentSize
{
return true;
}
+ /// <summary>
+ /// Retrieve the View's current Color.
+ /// </summary>
+ /// <remarks>
+ /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
+ /// Therefore, it is not updated in real time when the value is changed in the render thread (for example, the value is changed during animation).
+ /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
+ /// and users can get the current actual values through them.
+ /// </remarks>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Color CurrentColor => GetCurrentColor();
+
+ /// <summary>
+ /// Retrieve the current scale factor applied to the View.
+ /// </summary>
+ /// <remarks>
+ /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
+ /// Therefore, it is not updated in real time when the value is changed in the render thread (for example, the value is changed during animation).
+ /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
+ /// and users can get the current actual values through them.
+ /// </remarks>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Vector3 CurrentScale => GetCurrentScale();
}
}
}
/// <summary>
+ /// Retrieves a map property value.
+ /// </summary>
+ /// <param name="mapValue">On return, the map as vector of string and property value pairs.</param>
+ /// <returns>Returns true if the value is successfully retrieved, false if the type is not convertible.</returns>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public bool Get(ref PropertyMap mapValue)
+ {
+ if (mapValue == null)
+ {
+ return false;
+ }
+ bool ret = Interop.PropertyValue.GetMap(SwigCPtr, mapValue.SwigCPtr);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
+ /// <summary>
/// Retrieves a Extents value.
/// </summary>
/// <param name="extentsValue">On return, a extents.</param>
Interop.WidgetView.DeleteWidgetView(swigCPtr);
}
+ /// <inheritdoc/>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ protected override bool HandleControlStateOnTouch(Touch touch)
+ {
+ base.HandleControlStateOnTouch(touch);
+ return true; // Do not pass the touch event to the below.
+ }
+
// Callback for WidgetView WidgetAdded signal
private void OnWidgetAdded(IntPtr data)
{
{
if (borderInterface != null)
{
+ float height = 0;
+ if (isTop) height += topView.SizeHeight;
+ if (isBottom) height += bottomView.SizeHeight;
+
+ if (height != borderHeight)
+ {
+ float diff = height - borderHeight;
+ borderHeight = height;
+ WindowSize = new Size2D(WindowSize.Width, WindowSize.Height + (int)(diff));
+ }
+
if (minSize != borderInterface.MinSize)
{
using Size2D mimimumSize = new Size2D(borderInterface.MinSize.Width, borderInterface.MinSize.Height + (int)borderHeight);
Resized += OnBorderWindowResized;
+ Moved += OnBorderWindowMoved;
+
borderInterface.OnCreated(borderView);
// Increase the window size as much as the border area.
}
}
+ // Called when the window position has changed.
+ private void OnBorderWindowMoved(object sender, WindowMovedEventArgs e)
+ {
+ Tizen.Log.Info("NUI", $"OnBorderWindowMoved {e.WindowPosition.X}, {e.WindowPosition.Y}\n");
+ borderInterface.OnMoved(e.WindowPosition.X, e.WindowPosition.X);
+ }
+
// Called when the window size has changed.
private void OnBorderWindowResized(object sender, Window.ResizedEventArgs e)
/// The minimum size by which the window will small.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
- public Size2D MinSize
+ public Size2D MinSize
{
get
{
set
{
minSize = value;
- BorderWindow?.UpdateProperty();
+ UpdateProperty();
}
}
set
{
maxSize = value;
- BorderWindow?.UpdateProperty();
+ UpdateProperty();
}
}
set
{
resizePolicy = value;
- BorderWindow?.UpdateProperty();
+ UpdateProperty();
}
}
+ /// <summary>
+ /// Update properties
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public void UpdateProperty()
+ {
+ BorderWindow?.UpdateProperty();
+ }
+
/// <summary>
/// Creates a default border
}
else
{
+ OnRequestMove();
BorderWindow.RequestMoveToServer();
}
}
}
else
{
+ OnRequestMove();
BorderWindow.RequestMoveToServer();
}
}
}
/// <summary>
+ /// Called when requesting a move
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public virtual void OnRequestMove() {}
+
+ /// <summary>
+ /// Called when the window is moved.
+ /// </summary>
+ /// <param name="x">The x of the moved window</param>
+ /// <param name="y">The y of the moved window</param>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public virtual void OnMoved(int x, int y) {}
+
+ /// <summary>
/// Called when the window is maximized.
/// </summary>
/// <param name="isMaximized">If window is maximized or unmaximized.</param>
public void OnCreated(View borderView);
/// <summary>
- /// Called when requesting a resize
- /// </summary>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public void OnRequestResize();
-
- /// <summary>
/// Called when the window is resized.
/// </summary>
/// <param name="width">The width of the resized window</param>
public void OnResized(int width, int height);
/// <summary>
+ /// Called when the window is moved.
+ /// </summary>
+ /// <param name="x">The x of the moved window</param>
+ /// <param name="y">The y of the moved window</param>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public void OnMoved(int x, int y);
+
+ /// <summary>
/// Called when the window is maximized.
/// </summary>
/// <param name="isMaximized">If window is maximized or unmaximized.</param>
private TouchDataSignal interceptTouchDataSignal;
private TouchSignal interceptTouchSignal;
- [UnmanagedFunctionPointer(CallingConvention.StdCall)]
+ [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
private delegate void WindowFocusChangedEventCallbackType(IntPtr window, bool focusGained);
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
private delegate bool RootLayerTouchDataCallbackType(IntPtr view, IntPtr touchData);
--- /dev/null
+/*
+ * Copyright (c) 2022 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 System;
+using Tizen.NUI;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Components;
+using Tizen.Applications;
+
+namespace WidgetApplicationTemplate
+{
+ class Program : NUIApplication
+ {
+ string widgetAppId = "NUISettingsReset";
+
+ protected override void OnCreate()
+ {
+ base.OnCreate();
+ Initialize();
+ }
+ void Initialize()
+ {
+ Window window = GetDefaultWindow();
+ window.KeyEvent += OnKeyEvent;
+ window.TouchEvent += OnTouchEvent;
+
+ int widgetWidth = window.Size.Width;
+ int widgetHeight = window.Size.Height;
+
+ Bundle bundle = new Bundle();
+ bundle.AddItem(" ", " ");
+ String encodedBundle = bundle.Encode();
+
+ // Add Widget of "secondPage@NUISettingsReset" in advance to avoid loading pending.
+ AddWidget(out secondPageWidgetView, "secondPage@NUISettingsReset", encodedBundle, widgetWidth, widgetHeight, 0.0f);
+
+ Navigator navigator = window.GetDefaultNavigator();
+
+ var button = new Button()
+ {
+ Text = "Click to Second Page",
+ WidthSpecification = LayoutParamPolicies.MatchParent,
+ HeightSpecification = LayoutParamPolicies.MatchParent,
+ };
+ button.Clicked += (o, e) =>
+ {
+ var page = new ContentPage();
+ page.Content = secondPageWidgetView;
+ navigator.Push(page);
+ };
+
+ // Push the first page.
+ PushContentPage("First Page", button);
+ }
+
+ void AddWidget(out WidgetView widgetView, string widgetID, string contentInfo, int width, int height, float updatePeriod)
+ {
+ widgetView = WidgetViewManager.Instance.AddWidget(widgetID, contentInfo, width, height, updatePeriod);
+ widgetView.WidgetContentUpdated += OnWidgetContentUpdatedCB;
+ }
+
+ void PushContentPage(string title, View content)
+ {
+ Window window = GetDefaultWindow();
+ Navigator navigator = window.GetDefaultNavigator();
+
+ window.KeyEvent += OnKeyEvent;
+ window.TouchEvent += OnTouchEvent;
+
+ var page = new ContentPage()
+ {
+ AppBar = new AppBar()
+ {
+ Title = title,
+ },
+ };
+
+ page.Content = content;
+ navigator.Push(page);
+ }
+
+ public void OnKeyEvent(object sender, Window.KeyEventArgs e)
+ {
+ }
+
+ private void OnTouchEvent(object source, Window.TouchEventArgs e)
+ {
+ }
+
+ private void OnWidgetContentUpdatedCB(object sender, WidgetView.WidgetViewEventArgs e)
+ {
+ String encodedBundle = e.WidgetView.ContentInfo;
+ Bundle bundle = Bundle.Decode(encodedBundle);
+
+ string widgetID;
+ if (bundle.TryGetItem("WIDGET_ID", out widgetID))
+ {
+ }
+
+ string widgetWidth;
+ if (bundle.TryGetItem("WIDGET_WIDTH", out widgetWidth))
+ {
+ }
+
+ string widgetHeight;
+ if (bundle.TryGetItem("WIDGET_HEIGHT", out widgetHeight))
+ {
+ }
+
+ string widgetPage;
+ if (bundle.TryGetItem("WIDGET_PAGE", out widgetPage))
+ {
+ }
+
+ string widgetAction;
+ if (bundle.TryGetItem("WIDGET_ACTION", out widgetAction))
+ {
+ if (widgetAction.Equals("ADD"))
+ {
+ if (Int32.TryParse(widgetWidth, out int width) && Int32.TryParse(widgetHeight, out int height))
+ {
+ Bundle bundle2 = new Bundle();
+ bundle2.AddItem(" ", " ");
+ String encodedBundle2 = bundle2.Encode();
+
+ if (widgetID.Equals("secondPage@NUISettingsReset"))
+ {
+ secondPageWidgetView = WidgetViewManager.Instance.AddWidget(widgetID, encodedBundle2, width, height, 0.0f);
+ secondPageWidgetView.WidgetContentUpdated += OnWidgetContentUpdatedCB;
+ }
+ else if (widgetID.Equals("thirdPage@NUISettingsReset"))
+ {
+ thirdPageWidgetView = WidgetViewManager.Instance.AddWidget(widgetID, encodedBundle2, width, height, 0.0f);
+ thirdPageWidgetView.WidgetContentUpdated += OnWidgetContentUpdatedCB;
+ }
+ else if (widgetID.Equals("fourthPage@NUISettingsReset"))
+ {
+ fourthPageWidgetView = WidgetViewManager.Instance.AddWidget(widgetID, encodedBundle2, width, height, 0.0f);
+ fourthPageWidgetView.WidgetContentUpdated += OnWidgetContentUpdatedCB;
+ }
+ }
+ }
+ else if (widgetAction.Equals("PUSH"))
+ {
+ if (widgetPage.Equals("CONTENT_PAGE"))
+ {
+ if (widgetID.Equals("secondPage@NUISettingsReset"))
+ {
+ NUIApplication.GetDefaultWindow().GetDefaultNavigator().Push(new ContentPage() { Content = secondPageWidgetView });
+ }
+ else if (widgetID.Equals("thirdPage@NUISettingsReset"))
+ {
+ NUIApplication.GetDefaultWindow().GetDefaultNavigator().Push(new ContentPage() { Content = thirdPageWidgetView });
+ }
+ else if (widgetID.Equals("fourthPage@NUISettingsReset"))
+ {
+ NUIApplication.GetDefaultWindow().GetDefaultNavigator().Push(new ContentPage() { Content = fourthPageWidgetView });
+ }
+ }
+ else if (widgetPage.Equals("DIALOG_PAGE"))
+ {
+ if (widgetID.Equals("secondPage@NUISettingsReset"))
+ {
+ NUIApplication.GetDefaultWindow().GetDefaultNavigator().Push(new DialogPage() { Content = secondPageWidgetView });
+ }
+ else if (widgetID.Equals("thirdPage@NUISettingsReset"))
+ {
+ NUIApplication.GetDefaultWindow().GetDefaultNavigator().Push(new DialogPage() { Content = thirdPageWidgetView });
+ }
+ else if (widgetID.Equals("fourthPage@NUISettingsReset"))
+ {
+ NUIApplication.GetDefaultWindow().GetDefaultNavigator().Push(new DialogPage() { Content = fourthPageWidgetView });
+ }
+ }
+ }
+ else if (widgetAction.Equals("POP"))
+ {
+ NUIApplication.GetDefaultWindow().GetDefaultNavigator().Pop();
+ }
+ }
+ }
+
+ static void Main(string[] args)
+ {
+ var app = new Program();
+ app.Run(args);
+ }
+
+ WidgetView secondPageWidgetView;
+ WidgetView thirdPageWidgetView;
+ WidgetView fourthPageWidgetView;
+ }
+}
\ No newline at end of file
--- /dev/null
+<Project Sdk="Microsoft.NET.Sdk">
+
+ <PropertyGroup>
+ <OutputType>Exe</OutputType>
+ <TargetFramework>netcoreapp2.0</TargetFramework>
+ <AssemblyName>NUISettings</AssemblyName>
+ <SignAssembly>true</SignAssembly>
+ <PackageId>NUISettings</PackageId>
+ <Authors>NUISettings</Authors>
+ <Company>NUISettings</Company>
+ <Product>NUISettings</Product>
+ </PropertyGroup>
+
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugType>portable</DebugType>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>None</DebugType>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <ProjectReference Include="../../../src/Tizen.NUI.Components/Tizen.NUI.Components.csproj" />
+ <ProjectReference Include="../../../src/Tizen.Applications.MessagePort/Tizen.Applications.MessagePort.csproj" />
+ <PackageReference Include="Tizen.NET.Sdk" Version="1.0.9" />
+ </ItemGroup>
+
+</Project>
+
--- /dev/null
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.30309.148
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NUISettings", "NUISettings.csproj", "{3C6CE4CE-9D35-42C9-B23D-BBFFA96B3955}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {3C6CE4CE-9D35-42C9-B23D-BBFFA96B3955}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {3C6CE4CE-9D35-42C9-B23D-BBFFA96B3955}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {3C6CE4CE-9D35-42C9-B23D-BBFFA96B3955}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {3C6CE4CE-9D35-42C9-B23D-BBFFA96B3955}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {355D568D-D02A-490A-A6AC-FD6C7D97457A}
+ EndGlobalSection
+EndGlobal
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<manifest package="NUISettings" version="1.0.0" api-version="4" xmlns="http://tizen.org/ns/packages">
+ <profile name="tv" />
+ <ui-application appid="NUISettings" exec="NUISettings.dll" multiple="false" nodisplay="false" taskmanage="true"
+ splash-screen-display="true"
+ type="dotnet"
+ launch_mode="single">
+ <label>NUISettings</label>
+ <icon>NUISettings.png</icon>
+ <metadata key="http://tizen.org/metadata/prefer_dotnet_aot" value="true" />
+ <splash-screens />
+ </ui-application>
+ <privileges>
+ <privilege>http://tizen.org/privilege/widget.viewer</privilege>
+ <privilege>http://tizen.org/privilege/appmanager.launch</privilege>
+ <privilege>http://tizen.org/privilege/datasharing</privilege>
+ </privileges>
+</manifest>
--- /dev/null
+/*
+ * Copyright (c) 2022 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 System;
+using System.Collections.Generic; // for Dictionary
+using Tizen.NUI;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Components;
+using Tizen.Applications;
+
+namespace WidgetTemplate
+{
+ class SecondPage : Widget
+ {
+ protected override void OnCreate(string contentInfo, Window window)
+ {
+ Bundle bundle = Bundle.Decode(contentInfo);
+
+ window.BackgroundColor = Color.Transparent;
+
+ // Update Widget Content by sending message to add the third page in advance.
+ Bundle nextBundle = new Bundle();
+ nextBundle.AddItem("WIDGET_ID", "thirdPage@NUISettingsReset");
+ nextBundle.AddItem("WIDGET_ACTION", "ADD");
+ nextBundle.AddItem("WIDGET_WIDTH", window.Size.Width.ToString());
+ nextBundle.AddItem("WIDGET_HEIGHT", window.Size.Height.ToString());
+ String encodedBundle = nextBundle.Encode();
+ SetContentInfo(encodedBundle);
+
+ var appBar = new AppBar()
+ {
+ Title = "Second Page",
+ AutoNavigationContent = false,
+ };
+
+ var appBarStyle = ThemeManager.GetStyle("Tizen.NUI.Components.AppBar");
+
+ var navigationContent = new Button(((AppBarStyle)appBarStyle).BackButton);
+ navigationContent.Clicked += (o, e) =>
+ {
+ // Update Widget Content by sending message to pop the second page.
+ Bundle nextBundle2 = new Bundle();
+ nextBundle2.AddItem("WIDGET_ACTION", "POP");
+ String encodedBundle2 = nextBundle2.Encode();
+ SetContentInfo(encodedBundle2);
+ };
+
+ appBar.NavigationContent = navigationContent;
+
+ var page = new ContentPage()
+ {
+ AppBar = appBar,
+ };
+
+ var button = new Button()
+ {
+ Text = "Click to Third Page",
+ WidthSpecification = LayoutParamPolicies.MatchParent,
+ HeightSpecification = LayoutParamPolicies.MatchParent,
+ };
+ button.Clicked += (o, e) =>
+ {
+ // Update Widget Content by sending message to push the third page.
+ Bundle nextBundle2 = new Bundle();
+ nextBundle2.AddItem("WIDGET_ID", "thirdPage@NUISettingsReset");
+ nextBundle2.AddItem("WIDGET_PAGE", "CONTENT_PAGE");
+ nextBundle2.AddItem("WIDGET_ACTION", "PUSH");
+ String encodedBundle2 = nextBundle2.Encode();
+ SetContentInfo(encodedBundle2);
+ };
+
+ page.Content = button;
+ window.Add(page);
+ }
+
+ protected override void OnPause()
+ {
+ base.OnPause();
+ }
+
+ protected override void OnResume()
+ {
+ base.OnResume();
+ }
+
+ protected override void OnResize(Window window)
+ {
+ base.OnResize(window);
+ }
+
+ protected override void OnTerminate(string contentInfo, TerminationType type)
+ {
+ base.OnTerminate(contentInfo, type);
+ }
+
+ protected override void OnUpdate(string contentInfo, int force)
+ {
+ base.OnUpdate(contentInfo, force);
+ }
+ }
+
+ class ThirdPage : Widget
+ {
+ protected override void OnCreate(string contentInfo, Window window)
+ {
+ Bundle bundle = Bundle.Decode(contentInfo);
+
+ window.BackgroundColor = Color.Transparent;
+
+ // Update Widget Content by sending message to add the fourth page in advance.
+ Bundle nextBundle = new Bundle();
+ nextBundle.AddItem("WIDGET_ID", "fourthPage@NUISettingsReset");
+ nextBundle.AddItem("WIDGET_WIDTH", window.Size.Width.ToString());
+ nextBundle.AddItem("WIDGET_HEIGHT", window.Size.Height.ToString());
+ nextBundle.AddItem("WIDGET_ACTION", "ADD");
+ String encodedBundle = nextBundle.Encode();
+ SetContentInfo(encodedBundle);
+
+ var appBar = new AppBar()
+ {
+ Title = "Third Page",
+ AutoNavigationContent = false,
+ };
+
+ var appBarStyle = ThemeManager.GetStyle("Tizen.NUI.Components.AppBar");
+
+ var navigationContent = new Button(((AppBarStyle)appBarStyle).BackButton);
+ navigationContent.Clicked += (o, e) =>
+ {
+ // Update Widget Content by sending message to pop the third page.
+ Bundle nextBundle2 = new Bundle();
+ nextBundle2.AddItem("WIDGET_ACTION", "POP");
+ String encodedBundle2 = nextBundle2.Encode();
+ SetContentInfo(encodedBundle2);
+ };
+
+ appBar.NavigationContent = navigationContent;
+
+ var page = new ContentPage()
+ {
+ AppBar = appBar,
+ };
+
+ var button = new Button()
+ {
+ Text = "Click to Fourth Page",
+ WidthSpecification = LayoutParamPolicies.MatchParent,
+ HeightSpecification = LayoutParamPolicies.MatchParent,
+ };
+ button.Clicked += (o, e) =>
+ {
+ // Update Widget Content by sending message to push the fourth page.
+ Bundle nextBundle2 = new Bundle();
+ nextBundle2.AddItem("WIDGET_ID", "fourthPage@NUISettingsReset");
+ nextBundle2.AddItem("WIDGET_PAGE", "DIALOG_PAGE");
+ nextBundle2.AddItem("WIDGET_ACTION", "PUSH");
+ String encodedBundle2 = nextBundle2.Encode();
+ SetContentInfo(encodedBundle2);
+ };
+
+ page.Content = button;
+ window.Add(page);
+ }
+
+ protected override void OnPause()
+ {
+ base.OnPause();
+ }
+
+ protected override void OnResume()
+ {
+ base.OnResume();
+ }
+
+ protected override void OnResize(Window window)
+ {
+ base.OnResize(window);
+ }
+
+ protected override void OnTerminate(string contentInfo, TerminationType type)
+ {
+ base.OnTerminate(contentInfo, type);
+ }
+
+ protected override void OnUpdate(string contentInfo, int force)
+ {
+ base.OnUpdate(contentInfo, force);
+ }
+ }
+
+ class FourthPage : Widget
+ {
+ protected override void OnCreate(string contentInfo, Window window)
+ {
+ Bundle bundle = Bundle.Decode(contentInfo);
+
+ window.BackgroundColor = Color.Transparent;
+
+ var button = new Button()
+ {
+ Text = "OK",
+ };
+ button.Clicked += (o, e) =>
+ {
+ // Update Widget Content by sending message to pop the fourth page.
+ Bundle nextBundle2 = new Bundle();
+ nextBundle2.AddItem("WIDGET_ACTION", "POP");
+ String encodedBundle2 = nextBundle2.Encode();
+ SetContentInfo(encodedBundle2);
+ };
+
+ var dialog = new AlertDialog()
+ {
+ Title = "Fourth Page",
+ Message = "Message",
+ Actions = new View[] { button },
+ };
+
+ window.Add(dialog);
+ }
+
+ protected override void OnPause()
+ {
+ base.OnPause();
+ }
+
+ protected override void OnResume()
+ {
+ base.OnResume();
+ }
+
+ protected override void OnResize(Window window)
+ {
+ base.OnResize(window);
+ }
+
+ protected override void OnTerminate(string contentInfo, TerminationType type)
+ {
+ base.OnTerminate(contentInfo, type);
+ }
+
+ protected override void OnUpdate(string contentInfo, int force)
+ {
+ base.OnUpdate(contentInfo, force);
+ }
+ }
+
+ class Program : NUIWidgetApplication
+ {
+ public Program(Dictionary<System.Type, string> widgetSet) : base(widgetSet)
+ {
+
+ }
+
+ protected override void OnCreate()
+ {
+ base.OnCreate();
+ Initialize();
+ }
+
+ void Initialize()
+ {
+ }
+
+ public void OnKeyEvent(object sender, Window.KeyEventArgs e)
+ {
+ if (e.Key.State == Key.StateType.Down && (e.Key.KeyPressedName == "XF86Back" || e.Key.KeyPressedName == "Escape"))
+ {
+ Exit();
+ }
+ }
+
+ static void Main(string[] args)
+ {
+ Dictionary<System.Type, string> widgetSet = new Dictionary<Type, string>();
+ widgetSet.Add(typeof(SecondPage), "secondPage@NUISettingsReset");
+ widgetSet.Add(typeof(ThirdPage), "thirdPage@NUISettingsReset");
+ widgetSet.Add(typeof(FourthPage), "fourthPage@NUISettingsReset");
+ var app = new Program(widgetSet);
+ app.Run(args);
+ }
+ }
+}
\ No newline at end of file
--- /dev/null
+<Project Sdk="Microsoft.NET.Sdk">
+
+ <PropertyGroup>
+ <OutputType>Exe</OutputType>
+ <TargetFramework>netcoreapp2.0</TargetFramework>
+ <AssemblyName>NUISettingsReset</AssemblyName>
+ <SignAssembly>true</SignAssembly>
+ <PackageId>NUISettingsReset</PackageId>
+ <Authors>NUISettingsReset</Authors>
+ <Company>NUISettingsReset</Company>
+ <Product>NUISettingsReset</Product>
+ </PropertyGroup>
+
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugType>portable</DebugType>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>None</DebugType>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <ProjectReference Include="../../../src/Tizen.NUI.Components/Tizen.NUI.Components.csproj" />
+ <ProjectReference Include="../../../src/Tizen.Applications.MessagePort/Tizen.Applications.MessagePort.csproj" />
+ <PackageReference Include="Tizen.NET.Sdk" Version="1.0.9" />
+ </ItemGroup>
+
+</Project>
+
--- /dev/null
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.30309.148
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NUISettingsReset", "NUISettingsReset.csproj", "{3C6CE4CE-9D35-42C9-B23D-BBFFA96B3955}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {3C6CE4CE-9D35-42C9-B23D-BBFFA96B3955}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {3C6CE4CE-9D35-42C9-B23D-BBFFA96B3955}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {3C6CE4CE-9D35-42C9-B23D-BBFFA96B3955}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {3C6CE4CE-9D35-42C9-B23D-BBFFA96B3955}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {355D568D-D02A-490A-A6AC-FD6C7D97457A}
+ EndGlobalSection
+EndGlobal
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns="http://tizen.org/ns/packages" api-version="5" package="NUISettingsReset" version="1.0.0">
+ <profile name="common" />
+ <widget-application appid="NUISettingsReset"
+ exec="NUISettingsReset.dll"
+ type="dotnet"
+ multiple="false"
+ taskmanage="true"
+ nodisplay="false"
+ launch_mode="single">
+ <label>NUISettingsReset</label>
+ <icon>NUISettingsReset.png</icon>
+ <widget-class classid="secondPage" update-period="0">
+ <support-size preview="NUISettingsReset.png">4x4</support-size>
+ </widget-class>
+ <widget-class classid="thirdPage" update-period="0">
+ <support-size preview="NUISettingsReset.png">4x4</support-size>
+ </widget-class>
+ <widget-class classid="fourthPage" update-period="0">
+ <support-size preview="NUISettingsReset.png">4x4</support-size>
+ </widget-class>
+ <metadata key="http://tizen.org/metadata/prefer_dotnet_aot" value="true" />
+ </widget-application>
+</manifest>
+
Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio Version 16
-VisualStudioVersion = 16.0.29613.14
+# Visual Studio Version 17
+VisualStudioVersion = 17.1.32414.318
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.NUI.Samples", "Tizen.NUI.Samples\Tizen.NUI.Samples.csproj", "{B2EC3963-C77F-4D1A-9387-8BA0DB298266}"
EndProject
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.NUI.Extension", "..\..\src\Tizen.NUI.Extension\Tizen.NUI.Extension.csproj", "{47829CA1-0E21-4687-9ABB-0C27E1A67E85}"
EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Tracer", "..\..\src\Tizen.Tracer\Tizen.Tracer.csproj", "{A0AA9346-2025-4803-A168-3B39A367BB92}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.NUI.Scene3D", "..\..\src\Tizen.NUI.Scene3D\Tizen.NUI.Scene3D.csproj", "{C5BFC65A-91D1-424E-BEC4-4A40329DA185}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
{47829CA1-0E21-4687-9ABB-0C27E1A67E85}.Debug|Any CPU.Build.0 = Debug|Any CPU
{47829CA1-0E21-4687-9ABB-0C27E1A67E85}.Release|Any CPU.ActiveCfg = Release|Any CPU
{47829CA1-0E21-4687-9ABB-0C27E1A67E85}.Release|Any CPU.Build.0 = Release|Any CPU
+ {A0AA9346-2025-4803-A168-3B39A367BB92}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {A0AA9346-2025-4803-A168-3B39A367BB92}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {A0AA9346-2025-4803-A168-3B39A367BB92}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {A0AA9346-2025-4803-A168-3B39A367BB92}.Release|Any CPU.Build.0 = Release|Any CPU
+ {C5BFC65A-91D1-424E-BEC4-4A40329DA185}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {C5BFC65A-91D1-424E-BEC4-4A40329DA185}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {C5BFC65A-91D1-424E-BEC4-4A40329DA185}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {C5BFC65A-91D1-424E-BEC4-4A40329DA185}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
--- /dev/null
+
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI;
+using System.Collections.Generic;
+
+namespace Tizen.NUI.Samples
+{
+ using tlog = Tizen.Log;
+ public class LottieAnimationViewDynamicPropertyTest : IExample
+ {
+
+ const int NUM_OF_VIEW = 5;
+ const int TIMER_INTERVAL = 3000;
+ const string tag = "NUITEST";
+ Window win;
+ View root;
+ Timer timer;
+ public void Activate()
+ {
+ win = NUIApplication.GetDefaultWindow();
+
+ root = new View()
+ {
+ Size = new Size(win.Size.Width, win.Size.Height, 0),
+ BackgroundColor = Color.Yellow,
+ Layout = new LinearLayout()
+ {
+ LinearOrientation = LinearLayout.Orientation.Horizontal,
+ },
+ };
+ win.Add(root);
+
+ timer = new Timer(TIMER_INTERVAL);
+ timer.Tick += OnTick;
+ timer.Start();
+ }
+
+ int cnt;
+ bool OnTick(object sender, Timer.TickEventArgs e)
+ {
+ bool ret = false;
+ //ret = Test1();
+ //ret = Test2();
+ ret = Test3();
+ return ret;
+ }
+
+ //create objects => explicit dispose => create objects => implicit dispose
+ bool Test1()
+ {
+ switch (cnt % 4)
+ {
+ case 0:
+ MakeAll();
+ break;
+ case 1:
+ DisposeAll();
+ break;
+ case 2:
+ MakeAll();
+ break;
+ case 3:
+ ImplicitDispose();
+ break;
+ default:
+ DisposeAll();
+ break;
+ }
+ cnt++;
+ return true;
+ }
+
+ //create objects => implicit dispose => force full GC
+ bool Test2()
+ {
+ switch (cnt % 3)
+ {
+ case 0:
+ MakeAll();
+ break;
+ case 1:
+ ImplicitDispose();
+ break;
+ case 2:
+ ForceFullGC();
+ break;
+ default:
+ DisposeAll();
+ break;
+ }
+ cnt++;
+ return true;
+ }
+
+ global::System.Random rand = new global::System.Random();
+ bool Test3()
+ {
+ var lav = new LottieAnimationView();
+ lav.Size2D = new Size2D(300, 300);
+ lav.Position2D = new Position2D(rand.Next(10, 1000), rand.Next(10, 1000));
+ if (cnt++ % 2 == 0)
+ {
+ lav.URL = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "a.json";
+ }
+ else
+ {
+ lav.URL = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "done.json";
+ }
+ lav.LoopCount = -1;
+ lav.BackgroundColor = Color.White;
+ win.Add(lav);
+ lav.Play();
+
+ var ret = lav.GetContentInfo();
+ tlog.Fatal(tag, $"ret.Count {ret.Count}");
+ foreach (var item in ret)
+ {
+ tlog.Fatal(tag, $"item:({item.Item1}, {item.Item2}, {item.Item3})");
+ }
+ return true;
+ }
+
+ void ForceFullGC()
+ {
+ tlog.Debug(tag, "ForceFullGC start");
+ global::System.GC.Collect();
+ global::System.GC.WaitForPendingFinalizers();
+ global::System.GC.Collect();
+ tlog.Debug(tag, "ForceFullGC end");
+ }
+
+ void MakeAll()
+ {
+ tlog.Debug(tag, $"MakeAll() start");
+ int width = (int)(root.Size.Width / NUM_OF_VIEW);
+ for (int i = 0; i < NUM_OF_VIEW; i++)
+ {
+ var lav = new LottieAnimationView();
+ lav.Size2D = new Size2D(width, width);
+ lav.URL = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "done.json";
+ lav.LoopCount = -1;
+ lav.BackgroundColor = Color.White;
+ root.Add(lav);
+
+ LottieAnimationViewDynamicProperty pro = new LottieAnimationViewDynamicProperty
+ {
+ KeyPath = "Shape Layer 1.Ellipse 1.Fill 1",
+ Property = LottieAnimationView.VectorProperty.FillColor,
+ Callback = new Tizen.NUI.BaseComponents.LottieAnimationView.DynamicPropertyCallbackType(OnFillColor),
+ };
+
+ if (i % 1 == 0)
+ {
+ lav.DoActionExtension(pro);
+ }
+
+ if (i % 2 == 0)
+ {
+ pro.KeyPath = "**";
+ pro.Property = LottieAnimationView.VectorProperty.StrokeColor;
+ pro.Callback = new Tizen.NUI.BaseComponents.LottieAnimationView.DynamicPropertyCallbackType(OnStrokColor);
+ lav.DoActionExtension(pro);
+ }
+
+ if (i % 3 == 0)
+ {
+ pro.KeyPath = "**";
+ pro.Property = LottieAnimationView.VectorProperty.StrokeWidth;
+ pro.Callback = new Tizen.NUI.BaseComponents.LottieAnimationView.DynamicPropertyCallbackType(OnStrokWidth);
+ lav.DoActionExtension(pro);
+ }
+
+ if (i % 4 == 0)
+ {
+ pro.KeyPath = "Shape Layer 2.Shape 1";
+ pro.Property = LottieAnimationView.VectorProperty.TransformRotation;
+ pro.Callback = new Tizen.NUI.BaseComponents.LottieAnimationView.DynamicPropertyCallbackType(OnTransformRotation);
+ lav.DoActionExtension(pro);
+ }
+ lav.Play();
+ }
+ tlog.Debug(tag, $"MakeAll() end");
+ }
+
+ void DisposeAll()
+ {
+ tlog.Debug(tag, $"DisposeAll() start");
+ int childNum = (int)root.ChildCount;
+ for (int i = childNum - 1; i >= 0; i--)
+ {
+ var child = root.GetChildAt((uint)i);
+ if (child != null)
+ {
+ child.Unparent();
+ child.Dispose();
+ }
+ }
+ tlog.Debug(tag, $"DisposeAll() end");
+ }
+
+ void ImplicitDispose()
+ {
+ tlog.Debug(tag, $"ImplicitDispose() start");
+ int childNum = (int)root.ChildCount;
+ for (int i = childNum - 1; i >= 0; i--)
+ {
+ var child = root.GetChildAt((uint)i);
+ if (child != null)
+ {
+ child.Unparent();
+ }
+ }
+ tlog.Debug(tag, $"ImplicitDispose() end");
+ }
+
+ private PropertyValue OnFillColor(int returnType, uint frameNumber)
+ {
+ tlog.Debug(tag, $"OnFillColor() returnType={returnType} frameNumber={frameNumber}");
+ if (frameNumber < 60)
+ {
+ return new PropertyValue(new Vector3(0, 0, 1));
+ }
+ else
+ {
+ return new PropertyValue(new Vector3(1, 0, 0));
+ }
+ }
+
+ private PropertyValue OnStrokColor(int returnType, uint frameNumber)
+ {
+ tlog.Debug(tag, $"OnStrokColor() returnType={returnType} frameNumber={frameNumber}");
+ if (frameNumber < 60)
+ {
+ return new PropertyValue(new Vector3(1, 0, 1));
+ }
+ else
+ {
+ return new PropertyValue(new Vector3(1, 1, 0));
+ }
+ }
+
+ private PropertyValue OnStrokWidth(int returnType, uint frameNumber)
+ {
+ tlog.Debug(tag, $"OnStrokWidth() returnType={returnType} frameNumber={frameNumber}");
+
+ if (frameNumber < 60)
+ {
+ return new PropertyValue(2.0f);
+ }
+ else
+ {
+ return new PropertyValue(5.0f);
+ }
+ }
+
+ private PropertyValue OnTransformRotation(int returnType, uint frameNumber)
+ {
+ tlog.Debug(tag, $"OnTransformRotation() returnType={returnType} frameNumber={frameNumber}");
+
+ return new PropertyValue(frameNumber * 20.0f);
+ }
+
+ public void Deactivate()
+ {
+ root.Unparent();
+ timer.Stop();
+ DisposeAll();
+ root.Dispose();
+ }
+ }
+}
{
Window win;
int cnt;
+ TextLabel statusText;
+ global::System.Random rand = new global::System.Random();
+
public void Activate()
{
win = NUIApplication.GetDefaultWindow();
- win.BackgroundColor = Color.White;
+ win.BackgroundColor = Color.Green;
+
+ statusText = new TextLabel()
+ {
+ Size = new Size(300, 300),
+ Position = new Position(300, 10),
+ Text = "Status Text",
+ PointSize = 12,
+ BackgroundColor = Color.Cyan,
+ MultiLine = true,
+ Opacity = 0.6f,
+ Name = "test text",
+ };
View view = new View()
{
Size = new Size(100, 100),
- BackgroundColor = Color.Red,
+ Position = new Position(10, 10),
+ Color = Color.Yellow,
+ BackgroundColor = Color.White,
Name = "test view",
};
{
Tizen.Log.Error("NUI", $"Size changed! ({target.SizeWidth},{target.SizeHeight})");
global::System.Console.WriteLine($"Size changed! ({target.SizeWidth},{target.SizeHeight})");
+ statusText.Text = $"size changed! \n CurrentSize:({target.CurrentSize.Width},{target.CurrentSize.Height}) \n" +
+ $" CurrentPosition:({target.CurrentPosition.X},{target.CurrentPosition.Y},{target.CurrentPosition.Z}) \n" +
+ $" CurrentColor:({target.CurrentColor.R},{target.CurrentColor.G},{target.CurrentColor.B}) \n" +
+ $" CurrentScale:({target.CurrentScale.X},{target.CurrentScale.Y},{target.CurrentScale.Z}) \n";
}
Tizen.Log.Error("NUI", "Size changed");
};
Button button = new Button()
{
- Size = new Size(100, 100),
+ Size = new Size(200, 100),
Position = new Position(200, 200),
- Text = "Click me",
+ Text = "change size",
Name = "test button",
};
-
button.Clicked += (object source, ClickedEventArgs args) =>
{
- if (++cnt % 2 == 0)
- {
- view.Size += new Size(5, 5);
- }
- else
- {
- view.Position += new Position(10, 10);
- }
+ view.Size += new Size(2, 2);
+ view.Position += new Position(30, 30);
+ view.Color += new Color(0.03f, 0.06f, 0.03f, 1f);
+ view.Scale += new Vector3(0.3f, 0.2f, 0);
+ };
+
+ Button resetBtn = new Button()
+ {
+ Size = new Size(200, 100),
+ Position = new Position(200, 310),
+ Text = "reset",
+ Name = "reset button",
+ };
+ resetBtn.Clicked += (object source, ClickedEventArgs args) =>
+ {
+ view.Size = new Size(rand.Next(50, 100), rand.Next(50, 100));
+ view.Position = new Position(rand.Next(5, 10), rand.Next(5, 10));
+ view.Color = new Color(rand.Next(5, 10) / 255.0f, rand.Next(5, 10) / 255.0f, rand.Next(5, 10) / 255.0f, 1);
+ view.Scale = new Vector3(1, 1, 0);
};
win.GetDefaultLayer().Add(view);
win.GetDefaultLayer().Add(button);
+ win.GetDefaultLayer().Add(statusText);
+ win.GetDefaultLayer().Add(resetBtn);
+
+ view.SetColorMode(ColorMode.UseOwnColor);
+ view.LowerToBottom();
+ button.RaiseAbove(statusText);
+ resetBtn.RaiseAbove(statusText);
}
public void Deactivate()
{
win.GetDefaultLayer().FindChildByName("test view")?.Unparent();
win.GetDefaultLayer().FindChildByName("test button")?.Unparent();
+ win.GetDefaultLayer().FindChildByName("test text")?.Unparent();
+ win.GetDefaultLayer().FindChildByName("reset button")?.Unparent();
}
}
}
--- /dev/null
+
+using System;
+using Tizen.NUI;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Components;
+using System.IO;
+using System.Text;
+
+namespace Tizen.NUI.Samples
+{
+ using tlog = Tizen.Log;
+ public class WebViewInterceptTest : IExample
+ {
+ const string tag = "NUITEST";
+ private View root;
+ private Window win;
+ private Button btn1, btn2, btn3;
+ private WebView webView1, webView2;
+ private string invalidUrl = "https://test/";
+
+ public void Activate()
+ {
+ win = NUIApplication.GetDefaultWindow();
+
+ root = new View()
+ {
+ Size = new Size(win.Size.Width, win.Size.Height, 0),
+ BackgroundColor = Color.Green,
+ Layout = new LinearLayout()
+ {
+ LinearOrientation = LinearLayout.Orientation.Vertical,
+ Padding = new Extents(3, 3, 3, 3),
+ },
+ };
+ win.Add(root);
+
+ webView1 = new WebView();
+ webView1.Url = "https://m.naver.com/";
+ webView1.WidthSpecification = LayoutParamPolicies.MatchParent;
+ webView1.HeightSpecification = LayoutParamPolicies.MatchParent;
+ root.Add(webView1);
+
+ webView2 = new WebView();
+ webView2.Url = "https://m.google.com/";
+ webView2.WidthSpecification = LayoutParamPolicies.MatchParent;
+ webView2.HeightSpecification = LayoutParamPolicies.MatchParent;
+ root.Add(webView2);
+
+ btn1 = new Button()
+ {
+ HeightSpecification = 50,
+ WidthSpecification = 300,
+ Text = "register intercept callback",
+ };
+ btn1.Clicked += (s, e) =>
+ {
+ webView1.Context.RegisterHttpRequestInterceptedCallback(Callback);
+ // only this Callback2 will be invoked for all created WebViews, because the Context is global(Callback will be ignored).
+ webView2.Context.RegisterHttpRequestInterceptedCallback(Callback2);
+ };
+ root.Add(btn1);
+
+ btn2 = new Button()
+ {
+ HeightSpecification = 50,
+ WidthSpecification = 300,
+ Text = "WebView1 load invalid url",
+ };
+ btn2.Clicked += (s, e) =>
+ {
+ webView1.LoadUrl(invalidUrl);
+ };
+ root.Add(btn2);
+
+ btn3 = new Button()
+ {
+ HeightSpecification = 50,
+ WidthSpecification = 300,
+ Text = "WebView2 load invalid url",
+ };
+ btn3.Clicked += (s, e) =>
+ {
+ webView2.LoadUrl(invalidUrl);
+ };
+ root.Add(btn3);
+
+ }
+
+ private void Callback(WebHttpRequestInterceptor interceptor)
+ {
+ tlog.Debug(tag, $"callback: http request intercepted start, Url: {interceptor.Url}");
+
+ //interceptor.Ignore();
+ if (interceptor.Url.Equals(invalidUrl))
+ {
+ byte[] bData = Encoding.UTF8.GetBytes("<html><body><img src='test.jpg'></body></html>");
+ interceptor.SetResponseStatus(200, "OK");
+ interceptor.AddResponseHeader("Content-Type", "text/html; charset=UTF-8");
+ interceptor.AddResponseHeader("Content-Length", bData.Length.ToString());
+ interceptor.SetResponseBody(bData);
+ tlog.Debug(tag, $"http request intercepted set response body end");
+ }
+ else if (interceptor.Url.Equals($"{invalidUrl}test.jpg"))
+ {
+ string path = Tizen.Applications.Application.Current.DirectoryInfo.SharedResource + "soundcloud.png";
+ using (FileStream fs = File.OpenRead(path))
+ {
+ byte[] bData = new byte[1024];
+ while (fs.Read(bData, 0, bData.Length) > 0)
+ {
+ interceptor.WriteResponseChunk(bData);
+ }
+ interceptor.WriteResponseChunk((byte[])null);
+ tlog.Debug(tag, $"http request intercepted write chunk end");
+ }
+ }
+
+ if (interceptor.InterceptedWebView != null)
+ {
+ tlog.Debug(tag, $"http request intercepted web view is not null");
+ if(webView2 == interceptor.InterceptedWebView)
+ {
+ tlog.Debug(tag, $"InterceptedWebView is webView2!");
+ }
+ else if(webView1 == interceptor.InterceptedWebView)
+ {
+ tlog.Debug(tag, $"InterceptedWebView is webView1!");
+ }
+ else
+ {
+ tlog.Debug(tag, $"InterceptedWebView is not either webView1 or webView2");
+ }
+ }
+
+ tlog.Debug(tag, $"http request intercepted end");
+ tlog.Debug(tag, $"");
+ }
+
+ private void Callback2(WebHttpRequestInterceptor interceptor)
+ {
+ tlog.Debug(tag, $"callback2: http request intercepted start, Url: {interceptor.Url}");
+
+ //interceptor.Ignore();
+ if (interceptor.Url.Equals(invalidUrl))
+ {
+ byte[] bData = Encoding.UTF8.GetBytes("<html><body><img src='test.jpg'></body></html>");
+ interceptor.SetResponseStatus(200, "OK");
+ interceptor.AddResponseHeader("Content-Type", "text/html; charset=UTF-8");
+ interceptor.AddResponseHeader("Content-Length", bData.Length.ToString());
+ interceptor.SetResponseBody(bData);
+ tlog.Debug(tag, $"http request intercepted set response body end");
+ }
+ else if (interceptor.Url.Equals($"{invalidUrl}test.jpg"))
+ {
+ string path = Tizen.Applications.Application.Current.DirectoryInfo.SharedResource + "netflix.png";
+
+ if (interceptor.InterceptedWebView == webView2)
+ {
+ path = Tizen.Applications.Application.Current.DirectoryInfo.SharedResource + "hbo.png";
+ }
+
+ using (FileStream fs = File.OpenRead(path))
+ {
+ byte[] bData = new byte[1024];
+ while (fs.Read(bData, 0, bData.Length) > 0)
+ {
+ interceptor.WriteResponseChunk(bData);
+ }
+ interceptor.WriteResponseChunk((byte[])null);
+ tlog.Debug(tag, $"http request intercepted write chunk end");
+ }
+ }
+
+ if (interceptor.InterceptedWebView != null)
+ {
+ tlog.Debug(tag, $"http request intercepted web view is not null");
+ if (webView2 == interceptor.InterceptedWebView)
+ {
+ tlog.Debug(tag, $"InterceptedWebView is webView2!");
+ }
+ else if (webView1 == interceptor.InterceptedWebView)
+ {
+ tlog.Debug(tag, $"InterceptedWebView is webView1!");
+ }
+ else
+ {
+ tlog.Debug(tag, $"InterceptedWebView is not either webView1 or webView2");
+ }
+ }
+
+ tlog.Debug(tag, $"http request intercepted end");
+ tlog.Debug(tag, $"");
+ }
+
+ public void Deactivate()
+ {
+ btn3.Unparent();
+ btn2.Unparent();
+ btn1.Unparent();
+ webView2.Unparent();
+ webView1.Unparent();
+ root.Unparent();
+
+ btn3.Dispose();
+ btn2.Dispose();
+ btn1.Dispose();
+ webView2.Dispose();
+ webView1.Dispose();
+ root.Dispose();
+ }
+ }
+}
--- /dev/null
+{"v":"4.11.1","fr":29.9700012207031,"ip":0,"op":76.0000030955435,"w":70,"h":70,"nm":"Comp 1","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 2","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[35,35,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"n":["0p667_1_0p333_0","0p667_1_0p333_0","0p667_1_0p333_0"],"t":33,"s":[0,0,100],"e":[120,120,100]},{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"n":["0p667_1_0p333_0","0p667_1_0p333_0","0p667_1_0p333_0"],"t":46,"s":[120,120,100],"e":[100,100,100]},{"t":52.0000021180034}],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0]],"v":[[-7,1.438],[-2.656,5.781],[7.422,-4.297]],"c":false},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[1,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":3,"ix":5},"lc":2,"lj":2,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Shape 1","np":3,"cix":2,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"tm","s":{"a":0,"k":0,"ix":1},"e":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"n":["0p667_1_0p333_0"],"t":33,"s":[0],"e":[100]},{"t":52.0000021180034}],"ix":2},"o":{"a":0,"k":0,"ix":3},"m":1,"ix":2,"nm":"Trim Paths 1","mn":"ADBE Vector Filter - Trim","hd":false}],"ip":0,"op":450.000018328876,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[35,35,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"n":["0p667_1_0p333_0","0p667_1_0p333_0","0p667_1_0p333_0"],"t":18,"s":[0,0,100],"e":[120,120,100]},{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"n":["0p667_1_0p333_0","0p667_1_0p333_0","0p667_1_0p333_0"],"t":33,"s":[120,120,100],"e":[80,80,100]},{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"n":["0p667_1_0p333_0","0p667_1_0p333_0","0p667_1_0p333_0"],"t":41,"s":[80,80,100],"e":[110,110,100]},{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"n":["0p667_1_0p333_0","0p667_1_0p333_0","0p667_1_0p333_0"],"t":49,"s":[110,110,100],"e":[100,100,100]},{"t":52.0000021180034}],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[13.015,0],[0,-13.015],[-13.015,0],[0,13.015]],"o":[[-13.015,0],[0,13.015],[13.015,0],[0,-13.015]],"v":[[0,-23.566],[-23.566,0],[0,23.566],[23.566,0]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[0.898039215686,0.898039215686,0.898039215686,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":0,"ix":5},"lc":1,"lj":1,"ml":4,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"fl","c":{"a":0,"k":[0,0.760784313725,0.2,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[105.535,105.535],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":3,"cix":2,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":450.000018328876,"st":0,"bm":0}]}
\ No newline at end of file
}
}
+ if (interceptor.InterceptedWebView == simpleWebView)
+ {
+ Log.Info("WebView", $"------------http request intercepted web view is simpleWebVew-------");
+ }
+
Log.Info("WebView", $"------------http request intercepted end-------");
}