Releases: TizenAPI/ElottieSharp
v0.9.7
v0.9.6
v0.9.5
v0.9.4
ElottieSharp
Nuget package here.
ElottieSharp.Forms
Nuget package here.
Important Notice
- ElottieSharp 0.9.4-preview and ElottieSharp.Forms 0.9.4-preview are now support Galaxy Watch Active2.
v0.9.3
ElottieSharp
Nuget package here.
Important Notice
Nothing to changed
ElottieSharp.Forms
Nuget package here.
Important Notice
This version (
0.9.3-preview) only works on Galaxy Watch Active ,Galaxy Watch and Gear S-series that supportTizen 4.0.0.3or higher.)
- ElottieSharp.Forms is now available only for Tizen.
Developer's Guide
ELottieAnimationView
ElottieAnimationView is a View (Xamarin.Forms) subclass that displays animation content.
Creating Animation Views
- C#
var animation = new ELottieAnimationView
{
AutoPlay = true,
AutoRepeat = false,
Speed = 1.0,
MinumumProgress = 0,
MaximumProgress = 1.0,
HorizontalOptions = LayoutOptions.FillAndExpand,
VerticalOptions = LayoutOptions.FillAndExpand
};- XAML
<e:ElottieAnimationView
AutoPlay="True"
AutoRepeat="False"
Speed="1.0"
MinumumProgress="0"
MaximumProgress="1.0"
HorizontalOptions="FillAndExpand"
VerticalOptions="FillAndExpand"
/>Animation views can be allocated with or without animation data. There are a handful of convenience initializers for initializing with animations.
Properties:
- AutoPlay: Indicates whether this animation is play automatially or not. The default value is
false. - AutoRepeat: The loop behavior of the animation. The default value is
false. - Speed: The speed of the animation playback. Higher speed equals faster time. The default value is
1.0. - MinumumProgress: The start progress of the animation (0 ~ 1.0). The default value is
0. - MaximumProgress: The end progress of the animation (0 ~ 1.0). The default value is
1.0.
By default. the initial value of animation view's size(width, height) is 0. Make sure that using whether
WidthRequest.HeightRequestproperties orLayoutOptionslikeFillAndExpandto request the size of animation view.
Loading from a File Path
- C#
animation.AnimationFile = "lottie.json";- XAML
<e:ElottieAnimationView AnimationFile="lottie.json" />Loads an animation model from a animation file. After loading a animation successfully, you can receive AnimationInitialized event and get the duration time and total frame count by using TotalFrame and DurationTime properties.
Play the Animation
animation.Play();Plays the animation from its current state to the end of its timeline. Started event occurs when the animation is started. And Finished event occurs when the animation is finished.
Stop the Animation
animation.Stop();Stops the animation. Stopped event occurs when the animation is stopped.
Pause the Animation
animation.Pause();Pauses the animation. Paused event occurs when the animation is paused.
Is Animation Playing
bool isPlaying = animation.IsPlaying;Returns true if the animation is currently playing, false if it is not.
Current Frame
int currentFrame = animation.CurrentFrame;Returns the current animation frame count.
==Note==: It returns 0, if animation is not playing.
Total Frame
int totalFrame = animation.TotalFrame;Returns the total animation frame count.
==Note==: You should load the animation file before using it.
Duration Time
double duration = animation.DurationTime;Returns the duration time of animation.
==Note==: You should load the animation file before using it.
v0.9.2
v0.9.1
v0.9.0
Nuget package here.
Important Notice
This version (
0.9.0-preview) only works on Galaxy Watch Active, which supportsTizen 4.0.0.3. (Not Galaxy Watch and Gear S-series yet.)
Developer's Guide
LottieAnimationView
LottieAnimationView is a EvasObject (TizenFX) subclass that displays animation content.
Creating Animation Views
var animation = new LottieAnimationView(window)
{
AutoPlay = true,
AutoRepeat = false,
Speed = 1.0,
MinumumProgress = 0,
MaximumProgress = 1.0
};Animation views can be allocated with or without animation data. There are a handful of convenience initializers for initializing with animations.
Properties:
- AutoPlay: Indicates whether this animation is play automatially or not. The default value is
false. - AutoRepeat: The loop behavior of the animation. The default value is
false. - Speed: The speed of the animation playback. Higher speed equals faster time. The default value is
1.0. - MinumumProgress: The start progress of the animation (0 ~ 1.0). The default value is
0. - MaximumProgress: The end progress of the animation (0 ~ 1.0). The default value is
1.0.
Loading from a File Path
animation.SetAnimation(Path.Combine(DirectoryInfo.Resource, "lottie.json"));Loads an animation model from a filepath. After loading a animation successfully, you can get the duration time and total frame count by using TotalFrame and DurationTime properties.
Parameters:
: filepath: The absolute filepath of the animation to load.
Play the Animation
animation.Play();Plays the animation from its current state to the end of its timeline. Started event occurs when the animation is started. And Finished event occurs when the animation is finished.
Stop the Animation
animation.Stop();Stops the animation. Stopped event occurs when the animation is stopped.
Pause the Animation
animation.Pause();Pauses the animation. Paused event occurs when the animation is paused.
Is Animation Playing
bool isPlaying = anumation.IsPlaying;Returns true if the animation is currently playing, false if it is not.
Current Frame
int currentFrame = anumation.CurrentFrame;Returns the current animation frame count.
==Note==: It returns -1, if animation is not playing.
Total Frame
int totalFrame = anumation.TotalFrame;Returns the total animation frame count.
==Note==: You should load the animation file before using it.
Duration Time
double duration = anumation.DurationTime;Returns the duration time of animation.
==Note==: You should load the animation file before using it.