[NUI] Fix SetMinMaxFrameByMarker()'s not working issue in AnimatedVectorImageView...
authordongsug-song <35130733+dongsug-song@users.noreply.github.com>
Fri, 10 Jan 2020 04:25:31 +0000 (13:25 +0900)
committerGitHub <noreply@github.com>
Fri, 10 Jan 2020 04:25:31 +0000 (13:25 +0900)
src/Tizen.NUI/src/public/BaseComponents/AnimatedVectorImageView.cs
src/Tizen.NUI/src/public/BaseComponents/LottieAnimationView.cs
test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/AnimatedVectorImageViewTest.cs [new file with mode: 0755]

index 5ef4c82..a0efb42 100755 (executable)
 
 using global::System;
 using System.ComponentModel;
-#if (NUI_DEBUG_ON)
-using tlog = Tizen.Log;
-#endif
 
 namespace Tizen.NUI.BaseComponents
 {
+    #if (NUI_DEBUG_ON)
+    using tlog = Tizen.Log;
+    #endif
+
     /// <summary>
     /// AnimatedVectorImageView is a class for displaying a vector resource.
     /// </summary>
@@ -38,7 +39,7 @@ namespace Tizen.NUI.BaseComponents
         [EditorBrowsable(EditorBrowsableState.Never)]
         public AnimatedVectorImageView() : base()
         {
-            tlog.Fatal(tag,  $"[VAV START[ constuctor objId={GetId()} ]VAV END]");
+            tlog.Fatal(tag, $"[VAV START[ constuctor objId={GetId()} ]VAV END]");
         }
 
         /// <summary>
@@ -49,7 +50,7 @@ namespace Tizen.NUI.BaseComponents
         [EditorBrowsable(EditorBrowsableState.Never)]
         public AnimatedVectorImageView(float scale) : base(scale)
         {
-            tlog.Fatal(tag,  $"[VAV START[ constuctor scale={scale}) objId={GetId()} ]VAV END]");
+            tlog.Fatal(tag, $"[VAV START[ constuctor scale={scale}) objId={GetId()} ]VAV END]");
         }
 
         /// <summary>
@@ -64,7 +65,7 @@ namespace Tizen.NUI.BaseComponents
             {
                 return;
             }
-            tlog.Fatal(tag,  $"[VAV START[ [{GetId()}] type={type})");
+            tlog.Fatal(tag, $"[VAV START[ [{GetId()}] type={type})");
 
             //Release your own unmanaged resources here.
             //You should not access any managed member here except static instance.
@@ -72,7 +73,7 @@ namespace Tizen.NUI.BaseComponents
 
             base.Dispose(type);
 
-            tlog.Fatal(tag,  $"]VAV END]");
+            tlog.Fatal(tag, $"]VAV END]");
         }
         #endregion Constructor, Distructor, Dispose
 
@@ -87,23 +88,44 @@ namespace Tizen.NUI.BaseComponents
         {
             set
             {
-                tlog.Fatal(tag,  $"[VAV START[ [{GetId()}] ResourceURL SET");
+                tlog.Fatal(tag, $"[VAV START[ [{GetId()}] ResourceURL SET");
 
                 if (value == mResourceURL)
                 {
-                    tlog.Fatal(tag,  $"set same URL! ");
+                    tlog.Fatal(tag, $"set same URL! ");
                     return;
                 }
                 mResourceURL = (value == null) ? "" : value;
                 URL = mResourceURL;
-                mIsMinMaxSet = false;
+                mIsMinMaxSet = minMaxSetTypes.NotSetByUser;
                 mTotalFrameNum = base.TotalFrame;
-                tlog.Fatal(tag,  $" [{GetId()}] mResourceURL={mResourceURL}) ]VAV END]");
+                tlog.Fatal(tag, $" [{GetId()}] mResourceURL={mResourceURL}) ]VAV END]");
             }
             get => mResourceURL;
         }
 
         /// <summary>
+        /// Set Resource URL
+        /// </summary>
+        // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public new string ResourceUrl
+        {
+            set
+            {
+                tlog.Fatal(tag, $"[VAV START[ [{GetId()}] ResourceUrl SET");
+                this.ResourceURL = value;
+                tlog.Fatal(tag, $" [{GetId()}] value={value}) ]VAV END]");
+            }
+            get
+            {
+                tlog.Fatal(tag, $"[VAV [ [{GetId()}] ResourceUrl GET");
+                return this.ResourceURL;
+            }
+        }
+
+
+        /// <summary>
         /// RepeatCount of animation.
         /// The repeat count is 0 by default.
         /// If the RepeatCount is 0, the animation is never repeated.
