Class LottieAnimationView

    Definition

    Namespace:
    Tizen.NUI.BaseComponents
    Assembly:
    Tizen.NUI.dll

    LottieAnimationView renders an animated vector image (Lottie file).

    public class LottieAnimationView : ImageView, IDynamicResourceHandler, INameScope, System.IDisposable, IResourcesProvider
    Inheritance
    object
    BindableObject
    Element
    BaseHandle
    Animatable
    Container
    View
    ImageView
    LottieAnimationView
    Derived
    AnimatedVectorImageView
    Implements
    IDynamicResourceHandler
    INameScope
    System.IDisposable
    IResourcesProvider

    Constructors

    View Source

    LottieAnimationView(float, bool)

    LottieAnimationView constructor

    Declaration
    public LottieAnimationView(float scale = 1, bool shown = true)
    Parameters
    Type Name Description
    float scale

    The factor of scaling image, default : 1.0f

    bool shown

    false : not displayed (hidden), true : displayed (shown), default : true

    Remarks

    If the shown parameter is false, the animation is not visible even if the LottieAnimationView instance is created.

    Examples
    LottieAnimationView myLottie = new LottieAnimationView();
    LottieAnimationView myLottie2 = new LottieAnimationView(2.0f);
    LottieAnimationView myLottie3 = new LottieAnimationView(1.0f, false);

    Fields

    View Source

    CurrentFrameProperty

    CurrentFrameProperty

    Declaration
    public static readonly BindableProperty CurrentFrameProperty
    Field Value
    Type Description
    BindableProperty
    View Source

    EnableFrameCacheProperty

    EnableFrameCacheProperty

    Declaration
    public static readonly BindableProperty EnableFrameCacheProperty
    Field Value
    Type Description
    BindableProperty
    View Source

    LoopCountProperty

    LoopCountProperty

    Declaration
    public static readonly BindableProperty LoopCountProperty
    Field Value
    Type Description
    BindableProperty
    View Source

    LoopingModeProperty

    LoopingModeProperty

    Declaration
    public static readonly BindableProperty LoopingModeProperty
    Field Value
    Type Description
    BindableProperty
    View Source

    NotifyAfterRasterizationProperty

    NotifyAfterRasterizationProperty

    Declaration
    public static readonly BindableProperty NotifyAfterRasterizationProperty
    Field Value
    Type Description
    BindableProperty
    View Source

    RedrawInScalingDownProperty

    RedrawInScalingDownProperty

    Declaration
    public static readonly BindableProperty RedrawInScalingDownProperty
    Field Value
    Type Description
    BindableProperty
    View Source

    StopBehaviorProperty

    StopBehaviorProperty

    Declaration
    public static readonly BindableProperty StopBehaviorProperty
    Field Value
    Type Description
    BindableProperty
    View Source

    URLProperty

    URLProperty

    Declaration
    public static readonly BindableProperty URLProperty
    Field Value
    Type Description
    BindableProperty

    Properties

    View Source

    CurrentFrame

    Set or get the current frame. When setting a specific frame, it is displayed as a still image.

    Declaration
    public int CurrentFrame { get; set; }
    Property Value
    Type Description
    int
    Remarks

    Gets the value set by a user. If the setting value is out-ranged, it is reset as a minimum frame or a maximum frame.

    Examples

    We assume that the animation in myLottie.json file has 100 frames originally. If so, its frame index will be 0 - 99.

    LottieAnimationView myLottie = new LottieAnimationView();
    myLottie.URL = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "myLottie.json"; //myLottie.json's total frame is 100 (frame: 0~99)
    NUIApplication.GetDefaultWindow().GetDefaultLayer().Add(myLottie);
    myLottie.CurrentFrame = 200; //display 99 frame
    myLottie.SetMinMaxFrame(10, 20);
    myLottie.CurrentFrame = 15; //display 15 frame
    myLottie.CurrentFrame = 50; //display 20 frame, because the MinMax is set (10,20) above
    View Source

    DesiredHeight

    Gets or sets the desired image height for LottieAnimationView

    Declaration
    public int DesiredHeight { get; set; }
    Property Value
    Type Description
    int
    View Source

    DesiredWidth

    Gets or sets the desired image width for LottieAnimationView

    Declaration
    public int DesiredWidth { get; set; }
    Property Value
    Type Description
    int
    View Source

    EnableFrameCache

    Whether to AnimatedVectorImageVisual fixed cache or not.

    Declaration
    public bool EnableFrameCache { get; set; }
    Property Value
    Type Description
    bool
    Remarks

    If this property is true, AnimatedVectorImageVisual enable frame cache for loading and keeps loaded frame until the visual is removed. It reduces CPU cost when the animated image will be looping. But it can spend a lot of memory if the resource has high resolution image or many frame count.

    Inhouse API. It is used in the AnimatedVectorImageVisual.The default is false.

    View Source

    FrameSpeedFactor

    Specifies a speed factor for the animated image frame.

    Declaration
    public float FrameSpeedFactor { get; set; }
    Property Value
    Type Description
    float
    Remarks

    The speed factor is a multiplier of the normal velocity of the animation. Values between [0,1] will slow down the animation and values above one will speed up the animation.

    The range of this value is clamped between [0.01f ~ 100.0f].

    Inhouse API. The default is 1.0f.

    View Source

    LoopCount

    Sets or gets the loop count.

    Declaration
    public int LoopCount { get; set; }
    Property Value
    Type Description
    int
    Remarks

    The minus value means the infinite loop count.

    Examples
    LottieAnimationView myLottie = new LottieAnimationView();
    myLottie.URL = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "myLottie.json"; //myLottie.json's total frame is 100 (frame: 0~99)
    NUIApplication.GetDefaultWindow().GetDefaultLayer().Add(myLottie);
    myLottie.LoopCount = -1; //infinite loop
    myLottie.Play();
    myLottie.Stop(); //it plays continuously unless Stop() is called
    myLottie.LoopCount = 2;
    myLottie.Play(); //it plays only 2 times and stops automatically
    View Source

    LoopingMode

    Sets or gets the looping mode of Lottie animation.

    Declaration
    public LottieAnimationView.LoopingModeType LoopingMode { get; set; }
    Property Value
    Type Description
    LottieAnimationView.LoopingModeType
    View Source

    NotifyAfterRasterization

    Whether notify AnimatedVectorImageVisual to render thread after every rasterization or not.

    Declaration
    public bool NotifyAfterRasterization { get; set; }
    Property Value
    Type Description
    bool
    Remarks

    If this property is true, AnimatedVectorImageVisual send notify to render thread after every rasterization. If false, AnimatedVectorImageVisual set Renderer's Behaviour as Continouly (mean, always update the render thread.) This flag is useful if given resource has low fps, so we don't need to render every frame.

    Inhouse API. It is used in the AnimatedVectorImageVisual.The default is false.

    View Source

    PlayState

    Gets the playing state of the LottieAnimationView. This property returns the current play state of the LottieAnimationView.

    Declaration
    public LottieAnimationView.PlayStateType PlayState { get; }
    Property Value
    Type Description
    LottieAnimationView.PlayStateType
    View Source

    RedrawInScalingDown

    Whether to redraw the image when the visual is scaled down.

    Declaration
    public bool RedrawInScalingDown { get; set; }
    Property Value
    Type Description
    bool
    Remarks

    Inhouse API. It is used in the AnimatedVectorImageVisual.The default is true.

    View Source

    RedrawInScalingUp

    Whether to redraw the image when the visual is scaled up.

    Declaration
    public bool RedrawInScalingUp { get; set; }
    Property Value
    Type Description
    bool
    Remarks

    Inhouse API. It is used in the AnimatedVectorImageVisual.The default is true.

    View Source

    RenderScale

    Renders a texture at a given scale.

    Declaration
    public float RenderScale { get; set; }
    Property Value
    Type Description
    float
    Remarks

    Inhouse API. The default is 1.0f.

    View Source

    ResourceUrl

    Set or Get resource URL of Lottie file.

    Declaration
    public string ResourceUrl { get; set; }
    Property Value
    Type Description
    string
    View Source

    StopBehavior

    Sets or gets the stop behavior of the LottieAnimationView. This property determines how the animation behaves when it stops.

    Declaration
    public LottieAnimationView.StopBehaviorType StopBehavior { get; set; }
    Property Value
    Type Description
    LottieAnimationView.StopBehaviorType
    View Source

    SynchronousLoading

    Gets or sets the SynchronousLoading for LottieAnimationView
    We should set it before setup ResourceUrl, URL property.

    Declaration
    public bool SynchronousLoading { get; set; }
    Property Value
    Type Description
    bool
    View Source

    TotalFrame

    Get the number of total frames. If resouce is still not be loaded, or invalid resource, the value is 0.

    Declaration
    public int TotalFrame { get; }
    Property Value
    Type Description
    int
    View Source

    URL

    Set or Get resource URL of Lottie file.

    Declaration
    public string URL { get; set; }
    Property Value
    Type Description
    string

    Methods

    View Source

    Dispose(bool)

    Declaration
    protected override void Dispose(bool disposing)
    Parameters
    Type Name Description
    bool disposing
    Overrides
    View.Dispose(bool)
    View Source

    Dispose(DisposeTypes)

    Dispose(DisposeTypes type)

    Declaration
    protected override void Dispose(DisposeTypes type)
    Parameters
    Type Name Description
    DisposeTypes type
    Overrides
    ImageView.Dispose(DisposeTypes)
    View Source

    DoActionExtension(LottieAnimationViewDynamicProperty)

    Declaration
    public void DoActionExtension(LottieAnimationViewDynamicProperty info)
    Parameters
    Type Name Description
    LottieAnimationViewDynamicProperty info
    View Source

    GetContentInfo()

    Get the list of layers' information such as the start frame and the end frame in the Lottie file.

    Declaration
    public List<Tuple<string, int, int>> GetContentInfo()
    Returns
    Type Description
    List<><Tuple<string, int, int>>

    List of Tuple (string of layer name, integer of start frame, integer of end frame)

    View Source

    GetMarkerInfo()

    Get the list of markers' information such as the start frame and the end frame in the Lottie file.

    Declaration
    public List<Tuple<string, int, int>> GetMarkerInfo()
    Returns
    Type Description
    List<><Tuple<string, int, int>>

    List of Tuple (string of marker name, integer of start frame, integer of end frame)

    View Source

    GetMinMaxFrame()

    Get MinMax Frame

    Declaration
    public Tuple<int, int> GetMinMaxFrame()
    Returns
    Type Description
    Tuple<, ><int, int>

    Tuple of Min and Max frames

    View Source

    MergeCachedImageVisualProperty(PropertyMap)

    Update NUI cached animated image visual property map by inputed property map. And call base.MergeCachedImageVisualProperty()

    Declaration
    protected override void MergeCachedImageVisualProperty(PropertyMap map)
    Parameters
    Type Name Description
    PropertyMap map
    Overrides
    ImageView.MergeCachedImageVisualProperty(PropertyMap)
    Remarks

    For performance issue, we will collect only "cachedLottieAnimationPropertyKeyList" hold in this class.

    View Source

    Pause()

    Pauses the Lottie animation. This method pauses the animation without resetting its progress.

    Declaration
    public void Pause()
    View Source

    Play()

    Plays the Lottie animation. This method starts the playback of the Lottie animation.

    Declaration
    public void Play()
    View Source

    SetMinMaxFrame(int, int)

    Set the minimum and the maximum frame.

    Declaration
    public void SetMinMaxFrame(int minFrame, int maxFrame)
    Parameters
    Type Name Description
    int minFrame

    minimum frame

    int maxFrame

    maximum frame

    View Source

    SetMinMaxFrameByMarker(string, string)

    A marker has its start frame and end frame. Animation will play between the start frame and the end frame of the marker if one marker is specified. Or animation will play between the start frame of the first marker and the end frame of the second marker if two markers are specified.

    Declaration
    public void SetMinMaxFrameByMarker(string marker1, string marker2 = null)
    Parameters
    Type Name Description
    string marker1

    First marker

    string marker2

    Second marker

    View Source

    Stop()

    Stops the Lottie animation. This method stops the currently playing Lottie animation.

    Declaration
    public void Stop()
    View Source

    UpdateImage()

    Update lottie-image-relative properties synchronously. After call this API, All image properties updated.

    Declaration
    protected override void UpdateImage()
    Overrides
    ImageView.UpdateImage()

    Events

    View Source

    Finished

    The event handler for the animation finished event.

    Declaration
    public event EventHandler Finished
    Event Type
    Type Description
    EventHandler

    Implements

    IDynamicResourceHandler
    INameScope
    System.IDisposable
    IResourcesProvider

    Extension Methods

    BindingExtensions.BindingSession<T, TViewModel>(T, BindingSession<TViewModel>)
    BindingExtensions.SetBinding<T, TView>(TView, BindingSession<T>, Action<T, TView>, string)
    BindingExtensions.SetBinding<TView, TViewModel, TProperty>(TView, BindingSession<TViewModel>, BindingProperty<TView, TProperty>, string)
    BindingExtensions.SetTwoWayBinding<TView, TViewModel, TProperty>(TView, BindingSession<TViewModel>, TwoWayBindingProperty<TView, TProperty>, string)
    EXamlExtensions.LoadFromEXamlByRelativePath<T>(T, string)
    ViewExtensions.BackgroundColor<T>(T, float, float, float, float)
    ViewExtensions.BackgroundColor<T>(T, uint, float)
    ViewExtensions.BackgroundColor<T>(T, UIColor)
    ViewExtensions.BackgroundImage<T>(T, string)
    ViewExtensions.Borderline<T>(T, float, UIColor, float)
    ViewExtensions.BorderlineColor<T>(T, float, float, float, float)
    ViewExtensions.BorderlineColor<T>(T, uint, float)
    ViewExtensions.BorderlineColor<T>(T, UIColor)
    ViewExtensions.BorderlineOffset<T>(T, float)
    ViewExtensions.BorderlineWidth<T>(T, float)
    ViewExtensions.BoxShadow<T>(T, float, float, float)
    ViewExtensions.BoxShadow<T>(T, float, UIColor, float, float)
    ViewExtensions.BoxShadow<T>(T, UIShadow)
    ViewExtensions.ClippingMode<T>(T, ClippingModeType)
    ViewExtensions.Color<T>(T, float, float, float, float)
    ViewExtensions.Color<T>(T, uint, float)
    ViewExtensions.Color<T>(T, UIColor)
    ViewExtensions.CornerRadius<T>(T, float, bool)
    ViewExtensions.CornerRadius<T>(T, float, float, float, float, bool)
    ViewExtensions.CornerRadius<T>(T, UICorner)
    ViewExtensions.Focusable<T>(T, bool)
    ViewExtensions.FocusableChildren<T>(T, bool)
    ViewExtensions.FocusableInTouch<T>(T, bool)
    ViewExtensions.ImageShadow<T>(T, ImageShadow)
    ViewExtensions.IsEnabled<T>(T, bool)
    ViewExtensions.Layout<T>(T, LayoutItem)
    ViewExtensions.Opacity<T>(T, float)
    ViewExtensions.Position<T>(T, float, float)
    ViewExtensions.PositionX<T>(T, float)
    ViewExtensions.PositionY<T>(T, float)
    ViewExtensions.Scale<T>(T, float, float)
    ViewExtensions.ScaleX<T>(T, float)
    ViewExtensions.ScaleY<T>(T, float)
    ViewExtensions.Sensitive<T>(T, bool)
    ViewExtensions.Size<T>(T, float, float)
    ViewExtensions.SizeHeight<T>(T, float)
    ViewExtensions.SizeWidth<T>(T, float)
    ViewExtensions.Visibility<T>(T, bool)
    ViewExtensions.VoiceInteractionName<T>(T, string)
    Extensions.LoadFromXaml<TXaml>(TXaml, string)
    Extensions.LoadFromXaml<TXaml>(TXaml, Type)
    Extensions.LoadFromXamlFile<TXaml>(TXaml, string)
    BindingExtensions.BindingSession<TViewModel>(View)
    BindingExtensions.SetBinding<T>(View, BindingSession<T>, Action<T>, string)
    BindingExtensions.SetBinding<TViewModel>(View, BindingSession<TViewModel>, string, string)
    BindingExtensions.SetTwoWayBinding<TViewModel, TProperty>(View, BindingSession<TViewModel>, TwoWayBindingProperty<View, TProperty>, string)
    ViewExtensions.BackgroundColor(View)
    ViewExtensions.BorderlineColor(View)
    ViewExtensions.BoxShadow(View)
    ViewExtensions.Color(View)
    ViewExtensions.CornerRadius(View)
    BindableObjectExtensions.SetBinding(BindableObject, BindableProperty, string, BindingMode, IValueConverter, string)
    NameScopeExtensions.FindByName<T>(Element, string)
    • View Source
    Back to top Copyright © 2016-2025 Samsung
    Generated by DocFX