Class LottieAnimationView

Definition

Namespace:
Tizen.NUI.BaseComponents
Assembly:
Tizen.NUI.dll
API Level:
7

LottieAnimationView renders an animated vector image (Lottie file).

C#
Copy
public class LottieAnimationView : ImageView, INotifyPropertyChanged, IDynamicResourceHandler, IElement, INameScope, IElementController, IDisposable, IResourcesProvider
Inheritance
Tizen.NUI.Binding.BindableObject
Tizen.NUI.Binding.Element
LottieAnimationView
Derived
Tizen.NUI.BaseComponents.AnimatedVectorImageView
Implements
System.ComponentModel.INotifyPropertyChanged
System.IDisposable

Constructors

View Source

LottieAnimationView(Single, Boolean)

LottieAnimationView constructor

Declaration
C#
Copy
public LottieAnimationView(float scale = 1F, bool shown = true)
Parameters
Type Name Description
System.Single scale

The factor of scaling image, default : 1.0f

System.Boolean shown

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

Remarks

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

Examples
Copy
LottieAnimationView myLottie = new LottieAnimationView(); LottieAnimationView myLottie2 = new LottieAnimationView(2.0f); LottieAnimationView myLottie3 = new LottieAnimationView(1.0f, false);
API Level: 7

Properties

View Source

CurrentFrame

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

Declaration
C#
Copy
public int CurrentFrame { get; set; }
Property Value
Type Description
System.Int32
Remarks

Giving user set value when getting. If the out ranged frame is set, it is reset as minimum frame or maximum frame.

Examples

Let's say myLottie.json file has 100 frames originally, then it will have 0 ~ 99 range of frame index.

Copy
LottieAnimationView myLottie = new LottieAnimationView(); myLottie.URL = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "myLottie.json"; //myLottie.json's total frame is 100 (frame: 0~99) Window.Instance.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
API Level: 7
View Source

LoopCount

Set or Get loop count.

Declaration
C#
Copy
public int LoopCount { get; set; }
Property Value
Type Description
System.Int32
Remarks

Minus value means infinite loop count.

Examples
Copy
LottieAnimationView myLottie = new LottieAnimationView(); myLottie.URL = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "myLottie.json"; //myLottie.json's total frame is 100 (frame: 0~99) Window.Instance.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
API Level: 7
View Source

LoopingMode

Set or Get looping mode of Lottie animation.

Declaration
C#
Copy
public LottieAnimationView.LoopingModeType LoopingMode { get; set; }
Property Value
Type Description
LottieAnimationView.LoopingModeType
API Level: 7
View Source

PlayState

Get playing state

Declaration
C#
Copy
public LottieAnimationView.PlayStateType PlayState { get; }
Property Value
Type Description
LottieAnimationView.PlayStateType
API Level: 7
View Source

StopBehavior

Set or Get stop behavior.

Declaration
C#
Copy
public LottieAnimationView.StopBehaviorType StopBehavior { get; set; }
Property Value
Type Description
LottieAnimationView.StopBehaviorType
API Level: 7
View Source

TotalFrame

Get the number of total frame

Declaration
C#
Copy
public int TotalFrame { get; }
Property Value
Type Description
System.Int32
API Level: 7
View Source

URL

Set or Get resource URL of Lottie file.

Declaration
C#
Copy
public string URL { get; set; }
Property Value
Type Description
System.String
API Level: 7

Methods

View Source

GetContentInfo()

Get the list of layers' information (start frame, end frame) in Lottie file.

Declaration
C#
Copy
public List<Tuple<string, int, int>> GetContentInfo()
Returns
Type Description
System.Collections.Generic.List<Tuple<System.String, System.Int32, System.Int32>>

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

API Level: 7
View Source

Pause()

Pause Animation.

Declaration
C#
Copy
public void Pause()
API Level: 7
View Source

Play()

Play Animation.

Declaration
C#
Copy
public void Play()
API Level: 7
View Source

SetMinMaxFrame(Int32, Int32)

Set minimum and maximum frame.

Declaration
C#
Copy
public void SetMinMaxFrame(int minFrame, int maxFrame)
Parameters
Type Name Description
System.Int32 minFrame

minimum frame

System.Int32 maxFrame

maximum frame

API Level: 7
View Source

Stop()

Stop Animation.

Declaration
C#
Copy
public void Stop()
API Level: 7

Events

View Source

Finished

Animation finished event.

Declaration
C#
Copy
public event EventHandler Finished
Event Type
Type Description
System.EventHandler
API Level: 7

Implements

System.ComponentModel.INotifyPropertyChanged
System.IDisposable