@@ -116,12 +138,12 @@ namespace Tizen.NUI.BaseComponents
         {
             set
             {
-                tlog.Fatal(tag,  $"[VAV START[ [{GetId()}] RepeatCount SET");
+                tlog.Fatal(tag, $"[VAV START[ [{GetId()}] RepeatCount SET");
 
                 mRepeatCount = (value < -1) ? -1 : value;
                 LoopCount = (mRepeatCount < 0) ? mRepeatCount : mRepeatCount + 1;
 
-                tlog.Fatal(tag,  $"[{GetId()}] mRepeatCount={mRepeatCount} ]VAV END]");
+                tlog.Fatal(tag, $"[{GetId()}] mRepeatCount={mRepeatCount} ]VAV END]");
             }
             get => mRepeatCount;
         }
@@ -146,7 +168,7 @@ namespace Tizen.NUI.BaseComponents
         {
             set
             {
-                tlog.Fatal(tag,  $"[VAV START[ [{GetId()}] CurrentFrame SET");
+                tlog.Fatal(tag, $"[VAV START[ [{GetId()}] CurrentFrame SET");
 
                 if (mResourceURL == null || mResourceURL == String.Empty)
                 {
@@ -165,10 +187,10 @@ namespace Tizen.NUI.BaseComponents
                 mCurrentFrame = value;
                 AnimationState = AnimationStates.Paused;
 
-                SetMinMaxFrame(0, mTotalFrameNum - 1);
+                base.SetMinMaxFrame(0, mTotalFrameNum - 1);
                 base.CurrentFrame = mCurrentFrame;
 
-                tlog.Fatal(tag,  $" [{GetId()}] mCurrentFrame={mCurrentFrame}) ]VAV END]");
+                tlog.Fatal(tag, $" [{GetId()}] mCurrentFrame={mCurrentFrame}) ]VAV END]");
             }
             get => mCurrentFrame;
         }
@@ -182,7 +204,7 @@ namespace Tizen.NUI.BaseComponents
         {
             set
             {
-                tlog.Fatal(tag,  $"[VAV START[ [{GetId()}] RepeatMode SET");
+                tlog.Fatal(tag, $"[VAV START[ [{GetId()}] RepeatMode SET");
                 mRepeatMode = value;
 
                 switch (mRepeatMode)
@@ -198,7 +220,7 @@ namespace Tizen.NUI.BaseComponents
                         break;
                 }
 
-                tlog.Fatal(tag,  $" [{GetId()}] mRepeatMode={mRepeatMode}) ]VAV END]");
+                tlog.Fatal(tag, $" [{GetId()}] mRepeatMode={mRepeatMode}) ]VAV END]");
             }
             get => mRepeatMode;
         }
