Skip to content

Commit 1570c14

Browse files
authored
Added quickstart to readme, fixed build status section (#550)
1 parent afd115b commit 1570c14

File tree

1 file changed

+60
-3
lines changed

1 file changed

+60
-3
lines changed

README.md

Lines changed: 60 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,75 @@ Lottie-Windows consists of 3 related products:
1313

1414
This repo also contains source code for **[samples](/LottieViewer)**.
1515

16+
## <a name="quickstart"></a> Quick start
17+
18+
There are **two** options to integrate Lottie animations into your **WinUI 3** or **UWP** project.
19+
20+
**Option #1, using dynamic loader**
21+
1. Install `CommunityToolkit.WinUI.Lottie` nuget package for WinUI project (or `CommunityToolkit.Uwp.Lottie` for UWP project).
22+
2. If you are using C# you may also need to install `Microsoft.Graphics.Win2D` **(version 1.0.5 or below)** for WinUI project (or `Win2D.uwp` and `Microsoft.UI.Xaml` for UWP project).
23+
3. In your `.xaml` markup file add:
24+
```xml
25+
...
26+
xmlns:lottie="using:CommunityToolkit.WinUI.Lottie"
27+
...
28+
<AnimatedVisualPlayer>
29+
<lottie:LottieVisualSource UriSource="<asset path or web link to a json file>" />
30+
</AnimatedVisualPlayer>
31+
```
32+
or for UWP project:
33+
```xml
34+
...
35+
xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
36+
xmlns:lottie="using:CommunityToolkit.Uwp.Lottie"
37+
...
38+
<muxc:AnimatedVisualPlayer>
39+
<lottie:LottieVisualSource UriSource="<asset path or web link to a json file>" />
40+
</muxc:AnimatedVisualPlayer>
41+
```
42+
**Option #2, using codegen (recommended)**
43+
1. Install codegen tool using `dotnet tool install lottiegen` in powershell
44+
2. Run codegen tool `lottiegen -InputFile MyAnimation.json -Language cs -WinUIVersion 3`
45+
- For UWP projects use `-WinUIVersion 2.X` depending on the version of `Microsoft.UI.Xaml`
46+
- Other language options: `cppwinrt` and `cppcx`
47+
3. Add generated source files to the project
48+
4. Install packages from step 2 of Option #1 if needed.
49+
5. In your `.xaml` markup file add:
50+
```xml
51+
...
52+
xmlns:animatedvisuals="using:AnimatedVisuals"
53+
...
54+
<AnimatedVisualPlayer>
55+
<animatedvisuals:MyAnimation/>
56+
</AnimatedVisualPlayer>
57+
```
58+
or for UWP project:
59+
```xml
60+
...
61+
xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
62+
xmlns:animatedvisuals="using:AnimatedVisuals"
63+
...
64+
<muxc:AnimatedVisualPlayer>
65+
<animatedvisuals:MyAnimation/>
66+
</muxc:AnimatedVisualPlayer>
67+
```
68+
1669
## <a name="supported"></a> Supported SDKs
1770
* May 2019 Update (18362) and later
1871

19-
## <a name="documentation"></a> Getting Started
72+
## <a name="documentation"></a> Documentation
2073
* [Documentation and Tutorials](https://aka.ms/lottiedocs)
2174
* [Lottie Samples](https://aka.ms/lottiesamples)
2275
* [Lottie Viewer](https://aka.ms/lottieviewer)
2376

2477
## Build Status
25-
| Target | Branch | Status | Recommended NuGet package |
78+
| Package | Branch | Status | Latest nuget version |
2679
| ------ | ------ | ------ | ------ |
27-
| 7.1.0 release | main | [![Build Status](https://dev.azure.com/dotnet/WindowsCommunityToolkit/_apis/build/status/Microsoft.Toolkit.Uwp.UI.Lottie?branchName=main)](https://dev.azure.com/dotnet/WindowsCommunityToolkit/_build/latest?definitionId=61&branchName=main) | [![NuGet](https://img.shields.io/nuget/v/Microsoft.Toolkit.Uwp.UI.Lottie.svg)](https://www.nuget.org/packages/Microsoft.Toolkit.Uwp.UI.Lottie/) |
80+
| CommunityToolkit.WinUI.Lottie | main | [![Build Status](https://dev.azure.com/dotnet/WindowsCommunityToolkit/_apis/build/status/Microsoft.Toolkit.Uwp.UI.Lottie?branchName=main)](https://dev.azure.com/dotnet/WindowsCommunityToolkit/_build/latest?definitionId=61&branchName=main) | [![NuGet](https://img.shields.io/nuget/v/CommunityToolkit.WinUI.Lottie.svg)](https://www.nuget.org/packages/CommunityToolkit.WinUI.Lottie/) |
81+
| CommunityToolkit.Uwp.Lottie | main | [![Build Status](https://dev.azure.com/dotnet/WindowsCommunityToolkit/_apis/build/status/Microsoft.Toolkit.Uwp.UI.Lottie?branchName=main)](https://dev.azure.com/dotnet/WindowsCommunityToolkit/_build/latest?definitionId=61&branchName=main) | [![NuGet](https://img.shields.io/nuget/v/CommunityToolkit.Uwp.Lottie.svg)](https://www.nuget.org/packages/CommunityToolkit.Uwp.Lottie/) |
82+
| LottieGen | main | [![Build Status](https://dev.azure.com/dotnet/WindowsCommunityToolkit/_apis/build/status/Microsoft.Toolkit.Uwp.UI.Lottie?branchName=main)](https://dev.azure.com/dotnet/WindowsCommunityToolkit/_build/latest?definitionId=61&branchName=main) | [![NuGet](https://img.shields.io/nuget/v/LottieGen.svg)](https://www.nuget.org/packages/LottieGen/) |
83+
84+
2885

2986
## Feedback and Requests
3087
Please use [GitHub Issues](https://github.com/windows-toolkit/Lottie-Windows/issues) for bug reports and feature requests.

0 commit comments

Comments
 (0)