2 * Copyright(c) 2017 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.
22 using System.ComponentModel;
23 using System.Runtime.InteropServices;
24 using Tizen.NUI.BaseComponents;
26 using System.Collections;
27 using System.Collections.Generic;
29 using System.Reflection;
31 using Tizen.NUI.Binding.Internals;
32 using Tizen.NUI.Binding;
33 using System.Globalization;
34 using Tizen.NUI.Xaml.Internals;
37 /// Animation can be used to animate the properties of any number of objects, typically view.<br />
38 /// If the "Finished" event is connected to a member function of an object, it must be disconnected before the object is destroyed.<br />
39 /// This is typically done in the object destructor, and requires either the animation handle to be stored.<br />
40 /// 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 />
41 /// If any of the individual calls to those functions exceeds the overall animation time (Duration), then the overall animation time is automatically extended.<br />
43 /// <since_tizen> 3 </since_tizen>
44 public class Animation : BaseHandle
46 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
48 internal Animation(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Animation_SWIGUpcast(cPtr), cMemoryOwn)
50 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
52 _animationFinishedEventCallback = OnFinished;
53 _finishedCallbackOfNative = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate<System.Delegate>(_animationFinishedEventCallback);
56 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Animation obj)
58 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
62 /// To make animation instance be disposed.
64 /// <since_tizen> 3 </since_tizen>
65 protected override void Dispose(DisposeTypes type)
69 if (_animationFinishedEventCallback != null)
71 FinishedSignal().Disconnect(_finishedCallbackOfNative);
74 if (_animationProgressReachedEventCallback != null)
77 ProgressReachedSignal().Disconnect(_animationProgressReachedEventCallback);
85 if(type == DisposeTypes.Explicit)
88 //Release your own managed resources here.
89 //You should release all of your own disposable objects here.
92 else if(type == DisposeTypes.Implicit)
102 //Release your own unmanaged resources here.
103 //You should not access any managed member here except static instance.
104 //because the execution order of Finalizes is non-deterministic.
106 if (swigCPtr.Handle != global::System.IntPtr.Zero)
111 NDalicPINVOKE.delete_Animation(swigCPtr);
113 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
120 /// Creates an initialized animation.<br />
121 /// The animation will not loop.<br />
122 /// The default end action is "Cancel".<br />
123 /// The default alpha function is linear.<br />
125 /// <remarks>DurationmSeconds must be greater than zero.</remarks>
126 /// <param name="durationMilliSeconds">The duration in milliseconds.</param>
127 /// <since_tizen> 3 </since_tizen>
128 public Animation(int durationMilliSeconds) : this(NDalicPINVOKE.Animation_New((float)durationMilliSeconds / 1000.0f), true)
130 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
133 private AnimationFinishedEventCallbackType _animationFinishedEventCallback;
134 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
135 private delegate void AnimationFinishedEventCallbackType(IntPtr data);
136 private event EventHandler _animationFinishedEventHandler;
138 private System.IntPtr _finishedCallbackOfNative;
141 * @brief Event for the finished signal which can be used to subscribe or unsubscribe the event handler.
142 * The finished signal is emitted when an animation's animations have finished.
144 /// <since_tizen> 3 </since_tizen>
145 public event EventHandler Finished
149 if (_animationFinishedEventHandler == null && disposed == false)
151 FinishedSignal().Connect(_finishedCallbackOfNative);
153 _animationFinishedEventHandler += value;
157 _animationFinishedEventHandler -= value;
159 if (_animationFinishedEventHandler == null && FinishedSignal().Empty() == false)
161 FinishedSignal().Disconnect(_finishedCallbackOfNative);
165 private void OnFinished(IntPtr data)
167 if (_animationFinishedEventHandler != null)
169 //here we send all data to user event handlers
170 _animationFinishedEventHandler(this, null);
174 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
175 private delegate void AnimationProgressReachedEventCallbackType(IntPtr data);
176 private AnimationProgressReachedEventCallbackType _animationProgressReachedEventCallback;
177 private event EventHandler _animationProgressReachedEventHandler;
179 * @brief Event for the ProgressReached signal, which can be used to subscribe or unsubscribe the event handler.
180 * The ProgressReached signal is emitted when the animation has reached a given progress percentage, this is set in the api SetProgressNotification.
182 /// <since_tizen> 3 </since_tizen>
183 public event EventHandler ProgressReached
187 if (_animationProgressReachedEventHandler == null)
189 _animationProgressReachedEventCallback = OnProgressReached;
190 ProgressReachedSignal().Connect(_animationProgressReachedEventCallback);
193 _animationProgressReachedEventHandler += value;
197 _animationProgressReachedEventHandler -= value;
199 if (_animationProgressReachedEventHandler == null && ProgressReachedSignal().Empty() == false)
201 ProgressReachedSignal().Disconnect(_animationProgressReachedEventCallback);
205 private void OnProgressReached(IntPtr data)
207 if (_animationProgressReachedEventHandler != null)
209 //here we send all data to user event handlers
210 _animationProgressReachedEventHandler(this, null);
214 private float MilliSecondsToSeconds(int millisec)
216 return (float)millisec / 1000.0f;
219 private int SecondsToMilliSeconds(float sec)
221 return (int)(sec * 1000);
226 /// Gets or sets the duration in milliseconds of the animation.
228 /// <since_tizen> 3 </since_tizen>
233 SetDuration(MilliSecondsToSeconds(value));
237 return SecondsToMilliSeconds(GetDuration());
242 /// Gets or sets the default alpha function for the animation.
244 /// <since_tizen> 3 </since_tizen>
245 public AlphaFunction DefaultAlphaFunction
249 SetDefaultAlphaFunction(value);
253 AlphaFunction ret = GetDefaultAlphaFunction();
259 /// Queries the state of the animation.
261 /// <since_tizen> 3 </since_tizen>
271 /// Set: Enables looping for a specified number of repeats. A zero is the same as Looping = true; i.e., repeat forever.<br />
272 /// This property resets the looping value and should not be used with the Looping property.<br />
273 /// Setting this parameter does not cause the animation to Play().<br />
274 /// Get: Gets the loop count. A zero is the same as Looping = true; i.e., repeat forever.<br />
275 /// The loop count is initially 1 for play once.<br />
277 /// <since_tizen> 3 </since_tizen>
286 int ret = GetLoopCount();
292 /// Gets or sets the status of whether the animation will loop.<br />
293 /// This property resets the loop count and should not be used with the LoopCount property.<br />
294 /// Setting this parameter does not cause the animation to Play().<br />
296 /// <since_tizen> 3 </since_tizen>
305 bool ret = IsLooping();
312 /// Gets or sets the end action of the animation.<br />
313 /// This action is performed when the animation ends or if it is stopped.<br />
314 /// The default end action is cancel.<br />
316 /// <since_tizen> 3 </since_tizen>
317 public EndActions EndAction
325 return GetEndAction();
331 /// Stops the animation.
333 /// <param name="action">The end action can be set.</param>
334 /// <since_tizen> 3 </since_tizen>
335 public void Stop(EndActions action = EndActions.Cancel)
337 SetEndAction(action);
338 NDalicPINVOKE.Animation_Stop(swigCPtr);
339 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
343 /// Gets the current loop count.<br />
344 /// A value 0 indicating the current loop count when looping.<br />
346 /// <since_tizen> 3 </since_tizen>
347 public int CurrentLoop
351 return GetCurrentLoop();
356 /// Gets or sets the disconnect action.<br />
357 /// If any of the animated property owners are disconnected from the stage while the animation is being played, then this action is performed.<br />
358 /// The default action is cancel.<br />
360 /// <since_tizen> 3 </since_tizen>
361 public EndActions DisconnectAction
365 NDalicPINVOKE.Animation_SetDisconnectAction(swigCPtr, (int)value);
366 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
370 Animation.EndActions ret = (Animation.EndActions)NDalicPINVOKE.Animation_GetDisconnectAction(swigCPtr);
371 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
378 /// Gets or sets the progress of the animation.<br />
379 /// The animation will play (or continue playing) from this point.<br />
380 /// The progress must be in the 0-1 interval or in the play range interval if defined<br />
381 /// otherwise, it will be ignored.<br />
383 /// <since_tizen> 3 </since_tizen>
384 public float CurrentProgress
388 NDalicPINVOKE.Animation_SetCurrentProgress(swigCPtr, value);
389 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
393 float ret = NDalicPINVOKE.Animation_GetCurrentProgress(swigCPtr);
394 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
400 /// Gets or sets specificifications of a speed factor for the animation.<br />
401 /// The speed factor is a multiplier of the normal velocity of the animation.<br />
402 /// Values between [0, 1] will slow down the animation and values above one will speed up the animation.<br />
403 /// It is also possible to specify a negative multiplier to play the animation in reverse.<br />
405 /// <since_tizen> 3 </since_tizen>
406 public float SpeedFactor
410 NDalicPINVOKE.Animation_SetSpeedFactor(swigCPtr, value);
411 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
415 float ret = NDalicPINVOKE.Animation_GetSpeedFactor(swigCPtr);
416 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
422 /// Gets or sets the playing range.<br />
423 /// Animation will play between the values specified. Both values (range.x and range.y ) should be between 0-1,
424 /// otherwise they will be ignored. If the range provided is not in proper order (minimum, maximum ), it will be reordered.<br />
426 /// <since_tizen> 3 </since_tizen>
427 public RelativeVector2 PlayRange
431 NDalicPINVOKE.Animation_SetPlayRange(swigCPtr, Vector2.getCPtr(value));
432 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
436 Vector2 ret = new Vector2(NDalicPINVOKE.Animation_GetPlayRange(swigCPtr), true);
437 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
444 /// Gets or sets the progress notification marker which triggers the ProgressReachedSignal.<br />
445 /// Percentage of animation progress should be greater than 0 and less than 1, for example, 0.3 for 30% <br />
446 /// One notification can be set on each animation.
448 /// <since_tizen> 3 </since_tizen>
449 public float ProgressNotification
453 NDalicPINVOKE.Animation_SetProgressNotification(swigCPtr, value);
454 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
458 float ret = NDalicPINVOKE.Animation_GetProgressNotification(swigCPtr);
459 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
465 /// Animates a property value by a relative amount.<br />
467 /// <param name="target">The target object to animate.</param>
468 /// <param name="property">The target property to animate.</param>
469 /// <param name="relativeValue">The property value will change by this amount.</param>
470 /// <param name="alphaFunction">The alpha function to apply.</param>
471 /// <since_tizen> 3 </since_tizen>
472 public void AnimateBy(View target, string property, object relativeValue, AlphaFunction alphaFunction = null)
474 Property _prop = PropertyHelper.GetPropertyFromString(target, property);
476 PropertyType propertyType = target.GetPropertyType(_prop.propertyIndex);
477 if(propertyType.Equals(PropertyType.Float))
479 System.Type type = relativeValue.GetType();
480 if (type.Equals(typeof(System.Int32)) || type.Equals(typeof(int)))
482 int num = (int)relativeValue;
483 relativeValue = (float)num;
487 PropertyValue val = PropertyValue.CreateFromObject(relativeValue);
489 if (alphaFunction != null)
491 AnimateBy(_prop, val, alphaFunction);
495 AnimateBy(_prop, val);
500 /// Animates a property value by a relative amount.<br />
502 /// <param name="target">The target object to animate.</param>
503 /// <param name="property">The target property to animate.</param>
504 /// <param name="relativeValue">The property value will change by this amount.</param>
505 /// <param name="startTime">The start time of the animation.</param>
506 /// <param name="endTime">The end time of the animation.</param>
507 /// <param name="alphaFunction">The alpha function to apply.</param>
508 /// <since_tizen> 3 </since_tizen>
509 public void AnimateBy(View target, string property, object relativeValue, int startTime, int endTime, AlphaFunction alphaFunction = null)
511 Property _prop = PropertyHelper.GetPropertyFromString(target, property);
513 PropertyType propertyType = target.GetPropertyType(_prop.propertyIndex);
514 if(propertyType.Equals(PropertyType.Float))
516 System.Type type = relativeValue.GetType();
517 if (type.Equals(typeof(System.Int32)) || type.Equals(typeof(int)))
519 int num = (int)relativeValue;
520 relativeValue = (float)num;
524 PropertyValue val = PropertyValue.CreateFromObject(relativeValue);
526 if (alphaFunction != null)
528 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
529 AnimateBy(_prop, val, alphaFunction, time);
533 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
534 AnimateBy(_prop, val, time);
539 /// Animates a property to a destination value.<br />
541 /// <param name="target">The target object to animate.</param>
542 /// <param name="property">The target property to animate.</param>
543 /// <param name="destinationValue">The destination value.</param>
544 /// <param name="alphaFunction">The alpha function to apply.</param>
545 /// <since_tizen> 3 </since_tizen>
546 public void AnimateTo(View target, string property, object destinationValue, AlphaFunction alphaFunction = null)
548 Property _prop = PropertyHelper.GetPropertyFromString(target, property);
550 PropertyType propertyType = target.GetPropertyType(_prop.propertyIndex);
551 if(propertyType.Equals(PropertyType.Float))
553 System.Type type = destinationValue.GetType();
554 if (type.Equals(typeof(System.Int32)) || type.Equals(typeof(int)))
556 int num = (int)destinationValue;
557 destinationValue = (float)num;
561 PropertyValue val = PropertyValue.CreateFromObject(destinationValue);
563 if (alphaFunction != null)
565 AnimateTo(_prop, val, alphaFunction);
569 AnimateTo(_prop, val);
572 private string[] _properties = null;
575 /// Gets or sets the properties of the animation.
577 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
578 [EditorBrowsable(EditorBrowsableState.Never)]
579 public string[] Properties
591 private string[] _destValue = null;
594 /// Gets or sets the destination value for each property of the animation.
596 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
597 [EditorBrowsable(EditorBrowsableState.Never)]
598 public string[] DestValue
610 private int[] _startTime = null;
613 /// Gets or sets the start time for each property of the animation.
615 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
616 [EditorBrowsable(EditorBrowsableState.Never)]
617 public int[] StartTime
629 private int[] _endTime = null;
632 /// Gets or sets the end time for each property of the animation.
634 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
635 [EditorBrowsable(EditorBrowsableState.Never)]
649 /// Animates one or more properties to a destination value.<br />
651 /// <param name="target">The target object to animate.</param>
652 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
653 [EditorBrowsable(EditorBrowsableState.Never)]
654 public void PlayAnimateTo(View target)
657 if (_properties.Length == _destValue.Length && _startTime.Length == _endTime.Length && _properties.Length == _startTime.Length)
659 int length = _properties.Length;
660 for (int index = 0; index < length; index++)
662 //object destinationValue = _destValue[index];
663 var elementType = target.GetType();
664 PropertyInfo propertyInfo = elementType.GetProperties().FirstOrDefault(fi => fi.Name == _properties[index]);
665 //var propertyInfo = elementType.GetRuntimeProperties().FirstOrDefault(p => p.Name == localName);
666 if (propertyInfo != null)
668 object destinationValue = ConvertTo(_destValue[index], propertyInfo.PropertyType);
670 if(destinationValue != null)
672 AnimateTo(target, _properties[index], destinationValue, _startTime[index], _endTime[index]);
680 internal object ConvertTo(object value, Type toType)
682 Func<object> getConverter = () =>
684 MemberInfo memberInfo;
686 string converterTypeName = GetTypeConverterTypeName(toType.GetTypeInfo().CustomAttributes);
687 if (converterTypeName == null)
690 Type convertertype = Type.GetType(converterTypeName);
691 return Activator.CreateInstance(convertertype);
694 return ConvertTo(value, toType, getConverter);
697 internal object ConvertTo(object value, Type toType, Func<object> getConverter)
702 var str = value as string;
705 //If there's a [TypeConverter], use it
706 object converter = getConverter?.Invoke();
707 var xfTypeConverter = converter as Tizen.NUI.Binding.TypeConverter;
708 if (xfTypeConverter != null)
709 return value = xfTypeConverter.ConvertFromInvariantString(str);
710 var converterType = converter?.GetType();
711 if (converterType != null)
713 var convertFromStringInvariant = converterType.GetRuntimeMethod("ConvertFromInvariantString",
714 new[] { typeof(string) });
715 if (convertFromStringInvariant != null)
716 return value = convertFromStringInvariant.Invoke(converter, new object[] { str });
719 //If the type is nullable, as the value is not null, it's safe to assume we want the built-in conversion
720 if (toType.GetTypeInfo().IsGenericType && toType.GetGenericTypeDefinition() == typeof(Nullable<>))
721 toType = Nullable.GetUnderlyingType(toType);
723 //Obvious Built-in conversions
724 if (toType.GetTypeInfo().IsEnum)
725 return Enum.Parse(toType, str, true);
726 if (toType == typeof(SByte))
727 return SByte.Parse(str, CultureInfo.InvariantCulture);
728 if (toType == typeof(Int16))
729 return Int16.Parse(str, CultureInfo.InvariantCulture);
730 if (toType == typeof(Int32))
731 return Int32.Parse(str, CultureInfo.InvariantCulture);
732 if (toType == typeof(Int64))
733 return Int64.Parse(str, CultureInfo.InvariantCulture);
734 if (toType == typeof(Byte))
735 return Byte.Parse(str, CultureInfo.InvariantCulture);
736 if (toType == typeof(UInt16))
737 return UInt16.Parse(str, CultureInfo.InvariantCulture);
738 if (toType == typeof(UInt32))
739 return UInt32.Parse(str, CultureInfo.InvariantCulture);
740 if (toType == typeof(UInt64))
741 return UInt64.Parse(str, CultureInfo.InvariantCulture);
742 if (toType == typeof(Single))
743 return Single.Parse(str, CultureInfo.InvariantCulture);
744 if (toType == typeof(Double))
745 return Double.Parse(str, CultureInfo.InvariantCulture);
746 if (toType == typeof(Boolean))
747 return Boolean.Parse(str);
748 if (toType == typeof(TimeSpan))
749 return TimeSpan.Parse(str, CultureInfo.InvariantCulture);
750 if (toType == typeof(DateTime))
751 return DateTime.Parse(str, CultureInfo.InvariantCulture);
752 if (toType == typeof(Char))
755 Char.TryParse(str, out c);
758 if (toType == typeof(String) && str.StartsWith("{}", StringComparison.Ordinal))
759 return str.Substring(2);
760 if (toType == typeof(String))
762 if (toType == typeof(Decimal))
763 return Decimal.Parse(str, CultureInfo.InvariantCulture);
766 //if the value is not assignable and there's an implicit conversion, convert
767 if (value != null && !toType.IsAssignableFrom(value.GetType()))
769 var opImplicit = GetImplicitConversionOperator(value.GetType(), value.GetType(), toType)
770 ?? GetImplicitConversionOperator(toType, value.GetType(), toType);
771 //var opImplicit = value.GetType().GetImplicitConversionOperator(fromType: value.GetType(), toType: toType)
772 // ?? toType.GetImplicitConversionOperator(fromType: value.GetType(), toType: toType);
774 if (opImplicit != null)
776 value = opImplicit.Invoke(null, new[] { value });
781 var nativeValueConverterService = DependencyService.Get<INativeValueConverterService>();
783 object nativeValue = null;
784 if (nativeValueConverterService != null && nativeValueConverterService.ConvertTo(value, toType, out nativeValue))
790 internal string GetTypeConverterTypeName(IEnumerable<CustomAttributeData> attributes)
792 var converterAttribute =
793 attributes.FirstOrDefault(cad => Tizen.NUI.Binding.TypeConverterAttribute.TypeConvertersType.Contains(cad.AttributeType.FullName));
794 if (converterAttribute == null)
796 if (converterAttribute.ConstructorArguments[0].ArgumentType == typeof(string))
797 return (string)converterAttribute.ConstructorArguments[0].Value;
798 if (converterAttribute.ConstructorArguments[0].ArgumentType == typeof(Type))
799 return ((Type)converterAttribute.ConstructorArguments[0].Value).AssemblyQualifiedName;
803 internal MethodInfo GetImplicitConversionOperator(Type onType, Type fromType, Type toType)
806 var mi = onType.GetRuntimeMethod("op_Implicit", new[] { fromType });
808 var bindingFlags = BindingFlags.Public | BindingFlags.Static | BindingFlags.FlattenHierarchy;
809 var mi = onType.GetMethod("op_Implicit", bindingFlags, null, new[] { fromType }, null);
811 if (mi == null) return null;
812 if (!mi.IsSpecialName) return null;
813 if (!mi.IsPublic) return null;
814 if (!mi.IsStatic) return null;
815 if (!toType.IsAssignableFrom(mi.ReturnType)) return null;
822 /// Animates a property to a destination value.<br />
824 /// <param name="target">The target object to animate.</param>
825 /// <param name="property">The target property to animate.</param>
826 /// <param name="destinationValue">The destination value.</param>
827 /// <param name="startTime">The start time of the animation.</param>
828 /// <param name="endTime">The end time of the animation.</param>
829 /// <param name="alphaFunction">The alpha function to apply.</param>
830 /// <since_tizen> 3 </since_tizen>
831 public void AnimateTo(View target, string property, object destinationValue, int startTime, int endTime, AlphaFunction alphaFunction = null)
833 Property _prop = PropertyHelper.GetPropertyFromString(target, property);
835 PropertyType propertyType = target.GetPropertyType(_prop.propertyIndex);
836 if(propertyType.Equals(PropertyType.Float))
838 System.Type type = destinationValue.GetType();
839 if (type.Equals(typeof(System.Int32)) || type.Equals(typeof(int)))
841 int num = (int)destinationValue;
842 destinationValue = (float)num;
846 PropertyValue val = PropertyValue.CreateFromObject(destinationValue);
848 if (alphaFunction != null)
850 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
851 AnimateTo(_prop, val, alphaFunction, time);
855 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
856 AnimateTo(_prop, val, time);
861 /// Animates a property between keyframes.
863 /// <param name="target">The target object to animate.</param>
864 /// <param name="property">The target property to animate.</param>
865 /// <param name="keyFrames">The set of time or value pairs between which to animate.</param>
866 /// <param name="interpolation">The method used to interpolate between values.</param>
867 /// <param name="alphaFunction">The alpha function to apply.</param>
868 /// <since_tizen> 3 </since_tizen>
869 public void AnimateBetween(View target, string property, KeyFrames keyFrames, Interpolation interpolation = Interpolation.Linear, AlphaFunction alphaFunction = null)
871 Property _prop = PropertyHelper.GetPropertyFromString(target, property);
873 if (_prop.propertyIndex == Property.INVALID_INDEX)
875 throw new System.ArgumentException("second argument string property is invalid parameter!");
878 if (alphaFunction != null)
880 AnimateBetween(_prop, keyFrames, alphaFunction, interpolation);
884 AnimateBetween(_prop, keyFrames, interpolation);
890 /// Animates a property between keyframes.
892 /// <param name="target">The target object to animate</param>
893 /// <param name="property">The target property to animate</param>
894 /// <param name="keyFrames">The set of time/value pairs between which to animate</param>
895 /// <param name="startTime">The start time of animation in milliseconds.</param>
896 /// <param name="endTime">The end time of animation in milliseconds.</param>
897 /// <param name="interpolation">The method used to interpolate between values.</param>
898 /// <param name="alphaFunction">The alpha function to apply.</param>
899 /// <since_tizen> 3 </since_tizen>
900 public void AnimateBetween(View target, string property, KeyFrames keyFrames, int startTime, int endTime, Interpolation interpolation = Interpolation.Linear, AlphaFunction alphaFunction = null)
902 Property _prop = PropertyHelper.GetPropertyFromString(target, property);
904 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
905 if (alphaFunction != null)
907 AnimateBetween(_prop, keyFrames, alphaFunction, time, interpolation);
911 AnimateBetween(_prop, keyFrames, time, interpolation);
916 /// Animates the view's position and orientation through a predefined path.<br />
917 /// The view will rotate to orient the supplied forward vector with the path's tangent.<br />
918 /// If forward is the zero vector then no rotation will happen.<br />
920 /// <param name="view">The view to animate.</param>
921 /// <param name="path">It defines position and orientation.</param>
922 /// <param name="forward">The vector (in local space coordinate system) will be oriented with the path's tangent direction.</param>
923 /// <param name="alphaFunction">The alpha function to apply.</param>
924 /// <since_tizen> 3 </since_tizen>
925 public void AnimatePath(View view, Path path, Vector3 forward, AlphaFunction alphaFunction = null)
927 if (alphaFunction == null)
929 Animate(view, path, forward);
933 Animate(view, path, forward, alphaFunction);
938 /// Animates the view's position and orientation through a predefined path.<br />
939 /// The view will rotate to orient the supplied forward vector with the path's tangent.<br />
940 /// If forward is the zero vector then no rotation will happen.<br />
942 /// <param name="view">The view to animate.</param>
943 /// <param name="path">It defines position and orientation.</param>
944 /// <param name="forward">The vector (in local space coordinate system) will be oriented with the path's tangent direction.</param>
945 /// <param name="startTime">The start time of the animation.</param>
946 /// <param name="endTime">The end time of the animation.</param>
947 /// <param name="alphaFunction">The alpha function to apply.</param>
948 /// <since_tizen> 3 </since_tizen>
949 public void AnimatePath(View view, Path path, Vector3 forward, int startTime, int endTime, AlphaFunction alphaFunction = null)
951 TimePeriod time = new TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
952 if (alphaFunction == null)
954 Animate(view, path, forward, time);
958 Animate(view, path, forward, alphaFunction, time);
963 /// Creates an initialized animation.<br />
964 /// The animation will not loop.<br />
965 /// The default end action is "Cancel".<br />
966 /// The default alpha function is linear.<br />
968 /// <since_tizen> 3 </since_tizen>
969 public Animation() : this(NDalicPINVOKE.Animation_New(0.0f), true)
971 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
974 internal Animation(float durationSeconds) : this(NDalicPINVOKE.Animation_New(durationSeconds), true)
976 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
981 /// Downcasts a handle to animation handle.<br />
982 /// If handle points to an animation object, the downcast produces a valid handle.<br />
983 /// If not, the returned handle is left uninitialized.<br />
985 /// <param name="handle">Handle to an object.</param>
986 /// <returns>Handle to an animation object or an uninitialized handle.</returns>
987 /// <since_tizen> 3 </since_tizen>
988 public static Animation DownCast(BaseHandle handle)
990 Animation ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as Animation;
991 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
995 internal Animation(Animation handle) : this(NDalicPINVOKE.new_Animation__SWIG_1(Animation.getCPtr(handle)), true)
997 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1000 internal Animation Assign(Animation rhs)
1002 Animation ret = new Animation(NDalicPINVOKE.Animation_Assign(swigCPtr, Animation.getCPtr(rhs)), false);
1003 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1007 internal void SetDuration(float seconds)
1009 NDalicPINVOKE.Animation_SetDuration(swigCPtr, seconds);
1010 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1013 internal float GetDuration()
1015 float ret = NDalicPINVOKE.Animation_GetDuration(swigCPtr);
1016 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1020 internal void SetLooping(bool looping)
1022 NDalicPINVOKE.Animation_SetLooping(swigCPtr, looping);
1023 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1026 internal void SetLoopCount(int count)
1028 NDalicPINVOKE.Animation_SetLoopCount(swigCPtr, count);
1029 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1032 internal int GetLoopCount()
1034 int ret = NDalicPINVOKE.Animation_GetLoopCount(swigCPtr);
1035 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1039 internal int GetCurrentLoop()
1041 int ret = NDalicPINVOKE.Animation_GetCurrentLoop(swigCPtr);
1042 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1046 internal bool IsLooping()
1048 bool ret = NDalicPINVOKE.Animation_IsLooping(swigCPtr);
1049 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1053 internal void SetEndAction(Animation.EndActions action)
1055 NDalicPINVOKE.Animation_SetEndAction(swigCPtr, (int)action);
1056 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1059 internal Animation.EndActions GetEndAction()
1061 Animation.EndActions ret = (Animation.EndActions)NDalicPINVOKE.Animation_GetEndAction(swigCPtr);
1062 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1066 internal void SetDisconnectAction(Animation.EndActions disconnectAction)
1068 NDalicPINVOKE.Animation_SetDisconnectAction(swigCPtr, (int)disconnectAction);
1069 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1072 internal Animation.EndActions GetDisconnectAction()
1074 Animation.EndActions ret = (Animation.EndActions)NDalicPINVOKE.Animation_GetDisconnectAction(swigCPtr);
1075 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1079 internal void SetDefaultAlphaFunction(AlphaFunction alpha)
1081 NDalicPINVOKE.Animation_SetDefaultAlphaFunction(swigCPtr, AlphaFunction.getCPtr(alpha));
1082 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1085 internal AlphaFunction GetDefaultAlphaFunction()
1087 AlphaFunction ret = new AlphaFunction(NDalicPINVOKE.Animation_GetDefaultAlphaFunction(swigCPtr), true);
1088 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1092 internal void SetCurrentProgress(float progress)
1094 NDalicPINVOKE.Animation_SetCurrentProgress(swigCPtr, progress);
1095 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1098 internal float GetCurrentProgress()
1100 float ret = NDalicPINVOKE.Animation_GetCurrentProgress(swigCPtr);
1101 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1105 internal void SetSpeedFactor(float factor)
1107 NDalicPINVOKE.Animation_SetSpeedFactor(swigCPtr, factor);
1108 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1111 internal float GetSpeedFactor()
1113 float ret = NDalicPINVOKE.Animation_GetSpeedFactor(swigCPtr);
1114 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1118 internal void SetPlayRange(Vector2 range)
1120 NDalicPINVOKE.Animation_SetPlayRange(swigCPtr, Vector2.getCPtr(range));
1121 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1124 internal Vector2 GetPlayRange()
1126 Vector2 ret = new Vector2(NDalicPINVOKE.Animation_GetPlayRange(swigCPtr), true);
1127 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1131 private static bool? disableAnimation = null;
1132 private bool DisableAnimation
1136 if (disableAnimation.HasValue == false)
1138 string type = Environment.GetEnvironmentVariable("PlatformSmartType");
1139 if (type == "Entry")
1140 disableAnimation = true;
1142 disableAnimation = false;
1144 return disableAnimation.Value;
1149 /// Plays the animation.
1151 /// <since_tizen> 3 </since_tizen>
1154 NDalicPINVOKE.Animation_Play(swigCPtr);
1155 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1157 if (DisableAnimation == true)
1158 Stop(EndActions.StopFinal);
1162 /// Plays the animation from a given point.<br />
1163 /// The progress must be in the 0-1 interval or in the play range interval if defined,
1164 /// otherwise, it will be ignored.<br />
1166 /// <param name="progress">A value between [0,1], or between the play range if specified, from where the animation should start playing.</param>
1167 /// <since_tizen> 3 </since_tizen>
1168 public void PlayFrom(float progress)
1170 NDalicPINVOKE.Animation_PlayFrom(swigCPtr, progress);
1171 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1175 /// Plays the animation after a given delay time.<br/>
1176 /// The delay time is not included in the looping time.<br/>
1177 /// When the delay time is a negative value, it would treat as play immediately.<br/>
1179 /// <param name="delayMilliseconds">The delay time.</param>
1180 /// <since_tizen> 4 </since_tizen>
1181 public void PlayAfter(int delayMilliseconds)
1183 NDalicPINVOKE.Animation_PlayAfter(swigCPtr, MilliSecondsToSeconds(delayMilliseconds));
1184 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1188 /// Pauses the animation.
1190 /// <since_tizen> 3 </since_tizen>
1193 NDalicPINVOKE.Animation_Pause(swigCPtr);
1194 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1197 internal Animation.States GetState()
1199 Animation.States ret = (Animation.States)NDalicPINVOKE.Animation_GetState(swigCPtr);
1200 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1205 /// Stops the animation.
1207 /// <since_tizen> 3 </since_tizen>
1210 NDalicPINVOKE.Animation_Stop(swigCPtr);
1211 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1215 /// Clears the animation.<br />
1216 /// This disconnects any objects that were being animated, effectively stopping the animation.<br />
1218 /// <since_tizen> 3 </since_tizen>
1221 NDalicPINVOKE.Animation_Clear(swigCPtr);
1222 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1225 internal AnimationSignal FinishedSignal()
1227 AnimationSignal ret = new AnimationSignal(NDalicPINVOKE.Animation_FinishedSignal(swigCPtr), false);
1228 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1232 internal AnimationSignal ProgressReachedSignal()
1234 AnimationSignal ret = new AnimationSignal(NDalicPINVOKE.Animation_ProgressReachedSignal(swigCPtr), false);
1235 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1239 internal void AnimateBy(Property target, PropertyValue relativeValue)
1241 NDalicPINVOKE.Animation_AnimateBy__SWIG_0(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(relativeValue));
1242 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1245 internal void AnimateBy(Property target, PropertyValue relativeValue, AlphaFunction alpha)
1247 NDalicPINVOKE.Animation_AnimateBy__SWIG_1(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(relativeValue), AlphaFunction.getCPtr(alpha));
1248 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1251 internal void AnimateBy(Property target, PropertyValue relativeValue, TimePeriod period)
1253 NDalicPINVOKE.Animation_AnimateBy__SWIG_2(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(relativeValue), TimePeriod.getCPtr(period));
1254 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1257 internal void AnimateBy(Property target, PropertyValue relativeValue, AlphaFunction alpha, TimePeriod period)
1259 NDalicPINVOKE.Animation_AnimateBy__SWIG_3(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(relativeValue), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
1260 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1263 internal void AnimateTo(Property target, PropertyValue destinationValue)
1265 NDalicPINVOKE.Animation_AnimateTo__SWIG_0(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(destinationValue));
1266 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1269 internal void AnimateTo(Property target, PropertyValue destinationValue, AlphaFunction alpha)
1271 NDalicPINVOKE.Animation_AnimateTo__SWIG_1(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(destinationValue), AlphaFunction.getCPtr(alpha));
1272 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1275 internal void AnimateTo(Property target, PropertyValue destinationValue, TimePeriod period)
1277 NDalicPINVOKE.Animation_AnimateTo__SWIG_2(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(destinationValue), TimePeriod.getCPtr(period));
1278 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1281 internal void AnimateTo(Property target, PropertyValue destinationValue, AlphaFunction alpha, TimePeriod period)
1283 NDalicPINVOKE.Animation_AnimateTo__SWIG_3(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(destinationValue), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
1284 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1287 internal void AnimateBetween(Property target, KeyFrames keyFrames)
1289 NDalicPINVOKE.Animation_AnimateBetween__SWIG_0(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames));
1290 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1293 internal void AnimateBetween(Property target, KeyFrames keyFrames, Animation.Interpolation interpolation)
1295 NDalicPINVOKE.Animation_AnimateBetween__SWIG_1(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), (int)interpolation);
1296 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1299 internal void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha)
1301 NDalicPINVOKE.Animation_AnimateBetween__SWIG_2(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha));
1302 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1305 internal void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha, Animation.Interpolation interpolation)
1307 NDalicPINVOKE.Animation_AnimateBetween__SWIG_3(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha), (int)interpolation);
1308 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1311 internal void AnimateBetween(Property target, KeyFrames keyFrames, TimePeriod period)
1313 NDalicPINVOKE.Animation_AnimateBetween__SWIG_4(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), TimePeriod.getCPtr(period));
1314 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1317 internal void AnimateBetween(Property target, KeyFrames keyFrames, TimePeriod period, Animation.Interpolation interpolation)
1319 NDalicPINVOKE.Animation_AnimateBetween__SWIG_5(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), TimePeriod.getCPtr(period), (int)interpolation);
1320 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1323 internal void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha, TimePeriod period)
1325 NDalicPINVOKE.Animation_AnimateBetween__SWIG_6(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
1326 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1329 internal void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha, TimePeriod period, Animation.Interpolation interpolation)
1331 NDalicPINVOKE.Animation_AnimateBetween__SWIG_7(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period), (int)interpolation);
1332 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1335 internal void Animate(View view, Path path, Vector3 forward)
1337 NDalicPINVOKE.Animation_Animate__SWIG_0(swigCPtr, View.getCPtr(view), Path.getCPtr(path), Vector3.getCPtr(forward));
1338 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1341 internal void Animate(View view, Path path, Vector3 forward, AlphaFunction alpha)
1343 NDalicPINVOKE.Animation_Animate__SWIG_1(swigCPtr, View.getCPtr(view), Path.getCPtr(path), Vector3.getCPtr(forward), AlphaFunction.getCPtr(alpha));
1344 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1347 internal void Animate(View view, Path path, Vector3 forward, TimePeriod period)
1349 NDalicPINVOKE.Animation_Animate__SWIG_2(swigCPtr, View.getCPtr(view), Path.getCPtr(path), Vector3.getCPtr(forward), TimePeriod.getCPtr(period));
1350 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1353 internal void Animate(View view, Path path, Vector3 forward, AlphaFunction alpha, TimePeriod period)
1355 NDalicPINVOKE.Animation_Animate__SWIG_3(swigCPtr, View.getCPtr(view), Path.getCPtr(path), Vector3.getCPtr(forward), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
1356 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1359 internal void Show(View view, float delaySeconds)
1361 NDalicPINVOKE.Animation_Show(swigCPtr, View.getCPtr(view), delaySeconds);
1362 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1365 internal void Hide(View view, float delaySeconds)
1367 NDalicPINVOKE.Animation_Hide(swigCPtr, View.getCPtr(view), delaySeconds);
1368 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1372 /// Enumeration for what to do when the animation ends, stopped, or destroyed.
1374 /// <since_tizen> 3 </since_tizen>
1375 public enum EndActions
1378 /// When the animation ends, the animated property values are saved.
1382 /// When the animation ends, the animated property values are forgotten.
1386 /// If the animation is stopped, the animated property values are saved as if the animation had run to completion, otherwise behaves like cancel.
1392 /// Enumeration for what interpolation method to use on key-frame animations.
1394 /// <since_tizen> 3 </since_tizen>
1395 public enum Interpolation
1398 /// Values in between key frames are interpolated using a linear polynomial. (Default)
1402 /// Values in between key frames are interpolated using a cubic polynomial.
1408 /// Enumeration for what state the animation is in.
1410 /// <remarks>Calling Reset() on this class will not reset the animation. It will call the BaseHandle.Reset() which drops the object handle.</remarks>
1411 /// <since_tizen> 3 </since_tizen>
1415 /// The animation has stopped.
1419 /// The animation is playing.
1423 /// The animation is paused.