@@ -226,11 +248,11 @@ namespace Tizen.NUI.BaseComponents
         [EditorBrowsable(EditorBrowsableState.Never)]
         public void SetMinAndMaxFrame(int minFrame, int maxFrame)
         {
-            tlog.Fatal(tag,  $"[VAV START[ [{GetId()}] SetMinAndMaxFrame({minFrame}, {maxFrame})");
+            tlog.Fatal(tag, $"[VAV START[ [{GetId()}] SetMinAndMaxFrame({minFrame}, {maxFrame})");
 
             mMinFrame = (minFrame) > 0 ? minFrame : 0;
             mMaxFrame = (maxFrame) > 0 ? maxFrame : 0;
-            mIsMinMaxSet = true;
+            mIsMinMaxSet = minMaxSetTypes.SetByMinAndMaxFrameMethod;
 
             if (mMinFrame >= mTotalFrameNum)
             {
@@ -247,7 +269,51 @@ namespace Tizen.NUI.BaseComponents
                 return;
             }
 
-            tlog.Fatal(tag,  $" [{GetId()}] mMinFrame:{mMinFrame}, mMaxFrame:{mMaxFrame}) ]VAV END]");
+            tlog.Fatal(tag, $" [{GetId()}] mMinFrame:{mMinFrame}, mMaxFrame:{mMaxFrame}) ]VAV END]");
+        }
+
+        /// <summary>
+        /// SetMinMaxFrame(int startFrame, int endFrame)
+        /// </summary>
+        /// <param name="minFrame"></param>
+        /// <param name="maxFrame"></param>
+        // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public new void SetMinMaxFrame(int minFrame, int maxFrame)
+        {
+            tlog.Fatal(tag, $"SetMinMaxFrame({minFrame}, {maxFrame})!!!");
+
+            mMinFrame = (minFrame) > 0 ? minFrame : 0;
+            mMaxFrame = (maxFrame) > 0 ? maxFrame : 0;
+            mIsMinMaxSet = minMaxSetTypes.SetByBaseSetMinMaxFrameMethod;
+
+            if (mMinFrame >= mTotalFrameNum)
+            {
+                mMinFrame = mTotalFrameNum - 1;
+            }
+
+            if (mMaxFrame >= mTotalFrameNum)
+            {
+                mMaxFrame = mTotalFrameNum - 1;
+            }
+
+            base.SetMinMaxFrame(mMinFrame, mMaxFrame);
+        }
+
+        /// <summary>
+        /// A marker has its start frame and end frame. 
+        /// Animation will play between the start frame and the end frame of the marker if one marker is specified.
+        /// Or animation will play between the start frame of the first marker and the end frame of the second marker if two markers are specified.   *
+        /// </summary>
+        /// <param name="marker1">First marker</param>
+        /// <param name="marker2">Second marker</param>
+        // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public new void SetMinMaxFrameByMarker(string marker1, string marker2 = null)
+        {
+            tlog.Fatal(tag, $"SetMinMaxFrameByMarker({marker1}, {marker2})");
+            mIsMinMaxSet = minMaxSetTypes.SetByMarker;
+            base.SetMinMaxFrameByMarker(marker1, marker2);
         }
 
         /// <summary>
@@ -257,22 +323,30 @@ namespace Tizen.NUI.BaseComponents
         [EditorBrowsable(EditorBrowsableState.Never)]
         public new void Play()
         {
-            tlog.Fatal(tag,  $"[VAV START[ [{GetId()}] AnimationState={AnimationState}, PlayState={PlayState}");
+            tlog.Fatal(tag, $"[VAV START[ [{GetId()}] AnimationState={AnimationState}, PlayState={PlayState}");
 
             if (mResourceURL == null || mResourceURL == String.Empty)
             {
                 throw new InvalidOperationException("Resource Url not yet Set");
             }
 
-            if (mIsMinMaxSet)
-            {
-                SetMinMaxFrame(mMinFrame, mMaxFrame);
-                base.CurrentFrame = mMinFrame;
-            }
-            else
+            switch (mIsMinMaxSet)
             {
-                SetMinMaxFrame(0, mTotalFrameNum - 1);
-                base.CurrentFrame = 0;
+                case minMaxSetTypes.NotSetByUser:
+                    base.SetMinMaxFrame(0, mTotalFrameNum - 1);
+                    base.CurrentFrame = 0;
+                    break;
+
+                case minMaxSetTypes.SetByMinAndMaxFrameMethod:
+                    base.SetMinMaxFrame(mMinFrame, mMaxFrame);
+                    base.CurrentFrame = mMinFrame;
+                    break;
+
+                case minMaxSetTypes.SetByMarker:
+                case minMaxSetTypes.SetByBaseSetMinMaxFrameMethod:
+                default:
+                    //do nothing!
+                    break;
             }
 
             //temporal fix
@@ -282,7 +356,7 @@ namespace Tizen.NUI.BaseComponents
             base.Play();
             AnimationState = AnimationStates.Playing;
 
-            tlog.Fatal(tag,  $" [{GetId()}] mIsMinMaxSet={mIsMinMaxSet}) ]VAV END]");
+            tlog.Fatal(tag, $" [{GetId()}] mIsMinMaxSet={mIsMinMaxSet}) ]VAV END]");
         }
 
         /// <summary>
