Class LottieAnimationView
Definition
- Namespace:
- Tizen.NUI.BaseComponents
- Assembly:
- Tizen.NUI.dll
- API Level:
- 7
LottieAnimationView renders an animated vector image (Lottie file).
public class LottieAnimationView : ImageView, INotifyPropertyChanged, IDynamicResourceHandler, IElement, INameScope, IElementController, IDisposable, IResourcesProvider
- Inheritance
-
Tizen.NUI.Binding.BindableObjectTizen.NUI.Binding.ElementLottieAnimationView
- Implements
Constructors
View SourceLottieAnimationView(Single, Boolean)
LottieAnimationView constructor
Declaration
public LottieAnimationView(float scale = 1F, bool shown = true)
Parameters
Type | Name | Description |
---|---|---|
Single | scale | The factor of scaling image, default : 1.0f |
Boolean | 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);
API Level: 7
Properties
View SourceCurrentFrame
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 |
---|---|
Int32 |
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
API Level: 7
View SourceLoopCount
Sets or gets the loop count.
Declaration
public int LoopCount { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
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
API Level: 7
View SourceLoopingMode
Sets or gets the looping mode of Lottie animation.
Declaration
public LottieAnimationView.LoopingModeType LoopingMode { get; set; }
Property Value
Type | Description |
---|---|
LottieAnimationView.LoopingModeType |
API Level: 7
View SourcePlayState
Gets the playing state
Declaration
public LottieAnimationView.PlayStateType PlayState { get; }
Property Value
Type | Description |
---|---|
LottieAnimationView.PlayStateType |
API Level: 7
View SourceStopBehavior
Sets or gets the stop behavior.
Declaration
public LottieAnimationView.StopBehaviorType StopBehavior { get; set; }
Property Value
Type | Description |
---|---|
LottieAnimationView.StopBehaviorType |
API Level: 7
View SourceTotalFrame
Get the number of total frames
Declaration
public int TotalFrame { get; }
Property Value
Type | Description |
---|---|
Int32 |
API Level: 7
View SourceURL
Set or Get resource URL of Lottie file.
Declaration
public string URL { get; set; }
Property Value
Type | Description |
---|---|
String |
API Level: 7
Methods
View SourceGetContentInfo()
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, Int32, Int32>> | List of Tuple (string of layer name, integer of start frame, integer of end frame) |
API Level: 7
View SourcePause()
Pause Animation.
Declaration
public void Pause()
API Level: 7
View SourcePlay()
Play Animation.
Declaration
public void Play()
API Level: 7
View SourceSetMinMaxFrame(Int32, Int32)
Set the minimum and the maximum frame.
Declaration
public void SetMinMaxFrame(int minFrame, int maxFrame)
Parameters
Type | Name | Description |
---|---|---|
Int32 | minFrame | minimum frame |
Int32 | maxFrame | maximum frame |
API Level: 7
View SourceStop()
Stop Animation.
Declaration
public void Stop()
API Level: 7
Events
View SourceFinished
Animation finished event.
Declaration
public event EventHandler Finished
Event Type
Type | Description |
---|---|
EventHandler |