Class LottieAnimationView
Definition
- Namespace:
- Tizen.NUI.BaseComponents
- Assembly:
- Tizen.NUI.dll
LottieAnimationView renders an animated vector image (Lottie file).
public class LottieAnimationView : ImageView, INotifyPropertyChanged, IDisposable
- Inheritance
-
objectTizen.NUI.Binding.BindableObjectTizen.NUI.Binding.ElementLottieAnimationView
- Implements
-
System.ComponentModel.INotifyPropertyChangedSystem.IDisposable
Constructors
View SourceLottieAnimationView(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 shown parameter is false, it is not visible even the LottieAnimationView instance is created.
Examples
LottieAnimationView myLottie = new LottieAnimationView();
LottieAnimationView myLottie2 = new LottieAnimationView(2.0f);
LottieAnimationView myLottie3 = new LottieAnimationView(1.0f, false);
Properties
View SourceCurrentFrame
Set or Get 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
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.
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
View Source
LoopCount
Set or Get loop count.
Declaration
public int LoopCount { get; set; }
Property Value
Type | Description |
---|---|
int |
Remarks
Minus value means 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)
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
View Source
LoopingMode
Set or Get looping mode of Lottie animation.
Declaration
public LottieAnimationView.LoopingModeType LoopingMode { get; set; }
Property Value
Type | Description |
---|---|
LottieAnimationView.LoopingModeType |
PlayState
Get playing state
Declaration
public LottieAnimationView.PlayStateType PlayState { get; }
Property Value
Type | Description |
---|---|
LottieAnimationView.PlayStateType |
StopBehavior
Set or Get stop behavior.
Declaration
public LottieAnimationView.StopBehaviorType StopBehavior { get; set; }
Property Value
Type | Description |
---|---|
LottieAnimationView.StopBehaviorType |
TotalFrame
Get the number of total frame
Declaration
public int TotalFrame { get; }
Property Value
Type | Description |
---|---|
int |
URL
Set or Get resource URL of Lottie file.
Declaration
public string URL { get; set; }
Property Value
Type | Description |
---|---|
string |
Methods
View SourceGetContentInfo()
Get the list of layers' information (start frame, end frame) in Lottie file.
Declaration
public List<Tuple<string, int, int>> GetContentInfo()
Returns
Type | Description |
---|---|
System.Collections.Generic.List<T><Tuple<string, int, int>> | List of Tuple (string of layer name, integer of start frame, integer of end frame) |
Pause()
Pause Animation.
Declaration
public void Pause()
Play()
Play Animation.
Declaration
public void Play()
SetMinMaxFrame(int, int)
Set minimum and maximum frame.
Declaration
public void SetMinMaxFrame(int minFrame, int maxFrame)
Parameters
Type | Name | Description |
---|---|---|
int | minFrame | minimum frame |
int | maxFrame | maximum frame |
Stop()
Stop Animation.
Declaration
public void Stop()
Events
View SourceFinished
Animation finished event.
Declaration
public event EventHandler Finished
Event Type
Type | Description |
---|---|
System.EventHandler |