@@ -292,7 +366,7 @@ namespace Tizen.NUI.BaseComponents
         [EditorBrowsable(EditorBrowsableState.Never)]
         public new void Pause()
         {
-            tlog.Fatal(tag,  $"[VAV START[ [{GetId()}] AnimationState={AnimationState}, PlayState={PlayState}");
+            tlog.Fatal(tag, $"[VAV START[ [{GetId()}] AnimationState={AnimationState}, PlayState={PlayState}");
 
             if (mResourceURL == null || mResourceURL == String.Empty)
             {
@@ -302,7 +376,7 @@ namespace Tizen.NUI.BaseComponents
             base.Pause();
             AnimationState = AnimationStates.Paused;
 
-            tlog.Fatal(tag,  $" [{GetId()}] ]VAV END]");
+            tlog.Fatal(tag, $" [{GetId()}] ]VAV END]");
         }
 
         /// <summary>
@@ -317,7 +391,7 @@ namespace Tizen.NUI.BaseComponents
         [EditorBrowsable(EditorBrowsableState.Never)]
         public void Stop(EndActions endAction = EndActions.Cancel)
         {
-            tlog.Fatal(tag,  $"[VAV START[ [{GetId()}] endAction:({endAction}), PlayState={PlayState}");
+            tlog.Fatal(tag, $"[VAV START[ [{GetId()}] endAction:({endAction}), PlayState={PlayState}");
 
             if (mResourceURL == null || mResourceURL == String.Empty)
             {
@@ -344,7 +418,7 @@ namespace Tizen.NUI.BaseComponents
                         StopBehavior = StopBehaviorType.MaximumFrame;
                         break;
                     default:
-                        tlog.Fatal(tag,  $" [{GetId()}] no endAction : default set");
+                        tlog.Fatal(tag, $" [{GetId()}] no endAction : default set");
                         break;
                 }
             }
@@ -354,27 +428,33 @@ namespace Tizen.NUI.BaseComponents
 
             if (endAction == EndActions.StopFinal)
             {
-                if (mIsMinMaxSet)
+                switch (mIsMinMaxSet)
                 {
-                    if (base.CurrentFrame != mMaxFrame)
-                    {
-                        tlog.Fatal(tag,  $"mIsMinMaxSet:{mIsMinMaxSet}, CurrentFrameNumber:{base.CurrentFrame}, mMaxFrame:{ mMaxFrame}");
-                        base.CurrentFrame = mMaxFrame;
-                        tlog.Fatal(tag,  $"set CurrentFrameNumber({base.CurrentFrame}) as mMaxFrame({mMaxFrame})!!!");
-                    }
-                }
-                else
-                {
-                    if (base.CurrentFrame != mTotalFrameNum - 1)
-                    {
-                        tlog.Fatal(tag,  $"mIsMinMaxSet:{mIsMinMaxSet}, CurrentFrameNumber:{base.CurrentFrame}, mTotalFrameNum:{ mTotalFrameNum}");
-                        base.CurrentFrame = mTotalFrameNum - 1;
-                        tlog.Fatal(tag,  $"set CurrentFrameNumber({base.CurrentFrame}) as mTotalFrameNum({mMaxFrame}) - 1 !");
-                    }
+                    case minMaxSetTypes.NotSetByUser:
+                        if (base.CurrentFrame != mTotalFrameNum - 1)
+                        {
+                            tlog.Fatal(tag, $"mIsMinMaxSet:{mIsMinMaxSet}, CurrentFrameNumber:{base.CurrentFrame}, mTotalFrameNum:{ mTotalFrameNum}");
+                            base.CurrentFrame = mTotalFrameNum - 1;
+                            tlog.Fatal(tag, $"set CurrentFrameNumber({base.CurrentFrame}) as mTotalFrameNum({mMaxFrame}) - 1 !");
+                        }
+                        break;
+
+                    case minMaxSetTypes.SetByMinAndMaxFrameMethod:
+                        if (base.CurrentFrame != mMaxFrame)
+                        {
+                            tlog.Fatal(tag, $"mIsMinMaxSet:{mIsMinMaxSet}, CurrentFrameNumber:{base.CurrentFrame}, mMaxFrame:{ mMaxFrame}");
+                            base.CurrentFrame = mMaxFrame;
+                            tlog.Fatal(tag, $"set CurrentFrameNumber({base.CurrentFrame}) as mMaxFrame({mMaxFrame})!!!");
+                        }
+                        break;
+                    case minMaxSetTypes.SetByBaseSetMinMaxFrameMethod:
+                    case minMaxSetTypes.SetByMarker:
+                    default:
+                        //do nothing!
+                        break;
                 }
             }
-
-            tlog.Fatal(tag,  $" [{GetId()}] ]VAV END]");
+            tlog.Fatal(tag, $" [{GetId()}] ]VAV END]");
         }
         #endregion Method
 
