2 * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
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 /// Enumeration for the AnimationView state
24 /// <since_tizen> preview </since_tizen>
25 [Obsolete("This has been deprecated in API12")]
26 public enum AnimationViewState
29 /// Animation is not ready to play.
34 /// Animation is on playing.
39 /// Animation is on reverse playing.
44 /// Animation has been paused.
49 /// AnimationView successfully loaded a file then readied for playing. Otherwise after finished animation or stopped forcely by request.
55 /// The AnimationView is designed to show and play animation of vector graphics based content.
56 /// Currently ElmSharp AnimationView is supporting only json format (known for Lottie file as well).
58 /// <since_tizen> preview </since_tizen>
59 [Obsolete("This has been deprecated in API12")]
60 public class AnimationView : EvasObject
62 private SmartEvent _started;
63 private SmartEvent _repeated;
64 private SmartEvent _finished;
65 private SmartEvent _paused;
66 private SmartEvent _resumed;
67 private SmartEvent _stopped;
68 private SmartEvent _updated;
71 /// Creates and initializes a new instance of the AnimationView class.
73 /// <param name="parent">The parent is a given container, which will be attached by AnimationView as a child. It's <see cref="EvasObject"/> type.</param>
74 /// <since_tizen> preview </since_tizen>
75 [Obsolete("This has been deprecated in API12")]
76 public AnimationView(EvasObject parent) : base(parent)
78 _started = new SmartEvent(this, this.Handle, "play,start");
79 _repeated = new SmartEvent(this, this.Handle, "play,repeat");
80 _finished = new SmartEvent(this, this.Handle, "play,done");
81 _paused = new SmartEvent(this, this.Handle, "play,pause");
82 _resumed = new SmartEvent(this, this.Handle, "play,resume");
83 _stopped = new SmartEvent(this, this.Handle, "play,stop");
84 _updated = new SmartEvent(this, this.Handle, "play,update");
86 _started.On += (sender, e) =>
88 Started?.Invoke(this, EventArgs.Empty);
91 _repeated.On += (sender, e) =>
93 Repeated?.Invoke(this, EventArgs.Empty);
96 _finished.On += (sender, e) =>
98 Finished?.Invoke(this, EventArgs.Empty);
101 _paused.On += (sender, e) =>
103 Paused?.Invoke(this, EventArgs.Empty);
106 _resumed.On += (sender, e) =>
108 Resumed?.Invoke(this, EventArgs.Empty);
111 _stopped.On += (sender, e) =>
113 Stopped?.Invoke(this, EventArgs.Empty);
116 _updated.On += (sender, e) =>
118 Updated?.Invoke(this, EventArgs.Empty);
123 /// It occurs when the animation is just started.
125 /// <since_tizen> preview </since_tizen>
126 [Obsolete("This has been deprecated in API12")]
127 public event EventHandler Started;
130 /// It occurs when the animation is just repeated.
132 /// <since_tizen> preview </since_tizen>
133 [Obsolete("This has been deprecated in API12")]
134 public event EventHandler Repeated;
137 /// It occurs when the animation is just finished.
139 /// <since_tizen> preview </since_tizen>
140 [Obsolete("This has been deprecated in API12")]
141 public event EventHandler Finished;
144 /// It occurs when the animation is just paused.
146 /// <since_tizen> preview </since_tizen>
147 [Obsolete("This has been deprecated in API12")]
148 public event EventHandler Paused;
151 /// It occurs when the animation is just resumed.
153 /// <since_tizen> preview </since_tizen>
154 [Obsolete("This has been deprecated in API12")]
155 public event EventHandler Resumed;
158 /// It occurs when the animation is just stopped.
160 /// <since_tizen> preview </since_tizen>
161 [Obsolete("This has been deprecated in API12")]
162 public event EventHandler Stopped;
165 /// It occurs when the animation is updated to the next frame.
167 /// <since_tizen> preview </since_tizen>
168 [Obsolete("This has been deprecated in API12")]
169 public event EventHandler Updated;
172 /// Sets or gets whether to play animation automatically.
174 /// If AutoPlay is true, animation will be started when it's readied.
175 /// The condition of AutoPlay is when AnimationView opened file successfully, yet to play it plus when the object is visible.
176 /// If AnimationView is disabled, invisible, it turns to pause state then resume animation when it's visible again.
177 /// This AutoPlay will be only affected to the next animation source. So must be called before SetAnimation()
180 /// <since_tizen> preview </since_tizen>
181 [Obsolete("This has been deprecated in API12")]
186 return Interop.Elementary.elm_animation_view_auto_play_get(Handle);
190 Interop.Elementary.elm_animation_view_auto_play_set(Handle, value);
195 /// Sets or gets whether to turn on/off animation looping.
197 /// If AutoRepeat is true, it repeats animation when animation frame is reached to end.
198 /// This AutoRepeat mode is valid to both Play and ReversePlay cases.
201 /// <since_tizen> preview </since_tizen>
202 [Obsolete("This has been deprecated in API12")]
203 public bool AutoRepeat
207 return Interop.Elementary.elm_animation_view_auto_repeat_get(Handle);
211 Interop.Elementary.elm_animation_view_auto_repeat_set(Handle, value);
216 /// Sets or gets the animation speed.
218 /// Control animation speed by multiplying Speed value.
219 /// If you want to play animation double-time faster, you can give Speed 2.
220 /// If you want to play animation double-time slower, you can give Speed 0.5.
221 /// Speed must be greater than zero.
224 /// <since_tizen> preview </since_tizen>
225 [Obsolete("This has been deprecated in API12")]
230 return Interop.Elementary.elm_animation_view_speed_get(Handle);
234 Interop.Elementary.elm_animation_view_speed_set(Handle, value);
239 /// Get the duration of animation in seconds.
242 /// Returns total duration time of current animation in the seconds.
243 /// If current animation source isn't animatable, it returns zero.
245 /// <since_tizen> preview </since_tizen>
246 [Obsolete("This has been deprecated in API12")]
247 public double DurationTime
251 return Interop.Elementary.elm_animation_view_duration_time_get(Handle);
256 /// Sets or gets current progress position of animation view.
258 /// When you required to jump on a certain progress instantly,
259 /// you can change current position by using this property
260 /// The range of progress is 0 ~ 1.
263 /// <since_tizen> preview </since_tizen>
264 [Obsolete("This has been deprecated in API12")]
265 public double Progress
269 return Interop.Elementary.elm_animation_view_progress_get(Handle);
273 Interop.Elementary.elm_animation_view_progress_set(Handle, value);
278 /// Sets or gets current frame position of animation view.
280 /// The range of frame is from 0 to FrameCount - 1
283 /// <since_tizen> preview </since_tizen>
284 [Obsolete("This has been deprecated in API12")]
289 return Interop.Elementary.elm_animation_view_frame_get(Handle);
293 Interop.Elementary.elm_animation_view_frame_set(Handle, value);
298 /// Get the default view size that specified from vector resource.
300 /// <since_tizen> preview </since_tizen>
301 [Obsolete("This has been deprecated in API12")]
302 public Size DefaultSize
306 Interop.Elementary.elm_animation_view_default_size_get(Handle, out int w, out int h);
307 return new Size(w, h);
312 /// Get current animation view state.
314 /// <since_tizen> preview </since_tizen>
315 [Obsolete("This has been deprecated in API12")]
316 public AnimationViewState State
320 return (AnimationViewState)Interop.Elementary.elm_animation_view_state_get(Handle);
325 /// Get the status whether current animation is on playing forward or backward.
328 /// If AnimationView is not on playing, it will return False.
330 /// <since_tizen> preview </since_tizen>
331 [Obsolete("This has been deprecated in API12")]
332 public bool IsReversedPlaying
336 return Interop.Elementary.elm_animation_view_is_playing_back(Handle);
341 /// Get the index of end frame of the AnimationView, if it's animated.
344 /// Frame number starts with 0.
346 /// <since_tizen> preview </since_tizen>
347 [Obsolete("This has been deprecated in API12")]
348 public int FrameCount
352 return Interop.Elementary.elm_animation_view_frame_count_get(Handle);
357 /// Sets or Gets the start progress of the play
360 /// Default value is 0.
362 /// <since_tizen> preview </since_tizen>
363 [Obsolete("This has been deprecated in API12")]
364 public double MinProgress
368 return Interop.Elementary.elm_animation_view_min_progress_get(Handle);
372 Interop.Elementary.elm_animation_view_min_progress_set(Handle, value);
377 /// Sets or Gets the last progress of the play
380 /// Default value is 1.
382 /// <since_tizen> preview </since_tizen>
383 [Obsolete("This has been deprecated in API12")]
384 public double MaxProgress
388 return Interop.Elementary.elm_animation_view_max_progress_get(Handle);
392 Interop.Elementary.elm_animation_view_max_progress_set(Handle, value);
397 /// Sets or Gets the start frame of the play
400 /// Default value is 0.
402 /// <since_tizen> preview </since_tizen>
403 [Obsolete("This has been deprecated in API12")]
408 return Interop.Elementary.elm_animation_view_min_frame_get(Handle);
412 Interop.Elementary.elm_animation_view_min_frame_set(Handle, value);
417 /// Sets or Gets the last frame of the play
420 /// Default value is FrameCount -1.
422 /// <since_tizen> preview </since_tizen>
423 [Obsolete("This has been deprecated in API12")]
428 return Interop.Elementary.elm_animation_view_max_frame_get(Handle);
432 Interop.Elementary.elm_animation_view_max_frame_set(Handle, value);
437 /// Sets the animation source file.
439 /// <param name="file">The animation file path.</param>
440 /// <since_tizen> preview </since_tizen>
441 [Obsolete("This has been deprecated in API12")]
442 public void SetAnimation(string file)
444 Interop.Elementary.elm_animation_view_file_set(Handle, file, null);
448 /// Play animation one time instantly when it's available.
450 /// If current keyframe is on a certain position by playing reverse, this will play forward from there.
451 /// Play request will be ignored if animation source is not set yet or animation is paused state or it's already on playing.
454 /// <since_tizen> preview </since_tizen>
455 [Obsolete("This has been deprecated in API12")]
458 Interop.Elementary.elm_animation_view_play(Handle);
462 /// Play animation one time instantly when it's available.
464 /// If current keyframe is on a certain position by playing reverse and isReverse is ture, this will play forward from there.
465 /// And if current keyframe is on a certain position by playing and isReverse is false, this will play backward from there.
466 /// Play request will be ignored if animation source is not set yet or animation is paused state or it's already on playing.
469 /// <param name="isReverse">Whether the animation play or reverse play.</param>
470 /// <since_tizen> preview </since_tizen>
471 [Obsolete("This has been deprecated in API12")]
472 public void Play(bool isReverse)
476 Interop.Elementary.elm_animation_view_play(Handle);
480 Interop.Elementary.elm_animation_view_play_back(Handle);
485 /// Pause current animation instantly.
487 /// Once animation is paused, animation view must get resume to play continue again.
488 /// Animation must be on playing or playing back status.
491 /// <since_tizen> preview </since_tizen>
492 [Obsolete("This has been deprecated in API12")]
495 Interop.Elementary.elm_animation_view_pause(Handle);
499 /// Resume paused animation to continue animation.
502 /// This resume must be called on animation paused status.
504 /// <since_tizen> preview </since_tizen>
505 [Obsolete("This has been deprecated in API12")]
508 Interop.Elementary.elm_animation_view_resume(Handle);
512 /// Stop playing animation.
514 /// Stop animation instatly regardless of it's status and reset to
515 /// show first frame of animation.Even though current animation is paused,
516 /// the animation status will be stopped.
519 /// <since_tizen> preview </since_tizen>
520 [Obsolete("This has been deprecated in API12")]
523 Interop.Elementary.elm_animation_view_stop(Handle);
527 /// Creates a AnimationView handle.
529 /// <param name="parent">Parent EvasObject.</param>
530 /// <returns>Handle IntPtr.</returns>
531 /// <since_tizen> preview </since_tizen>
532 [Obsolete("This has been deprecated in API12")]
533 protected override IntPtr CreateHandle(EvasObject parent)
535 return Interop.Elementary.elm_animation_view_add(parent.Handle);