From: seungho Date: Wed, 4 Nov 2020 07:06:28 +0000 (+0900) Subject: [NUI] Refactoring FrameUpdateCallback X-Git-Tag: accepted/tizen/unified/20210219.040944~231 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6d17b0d2e383c46671c62ff29deaf5f34bb2d37a;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [NUI] Refactoring FrameUpdateCallback - Remove FrameCallback.cs and Interop.FrameCallback.cs - Rename FrameCallbackInterface to FrameUpdateCallbackInterface Signed-off-by: seungho --- diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.FrameCallback.cs b/src/Tizen.NUI/src/internal/Interop/Interop.FrameCallback.cs deleted file mode 100755 index 9e23a4b..0000000 --- a/src/Tizen.NUI/src/internal/Interop/Interop.FrameCallback.cs +++ /dev/null @@ -1,75 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace Tizen.NUI -{ - internal static partial class Interop - { - internal static partial class FrameCallback - { - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FrameUpdateCallback_New")] - public static extern global::System.IntPtr FrameUpdateCallback_New(); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FrameUpdateCallback_SWIGUpcast")] - public static extern global::System.IntPtr FrameUpdateCallback_SWIGUpcast(global::System.IntPtr jarg1); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FrameUpdateCallback_AddCallback")] - public static extern global::System.IntPtr FrameUpdateCallback_AddCallback(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FrameUpdateCallback_AddMainThreadCallback")] - public static extern global::System.IntPtr FrameUpdateCallback_AddMainThreadCallback(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FrameUpdateCallback_RemoveCallback")] - public static extern global::System.IntPtr FrameUpdateCallback_RemoveCallback(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FrameUpdateCallback_GetPosition")] - public static extern global::System.IntPtr FrameUpdateCallback_GetPosition(global::System.Runtime.InteropServices.HandleRef jarg1, uint jarg2); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FrameUpdateCallback_SetPosition")] - public static extern global::System.IntPtr FrameUpdateCallback_SetPosition(global::System.Runtime.InteropServices.HandleRef jarg1, uint jarg2, global::System.Runtime.InteropServices.HandleRef jarg3); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FrameUpdateCallback_BakePosition")] - public static extern global::System.IntPtr FrameUpdateCallback_BakePosition(global::System.Runtime.InteropServices.HandleRef jarg1, uint jarg2, global::System.Runtime.InteropServices.HandleRef jarg3); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FrameUpdateCallback_GetSize")] - public static extern global::System.IntPtr FrameUpdateCallback_GetSize(global::System.Runtime.InteropServices.HandleRef jarg1, uint jarg2); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FrameUpdateCallback_SetSize")] - public static extern global::System.IntPtr FrameUpdateCallback_SetSize(global::System.Runtime.InteropServices.HandleRef jarg1, uint jarg2, global::System.Runtime.InteropServices.HandleRef jarg3); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FrameUpdateCallback_BakeSize")] - public static extern global::System.IntPtr FrameUpdateCallback_BakeSize(global::System.Runtime.InteropServices.HandleRef jarg1, uint jarg2, global::System.Runtime.InteropServices.HandleRef jarg3); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FrameUpdateCallback_GetScale")] - public static extern global::System.IntPtr FrameUpdateCallback_GetScale(global::System.Runtime.InteropServices.HandleRef jarg1, uint jarg2); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FrameUpdateCallback_SetScale")] - public static extern global::System.IntPtr FrameUpdateCallback_SetScale(global::System.Runtime.InteropServices.HandleRef jarg1, uint jarg2, global::System.Runtime.InteropServices.HandleRef jarg3); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FrameUpdateCallback_BakeScale")] - public static extern global::System.IntPtr FrameUpdateCallback_BakeScale(global::System.Runtime.InteropServices.HandleRef jarg1, uint jarg2, global::System.Runtime.InteropServices.HandleRef jarg3); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FrameUpdateCallback_GetColor")] - public static extern global::System.IntPtr FrameUpdateCallback_GetColor(global::System.Runtime.InteropServices.HandleRef jarg1, uint jarg2); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FrameUpdateCallback_SetColor")] - public static extern global::System.IntPtr FrameUpdateCallback_SetColor(global::System.Runtime.InteropServices.HandleRef jarg1, uint jarg2, global::System.Runtime.InteropServices.HandleRef jarg3); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FrameUpdateCallback_BakeColor")] - public static extern global::System.IntPtr FrameUpdateCallback_BakeColor(global::System.Runtime.InteropServices.HandleRef jarg1, uint jarg2, global::System.Runtime.InteropServices.HandleRef jarg3); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FrameUpdateCallback_SetAlphaFunction")] - public static extern void FrameUpdateCallback_SetAlphaFunction(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FrameUpdateCallback_GetAlphaFunction")] - public static extern global::System.IntPtr FrameUpdateCallback_GetAlphaFunction(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FrameUpdateCallback_SetDuration")] - public static extern void FrameUpdateCallback_SetDuration(global::System.Runtime.InteropServices.HandleRef jarg1, float jarg2); - - [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FrameUpdateCallback_GetDuration")] - public static extern float FrameUpdateCallback_GetDuration(global::System.Runtime.InteropServices.HandleRef jarg1); - } - } -} \ No newline at end of file diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.FrameCallbackInterface.cs b/src/Tizen.NUI/src/internal/Interop/Interop.FrameUpdateCallbackInterface.cs old mode 100755 new mode 100644 similarity index 54% rename from src/Tizen.NUI/src/internal/Interop/Interop.FrameCallbackInterface.cs rename to src/Tizen.NUI/src/internal/Interop/Interop.FrameUpdateCallbackInterface.cs index 9f6a4e8..48eb7bb --- a/src/Tizen.NUI/src/internal/Interop/Interop.FrameCallbackInterface.cs +++ b/src/Tizen.NUI/src/internal/Interop/Interop.FrameUpdateCallbackInterface.cs @@ -6,58 +6,58 @@ namespace Tizen.NUI { internal static partial class Interop { - internal static partial class FrameCallbackInterface + internal static partial class FrameUpdateCallbackInterface { [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_FrameCallbackInterface")] - public static extern global::System.IntPtr new_FrameCallbackInterface(); + public static extern global::System.IntPtr newFrameUpdateCallbackInterface(); [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FrameCallbackInterface_director_connect")] - public static extern void FrameCallbackInterface_director_connect(global::System.Runtime.InteropServices.HandleRef jarg1, Tizen.NUI.FrameCallbackInterface.SwigDelegateFrameCallbackInterface delegate0); + public static extern void FrameUpdateCallbackInterfaceDirectorConnect(global::System.Runtime.InteropServices.HandleRef jarg1, Tizen.NUI.FrameUpdateCallbackInterface.DelegateFrameUpdateCallbackInterface delegate0); [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FrameCallbackInterface_GetPosition")] - public static extern bool FraemCallbackInterface_GetPosition(global::System.IntPtr proxy, uint id, global::System.Runtime.InteropServices.HandleRef vector); + public static extern bool FraemCallbackInterfaceGetPosition(global::System.IntPtr proxy, uint id, global::System.Runtime.InteropServices.HandleRef vector); [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FrameCallbackInterface_SetPosition")] - public static extern bool FraemCallbackInterface_SetPosition(global::System.IntPtr proxy, uint id, global::System.Runtime.InteropServices.HandleRef vector); + public static extern bool FraemCallbackInterfaceSetPosition(global::System.IntPtr proxy, uint id, global::System.Runtime.InteropServices.HandleRef vector); [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FrameCallbackInterface_BakePosition")] - public static extern bool FraemCallbackInterface_BakePosition(global::System.IntPtr proxy, uint id, global::System.Runtime.InteropServices.HandleRef vector); + public static extern bool FraemCallbackInterfaceBakePosition(global::System.IntPtr proxy, uint id, global::System.Runtime.InteropServices.HandleRef vector); [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FrameCallbackInterface_GetPositionAndSize")] - public static extern bool FraemCallbackInterface_GetPositionAndSize(global::System.IntPtr proxy, uint id, global::System.Runtime.InteropServices.HandleRef vector, global::System.Runtime.InteropServices.HandleRef vector2); + public static extern bool FraemCallbackInterfaceGetPositionAndSize(global::System.IntPtr proxy, uint id, global::System.Runtime.InteropServices.HandleRef vector, global::System.Runtime.InteropServices.HandleRef vector2); [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FrameCallbackInterface_GetSize")] - public static extern bool FraemCallbackInterface_GetSize(global::System.IntPtr proxy, uint id, global::System.Runtime.InteropServices.HandleRef vector); + public static extern bool FraemCallbackInterfaceGetSize(global::System.IntPtr proxy, uint id, global::System.Runtime.InteropServices.HandleRef vector); [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FrameCallbackInterface_SetSize")] - public static extern bool FraemCallbackInterface_SetSize(global::System.IntPtr proxy, uint id, global::System.Runtime.InteropServices.HandleRef vector); + public static extern bool FraemCallbackInterfaceSetSize(global::System.IntPtr proxy, uint id, global::System.Runtime.InteropServices.HandleRef vector); [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FrameCallbackInterface_BakeSize")] - public static extern bool FraemCallbackInterface_BakeSize(global::System.IntPtr proxy, uint id, global::System.Runtime.InteropServices.HandleRef vector); + public static extern bool FraemCallbackInterfaceBakeSize(global::System.IntPtr proxy, uint id, global::System.Runtime.InteropServices.HandleRef vector); [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FrameCallbackInterface_GetScale")] - public static extern bool FraemCallbackInterface_GetScale(global::System.IntPtr proxy, uint id, global::System.Runtime.InteropServices.HandleRef vector); + public static extern bool FraemCallbackInterfaceGetScale(global::System.IntPtr proxy, uint id, global::System.Runtime.InteropServices.HandleRef vector); [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FrameCallbackInterface_SetScale")] - public static extern bool FraemCallbackInterface_SetScale(global::System.IntPtr proxy, uint id, global::System.Runtime.InteropServices.HandleRef vector); + public static extern bool FraemCallbackInterfaceSetScale(global::System.IntPtr proxy, uint id, global::System.Runtime.InteropServices.HandleRef vector); [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FrameCallbackInterface_BakeScale")] - public static extern bool FraemCallbackInterface_BakeScale(global::System.IntPtr proxy, uint id, global::System.Runtime.InteropServices.HandleRef vector); + public static extern bool FraemCallbackInterfaceBakeScale(global::System.IntPtr proxy, uint id, global::System.Runtime.InteropServices.HandleRef vector); [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FrameCallbackInterface_GetColor")] - public static extern bool FraemCallbackInterface_GetColor(global::System.IntPtr proxy, uint id, global::System.Runtime.InteropServices.HandleRef vector); + public static extern bool FraemCallbackInterfaceGetColor(global::System.IntPtr proxy, uint id, global::System.Runtime.InteropServices.HandleRef vector); [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FrameCallbackInterface_SetColor")] - public static extern bool FraemCallbackInterface_SetColor(global::System.IntPtr proxy, uint id, global::System.Runtime.InteropServices.HandleRef vector); + public static extern bool FraemCallbackInterfaceSetColor(global::System.IntPtr proxy, uint id, global::System.Runtime.InteropServices.HandleRef vector); [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FrameCallbackInterface_BakeColor")] - public static extern bool FraemCallbackInterface_BakeColor(global::System.IntPtr proxy, uint id, global::System.Runtime.InteropServices.HandleRef vector); + public static extern bool FraemCallbackInterfaceBakeColor(global::System.IntPtr proxy, uint id, global::System.Runtime.InteropServices.HandleRef vector); [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FrameCallbackInterface_AddFrameCallback")] - public static extern void FraemCallbackInterface_AddFrameCallback(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, global::System.Runtime.InteropServices.HandleRef jarg3); + public static extern void FraemCallbackInterfaceAddFrameUpdateCallback(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, global::System.Runtime.InteropServices.HandleRef jarg3); [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FrameCallbackInterface_RemoveFrameCallback")] - public static extern void FraemCallbackInterface_RemoveFrameCallback(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); + public static extern void FraemCallbackInterfaceRemoveFrameUpdateCallback(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); } } } diff --git a/src/Tizen.NUI/src/public/FrameCallback.cs b/src/Tizen.NUI/src/public/FrameCallback.cs deleted file mode 100755 index 0afef49..0000000 --- a/src/Tizen.NUI/src/public/FrameCallback.cs +++ /dev/null @@ -1,179 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Runtime.InteropServices; -using System.Text; -using System.ComponentModel; - -namespace Tizen.NUI -{ - - /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public class FrameCallback : BaseHandle - { - /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public FrameCallback() : this(Interop.FrameCallback.FrameUpdateCallback_New(), true) - { - - } - - - internal FrameCallback(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.FrameCallback.FrameUpdateCallback_SWIGUpcast(cPtr), cMemoryOwn) - { - } - - /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - public delegate void FrameUpdateCallback(float progress); - - /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public void AddCallback(FrameUpdateCallback callback) - { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(callback); - { - Interop.FrameCallback.FrameUpdateCallback_AddCallback(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - } - - /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public void AddMainThreadCallback(FrameUpdateCallback callback) - { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(callback); - { - Interop.FrameCallback.FrameUpdateCallback_AddMainThreadCallback(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - } - - /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public void RemoveCallback() - { - Interop.FrameCallback.FrameUpdateCallback_RemoveCallback(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public Vector3 GetPosition(uint actorID) - { - Vector3 ret = new Vector3(Interop.FrameCallback.FrameUpdateCallback_GetPosition(swigCPtr, actorID), false); - return ret; - } - - /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public void SetPosition(uint actorID, Vector3 position) - { - Interop.FrameCallback.FrameUpdateCallback_SetPosition(swigCPtr, actorID, Vector3.getCPtr(position)); - } - - /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public void BakePosition(uint actorID, Vector3 position) - { - Interop.FrameCallback.FrameUpdateCallback_BakePosition(swigCPtr, actorID, Vector3.getCPtr(position)); - } - - /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public Vector3 GetSize(uint actorID) - { - Vector3 ret = new Vector3(Interop.FrameCallback.FrameUpdateCallback_GetSize(swigCPtr, actorID), false); - return ret; - } - - /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public void SetSize(uint actorID, Vector3 size) - { - Interop.FrameCallback.FrameUpdateCallback_SetSize(swigCPtr, actorID, Vector3.getCPtr(size)); - } - - /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public void BakeSize(uint actorID, Vector3 size) - { - Interop.FrameCallback.FrameUpdateCallback_BakeSize(swigCPtr, actorID, Vector3.getCPtr(size)); - } - - /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public Vector3 GetScale(uint actorID) - { - Vector3 ret = new Vector3(Interop.FrameCallback.FrameUpdateCallback_GetScale(swigCPtr, actorID), false); - return ret; - } - - /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public void SetScale(uint actorID, Vector3 scale) - { - Interop.FrameCallback.FrameUpdateCallback_SetScale(swigCPtr, actorID, Vector3.getCPtr(scale)); - } - - /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public void BakeScale(uint actorID, Vector3 scale) - { - Interop.FrameCallback.FrameUpdateCallback_BakeScale(swigCPtr, actorID, Vector3.getCPtr(scale)); - } - - /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public Vector4 GetColor(uint actorID) - { - Vector4 ret = new Vector4(Interop.FrameCallback.FrameUpdateCallback_GetColor(swigCPtr, actorID), false); - return ret; - } - - /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public void SetColor(uint actorID, Vector4 color) - { - Interop.FrameCallback.FrameUpdateCallback_SetColor(swigCPtr, actorID, Vector4.getCPtr(color)); - } - - /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public void BakeColor(uint actorID, Vector4 color) - { - Interop.FrameCallback.FrameUpdateCallback_BakeColor(swigCPtr, actorID, Vector4.getCPtr(color)); - } - - /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public void SetAlphaFunction(AlphaFunction alphaFunction) - { - Interop.FrameCallback.FrameUpdateCallback_SetAlphaFunction(swigCPtr, AlphaFunction.getCPtr(alphaFunction)); - } - - /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public AlphaFunction GetAlphaFunction() - { - AlphaFunction alphaFunction = new AlphaFunction(Interop.FrameCallback.FrameUpdateCallback_GetAlphaFunction(swigCPtr), false); - return alphaFunction; - } - - /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public void SetDuration(float seconds) - { - Interop.FrameCallback.FrameUpdateCallback_SetDuration(swigCPtr, seconds); - } - - /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public float GetDuration() - { - return Interop.FrameCallback.FrameUpdateCallback_GetDuration(swigCPtr); - } - - } -} diff --git a/src/Tizen.NUI/src/public/FrameCallbackInterface.cs b/src/Tizen.NUI/src/public/FrameUpdateCallbackInterface.cs old mode 100755 new mode 100644 similarity index 72% rename from src/Tizen.NUI/src/public/FrameCallbackInterface.cs rename to src/Tizen.NUI/src/public/FrameUpdateCallbackInterface.cs index 20897ed..1f3d177 --- a/src/Tizen.NUI/src/public/FrameCallbackInterface.cs +++ b/src/Tizen.NUI/src/public/FrameUpdateCallbackInterface.cs @@ -26,43 +26,43 @@ namespace Tizen.NUI /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public class FrameCallbackInterface : Disposable + public class FrameUpdateCallbackInterface : Disposable { /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - internal FrameCallbackInterface(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn) + internal FrameUpdateCallbackInterface(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn) { } /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public FrameCallbackInterface() : this(Interop.FrameCallbackInterface.new_FrameCallbackInterface(), true) + public FrameUpdateCallbackInterface() : this(Interop.FrameUpdateCallbackInterface.newFrameUpdateCallbackInterface(), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - SwigDirectorConnect(); + DirectorConnect(); } - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(FrameCallbackInterface obj) + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(FrameUpdateCallbackInterface obj) { return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; } - private void SwigDirectorConnect() + private void DirectorConnect() { - swigDelegate0 = new SwigDelegateFrameCallbackInterface(SwigDirectorOnUpdate); - Interop.FrameCallbackInterface.FrameCallbackInterface_director_connect(swigCPtr, swigDelegate0); + Delegate0 = new DelegateFrameUpdateCallbackInterface(DirectorOnUpdate); + Interop.FrameUpdateCallbackInterface.FrameUpdateCallbackInterfaceDirectorConnect(swigCPtr, Delegate0); } private global::System.IntPtr proxyIntPtr; - private void SwigDirectorOnUpdate(global::System.IntPtr proxy, float elapsedSeconds) + private void DirectorOnUpdate(global::System.IntPtr proxy, float elapsedSeconds) { proxyIntPtr = proxy; OnUpdate(elapsedSeconds); return; } - internal delegate void SwigDelegateFrameCallbackInterface(global::System.IntPtr proxy, float elapsedSeconds); - private SwigDelegateFrameCallbackInterface swigDelegate0; + internal delegate void DelegateFrameUpdateCallbackInterface(global::System.IntPtr proxy, float elapsedSeconds); + private DelegateFrameUpdateCallbackInterface Delegate0; /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. @@ -80,7 +80,7 @@ namespace Tizen.NUI { return false; } - bool ret = Interop.FrameCallbackInterface.FraemCallbackInterface_GetPosition(proxyIntPtr, id, Vector3.getCPtr(position)); + bool ret = Interop.FrameUpdateCallbackInterface.FraemCallbackInterfaceGetPosition(proxyIntPtr, id, Vector3.getCPtr(position)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } @@ -94,7 +94,7 @@ namespace Tizen.NUI { return false; } - bool ret = Interop.FrameCallbackInterface.FraemCallbackInterface_SetPosition(proxyIntPtr, id, Vector3.getCPtr(position)); + bool ret = Interop.FrameUpdateCallbackInterface.FraemCallbackInterfaceSetPosition(proxyIntPtr, id, Vector3.getCPtr(position)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } @@ -108,7 +108,7 @@ namespace Tizen.NUI { return false; } - bool ret = Interop.FrameCallbackInterface.FraemCallbackInterface_BakePosition(proxyIntPtr, id, Vector3.getCPtr(position)); + bool ret = Interop.FrameUpdateCallbackInterface.FraemCallbackInterfaceBakePosition(proxyIntPtr, id, Vector3.getCPtr(position)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } @@ -122,7 +122,7 @@ namespace Tizen.NUI { return false; } - bool ret = Interop.FrameCallbackInterface.FraemCallbackInterface_GetSize(proxyIntPtr, id, Vector3.getCPtr(size)); + bool ret = Interop.FrameUpdateCallbackInterface.FraemCallbackInterfaceGetSize(proxyIntPtr, id, Vector3.getCPtr(size)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } @@ -136,7 +136,7 @@ namespace Tizen.NUI { return false; } - bool ret = Interop.FrameCallbackInterface.FraemCallbackInterface_SetSize(proxyIntPtr, id, Vector3.getCPtr(size)); + bool ret = Interop.FrameUpdateCallbackInterface.FraemCallbackInterfaceSetSize(proxyIntPtr, id, Vector3.getCPtr(size)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } @@ -149,7 +149,7 @@ namespace Tizen.NUI { return false; } - bool ret = Interop.FrameCallbackInterface.FraemCallbackInterface_BakeSize(proxyIntPtr, id, Vector3.getCPtr(size)); + bool ret = Interop.FrameUpdateCallbackInterface.FraemCallbackInterfaceBakeSize(proxyIntPtr, id, Vector3.getCPtr(size)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } @@ -163,7 +163,7 @@ namespace Tizen.NUI { return false; } - bool ret = Interop.FrameCallbackInterface.FraemCallbackInterface_SetScale(proxyIntPtr, id, Vector3.getCPtr(scale)); + bool ret = Interop.FrameUpdateCallbackInterface.FraemCallbackInterfaceSetScale(proxyIntPtr, id, Vector3.getCPtr(scale)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } @@ -177,7 +177,7 @@ namespace Tizen.NUI { return false; } - bool ret = Interop.FrameCallbackInterface.FraemCallbackInterface_SetScale(proxyIntPtr, id, Vector3.getCPtr(scale)); + bool ret = Interop.FrameUpdateCallbackInterface.FraemCallbackInterfaceSetScale(proxyIntPtr, id, Vector3.getCPtr(scale)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } @@ -191,7 +191,7 @@ namespace Tizen.NUI { return false; } - bool ret = Interop.FrameCallbackInterface.FraemCallbackInterface_BakeScale(proxyIntPtr, id, Vector3.getCPtr(scale)); + bool ret = Interop.FrameUpdateCallbackInterface.FraemCallbackInterfaceBakeScale(proxyIntPtr, id, Vector3.getCPtr(scale)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } @@ -204,7 +204,7 @@ namespace Tizen.NUI { return false; } - bool ret = Interop.FrameCallbackInterface.FraemCallbackInterface_BakeScale(proxyIntPtr, id, Vector4.getCPtr(color)); + bool ret = Interop.FrameUpdateCallbackInterface.FraemCallbackInterfaceBakeScale(proxyIntPtr, id, Vector4.getCPtr(color)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } @@ -217,7 +217,7 @@ namespace Tizen.NUI { return false; } - bool ret = Interop.FrameCallbackInterface.FraemCallbackInterface_BakeScale(proxyIntPtr, id, Vector4.getCPtr(color)); + bool ret = Interop.FrameUpdateCallbackInterface.FraemCallbackInterfaceBakeScale(proxyIntPtr, id, Vector4.getCPtr(color)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } @@ -230,7 +230,7 @@ namespace Tizen.NUI { return false; } - bool ret = Interop.FrameCallbackInterface.FraemCallbackInterface_BakeScale(proxyIntPtr, id, Vector4.getCPtr(color)); + bool ret = Interop.FrameUpdateCallbackInterface.FraemCallbackInterfaceBakeScale(proxyIntPtr, id, Vector4.getCPtr(color)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } @@ -244,19 +244,19 @@ namespace Tizen.NUI { return false; } - bool ret = Interop.FrameCallbackInterface.FraemCallbackInterface_GetPositionAndSize(proxyIntPtr, id, Vector3.getCPtr(Position), Vector3.getCPtr(Size)); + bool ret = Interop.FrameUpdateCallbackInterface.FraemCallbackInterfaceGetPositionAndSize(proxyIntPtr, id, Vector3.getCPtr(Position), Vector3.getCPtr(Size)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } - internal void AddFrameCallback(global::System.Runtime.InteropServices.HandleRef windowCPtr, global::System.Runtime.InteropServices.HandleRef layerCPtr) + internal void AddFrameUpdateCallback(global::System.Runtime.InteropServices.HandleRef windowCPtr, global::System.Runtime.InteropServices.HandleRef layerCPtr) { - Interop.FrameCallbackInterface.FraemCallbackInterface_AddFrameCallback(windowCPtr, swigCPtr, layerCPtr); + Interop.FrameUpdateCallbackInterface.FraemCallbackInterfaceAddFrameUpdateCallback(windowCPtr, swigCPtr, layerCPtr); } - internal void RemoveFrameCallback(global::System.Runtime.InteropServices.HandleRef windowCPtr) + internal void RemoveFrameUpdateCallback(global::System.Runtime.InteropServices.HandleRef windowCPtr) { - Interop.FrameCallbackInterface.FraemCallbackInterface_RemoveFrameCallback(windowCPtr, swigCPtr); + Interop.FrameUpdateCallbackInterface.FraemCallbackInterfaceRemoveFrameUpdateCallback(windowCPtr, swigCPtr); } } } diff --git a/src/Tizen.NUI/src/public/Window.cs b/src/Tizen.NUI/src/public/Window.cs index 69769b1..b14c327 100755 --- a/src/Tizen.NUI/src/public/Window.cs +++ b/src/Tizen.NUI/src/public/Window.cs @@ -1302,21 +1302,21 @@ namespace Tizen.NUI } /// - /// Add FrameCallback + /// Add FrameUpdateCallback /// [EditorBrowsable(EditorBrowsableState.Never)] - public void AddFrameCallback(FrameCallbackInterface frameCallback) + public void AddFrameUpdateCallback(FrameUpdateCallbackInterface frameUpdateCallback) { - frameCallback?.AddFrameCallback(stageCPtr, Layer.getCPtr(GetRootLayer())); + frameUpdateCallback?.AddFrameUpdateCallback(stageCPtr, Layer.getCPtr(GetRootLayer())); } /// - /// Remove FrameCallback + /// Remove FrameUpdateCallback /// [EditorBrowsable(EditorBrowsableState.Never)] - public void RemoveFrameCallback(FrameCallbackInterface frameCallback) + public void RemoveFrameUpdateCallback(FrameUpdateCallbackInterface frameUpdateCallback) { - frameCallback?.RemoveFrameCallback(stageCPtr); + frameUpdateCallback?.RemoveFrameUpdateCallback(stageCPtr); } /// diff --git a/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/FrameCallbackTest.cs b/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/FrameCallbackTest.cs deleted file mode 100644 index e113d26..0000000 --- a/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/FrameCallbackTest.cs +++ /dev/null @@ -1,757 +0,0 @@ -using System; -using System.Threading.Tasks; -using Tizen.NUI; -using Tizen.NUI.BaseComponents; -using System.Collections.Generic; -using System.Linq; - -namespace Tizen.NUI.Samples -{ - enum TOUCH_ANIMATION_STATE - { - NO_ANIMATION = 0, - ON_ANIMATION, - ON_FINISH_ANIMATION, - END_ANIMATION = NO_ANIMATION - }; - - public class FrameCallbackTest : IExample - { - - private static string resourcePath = Tizen.Applications.Application.Current.DirectoryInfo.Resource; - private static string[] BACKGROUND_IMAGE_PATH = { - resourcePath + "/images/FrameCallbackTest/launcher_bg_02_nor.png", - resourcePath + "/images/FrameCallbackTest/launcher_bg_03_nor.png", - resourcePath + "/images/FrameCallbackTest/launcher_bg_04_nor.png", - resourcePath + "/images/FrameCallbackTest/launcher_bg_05_nor.png", - resourcePath + "/images/FrameCallbackTest/launcher_bg_06_nor.png", - resourcePath + "/images/FrameCallbackTest/launcher_bg_apps_nor.png" - }; - - private static string[] APPS_IMAGE_PATH = { - resourcePath + "/images/FrameCallbackTest/launcher_ic_culinary_nor.png", - resourcePath + "/images/FrameCallbackTest/launcher_ic_family_nor.png", - resourcePath + "/images/FrameCallbackTest/launcher_ic_ent_nor.png", - resourcePath + "/images/FrameCallbackTest/launcher_ic_homecare_nor.png" - }; - - private static string[] APPS_ICON_NAME = { - "Culinary", - "Family", - "Entertainment", - "Homecare" - }; - - private static string[] CONTROL_IMAGE_PATH = { - resourcePath + "/images/FrameCallbackTest/launcher_ic_apps_nor.png", - resourcePath + "/images/FrameCallbackTest/launcher_ic_settings_nor.png", - resourcePath + "/images/FrameCallbackTest/launcher_ic_viewinside_nor.png", - resourcePath + "/images/FrameCallbackTest/launcher_ic_timer_nor.png", - resourcePath + "/images/FrameCallbackTest/launcher_ic_internet_nor.png" - }; - - private static string[] CONTROL_ICON_NAME = { - "Apps", - "Settings", - "ViewInside", - "Timer", - "Internet" - }; - - private const int FRAME_RATE = 60; - private const int OBJECT_DELAY = 30; - private const int OBJECT_SIZE = 150; - private const int INITIAL_POSITION = 46; - private const int DEFAULT_SPACE = 9; - private const int DEVIDE_BAR_SIZE = 4; - - private TextLabel text; - public class FrameCallback : FrameCallbackInterface - { - private int mTimeInterval; - - private uint mContainerId; - private List mViewId; ///< Container of Actor IDs. - private List mViewPosition; - - // Movement is position difference of Container from start position of this animation to current position. - // Time interval between each mMovement entry is 16 milliseconds(about 60 fps) - // For example. - // mMovement[i] + mContainerStartPosition is the position of container after i*16 milliseconds from this animation started. - private List mMovement; - - // mLatestMovement is actually current movement of container. - private float mLatestMovement; - - // An icon of mTouchedViewIndex moves with container at the same time. - // Each icon of (mTouchedViewIndex -/+ i) moves as following container after i*OBJECT_DELAY milliseconds. - private int mTouchedViewIndex; - - // If every icon between mLeftIndext and mRightIndex is stopped, this frame callback can be reset. - // Then mIsResetTouchedViewPossible becomes true. - private bool mIsResetTouchedViewPossible; - private int mLeftIndex; - private int mRightIndex; - - // Total animation time from start to current. - private float mTotalAnimationTime; - // Total animation time from start to the time that last movement is added. - private float mPreviousTotalAnimationTime; - - // Start position of container in this animation. - private float mContainerStartPosition; - // Position of container at the time that last movement is added. - private float mPreviousContainerPosition; - - // This animation only need to save movement about (the number of view * OBJECT_DELAY) milliseconds. - // and this size is updated when new view is added. - // and, If the list of mMovement size become larger than this size, remove unnecessary entries. - private int mRequiredMovementSize; - private bool mNeedUpdateMovementSize; - - // current velocity. - private float mVelocity; - // dirty flag. - private bool mDirty; - - public FrameCallback() - { - mViewId = new List(); - mMovement = new List(); - mRequiredMovementSize = 0; - mNeedUpdateMovementSize = false; - mIsResetTouchedViewPossible = false; - } - - public void ResetAnimationData() - { - SetLatestMovement(0.0f); - mMovement.Clear(); - mTotalAnimationTime = 0.0f; - mPreviousTotalAnimationTime = 0.0f; - mDirty = true; - } - - public void SetTimeInterval(int timeInterval) - { - mNeedUpdateMovementSize = true; - mTimeInterval = timeInterval; - } - - public void AddId(uint id) - { - mViewId.Add(id); - mNeedUpdateMovementSize = true; - } - - public void SetContainerId(uint id) - { - mContainerId = id; - } - - public void SetContainerStartPosition(float position) - { - mContainerStartPosition = position; - } - - public void SetLatestMovement(float movement) - { - mLatestMovement = movement; - } - - public void ResetViewPosition() - { - mViewPosition = Enumerable.Repeat(0.0f, mViewId.Count).ToList(); - } - - public void SetViewPosition(int index, float position) - { - mViewPosition[index] = position; - } - - public void SetTouchedViewIndex(int controlIndex) - { - mTouchedViewIndex = controlIndex; - } - - public void AddMovement(float movement) - { - mMovement.Add(movement); - } - - public void SetLeftIndex(int leftIndex) - { - mLeftIndex = leftIndex; - } - - public void SetRightIndex(int rightIndex) - { - mRightIndex = rightIndex; - } - - public bool IsResetTouchedViewPossible() - { - return mIsResetTouchedViewPossible; - } - public void Dirty() - { - mDirty = true; - } - - public bool IsDirty() - { - return mDirty; - } - - public float GetVelocity() - { - return mVelocity; - } - - private void ComputeNewPositions(int totalTime) - { - // save latestMovement to avoid interference between thread. - float latestMovement = mLatestMovement; - bool isResetTouchedViewPossible = true; - for (int i = 0; i < mViewId.Count; ++i) - { - if (i == mTouchedViewIndex) - { - continue; - } - - // compute delay of view of i. - int totalDelay = Math.Abs(i - mTouchedViewIndex) * OBJECT_DELAY; - if (totalDelay > totalTime) - { - continue; - } - - int actorTime = totalTime - totalDelay; - int movementIndex = actorTime / mTimeInterval; - float factor = (float)(actorTime - (movementIndex * mTimeInterval)) / (float)mTimeInterval; - float movement; - if (movementIndex >= mMovement.Count - 1) - { - // 1. delay is zero(every view moves with container at the same time) - // 2. after every icons are stopped and the finger is stopped to move, the movement is still not added more. - // than the view has latestMovement. - movement = latestMovement; - } - else if (movementIndex < 0) - { - // If this animation is just staarted and the view need to wait more. - // movement is 0. - movement = 0.0f; - } - else - { - // Get the movement of ith view by interpolating mMovement - movement = factor * mMovement[movementIndex + 1] + (1.0f - factor) * mMovement[movementIndex]; - } - - // Prevent to overlap of each views. - float currentSpace = Math.Abs((mViewPosition[i] + movement) - (mViewPosition[mTouchedViewIndex] + latestMovement)); - float minimumSpace = (float)Math.Abs(mViewPosition[i] - mViewPosition[mTouchedViewIndex]); - if (currentSpace < minimumSpace) - { - movement = latestMovement; - } - - // check views in screen are still moving or stopped. - float newPosition = mViewPosition[i] + movement - latestMovement; - if (i >= mLeftIndex && i <= mRightIndex) - { - Vector3 previousPosition = new Vector3(); - GetPosition(mViewId[i], previousPosition); - if (Math.Abs(previousPosition.X - newPosition) >= 1.0f) - { - isResetTouchedViewPossible = false; - } - } - // update new position. - SetPosition(mViewId[i], new Vector3(newPosition, 0.0f, 0.0f)); - } - mIsResetTouchedViewPossible = isResetTouchedViewPossible; - } - - public override void OnUpdate(float elapsedSeconds) - { - // second -> millisecond - mTotalAnimationTime += elapsedSeconds * 1000.0f; - - Vector3 currentPosition = new Vector3(); - GetPosition(mContainerId, currentPosition); - - // Add new Movement, if there is change in position. - // 1. if dirty(there is reserved event) - // 2. if container position is changed. - // 3. if every icons in screen is stopped - if (mDirty || currentPosition.X != mPreviousContainerPosition || mIsResetTouchedViewPossible) - { - mDirty = false; - if (mTotalAnimationTime >= mMovement.Count * mTimeInterval) - { - // If the passed time is larger than mTimeInterval, add new movements. - // If we need to add more than one, compute each movement by using interpolation. - while (mMovement.Count <= mTotalAnimationTime / mTimeInterval) - { - float factor = ((float)(mMovement.Count * mTimeInterval) - mPreviousTotalAnimationTime) / (mTotalAnimationTime - mPreviousTotalAnimationTime); - float movement = (float)(factor * currentPosition.X + (1.0f - factor) * mPreviousContainerPosition) - mContainerStartPosition; - AddMovement(movement); - } - // Compute velocity. - // We need to compute velocity here to get reasonable value. - mVelocity = (currentPosition.X - mPreviousContainerPosition) / (mTotalAnimationTime - mPreviousTotalAnimationTime); - mPreviousTotalAnimationTime = mTotalAnimationTime; - mPreviousContainerPosition = currentPosition.X; - } - } - float currentMovement = currentPosition.X - mContainerStartPosition; - SetLatestMovement(currentMovement); - - // Compute positions of each icon - ComputeNewPositions((int)mTotalAnimationTime); - - // compute mRequiredMovementSize - if (mRequiredMovementSize == 0 || mNeedUpdateMovementSize) - { - mNeedUpdateMovementSize = false; - mRequiredMovementSize = mViewId.Count * OBJECT_DELAY / mTimeInterval; - } - - // Remove unnecessary movement for memory optimization. - if (mMovement.Count > mRequiredMovementSize * 2) - { - int movementNumberToRemove = mMovement.Count - mRequiredMovementSize; - mMovement.RemoveRange(0, movementNumberToRemove); - mTotalAnimationTime -= (float)(mTimeInterval * movementNumberToRemove); - } - } - } - - private Window mWindow; - - private FrameCallback mFrameCallback; ///< An instance of our implementation of the FrameCallbackInterface. - - // Views for launcher - private View mBaseView; - private View mControlView; - private View mLayoutView; - - // Variables for animation - private float mPreviousTouchedPosition; - private int mTouchedViewIndex; - private TOUCH_ANIMATION_STATE mAnimationState; - - private float mLeftDirectionLimit; - private float mRightDirectionLimit; - - - // Variables for Finish animation - // These variables are for deceleration curve. - // If we want to use another curve like bezier, uses different variables - private delegate float UserAlphaFunctionDelegate(float progress); - private UserAlphaFunctionDelegate customScrollAlphaFunction; - private float mAbsoluteVelocity = 0.0f; - private float mFinishAnimationDuration = 0.0f; - private float mFinishAnimationDelta = 0.0f; - private float mLogDeceleration = 0.0f; - private float mDecelerationRate = 0.99f; - private float mEasingThreshold = 0.1f; - - private Animation mFinishAnimation; - private Timer mAnimationOffTimer; // timer to end animation after the easing animation is finished - - // Vies of contents - private View mContentsView; - - public void Activate() - { - mFrameCallback = new FrameCallback(); - Initialize(); - } - - public void Deactivate() - { - } - - void Initialize() - { - // Set the stage background color and connect to the stage's key signal to allow Back and Escape to exit. - mWindow = Window.Instance; - mWindow.BackgroundColor = Color.White; - - mRightDirectionLimit = INITIAL_POSITION; - - // Contents - - mContentsView = new View(); - mContentsView.BackgroundColor = new Color(0.921568f, 0.9098039f, 0.890196f, 0.5f); - mContentsView.ParentOrigin = ParentOrigin.TopLeft; - mContentsView.PivotPoint = PivotPoint.TopLeft; - mContentsView.PositionUsesPivotPoint = true; - mContentsView.WidthResizePolicy = ResizePolicyType.FillToParent; - mContentsView.HeightResizePolicy = ResizePolicyType.FillToParent; - mWindow.GetDefaultLayer().Add(mContentsView); - - // Launcher - mBaseView = new View(); - mBaseView.ParentOrigin = ParentOrigin.BottomLeft; - mBaseView.PivotPoint = PivotPoint.BottomLeft; - mBaseView.PositionUsesPivotPoint = true; - mBaseView.Size = new Size(mWindow.Size.Width, 278); - mBaseView.Position = new Position(0, 0); - mWindow.GetDefaultLayer().Add(mBaseView); - - View iconBackgroundView = new View(); - iconBackgroundView.BackgroundColor = new Color(0.921568f, 0.9098039f, 0.890196f, 0.5f); - iconBackgroundView.ParentOrigin = ParentOrigin.BottomLeft; - iconBackgroundView.PivotPoint = PivotPoint.BottomLeft; - iconBackgroundView.PositionUsesPivotPoint = true; - iconBackgroundView.Size = new Size(mWindow.Size.Width, 278); - iconBackgroundView.Position = new Position(0, 0); - mBaseView.Add(iconBackgroundView); - - mControlView = new View(); - mControlView.ParentOrigin = ParentOrigin.CenterLeft; - mControlView.PivotPoint = PivotPoint.CenterLeft; - mControlView.PositionUsesPivotPoint = true; - mControlView.Position = new Position(mRightDirectionLimit, 0); - mBaseView.Add(mControlView); - mFrameCallback.SetContainerId(mControlView.ID); - - mLayoutView = new View(); - mLayoutView.ParentOrigin = ParentOrigin.CenterLeft; - mLayoutView.PivotPoint = PivotPoint.CenterLeft; - mLayoutView.PositionUsesPivotPoint = true; - mLayoutView.Layout = new LinearLayout() - { - LinearOrientation = LinearLayout.Orientation.Horizontal, - CellPadding = new Size2D(DEFAULT_SPACE, 0), - }; - mLayoutView.Position = new Position(0, 0); - mControlView.Add(mLayoutView); - - for (int i = 0; i < 4; ++i) - { - AddIcon(BACKGROUND_IMAGE_PATH[i], APPS_IMAGE_PATH[i], APPS_ICON_NAME[i], Color.White); - } - - View divideBar = new View(); - divideBar.BackgroundColor = new Color(0.0f, 0.0f, 0.0f, 0.1f); - divideBar.ParentOrigin = ParentOrigin.CenterLeft; - divideBar.PivotPoint = PivotPoint.CenterLeft; - divideBar.PositionUsesPivotPoint = true; - divideBar.Size = new Size(DEVIDE_BAR_SIZE, OBJECT_SIZE); - mLayoutView.Add(divideBar); - mFrameCallback.AddId(divideBar.ID); - - int iconNumber = 8; - for (int i = 0; i < iconNumber; ++i) - { - AddIcon(BACKGROUND_IMAGE_PATH[5], CONTROL_IMAGE_PATH[i % 5], CONTROL_ICON_NAME[i % 5], new Color(0.0f, 0.0f, 0.0f, 0.5f)); - } - - mFrameCallback.ResetViewPosition(); - mFrameCallback.SetTimeInterval(1000 / FRAME_RATE); - - mAnimationState = TOUCH_ANIMATION_STATE.NO_ANIMATION; - - mAnimationOffTimer = new Timer(16); - mAnimationOffTimer.Tick += OffAnimatable; - - mBaseView.TouchEvent += OnTouch; - - mFinishAnimation = new Animation(); - mFinishAnimation.Finished += EasingAnimationFinishedCallback; - mLogDeceleration = (float)Math.Log(mDecelerationRate); - } - - // Add icons - - void AddIcon(string background, string icon, string text, Color textColor) - { - ImageView backgroundView = new ImageView(); - backgroundView.ResourceUrl = background; - backgroundView.Size = new Size(OBJECT_SIZE, OBJECT_SIZE); - backgroundView.ParentOrigin = ParentOrigin.CenterLeft; - backgroundView.PivotPoint = PivotPoint.CenterLeft; - backgroundView.PositionUsesPivotPoint = true; - mLayoutView.Add(backgroundView); - mFrameCallback.AddId(backgroundView.ID); - - ImageView iconView = new ImageView(); - iconView.ResourceUrl = icon; - iconView.Position = new Position(0, -15); - iconView.ParentOrigin = ParentOrigin.Center; - iconView.PivotPoint = PivotPoint.Center; - iconView.PositionUsesPivotPoint = true; - backgroundView.Add(iconView); - - TextLabel label = new TextLabel(text); - label.Position = new Position(0, 30); - label.HorizontalAlignment = HorizontalAlignment.Center; - label.TextColor = textColor; - label.FontFamily = "SamsungOneUI"; - label.PointSize = 12; - label.ParentOrigin = ParentOrigin.Center; - label.PivotPoint = PivotPoint.Center; - label.PositionUsesPivotPoint = true; - backgroundView.Add(label); - } - - // Set frame callback to start drag animation. - private void SetFrameCallback(float position) - { - // remove frame callback if it is already added. - mWindow.RemoveFrameCallback(mFrameCallback); - - mFrameCallback.ResetAnimationData(); - mFrameCallback.AddMovement(0.0f); // Add first movement. - - // Set container start position and start positions of each icon(and vertical bar) - // And compute total container size. - float totalSize = 0.0f; - mFrameCallback.SetContainerStartPosition(mControlView.Position.X); - for (int i = 0; i < mLayoutView.ChildCount; ++i) - { - mFrameCallback.SetViewPosition(i, mLayoutView.Children[i].Position.X); - totalSize += (float)(mLayoutView.Children[i].Size.Width + DEFAULT_SPACE); - } - totalSize -= (float)DEFAULT_SPACE; - - // Find touched icon - for (int i = (int)mLayoutView.ChildCount - 1; i >= 0; --i) - { - if (position >= mLayoutView.Children[i].Position.X + mControlView.Position.X) - { - mFrameCallback.SetTouchedViewIndex(i); - mTouchedViewIndex = i; - break; - } - } - if (position < mLayoutView.Children[0].Position.X + mControlView.Position.X) - { - mFrameCallback.SetTouchedViewIndex(0); - mTouchedViewIndex = 0; - } - - mPreviousTouchedPosition = position; - - // Add frame callback on window. - // OnUpdate callback of mFrameCallback will be called before every render frame. - mWindow.AddFrameCallback(mFrameCallback); - - // compute limit position the container could go. - mLeftDirectionLimit = (float)mWindow.Size.Width - (totalSize + (float)(INITIAL_POSITION)); - - mWindow.RenderingBehavior = RenderingBehaviorType.Continuously; // make rendering be done for upto 60 fps even though there is no update in main thread. - mAnimationState = TOUCH_ANIMATION_STATE.ON_ANIMATION; // make rendering state on. - } - - private bool OnTouch(object source, View.TouchEventArgs e) - { - Vector2 position = e.Touch.GetScreenPosition(0); - - PointStateType state = e.Touch.GetState(0); - if (PointStateType.Down == state) - { - if (mAnimationState == TOUCH_ANIMATION_STATE.ON_FINISH_ANIMATION) - { - // re-birth current animation - // in case of touch during finish animation, - // quit easingAnimation and AnimationOffTimer because animation ownership is returned to the touch event again. - // AND, DO NOT RESET ALL PROPERTIES OF FRAMECALLBACK. - // because, for example, if touched icon index is changed, the movement is wrong and the animation can be not continous. - // This re-birthed animation is just for smooth moving during complex user interaction. - // during complex and fast interaction, this is not so noticeable. - // and reset of such properties will be done in the below Motion state - mFinishAnimation.Stop(); - mAnimationOffTimer.Stop(); - - // Set Animation State to ON_ANIMATION again - mAnimationState = TOUCH_ANIMATION_STATE.ON_ANIMATION; - // Set previousTouchPosition - mPreviousTouchedPosition = position.X; - } - else - { - // in case of stable state - // just set new framecallback for this touched position. - SetFrameCallback(position.X); - } - } - else if (PointStateType.Motion == state) - { - // if framecallback can be reset, quit current frame callback and re-launch new frame callback. - // because, if current frame callback is re-birthed one, the animation is not totally re-created one. - // So, some properties like touched icon index can be wrong for the continuous animation. - // But, some case like that finger is stopped and restart to move, this could make weired feeling. - // We reset mFrameCallback as soon as possible we can. And the conditions are ... - // 1. icons in screen is stopped. - // 2. velocity of frame callback is 0.0 (this frame callback will not move again instantly) - // 3. frame callback is not dirty (there is no reserved action) - if (mFrameCallback.IsResetTouchedViewPossible() && mFrameCallback.GetVelocity() == 0.0f && !mFrameCallback.IsDirty()) - { - SetFrameCallback(position.X); - } - - // Set new controlView(container) position - // in here, we need to consider the container is not go outside of limits. - float containerPosition = mControlView.Position.X + (position.X - mPreviousTouchedPosition); - containerPosition = Math.Min(containerPosition, mRightDirectionLimit); - containerPosition = Math.Max(containerPosition, mLeftDirectionLimit); - float adjustedPosition = containerPosition - mControlView.Position.X + mPreviousTouchedPosition; - mPreviousTouchedPosition = adjustedPosition; - mControlView.Position.X = containerPosition; - } - else if ((PointStateType.Up == state || PointStateType.Leave == state || PointStateType.Interrupted == state) && - mAnimationState == TOUCH_ANIMATION_STATE.ON_ANIMATION) - { - mAnimationState = TOUCH_ANIMATION_STATE.ON_FINISH_ANIMATION; - - // To launch finish animation, we get latest velocty from frame callback - float velocity = mFrameCallback.GetVelocity(); - - /* TUNING */ - // This is just for turning of finish animation. - // change the values if you want. - velocity = Math.Max(velocity, -3.5f); - velocity = Math.Min(velocity, 3.5f); - if (Math.Abs(velocity) < 0.0001f) - { - // If velocity is zero. just start animationOfftimer. - mAnimationOffTimer.Start(); - } - else - { - // If velocity is not zero, make decelerating animation. - Decelerating(velocity); - } - } - // set currently visible icons for optimization - SetVisibleLimit(); - // make frame callback dirty. - mFrameCallback.Dirty(); - return true; - } - - private void SetVisibleLimit() - { - int leftViewIndex = mTouchedViewIndex; - for (; leftViewIndex >= 0; --leftViewIndex) - { - float newPosition = mLayoutView.Children[leftViewIndex].Position.X + mControlView.Position.X; - if (newPosition + (float)mLayoutView.Children[leftViewIndex].Size.Width < 0.0f) - { - break; - } - } - leftViewIndex = Math.Max(leftViewIndex, 0); - int rightViewIndex = mTouchedViewIndex; - for (; rightViewIndex < mLayoutView.ChildCount; ++rightViewIndex) - { - float newPosition = mLayoutView.Children[rightViewIndex].Position.X + mControlView.Position.X; - if (newPosition > mWindow.Size.Width) - { - break; - } - } - rightViewIndex = Math.Min(rightViewIndex, (int)mLayoutView.ChildCount - 1); - - mFrameCallback.SetLeftIndex(leftViewIndex); - mFrameCallback.SetRightIndex(rightViewIndex); - } - - // set decelerating properties - // in this example, we used decelerate animation in "https://medium.com/@esskeetit/scrolling-mechanics-of-uiscrollview-142adee1142c" - // But, if this method is problematic or violate some patent of other company, change this other way. - // We didn't checked anything. - // Only thing we need to remember when we change this animation is to add "EasingAnimationFinishedCallback" for the new animation. - private void Decelerating(float velocity) - { - mAbsoluteVelocity = Math.Abs(velocity); - mFinishAnimationDelta = (mAbsoluteVelocity * mDecelerationRate) / (1 - mDecelerationRate); - float destination = (velocity > 0) ? mControlView.Position.X + mFinishAnimationDelta : mControlView.Position.X - mFinishAnimationDelta; - - if (destination < mLeftDirectionLimit || destination > mRightDirectionLimit) - { - mFinishAnimationDelta = velocity > 0 ? (mRightDirectionLimit - mControlView.Position.X) : (mControlView.Position.X - mLeftDirectionLimit); - destination = velocity > 0 ? mRightDirectionLimit : mLeftDirectionLimit; - if (mFinishAnimationDelta == 0) - { - mFinishAnimationDuration = 0.0f; - } - else - { - mFinishAnimationDuration = (float)Math.Log((mFinishAnimationDelta * mLogDeceleration / mAbsoluteVelocity + 1), mDecelerationRate); - } - } - else - { - if (mFinishAnimationDelta == 0) - { - mFinishAnimationDuration = 0.0f; - } - else - { - mFinishAnimationDuration = (float)Math.Log(-mEasingThreshold * mLogDeceleration / mAbsoluteVelocity) / mLogDeceleration; - } - } - - mFinishAnimation.Clear(); - customScrollAlphaFunction = new UserAlphaFunctionDelegate(CustomScrollAlphaFunction); - mFinishAnimation.DefaultAlphaFunction = new AlphaFunction(customScrollAlphaFunction); - GC.KeepAlive(customScrollAlphaFunction); - mFinishAnimation.Duration = (int)mFinishAnimationDuration; - mFinishAnimation.AnimateTo(mControlView, "PositionX", destination); - mFinishAnimation.Play(); - } - - private float CustomScrollAlphaFunction(float progress) - { - if (mFinishAnimationDelta == 0) - { - return 1.0f; - } - else - { - float realDuration = progress * mFinishAnimationDuration; - float realDistance = mAbsoluteVelocity * ((float)Math.Pow(mDecelerationRate, realDuration) - 1) / mLogDeceleration; - float result = Math.Min(realDistance / Math.Abs(mFinishAnimationDelta), 1.0f); - - return result; - } - } - - private void EasingAnimationFinishedCallback(object sender, EventArgs e) - { - if (mAnimationState != TOUCH_ANIMATION_STATE.ON_FINISH_ANIMATION) - { - return; - } - - // start Animation Off Timer - mFinishAnimation.Clear(); - SetVisibleLimit(); - mAnimationOffTimer.Start(); - } - - // Check each icons in screen is not moving. - // If it is, finish all animation and make animationstate End_animation(NO_ANIMATION) - private bool OffAnimatable(object target, Timer.TickEventArgs args) - { - if (mFrameCallback.IsResetTouchedViewPossible()) - { - mWindow.RenderingBehavior = RenderingBehaviorType.IfRequired; - mWindow.RemoveFrameCallback(mFrameCallback); - mAnimationOffTimer.Stop(); - mAnimationState = TOUCH_ANIMATION_STATE.END_ANIMATION; - return false; - } - SetVisibleLimit(); - return true; - } - } -} \ No newline at end of file diff --git a/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/FrameUpdateCallbackTest.cs b/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/FrameUpdateCallbackTest.cs new file mode 100644 index 0000000..59edcff --- /dev/null +++ b/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/FrameUpdateCallbackTest.cs @@ -0,0 +1,757 @@ +using System; +using System.Threading.Tasks; +using Tizen.NUI; +using Tizen.NUI.BaseComponents; +using System.Collections.Generic; +using System.Linq; + +namespace Tizen.NUI.Samples +{ + enum TOUCH_ANIMATION_STATE + { + NO_ANIMATION = 0, + ON_ANIMATION, + ON_FINISH_ANIMATION, + END_ANIMATION = NO_ANIMATION + }; + + public class FrameUpdateCallbackTest : IExample + { + + private static string resourcePath = Tizen.Applications.Application.Current.DirectoryInfo.Resource; + private static string[] BACKGROUND_IMAGE_PATH = { + resourcePath + "/images/FrameUpdateCallbackTest/launcher_bg_02_nor.png", + resourcePath + "/images/FrameUpdateCallbackTest/launcher_bg_03_nor.png", + resourcePath + "/images/FrameUpdateCallbackTest/launcher_bg_04_nor.png", + resourcePath + "/images/FrameUpdateCallbackTest/launcher_bg_05_nor.png", + resourcePath + "/images/FrameUpdateCallbackTest/launcher_bg_06_nor.png", + resourcePath + "/images/FrameUpdateCallbackTest/launcher_bg_apps_nor.png" + }; + + private static string[] APPS_IMAGE_PATH = { + resourcePath + "/images/FrameUpdateCallbackTest/launcher_ic_culinary_nor.png", + resourcePath + "/images/FrameUpdateCallbackTest/launcher_ic_family_nor.png", + resourcePath + "/images/FrameUpdateCallbackTest/launcher_ic_ent_nor.png", + resourcePath + "/images/FrameUpdateCallbackTest/launcher_ic_homecare_nor.png" + }; + + private static string[] APPS_ICON_NAME = { + "Culinary", + "Family", + "Entertainment", + "Homecare" + }; + + private static string[] CONTROL_IMAGE_PATH = { + resourcePath + "/images/FrameUpdateCallbackTest/launcher_ic_apps_nor.png", + resourcePath + "/images/FrameUpdateCallbackTest/launcher_ic_settings_nor.png", + resourcePath + "/images/FrameUpdateCallbackTest/launcher_ic_viewinside_nor.png", + resourcePath + "/images/FrameUpdateCallbackTest/launcher_ic_timer_nor.png", + resourcePath + "/images/FrameUpdateCallbackTest/launcher_ic_internet_nor.png" + }; + + private static string[] CONTROL_ICON_NAME = { + "Apps", + "Settings", + "ViewInside", + "Timer", + "Internet" + }; + + private const int FRAME_RATE = 60; + private const int OBJECT_DELAY = 30; + private const int OBJECT_SIZE = 150; + private const int INITIAL_POSITION = 46; + private const int DEFAULT_SPACE = 9; + private const int DEVIDE_BAR_SIZE = 4; + + private TextLabel text; + public class FrameUpdateCallback : FrameUpdateCallbackInterface + { + private int timeInterval; + + private uint containerId; + private List viewId; ///< View ID in the container. + private List viewPosition; + + // Movement is position difference of Container from start position of this animation to current position. + // Time interval between each containerMovement entry is 16 milliseconds(about 60 fps) + // For example. + // containerMovement[i] + containerStartPosition is the position of container after i*16 milliseconds from this animation started. + private List containerMovement; + + // latestMovement is actually current movement of container. + private float latestMovement; + + // An icon of touchedViewIndex moves with container at the same time. + // Each icon of (touchedViewIndex -/+ i) moves as following container after i*OBJECT_DELAY milliseconds. + private int touchedViewIndex; + + // If every icon between mLeftIndext and rightIndex is stopped, this frame callback can be reset. + // Then isResetTouchedViewPossible becomes true. + private bool isResetTouchedViewPossible; + private int leftIndex; + private int rightIndex; + + // Total animation time from start to current. + private float totalAnimationTime; + // Total animation time from start to the time that last movement is added. + private float previousTotalAnimationTime; + + // Start position of container in this animation. + private float containerStartPosition; + // Position of container at the time that last movement is added. + private float previousContainerPosition; + + // This animation only need to save movement about (the number of view * OBJECT_DELAY) milliseconds. + // and this size is updated when new view is added. + // and, If the list of containerMovement size become larger than this size, remove unnecessary entries. + private int requiredMovementSize; + private bool needUpdateMovementSize; + + // current velocity. + private float velocity; + // dirty flag. + private bool dirty; + + public FrameUpdateCallback() + { + viewId = new List(); + containerMovement = new List(); + requiredMovementSize = 0; + needUpdateMovementSize = false; + isResetTouchedViewPossible = false; + } + + public void ResetAnimationData() + { + SetLatestMovement(0.0f); + containerMovement.Clear(); + totalAnimationTime = 0.0f; + previousTotalAnimationTime = 0.0f; + dirty = true; + } + + public void SetTimeInterval(int interval) + { + needUpdateMovementSize = true; + timeInterval = interval; + } + + public void AddId(uint id) + { + viewId.Add(id); + needUpdateMovementSize = true; + } + + public void SetContainerId(uint id) + { + containerId = id; + } + + public void SetContainerStartPosition(float position) + { + containerStartPosition = position; + } + + public void SetLatestMovement(float movement) + { + latestMovement = movement; + } + + public void ResetViewPosition() + { + viewPosition = Enumerable.Repeat(0.0f, viewId.Count).ToList(); + } + + public void SetViewPosition(int index, float position) + { + viewPosition[index] = position; + } + + public void SetTouchedViewIndex(int controlIndex) + { + touchedViewIndex = controlIndex; + } + + public void AddMovement(float movement) + { + containerMovement.Add(movement); + } + + public void SetLeftIndex(int Index) + { + leftIndex = Index; + } + + public void SetRightIndex(int Index) + { + rightIndex = Index; + } + + public bool IsResetTouchedViewPossible() + { + return isResetTouchedViewPossible; + } + public void Dirty() + { + dirty = true; + } + + public bool IsDirty() + { + return dirty; + } + + public float GetVelocity() + { + return velocity; + } + + private void ComputeNewPositions(int totalTime) + { + // save latestMovement to avoid interference between thread. + float lastMovement = latestMovement; + bool isStillMoving = true; + for (int i = 0; i < viewId.Count; ++i) + { + if (i == touchedViewIndex) + { + continue; + } + + // compute delay of view of i. + int totalDelay = Math.Abs(i - touchedViewIndex) * OBJECT_DELAY; + if (totalDelay > totalTime) + { + continue; + } + + int actorTime = totalTime - totalDelay; + int movementIndex = actorTime / timeInterval; + float factor = (float)(actorTime - (movementIndex * timeInterval)) / (float)timeInterval; + float movement; + if (movementIndex >= containerMovement.Count - 1) + { + // 1. delay is zero(every view moves with container at the same time) + // 2. after every icons are stopped and the finger is stopped to move, the movement is still not added more. + // than the view has lastMovement. + movement = lastMovement; + } + else if (movementIndex < 0) + { + // If this animation is just staarted and the view need to wait more. + // movement is 0. + movement = 0.0f; + } + else + { + // Get the movement of ith view by interpolating containerMovement + movement = factor * containerMovement[movementIndex + 1] + (1.0f - factor) * containerMovement[movementIndex]; + } + + // Prevent to overlap of each views. + float currentSpace = Math.Abs((viewPosition[i] + movement) - (viewPosition[touchedViewIndex] + lastMovement)); + float minimumSpace = (float)Math.Abs(viewPosition[i] - viewPosition[touchedViewIndex]); + if (currentSpace < minimumSpace) + { + movement = lastMovement; + } + + // check views in screen are still moving or stopped. + float newPosition = viewPosition[i] + movement - lastMovement; + if (i >= leftIndex && i <= rightIndex) + { + Vector3 previousPosition = new Vector3(); + GetPosition(viewId[i], previousPosition); + if (Math.Abs(previousPosition.X - newPosition) >= 1.0f) + { + isStillMoving = false; + } + } + // update new position. + SetPosition(viewId[i], new Vector3(newPosition, 0.0f, 0.0f)); + } + isResetTouchedViewPossible = isStillMoving; + } + + public override void OnUpdate(float elapsedSeconds) + { + // second -> millisecond + totalAnimationTime += elapsedSeconds * 1000.0f; + + Vector3 currentPosition = new Vector3(); + GetPosition(containerId, currentPosition); + + // Add new Movement, if there is change in position. + // 1. if dirty(there is reserved event) + // 2. if container position is changed. + // 3. if every icons in screen is stopped + if (dirty || currentPosition.X != previousContainerPosition || isResetTouchedViewPossible) + { + dirty = false; + if (totalAnimationTime >= containerMovement.Count * timeInterval) + { + // If the passed time is larger than timeInterval, add new movements. + // If we need to add more than one, compute each movement by using interpolation. + while (containerMovement.Count <= totalAnimationTime / timeInterval) + { + float factor = ((float)(containerMovement.Count * timeInterval) - previousTotalAnimationTime) / (totalAnimationTime - previousTotalAnimationTime); + float movement = (float)(factor * currentPosition.X + (1.0f - factor) * previousContainerPosition) - containerStartPosition; + AddMovement(movement); + } + // Compute velocity. + // We need to compute velocity here to get reasonable value. + velocity = (currentPosition.X - previousContainerPosition) / (totalAnimationTime - previousTotalAnimationTime); + previousTotalAnimationTime = totalAnimationTime; + previousContainerPosition = currentPosition.X; + } + } + float currentMovement = currentPosition.X - containerStartPosition; + SetLatestMovement(currentMovement); + + // Compute positions of each icon + ComputeNewPositions((int)totalAnimationTime); + + // compute requiredMovementSize + if (requiredMovementSize == 0 || needUpdateMovementSize) + { + needUpdateMovementSize = false; + requiredMovementSize = viewId.Count * OBJECT_DELAY / timeInterval; + } + + // Remove unnecessary movement for memory optimization. + if (containerMovement.Count > requiredMovementSize * 2) + { + int movementNumberToRemove = containerMovement.Count - requiredMovementSize; + containerMovement.RemoveRange(0, movementNumberToRemove); + totalAnimationTime -= (float)(timeInterval * movementNumberToRemove); + } + } + } + + private Window window; + + private FrameUpdateCallback frameUpdateCallback; ///< An instance of our implementation of the FrameUpdateCallbackInterface. + + // Views for launcher + private View baseView; + private View controlView; + private View layoutView; + + // Variables for animation + private float previousTouchedPosition; + private int touchedViewIndex; + private TOUCH_ANIMATION_STATE animationState; + + private float leftDirectionLimit; + private float rightDirectionLimit; + + + // Variables for Finish animation + // These variables are for deceleration curve. + // If we want to use another curve like bezier, uses different variables + private delegate float UserAlphaFunctionDelegate(float progress); + private UserAlphaFunctionDelegate customScrollAlphaFunction; + private float absoluteVelocity = 0.0f; + private float finishAnimationDuration = 0.0f; + private float finishAnimationDelta = 0.0f; + private float logDeceleration = 0.0f; + private float decelerationRate = 0.99f; + private float easingThreshold = 0.1f; + + private Animation finishAnimation; + private Timer animationOffTimer; // timer to end animation after the easing animation is finished + + // Vies of contents + private View contentsView; + + public void Activate() + { + frameUpdateCallback = new FrameUpdateCallback(); + Initialize(); + } + + public void Deactivate() + { + } + + void Initialize() + { + // Set the stage background color and connect to the stage's key signal to allow Back and Escape to exit. + window = Window.Instance; + window.BackgroundColor = Color.White; + + rightDirectionLimit = INITIAL_POSITION; + + // Contents + + contentsView = new View(); + contentsView.BackgroundColor = new Color(0.921568f, 0.9098039f, 0.890196f, 0.5f); + contentsView.ParentOrigin = ParentOrigin.TopLeft; + contentsView.PivotPoint = PivotPoint.TopLeft; + contentsView.PositionUsesPivotPoint = true; + contentsView.WidthResizePolicy = ResizePolicyType.FillToParent; + contentsView.HeightResizePolicy = ResizePolicyType.FillToParent; + window.GetDefaultLayer().Add(contentsView); + + // Launcher + baseView = new View(); + baseView.ParentOrigin = ParentOrigin.BottomLeft; + baseView.PivotPoint = PivotPoint.BottomLeft; + baseView.PositionUsesPivotPoint = true; + baseView.Size = new Size(window.Size.Width, 278); + baseView.Position = new Position(0, 0); + window.GetDefaultLayer().Add(baseView); + + View iconBackgroundView = new View(); + iconBackgroundView.BackgroundColor = new Color(0.921568f, 0.9098039f, 0.890196f, 0.5f); + iconBackgroundView.ParentOrigin = ParentOrigin.BottomLeft; + iconBackgroundView.PivotPoint = PivotPoint.BottomLeft; + iconBackgroundView.PositionUsesPivotPoint = true; + iconBackgroundView.Size = new Size(window.Size.Width, 278); + iconBackgroundView.Position = new Position(0, 0); + baseView.Add(iconBackgroundView); + + controlView = new View(); + controlView.ParentOrigin = ParentOrigin.CenterLeft; + controlView.PivotPoint = PivotPoint.CenterLeft; + controlView.PositionUsesPivotPoint = true; + controlView.Position = new Position(rightDirectionLimit, 0); + baseView.Add(controlView); + frameUpdateCallback.SetContainerId(controlView.ID); + + layoutView = new View(); + layoutView.ParentOrigin = ParentOrigin.CenterLeft; + layoutView.PivotPoint = PivotPoint.CenterLeft; + layoutView.PositionUsesPivotPoint = true; + layoutView.Layout = new LinearLayout() + { + LinearOrientation = LinearLayout.Orientation.Horizontal, + CellPadding = new Size2D(DEFAULT_SPACE, 0), + }; + layoutView.Position = new Position(0, 0); + controlView.Add(layoutView); + + for (int i = 0; i < 4; ++i) + { + AddIcon(BACKGROUND_IMAGE_PATH[i], APPS_IMAGE_PATH[i], APPS_ICON_NAME[i], Color.White); + } + + View divideBar = new View(); + divideBar.BackgroundColor = new Color(0.0f, 0.0f, 0.0f, 0.1f); + divideBar.ParentOrigin = ParentOrigin.CenterLeft; + divideBar.PivotPoint = PivotPoint.CenterLeft; + divideBar.PositionUsesPivotPoint = true; + divideBar.Size = new Size(DEVIDE_BAR_SIZE, OBJECT_SIZE); + layoutView.Add(divideBar); + frameUpdateCallback.AddId(divideBar.ID); + + int iconNumber = 8; + for (int i = 0; i < iconNumber; ++i) + { + AddIcon(BACKGROUND_IMAGE_PATH[5], CONTROL_IMAGE_PATH[i % 5], CONTROL_ICON_NAME[i % 5], new Color(0.0f, 0.0f, 0.0f, 0.5f)); + } + + frameUpdateCallback.ResetViewPosition(); + frameUpdateCallback.SetTimeInterval(1000 / FRAME_RATE); + + animationState = TOUCH_ANIMATION_STATE.NO_ANIMATION; + + animationOffTimer = new Timer(16); + animationOffTimer.Tick += OffAnimatable; + + baseView.TouchEvent += OnTouch; + + finishAnimation = new Animation(); + finishAnimation.Finished += EasingAnimationFinishedCallback; + logDeceleration = (float)Math.Log(decelerationRate); + } + + // Add icons + + void AddIcon(string background, string icon, string text, Color textColor) + { + ImageView backgroundView = new ImageView(); + backgroundView.ResourceUrl = background; + backgroundView.Size = new Size(OBJECT_SIZE, OBJECT_SIZE); + backgroundView.ParentOrigin = ParentOrigin.CenterLeft; + backgroundView.PivotPoint = PivotPoint.CenterLeft; + backgroundView.PositionUsesPivotPoint = true; + layoutView.Add(backgroundView); + frameUpdateCallback.AddId(backgroundView.ID); + + ImageView iconView = new ImageView(); + iconView.ResourceUrl = icon; + iconView.Position = new Position(0, -15); + iconView.ParentOrigin = ParentOrigin.Center; + iconView.PivotPoint = PivotPoint.Center; + iconView.PositionUsesPivotPoint = true; + backgroundView.Add(iconView); + + TextLabel label = new TextLabel(text); + label.Position = new Position(0, 30); + label.HorizontalAlignment = HorizontalAlignment.Center; + label.TextColor = textColor; + label.FontFamily = "SamsungOneUI"; + label.PointSize = 12; + label.ParentOrigin = ParentOrigin.Center; + label.PivotPoint = PivotPoint.Center; + label.PositionUsesPivotPoint = true; + backgroundView.Add(label); + } + + // Set frame callback to start drag animation. + private void SetFrameUpdateCallback(float position) + { + // remove frame callback if it is already added. + window.RemoveFrameUpdateCallback(frameUpdateCallback); + + frameUpdateCallback.ResetAnimationData(); + frameUpdateCallback.AddMovement(0.0f); // Add first movement. + + // Set container start position and start positions of each icon(and vertical bar) + // And compute total container size. + float totalSize = 0.0f; + frameUpdateCallback.SetContainerStartPosition(controlView.Position.X); + for (int i = 0; i < layoutView.ChildCount; ++i) + { + frameUpdateCallback.SetViewPosition(i, layoutView.Children[i].Position.X); + totalSize += (float)(layoutView.Children[i].Size.Width + DEFAULT_SPACE); + } + totalSize -= (float)DEFAULT_SPACE; + + // Find touched icon + for (int i = (int)layoutView.ChildCount - 1; i >= 0; --i) + { + if (position >= layoutView.Children[i].Position.X + controlView.Position.X) + { + frameUpdateCallback.SetTouchedViewIndex(i); + touchedViewIndex = i; + break; + } + } + if (position < layoutView.Children[0].Position.X + controlView.Position.X) + { + frameUpdateCallback.SetTouchedViewIndex(0); + touchedViewIndex = 0; + } + + previousTouchedPosition = position; + + // Add frame callback on window. + // OnUpdate callback of frameUpdateCallback will be called before every render frame. + window.AddFrameUpdateCallback(frameUpdateCallback); + + // compute limit position the container could go. + leftDirectionLimit = (float)window.Size.Width - (totalSize + (float)(INITIAL_POSITION)); + + window.RenderingBehavior = RenderingBehaviorType.Continuously; // make rendering be done for upto 60 fps even though there is no update in main thread. + animationState = TOUCH_ANIMATION_STATE.ON_ANIMATION; // make rendering state on. + } + + private bool OnTouch(object source, View.TouchEventArgs e) + { + Vector2 position = e.Touch.GetScreenPosition(0); + + PointStateType state = e.Touch.GetState(0); + if (PointStateType.Down == state) + { + if (animationState == TOUCH_ANIMATION_STATE.ON_FINISH_ANIMATION) + { + // re-birth current animation + // in case of touch during finish animation, + // quit easingAnimation and AnimationOffTimer because animation ownership is returned to the touch event again. + // AND, DO NOT RESET ALL PROPERTIES OF FRAMECALLBACK. + // because, for example, if touched icon index is changed, the movement is wrong and the animation can be not continous. + // This re-birthed animation is just for smooth moving during complex user interaction. + // during complex and fast interaction, this is not so noticeable. + // and reset of such properties will be done in the below Motion state + finishAnimation.Stop(); + animationOffTimer.Stop(); + + // Set Animation State to ON_ANIMATION again + animationState = TOUCH_ANIMATION_STATE.ON_ANIMATION; + // Set previousTouchPosition + previousTouchedPosition = position.X; + } + else + { + // in case of stable state + // just set new framecallback for this touched position. + SetFrameUpdateCallback(position.X); + } + } + else if (PointStateType.Motion == state) + { + // if framecallback can be reset, quit current frame callback and re-launch new frame callback. + // because, if current frame callback is re-birthed one, the animation is not totally re-created one. + // So, some properties like touched icon index can be wrong for the continuous animation. + // But, some case like that finger is stopped and restart to move, this could make weired feeling. + // We reset frameUpdateCallback as soon as possible we can. And the conditions are ... + // 1. icons in screen is stopped. + // 2. velocity of frame callback is 0.0 (this frame callback will not move again instantly) + // 3. frame callback is not dirty (there is no reserved action) + if (frameUpdateCallback.IsResetTouchedViewPossible() && frameUpdateCallback.GetVelocity() == 0.0f && !frameUpdateCallback.IsDirty()) + { + SetFrameUpdateCallback(position.X); + } + + // Set new controlView(container) position + // in here, we need to consider the container is not go outside of limits. + float containerPosition = controlView.Position.X + (position.X - previousTouchedPosition); + containerPosition = Math.Min(containerPosition, rightDirectionLimit); + containerPosition = Math.Max(containerPosition, leftDirectionLimit); + float adjustedPosition = containerPosition - controlView.Position.X + previousTouchedPosition; + previousTouchedPosition = adjustedPosition; + controlView.Position.X = containerPosition; + } + else if ((PointStateType.Up == state || PointStateType.Leave == state || PointStateType.Interrupted == state) && + animationState == TOUCH_ANIMATION_STATE.ON_ANIMATION) + { + animationState = TOUCH_ANIMATION_STATE.ON_FINISH_ANIMATION; + + // To launch finish animation, we get latest velocty from frame callback + float lastVelocity = frameUpdateCallback.GetVelocity(); + + /* TUNING */ + // This is just for turning of finish animation. + // change the values if you want. + lastVelocity = Math.Max(lastVelocity, -3.5f); + lastVelocity = Math.Min(lastVelocity, 3.5f); + if (Math.Abs(lastVelocity) < 0.0001f) + { + // If velocity is zero. just start animationOfftimer. + animationOffTimer.Start(); + } + else + { + // If velocity is not zero, make decelerating animation. + Decelerating(lastVelocity); + } + } + // set currently visible icons for optimization + SetVisibleLimit(); + // make frame callback dirty. + frameUpdateCallback.Dirty(); + return true; + } + + private void SetVisibleLimit() + { + int leftViewIndex = touchedViewIndex; + for (; leftViewIndex >= 0; --leftViewIndex) + { + float newPosition = layoutView.Children[leftViewIndex].Position.X + controlView.Position.X; + if (newPosition + (float)layoutView.Children[leftViewIndex].Size.Width < 0.0f) + { + break; + } + } + leftViewIndex = Math.Max(leftViewIndex, 0); + int rightViewIndex = touchedViewIndex; + for (; rightViewIndex < layoutView.ChildCount; ++rightViewIndex) + { + float newPosition = layoutView.Children[rightViewIndex].Position.X + controlView.Position.X; + if (newPosition > window.Size.Width) + { + break; + } + } + rightViewIndex = Math.Min(rightViewIndex, (int)layoutView.ChildCount - 1); + + frameUpdateCallback.SetLeftIndex(leftViewIndex); + frameUpdateCallback.SetRightIndex(rightViewIndex); + } + + // set decelerating properties + // in this example, we used decelerate animation in "https://medium.com/@esskeetit/scrolling-mechanics-of-uiscrollview-142adee1142c" + // But, if this method is problematic or violate some patent of other company, change this other way. + // We didn't checked anything. + // Only thing we need to remember when we change this animation is to add "EasingAnimationFinishedCallback" for the new animation. + private void Decelerating(float lastVelocity) + { + absoluteVelocity = Math.Abs(lastVelocity); + finishAnimationDelta = (absoluteVelocity * decelerationRate) / (1 - decelerationRate); + float destination = (lastVelocity > 0) ? controlView.Position.X + finishAnimationDelta : controlView.Position.X - finishAnimationDelta; + + if (destination < leftDirectionLimit || destination > rightDirectionLimit) + { + finishAnimationDelta = lastVelocity > 0 ? (rightDirectionLimit - controlView.Position.X) : (controlView.Position.X - leftDirectionLimit); + destination = lastVelocity > 0 ? rightDirectionLimit : leftDirectionLimit; + if (finishAnimationDelta == 0) + { + finishAnimationDuration = 0.0f; + } + else + { + finishAnimationDuration = (float)Math.Log((finishAnimationDelta * logDeceleration / absoluteVelocity + 1), decelerationRate); + } + } + else + { + if (finishAnimationDelta == 0) + { + finishAnimationDuration = 0.0f; + } + else + { + finishAnimationDuration = (float)Math.Log(-easingThreshold * logDeceleration / absoluteVelocity) / logDeceleration; + } + } + + finishAnimation.Clear(); + customScrollAlphaFunction = new UserAlphaFunctionDelegate(CustomScrollAlphaFunction); + finishAnimation.DefaultAlphaFunction = new AlphaFunction(customScrollAlphaFunction); + GC.KeepAlive(customScrollAlphaFunction); + finishAnimation.Duration = (int)finishAnimationDuration; + finishAnimation.AnimateTo(controlView, "PositionX", destination); + finishAnimation.Play(); + } + + private float CustomScrollAlphaFunction(float progress) + { + if (finishAnimationDelta == 0) + { + return 1.0f; + } + else + { + float realDuration = progress * finishAnimationDuration; + float realDistance = absoluteVelocity * ((float)Math.Pow(decelerationRate, realDuration) - 1) / logDeceleration; + float result = Math.Min(realDistance / Math.Abs(finishAnimationDelta), 1.0f); + + return result; + } + } + + private void EasingAnimationFinishedCallback(object sender, EventArgs e) + { + if (animationState != TOUCH_ANIMATION_STATE.ON_FINISH_ANIMATION) + { + return; + } + + // start Animation Off Timer + finishAnimation.Clear(); + SetVisibleLimit(); + animationOffTimer.Start(); + } + + // Check each icons in screen is not moving. + // If it is, finish all animation and make animationstate End_animation(NO_ANIMATION) + private bool OffAnimatable(object target, Timer.TickEventArgs args) + { + if (frameUpdateCallback.IsResetTouchedViewPossible()) + { + window.RenderingBehavior = RenderingBehaviorType.IfRequired; + window.RemoveFrameUpdateCallback(frameUpdateCallback); + animationOffTimer.Stop(); + animationState = TOUCH_ANIMATION_STATE.END_ANIMATION; + return false; + } + SetVisibleLimit(); + return true; + } + } +} \ No newline at end of file diff --git a/test/Tizen.NUI.Samples/Tizen.NUI.Samples/res/images/FrameCallbackTest/launcher_bg_01_nor.png b/test/Tizen.NUI.Samples/Tizen.NUI.Samples/res/images/FrameUpdateCallbackTest/launcher_bg_01_nor.png similarity index 100% rename from test/Tizen.NUI.Samples/Tizen.NUI.Samples/res/images/FrameCallbackTest/launcher_bg_01_nor.png rename to test/Tizen.NUI.Samples/Tizen.NUI.Samples/res/images/FrameUpdateCallbackTest/launcher_bg_01_nor.png diff --git a/test/Tizen.NUI.Samples/Tizen.NUI.Samples/res/images/FrameCallbackTest/launcher_bg_02_nor.png b/test/Tizen.NUI.Samples/Tizen.NUI.Samples/res/images/FrameUpdateCallbackTest/launcher_bg_02_nor.png similarity index 100% rename from test/Tizen.NUI.Samples/Tizen.NUI.Samples/res/images/FrameCallbackTest/launcher_bg_02_nor.png rename to test/Tizen.NUI.Samples/Tizen.NUI.Samples/res/images/FrameUpdateCallbackTest/launcher_bg_02_nor.png diff --git a/test/Tizen.NUI.Samples/Tizen.NUI.Samples/res/images/FrameCallbackTest/launcher_bg_03_nor.png b/test/Tizen.NUI.Samples/Tizen.NUI.Samples/res/images/FrameUpdateCallbackTest/launcher_bg_03_nor.png similarity index 100% rename from test/Tizen.NUI.Samples/Tizen.NUI.Samples/res/images/FrameCallbackTest/launcher_bg_03_nor.png rename to test/Tizen.NUI.Samples/Tizen.NUI.Samples/res/images/FrameUpdateCallbackTest/launcher_bg_03_nor.png diff --git a/test/Tizen.NUI.Samples/Tizen.NUI.Samples/res/images/FrameCallbackTest/launcher_bg_04_nor.png b/test/Tizen.NUI.Samples/Tizen.NUI.Samples/res/images/FrameUpdateCallbackTest/launcher_bg_04_nor.png similarity index 100% rename from test/Tizen.NUI.Samples/Tizen.NUI.Samples/res/images/FrameCallbackTest/launcher_bg_04_nor.png rename to test/Tizen.NUI.Samples/Tizen.NUI.Samples/res/images/FrameUpdateCallbackTest/launcher_bg_04_nor.png diff --git a/test/Tizen.NUI.Samples/Tizen.NUI.Samples/res/images/FrameCallbackTest/launcher_bg_05_nor.png b/test/Tizen.NUI.Samples/Tizen.NUI.Samples/res/images/FrameUpdateCallbackTest/launcher_bg_05_nor.png similarity index 100% rename from test/Tizen.NUI.Samples/Tizen.NUI.Samples/res/images/FrameCallbackTest/launcher_bg_05_nor.png rename to test/Tizen.NUI.Samples/Tizen.NUI.Samples/res/images/FrameUpdateCallbackTest/launcher_bg_05_nor.png diff --git a/test/Tizen.NUI.Samples/Tizen.NUI.Samples/res/images/FrameCallbackTest/launcher_bg_06_nor.png b/test/Tizen.NUI.Samples/Tizen.NUI.Samples/res/images/FrameUpdateCallbackTest/launcher_bg_06_nor.png similarity index 100% rename from test/Tizen.NUI.Samples/Tizen.NUI.Samples/res/images/FrameCallbackTest/launcher_bg_06_nor.png rename to test/Tizen.NUI.Samples/Tizen.NUI.Samples/res/images/FrameUpdateCallbackTest/launcher_bg_06_nor.png diff --git a/test/Tizen.NUI.Samples/Tizen.NUI.Samples/res/images/FrameCallbackTest/launcher_bg_apps_nor.png b/test/Tizen.NUI.Samples/Tizen.NUI.Samples/res/images/FrameUpdateCallbackTest/launcher_bg_apps_nor.png similarity index 100% rename from test/Tizen.NUI.Samples/Tizen.NUI.Samples/res/images/FrameCallbackTest/launcher_bg_apps_nor.png rename to test/Tizen.NUI.Samples/Tizen.NUI.Samples/res/images/FrameUpdateCallbackTest/launcher_bg_apps_nor.png diff --git a/test/Tizen.NUI.Samples/Tizen.NUI.Samples/res/images/FrameCallbackTest/launcher_ic_apps_nor.png b/test/Tizen.NUI.Samples/Tizen.NUI.Samples/res/images/FrameUpdateCallbackTest/launcher_ic_apps_nor.png similarity index 100% rename from test/Tizen.NUI.Samples/Tizen.NUI.Samples/res/images/FrameCallbackTest/launcher_ic_apps_nor.png rename to test/Tizen.NUI.Samples/Tizen.NUI.Samples/res/images/FrameUpdateCallbackTest/launcher_ic_apps_nor.png diff --git a/test/Tizen.NUI.Samples/Tizen.NUI.Samples/res/images/FrameCallbackTest/launcher_ic_culinary_nor.png b/test/Tizen.NUI.Samples/Tizen.NUI.Samples/res/images/FrameUpdateCallbackTest/launcher_ic_culinary_nor.png similarity index 100% rename from test/Tizen.NUI.Samples/Tizen.NUI.Samples/res/images/FrameCallbackTest/launcher_ic_culinary_nor.png rename to test/Tizen.NUI.Samples/Tizen.NUI.Samples/res/images/FrameUpdateCallbackTest/launcher_ic_culinary_nor.png diff --git a/test/Tizen.NUI.Samples/Tizen.NUI.Samples/res/images/FrameCallbackTest/launcher_ic_ent_nor.png b/test/Tizen.NUI.Samples/Tizen.NUI.Samples/res/images/FrameUpdateCallbackTest/launcher_ic_ent_nor.png similarity index 100% rename from test/Tizen.NUI.Samples/Tizen.NUI.Samples/res/images/FrameCallbackTest/launcher_ic_ent_nor.png rename to test/Tizen.NUI.Samples/Tizen.NUI.Samples/res/images/FrameUpdateCallbackTest/launcher_ic_ent_nor.png diff --git a/test/Tizen.NUI.Samples/Tizen.NUI.Samples/res/images/FrameCallbackTest/launcher_ic_family_nor.png b/test/Tizen.NUI.Samples/Tizen.NUI.Samples/res/images/FrameUpdateCallbackTest/launcher_ic_family_nor.png similarity index 100% rename from test/Tizen.NUI.Samples/Tizen.NUI.Samples/res/images/FrameCallbackTest/launcher_ic_family_nor.png rename to test/Tizen.NUI.Samples/Tizen.NUI.Samples/res/images/FrameUpdateCallbackTest/launcher_ic_family_nor.png diff --git a/test/Tizen.NUI.Samples/Tizen.NUI.Samples/res/images/FrameCallbackTest/launcher_ic_homecare_nor.png b/test/Tizen.NUI.Samples/Tizen.NUI.Samples/res/images/FrameUpdateCallbackTest/launcher_ic_homecare_nor.png similarity index 100% rename from test/Tizen.NUI.Samples/Tizen.NUI.Samples/res/images/FrameCallbackTest/launcher_ic_homecare_nor.png rename to test/Tizen.NUI.Samples/Tizen.NUI.Samples/res/images/FrameUpdateCallbackTest/launcher_ic_homecare_nor.png diff --git a/test/Tizen.NUI.Samples/Tizen.NUI.Samples/res/images/FrameCallbackTest/launcher_ic_internet_nor.png b/test/Tizen.NUI.Samples/Tizen.NUI.Samples/res/images/FrameUpdateCallbackTest/launcher_ic_internet_nor.png similarity index 100% rename from test/Tizen.NUI.Samples/Tizen.NUI.Samples/res/images/FrameCallbackTest/launcher_ic_internet_nor.png rename to test/Tizen.NUI.Samples/Tizen.NUI.Samples/res/images/FrameUpdateCallbackTest/launcher_ic_internet_nor.png diff --git a/test/Tizen.NUI.Samples/Tizen.NUI.Samples/res/images/FrameCallbackTest/launcher_ic_logo_amazon_nor.png b/test/Tizen.NUI.Samples/Tizen.NUI.Samples/res/images/FrameUpdateCallbackTest/launcher_ic_logo_amazon_nor.png similarity index 100% rename from test/Tizen.NUI.Samples/Tizen.NUI.Samples/res/images/FrameCallbackTest/launcher_ic_logo_amazon_nor.png rename to test/Tizen.NUI.Samples/Tizen.NUI.Samples/res/images/FrameUpdateCallbackTest/launcher_ic_logo_amazon_nor.png diff --git a/test/Tizen.NUI.Samples/Tizen.NUI.Samples/res/images/FrameCallbackTest/launcher_ic_settings_nor.png b/test/Tizen.NUI.Samples/Tizen.NUI.Samples/res/images/FrameUpdateCallbackTest/launcher_ic_settings_nor.png similarity index 100% rename from test/Tizen.NUI.Samples/Tizen.NUI.Samples/res/images/FrameCallbackTest/launcher_ic_settings_nor.png rename to test/Tizen.NUI.Samples/Tizen.NUI.Samples/res/images/FrameUpdateCallbackTest/launcher_ic_settings_nor.png diff --git a/test/Tizen.NUI.Samples/Tizen.NUI.Samples/res/images/FrameCallbackTest/launcher_ic_timer_nor.png b/test/Tizen.NUI.Samples/Tizen.NUI.Samples/res/images/FrameUpdateCallbackTest/launcher_ic_timer_nor.png similarity index 100% rename from test/Tizen.NUI.Samples/Tizen.NUI.Samples/res/images/FrameCallbackTest/launcher_ic_timer_nor.png rename to test/Tizen.NUI.Samples/Tizen.NUI.Samples/res/images/FrameUpdateCallbackTest/launcher_ic_timer_nor.png diff --git a/test/Tizen.NUI.Samples/Tizen.NUI.Samples/res/images/FrameCallbackTest/launcher_ic_viewinside_nor.png b/test/Tizen.NUI.Samples/Tizen.NUI.Samples/res/images/FrameUpdateCallbackTest/launcher_ic_viewinside_nor.png similarity index 100% rename from test/Tizen.NUI.Samples/Tizen.NUI.Samples/res/images/FrameCallbackTest/launcher_ic_viewinside_nor.png rename to test/Tizen.NUI.Samples/Tizen.NUI.Samples/res/images/FrameUpdateCallbackTest/launcher_ic_viewinside_nor.png