@@ -455,9 +535,16 @@ namespace Tizen.NUI.BaseComponents
         private int mTotalFrameNum = 0;
         private RepeatModes mRepeatMode = RepeatModes.Restart;
         private int mMinFrame = -1, mMaxFrame = -1;
-        private bool mIsMinMaxSet = false;
+        private minMaxSetTypes mIsMinMaxSet = minMaxSetTypes.NotSetByUser;
         private int mCurrentFrame = -1;
         private EndActions mEndAction = EndActions.Cancel;
+        private enum minMaxSetTypes
+        {
+            NotSetByUser,
+            SetByMinAndMaxFrameMethod,
+            SetByMarker,
+            SetByBaseSetMinMaxFrameMethod,
+        }
 
         private string tag = "NUITEST";
         #endregion Private
index e12f6bc..a38a43b 100755 (executable)
@@ -20,12 +20,12 @@ using global::System.Runtime.InteropServices;
 using System.ComponentModel;
 using System.Collections.Generic;
 
-#if (NUI_DEBUG_ON)
-using tlog = Tizen.Log;
-#endif
-
 namespace Tizen.NUI.BaseComponents
 {
+    #if (NUI_DEBUG_ON)
+    using tlog = Tizen.Log;
+    #endif
+
     /// <summary>
     /// LottieAnimationView renders an animated vector image (Lottie file).
     /// </summary>
@@ -172,11 +172,13 @@ namespace Tizen.NUI.BaseComponents
                         {
                             currentStates.playState = (PlayStateType)ret;
                             tlog.Fatal(tag, $"gotten play state={ret} >");
-                            return currentStates.playState;
                         }
                     }
                 }
-                Tizen.Log.Error(tag, $"<[ERROR][{GetId()}]Fail to get PlayState from dali currentStates.playState={currentStates.playState}>");
+                else
+                {
+                    Tizen.Log.Error(tag, $"<[ERROR][{GetId()}]Fail to get PlayState from dali currentStates.playState={currentStates.playState}>");
+                }
                 return currentStates.playState;
             }
         }
