Show / Hide Table of Contents

    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
    Object
    EvasObject
    AnimationView

    Constructors

    View Source

    AnimationView(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 Source

    AutoPlay

    Sets or gets whether to play animation automatically. If AutoPlay is true, animation will be started when it's readied. The condition of AutoPlay is when AnimationView opened file successfully, yet to play it plus when the object is visible. If AnimationView is disabled, invisible, it turns to pause state then resume animation when it's visible again. This AutoPlay will be only affected to the next animation source. So must be called before SetAnimation()

    Declaration
    public bool AutoPlay { get; set; }
    Property Value
    Type Description
    Boolean
    API Level: preview
    View Source

    AutoRepeat

    Sets or gets whether to turn on/off animation looping. If AutoRepeat is true, it repeats animation when animation frame is reached to end. This AutoRepeat mode is valid to both Play and ReversePlay cases.

    Declaration
    public bool AutoRepeat { get; set; }
    Property Value
    Type Description
    Boolean
    API Level: preview
    View Source

    DefaultSize

    Get the default view size that specified from vector resource.

    Declaration
    public Size DefaultSize { get; }
    Property Value
    Type Description
    Size
    API Level: preview
    View Source

    DurationTime

    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 Source

    Frame

    Sets or gets current frame position of animation view. The range of frame is from 0 to FrameCount - 1

    Declaration
    public int Frame { get; set; }
    Property Value
    Type Description
    Int32
    API Level: preview
    View Source

    FrameCount

    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 Source

    IsReversedPlaying

    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 Source

    MaxFrame

    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 Source

    MaxProgress

    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 Source

    MinFrame

    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 Source

    MinProgress

    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 Source

    Progress

    Sets or gets current progress position of animation view. When you required to jump on a certain progress instantly, you can change current position by using this property The range of progress is 0 ~ 1.

    Declaration
    public double Progress { get; set; }
    Property Value
    Type Description
    Double
    API Level: preview
    View Source

    Speed

    Sets or gets the animation speed. Control animation speed by multiplying Speed value. If you want to play animation double-time faster, you can give Speed 2. If you want to play animation double-time slower, you can give Speed 0.5. Speed must be greater than zero.

    Declaration
    public double Speed { get; set; }
    Property Value
    Type Description
    Double
    API Level: preview
    View Source

    State

    Get current animation view state.

    Declaration
    public AnimationViewState State { get; }
    Property Value
    Type Description
    AnimationViewState
    API Level: preview

    Methods

    View Source

    CreateHandle(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
    EvasObject.CreateHandle(EvasObject)
    API Level: preview
    View Source

    Pause()

    Pause current animation instantly. Once animation is paused, animation view must get resume to play continue again. Animation must be on playing or playing back status.

    Declaration
    public void Pause()
    API Level: preview
    View Source

    Play()

    Play animation one time instantly when it's available. If current keyframe is on a certain position by playing reverse, this will play forward from there. Play request will be ignored if animation source is not set yet or animation is paused state or it's already on playing.

    Declaration
    public void Play()
    API Level: preview
    View Source

    Play(Boolean)

    Play animation one time instantly when it's available. If current keyframe is on a certain position by playing reverse and isReverse is ture, this will play forward from there. And if current keyframe is on a certain position by playing and isReverse is false, this will play backward from there. Play request will be ignored if animation source is not set yet or animation is paused state or it's already on playing.

    Declaration
    public void Play(bool isReverse)
    Parameters
    Type Name Description
    Boolean isReverse

    Whether the animation play or reverse play.

    API Level: preview
    View Source

    Resume()

    Resume paused animation to continue animation.

    Declaration
    public void Resume()
    Remarks

    This resume must be called on animation paused status.

    API Level: preview
    View Source

    SetAnimation(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 Source

    Stop()

    Stop playing animation. Stop animation instatly regardless of it's status and reset to show first frame of animation.Even though current animation is paused, the animation status will be stopped.

    Declaration
    public void Stop()
    API Level: preview

    Events

    View Source

    Finished

    It occurs when the animation is just finished.

    Declaration
    public event EventHandler Finished
    Event Type
    Type Description
    EventHandler
    API Level: preview
    View Source

    Paused

    It occurs when the animation is just paused.

    Declaration
    public event EventHandler Paused
    Event Type
    Type Description
    EventHandler
    API Level: preview
    View Source

    Repeated

    It occurs when the animation is just repeated.

    Declaration
    public event EventHandler Repeated
    Event Type
    Type Description
    EventHandler
    API Level: preview
    View Source

    Resumed

    It occurs when the animation is just resumed.

    Declaration
    public event EventHandler Resumed
    Event Type
    Type Description
    EventHandler
    API Level: preview
    View Source

    Started

    It occurs when the animation is just started.

    Declaration
    public event EventHandler Started
    Event Type
    Type Description
    EventHandler
    API Level: preview
    View Source

    Stopped

    It occurs when the animation is just stopped.

    Declaration
    public event EventHandler Stopped
    Event Type
    Type Description
    EventHandler
    API Level: preview
    View Source

    Updated

    It occurs when the animation is updated to the next frame.

    Declaration
    public event EventHandler Updated
    Event Type
    Type Description
    EventHandler
    API Level: preview

    Extension Methods

    RotaryEventExtensions.AddRotaryEventHandler(EvasObject, RotaryEventHandler)
    RotaryEventExtensions.RemoveRotaryEventHandler(EvasObject, RotaryEventHandler)
    RotaryEventExtensions.Activate(EvasObject)
    RotaryEventExtensions.Deactivate(EvasObject)
    • View Source
    Back to top Copyright © 2016-2020 Samsung
    Generated by DocFX