2 * Copyright(c) 2019 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
21 using System.ComponentModel;
22 using System.Runtime.InteropServices;
23 using Tizen.NUI.BaseComponents;
25 using System.Collections;
26 using System.Collections.Generic;
28 using System.Reflection;
30 using Tizen.NUI.Binding.Internals;
31 using Tizen.NUI.Binding;
32 using System.Globalization;
33 using Tizen.NUI.Xaml.Internals;
36 /// Animation can be used to animate the properties of any number of objects, typically view.<br />
37 /// If the "Finished" event is connected to a member function of an object, it must be disconnected before the object is destroyed.<br />
38 /// This is typically done in the object destructor, and requires either the animation handle to be stored.<br />
39 /// The overall animation time is superseded by the values given in the animation time used when calling the AnimateTo(), AnimateBy(), AnimateBetween() and AnimatePath() methods.<br />
40 /// If any of the individual calls to those functions exceeds the overall animation time (Duration), then the overall animation time is automatically extended.<br />
42 /// <since_tizen> 3 </since_tizen>
43 public class Animation : BaseHandle
45 private static bool? disableAnimation = null;
48 private AnimationFinishedEventCallbackType _animationFinishedEventCallback;
49 private System.IntPtr _finishedCallbackOfNative;
51 private AnimationProgressReachedEventCallbackType _animationProgressReachedEventCallback;
53 private string[] _properties = null;
54 private string[] _destValue = null;
55 private int[] _startTime = null;
56 private int[] _endTime = null;
59 /// Creates an initialized animation.<br />
60 /// The animation will not loop.<br />
61 /// The default end action is "Cancel".<br />
62 /// The default alpha function is linear.<br />
64 /// <remarks>DurationmSeconds must be greater than zero.</remarks>
65 /// <param name="durationMilliSeconds">The duration in milliseconds.</param>
66 /// <since_tizen> 3 </since_tizen>
67 public Animation(int durationMilliSeconds) : this(Interop.Animation.New((float)durationMilliSeconds / 1000.0f), true)
69 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
72 internal Animation(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.Animation.Upcast(cPtr), cMemoryOwn)
75 _animationFinishedEventCallback = OnFinished;
76 _finishedCallbackOfNative = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate<System.Delegate>(_animationFinishedEventCallback);
79 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
80 private delegate void AnimationFinishedEventCallbackType(IntPtr data);
82 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
83 private delegate void AnimationProgressReachedEventCallbackType(IntPtr data);
85 private event EventHandler _animationFinishedEventHandler;
88 * @brief Event for the finished signal which can be used to subscribe or unsubscribe the event handler.
89 * The finished signal is emitted when an animation's animations have finished.
91 /// <since_tizen> 3 </since_tizen>
92 public event EventHandler Finished
96 if (_animationFinishedEventHandler == null && disposed == false)
98 AnimationSignal finishedSignal = FinishedSignal();
99 finishedSignal.Connect(_finishedCallbackOfNative);
100 finishedSignal.Dispose();
102 _animationFinishedEventHandler += value;
106 _animationFinishedEventHandler -= value;
108 AnimationSignal finishedSignal = FinishedSignal();
109 if (_animationFinishedEventHandler == null && finishedSignal.Empty() == false)
111 finishedSignal.Disconnect(_finishedCallbackOfNative);
113 finishedSignal.Dispose();
117 private event EventHandler _animationProgressReachedEventHandler;
120 * @brief Event for the ProgressReached signal, which can be used to subscribe or unsubscribe the event handler.
121 * The ProgressReached signal is emitted when the animation has reached a given progress percentage, this is set in the api SetProgressNotification.
123 /// <since_tizen> 3 </since_tizen>
124 public event EventHandler ProgressReached
128 if (_animationProgressReachedEventHandler == null)
130 _animationProgressReachedEventCallback = OnProgressReached;
131 AnimationSignal progressReachedSignal = ProgressReachedSignal();
132 progressReachedSignal?.Connect(_animationProgressReachedEventCallback);
133 progressReachedSignal?.Dispose();
136 _animationProgressReachedEventHandler += value;
140 _animationProgressReachedEventHandler -= value;
142 AnimationSignal progressReachedSignal = ProgressReachedSignal();
143 if (_animationProgressReachedEventHandler == null && progressReachedSignal?.Empty() == false)
145 progressReachedSignal?.Disconnect(_animationProgressReachedEventCallback);
147 progressReachedSignal.Dispose();
152 /// Enumeration for what to do when the animation ends, stopped, or destroyed.
154 /// <since_tizen> 3 </since_tizen>
155 public enum EndActions
158 /// When the animation ends, the animated property values are saved.
162 /// When the animation ends, the animated property values are forgotten.
166 /// If the animation is stopped, the animated property values are saved as if the animation had run to completion, otherwise behaves like cancel.
172 /// Enumeration for what interpolation method to use on key-frame animations.
174 /// <since_tizen> 3 </since_tizen>
175 public enum Interpolation
178 /// Values in between key frames are interpolated using a linear polynomial. (Default)
182 /// Values in between key frames are interpolated using a cubic polynomial.
188 /// Enumeration for what state the animation is in.
190 /// <remarks>Calling Reset() on this class will not reset the animation. It will call the BaseHandle.Reset() which drops the object handle.</remarks>
191 /// <since_tizen> 3 </since_tizen>
195 /// The animation has stopped.
199 /// The animation is playing.
203 /// The animation is paused.
209 /// Gets or sets the duration in milliseconds of the animation.
211 /// <since_tizen> 3 </since_tizen>
216 SetDuration(MilliSecondsToSeconds(value));
220 return SecondsToMilliSeconds(GetDuration());
225 /// Gets or sets the default alpha function for the animation.
227 /// <since_tizen> 3 </since_tizen>
228 public AlphaFunction DefaultAlphaFunction
232 SetDefaultAlphaFunction(value);
236 AlphaFunction ret = GetDefaultAlphaFunction();
242 /// Queries the state of the animation.
244 /// <since_tizen> 3 </since_tizen>
254 /// Set: Enables looping for a specified number of repeats. A zero is the same as Looping = true; i.e., repeat forever.<br />
255 /// This property resets the looping value and should not be used with the Looping property.<br />
256 /// Setting this parameter does not cause the animation to Play().<br />
257 /// Get: Gets the loop count. A zero is the same as Looping = true; i.e., repeat forever.<br />
258 /// The loop count is initially 1 for play once.<br />
260 /// <since_tizen> 3 </since_tizen>
269 int ret = GetLoopCount();
275 /// Gets or sets the status of whether the animation will loop.<br />
276 /// This property resets the loop count and should not be used with the LoopCount property.<br />
277 /// Setting this parameter does not cause the animation to Play().<br />
279 /// <since_tizen> 3 </since_tizen>
288 bool ret = IsLooping();
295 /// Gets or sets the end action of the animation.<br />
296 /// This action is performed when the animation ends or if it is stopped.<br />
297 /// The default end action is cancel.<br />
299 /// <since_tizen> 3 </since_tizen>
300 public EndActions EndAction
308 return GetEndAction();
313 /// Gets the current loop count.<br />
314 /// A value 0 indicating the current loop count when looping.<br />
316 /// <since_tizen> 3 </since_tizen>
317 public int CurrentLoop
321 return GetCurrentLoop();
326 /// Gets or sets the disconnect action.<br />
327 /// If any of the animated property owners are disconnected from the stage while the animation is being played, then this action is performed.<br />
328 /// The default action is cancel.<br />
330 /// <since_tizen> 3 </since_tizen>
331 public EndActions DisconnectAction
335 Interop.Animation.SetDisconnectAction(swigCPtr, (int)value);
336 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
340 Animation.EndActions ret = (Animation.EndActions)Interop.Animation.GetDisconnectAction(swigCPtr);
341 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
348 /// Gets or sets the progress of the animation.<br />
349 /// The animation will play (or continue playing) from this point.<br />
350 /// The progress must be in the 0-1 interval or in the play range interval if defined<br />
351 /// otherwise, it will be ignored.<br />
353 /// <since_tizen> 3 </since_tizen>
354 public float CurrentProgress
358 Interop.Animation.SetCurrentProgress(swigCPtr, value);
359 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
363 float ret = Interop.Animation.GetCurrentProgress(swigCPtr);
364 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
370 /// Gets or sets specificifications of a speed factor for the animation.<br />
371 /// The speed factor is a multiplier of the normal velocity of the animation.<br />
372 /// Values between [0, 1] will slow down the animation and values above one will speed up the animation.<br />
373 /// It is also possible to specify a negative multiplier to play the animation in reverse.<br />
375 /// <since_tizen> 3 </since_tizen>
376 public float SpeedFactor
380 Interop.Animation.SetSpeedFactor(swigCPtr, value);
381 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
385 float ret = Interop.Animation.GetSpeedFactor(swigCPtr);
386 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
392 /// Gets or sets the playing range.<br />
393 /// Animation will play between the values specified. Both values (range.x and range.y ) should be between 0-1,
394 /// otherwise they will be ignored. If the range provided is not in proper order (minimum, maximum ), it will be reordered.<br />
396 /// <since_tizen> 3 </since_tizen>
397 public RelativeVector2 PlayRange
401 Interop.Animation.SetPlayRange(swigCPtr, Vector2.getCPtr(value));
402 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
406 Vector2 ret = new Vector2(Interop.Animation.GetPlayRange(swigCPtr), true);
407 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
414 /// Gets or sets the progress notification marker which triggers the ProgressReachedSignal.<br />
415 /// Percentage of animation progress should be greater than 0 and less than 1, for example, 0.3 for 30% <br />
416 /// One notification can be set on each animation.
418 /// <since_tizen> 3 </since_tizen>
419 public float ProgressNotification
423 Interop.Animation.SetProgressNotification(swigCPtr, value);
424 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
428 float ret = Interop.Animation.GetProgressNotification(swigCPtr);
429 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
435 /// Gets or sets the properties of the animation.
437 public string[] Properties
450 /// Gets or sets the destination value for each property of the animation.
452 public string[] DestValue
465 /// Gets or sets the start time for each property of the animation.
467 public int[] StartTime
480 /// Gets or sets the end time for each property of the animation.
494 private bool DisableAnimation
498 if (disableAnimation.HasValue == false)
500 string type = Environment.GetEnvironmentVariable("PlatformSmartType");
502 disableAnimation = true;
504 disableAnimation = false;
506 return disableAnimation.Value;
511 /// Downcasts a handle to animation handle.<br />
512 /// If handle points to an animation object, the downcast produces a valid handle.<br />
513 /// If not, the returned handle is left uninitialized.<br />
515 /// <param name="handle">Handle to an object.</param>
516 /// <returns>Handle to an animation object or an uninitialized handle.</returns>
517 /// <exception cref="ArgumentNullException"> Thrown when handle is null. </exception>
518 /// <since_tizen> 3 </since_tizen>
519 [Obsolete("Deprecated in API6, Will be removed in API9, Please use as keyword instead!")]
520 [EditorBrowsable(EditorBrowsableState.Never)]
521 public static Animation DownCast(BaseHandle handle)
525 throw new ArgumentNullException(nameof(handle));
527 Animation ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as Animation;
528 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
533 /// Stops the animation.
535 /// <param name="action">The end action can be set.</param>
536 /// <since_tizen> 3 </since_tizen>
537 public void Stop(EndActions action = EndActions.Cancel)
539 SetEndAction(action);
540 Interop.Animation.Stop(swigCPtr);
541 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
545 /// Animates a property value by a relative amount.<br />
547 /// <param name="target">The target object to animate.</param>
548 /// <param name="property">The target property to animate.</param>
549 /// <param name="relativeValue">The property value will change by this amount.</param>
550 /// <param name="alphaFunction">The alpha function to apply.</param>
551 /// <exception cref="ArgumentNullException"> Thrown when target or relativeValue is null. </exception>
552 /// <since_tizen> 3 </since_tizen>
553 public void AnimateBy(View target, string property, object relativeValue, AlphaFunction alphaFunction = null)
557 throw new ArgumentNullException(nameof(target));
559 else if (relativeValue == null)
561 throw new ArgumentNullException(nameof(relativeValue));
564 Property _prop = PropertyHelper.GetPropertyFromString(target, property);
565 relativeValue = AvoidFloatPropertyHasIntegerValue(target, _prop, relativeValue);
566 PropertyValue val = PropertyValue.CreateFromObject(relativeValue);
568 if (alphaFunction != null)
570 AnimateBy(_prop, val, alphaFunction);
574 AnimateBy(_prop, val);
582 /// Animates a property value by a relative amount.<br />
584 /// <param name="target">The target object to animate.</param>
585 /// <param name="property">The target property to animate.</param>
586 /// <param name="relativeValue">The property value will change by this amount.</param>
587 /// <param name="startTime">The start time of the animation.</param>
588 /// <param name="endTime">The end time of the animation.</param>
589 /// <param name="alphaFunction">The alpha function to apply.</param>
590 /// <exception cref="ArgumentNullException"> Thrown when target or relativeValue is null. </exception>
591 /// <since_tizen> 3 </since_tizen>
592 public void AnimateBy(View target, string property, object relativeValue, int startTime, int endTime, AlphaFunction alphaFunction = null)
596 throw new ArgumentNullException(nameof(target));
598 else if (relativeValue == null)
600 throw new ArgumentNullException(nameof(relativeValue));
603 Property _prop = PropertyHelper.GetPropertyFromString(target, property);
604 relativeValue = AvoidFloatPropertyHasIntegerValue(target, _prop, relativeValue);
605 PropertyValue val = PropertyValue.CreateFromObject(relativeValue);
607 if (alphaFunction != null)
609 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
610 AnimateBy(_prop, val, alphaFunction, time);
615 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
616 AnimateBy(_prop, val, time);
625 /// Animates a property to a destination value.<br />
627 /// <param name="target">The target object to animate.</param>
628 /// <param name="property">The target property to animate.</param>
629 /// <param name="destinationValue">The destination value.</param>
630 /// <param name="alphaFunction">The alpha function to apply.</param>
631 /// <exception cref="ArgumentNullException"> Thrown when target or destinationValue is null. </exception>
632 /// <since_tizen> 3 </since_tizen>
633 public void AnimateTo(View target, string property, object destinationValue, AlphaFunction alphaFunction = null)
637 throw new ArgumentNullException(nameof(target));
639 else if (destinationValue == null)
641 throw new ArgumentNullException(nameof(destinationValue));
644 Property _prop = PropertyHelper.GetPropertyFromString(target, property);
645 destinationValue = AvoidFloatPropertyHasIntegerValue(target, _prop, destinationValue);
646 PropertyValue val = PropertyValue.CreateFromObject(destinationValue);
648 if (alphaFunction != null)
650 AnimateTo(_prop, val, alphaFunction);
654 AnimateTo(_prop, val);
662 /// Animates one or more properties to a destination value.<br />
664 /// <param name="target">The target object to animate.</param>
665 /// <exception cref="ArgumentNullException"> Thrown when target is null. </exception>
666 public void PlayAnimateTo(View target)
670 throw new ArgumentNullException(nameof(target));
674 if (_properties.Length == _destValue.Length && _startTime.Length == _endTime.Length && _properties.Length == _startTime.Length)
676 int length = _properties.Length;
677 for (int index = 0; index < length; index++)
679 //object destinationValue = _destValue[index];
680 var elementType = target.GetType();
681 PropertyInfo propertyInfo = elementType.GetProperties().FirstOrDefault(fi => fi.Name == _properties[index]);
682 //var propertyInfo = elementType.GetRuntimeProperties().FirstOrDefault(p => p.Name == localName);
683 if (propertyInfo != null)
685 object destinationValue = ConvertTo(_destValue[index], propertyInfo.PropertyType);
687 if (destinationValue != null)
689 AnimateTo(target, _properties[index], destinationValue, _startTime[index], _endTime[index]);
698 /// Animates a property to a destination value.<br />
700 /// <param name="target">The target object to animate.</param>
701 /// <param name="property">The target property to animate.</param>
702 /// <param name="destinationValue">The destination value.</param>
703 /// <param name="startTime">The start time of the animation.</param>
704 /// <param name="endTime">The end time of the animation.</param>
705 /// <param name="alphaFunction">The alpha function to apply.</param>
706 /// <exception cref="ArgumentNullException"> Thrown when target or destinationValue is null. </exception>
707 /// <since_tizen> 3 </since_tizen>
708 public void AnimateTo(View target, string property, object destinationValue, int startTime, int endTime, AlphaFunction alphaFunction = null)
712 throw new ArgumentNullException(nameof(target));
714 else if (destinationValue == null)
716 throw new ArgumentNullException(nameof(destinationValue));
719 Property _prop = PropertyHelper.GetPropertyFromString(target, property);
720 destinationValue = AvoidFloatPropertyHasIntegerValue(target, _prop, destinationValue);
721 PropertyValue val = PropertyValue.CreateFromObject(destinationValue);
723 if (alphaFunction != null)
725 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
726 AnimateTo(_prop, val, alphaFunction, time);
731 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
732 AnimateTo(_prop, val, time);
741 /// Animates a property between keyframes.
743 /// <param name="target">The target object to animate.</param>
744 /// <param name="property">The target property to animate.</param>
745 /// <param name="keyFrames">The set of time or value pairs between which to animate.</param>
746 /// <param name="interpolation">The method used to interpolate between values.</param>
747 /// <param name="alphaFunction">The alpha function to apply.</param>
748 /// <since_tizen> 3 </since_tizen>
749 public void AnimateBetween(View target, string property, KeyFrames keyFrames, Interpolation interpolation = Interpolation.Linear, AlphaFunction alphaFunction = null)
751 Property _prop = PropertyHelper.GetPropertyFromString(target, property);
753 if (_prop.propertyIndex == Property.InvalidIndex)
755 throw new System.ArgumentException("second argument string property is invalid parameter!");
758 if (alphaFunction != null)
760 AnimateBetween(_prop, keyFrames, alphaFunction, interpolation);
764 AnimateBetween(_prop, keyFrames, interpolation);
771 /// Animates a property between keyframes.
773 /// <param name="target">The target object to animate</param>
774 /// <param name="property">The target property to animate</param>
775 /// <param name="keyFrames">The set of time/value pairs between which to animate</param>
776 /// <param name="startTime">The start time of animation in milliseconds.</param>
777 /// <param name="endTime">The end time of animation in milliseconds.</param>
778 /// <param name="interpolation">The method used to interpolate between values.</param>
779 /// <param name="alphaFunction">The alpha function to apply.</param>
780 /// <since_tizen> 3 </since_tizen>
781 public void AnimateBetween(View target, string property, KeyFrames keyFrames, int startTime, int endTime, Interpolation interpolation = Interpolation.Linear, AlphaFunction alphaFunction = null)
783 Property _prop = PropertyHelper.GetPropertyFromString(target, property);
785 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
786 if (alphaFunction != null)
788 AnimateBetween(_prop, keyFrames, alphaFunction, time, interpolation);
792 AnimateBetween(_prop, keyFrames, time, interpolation);
800 /// Animates the view's position and orientation through a predefined path.<br />
801 /// The view will rotate to orient the supplied forward vector with the path's tangent.<br />
802 /// If forward is the zero vector then no rotation will happen.<br />
804 /// <param name="view">The view to animate.</param>
805 /// <param name="path">It defines position and orientation.</param>
806 /// <param name="forward">The vector (in local space coordinate system) will be oriented with the path's tangent direction.</param>
807 /// <param name="alphaFunction">The alpha function to apply.</param>
808 /// <since_tizen> 3 </since_tizen>
809 public void AnimatePath(View view, Path path, Vector3 forward, AlphaFunction alphaFunction = null)
811 if (alphaFunction == null)
813 Animate(view, path, forward);
817 Animate(view, path, forward, alphaFunction);
822 /// Animates the view's position and orientation through a predefined path.<br />
823 /// The view will rotate to orient the supplied forward vector with the path's tangent.<br />
824 /// If forward is the zero vector then no rotation will happen.<br />
826 /// <param name="view">The view to animate.</param>
827 /// <param name="path">It defines position and orientation.</param>
828 /// <param name="forward">The vector (in local space coordinate system) will be oriented with the path's tangent direction.</param>
829 /// <param name="startTime">The start time of the animation.</param>
830 /// <param name="endTime">The end time of the animation.</param>
831 /// <param name="alphaFunction">The alpha function to apply.</param>
832 /// <since_tizen> 3 </since_tizen>
833 public void AnimatePath(View view, Path path, Vector3 forward, int startTime, int endTime, AlphaFunction alphaFunction = null)
835 TimePeriod time = new TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
836 if (alphaFunction == null)
838 Animate(view, path, forward, time);
842 Animate(view, path, forward, alphaFunction, time);
848 /// Creates an initialized animation.<br />
849 /// The animation will not loop.<br />
850 /// The default end action is "Cancel".<br />
851 /// The default alpha function is linear.<br />
853 /// <since_tizen> 3 </since_tizen>
854 public Animation() : this(Interop.Animation.New(0.0f), true)
856 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
860 /// Plays the animation.
862 /// <since_tizen> 3 </since_tizen>
865 Interop.Animation.Play(swigCPtr);
866 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
868 if (DisableAnimation == true)
869 Stop(EndActions.StopFinal);
873 /// Plays the animation from a given point.<br />
874 /// The progress must be in the 0-1 interval or in the play range interval if defined,
875 /// otherwise, it will be ignored.<br />
877 /// <param name="progress">A value between [0,1], or between the play range if specified, from where the animation should start playing.</param>
878 /// <since_tizen> 3 </since_tizen>
879 public void PlayFrom(float progress)
881 Interop.Animation.PlayFrom(swigCPtr, progress);
882 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
886 /// Plays the animation after a given delay time.<br/>
887 /// The delay time is not included in the looping time.<br/>
888 /// When the delay time is a negative value, it would treat as play immediately.<br/>
890 /// <param name="delayMilliseconds">The delay time.</param>
891 /// <since_tizen> 4 </since_tizen>
892 public void PlayAfter(int delayMilliseconds)
894 Interop.Animation.PlayAfter(swigCPtr, MilliSecondsToSeconds(delayMilliseconds));
895 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
899 /// Pauses the animation.
901 /// <since_tizen> 3 </since_tizen>
904 Interop.Animation.Pause(swigCPtr);
905 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
909 /// Stops the animation.
911 /// <since_tizen> 3 </since_tizen>
914 Interop.Animation.Stop(swigCPtr);
915 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
919 /// Clears the animation.<br />
920 /// This disconnects any objects that were being animated, effectively stopping the animation.<br />
922 /// <since_tizen> 3 </since_tizen>
925 Interop.Animation.Clear(swigCPtr);
926 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
929 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Animation obj)
931 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
934 internal object ConvertTo(object value, Type toType)
936 Func<object> getConverter = () =>
938 string converterTypeName = GetTypeConverterTypeName(toType.GetTypeInfo().CustomAttributes);
939 if (converterTypeName == null)
942 Type convertertype = Type.GetType(converterTypeName);
943 return Activator.CreateInstance(convertertype);
946 return ConvertTo(value, toType, getConverter);
949 internal object ConvertTo(object value, Type toType, Func<object> getConverter)
954 var str = value as string;
957 //If there's a [TypeConverter], use it
958 object converter = getConverter?.Invoke();
959 var xfTypeConverter = converter as Tizen.NUI.Binding.TypeConverter;
960 if (xfTypeConverter != null)
961 return value = xfTypeConverter.ConvertFromInvariantString(str);
962 var converterType = converter?.GetType();
963 if (converterType != null)
965 var convertFromStringInvariant = converterType.GetRuntimeMethod("ConvertFromInvariantString",
966 new[] { typeof(string) });
967 if (convertFromStringInvariant != null)
968 return value = convertFromStringInvariant.Invoke(converter, new object[] { str });
971 //If the type is nullable, as the value is not null, it's safe to assume we want the built-in conversion
972 if (toType.GetTypeInfo().IsGenericType && toType.GetGenericTypeDefinition() == typeof(Nullable<>))
973 toType = Nullable.GetUnderlyingType(toType);
975 //Obvious Built-in conversions
976 if (toType.GetTypeInfo().IsEnum)
977 return Enum.Parse(toType, str, true);
978 if (toType == typeof(SByte))
979 return SByte.Parse(str, CultureInfo.InvariantCulture);
980 if (toType == typeof(Int16))
981 return Int16.Parse(str, CultureInfo.InvariantCulture);
982 if (toType == typeof(Int32))
983 return Int32.Parse(str, CultureInfo.InvariantCulture);
984 if (toType == typeof(Int64))
985 return Int64.Parse(str, CultureInfo.InvariantCulture);
986 if (toType == typeof(Byte))
987 return Byte.Parse(str, CultureInfo.InvariantCulture);
988 if (toType == typeof(UInt16))
989 return UInt16.Parse(str, CultureInfo.InvariantCulture);
990 if (toType == typeof(UInt32))
991 return UInt32.Parse(str, CultureInfo.InvariantCulture);
992 if (toType == typeof(UInt64))
993 return UInt64.Parse(str, CultureInfo.InvariantCulture);
994 if (toType == typeof(Single))
995 return Single.Parse(str, CultureInfo.InvariantCulture);
996 if (toType == typeof(Double))
997 return Double.Parse(str, CultureInfo.InvariantCulture);
998 if (toType == typeof(Boolean))
999 return Boolean.Parse(str);
1000 if (toType == typeof(TimeSpan))
1001 return TimeSpan.Parse(str, CultureInfo.InvariantCulture);
1002 if (toType == typeof(DateTime))
1003 return DateTime.Parse(str, CultureInfo.InvariantCulture);
1004 if (toType == typeof(Char))
1007 Char.TryParse(str, out c);
1010 if (toType == typeof(String) && str.StartsWith("{}", StringComparison.Ordinal))
1011 return str.Substring(2);
1012 if (toType == typeof(String))
1014 if (toType == typeof(Decimal))
1015 return Decimal.Parse(str, CultureInfo.InvariantCulture);
1018 //if the value is not assignable and there's an implicit conversion, convert
1019 if (value != null && !toType.IsAssignableFrom(value.GetType()))
1021 var opImplicit = GetImplicitConversionOperator(value.GetType(), value.GetType(), toType)
1022 ?? GetImplicitConversionOperator(toType, value.GetType(), toType);
1023 //var opImplicit = value.GetType().GetImplicitConversionOperator(fromType: value.GetType(), toType: toType)
1024 // ?? toType.GetImplicitConversionOperator(fromType: value.GetType(), toType: toType);
1026 if (opImplicit != null)
1028 value = opImplicit.Invoke(null, new[] { value });
1036 internal string GetTypeConverterTypeName(IEnumerable<CustomAttributeData> attributes)
1038 var converterAttribute =
1039 attributes.FirstOrDefault(cad => Tizen.NUI.Binding.TypeConverterAttribute.TypeConvertersType.Contains(cad.AttributeType.FullName));
1040 if (converterAttribute == null)
1042 if (converterAttribute.ConstructorArguments[0].ArgumentType == typeof(string))
1043 return (string)converterAttribute.ConstructorArguments[0].Value;
1044 if (converterAttribute.ConstructorArguments[0].ArgumentType == typeof(Type))
1045 return ((Type)converterAttribute.ConstructorArguments[0].Value).AssemblyQualifiedName;
1049 internal MethodInfo GetImplicitConversionOperator(Type onType, Type fromType, Type toType)
1052 var mi = onType.GetRuntimeMethod("op_Implicit", new[] { fromType });
1054 var bindingFlags = BindingFlags.Public | BindingFlags.Static | BindingFlags.FlattenHierarchy;
1055 var mi = onType.GetMethod("op_Implicit", bindingFlags, null, new[] { fromType }, null);
1057 if (mi == null) return null;
1058 if (!mi.IsSpecialName) return null;
1059 if (!mi.IsPublic) return null;
1060 if (!mi.IsStatic) return null;
1061 if (!toType.IsAssignableFrom(mi.ReturnType)) return null;
1066 internal Animation(float durationSeconds) : this(Interop.Animation.New(durationSeconds), true)
1068 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1072 internal Animation(Animation handle) : this(Interop.Animation.NewAnimation(Animation.getCPtr(handle)), true)
1074 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1077 internal Animation Assign(Animation rhs)
1079 Animation ret = new Animation(Interop.Animation.Assign(swigCPtr, Animation.getCPtr(rhs)), false);
1080 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1084 internal void SetDuration(float seconds)
1086 Interop.Animation.SetDuration(swigCPtr, seconds);
1087 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1090 internal float GetDuration()
1092 float ret = Interop.Animation.GetDuration(swigCPtr);
1093 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1097 internal void SetLooping(bool looping)
1099 Interop.Animation.SetLooping(swigCPtr, looping);
1100 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1103 internal void SetLoopCount(int count)
1105 Interop.Animation.SetLoopCount(swigCPtr, count);
1106 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1109 internal int GetLoopCount()
1111 int ret = Interop.Animation.GetLoopCount(swigCPtr);
1112 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1116 internal int GetCurrentLoop()
1118 int ret = Interop.Animation.GetCurrentLoop(swigCPtr);
1119 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1123 internal bool IsLooping()
1125 bool ret = Interop.Animation.IsLooping(swigCPtr);
1126 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1130 internal void SetEndAction(Animation.EndActions action)
1132 Interop.Animation.SetEndAction(swigCPtr, (int)action);
1133 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1136 internal Animation.EndActions GetEndAction()
1138 Animation.EndActions ret = (Animation.EndActions)Interop.Animation.GetEndAction(swigCPtr);
1139 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1143 internal void SetDisconnectAction(Animation.EndActions disconnectAction)
1145 Interop.Animation.SetDisconnectAction(swigCPtr, (int)disconnectAction);
1146 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1149 internal Animation.EndActions GetDisconnectAction()
1151 Animation.EndActions ret = (Animation.EndActions)Interop.Animation.GetDisconnectAction(swigCPtr);
1152 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1156 internal void SetDefaultAlphaFunction(AlphaFunction alpha)
1158 Interop.Animation.SetDefaultAlphaFunction(swigCPtr, AlphaFunction.getCPtr(alpha));
1159 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1162 internal AlphaFunction GetDefaultAlphaFunction()
1164 AlphaFunction ret = new AlphaFunction(Interop.Animation.GetDefaultAlphaFunction(swigCPtr), true);
1165 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1169 internal void SetCurrentProgress(float progress)
1171 Interop.Animation.SetCurrentProgress(swigCPtr, progress);
1172 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1175 internal float GetCurrentProgress()
1177 float ret = Interop.Animation.GetCurrentProgress(swigCPtr);
1178 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1182 internal void SetSpeedFactor(float factor)
1184 Interop.Animation.SetSpeedFactor(swigCPtr, factor);
1185 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1188 internal float GetSpeedFactor()
1190 float ret = Interop.Animation.GetSpeedFactor(swigCPtr);
1191 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1195 internal void SetPlayRange(Vector2 range)
1197 Interop.Animation.SetPlayRange(swigCPtr, Vector2.getCPtr(range));
1198 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1201 internal Vector2 GetPlayRange()
1203 Vector2 ret = new Vector2(Interop.Animation.GetPlayRange(swigCPtr), true);
1204 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1208 internal Animation.States GetState()
1210 Animation.States ret = (Animation.States)Interop.Animation.GetState(swigCPtr);
1211 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1215 internal AnimationSignal FinishedSignal()
1217 AnimationSignal ret = new AnimationSignal(Interop.Animation.FinishedSignal(swigCPtr), false);
1218 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1222 internal AnimationSignal ProgressReachedSignal()
1224 AnimationSignal ret = new AnimationSignal(Interop.Animation.ProgressReachedSignal(swigCPtr), false);
1225 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1229 internal void AnimateBy(Property target, PropertyValue relativeValue)
1231 Interop.Animation.AnimateBy(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(relativeValue));
1232 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1235 internal void AnimateBy(Property target, PropertyValue relativeValue, AlphaFunction alpha)
1237 Interop.Animation.AnimateByAlphaFunction(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(relativeValue), AlphaFunction.getCPtr(alpha));
1238 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1241 internal void AnimateBy(Property target, PropertyValue relativeValue, TimePeriod period)
1243 Interop.Animation.AnimateByTimePeriod(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(relativeValue), TimePeriod.getCPtr(period));
1244 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1247 internal void AnimateBy(Property target, PropertyValue relativeValue, AlphaFunction alpha, TimePeriod period)
1249 Interop.Animation.AnimateBy(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(relativeValue), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
1250 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1253 internal void AnimateTo(Property target, PropertyValue destinationValue)
1255 Interop.Animation.AnimateTo(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(destinationValue));
1256 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1259 internal void AnimateTo(Property target, PropertyValue destinationValue, AlphaFunction alpha)
1261 Interop.Animation.AnimateToAlphaFunction(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(destinationValue), AlphaFunction.getCPtr(alpha));
1262 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1265 internal void AnimateTo(Property target, PropertyValue destinationValue, TimePeriod period)
1267 Interop.Animation.AnimateToTimePeriod(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(destinationValue), TimePeriod.getCPtr(period));
1268 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1271 internal void AnimateTo(Property target, PropertyValue destinationValue, AlphaFunction alpha, TimePeriod period)
1273 Interop.Animation.AnimateTo(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(destinationValue), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
1274 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1277 internal void AnimateBetween(Property target, KeyFrames keyFrames)
1279 Interop.Animation.AnimateBetween(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames));
1280 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1283 internal void AnimateBetween(Property target, KeyFrames keyFrames, Animation.Interpolation interpolation)
1285 Interop.Animation.AnimateBetween(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), (int)interpolation);
1286 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1289 internal void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha)
1291 Interop.Animation.AnimateBetweenAlphaFunction(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha));
1292 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1295 internal void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha, Animation.Interpolation interpolation)
1297 Interop.Animation.AnimateBetweenAlphaFunctionInterpolation(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha), (int)interpolation);
1298 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1301 internal void AnimateBetween(Property target, KeyFrames keyFrames, TimePeriod period)
1303 Interop.Animation.AnimateBetweenTimePeriod(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), TimePeriod.getCPtr(period));
1304 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1307 internal void AnimateBetween(Property target, KeyFrames keyFrames, TimePeriod period, Animation.Interpolation interpolation)
1309 Interop.Animation.AnimateBetweenTimePeriodInterpolation(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), TimePeriod.getCPtr(period), (int)interpolation);
1310 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1313 internal void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha, TimePeriod period)
1315 Interop.Animation.AnimateBetween(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
1316 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1319 internal void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha, TimePeriod period, Animation.Interpolation interpolation)
1321 Interop.Animation.AnimateBetween(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period), (int)interpolation);
1322 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1325 internal void Animate(View view, Path path, Vector3 forward)
1327 Interop.Animation.Animate(swigCPtr, View.getCPtr(view), Path.getCPtr(path), Vector3.getCPtr(forward));
1328 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1331 internal void Animate(View view, Path path, Vector3 forward, AlphaFunction alpha)
1333 Interop.Animation.AnimateAlphaFunction(swigCPtr, View.getCPtr(view), Path.getCPtr(path), Vector3.getCPtr(forward), AlphaFunction.getCPtr(alpha));
1334 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1337 internal void Animate(View view, Path path, Vector3 forward, TimePeriod period)
1339 Interop.Animation.AnimateTimePeriod(swigCPtr, View.getCPtr(view), Path.getCPtr(path), Vector3.getCPtr(forward), TimePeriod.getCPtr(period));
1340 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1343 internal void Animate(View view, Path path, Vector3 forward, AlphaFunction alpha, TimePeriod period)
1345 Interop.Animation.Animate(swigCPtr, View.getCPtr(view), Path.getCPtr(path), Vector3.getCPtr(forward), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
1346 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1349 internal void Show(View view, float delaySeconds)
1351 Interop.Animation.Show(swigCPtr, View.getCPtr(view), delaySeconds);
1352 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1355 internal void Hide(View view, float delaySeconds)
1357 Interop.Animation.Hide(swigCPtr, View.getCPtr(view), delaySeconds);
1358 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1362 /// To make animation instance be disposed.
1364 /// <since_tizen> 3 </since_tizen>
1365 protected override void Dispose(DisposeTypes type)
1372 if (_animationFinishedEventHandler != null)
1374 AnimationSignal finishedSignal = FinishedSignal();
1375 finishedSignal?.Disconnect(_finishedCallbackOfNative);
1376 finishedSignal?.Dispose();
1377 _animationFinishedEventHandler = null;
1380 if (_animationProgressReachedEventCallback != null)
1382 AnimationSignal progressReachedSignal = ProgressReachedSignal();
1383 progressReachedSignal?.Disconnect(_animationProgressReachedEventCallback);
1384 progressReachedSignal?.Dispose();
1385 _animationProgressReachedEventCallback = null;
1391 /// This will not be public opened.
1392 [EditorBrowsable(EditorBrowsableState.Never)]
1393 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
1395 if (swigCPtr.Handle == IntPtr.Zero || this.HasBody() == false)
1397 Tizen.Log.Fatal("NUI", $"[ERROR] Animation ReleaseSwigCPtr()! IntPtr=0x{swigCPtr.Handle:X} HasBody={this.HasBody()}");
1400 Interop.Animation.DeleteAnimation(swigCPtr);
1403 private void OnFinished(IntPtr data)
1405 if (_animationFinishedEventHandler != null)
1407 //here we send all data to user event handlers
1408 _animationFinishedEventHandler(this, null);
1412 private void OnProgressReached(IntPtr data)
1414 if (_animationProgressReachedEventHandler != null)
1416 //here we send all data to user event handlers
1417 _animationProgressReachedEventHandler(this, null);
1421 private float MilliSecondsToSeconds(int millisec)
1423 return (float)millisec / 1000.0f;
1426 private int SecondsToMilliSeconds(float sec)
1428 return (int)(sec * 1000);
1431 private object AvoidFloatPropertyHasIntegerValue(View target, Property property, object value)
1433 PropertyType propertyType = target.GetPropertyType(property.propertyIndex);
1434 if (propertyType.Equals(PropertyType.Float))
1436 System.Type type = value.GetType();
1437 if (type.Equals(typeof(System.Int32)) || type.Equals(typeof(int)))
1439 int num = (int)value;