@@ -485,6 +487,7 @@ namespace Tizen.NUI.BaseComponents
                 {
                     if (val.Get(contentMap))
                     {
+                        currentStates.contentInfo = new List<Tuple<string, int, int>>();
                         for (uint i = 0; i < contentMap.Count(); i++)
                         {
                             string key = contentMap.GetKeyAt(i).StringKey;
@@ -539,6 +542,57 @@ namespace Tizen.NUI.BaseComponents
             DoAction(vectorImageVisualIndex, (int)actionType.updateProperty, new PropertyValue(map));
             tlog.Fatal(tag, $"  [{GetId()}] currentStates.mark1:{currentStates.mark1}, mark2:{currentStates.mark2} >");
         }
+
+        /// <summary>
+        /// Get MinMax Frame
+        /// </summary>
+        /// <returns>Tuple of Min and Max frames</returns>
+        // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public Tuple<int, int> GetMinMaxFrame()
+        {
+            tlog.Fatal(tag, $"< [{GetId()}] GetMinMaxFrame()! total frame={currentStates.totalFrame}");
+
+            PropertyMap map = Image;
+            if (map != null)
+            {
+                PropertyValue val = map.Find(ImageVisualProperty.PlayRange);
+                if (val != null)
+                {
+                    PropertyArray array = new PropertyArray();
+                    if (val.Get(array))
+                    {
+                        uint cnt = array.Count();
+                        int item1 = -1, item2 = -1;
+                        for (uint i = 0; i < cnt; i++)
+                        {
+                            PropertyValue v = array.GetElementAt(i);
+                            int intRet;
+                            if (v.Get(out intRet))
+                            {
+                                tlog.Fatal(tag, $"Got play range of string [{i}]: {intRet}");
+                                if (i == 0)
+                                {
+                                    item1 = intRet;
+                                }
+                                else if (i == 1)
+                                {
+                                    item2 = intRet;
+                                }
+                            }
+                            else
+                            {
+                                Tizen.Log.Error("NUI", $"[ERR] fail to get play range from dali! case#1");
+                            }
+                        }
+                        tlog.Fatal(tag, $"  [{GetId()}] GetMinMaxFrame(min:{item1}, max:{item2})! >");
+                        return new Tuple<int, int>(item1, item2);
+                    }
+                }
+            }
+            Tizen.Log.Error("NUI", $"[ERR] fail to get play range from dali! case#2");
+            return new Tuple<int, int>(-1, -1);
+        }
         #endregion Method
 
 
diff --git a/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/AnimatedVectorImageViewTest.cs b/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/AnimatedVectorImageViewTest.cs
new file mode 100755 (executable)
index 0000000..1a8d30d
--- /dev/null
@@ -0,0 +1,168 @@
+using System;
+using Tizen.NUI;
+using Tizen.NUI.BaseComponents;
+
+namespace Tizen.NUI.Samples
+{
+    public class AnimatedVectorImageViewTest : IExample
+    {
+        Window win;
+        AnimatedVectorImageView avi, avi2, avi3, avi4, avi5, avi6;
+        public void Activate()
+        {
+            Tizen.Log.Fatal("NUITEST", $"###Activate()");
+            win = Window.Instance;
+            win.BackgroundColor = Color.Green;
+            win.KeyEvent += Win_KeyEvent;
+
+            avi = new AnimatedVectorImageView();
+            avi.ResourceURL = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "images/marker.json";
+            avi.RepeatCount = -1;
+            avi.BackgroundColor = Color.White;
+            avi.Position2D = new Position2D(50, 10);
+            avi.Size2D = new Size2D(500, 500);
+            Window.Instance.GetDefaultLayer().Add(avi);
+            avi.Play();
+
+            avi2 = new AnimatedVectorImageView();
+            avi2.ResourceURL = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "images/marker.json";
+            avi2.RepeatCount = -1;
+            avi2.BackgroundColor = Color.White;
+            avi2.Position2D = new Position2D(600, 10);
+            avi2.Size2D = new Size2D(500, 500);
+            avi2.SetMinMaxFrameByMarker("first");
+            Window.Instance.GetDefaultLayer().Add(avi2);
+            avi2.Play();
+
+            avi3 = new AnimatedVectorImageView();
+            avi3.ResourceURL = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "images/marker.json";
+            avi3.RepeatCount = -1;
+            avi3.BackgroundColor = Color.White;
+            avi3.Position2D = new Position2D(1150, 10);
+            avi3.Size2D = new Size2D(500, 500);
+            avi3.SetMinMaxFrameByMarker("second", "third");
+            Window.Instance.GetDefaultLayer().Add(avi3);
+            avi3.Play();
+
+            avi4 = new AnimatedVectorImageView();
+            avi4.ResourceURL = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "images/marker.json";
+            avi4.RepeatCount = -1;
+            avi4.BackgroundColor = Color.White;
+            avi4.Position2D = new Position2D(50, 550);
+            avi4.Size2D = new Size2D(500, 500);
+            avi4.SetMinMaxFrameByMarker("second");
+            Window.Instance.GetDefaultLayer().Add(avi4);
+            avi4.Play();
+
+            avi5 = new AnimatedVectorImageView();
+            avi5.ResourceURL = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "images/marker.json";
+            avi5.RepeatCount = -1;
+            avi5.BackgroundColor = Color.White;
+            avi5.Position2D = new Position2D(600, 550);
+            avi5.Size2D = new Size2D(500, 500);
+            avi5.SetMinMaxFrameByMarker("third");
+            Window.Instance.GetDefaultLayer().Add(avi5);
+            avi5.Play();
+
+            avi6 = new AnimatedVectorImageView();
+            avi6.ResourceURL = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "images/marker.json";
+            avi6.RepeatCount = -1;
+            avi6.BackgroundColor = Color.White;
+            avi6.Position2D = new Position2D(1150, 550);
+            avi6.Size2D = new Size2D(500, 500);
+            avi6.SetMinMaxFrameByMarker("third", "first");
+            Window.Instance.GetDefaultLayer().Add(avi6);
+            avi6.Play();
+
+        }
+        public void Deactivate()
+        {
+            win.KeyEvent -= Win_KeyEvent;
+
+            Window.Instance.GetDefaultLayer().Remove(avi);
+            Window.Instance.GetDefaultLayer().Remove(avi2);
+            Window.Instance.GetDefaultLayer().Remove(avi3);
+            Window.Instance.GetDefaultLayer().Remove(avi4);
+            Window.Instance.GetDefaultLayer().Remove(avi5);
+            Window.Instance.GetDefaultLayer().Remove(avi6);
+        }
+
+        private void Win_KeyEvent(object sender, Window.KeyEventArgs e)
+        {
+            if (e.Key.State == Key.StateType.Down)
+            {
+                if (e.Key.KeyPressedName == "1")
+                {
+                    var l = avi.GetContentInfo();
+                    foreach (var iter in l)
+                    {
+                        Tizen.Log.Fatal("NUITEST", $"content [{iter.Item1}, {iter.Item2}, {iter.Item3}]");
+                    }
+                }
+                else if (e.Key.KeyPressedName == "2")
+                {
+                    avi2.SetMinAndMaxFrame(0, 1000);
+                }
+                else if (e.Key.KeyPressedName == "3")
+                {
+                    avi3.SetMinMaxFrameByMarker("first", "second");
+                }
+                else if (e.Key.KeyPressedName == "4")
+                {
+                    avi6.SetMinMaxFrameByMarker("second", "third");
+                }
+                else if (e.Key.KeyPressedName == "5")
+                {
+                    avi6.SetMinMaxFrameByMarker("first", "second");
+                }
+                else if (e.Key.KeyPressedName == "6")
+                {
+                    avi6.SetMinMaxFrame(0, 1000);
+                }
+                else if (e.Key.KeyPressedName == "7")
+                {
+                    avi.Stop(AnimatedVectorImageView.EndActions.Discard);
+                    avi2.Stop(AnimatedVectorImageView.EndActions.Discard);
+                    avi3.Stop(AnimatedVectorImageView.EndActions.Discard);
+                    avi4.Stop(AnimatedVectorImageView.EndActions.Discard);
+                    avi5.Stop(AnimatedVectorImageView.EndActions.Discard);
+                    avi6.Stop(AnimatedVectorImageView.EndActions.Discard);
+                }
+                else if (e.Key.KeyPressedName == "8")
+                {
+                    avi.Stop(AnimatedVectorImageView.EndActions.StopFinal);
+                    avi2.Stop(AnimatedVectorImageView.EndActions.StopFinal);
+                    avi3.Stop(AnimatedVectorImageView.EndActions.StopFinal);
+                    avi4.Stop(AnimatedVectorImageView.EndActions.StopFinal);
+                    avi5.Stop(AnimatedVectorImageView.EndActions.StopFinal);
+                    avi6.Stop(AnimatedVectorImageView.EndActions.StopFinal);
+                }
+                else if (e.Key.KeyPressedName == "9")
+                {
+                    avi.Play();
+                    avi2.Play();
+                    avi3.Play();
+                    avi4.Play();
+                    avi5.Play();
+                    avi6.Play();
+                }
+                else if (e.Key.KeyPressedName == "0")
+                {
+                    Tizen.Log.Fatal("NUITEST", $"get MinMaxFrame() !");
+                    var temp = avi.GetMinMaxFrame();
+                    Tizen.Log.Fatal("NUITEST", $"avi min={temp.Item1}, max={temp.Item2}");
+                    temp = avi2.GetMinMaxFrame();
+                    Tizen.Log.Fatal("NUITEST", $"avi2 min={temp.Item1}, max={temp.Item2}");
+                    temp = avi3.GetMinMaxFrame();
+                    Tizen.Log.Fatal("NUITEST", $"avi3 min={temp.Item1}, max={temp.Item2}");
+                    temp = avi4.GetMinMaxFrame();
+                    Tizen.Log.Fatal("NUITEST", $"avi4 min={temp.Item1}, max={temp.Item2}");
+                    temp = avi5.GetMinMaxFrame();
+                    Tizen.Log.Fatal("NUITEST", $"avi5 min={temp.Item1}, max={temp.Item2}");
+                    temp = avi6.GetMinMaxFrame();
+                    Tizen.Log.Fatal("NUITEST", $"avi6 min={temp.Item1}, max={temp.Item2}");
+                }
+            }
+        }
+    }
+}