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>
[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>
[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>
{
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.
base.Dispose(type);
- tlog.Fatal(tag, $"]VAV END]");
+ tlog.Fatal(tag, $"]VAV END]");
}
#endregion Constructor, Distructor, Dispose
{
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.
{
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;
}
{
set
{
- tlog.Fatal(tag, $"[VAV START[ [{GetId()}] CurrentFrame SET");
+ tlog.Fatal(tag, $"[VAV START[ [{GetId()}] CurrentFrame SET");
if (mResourceURL == null || mResourceURL == String.Empty)
{
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;
}
{
set
{
- tlog.Fatal(tag, $"[VAV START[ [{GetId()}] RepeatMode SET");
+ tlog.Fatal(tag, $"[VAV START[ [{GetId()}] RepeatMode SET");
mRepeatMode = value;
switch (mRepeatMode)
break;
}
- tlog.Fatal(tag, $" [{GetId()}] mRepeatMode={mRepeatMode}) ]VAV END]");
+ tlog.Fatal(tag, $" [{GetId()}] mRepeatMode={mRepeatMode}) ]VAV END]");
}
get => mRepeatMode;
}
[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)
{
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>
[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
base.Play();
AnimationState = AnimationStates.Playing;
- tlog.Fatal(tag, $" [{GetId()}] mIsMinMaxSet={mIsMinMaxSet}) ]VAV END]");
+ tlog.Fatal(tag, $" [{GetId()}] mIsMinMaxSet={mIsMinMaxSet}) ]VAV END]");
}
/// <summary>
[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)
{
base.Pause();
AnimationState = AnimationStates.Paused;
- tlog.Fatal(tag, $" [{GetId()}] ]VAV END]");
+ tlog.Fatal(tag, $" [{GetId()}] ]VAV END]");
}
/// <summary>
[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)
{
StopBehavior = StopBehaviorType.MaximumFrame;
break;
default:
- tlog.Fatal(tag, $" [{GetId()}] no endAction : default set");
+ tlog.Fatal(tag, $" [{GetId()}] no endAction : default set");
break;
}
}
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
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