Class AnimationView
Definition
- Namespace:
- ElmSharp
- Assembly:
- ElmSharp.dll
- API Level:
- preview
The AnimationView is designed to show and play animation of vector graphics based content. Currently ElmSharp AnimationView is supporting only json format (known for Lottie file as well).
public class AnimationView : EvasObject
- Inheritance
Constructors
View SourceAnimationView(EvasObject)
Creates and initializes a new instance of the AnimationView class.
Declaration
public AnimationView(EvasObject parent)
Parameters
Type | Name | Description |
---|---|---|
EvasObject | parent | The parent is a given container, which will be attached by AnimationView as a child. It's EvasObject type. |
API Level: preview
Properties
View SourceAutoPlay
Sets or gets whether to play animation automatically.
Declaration
public bool AutoPlay { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
API Level: preview
View SourceAutoRepeat
Sets or gets whether to turn on/off animation looping.
Declaration
public bool AutoRepeat { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
API Level: preview
View SourceDefaultSize
Get the default view size that specified from vector resource.
Declaration
public Size DefaultSize { get; }
Property Value
Type | Description |
---|---|
Size |
API Level: preview
View SourceDurationTime
Get the duration of animation in seconds.
Declaration
public double DurationTime { get; }
Property Value
Type | Description |
---|---|
Double |
Remarks
Returns total duration time of current animation in the seconds. If current animation source isn't animatable, it returns zero.
API Level: preview
View SourceFrame
Sets or gets current frame position of animation view.
Declaration
public int Frame { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
API Level: preview
View SourceFrameCount
Get the index of end frame of the AnimationView, if it's animated.
Declaration
public int FrameCount { get; }
Property Value
Type | Description |
---|---|
Int32 |
Remarks
Frame number starts with 0.
API Level: preview
View SourceIsReversedPlaying
Get the status whether current animation is on playing forward or backward.
Declaration
public bool IsReversedPlaying { get; }
Property Value
Type | Description |
---|---|
Boolean |
Remarks
If AnimationView is not on playing, it will return False.
API Level: preview
View SourceMaxFrame
Sets or Gets the last frame of the play
Declaration
public int MaxFrame { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
Remarks
Default value is FrameCount -1.
API Level: preview
View SourceMaxProgress
Sets or Gets the last progress of the play
Declaration
public double MaxProgress { get; set; }
Property Value
Type | Description |
---|---|
Double |
Remarks
Default value is 1.
API Level: preview
View SourceMinFrame
Sets or Gets the start frame of the play
Declaration
public int MinFrame { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
Remarks
Default value is 0.
API Level: preview
View SourceMinProgress
Sets or Gets the start progress of the play
Declaration
public double MinProgress { get; set; }
Property Value
Type | Description |
---|---|
Double |
Remarks
Default value is 0.
API Level: preview
View SourceProgress
Sets or gets current progress position of animation view.
Declaration
public double Progress { get; set; }
Property Value
Type | Description |
---|---|
Double |
API Level: preview
View SourceSpeed
Sets or gets the animation speed.
Declaration
public double Speed { get; set; }
Property Value
Type | Description |
---|---|
Double |
API Level: preview
View SourceState
Get current animation view state.
Declaration
public AnimationViewState State { get; }
Property Value
Type | Description |
---|---|
AnimationViewState |
API Level: preview
Methods
View SourceCreateHandle(EvasObject)
Creates a AnimationView handle.
Declaration
protected override IntPtr CreateHandle(EvasObject parent)
Parameters
Type | Name | Description |
---|---|---|
EvasObject | parent | Parent EvasObject. |
Returns
Type | Description |
---|---|
IntPtr | Handle IntPtr. |
Overrides
API Level: preview
View SourcePause()
Pause current animation instantly.
Declaration
public void Pause()
API Level: preview
View SourcePlay()
Play animation one time instantly when it's available.
Declaration
public void Play()
API Level: preview
View SourcePlay(Boolean)
Play animation one time instantly when it's available.
Declaration
public void Play(bool isReverse)
Parameters
Type | Name | Description |
---|---|---|
Boolean | isReverse | Whether the animation play or reverse play. |
API Level: preview
View SourceResume()
Resume paused animation to continue animation.
Declaration
public void Resume()
Remarks
This resume must be called on animation paused status.
API Level: preview
View SourceSetAnimation(String)
Sets the animation source file.
Declaration
public void SetAnimation(string file)
Parameters
Type | Name | Description |
---|---|---|
String | file | The animation file path. |
API Level: preview
View SourceStop()
Stop playing animation.
Declaration
public void Stop()
API Level: preview
Events
View SourceFinished
It occurs when the animation is just finished.
Declaration
public event EventHandler Finished
Event Type
Type | Description |
---|---|
EventHandler |
API Level: preview
View SourcePaused
It occurs when the animation is just paused.
Declaration
public event EventHandler Paused
Event Type
Type | Description |
---|---|
EventHandler |
API Level: preview
View SourceRepeated
It occurs when the animation is just repeated.
Declaration
public event EventHandler Repeated
Event Type
Type | Description |
---|---|
EventHandler |
API Level: preview
View SourceResumed
It occurs when the animation is just resumed.
Declaration
public event EventHandler Resumed
Event Type
Type | Description |
---|---|
EventHandler |
API Level: preview
View SourceStarted
It occurs when the animation is just started.
Declaration
public event EventHandler Started
Event Type
Type | Description |
---|---|
EventHandler |
API Level: preview
View SourceStopped
It occurs when the animation is just stopped.
Declaration
public event EventHandler Stopped
Event Type
Type | Description |
---|---|
EventHandler |
API Level: preview
View SourceUpdated
It occurs when the animation is updated to the next frame.
Declaration
public event EventHandler Updated
Event Type
Type | Description |
---|---|
EventHandler |